split buffer into fields
cc [flag . . . ] file . . . -lgen [library] . . .
size_t bufsplit(char *buf, size_t n, char **a);
bufsplit examines the buffer, buf, and assigns values to
the pointer array, a, so that the pointers point to the first
fields in buf that are delimited by tabs or new-lines.
To change the characters used to separate fields, call
pointing to the string of characters, and
set to zero.
For example, to use ':', '.', and ',' as
separators along with tab and new-line:
bufsplit(":.,\t\n", 0, (char**)0);
The number of fields assigned in the array
is zero, the return value is zero and the array is unchanged.
Otherwise the value is at least one.
The remainder of the elements in the array are assigned the address
of the null byte at the end of the buffer.
* set a = "This", a = "is", a = "a",
* a = "test"
bufsplit("This\tis\ta\ttest\n", 4, a);
bufsplit changes the delimiters to null bytes in
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004