diff options
Diffstat (limited to 'src/dbhandling.h')
| -rw-r--r-- | src/dbhandling.h | 30 |
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 |
