Easy-to-use CSV parsing library for C language.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

44 lines
1.4 KiB

#ifndef EASYCSV_ERROR_H
#define EASYCSV_ERROR_H
/* Error flags */
typedef enum EASYCSV_ERROR {
/* Generic errors */
EASYCSV_NOERROR, // no error
EASYCSV_NULLCSV, // easycsv* is NULL
EASYCSV_NULLPTR, // generic pointer is NULL
EASYCSV_EMPTYSTRING, // empty string
EASYCSV_EMPTYVALUE, // value is empty
EASYCSV_OVERMAXROW, // int exceeds row limit
EASYCSV_OVERMAXCOL, // int exceeds col limit
EASYCSV_ZEROROW,
EASYCSV_ZEROCOL,
EASYCSV_MEMALLOC, ///< memory allocation failure
/* File input/output errors */
EASYCSV_UNKNOWNIOMODE, // unknown file IO mode
EASYCSV_OPENFAIL, // fail to open
EASYCSV_REOPENFAIL, // fail to reopen
EASYCSV_EMPTYCSV, // csv is empty or does not exist
EASYCSV_UNWRITABLE, // csv mode not at EASYCSV_W
EASYCSV_UNREADABLE, // csv mode not at EASYCSV_R
EASYCSV_UPDATEFAIL, // update file fail = temp -> file
EASYCSV_UPDATETEMPFAIL, // update = -> temp
EASYCSV_FILEPTRFAIL, // move file pointer fail
/* Non-existant elements */
EASYCSV_ROWNOTEXIST, // row does not exist
EASYCSV_COLNOTEXIST, // column does not exist
/* User-facing failure */
EASYCSV_PUSHCOLFAIL, // push column value fail
EASYCSV_COLNUMFAIL, // column number retrieval fail
EASYCSV_READVALUEFAIL, // read value fail
EASYCSV_FINDVALUEFAIL, // find value fail
} EASYCSV_ERROR;
void
easycsv_error(EASYCSV_ERROR,
const char*);
#endif