From 78e51a8c6678b6e3dff3d619aa786669f531f4bc Mon Sep 17 00:00:00 2001 From: rsc Date: Fri, 14 Jan 2005 03:45:44 +0000 Subject: checkpoint --- man/man3/getfields.html | 136 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 man/man3/getfields.html (limited to 'man/man3/getfields.html') diff --git a/man/man3/getfields.html b/man/man3/getfields.html new file mode 100644 index 00000000..7c1d8f64 --- /dev/null +++ b/man/man3/getfields.html @@ -0,0 +1,136 @@ + +getfields(3) - Plan 9 from User Space + + + + +
+
+
GETFIELDS(3)GETFIELDS(3) +
+
+

NAME
+ +
+ + getfields, gettokens, tokenize – break a string into fields
+ +
+

SYNOPSIS
+ +
+ + #include <u.h>
+ #include <libc.h> +
+
+ int     getfields(char *str, char **args, int maxargs, int multiflag,
+ +
+ + +
+ + char *delims) +
+ +
+ +
+
+
+ + +
+ + + +
+ +
+ int     gettokens(char *str, char **args, int maxargs, char *delims) + +
+
+ int     tokenize(char *str, char **args, int maxargs)
+
+
+

DESCRIPTION
+ +
+ + Getfields places into the array args pointers to the first maxargs + fields of the null terminated UTF string str. Delimiters between + these fields are set to null. +
+ + Fields are substrings of str whose definition depends on the value + of multiflag. If multiflag is zero, adjacent fields are separated + by exactly one delimiter. For example
+ +
+ + +
+ + getfields("#alice#bob##charles###", arg, 3, 0, "#");
+
+
+ +
+ yields three substrings: null-string , alice, and bob##charles###. + If the multiflag argument is not zero, a field is a non-empty + string of non-delimiters. For example
+ +
+ + +
+ + getfields("#alice#bob##charles###", arg, 3, 1, "#");
+
+
+ +
+ yields the three substrings: alice, bob, and charles###. +
+ + Getfields returns the number of fields pointed to. +
+ + Gettokens is the same as getfields with multiflag non-zero, except + that fields may be quoted using single quotes, in the manner of + rc(1). See quote(3) for related quote-handling software. +
+ + Tokenize is gettokens with delims set to "\t\r\n ".
+ +
+

SOURCE
+ +
+ + /usr/local/plan9/src/lib9/tokenize.c
+
+
+

SEE ALSO
+ +
+ + strtok in strcat(3), quote(3).
+ +
+ +

+
+
+ + +
+
+
+Space Glenda +
+
+ + -- cgit v1.2.3