Commit a8a9c89f authored by Jan Včelák's avatar Jan Včelák 🚀
Browse files

namedb: make the API constant

parent 61230685
......@@ -325,9 +325,9 @@ static void iter_finish(knot_iter_t *iter)
mdb_cursor_close(cursor);
}
struct namedb_api *namedb_lmdb_api(void)
const struct namedb_api *namedb_lmdb_api(void)
{
static struct namedb_api api = {
static const struct namedb_api api = {
"lmdb",
init, deinit,
txn_begin, txn_commit, txn_abort,
......@@ -342,7 +342,7 @@ struct namedb_api *namedb_lmdb_api(void)
#include <stdlib.h>
struct namedb_api *namedb_lmdb_api(void)
const struct namedb_api *namedb_lmdb_api(void)
{
return NULL;
}
......
......@@ -18,4 +18,4 @@
#include "common/namedb/namedb.h"
struct namedb_api *namedb_lmdb_api(void);
const struct namedb_api *namedb_lmdb_api(void);
......@@ -126,9 +126,9 @@ static void iter_finish(knot_iter_t *iter)
hattrie_iter_free((hattrie_iter_t *)iter);
}
struct namedb_api *namedb_trie_api(void)
const struct namedb_api *namedb_trie_api(void)
{
static struct namedb_api api = {
static const struct namedb_api api = {
"hattrie",
init, deinit,
txn_begin, txn_commit, txn_abort,
......
......@@ -18,4 +18,4 @@
#include "common/namedb/namedb.h"
struct namedb_api *namedb_trie_api(void);
const struct namedb_api *namedb_trie_api(void);
......@@ -48,7 +48,7 @@ static char *str_key_rand(size_t len, mm_ctx_t *pool)
#include "common-knot/array-sort.h"
static void namedb_test_set(unsigned nkeys, char **keys, char *dbid,
struct namedb_api *api, mm_ctx_t *pool)
const struct namedb_api *api, mm_ctx_t *pool)
{
if (api == NULL) {
skip("API not compiled in");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment