next up previous contents
Next: The C++ API Up: The C API Previous: Reading and writing cyclic   Contents

Error handling

Most cyclic log routines return zero for success and -1 to indicate an error. Upon an error, errno will indicate the error that occurred. The exception is the CYC_open routine. This needs to be able to detect attempts to open files that are not cyclic logs, hence the cyclic package has an error code enumeration. To map the error code to meaningful text, use the CYC_errorText function. The prototype is:

const char* CYC_errorText(CYC_ErrorCode errorCode);

Andrew Marlow 2004-01-01