|
MGE General C Library - API Documentation v1.9.0
Library of general C functions.
|
Builds, traverses and releases a doubly linked list. More...
#include <errno.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <libmgec/dllist.h>#include <libmgec/mge-errno.h>
Functions | |
| static void | free_dll_node (struct dllistnode *currentnode) |
| struct dllistnode * | add_dll_node (struct dllistnode *currentnode, const void *object, size_t objsize) |
| Add a node to the tail of the doubly linked list. | |
| struct dllistnode * | free_dllist (struct dllistnode *currentnode) |
| Free the entire list. | |
Builds, traverses and releases a doubly linked list.
Build, manipulate and bi-directional traverse functionality for doubly linked lists.
Released under the GPLv3 only.
SPDX-License-Identifier: GPL-3.0-only
| struct dllistnode * add_dll_node | ( | struct dllistnode * | currentnode, |
| const void * | object, | ||
| size_t | objsize | ||
| ) |
Add a node to the tail of the doubly linked list.
On error mge_errno will be set.
| currentnode | A pointer to the first node or NULL if list not yet started. |
| object | Object to be attached to the node. |
| objsize | Size of object. |
|
static |
| struct dllistnode * free_dllist | ( | struct dllistnode * | currentnode | ) |
Free the entire list.
Remove all nodes and free memory allocated to the dllist. Walks the list deleting nodes.
| currentnode | The root node. |