diff -r d5d6ab809ad3 -r deb0035635eb src/ucx/list.h --- a/src/ucx/list.h Wed May 09 20:15:10 2018 +0200 +++ b/src/ucx/list.h Fri May 11 17:40:16 2018 +0200 @@ -232,8 +232,6 @@ * Inserts an element at the end of the list, if it is not present in the list, * using a UcxAllocator. * - * See ucx_list_append() for details. - * * @param allocator the allocator to use * @param list the list where to append the data, or NULL to * create a new list @@ -248,6 +246,38 @@ UcxList *list, void *data, cmp_func cmpfnc, void *cmpdata); /** + * Inserts an element at the beginning of the list, if it is not present + * in the list. + * + * + * @param list the list where to prepend the data, or NULL to + * create a new list + * @param data the data to insert + * @param cmpfnc the compare function + * @param cmpdata additional data for the compare function + * @return a pointer to the new list head + * @see ucx_list_prepend() + */ +UcxList *ucx_list_prepend_once(UcxList *list, void *data, + cmp_func cmpfnc, void *cmpdata); + +/** + * Inserts an element at the beginning of the list, if it is not present in + * the list, using a UcxAllocator. + * + * @param allocator the allocator to use + * @param list the list where to prepend the data, or NULL to + * create a new list + * @param data the data to insert + * @param cmpfnc the compare function + * @param cmpdata additional data for the compare function + * @return a pointer to the new list head + * @see ucx_list_prepend_a() + */ +UcxList *ucx_list_prepend_once_a(UcxAllocator *allocator, + UcxList *list, void *data, cmp_func cmpfnc, void *cmpdata); + +/** * Inserts an element at the beginning of the list. * * You should overwrite the old list pointer by calling