Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ bufsplit(3G) — svr4 — mips UMIPS RISC/os 5.01

Media Vault

Software Library

Restoration Projects

Artifacts Sought



BUFSPLIT(3G-SVR4)   RISC/os Reference Manual    BUFSPLIT(3G-SVR4)



NAME
     bufsplit - split buffer into fields

SYNOPSIS
     cc [flag ...] file ...  -lgen [library ...]

     #include <libgen.h>

     sizet bufsplit (char *buf, sizet n, char **a);

DESCRIPTION
     bufsplit examines the buffer, buf, and assigns values to the
     pointer array, a, so that the pointers point to the first n
     fields in buf that are delimited by tabs or new-lines.

     To change the characters used to separate fields, call bufs-
     plit with buf pointing to the string of characters, and n
     and a set to zero.  For example, to use colon, period and
     comma as separators along with tab and new-line:

          bufsplit (":.,\t\n", 0, (char**)0 );

RETURN VALUE
     The number of fields assigned in the array a.  If buf is
     zero, the return value is zero and the array is unchanged.
     Otherwise the value is at least one.  The remainder of the
     elements in the array are assigned the address of the null
     byte at the end of the buffer.

EXAMPLES
     /*
      * set a[0] = "This", a[1] = "is", a[2] = "a",
      * a[3] = "test"
      */
     bufsplit("This\tis\ta\ttest\n", 4, a);

NOTES
     bufsplit changes the delimiters to null bytes in buf.

















                        Printed 11/19/92                   Page 1



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026