parse.c
/* the return value is the number of characters in string up to
   and not including the char */
the return value is the number of characters in string up to
and not including the char
the return value is the number of characters in string up to and not including the char
long scan_char(unsigned char *input, long len, long *offset, unsigned char ch,
	       long *str, long *str_len)
{
   int i;
   if (*offset == len) {
      *str = -1;
      *str_len = 0;
      return(0);
   } 
   for (i=*offset; i<len; i++)
      if (input[i] == ch)
	 break;
   if (i == len) {
      *str = -1;
      *str_len = 0;
      return(i-*offset);
   }
   i++;
   *str = *offset;
   *str_len = i-*offset;
   *offset = i;
   return(*str_len - 1);
}
long scan_char ( unsigned char * input , long len , long * offset , unsigned char ch , long * str , long * str_len ) { int i ; if ( * offset == len ) { * str = -1 ; * str_len = 0 ; return ( 0 ) ; } for ( i = * offset ; i < len ; i ++ ) if ( input [ i ] == ch ) break ; if ( i == len ) { * str = -1 ; * str_len = 0 ; return ( i - * offset ) ; } i ++ ; * str = * offset ; * str_len = i - * offset ; * offset = i ; return ( * str_len - 1 ) ; }
the return value is the number of characters in string up to
and not including the char
the return value is the number of characters in string up to and not including the char
/* end of input reached before ch.  don't return a string
	 or move the pointer, but return the number of chars seen */