/* c-args -- template for a c main, with simple args parser */ /* $Id: c-args,v 1.2 1999/03/14 16:21:01 cdua Exp cdua $ */ /* Carlos Duarte , 990302 */ /* * how to use this: * * USAGE(): change to give a typical usage message * options: add field to contain args data * switch: add case entries to catch args * * edit after "USER CODE" to do something with other args (non options) * */ #include #include #include static int do_args(int first, int ac, char *av[]); #define ARG() \ s[1] ? (t=s+1, s+=strlen(s)-1, t) : ++i