summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2009-01-12 14:40:21 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2009-01-12 14:40:21 +0100
commit02a9eeeb8547b3f0940a0295df8a78ce2181ec30 (patch)
treef8e4542f82a7caa0ef1403c3852b10b4a9ca7e6a /lib
parent23d6702952841184d364a5520dbe6be7a1a5d14b (diff)
downloadbird-02a9eeeb8547b3f0940a0295df8a78ce2181ec30.tar
bird-02a9eeeb8547b3f0940a0295df8a78ce2181ec30.zip
Slist update
Diffstat (limited to 'lib')
-rw-r--r--lib/slists.c3
-rw-r--r--lib/slists.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/slists.c b/lib/slists.c
index 3577430..6e0df39 100644
--- a/lib/slists.c
+++ b/lib/slists.c
@@ -61,6 +61,9 @@ s_get(siterator *i)
f->next = g;
if (g)
g->prev = f;
+
+ i->prev = NULL;
+ i->next = NULL;
return n;
}
diff --git a/lib/slists.h b/lib/slists.h
index 27520c9..2334e36 100644
--- a/lib/slists.h
+++ b/lib/slists.h
@@ -84,5 +84,6 @@ void s_insert_node(snode *, snode *);
snode *s_get(siterator *);
void s_put(siterator *, snode *n);
static inline void s_init(siterator *i, slist *l) { s_put(i, SHEAD(*l)); }
+static inline int s_is_used(siterator *i) { return (i->prev != NULL); }
#endif