commit 3a7cf4d08d080218e3fd10ce705bbe01cf0a6bd3
parent e3001cc2405579f8b6219e5d5ef81654a5d6f964
Author: William Casarin <jb55@jb55.com>
Date: Thu, 14 Dec 2023 11:59:25 -0800
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 <jb55@jb55.com>
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git 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
@@ -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);