Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
xt_dsv_rea...eld_malloc(3) Library Functions Manual xt_dsv_rea...eld_malloc(3)

NAME
       xt_dsv_read_field_malloc()  - Read next field from tabular input, allo-
       cating memory as	needed

LIBRARY
       #include	<xtend/dsv.h>
       -lxtend

SYNOPSIS
       int     xt_dsv_read_field_malloc(FILE *stream, char **buff, size_t *buff_size,
       const char *delims, size_t *len)

ARGUMENTS
       stream	   FILE	stream from which field	is read
       buff	   Character buffer into which field is	copied
       buff_size   Size	of the array passed to buff
       delims	   Array of characters that may	serve as delimiters
       len	   Pointer to a	variable which will receive the	field length

DESCRIPTION
       Read next delimiter-separated field from	stream,	allocating a buffer to
       fit in the fashion of strdup(3).	The fields may be ended	by any charac-
       ter in the string delims	or by a	newline	('\n').

       If the delimiter	ending a field is a space, then	subsequence spaces are
       discarded, so that multiple space characters serve as a	single	delim-
       iter.

       *buff_size  indicates the size of the existing array, if	one is already
       allocated.  If *buff does not point to an allocated array, this	should
       be  0,  i.e.  pass  the	address	 of a variable containing 0, not NULL.
       *buff_size will be updated if the array needs to	be expanded to	accom-
       modate the new input.

RETURN VALUES
       Delimiter  ending  the  field  (either a	member of delim	or newline) or
       XT_MALLOC_FAILED.

SEE ALSO
       xt_dsv_read_field(3),				 xt_dsv_skip_field(3),
       xt_dsv_skip_rest_of_line(3), xt_dsv_line_read(3)

						    xt_dsv_rea...eld_malloc(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=xt_dsv_read_field_malloc&sektion=3&manpath=FreeBSD+Ports+15.0>

home | help