From 588cebd18d6b887444a736060d06991c275f246d Mon Sep 17 00:00:00 2001 From: William Casarin Date: Thu, 25 Jan 2024 15:31:17 -0800 Subject: [PATCH] nostrdb: header: add ptr helpers for swift swift is kind of dumb when it comes to opaque pointers Signed-off-by: William Casarin --- nostrdb/src/nostrdb.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/nostrdb/src/nostrdb.h b/nostrdb/src/nostrdb.h index 4bf58ad0..7a46fb1f 100644 --- a/nostrdb/src/nostrdb.h +++ b/nostrdb/src/nostrdb.h @@ -32,7 +32,13 @@ struct ndb_lmdb; union ndb_packed_str; struct bolt11; -// sorry, swift needs help with forward declared pointers like this +// some bindings like swift needs help with forward declared pointers +struct ndb_tag_ptr { struct ndb_tag *ptr; }; +struct ndb_tags_ptr { struct ndb_tags *ptr; }; +struct ndb_block_ptr { struct ndb_block *ptr; }; +struct ndb_blocks_ptr { struct ndb_blocks *ptr; }; +struct ndb_note_ptr { struct ndb_note *ptr; }; + struct ndb_t { struct ndb *ndb; };