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

FreeBSD Manual Pages

  
 
  

home | help
xt_inhale_strings(3)	    Library Functions Manual	    xt_inhale_strings(3)

NAME
     xt_inhale_strings() - Read list of strings into array

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

SYNOPSIS
     ssize_t xt_inhale_strings(FILE *stream, char ***list)

ARGUMENTS
     stream  FILE * from which strings are read, one per line
     list    Pointer to a char ** (poiner array), populated with strings

DESCRIPTION
     xt_inhale_strings() reads a list of strings from a file, one per line, into
     a	pointer  array.   Memory is allocated for the pointer array and for each
     string.

     Memory should be freed using xt_free_strings(3) as soon as the strings  are
     no longer needed.

     Inhaling  large  amounts of data into arrays should generally be avoided in
     favor of more memory-efficient use-once-and-discard strategies, but may  be
     advantageous  for	small lists of strings accessed repeatedly, or necessary
     for a few tasks such as sorting.

RETURN VALUES
     The number of strings read, XT_READ_IO_ERR on read error

EXAMPLES
     FILE    *instream;
     char    **strings;
     ssize_t string_count;

     string_count = xt_inhale_strings(instream, &strings);
     xt_free_strings(strings);

SEE ALSO
     xt_free_strings(3)

							    xt_inhale_strings(3)

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

home | help