2 Copyright © 2004, The AROS Development Team. All rights reserved.
10 /*****************************************************************************
22 Separates a string by the characters in sep.
25 str - The string to check or NULL if the next word in
26 the last string is to be searched.
27 sep - Characters which separate "words" in str.
30 The first word in str or the next one if str is NULL.
33 The function changes str !
39 strcpy (buffer, "Hello, this is a test.");
42 // First word. Returns "Hello"
43 strtok (bufptr, " \t,.");
45 // Next word. Returns "this"
46 strtok (bufptr, " \t,.");
48 // Next word. Returns "is"
49 strtok (bufptr, " \t");
51 // Next word. Returns "a"
52 strtok (bufptr, " \t");
54 // Next word. Returns "test."
55 strtok (bufptr, " \t");
57 // Next word. Returns NULL.
58 strtok (bufptr, " \t");
66 ******************************************************************************/
73 *strptr
+= strspn (*strptr
, sep
);
83 *strptr
+= strcspn (*strptr
, sep
);