2 Copyright © 2004-2012, The AROS Development Team. All rights reserved.
8 /*****************************************************************************
20 Separates a string by the characters in sep.
23 str - The string to check or NULL if the next word in
24 the last string is to be searched.
25 sep - Characters which separate "words" in str.
28 The first word in str or the next one if str is NULL.
31 The function changes str !
37 strcpy (buffer, "Hello, this is a test.");
40 // First word. Returns "Hello"
41 strtok (bufptr, " \t,.");
43 // Next word. Returns "this"
44 strtok (bufptr, " \t,.");
46 // Next word. Returns "is"
47 strtok (bufptr, " \t");
49 // Next word. Returns "a"
50 strtok (bufptr, " \t");
52 // Next word. Returns "test."
53 strtok (bufptr, " \t");
55 // Next word. Returns NULL.
56 strtok (bufptr, " \t");
64 ******************************************************************************/
71 *strptr
+= strspn (*strptr
, sep
);
81 *strptr
+= strcspn (*strptr
, sep
);