List
The RList module is a simple growable list suitable for storing simple primitive data values or pointers to arbitrary objects.
API Tour
To create a list:
Lists can be created so that when the list is freed, each of the list items will also be freed.
If the flags
are set to R_DYNAMIC_VALUE, then rFree() will be called on each list item when the list is freed. If the flags are set to R_STATIC_VALUE (the default), then list items will not be freed.
To free a list:
To add an item to the end of the list:
To clear the list:
To get the number of items in the list:
To iterate over items in a list:
ITERATE_ITEMS is defined as:
To get an item from the list at a specific index position:
To insert an item at a specific position. This will insert myObject at index 4.
To remove an item:
To grow a list:
To push and pop items:
API Reference
The full API is specified here: