[net.unix] string.h unknowns

roma@uiucuxc.CSO.UIUC.EDU (08/21/86)

The following is excerpted from the UNIX System V programmer's reference
manual:

#include <string.h>

char *strpbrk (s1, s2)
char *s1, *s2;

int *strspn (s1, s2)
char *s1, *s2;

int *strcspn (s1, s2)
char *s1, *s2;

char *strtok (s1, s2)
char *s1, *s2;

Strpbrk returns a pointer to the first occurrence in string s1 of any character
from string s2, or a NULL pointer if no character from s2 exists in s1.

Strspn (strcspn) returns the length of the initial segment of string s1 which
which consists entirely of characters from (not from) string s2.

Strtok considers the string s1 to consist of a sequence of zero or more text
tokens separated by spans of one or more characters from the separator string
s2.  The first call (with pointer s1 specified) returns a pointer to the first
character of the first token, and will have written a null character into s1
immediately following the returned token.  The function keeps track of its
position in the string between separate calls, so that subsequent calls 
(which must be made with the first argument a NULL pointer) will work through
the string s1 immediately following that token.  In this way subsequent calls
will work through the string s1 until no tokens remain.  The separator string
s2 may be different from call to call.  When no token remains in s1, a NULL
pointer is returned.

I couldn't find the strdup function.

Jon Roma
Computing Services Office, University of Illinois at Urbana-Champaign

ARPANET: roma%uiucuxc@a.cs.uiuc.edu
CSNET:	 roma%uiucuxc@uiuc.csnet
UUCP:	 {ihnp4,pur-ee,convex}!uiucdcs!uiucuxc!roma