summaryrefslogtreecommitdiff
path: root/lib/alist.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/alist.c')
-rw-r--r--lib/alist.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/alist.c b/lib/alist.c
index 7730fe0d473..1a4b4fb9c40 100644
--- a/lib/alist.c
+++ b/lib/alist.c
@@ -118,6 +118,13 @@ int alist_calc_index(const struct alist *lst, const void *ptr)
return index;
}
+bool alist_chk_ptr(const struct alist *lst, const void *ptr)
+{
+ int index = alist_calc_index(lst, ptr);
+
+ return index >= 0 && index < lst->count;
+}
+
const void *alist_next_ptrd(const struct alist *lst, const void *ptr)
{
int index = alist_calc_index(lst, ptr);