src/k_strparse.c
void k_strparse(char *str,
								char *signal,
								int *nwrd,
								char ***wrd)
{
	int i,istr,iword,len;

	/* count words and allocate memory */

	(*nwrd)=0;
	istr=0;
	len=strlen(str);
	while(istr<len) {
		while((strchr(signal,str[istr])) && istr<len) istr++;
		if(istr>=len) break;
		iword=0;
		while((!strchr(signal,str[istr])) && istr<len) {
			istr++;
			iword++;
		} /* end while */
		(*nwrd)++;
	} /* end while */

	if((*nwrd)==0) return;

	/* allocate words */
	(*wrd)=k_cmatrix((*nwrd),STRMAX+1);

	i=0;
	istr=0;
	iword=0;
	len=strlen(str);
	while(istr<len) {
		while((strchr(signal,str[istr])) && istr<len) istr++;
		if(istr>=len) break;
		iword=0;
		while((!strchr(signal,str[istr])) && istr<len) {
			(*wrd)[i][iword]=str[istr];
			iword++;
			istr++;
		} /* end while */
		(*wrd)[i][iword]='\0';
		i++;
	} /* end wHile */
}
/*
 * strparse()
 *
 * Parse a string into separate words.  Do allocate 
 * the wrd array. Use the characters in the string
 * signal as the delimiting characters. 
 *
 * CRK 6/2/94
 *
 */
strparse()
Parse a string into separate words.  Do allocate
the wrd array. Use the characters in the string
signal as the delimiting characters.


strparse () Parse a string into separate words . Do allocate the wrd array . Use the characters in the string signal as the delimiting characters .
void k_strparse(char *str,
								char *signal,
								int *nwrd,
								char ***wrd)
{
	int i,istr,iword,len;
	(*nwrd)=0;
	istr=0;
	len=strlen(str);
	while(istr<len) {
		while((strchr(signal,str[istr])) && istr<len) istr++;
		if(istr>=len) break;
		iword=0;
		while((!strchr(signal,str[istr])) && istr<len) {
			istr++;
			iword++;
		} 
		(*nwrd)++;
	} 
	if((*nwrd)==0) return;
	(*wrd)=k_cmatrix((*nwrd),STRMAX+1);
	i=0;
	istr=0;
	iword=0;
	len=strlen(str);
	while(istr<len) {
		while((strchr(signal,str[istr])) && istr<len) istr++;
		if(istr>=len) break;
		iword=0;
		while((!strchr(signal,str[istr])) && istr<len) {
			(*wrd)[i][iword]=str[istr];
			iword++;
			istr++;
		} 
		(*wrd)[i][iword]='\0';
		i++;
	} 
}
void k_strparse ( char * str , char * signal , int * nwrd , char * * * wrd ) { int i , istr , iword , len ; ( * nwrd ) = 0 ; istr = 0 ; len = strlen ( str ) ; while ( istr < len ) { while ( ( strchr ( signal , str [ istr ] ) ) & & istr < len ) istr ++ ; if ( istr >= len ) break ; iword = 0 ; while ( ( ! strchr ( signal , str [ istr ] ) ) && istr < len ) { istr ++ ; iword ++ ; } ( * nwrd ) ++ ; } if ( ( * nwrd ) == 0 ) return ; ( * wrd ) = k_cmatrix ( ( * nwrd ) , STRMAX + 1 ) ; i = 0 ; istr = 0 ; iword = 0 ; len = strlen ( str ) ; while ( istr < len ) { while ( ( strchr ( signal , str [ istr ] ) ) & & istr < len ) istr ++ ; if ( istr >= len ) break ; iword = 0 ; while ( ( ! strchr ( signal , str [ istr ] ) ) && istr < len ) { ( * wrd ) [ i ] [ iword ] = str [ istr ] ; iword ++ ; istr ++ ; } ( * wrd ) [ i ] [ iword ] = ' \0 ' ; i ++ ; } }
strparse()
 Parse a string into separate words.
strparse () Parse a string into separate words .
/* count words and allocate memory */ /* end while */ /* end while */ /* allocate words */ /* end while */ /* end wHile */