|
Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
Macros | |
| #define | VALIDATE_LIST(func, line, nl, list, target) |
Functions | |
| void | push (list_t *list, void *val) |
| Add to the end of the list. | |
| void * | pop (list_t *list) |
| Remove from the end of the list. | |
| void | unshift (list_t *list, void *val) |
| Add to the front of the list. | |
| void * | shift (list_t *list) |
| Remove from the front of the list. | |
| bool | addIdx (list_t *list, void *val, uint16_t index) |
| Add at an index in the list. | |
| void | addBefore (list_t *list, void *val, node_t *entry) |
| Insert a value into the list immediately before the given node. | |
| void | addAfter (list_t *list, void *val, node_t *entry) |
| Insert a value into the list immediately after the given node. | |
| void * | removeIdx (list_t *list, uint16_t index) |
| Remove at an index in the list. | |
| void * | removeEntry (list_t *list, node_t *entry) |
| Remove a specific entry from the linked list by node_t. | |
| void * | removeVal (list_t *list, void *val) |
| Remove a specific entry from the linked list by value and relink neighbors. | |
| void | clear (list_t *list) |
| Remove all items from the list. | |
| node_t * | getNextWraparound (list_t *list, node_t *node) |
| Get the next node, wrapping around to the first at the end of the list. | |
| #define VALIDATE_LIST | ( | func, | |
| line, | |||
| nl, | |||
| list, | |||
| target ) |
| void push | ( | list_t * | list, |
| void * | val ) |
Add to the end of the list.
| list | The list to add to |
| val | The value to be added |
| void * pop | ( | list_t * | list | ) |
Remove from the end of the list.
| list | The list to remove the last node from |
| void unshift | ( | list_t * | list, |
| void * | val ) |
Add to the front of the list.
| list | The list to add to |
| val | The value to add to the list |
| void * shift | ( | list_t * | list | ) |
Remove from the front of the list.
| list | The list to remove from |
| bool addIdx | ( | list_t * | list, |
| void * | val, | ||
| uint16_t | index ) |
Add at an index in the list.
| list | The list to add to |
| val | The value to add |
| index | The index to add the value at |
Insert a value into the list immediately before the given node.
If the given node is NULL, inserts at the end of the list
| list | The list to add the entry to |
| val | The new value to add to the list |
| entry | The existing entry, after which to insert the value |
Insert a value into the list immediately after the given node.
If the given node is NULL, inserts at the beginning of the list
| list | The list to add the entry to |
| val | The new value to add to the list |
| entry | The existing entry, after which to insert the value |
| void * removeIdx | ( | list_t * | list, |
| uint16_t | index ) |
Remove at an index in the list.
| list | The list to remove from |
| index | The index to remove the value from |
Remove a specific entry from the linked list by node_t.
This relinks the entry's neighbors, but does not validate that it was part of the given list_t. If the given node_t was not part of the given list_t, the list length will desync.
| list | The list to remove an entry from |
| entry | The entry to remove |
| void * removeVal | ( | list_t * | list, |
| void * | val ) |
Remove a specific entry from the linked list by value and relink neighbors.
If the given value was not part of the given list_t, nothing will happen.
| list | The list to remove an entry from |
| val | The value to remove from the list |
| void clear | ( | list_t * | list | ) |
Remove all items from the list.
| list | The list to clear |