TOK(3ast)

NAME
tok - space separated token stream routines

SYNOPSIS

DESCRIPTION
returns a pointer to a space separated token stream on the 0 terminated string returns a pointer to the next space separated token in the token stream as returned by 0 is returned when no tokens remain. temporarily modifies by inserting 0's to terminate each token. closes the token stream and restores to its original state.

scans the string for tokens specified in It is a more forgiving sscanf(3). If then it will point to the next unread character in on return. The number of scanned tokens is returned. is returned if was not empty and failed to match and tokens.

space in matches 0 or more space or tab characters. newline in format eats the remainder of the current line in "...", '...' and \character quotes are interpreted. A quoted carriage-return is converted to newline. newline in is equivalent to end of string except when quoted. \newline is a line splice.

in prefixes format conversion characters; each conversion character corresponds to a argument following the argument. The format conversions are:

A single

[short, int, long] base 10 integer.

[short, int, long] C-style base integer.

[short, int, long] base 8 integer.

String.

[short, int, long] C-style base unsigned integer.

The next two arguments are a pointer to a
    argument vector and the maximum number of elements in the vector.

[short, int, long] base 16 integer.

and data may also be counted length strings of the form (count:data) where count is the number of characters in data and the terminating may also be a tab, or the data may be which represents the string.

returns an sfio(3) stream to a file or string that splices \newline into single lines, allows "..." and '...' to quotes to span newlines (done by translating quoted newline to carriage-return; 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 then is a file name; If then is a 0 terminated string; otherwise is an open stream. If then it points to a line count that is initialized to 0 and is incremented for each input line.

SEE ALSO
sfio(3)