nostrdb/Inital embedded content parser

This adds some initial code for nostrdb content parsing.

We still need to write tests for encoding and decoding, so this is
likely not working yet.

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2023-12-27 12:43:20 -08:00
committed by Daniel D’Aquino
parent 9ff1f69a82
commit e0a2dcf3db
8 changed files with 253 additions and 102 deletions

View File

@@ -20,11 +20,13 @@
struct ndb_json_parser;
struct ndb;
struct ndb_note_blocks;
struct ndb_note;
struct ndb_tag;
struct ndb_tags;
struct ndb_lmdb;
union ndb_packed_str;
struct bolt11;
// sorry, swift needs help with forward declared pointers like this
struct ndb_t {
@@ -383,4 +385,9 @@ const char *ndb_db_name(enum ndb_dbs db);
const char *ndb_kind_name(enum ndb_common_kind ck);
enum ndb_common_kind ndb_kind_to_common_kind(int kind);
// CONTENT PARSER
int ndb_parse_content(unsigned char *buf, int buf_size,
const char *content, int content_len,
struct ndb_note_blocks **blocks_p);
#endif