aboutsummaryrefslogtreecommitdiff
path: root/include/database.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/database.h')
-rw-r--r--include/database.h31
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