aboutsummaryrefslogtreecommitdiff
path: root/include/npassd/collection.h
blob: 4b157e04d661c928410c5926d82bcac5eb7c5da7 (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
#include <linux/limits.h>
#include <sqlite3.h>
#include <sys/queue.h>
#include <systemd/sd-bus.h>

struct collection {
	sd_bus_slot *slot;
	char *root, *path;

	int locked;
	char *alias, *label;
	uint64_t created, modified;

	LIST_ENTRY(collection) dlist;
};

LIST_HEAD(collection_dlist, collection);

void collection_free(struct collection *c);
int collection_new(sd_bus *bus, struct sqlite3 *db, struct collection **p,
		   const char *alias, const char *label, const char *root);
int collection_root_make(const char *label, const char *alias, char **root);
int collection_alias_search(struct collection_dlist *collections,
			    const char *alias, struct collection **collection);
int collection_db_alias_read(sd_bus *bus, struct sqlite3 *db,
			     struct collection **p, const char *alias);