Code

utils llist: Added sdb_llist_get().
[sysdb.git] / src / include / utils / llist.h
index 2742139f17db051d12b36c279889ff0c0bbfb48f..3eefae5e19b894adf457a5d195e7840a11f79757 100644 (file)
@@ -119,6 +119,13 @@ int
 sdb_llist_insert_sorted(sdb_llist_t *list,
                sdb_object_t *obj, sdb_llist_cmp_cb);
 
+/*
+ * sdb_llist_get:
+ * Returns the i-th element of the list or NULL in case of an error.
+ */
+sdb_object_t *
+sdb_llist_get(sdb_llist_t *list, size_t i);
+
 /*
  * sdb_llist_search:
  * Search for a object in the given 'list'. The function will return the first
@@ -203,6 +210,13 @@ sdb_llist_iter_get_next(sdb_llist_iter_t *iter);
 int
 sdb_llist_iter_remove_current(sdb_llist_iter_t *iter);
 
+/*
+ * sdb_llist_len:
+ * Return the length (number of elements) of the list.
+ */
+size_t
+sdb_llist_len(sdb_llist_t *list);
+
 #ifdef __cplusplus
 } /* extern "C" */
 #endif