nostrdb

an unfairly fast embedded nostr database backed by lmdb
git clone git://jb55.com/nostrdb
Log | Files | Refs | Submodules | README | LICENSE

commit b1210172140ecfc81d1292e32ab95f5ae4cb78ab
parent d73a1629448e20d2323fbffe5cf0da8dd5cf80a8
Author: William Casarin <jb55@jb55.com>
Date:   Tue, 13 Aug 2024 11:20:38 -0700

expose ndb_filter_get_elements

This can be used to iterate though filter elements

Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Msrc/nostrdb.c | 2+-
Msrc/nostrdb.h | 1+
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/nostrdb.c b/src/nostrdb.c @@ -610,7 +610,7 @@ ndb_filter_current_element(const struct ndb_filter *filter) return ndb_filter_get_elements_by_offset(filter, filter->current); } -static inline struct ndb_filter_elements * +struct ndb_filter_elements * ndb_filter_get_elements(const struct ndb_filter *filter, int index) { if (filter->num_elements <= 0) diff --git a/src/nostrdb.h b/src/nostrdb.h @@ -489,6 +489,7 @@ int ndb_filter_add_int_element(struct ndb_filter *, uint64_t integer); int ndb_filter_add_str_element(struct ndb_filter *, const char *str); struct ndb_filter_elements *ndb_filter_current_element(const struct ndb_filter *); +struct ndb_filter_elements *ndb_filter_get_elements(const struct ndb_filter *, int); int ndb_filter_start_field(struct ndb_filter *, enum ndb_filter_fieldtype); int ndb_filter_start_tag_field(struct ndb_filter *, char tag); int ndb_filter_matches(struct ndb_filter *, struct ndb_note *);