const char sig[3] = {0x7f, 'D', 'W'};
-const char* dw_errors[] = {"Success", "Used already", "File open fail", "Invalid signature", "Invalid version", "Parser returned NULL", "Cannot call non-method", "Unknown method", "Insufficient arguments", "Too many arguments", "Not used"};
+const char* dw_errors[] = {"Success", "Used already", "File open fail", "Invalid signature", "Invalid version", "Parser returned NULL", "Cannot call non-method", "Unknown method", "Insufficient arguments", "Too many arguments", "Not used", "Too many tables"};
#ifdef M_I86
#define BUFSIZE 128
int i;
struct dataworks_db_v1_indexentry index;
char* buf = malloc(1 + 8 + 1 + 256 + 4096);
+ int cnt = 0;
for(i = 0; i < 256; i++) {
fread(buf, 1, 1 + 8 + 1 + 256 + 4096, db->fp);
__dw_buffer_to_db_v1_indexentry(buf, index);
__dw_unlockfile(db->fp);
return DW_ERR_USED;
}
+ cnt++;
}
}
+ if(cnt == 256) {
+ free(buf);
+ __dw_unlockfile(db->fp);
+ return DW_ERR_TOO_MANY_TABLES;
+ }
fseek(db->fp, 3 + 10, SEEK_SET);
for(i = 0; i < 256; i++) {
fread(buf, 1, 1 + 8 + 1 + 256 + 4096, db->fp);
*
*/
DW_ERR_NOT_USED,
+
+ /**
+ * @~english
+ * @brief Too many tables
+ *
+ */
+ DW_ERR_TOO_MANY_TABLES,
};
/**