Skip to content

dll_new

Taras Maliukh edited this page Apr 11, 2020 · 2 revisions

Synopsis:

dll_obj_t *dll_new(void *restrict data,
    size_t size,
    dll_bits_t bits,
    f_dll_obj_data_del fn_del);

Description:

Create a new list object

For specifying behavior for this object - set bits using this bits

!! Strongly recommended to setup fn_del if you allocating memory inside data

Return value:

Pointer to the allocated memory otherwise NULL if:

  • memory allocation failed
  • if DLL_BIT_DUP specified:
    • failed to allocate memory for duplicate size-n bytes of data
  • if DLL_BIT_EIGN is not specified:
    • passed invalid bits mask
    • data is NULL
    • size is 0
Clone this wiki locally