FreeBSD/contrib/ntp/ntpdc/ntpdc.c
/*
 * tokenize - turn a command line into tokens
 */
turn a command line into tokens
turn a command line into tokens
static void
tokenize(
	const char *line,
	char **tokens,
	int *ntok
	)
{
	register const char *cp;
	register char *sp;
	static char tspace[MAXLINE];
	sp = tspace;
	cp = line;
	for (*ntok = 0; *ntok < MAXTOKENS; (*ntok)++) {
		tokens[*ntok] = sp;
		while (ISSPACE(*cp))
		    cp++;
		if (ISEOL(*cp))
		    break;
		do {
			*sp++ = *cp++;
		} while (!ISSPACE(*cp) && !ISEOL(*cp));
		*sp++ = '\0';
	}
}
static void tokenize ( const char * line , char * * tokens , int * ntok ) { register const char * cp ; register char * sp ; static char tspace [ MAXLINE ] ; sp = tspace ; cp = line ; for ( * ntok = 0 ; * ntok < MAXTOKENS ; ( * ntok ) ++ ) { tokens [ * ntok ] = sp ; while ( ISSPACE ( * cp ) ) cp ++ ; if ( ISEOL ( * cp ) ) break ; do { * sp ++ = * cp ++ ; } while ( ! ISSPACE ( * cp ) && ! ISEOL ( * cp ) ) ; * sp ++ = ' \0 ' ; } }
tokenize - turn a command line into tokens
tokenize - turn a command line into tokens