*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> bufsplit (3g)              
Title
Content
Arch
Section
 

Contents


bufsplit(3G)							  bufsplit(3G)


NAME    [Toc]    [Back]

     bufsplit -	split buffer into fields

SYNOPSIS    [Toc]    [Back]

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

     #include <libgen.h>

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

DESCRIPTION    [Toc]    [Back]

     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 bufsplit with buf
     pointing to the string of characters, and n and a set to zero.  For
     example, to use ':', '.', and ',' as separators along with	tab and	newline:


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

RETURN VALUE    [Toc]    [Back]

     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    [Toc]    [Back]

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

NOTES    [Toc]    [Back]

     bufsplit changes the delimiters to	null bytes in buf.


									PPPPaaaaggggeeee 1111
[ Back ]
 Similar pages
Name OS Title
dmFXSplitFields IRIX split a frame out into two fields
csplit HP-UX context split
csplit IRIX context split
getgconfig IRIX gets the size of a buffer or a state in the current buffer configuration
strtok Tru64 Split string into tokens
split OpenBSD split a file into pieces
strtok_r Tru64 Split string into tokens
split IRIX split a file into pieces
AutoSplit IRIX split a package for autoloading
split HP-UX split a file into pieces
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service