home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / ixemul-39.47-env-bin.lha / man / cat3 / strsep.0 < prev    next >
Text File  |  1993-12-07  |  2KB  |  67 lines

  1.  
  2. STRSEP(3)                  UNIX Programmer's Manual                  STRSEP(3)
  3.  
  4. NNAAMMEE
  5.      ssttrrsseepp - separate strings
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ssttrriinngg..hh>>
  9.  
  10.      _c_h_a_r _*
  11.      ssttrrsseepp(_c_h_a_r _*_*_s_t_r_i_n_g_p, _c_h_a_r _*_d_e_l_i_m)
  12.  
  13. DDEESSCCRRIIPPTTIIOONN
  14.      The ssttrrsseepp() locates in the null­terminated string at _*_s_t_r_i_n_g_p the first
  15.      occurence of any character in _d_e_l_i_m and replaces this with a `\0',
  16.      records the location of the immediate following character in _*_s_t_r_i_n_g_p,
  17.      then returns the original value of _*_s_t_r_i_n_g_p. If no delimiter characters
  18.      are found, ssttrrsseepp() sets _*_s_t_r_i_n_g_p to NULL; if _*_s_t_r_i_n_g_p is initially NULL,
  19.      ssttrrsseepp() returns NULL.
  20.  
  21. EEXXAAMMPPLLEESS
  22.      The following uses ssttrrsseepp() to parse strings containing runs of white
  23.      space, making up an argument vector:
  24.  
  25.            char inputstring[100];
  26.            char **argv[51], **ap = argv, *p, *val;
  27.            /* set up inputstring */
  28.            for (p = inputstring; p != NULL; ) {
  29.                    while ((val = strsep(&p, " \t")) != NULL && *val == '\0');
  30.                    *ap++ = val;
  31.            }
  32.            *ap = 0;
  33.  
  34. HHIISSTTOORRYY
  35.      The ssttrrsseepp() function is currently under development.
  36.  
  37. BSD Experimental                April 19, 1991                               1
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.