. \" Manual Seite fuer breakline
. \" @(#)breakline.3 1.2 20/02/09 Copyright 1988,2020 J. Schilling
. \"
BREAKLINE 3 "2020/02/09" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS"
NAME
breakline() - breaks a buffer into fields
SYNOPSIS
int breakline(buf, delim, array, max) char *buf; char delim; char *array[]; int max;
DESCRIPTION
breakline() breaks the buffer buf into fields delimited by the
character delim, replacing the occurrences of delim in buf with
the NULL character ('\\0'). It fills in the array with pointers
to the beginning of each field in the buffer. max defines how
many entries to fill in the array. If there are not enough
fields in buf, the extra entries in the array will point to an
empty string.
RETURNS
Returns the number of fields actually in the buffer, but not
more than max.
EXAMPLES
char *buf = "a:bc:d:efg"; char *array[10]; breakline(buf, ':', array, 10); now the `:' are replaced by '\\0' and: array[0] = "a"; array[1] = "bc"; array[2] = "d" array[3] = "efg"; array[4] .\|.\|. array[9] = "";
"SEE ALSO"
findline(3)
NOTES
none