summary refs log tree commit diff
path: root/database.h
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-08-20 21:33:12 -0400
committerJune McEnroe <june@causal.agency>2020-08-20 21:42:31 -0400
commitdd3b702fd104353970e8a047ab9b4382c935e5d2 (patch)
treeff1d4a3eea4943f59439bb0cc66efd90e021bb9e /database.h
parentSay "OpenSSL" in additional permission notices (diff)
downloadlitterbox-dd3b702fd104353970e8a047ab9b4382c935e5d2.tar.gz
litterbox-dd3b702fd104353970e8a047ab9b4382c935e5d2.zip
Import xdg.c from catgirl
Diffstat (limited to '')
-rw-r--r--database.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/database.h b/database.h
index fbef0bb..d2db1f0 100644
--- a/database.h
+++ b/database.h
@@ -27,6 +27,7 @@
 
 #include <err.h>
 #include <errno.h>
+#include <getopt.h>
 #include <limits.h>
 #include <sqlite3.h>
 #include <stdbool.h>
@@ -40,6 +41,20 @@
 #define SQL(...) #__VA_ARGS__
 #define ARRAY_LEN(a) (sizeof(a) / sizeof((a)[0]))
 
+const char *configPath(
+	char *buf, size_t cap, const char **dirs, const char *path
+);
+const char *dataPath(
+	char *buf, size_t cap, const char **dirs, const char *path
+);
+FILE *configOpen(const char *path, const char *mode);
+FILE *dataOpen(const char *path, const char *mode);
+void dataMkdir(const char *path);
+int getopt_config(
+	int argc, char *const *argv, const char *optstring,
+	const struct option *longopts, int *longindex
+);
+
 #define DATABASE_PATH "litterbox/litterbox.sqlite"
 
 enum { DatabaseVersion = 5 };