210 * the newly created list otherwise |
210 * the newly created list otherwise |
211 * @see ucx_list_append() |
211 * @see ucx_list_append() |
212 */ |
212 */ |
213 UcxList *ucx_list_append_a(UcxAllocator *allocator, UcxList *list, void *data); |
213 UcxList *ucx_list_append_a(UcxAllocator *allocator, UcxList *list, void *data); |
214 |
214 |
215 /** |
|
216 * Inserts an element at the end of the list, if it is not present in the list. |
|
217 * |
|
218 * <b>Note:</b> You should not try to store a freshly allocated object. Since |
|
219 * it might be a duplicate, the memory allocated for that copy would be leaking |
|
220 * afterwards. |
|
221 * |
|
222 * <b>Deprecation notice:</b> This function is considered to do more harm than |
|
223 * it adds usefulness and is going to be removed in a future UCX release. |
|
224 * |
|
225 * @param list the list where to append the data, or <code>NULL</code> to |
|
226 * create a new list |
|
227 * @param data the data to insert |
|
228 * @param cmpfnc the compare function |
|
229 * @param cmpdata additional data for the compare function |
|
230 * @return <code>list</code>, if it is not <code>NULL</code> or a pointer to |
|
231 * the newly created list otherwise |
|
232 * @see ucx_list_append() |
|
233 */ |
|
234 UcxList *ucx_list_append_once(UcxList *list, void *data, |
|
235 cmp_func cmpfnc, void *cmpdata); |
|
236 |
|
237 /** |
|
238 * Inserts an element at the end of the list, if it is not present in the list, |
|
239 * using a UcxAllocator. |
|
240 * |
|
241 * <b>Note:</b> You should not try to store a freshly allocated object. Since |
|
242 * it might be a duplicate, the memory allocated for that copy would be leaking |
|
243 * afterwards. |
|
244 * |
|
245 * <b>Deprecation notice:</b> This function is considered to do more harm than |
|
246 * it adds usefulness and is going to be removed in a future UCX release. |
|
247 * |
|
248 * @param allocator the allocator to use |
|
249 * @param list the list where to append the data, or <code>NULL</code> to |
|
250 * create a new list |
|
251 * @param data the data to insert |
|
252 * @param cmpfnc the compare function |
|
253 * @param cmpdata additional data for the compare function |
|
254 * @return <code>list</code>, if it is not <code>NULL</code> or a pointer to |
|
255 * the newly created list otherwise |
|
256 * @see ucx_list_append_a() |
|
257 */ |
|
258 UcxList *ucx_list_append_once_a(UcxAllocator *allocator, |
|
259 UcxList *list, void *data, cmp_func cmpfnc, void *cmpdata); |
|
260 |
|
261 /** |
|
262 * Inserts an element at the beginning of the list, if it is not present |
|
263 * in the list. |
|
264 * |
|
265 * <b>Note:</b> You should not try to store a freshly allocated object. Since |
|
266 * it might be a duplicate, the memory allocated for that copy would be leaking |
|
267 * afterwards. |
|
268 * |
|
269 * <b>Deprecation notice:</b> This function is considered to do more harm than |
|
270 * it adds usefulness and is going to be removed in a future UCX release. |
|
271 * |
|
272 * @param list the list where to prepend the data, or <code>NULL</code> to |
|
273 * create a new list |
|
274 * @param data the data to insert |
|
275 * @param cmpfnc the compare function |
|
276 * @param cmpdata additional data for the compare function |
|
277 * @return a pointer to the new list head |
|
278 * @see ucx_list_prepend() |
|
279 */ |
|
280 UcxList *ucx_list_prepend_once(UcxList *list, void *data, |
|
281 cmp_func cmpfnc, void *cmpdata); |
|
282 |
|
283 /** |
|
284 * Inserts an element at the beginning of the list, if it is not present in |
|
285 * the list, using a UcxAllocator. |
|
286 * |
|
287 * <b>Note:</b> You should not try to store a freshly allocated object. Since |
|
288 * it might be a duplicate, the memory allocated for that copy would be leaking |
|
289 * afterwards. |
|
290 * |
|
291 * <b>Deprecation notice:</b> This function is considered to do more harm than |
|
292 * it adds usefulness and is going to be removed in a future UCX release. |
|
293 * |
|
294 * @param allocator the allocator to use |
|
295 * @param list the list where to prepend the data, or <code>NULL</code> to |
|
296 * create a new list |
|
297 * @param data the data to insert |
|
298 * @param cmpfnc the compare function |
|
299 * @param cmpdata additional data for the compare function |
|
300 * @return a pointer to the new list head |
|
301 * @see ucx_list_prepend_a() |
|
302 */ |
|
303 UcxList *ucx_list_prepend_once_a(UcxAllocator *allocator, |
|
304 UcxList *list, void *data, cmp_func cmpfnc, void *cmpdata); |
|
305 |
215 |
306 /** |
216 /** |
307 * Inserts an element at the beginning of the list. |
217 * Inserts an element at the beginning of the list. |
308 * |
218 * |
309 * You <i>should</i> overwrite the old list pointer by calling |
219 * You <i>should</i> overwrite the old list pointer by calling |