]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/slists.h
Opt: Documented opt and its interaction with conf
[libucw.git] / ucw / slists.h
index 5c6d29f93721ea256bd6b66efb2d57d457c891b1..961748f30f86332ca024c5c6a67969dc9b7982bc 100644 (file)
 #ifndef _UCW_SLISTS_H
 #define _UCW_SLISTS_H
 
+#ifdef CONFIG_UCW_CLEAN_ABI
+#define slist_insert_before ucw_slist_insert_before
+#define slist_prev ucw_slist_prev
+#define slist_remove ucw_slist_remove
+#endif
+
 /**
  * Common header for list nodes.
  **/
@@ -116,9 +122,12 @@ static inline void slist_remove_after(slist *l, snode *after)
 /**
  * Remove the first node in @l. The list can be empty.
  **/
-static inline void slist_remove_head(slist *l)
+static inline void *slist_remove_head(slist *l)
 {
-  slist_remove_after(l, &l->head);
+  snode *n = slist_head(l);
+  if (n)
+    slist_remove_after(l, &l->head);
+  return n;
 }
 
 /* Loops */