1: #include <stdio.h>
   2: 
   3: 
   4: /*******
   5:  *	getargs(s, arps)
   6:  *	char *s, *arps[];
   7:  *
   8:  *	getargs  -  this routine will generate a vector of
   9:  *	pointers (arps) to the substrings in string "s".
  10:  *	Each substring is separated by blanks and/or tabs.
  11:  *
  12:  *	return - the number of subfields.
  13:  */
  14: 
  15: getargs(s, arps)
  16: char *s, *arps[];
  17: {
  18:     int i;
  19: 
  20:     i = 0;
  21:     while (1) {
  22:         arps[i] = NULL;
  23:         while (*s == ' ' || *s == '\t')
  24:             *s++ = '\0';
  25:         if (*s == '\n')
  26:             *s = '\0';
  27:         if (*s == '\0')
  28:             break;
  29:         arps[i++] = s++;
  30:         while (*s != '\0' && *s != ' '
  31:             && *s != '\t' && *s != '\n')
  32:                 s++;
  33:     }
  34:     return(i);
  35: }

Defined functions

Last modified: 1979-01-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 498
Valid CSS Valid XHTML 1.0 Strict