commit c2383060aaa2726f522c1be32afbf3de9f8af01d
parent 432cdb96d9a612416736a83bb96dec7975c197a3
Author: William Casarin <jb55@jb55.com>
Date: Sat, 30 Dec 2023 21:20:40 -0800
nostrdb/blocks: add ndb_blocks_flags function
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/nostrdb/src/block.c b/nostrdb/src/block.c
@@ -194,3 +194,7 @@ void ndb_blocks_free(struct ndb_blocks *blocks) {
free(blocks);
}
+
+int ndb_blocks_flags(struct ndb_blocks *blocks) {
+ return blocks->flags;
+}
diff --git a/nostrdb/src/nostrdb.h b/nostrdb/src/nostrdb.h
@@ -505,7 +505,8 @@ int ndb_parse_content(unsigned char *buf, int buf_size,
struct ndb_blocks **blocks_p);
// BLOCKS
-enum ndb_block_type ndb_block_type(struct ndb_blocks *blocks);
+enum ndb_block_type ndb_get_block_type(struct ndb_block *block);
+int ndb_blocks_flags(struct ndb_blocks *block);
size_t ndb_blocks_total_size(struct ndb_blocks *blocks);
/// Free blocks if they are owned, safe to call on unowned blocks as well.
@@ -519,7 +520,6 @@ void ndb_blocks_iterate_start(const char *, struct ndb_blocks *, struct ndb_bloc
struct ndb_block *ndb_blocks_iterate_next(struct ndb_block_iterator *);
// STR BLOCKS
-enum ndb_block_type ndb_get_block_type(struct ndb_block *block);
struct ndb_str_block *ndb_block_str(struct ndb_block *);
const char *ndb_str_block_ptr(struct ndb_str_block *);
uint32_t ndb_str_block_len(struct ndb_str_block *);