summaryrefslogtreecommitdiffstats
path: root/src/ref.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ref.c')
-rw-r--r--src/ref.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ref.c b/src/ref.c
index ac4bcb0..d43df61 100644
--- a/src/ref.c
+++ b/src/ref.c
@@ -41,6 +41,24 @@ refs_ffind(struct list *list, void *data)
}
int
+refs_index(struct list *list, void *data)
+{
+ struct link *iter;
+ struct ref *ref;
+ int index;
+
+ index = 0;
+ for (LIST_ITER(list, iter)) {
+ ref = UPCAST(iter, struct ref);
+ if (ref->data == data)
+ return index;
+ index++;
+ }
+
+ return -1;
+}
+
+int
refs_incl(struct list *list, void *data)
{
struct link *ref;