#ident "$URL: svn://elmer/devel/SVN/SDDAS/trunk/libant/TokLine.c $ %D% SwRI" /* TokLine.c */ #include /* for malloc,etc. */ #include /* for strtok,etc. */ /* TokLine */ void * TokLine( char *line, char *separators) { #define ARGSET 30 char *arg; char **args = (char **)malloc(ARGSET*sizeof(char *)); int n=0; args[n++] = strtok(line,separators); while ((arg=strtok(NULL,separators))) args[n++] = arg; args[n] = 0; return args; } /* TokLineEasy -- strtok line using default separators */ void * TokLineEasy( char *line) { return TokLine(line," \t"); }