|
Zycore 1.5.2.0
|
#include <Zycore/Allocator.h>#include <Zycore/Object.h>#include <Zycore/Status.h>#include <Zycore/Types.h>
Go to the source code of this file.
Classes | |
| struct | ZyanListNode_ |
| struct | ZyanList_ |
Macros | |
| #define | ZYAN_LIST_INITIALIZER |
| #define | ZYAN_LIST_GET(type, node) (*(const type*)ZyanListGetNodeData(node)) |
Typedefs | |
| typedef struct ZyanListNode_ | ZyanListNode |
| typedef struct ZyanList_ | ZyanList |
Implements a doubly linked list.
| #define ZYAN_LIST_GET | ( | type, | |
| node | |||
| ) | (*(const type*)ZyanListGetNodeData(node)) |
Returns the data value of the given node.
| type | The desired value type. |
| node | A pointer to the ZyanListNode struct. |
node.Note that this function is unsafe and might dereference a null-pointer.
| #define ZYAN_LIST_INITIALIZER |
Defines an uninitialized ZyanList instance.
Defines the ZyanList struct.
All fields in this struct should be considered as "private". Any changes may lead to unexpected behavior.
| typedef struct ZyanListNode_ ZyanListNode |
Defines the ZyanListNode struct.
All fields in this struct should be considered as "private". Any changes may lead to unexpected behavior.
| ZYCORE_EXPORT ZyanStatus ZyanListClear | ( | ZyanList * | list | ) |
Erases all elements of the list.
| list | A pointer to the ZyanList instance. |
| ZYCORE_EXPORT ZyanStatus ZyanListDestroy | ( | ZyanList * | list | ) |
Destroys the given ZyanList instance.
| list | A pointer to the ZyanList instance. |
| ZYCORE_EXPORT ZYAN_REQUIRES_LIBC ZyanStatus ZyanListDuplicate | ( | ZyanList * | destination, |
| const ZyanList * | source | ||
| ) |
Initializes a new ZyanList instance by duplicating an existing list.
| destination | A pointer to the (uninitialized) destination ZyanList instance. |
| source | A pointer to the source list. |
The memory for the list is dynamically allocated by the default allocator.
Finalization with ZyanListDestroy is required for all instances created by this function.
| ZYCORE_EXPORT ZyanStatus ZyanListDuplicateCustomBuffer | ( | ZyanList * | destination, |
| const ZyanList * | source, | ||
| void * | buffer, | ||
| ZyanUSize | capacity | ||
| ) |
Initializes a new ZyanList instance by duplicating an existing list and configures it to use a custom user defined buffer with a fixed size.
| destination | A pointer to the (uninitialized) destination ZyanList instance. |
| source | A pointer to the source list. |
| buffer | A pointer to the buffer that is used as storage for the elements. |
| capacity | The maximum capacity (number of bytes) of the buffer including the space required for the list-nodes. |
This function will fail, if the capacity of the buffer is not sufficient to store all elements of the source list.
The buffer capacity required to store n elements of type T is be calculated by: size = n * sizeof(ZyanListNode) + n * sizeof(T)
Finalization is not required for instances created by this function.
| ZYCORE_EXPORT ZyanStatus ZyanListDuplicateEx | ( | Zya |