From bc25e14b448edb9f41260a23cf6567e6632db267 Mon Sep 17 00:00:00 2001 From: gramanas Date: Sun, 15 Apr 2018 00:43:08 +0300 Subject: dummy init done action parser conf parser db layer --- src/dblayer.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/dblayer.h (limited to 'src/dblayer.h') 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 + +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 */ -- cgit v1.2.3