static void * varprint(const char *name, CexpSym s, void *arg) { FILE *f=stdout; cexp_regex *rc=arg; if (cexp_regexec(rc,name)) { cexpSymPrintInfo(s,f); } return 0; }
/* a semi-public routine which takes a precompiled regexp. * The reason this is not public is that we try to keep * the public from having to deal with/know about the regexp * implementation, i.e. which variant, which headers etc. */ CexpSym _cexpSymTblLookupRegex(cexp_regex *rc, int *pmax, CexpSym s, FILE *f, CexpSymTbl t) { CexpSym found=0; int max=24; if (!pmax) pmax=&max; if (!s) s=t->syms; while (s->name && *pmax) { if (cexp_regexec(rc,s->name)) { if (f) cexpSymPrintInfo(s,f); (*pmax)--; found=s; } s++; } return s->name ? found : 0; }