alist: Add a function to empty the list
Sometimes it is useful to empty the list without de-allocating any of
the memory used, e.g. when the list will be re-populated immediately
afterwards.
Add a new function for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/include/alist.h b/include/alist.h
index 0090b9c..c639e42 100644
--- a/include/alist.h
+++ b/include/alist.h
@@ -275,6 +275,13 @@
_pos++)
/**
+ * alist_empty() - Empty an alist
+ *
+ * This removes all entries from the list, without changing the allocated size
+ */
+void alist_empty(struct alist *lst);
+
+/**
* alist_init() - Set up a new object list
*
* Sets up a list of objects, initially empty