3 .ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
4 .if !
\a\\$4
\a\a .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
7 .ie
\a\\$3
\a\a .ft \\$1
11 .Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
16 .aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
19 .aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
22 .aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
24 .de EX \" start example
41 tok \- space separated token stream routines
45 .L "void* tokopen(char* string)"
46 .L "char* tokread(void* tok)"
47 .L "void tokclose(void* tok)"
49 .L "int tokscan(char* string, char** next, const char* format, ...);"
51 .L "Sfio_t* tokline(const char* input, int flags, int* line);"
54 returns a pointer to a space separated token stream on the 0 terminated
58 returns a pointer to the next
59 space separated token in the token stream
63 0 is returned when no tokens remain.
67 by inserting 0's to terminate each token.
69 closes the token stream and restores
71 to its original state.
76 for tokens specified in
78 It is a more forgiving
82 then it will point to the next unread character in
85 The number of scanned tokens is returned.
91 failed to match and tokens.
102 in format eats the remainder of the current line in
104 "...", '...' and \e\fIcharacter\fP quotes are interpreted.
112 is equivalent to end of string except when quoted.
119 prefixes format conversion characters; each conversion character
122 argument following the
125 The format conversions are:
132 [short, int, long] base 10 integer.
135 [short, int, long] C-style base integer.
138 [short, int, long] base 8 integer.
144 [short, int, long] C-style base unsigned integer.
147 The next two arguments are a pointer to a
149 argument vector and the maximum number of elements in the vector.
152 [short, int, long] base 16 integer.
157 data may also be counted length strings of the form
158 \f5(\fIcount\fP:\fIdata\fP)\fR
161 is the number of characters in
176 stream to a file or string that splices
179 allows "..." and '...' to quotes to span
181 (done by translating quoted
184 .IR carriage-return ;
186 above converts quoted
193 This is done by pushing an
195 discipline onto a string or file stream.
196 Seeks are disabled on the resulting stream.
198 .L "flags == SF_READ"
203 .L "flags == SF_STRING"
206 is a 0 terminated string;
214 then it points to a line count that is initialized to 0
215 and is incremented for each input line.