nostrdb/blocks: add ndb_blocks_flags function

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2023-12-30 21:20:40 -08:00
committed by Daniel D’Aquino
parent 432cdb96d9
commit c2383060aa
2 changed files with 6 additions and 2 deletions

View File

@@ -194,3 +194,7 @@ void ndb_blocks_free(struct ndb_blocks *blocks) {
free(blocks); free(blocks);
} }
int ndb_blocks_flags(struct ndb_blocks *blocks) {
return blocks->flags;
}

View File

@@ -505,7 +505,8 @@ int ndb_parse_content(unsigned char *buf, int buf_size,
struct ndb_blocks **blocks_p); struct ndb_blocks **blocks_p);
// BLOCKS // 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); size_t ndb_blocks_total_size(struct ndb_blocks *blocks);
/// Free blocks if they are owned, safe to call on unowned blocks as well. /// 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 *); struct ndb_block *ndb_blocks_iterate_next(struct ndb_block_iterator *);
// STR BLOCKS // STR BLOCKS
enum ndb_block_type ndb_get_block_type(struct ndb_block *block);
struct ndb_str_block *ndb_block_str(struct ndb_block *); struct ndb_str_block *ndb_block_str(struct ndb_block *);
const char *ndb_str_block_ptr(struct ndb_str_block *); const char *ndb_str_block_ptr(struct ndb_str_block *);
uint32_t ndb_str_block_len(struct ndb_str_block *); uint32_t ndb_str_block_len(struct ndb_str_block *);