Browse Source

Add EASYCSV_MEMALLOC error flag

Signed-off-by: Pradana AUMARS <paumars@courrier.dev>
master
Pradana AUMARS 3 months ago
parent
commit
4b3c7bbb97
  1. 4
      src/easycsv_error.c
  2. 1
      src/easycsv_error.h

4
src/easycsv_error.c

@ -31,6 +31,8 @@ easycsv_error(EASYCSV_ERROR error,
case EASYCSV_OVERMAXCOL: sprintf(s_error_msg, "int exceeds column limit of %s", error_msg); return;
case EASYCSV_ZEROROW: sprintf(s_error_msg, "parameterised row number is zero"); return;
case EASYCSV_ZEROCOL: sprintf(s_error_msg, "parameterised column number is zero"); return;
case EASYCSV_MEMALLOC: sprintf(s_error_msg, "memory allocation failure"); return;
case EASYCSV_UNKNOWNIOMODE: sprintf(s_error_msg, "unknown file IO mode"); return;
case EASYCSV_OPENFAIL: sprintf(s_error_msg, "failed to open file"); return;
case EASYCSV_REOPENFAIL: sprintf(s_error_msg, "failed to reopen file"); return;
@ -40,8 +42,10 @@ easycsv_error(EASYCSV_ERROR error,
case EASYCSV_UPDATEFAIL: sprintf(s_error_msg, "CSV file has failed to update"); return;
case EASYCSV_UPDATETEMPFAIL: sprintf(s_error_msg, "failed to update temp CSV file"); return;
case EASYCSV_FILEPTRFAIL: sprintf(s_error_msg, "failed to move FILE pointer"); return;
case EASYCSV_ROWNOTEXIST: sprintf(s_error_msg, "given row does not exist"); return;
case EASYCSV_COLNOTEXIST: sprintf(s_error_msg, "given column does not exist"); return;
case EASYCSV_PUSHCOLFAIL: sprintf(s_error_msg, "failed to push value under column"); return;
case EASYCSV_COLNUMFAIL: sprintf(s_error_msg, "failed to determine the column number of a value in the first row"); return;
case EASYCSV_FINDVALUEFAIL: sprintf(s_error_msg, "cannot find the value %s", error_msg); return;

1
src/easycsv_error.h

@ -13,6 +13,7 @@ typedef enum EASYCSV_ERROR {
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

Loading…
Cancel
Save