#if CONFIG_xxx -> #if ENABLE_xxx
[oweals/busybox.git] / libbb / llist.c
index 8bf89a5950bf7188c28a5537f81ffe29ea515ad0..8a74832ee3ff54e50d08c4e86f0c1daefbf0965e 100644 (file)
@@ -62,3 +62,17 @@ void llist_free(llist_t *elm, void (*freeit)(void *data))
                if (freeit) freeit(data);
        }
 }
+
+/* Reverse list order. Useful since getopt32 saves option params
+ * in reverse order */
+llist_t* rev_llist(llist_t *list)
+{
+       llist_t *new = NULL;
+       while (list) {
+               llist_t *next = list->link;
+               list->link = new;
+               new = list;
+               list = next;
+       }
+       return new;
+}