diff options
Diffstat (limited to 'lib/typesafe.h')
| -rw-r--r-- | lib/typesafe.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/typesafe.h b/lib/typesafe.h index b03934b964..44c42ffbca 100644 --- a/lib/typesafe.h +++ b/lib/typesafe.h @@ -258,6 +258,10 @@ macro_pure size_t prefix ## _count(const struct prefix##_head *h) \ { \ return h->sh.count; \ } \ +macro_pure bool prefix ## _anywhere(const type *item) \ +{ \ + return item->field.si.next != NULL; \ +} \ macro_pure bool prefix ## _member(const struct prefix##_head *h, \ const type *item) \ { \ @@ -405,6 +409,11 @@ macro_pure size_t prefix ## _count(const struct prefix##_head *h) \ { \ return h->dh.count; \ } \ +macro_pure bool prefix ## _anywhere(const type *item) \ +{ \ + const struct dlist_item *ditem = &item->field.di; \ + return ditem->next && ditem->prev; \ +} \ macro_pure bool prefix ## _member(const struct prefix##_head *h, \ const type *item) \ { \ |
