sexp_errors.h File Reference

Error conditions are enumerated here along with any routines for translating error codes to human readable messages. More...

Go to the source code of this file.

Enumerations

enum  sexp_errcode_t {
  SEXP_ERR_OK = 0, SEXP_ERR_MEMORY, SEXP_ERR_BADFORM, SEXP_ERR_BADCONTENT,
  SEXP_ERR_NULLSTRING, SEXP_ERR_IO, SEXP_ERR_IO_EMPTY, SEXP_ERR_MEM_LIMIT,
  SEXP_ERR_BUFFER_FULL, SEXP_ERR_BAD_PARAM, SEXP_ERR_BAD_STACK, SEXP_ERR_UNKNOWN_STATE
}


Detailed Description

Error conditions are enumerated here along with any routines for translating error codes to human readable messages.


Enumeration Type Documentation

enum sexp_errcode_t
 

Error codes used by the library are defined in this enumeration. They are either used as values for the error field within the continuation structures, or as return values for functions with a return type of sexp_errcode_t.

Enumerator:
SEXP_ERR_OK  no error.
SEXP_ERR_MEMORY  memory error. malloc/realloc/calloc failures may result in this error code. this can either result from the system calls failing, or in the limited memory mode of the library, the memory limit being exceeded. In limited memory mode, if this error condition is present, one should check the memory limits that were in place during the erroneous call.
SEXP_ERR_BADFORM  badly formed expression. Missing, misplaced, or mismatched parenthesis will result in this error.
SEXP_ERR_BADCONTENT  a sexp_t that is inconsistent will result in this error code. An example is a SEXP_BASIC sexp_t with a null val field but a non-zero val_used value. Similar cases exist for SEXP_DQUOTE, SQUOTE, and BINARY types. This value is also used in the parser to flag a case where an inlined binary block is given a negative length.
SEXP_ERR_NULLSTRING  if a null string is passed into the parser, this error occurs.
SEXP_ERR_IO  general IO related errors, such as failure of fopen(). these are basically non-starters with respect to getting the IO routines going.
SEXP_ERR_IO_EMPTY  I/O routines that return NULL may simply have nothing to read. This is sometimes an error condition if the io wrapper continuation contains a partially complete s-expression, but nothing more is present (yet) on the file descriptor.
SEXP_ERR_MEM_LIMIT  when running the library under limited memory (ie, _SEXP_LIMIT_MEMORY_ defined at build time), this error will be produced when the memory limit is exceeded.
SEXP_ERR_BUFFER_FULL  buffer for unparsing is full.
SEXP_ERR_BAD_PARAM  routines that take parameters such as memory limits, growth sizes, or default sizes, can produce this error if a bad value has been passed in. this error usually will indicate that the parameters were bad and the default values were used instead (ie, it is non-fatal.).
SEXP_ERR_BAD_STACK  bad stack state encountered.
SEXP_ERR_UNKNOWN_STATE  unknown parser state


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