int main(int argc, char *argv[]) { int x; char buf[256]; const char *s; struct pmllex *lex; struct pmll_val v; lex = pmll_alloc(); if (lex == NULL) errsys("pmll_new():"); if (pmll_add_infile(lex, stdin, 0, "stdin") < 0) errsys("pmll_add_input_file():"); while ( (x = pmll_nexttok(lex, &v)) > 0 ) { printf("%-15s'%s'", pml_tok_strs[x], pmll_get_text(lex)); s = strof(&v, x, buf, sizeof(buf)); if (s != NULL) printf(" -- '%s'\n", s); else printf("\n"); pmllv_clear(&v); } if ( x < 0 ) { printf("unknown token on line: %lu\n", pmll_get_lineno(lex)); printf("\t%s\n", pmll_get_err(lex)); } else { printf("End of file\n"); } pmll_free(lex); return 0; }
#include <stdlib.h> #include <unistd.h> #include <stdio.h> #include <signal.h> #include <sys/types.h> #include <ctype.h> #include <string.h> #include <sys/stat.h> #include <errno.h> #include "libcitadel.h" #include "xdgmime/xdgmime.h" #include "libcitadellocal.h" ConstStr RoomNetCfgStrs[maxRoomNetCfg] = { {HKEY(strof(subpending))}, {HKEY(strof(unsubpending))}, {HKEY(strof(lastsent))}, /* Server internal use only */ {HKEY(strof(ignet_push_share))}, {HKEY(strof(listrecp))}, {HKEY(strof(digestrecp))}, {HKEY(strof(pop3client))}, {HKEY(strof(rssclient))}, {HKEY(strof(participate))} // No, not one of.. {HKEY(strof(maxRoomNetCfg))} }; extern int EnableSplice; extern int BaseStrBufSize;