Code

utils llist: Added sdb_llist_iter_remove_current().
[sysdb.git] / src / include / utils / llist.h
index 104c9e45ab94c2e08a8aca2feb5e84ba57a2e1db..2742139f17db051d12b36c279889ff0c0bbfb48f 100644 (file)
@@ -173,7 +173,8 @@ sdb_llist_remove(sdb_llist_t *list,
 sdb_object_t *
 sdb_llist_shift(sdb_llist_t *list);
 
-/* sdb_llist_get_iter, sdb_llist_iter_has_next, sdb_llist_iter_get_next:
+/*
+ * sdb_llist_get_iter, sdb_llist_iter_has_next, sdb_llist_iter_get_next:
  * Iterate through the list, element by element.
  *
  * sdb_llist_iter_get_next returns NULL if there is no next element.
@@ -188,6 +189,20 @@ sdb_llist_iter_has_next(sdb_llist_iter_t *iter);
 sdb_object_t *
 sdb_llist_iter_get_next(sdb_llist_iter_t *iter);
 
+/*
+ * sdb_llist_iter_remove_current:
+ * Remove the current object from the list, that is, the object which was
+ * returned by the last call to sdb_llist_iter_get_next().
+ *
+ * This operation is not safe if another iterator is in use at the same time.
+ *
+ * Returns:
+ *  - 0 on success
+ *  - a negative value else
+ */
+int
+sdb_llist_iter_remove_current(sdb_llist_iter_t *iter);
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif