List implementation.
More...
|
| size_t | length (const void *self) |
| | Get list length. More...
|
| |
| void * | get (const void *self, int idx) |
| | Get list item. More...
|
| |
| void | append (void *self, const void *obj) |
| | Append object to list. More...
|
| |
| void | preprend (void *self, const void *obj) |
| | Prepend object to list. More...
|
| |
| void | insert (void *self, int i, const void *obj) |
| | Insert object into list. More...
|
| |
| void * | pop (const void *self, int i) |
| | Remove object from list and return it. More...
|
| |
| bool | contains (const void *self, const void *object) |
| | Check if object is in the collection. More...
|
| |
| void | clear (void *self) |
| | Remove all items from iterable. More...
|
| |
| void * | next (const void *self, const void *iterator) |
| |
| void * | ref (void *self) |
| | Increment object's reference counter. More...
|
| |
| void | unref (void *self) |
| | Decrement object's reference counter, if equals 0, delete the object. More...
|
| |
| bool | equal (const void *self, const void *other) |
| | Check objects equality. More...
|
| |
| void append |
( |
void * |
self, |
|
|
const void * |
obj |
|
) |
| |
Append object to list.
- Parameters
-
| void * get |
( |
const void * |
self, |
|
|
int |
idx |
|
) |
| |
Get list item.
- Parameters
-
| self | List object. |
| idx | Item index. |
- Returns
- Item object.
| void insert |
( |
void * |
self, |
|
|
int |
i, |
|
|
const void * |
obj |
|
) |
| |
Insert object into list.
- Parameters
-
| self | List object. |
| i | Position at which the object must be inserted. |
| obj | Object to insert. |
| size_t length |
( |
const void * |
self | ) |
|
Get list length.
- Parameters
-
- Returns
- List size.
| void * pop |
( |
const void * |
self, |
|
|
int |
i |
|
) |
| |
Remove object from list and return it.
- Parameters
-
| self | List object. |
| i | Position of the object to pop (or -1 for the last one) |
- Returns
- Item object.
| void preprend |
( |
void * |
self, |
|
|
const void * |
obj |
|
) |
| |
Prepend object to list.
- Parameters
-