nostrdb: filter: add ndb_filter_find_search helper
This can be used to quicky pull the search string from a filter Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
committed by
Daniel D’Aquino
parent
1e6873c879
commit
2d02766461
@@ -2906,6 +2906,16 @@ ndb_filter_find_elements(struct ndb_filter *filter, enum ndb_filter_fieldtype ty
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char *ndb_filter_find_search(struct ndb_filter *filter)
|
||||||
|
{
|
||||||
|
struct ndb_filter_elements *els;
|
||||||
|
|
||||||
|
if (!(els = ndb_filter_find_elements(filter, NDB_FILTER_SEARCH)))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return ndb_filter_get_string_element(filter, els, 0);
|
||||||
|
}
|
||||||
|
|
||||||
int ndb_filter_is_subset_of(const struct ndb_filter *a, const struct ndb_filter *b)
|
int ndb_filter_is_subset_of(const struct ndb_filter *a, const struct ndb_filter *b)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|||||||
Reference in New Issue
Block a user