Browse Source

* reformat simdb_error()

master
Alex 'AdUser' Z 8 years ago
parent
commit
7939d7f655
  1. 32
      src/database.c

32
src/database.c

@ -156,22 +156,22 @@ simdb_close(simdb_t *db) {
const char *
simdb_error(int error) {
if (error == SIMDB_SUCCESS) {
return "success";
} else if (error == SIMDB_ERR_SYSTEM) {
return strerror(errno);
} else if (error == SIMDB_ERR_OOM) {
return "can't allocate memory";
} else if (error == SIMDB_ERR_CORRUPTDB) {
return "database corrupted";
} else if (error == SIMDB_ERR_WRONGVERS) {
return "database version differs from library version";
} else if (error == SIMDB_ERR_READONLY) {
return "database opened in read-only mode";
} else if (error == SIMDB_ERR_NXRECORD) {
return "no such record in database";
}
return "unknown error";
if (error == SIMDB_SUCCESS) {
return "success";
} else if (error == SIMDB_ERR_SYSTEM) {
return strerror(errno);
} else if (error == SIMDB_ERR_OOM) {
return "can't allocate memory";
} else if (error == SIMDB_ERR_CORRUPTDB) {
return "database corrupted";
} else if (error == SIMDB_ERR_WRONGVERS) {
return "database version differs from library version";
} else if (error == SIMDB_ERR_READONLY) {
return "database opened in read-only mode";
} else if (error == SIMDB_ERR_NXRECORD) {
return "no such record in database";
}
return "unknown error";
}
int simdb_record_read(simdb_t *db, simdb_rec_t *rec) {

Loading…
Cancel
Save