aboutsummaryrefslogtreecommitdiff
path: root/include/storage.h
diff options
context:
space:
mode:
authorSoikk2022-08-07 15:41:19 +0200
committerSoikk2022-08-07 15:41:19 +0200
commit5dd0d7700fa98197cdadaa2369d789e092cc0f49 (patch)
tree99d2dd331eb4c887b7895c893b803e34a9c10a77 /include/storage.h
parentf9a7d9cd8a7e603c89d4cc5d98d7f694cc217d85 (diff)
downloadsoikk-DB-5dd0d7700fa98197cdadaa2369d789e092cc0f49.tar.xz
soikk-DB-5dd0d7700fa98197cdadaa2369d789e092cc0f49.tar.zst
Added removing things from db. Ref counts update when removing things. Added changelog.
Diffstat (limited to 'include/storage.h')
-rw-r--r--include/storage.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/include/storage.h b/include/storage.h
index 8bfc751..dccfa5f 100644
--- a/include/storage.h
+++ b/include/storage.h
@@ -60,7 +60,7 @@ typedef struct lookupTable{
char **table; // They cant be longer than MAXPATH
} ltable;
-// Stores a number (used as the count for files and tags in the mapping table)
+// Stores a number in the index that references the ltable (used as the count for files and tags in the mapping table)
typedef struct countTable{
uint64_t size;
uint64_t *table;
@@ -94,6 +94,8 @@ ltable *newLtable(uint64_t size);
int ltableAdd(ltable *lt, char *str);
+int ltableRemove(ltable *lt, char *str);
+
uint64_t ltableSearch(ltable *lt, char *str);
int storeLtable(const ltable *lt, FILE *fp);
@@ -106,7 +108,7 @@ ctable *newCtable(uint64_t size);
int ctableAdd(ctable *ct, uint64_t n);
-int ctableDelete(ctable *ct, uint64_t n);
+int ctableRemove(ctable *ct, uint64_t n);
uint64_t ctableSearch(ctable *ct, uint64_t n);
@@ -120,6 +122,12 @@ mtable *newMtable(uint64_t size);
int mtableAdd(mtable *mt, relation r);
+int mtableRemove(mtable *mt, relation r);
+
+int mtableRemoveFile(mtable *mt, uint64_t file);
+
+int mtableRemoveTag(mtable *mt, uint64_t tag);
+
uint64_t mtableSearch(mtable *mt, relation r);
uint64_t mtableSearchFile(mtable *mt, uint64_t file);
@@ -132,8 +140,6 @@ mtable *loadMtable(FILE *fp);
// AVL TREE
-uint64_t height(node *n);
-
node *newNode(uint64_t h, uint64_t i);
node *insertNode(node *r, uint64_t h, uint64_t i);