Skip to content

dll_get*

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

Synopsis:

size_t dll_getsize(const dll_t *restrict dll);
dll_obj_t *dll_gethead(const dll_t *restrict dll);
dll_obj_t *dll_getlast(const dll_t *restrict dll);

void *dll_getdata(const dll_obj_t *restrict dll_obj);
size_t dll_getdatasize(const dll_obj_t *restrict dll_obj);
dll_obj_t *dll_getprev(const dll_obj_t *restrict dll_obj);
dll_obj_t *dll_getnext(const dll_obj_t *restrict dll_obj);

size_t	dll_getid(const dll_t *restrict dll, const dll_obj_t *restrict dll_obj);

Description:

  • dll_getsize: Get a current count of objects in list
  • dll_gethead: Get a current first object in list
  • dll_getlast: Get a current last object in list
  • dll_getdata: Get a pointer to data in object
  • dll_getdatasize: Get a size of data in object
  • dll_getprev: Get a previous object
  • dll_getnext: Get a next object
  • dll_getid: Get a index of object in list

Return value:

Some value otherwise 0 if:

  • dll_getdatasize, dll_getsize:
    • pointer to object\list is NULL
  • dll_getid:
    • pointer to object\list is NULL
    • dll_obj object is not pointing to any object in list
    • if DLL_BIT_EIGN is not specified:
      • list dll hasn't any objects

Pointer otherwise NULL if:

  • dll_getnext, dll_getprev, dll_getdata, dll_getlast, dll_gethead:
    • pointer to object\list is NULL
    • list is empty
    • data inside object is pointed to NULL
Clone this wiki locally