aboutsummaryrefslogtreecommitdiffstats
path: root/src/dblayer.h
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2018-04-15 00:43:08 +0300
committergramanas <anastasis.gramm2@gmail.com>2018-04-15 00:43:08 +0300
commitbc25e14b448edb9f41260a23cf6567e6632db267 (patch)
tree71362a1c8d369f3d0080baee5f98edb3439f3735 /src/dblayer.h
parent0168c10023f0040ae2fa31a212eb6d2e411eefb3 (diff)
downloadck-bc25e14b448edb9f41260a23cf6567e6632db267.tar.gz
ck-bc25e14b448edb9f41260a23cf6567e6632db267.tar.bz2
ck-bc25e14b448edb9f41260a23cf6567e6632db267.zip
dummy init done
action parser conf parser db layer
Diffstat (limited to 'src/dblayer.h')
-rw-r--r--src/dblayer.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/dblayer.h b/src/dblayer.h
new file mode 100644
index 0000000..4fe4d99
--- /dev/null
+++ b/src/dblayer.h
@@ -0,0 +1,35 @@
+/* dblayer.h - Database layer for ck ---------------------------*- C -*-
+ *
+ * This file is part of ck, the config keeper
+ *
+ * ---------------------------------------------------------------------
+ *
+ *
+ * ------------------------------------------------------------------ */
+#ifndef DBLAYER_H
+#define DBLAYER_H
+
+#include <sqlite3.h>
+
+typedef enum SqlErrors SqlError;
+enum SqlErrors {
+ SQL_NO_ERR = 0,
+ SQL_ERR_NO_DB_FILE,
+ SQL_ERR_NO_TABLES,
+ SQL_ERR_SQLITE
+};
+
+typedef struct DBstruct DB;
+struct DBstruct {
+ sqlite3 *get;
+ SqlError error;
+};
+
+extern int db_exists();
+extern DB open_DB();
+
+/* init */
+extern void init_make_tables(DB *db);
+extern DB init_make_DB();
+
+#endif /* DBLAEYR_H */