0
..
..
.L tokscan scans the string .L string for tokens specified in .LR format . It is a more forgiving sscanf (3). If .L "next != 0" then it will point to the next unread character in .L string on return. The number of scanned tokens is returned. .L -1 is returned if .L string was not empty and .L format failed to match and tokens.
space in .L format matches 0 or more space or tab characters. newline in format eats the remainder of the current line in .LR string . "...", '...' and \echaracter quotes are interpreted. A quoted carriage-return is converted to newline . newline in .L string is equivalent to end of string except when quoted. \enewline is a line splice.
.L % in .L format prefixes format conversion characters; each conversion character corresponds to a .L tokscan argument following the .L format argument. The format conversions are:
.L %c A single .LR char .
.L "%hd %d %ld" [short, int, long] base 10 integer.
.L "%hn %n %ln" [short, int, long] C-style base integer.
.L "%ho %o %lo" [short, int, long] base 8 integer.
.L %s String.
.L "%hu %u %lu" [short, int, long] C-style base unsigned integer.
.L %v The next two arguments are a pointer to a .L char** argument vector and the maximum number of elements in the vector.
.L "%hx %x %lx" [short, int, long] base 16 integer.
.L %s and .L %v data may also be counted length strings of the form \f5(count:data) where count is the number of characters in data and the terminating .L ) may also be a tab , or the data may be .L (null) which represents the .L NULL string.
.L tokline returns an sfio (3) stream to a file or string that splices \enewline into single lines, allows "..." and '...' to quotes to span newlines (done by translating quoted newline to carriage-return ; .L tokscan above converts quoted carriage-return back to newline ), and deletes "# ... newline" comments. This is done by pushing an sfio discipline onto a string or file stream. Seeks are disabled on the resulting stream. If .L "flags == SF_READ" then .L input is a file name; If .L "flags == SF_STRING" then .L input is a 0 terminated string; otherwise .L input is an open .L Sfio_t* stream. If .L "line != 0" then it points to a line count that is initialized to 0 and is incremented for each input line.