Skip to content

dll_findkey

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

Synopsis:

dll_obj_t *dll_findkey(const dll_t *restrict dll,
    f_dll_obj_handler fn_serach,
    void *restrict any_data);
dll_obj_t *dll_findkeyr(const dll_t *restrict dll,
    f_dll_obj_handler fn_serach,
    void *restrict any_data);

Description:

  • dll_findkey: Find object by data(key) from start
  • dll_findkeyr: Find object by data(key) from end

The third argument(any_data) provided for more flexible use. It's just will be the second argument to your fn_search handler

Return value:

Pointer to desired object:

  • when fn_search returns a zero.

NULL:

  • when fn_serach returns a negative value or if the desired object doesn't exist in the list
  • dll is NULL
  • if DLL_BIT_EIGN is not specified:
    • fn_search is NULL
    • list dll hasn't any objects
    • data inside at least 1 object is pointed to NULL
Clone this wiki locally