I/O routines

Data Structures

struct  sexp_iowrap


typedef sexp_iowrap sexp_iowrap_t


sexp_iowrap_tinit_iowrap (int fd)
void destroy_iowrap (sexp_iowrap_t *iow)
sexp_tread_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 int  fd  ) 

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.

Generated on Thu Oct 25 01:19:37 2007 for Small, Fast S-Expression Library by  doxygen 1.4.6