| include/Zycore/List.h(3) | Library Functions Manual | include/Zycore/List.h(3) |
include/Zycore/List.h
#include <Zycore/Allocator.h>
#include <Zycore/Object.h>
#include <Zycore/Status.h>
#include <Zycore/Types.h>
struct ZyanListNode_
struct ZyanList_
#define ZYAN_LIST_INITIALIZER
#define ZYAN_LIST_GET(type, node) (*(const
type*)ZyanListGetNodeData(node))
typedef struct ZyanListNode_ ZyanListNode
typedef struct ZyanList_ ZyanList
ZYCORE_EXPORT ZYAN_REQUIRES_LIBC ZyanStatus
ZyanListInit (ZyanList *list, ZyanUSize element_size,
ZyanMemberProcedure destructor)
ZYCORE_EXPORT ZyanStatus ZyanListInitEx (ZyanList
*list, ZyanUSize element_size, ZyanMemberProcedure destructor,
ZyanAllocator *allocator)
ZYCORE_EXPORT ZyanStatus ZyanListInitCustomBuffer
(ZyanList *list, ZyanUSize element_size, ZyanMemberProcedure
destructor, void *buffer, ZyanUSize capacity)
ZYCORE_EXPORT ZyanStatus ZyanListDestroy (ZyanList
*list)
ZYCORE_EXPORT ZYAN_REQUIRES_LIBC ZyanStatus
ZyanListDuplicate (ZyanList *destination, const
ZyanList *source)
ZYCORE_EXPORT ZyanStatus ZyanListDuplicateEx
(ZyanList *destination, const ZyanList *source,
ZyanAllocator *allocator)
ZYCORE_EXPORT ZyanStatus ZyanListDuplicateCustomBuffer
(ZyanList *destination, const ZyanList *source, void *buffer,
ZyanUSize capacity)
ZYCORE_EXPORT ZyanStatus ZyanListGetHeadNode (const
ZyanList *list, const ZyanListNode **node)
ZYCORE_EXPORT ZyanStatus ZyanListGetTailNode (const
ZyanList *list, const ZyanListNode **node)
ZYCORE_EXPORT ZyanStatus ZyanListGetPrevNode (const
ZyanListNode **node)
ZYCORE_EXPORT ZyanStatus ZyanListGetNextNode (const
ZyanListNode **node)
ZYCORE_EXPORT const void * ZyanListGetNodeData (const
ZyanListNode *node)
ZYCORE_EXPORT ZyanStatus ZyanListGetNodeDataEx (const
ZyanListNode *node, const void **value)
ZYCORE_EXPORT void * ZyanListGetNodeDataMutable (const
ZyanListNode *node)
ZYCORE_EXPORT ZyanStatus ZyanListGetNodeDataMutableEx
(const ZyanListNode *node, void **value)
ZYCORE_EXPORT ZyanStatus ZyanListSetNodeData (const
ZyanList *list, const ZyanListNode *node, const void *value)
ZYCORE_EXPORT ZyanStatus ZyanListPushBack
(ZyanList *list, const void *item)
ZYCORE_EXPORT ZyanStatus ZyanListPushFront
(ZyanList *list, const void *item)
ZYCORE_EXPORT ZyanStatus ZyanListEmplaceBack
(ZyanList *list, void **item, ZyanMemberFunction constructor)
ZYCORE_EXPORT ZyanStatus ZyanListEmplaceFront
(ZyanList *list, void **item, ZyanMemberFunction constructor)
ZYCORE_EXPORT ZyanStatus ZyanListPopBack (ZyanList
*list)
ZYCORE_EXPORT ZyanStatus ZyanListPopFront
(ZyanList *list)
ZYCORE_EXPORT ZyanStatus ZyanListRemove (ZyanList
*list, const ZyanListNode *node)
ZYCORE_EXPORT ZyanStatus ZyanListRemoveRange
(ZyanList *list, const ZyanListNode *first, const
ZyanListNode *last)
ZYCORE_EXPORT ZyanStatus ZyanListClear (ZyanList
*list)
ZYCORE_EXPORT ZyanStatus ZyanListResize (ZyanList
*list, ZyanUSize size)
ZYCORE_EXPORT ZyanStatus ZyanListResizeEx
(ZyanList *list, ZyanUSize size, const void *initializer)
ZYCORE_EXPORT ZyanStatus ZyanListGetSize (const
ZyanList *list, ZyanUSize *size)
Implements a doubly linked list.
Returns the data value of the given node.
Parameters
Returns
Note that this function is unsafe and might dereference a null-pointer.
Value:.PP
{ \
/* allocator */ ZYAN_NULL, \
/* size */ 0, \
/* element_size */ 0, \
/* head */ ZYAN_NULL, \
/* destructor */ ZYAN_NULL, \
/* tail */ ZYAN_NULL, \
/* buffer */ ZYAN_NULL, \
/* capacity */ 0, \
/* first_unused */ ZYAN_NULL \
}
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.
Defines the ZyanListNode struct.
All fields in this struct should be considered as 'private'. Any changes may lead to unexpected behavior.
Erases all elements of the list.
Parameters
Returns
Destroys the given ZyanList instance.
Parameters
Returns
Initializes a new ZyanList instance by duplicating an existing list.
Parameters
Returns
The memory for the list is dynamically allocated by the default allocator.
Finalization with ZyanListDestroy is required for all instances created by this function.
Initializes a new ZyanList instance by duplicating an existing list and configures it to use a custom user defined buffer with a fixed size.
Parameters
This function will fail, if the capacity of the buffer is not sufficient to store all elements of the source list.
Returns
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.
Initializes a new ZyanList instance by duplicating an existing list and sets a custom allocator.
Parameters
Returns
Finalization with ZyanListDestroy is required for all instances created by this function.
Constructs an item in-place at the end of the list.
Parameters
Returns
Constructs an item in-place at the beginning of the list.
Parameters
Returns
Returns a pointer to the first ZyanListNode struct of the given list.
Parameters
Returns
Receives a pointer to the next ZyanListNode struct linked to the passed one.
Parameters
Returns
Returns a constant pointer to the data of the given node.
Parameters
Returns
Take a look at ZyanListGetNodeDataEx, if you need a function that returns a zyan status code.
Returns a constant pointer to the data of the given node..
Parameters
Take a look at ZyanListGetNodeData, if you need a function that directly returns a pointer.
Returns
Returns a mutable pointer to the data of the given node.
Parameters
Returns
Take a look at ZyanListGetPointerMutableEx instead, if you need a function that returns a zyan status code.
Returns a mutable pointer to the data of the given node..
Parameters
Take a look at ZyanListGetNodeDataMutable, if you need a function that directly returns a pointer.
Returns
Receives a pointer to the previous ZyanListNode struct linked to the passed one.
Parameters
Returns
Returns the current size of the list.
Parameters
Returns
Returns a pointer to the last ZyanListNode struct of the given list.
Parameters
Returns
Initializes the given ZyanList instance.
Parameters
Returns
The memory for the list elements is dynamically allocated by the default allocator.
Finalization with ZyanListDestroy is required for all instances created by this function.
Initializes the given ZyanList instance and configures it to use a custom user defined buffer with a fixed size.
Parameters
Returns
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.
Initializes the given ZyanList instance and sets a custom allocator.
Parameters
Returns
Finalization with ZyanListDestroy is required for all instances created by this function.
Removes the last element of the list.
Parameters
Returns
Removes the firstelement of the list.
Parameters
Returns
Adds a new item to the end of the list.
Parameters
Returns
Adds a new item to the beginning of the list.
Parameters
Returns
Removes the given node from the list.
Parameters
Returns
Removes multiple nodes from the list.
Parameters
Returns
Resizes the given ZyanList instance.
Parameters
Returns
Resizes the given ZyanList instance.
Parameters
Returns
Assigns a new data value to the given node.
Parameters
Returns
Generated automatically by Doxygen for Zycore from the source code.
| Version 1.5.2.0 | Zycore |