summaryrefslogtreecommitdiff
path: root/db.h
diff options
context:
space:
mode:
Diffstat (limited to 'db.h')
-rw-r--r--db.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/db.h b/db.h
new file mode 100644
index 0000000..269cd70
--- /dev/null
+++ b/db.h
@@ -0,0 +1,22 @@
+//
+// Created by yuuta on 11/28/21.
+//
+
+#ifndef _DB_H
+#define _DB_H
+
+#include <sqlite3.h>
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+
+#define ULEN(X) (X == 0 ? 1 : (int)floor(log10(X)) + 1)
+#define LLEN(X) ((int)floor(log10(llabs(X))) + 1 + ((X < 0) ? 1 : 0))
+
+extern sqlite3 *db;
+
+void db_init(void);
+
+void db_close(void);
+
+#endif /* _DB_H */