Skip to content

dll_dup*

Taras Maliukh edited this page Apr 15, 2020 · 1 revision

Synopsis:

dll_t *dll_dup(const dll_t *restrict dll,
    size_t start,
    size_t n);

dll_t *dll_dupkey(const dll_t *restrict dll,
    dll_obj_handler_fn_t,
    void *restrict any_data,
    size_t start,
    size_t n);

Description:

dll_dup: Creating a duplicate list with at most n objects from dll list, starting from start indexed object. dll_dupkey: The same as dll_dup, but duplicating only objects for which fn_match handler returns a zero.

Return value:

Pointer to new duplicated list otherwise NULL if:

  • dll is NULL
  • failed to allocate memory for new list
  • if DLL_BIT_EIGN is not specified:
    • list dll hasn't any objects
    • object with index start doesn't exit in dll list
    • failed to duplicate at least 1 object
Clone this wiki locally