model_server/style/src/styStyle.cxx
// The following routine is like "strtok" from the standard C library
// except that it allows for empty tokens and always assumes a delimiter
// of ",".
The following routine is like "strtok" from the standard C library
except that it allows for empty tokens and always assumes a delimiter
of ",".
The following routine is like " strtok " from the standard C library except that it allows for empty tokens and always assumes a delimiter of " " .
char* steStyle::gettok(char* start) {
   Initialize(gettok);
   static char* lasttime = NULL;
   char* tok = (start) ? start : lasttime;
   if (tok) {
      if (*tok) {
	 char *p;
         for (p = tok; *p && *p != ','; p++)
            ;
         if (*p)
            *p++ = 0;
         lasttime = p;
      }
      else lasttime = tok = NULL;
   }
   return (tok);
}
char * steStyle :: gettok ( char * start ) { Initialize ( gettok ) ; static char * lasttime = NULL ; char * tok = ( start ) ? start : lasttime ; if ( tok ) { if ( * tok ) { char * p ; for ( p = tok ; * p && * p != ' ' ; p ++ ) ; if ( * p ) * p ++ = 0 ; lasttime = p ; } else lasttime = tok = NULL ; } return ( tok ) ; }
The following routine is like "strtok" from the standard C library
except that it allows for empty tokens and always assumes a delimiter
of ",".
The following routine is like " strtok " from the standard C library except that it allows for empty tokens and always assumes a delimiter of " " .