home *** CD-ROM | disk | FTP | other *** search
-
- STRSEP(3) UNIX Programmer's Manual STRSEP(3)
-
- NNAAMMEE
- ssttrrsseepp - separate strings
-
- SSYYNNOOPPSSIISS
- ##iinncclluuddee <<ssttrriinngg..hh>>
-
- _c_h_a_r _*
- ssttrrsseepp(_c_h_a_r _*_*_s_t_r_i_n_g_p, _c_h_a_r _*_d_e_l_i_m)
-
- DDEESSCCRRIIPPTTIIOONN
- The ssttrrsseepp() locates in the nullterminated string at _*_s_t_r_i_n_g_p the first
- occurence of any character in _d_e_l_i_m and replaces this with a `\0',
- records the location of the immediate following character in _*_s_t_r_i_n_g_p,
- then returns the original value of _*_s_t_r_i_n_g_p. If no delimiter characters
- are found, ssttrrsseepp() sets _*_s_t_r_i_n_g_p to NULL; if _*_s_t_r_i_n_g_p is initially NULL,
- ssttrrsseepp() returns NULL.
-
- EEXXAAMMPPLLEESS
- The following uses ssttrrsseepp() to parse strings containing runs of white
- space, making up an argument vector:
-
- char inputstring[100];
- char **argv[51], **ap = argv, *p, *val;
- /* set up inputstring */
- for (p = inputstring; p != NULL; ) {
- while ((val = strsep(&p, " \t")) != NULL && *val == '\0');
- *ap++ = val;
- }
- *ap = 0;
-
- HHIISSTTOORRYY
- The ssttrrsseepp() function is currently under development.
-
- BSD Experimental April 19, 1991 1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-