#include "def.h" void trimnl(char *p) { if ((p = strchr(p, '\n')) != 0) *p = '\0'; } int prefix(char *t, char *s) { int c; while ((c = *t++) != 0) if (c != *s++) return 0; return 1; } char *mindex(char *s, int c) { return c==0? 0: strchr(s, c); }