From 3a7cf4d08d080218e3fd10ce705bbe01cf0a6bd3 Mon Sep 17 00:00:00 2001 From: William Casarin Date: Thu, 14 Dec 2023 11:59:25 -0800 Subject: [PATCH] nostrdb/rust: initial api for Ndb and NdbConfig This is the start of our rust library for nostrdb. Implement idiomatic interfaces for Ndb and NdbConfig. Changelog-Added: Add initial rust library Signed-off-by: William Casarin --- nostrdb/nostrdb.c | 2 +- nostrdb/nostrdb.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nostrdb/nostrdb.c b/nostrdb/nostrdb.c index d48e79a5..b6d0f439 100644 --- a/nostrdb/nostrdb.c +++ b/nostrdb/nostrdb.c @@ -3155,7 +3155,7 @@ static int ndb_run_migrations(struct ndb *ndb) return 1; } -int ndb_init(struct ndb **pndb, const char *filename, struct ndb_config *config) +int ndb_init(struct ndb **pndb, const char *filename, const struct ndb_config *config) { struct ndb *ndb; //MDB_dbi ind_id; // TODO: ind_pk, etc diff --git a/nostrdb/nostrdb.h b/nostrdb/nostrdb.h index a5f2833f..88cec55a 100644 --- a/nostrdb/nostrdb.h +++ b/nostrdb/nostrdb.h @@ -296,7 +296,7 @@ int ndb_decode_key(const char *secstr, struct ndb_keypair *keypair); int ndb_note_verify(void *secp_ctx, unsigned char pubkey[32], unsigned char id[32], unsigned char signature[64]); // NDB -int ndb_init(struct ndb **ndb, const char *dbdir, struct ndb_config *); +int ndb_init(struct ndb **ndb, const char *dbdir, const struct ndb_config *); int ndb_db_version(struct ndb *ndb); int ndb_process_event(struct ndb *, const char *json, int len); int ndb_process_events(struct ndb *, const char *ldjson, size_t len);