commit f8d0bbdc0144d32a56433b73f495dd65514a0326
parent 84e4b0456359cbaa960fa46435c448ce9c12a983
Author: William Casarin <jb55@jb55.com>
Date: Sat, 30 Dec 2023 21:20:40 -0800
blocks: add ndb_blocks_flags function
Diffstat:
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/block.c b/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/src/nostrdb.h b/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 *);