summaryrefslogtreecommitdiff
path: root/src/dbhandling.h
diff options
context:
space:
mode:
authoryuzu-eva <cafebabe@disroot.org>2025-06-08 14:33:02 +0200
committeryuzu-eva <cafebabe@disroot.org>2025-06-08 14:33:02 +0200
commit390cbf31635951e46a49ed8657cd2a1635757f19 (patch)
tree89f1d51b926017cc5bbcdd88ad503fb20743223c /src/dbhandling.h
parentb7e05ac5c2cb8f169b1cf66926faddcf7f15b7cc (diff)
changed project structure, adjusted Makefilerefactor
Diffstat (limited to 'src/dbhandling.h')
-rw-r--r--src/dbhandling.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/dbhandling.h b/src/dbhandling.h
new file mode 100644
index 0000000..fd21579
--- /dev/null
+++ b/src/dbhandling.h
@@ -0,0 +1,30 @@
+#ifndef _DBHANDLING_
+#define _DBHANDLING_
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sqlite3.h>
+
+#include "enum.h"
+
+#define MAX_NAME_LEN 128
+#define MAX_AUTHOR_LEN 64
+#define MAX_VALUE_LEN 16
+#define MAX_STATUS_LEN 16
+
+typedef struct {
+ char *name;
+ char *author;
+ char *value;
+ char *status;
+} entry_t;
+
+
+void exit_with_error(sqlite3 *db, const char *msg);
+void select_from_table(sqlite3 *db, args_e target, entry_t *entry);
+void update_entry(sqlite3 *db, args_e target, entry_t *entry);
+void add_entry(sqlite3 *db, args_e target, entry_t *entry);
+
+#endif