aboutsummaryrefslogtreecommitdiff
path: root/include/database.h
blob: 2b1c91a6f825e9c45b0008822e4622236809c610 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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