summaryrefslogtreecommitdiff
path: root/static/v10/man3/getfields.3
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
commit97d5c458cfa039d857301e1ca7d5af3beb37131d (patch)
treeb460cd850d0537eb71806ba30358840377b27688 /static/v10/man3/getfields.3
parentb89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff)
build: Better Build System
Diffstat (limited to 'static/v10/man3/getfields.3')
-rw-r--r--static/v10/man3/getfields.374
1 files changed, 0 insertions, 74 deletions
diff --git a/static/v10/man3/getfields.3 b/static/v10/man3/getfields.3
deleted file mode 100644
index 2f0b90ce..00000000
--- a/static/v10/man3/getfields.3
+++ /dev/null
@@ -1,74 +0,0 @@
-.TH GETFIELDS 3
-.CT 2 data_man
-.SH NAME
-getfields, getmfields, setfields \(mi break a string into fields
-.SH SYNOPSIS
-.nf
-.B int getfields(str, ptrs, nptrs)
-.B char *str, **ptrs;
-.PP
-.B int getmfields(str, ptrs, nptrs)
-.B char *str, **ptrs;
-.PP
-.B void setfields(fielddelim)
-.B char *fielddelim;
-.fi
-.SH DESCRIPTION
-.I Getfields
-breaks the null-terminated string
-.I str
-into at most
-.I nptrs
-null-terminated fields and places pointers to the start of these fields in the array
-.IR ptrs .
-It returns the number of fields
-and terminates the list of pointers with a zero pointer.
-It overwrites some of the bytes in
-.IR str .
-If there are
-.I nptr
-or more fields, the list will not end with zero
-and the last `field' will extend to the end of the
-input string and may contain delimiters.
-.PP
-A field is defined as a maximal sequence of characters not in a set
-of field delimiters.
-Adjacent fields are separated by exactly one delimiter.
-No field follows a delimiter at the end of string.
-Thus a string of just two delimiter characters
-contains two empty fields,
-and a nonempty string with no delimiters contains
-one field.
-.PP
-.I Getmfields
-is the same as
-.I getfields
-except that fields are separated by maximal strings of
-field delimiters rather than just one.
-.PP
-.I Setfields
-makes the field delimiters (space and tab by default)
-be the characters of the string
-.I fielddelim.
-.SH EXAMPLES
-Print the words in a string, where words are non-whitespace
-strings.
-There is no bound on the number of words.
-.EX
-printwords(string)
-char *string;
-{
- char *ptrs[2];
- int n;
- setfields(" \et\en");
- for(n=2; n>=2; string=ptrs[1]) {
- n = getmfields(string, ptrs, 2);
- if(n == 0)
- break;
- if(ptrs[0][0] != 0) /* skip initial blanks */
- printf("%s\en", ptrs[0]);
- }
-}
-.EE
-.SH SEE ALSO
-.IR string (3)