/* * @brief Delete a node from the given database * @param db - the database that contains the table * @param tablename - the name of the table insert into * @param key - the key to delete * @return -1 if table not found, -2 if key not found, 0 on success */ int DB_delete (struct database *db, char *tablename, char *key) { struct Table *t = DB_getTable(db, tablename); if(t == NULL) { return -1; } else { if(Table_delete(t, key) == -1) { return -2; } } DB_toDisk(db); return 0; }
void SPBLASI_table_destroy(void) { Table_delete(SPBLASI_Table); SPBLASI_Table = NULL; }