diff options
| author | Soikk | 2022-07-24 22:18:31 +0200 |
|---|---|---|
| committer | Soikk | 2022-07-24 22:18:31 +0200 |
| commit | ff5da06da823ac3a0bc7e89b35ed573255139b2d (patch) | |
| tree | 41551fe546a34ad8f771b5a75eb4d883db5fb4ac /include/database.h | |
| parent | caacd02d3c6a6ab3ddea620214ee5d1836de2c31 (diff) | |
| download | soikk-DB-ff5da06da823ac3a0bc7e89b35ed573255139b2d.tar.xz soikk-DB-ff5da06da823ac3a0bc7e89b35ed573255139b2d.tar.zst | |
Added ref count for files & tags. Refactored database.c. Removed tags.h but kept documentation.
Diffstat (limited to 'include/database.h')
| -rw-r--r-- | include/database.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/database.h b/include/database.h index 2b1c91a..339b48b 100644 --- a/include/database.h +++ b/include/database.h @@ -8,6 +8,7 @@ typedef struct database{ char name[32]; ltable *lfiles, *ltags; htable *hfiles, *htags; + htable *fcount, *tcount; mtable *map; } database; @@ -18,11 +19,17 @@ database *loadDatabase(const char* path); int storeDatabase(database *db, const char *path); +uint64_t addFile(database *db, char *file); + +uint64_t addTag(database *db, char *tag); + int addFileTag(database *db, char *file, char *tag); int addFileTags(database *db, char *file, int ntags, ...); -int searchTag(database *db, char *tag, uint64_t *rl); +int searchTag(database *db, char *tag, uint64_t n, uint64_t **r, uint64_t *rl); + +int searchFile(database *db, char *file, uint64_t n, uint64_t **r, uint64_t *rl); void printDatabase(database *db); |
