IO(3)
| I/O routines(3) | Library Functions Manual | I/O routines(3) |
NAME
I/O routines -
Data Structures
struct sexp_iowrap
Typedefs
typedef struct sexp_iowrap sexp_iowrap_t
Functions
sexp_iowrap_t * init_iowrap (int fd)
void destroy_iowrap (sexp_iowrap_t *iow)
sexp_t * read_one_sexp (sexp_iowrap_t *iow)
Typedef Documentation
typedef struct sexp_iowrap sexp_iowrap_t This structure is a wrapper around a standard I/O file descriptor and the parsing infrastructure (continuation and a buffer) required to parse off of it. This is used so that routines can hide the loops and details required to accumulate up data read off of the file descriptor and parse expressions individually out of it.
Function Documentation
void destroy_iowrap (sexp_iowrap_t *iow) destroy an IO wrapper structure. The file descriptor wrapped in the wrapper will not be closed, so the caller is responsible for manually calling close on the file descriptor.
sexp_iowrap_t* init_iowrap (intfd) create an IO wrapper structure around a file descriptor. A NULL return value indicates some problem occurred allocating the wrapper, so the user should check the value of sexp_errno for further information.
sexp_t* read_one_sexp (sexp_iowrap_t *iow) given and IO wrapper handle, read one s-expression off of it. this expression may be contained in a continuation, so there is no guarantee that under the covers an IO read actually is occuring. A return value of NULL can either indicate a parser error or no more data on the input IO handle. In the event that NULL is returned, the user should check to see if sexp_errno contains SEXP_ERR_IO_EMPTY (no more data) or a more problematic error.
Author
Generated automatically by Doxygen for Small, Fast S-Expression Library from the source code.
| Thu Nov 21 2013 | Small, Fast S-Expression Library |
