From 6738962d73941ad2eae07d58b2a52cd6ca295a97 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 24 Oct 2018 07:00:26 +0200 Subject: [PATCH] missing files --- src/kernel/database.c | 28 ++++++++++++++++++++++++++++ src/kernel/database.h | 11 +++++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/kernel/database.c create mode 100644 src/kernel/database.h diff --git a/src/kernel/database.c b/src/kernel/database.c new file mode 100644 index 000000000..fec8867a2 --- /dev/null +++ b/src/kernel/database.c @@ -0,0 +1,28 @@ +#include "config.h" +#include "database.h" +#include "db/driver.h" + +void swapdb_open(void) +{ + const char *dbname; + dbname = config_get("game.dbswap"); + db_driver_open(DB_SWAP, dbname); +} + +void swapdb_close(void) +{ + db_driver_close(DB_SWAP); +} + +dbstring_id db_string_save(const char *s) { + (void)s; + return 0; +} + +dbstring_id dbstring_save(const char *s) { + return db_driver_string_save(s); +} + +const char *dbstring_load(dbstring_id id, size_t *size) { + return db_driver_string_load(id, size); +} diff --git a/src/kernel/database.h b/src/kernel/database.h new file mode 100644 index 000000000..584b21908 --- /dev/null +++ b/src/kernel/database.h @@ -0,0 +1,11 @@ +#pragma once + +#include + +typedef unsigned int dbstring_id; + +void swapdb_open(void); +void swapdb_close(void); + +dbstring_id dbstring_save(const char *s); +const char *dbstring_load(dbstring_id id, size_t *size);