GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
xt_inhale_strings(3) FreeBSD Library Functions Manual xt_inhale_strings(3)

#include <xtend/file.h>
-lxtend

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

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

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.

The number of strings read, XT_READ_IO_ERR on read error

FILE    *instream;
char    **strings;
ssize_t string_count;
string_count = xt_inhale_strings(instream, &strings);
xt_free_strings(strings);

xt_free_strings(3)


Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.