diff options
| author | Soikk | 2022-07-23 01:46:24 +0200 |
|---|---|---|
| committer | Soikk | 2022-07-23 01:46:24 +0200 |
| commit | 28578b192d0828a9820983b5624b9bcc3577cd18 (patch) | |
| tree | 2f30b1730f30a7eeee80995ee3984c10f5bdc2ff /include/database.h | |
| parent | 377dc104be127291ede5b32640c23eea0ba6791a (diff) | |
| download | soikk-DB-28578b192d0828a9820983b5624b9bcc3577cd18.tar.xz soikk-DB-28578b192d0828a9820983b5624b9bcc3577cd18.tar.zst | |
Improved the database storage system. Added persistency.
Diffstat (limited to 'include/database.h')
| -rw-r--r-- | include/database.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/include/database.h b/include/database.h new file mode 100644 index 0000000..2b1c91a --- /dev/null +++ b/include/database.h @@ -0,0 +1,31 @@ +#ifndef DATABASE_H +#define DATABASE_H + +#include "db.h" + + +typedef struct database{ + char name[32]; + ltable *lfiles, *ltags; + htable *hfiles, *htags; + mtable *map; +} database; + + +database *newDatabase(char *name); + +database *loadDatabase(const char* path); + +int storeDatabase(database *db, const char *path); + +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); + +void printDatabase(database *db); + +void debugDatabase(database *db); + +#endif |
