Skip to content

dll_del*

Taras Maliukh edited this page Apr 12, 2020 · 4 revisions

Synopsis:

bool dll_del(dll_t *restrict dll,
    dll_obj_t *restrict dll_obj);
size_t dll_deln(dll_t *restrict dll,
    size_t start,
    size_t n);

bool dll_delkey(dll_t *restrict dll,
    f_dll_obj_handler fn_search_del,
    void *restrict any_data);
bool dll_delkeyr(dll_t *restrict dll,
    f_dll_obj_handler fn_search_del,
    void *restrict any_data);

bool dll_delid(dll_t *restrict dll,
    size_t index);
bool dll_delidr(dll_t *restrict dll,
    size_t index);

Description:

  • dll_del: Delete links to given object via dll_unlink and free it via dll_freeobj
  • dll_deln: Delete links and free it to at most n object in dll list, starting from start indexed object
  • dll_delkey: Delete object by data(key) from start via dll_findkey
  • dll_delkeyr: Delete object by data(key) from end via dll_findkeyr
  • dll_delid: Delete object by index via dll_findid
  • dll_delidr: Delete object by index via dll_findidr

The third argument(any_data) in dll_delkey and dll_delkeyrprovided for more flexible use as in dll_findkey

Return value:

  • dll_deln: count of deleted objects otherwise 0 if:
  • some errors occurred when calling dll_findkey or some errors occurred when calling dll_del true when object deleted otherwise false if:
  • dll_del: some errors occurred when calling dll_unlink or dll_freeobj
  • dll_delkey, dll_delkeyr: some errors occurred when calling dll_findkey,dll_findkeyr or dll_del
  • dll_delid, dll_delidr: some errors occurred when calling dll_findid,dll_findidr or dll_del
Clone this wiki locally