diff options
Diffstat (limited to 'include/npassd')
-rw-r--r-- | include/npassd/collection.h | 21 | ||||
-rw-r--r-- | include/npassd/service.h | 4 | ||||
-rw-r--r-- | include/npassd/util.h | 1 |
3 files changed, 25 insertions, 1 deletions
diff --git a/include/npassd/collection.h b/include/npassd/collection.h new file mode 100644 index 0000000..36d6b72 --- /dev/null +++ b/include/npassd/collection.h @@ -0,0 +1,21 @@ +#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); + +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); diff --git a/include/npassd/service.h b/include/npassd/service.h index b7c71af..92a833e 100644 --- a/include/npassd/service.h +++ b/include/npassd/service.h @@ -2,6 +2,7 @@ #include <sys/queue.h> #include <systemd/sd-bus.h> +#include "npassd/collection.h" #include "npassd/session.h" #define MAX_SESSION 128 @@ -9,9 +10,10 @@ struct service { sd_bus *bus; sd_bus_slot *slot; - struct sqlite3 *db; + struct session_dlist sessions; + struct collection_dlist collections; }; int service_init(sd_bus *bus, struct service *service); diff --git a/include/npassd/util.h b/include/npassd/util.h new file mode 100644 index 0000000..44efb9b --- /dev/null +++ b/include/npassd/util.h @@ -0,0 +1 @@ +int dbus_objpath_alnumify(char *path); |