From eeca7f0151d85d563d1db229e3b7ca936323ffa2 Mon Sep 17 00:00:00 2001 From: gramanas Date: Sun, 22 Apr 2018 05:47:33 +0300 Subject: First steps towards adding to the db --- src/dblayer.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/dblayer.h') diff --git a/src/dblayer.h b/src/dblayer.h index 24fdc2b..de73aac 100644 --- a/src/dblayer.h +++ b/src/dblayer.h @@ -33,14 +33,25 @@ struct DBstruct { SqlError error; }; -extern int db_exists(UserOpt *opt); -extern DB open_DB(); +extern int db_exists(const UserOpt *opt); + +/* Open the db file. On fail return null pointer to db + * and the corresponding SQL error (NO_DB_FILE | NO_TABLES)*/ +extern DB open_DB(const UserOpt *opt); + extern void close_DB(DB *DB); +/********/ /* init */ +/********/ + +/* Create the tables required for the ckdb */ extern void init_make_tables(DB *db); -extern DB init_make_DB(); +extern DB init_make_DB(const UserOpt *opt); +/*******/ /* add */ -extern int add_insert_program_to_db(DB *db, char * name); +/*******/ + +extern int add_insert_program_to_db(DB *db, const char * name); #endif /* DBLAEYR_H */ -- cgit v1.2.3