chsvlib
chsv helper source code
chsvlist.h File Reference

The file contains the C definition of the binary list. More...

#include "chsverr.h"

Namespaces

 Chusov
 Basic chsvlib namespace.
 

Macros

#define LIST_ITERATOR_ERROR   ((::Chusov::HCHSVLISTITERATOR) -1)
 Service list iterator value indicating a system error.
 
#define LIST_ITERATOR_DOES_NOT_EXIST   ((::Chusov::HCHSVLISTITERATOR) 0)
 Service list iterator value indicating that a specified element has not been found.
 

Typedefs

typedef bool(* LPLISTELEMENTFUNCTION) (void *lpListElement, void *lpArg)
 A client callback function used in the function ListApplyFuncToElements() as a procedure over each element of the list. More...
 

Functions

EXTERN_C HCHSVLIST CreateList () noexcept
 Creates a binary growing list. More...
 
EXTERN_C bool CloseList (HCHSVLIST hList) noexcept
 Closes the list and frees occupied resources. More...
 
EXTERN_C bool ListPushBackValueByPtr (HCHSVLIST hList, void *lpVal) noexcept
 Inserts a pointer to the end of the list without copying any pointed data. More...
 
EXTERN_C bool ListPushFrontValueByPtr (HCHSVLIST hList, void *lpVal) noexcept
 Inserts a pointer to the beginning of the list without copying any pointed data. More...
 
EXTERN_C bool ListPushBackValueByValue (HCHSVLIST hList, const void *lpVal, std::size_t nValueSize) noexcept
 Creates the last element of the list and copies data into its buffers. More...
 
EXTERN_C bool ListPushFrontValueByValue (HCHSVLIST hList, const void *lpVal, std::size_t nValueSize) noexcept
 Creates the first element of the list and copies data into its buffers. More...
 
EXTERN_C void * ListFrontData (HCHSVLIST hList) noexcept
 Returns a pointer to data at the beginning of the list. More...
 
EXTERN_C void * ListBackData (HCHSVLIST hList) noexcept
 Returns a pointer to data at the end of the list. More...
 
EXTERN_C bool ListPopFront (HCHSVLIST hList) noexcept
 Removes the first element of the list and frees occupied resources. More...
 
EXTERN_C bool ListPopBack (HCHSVLIST hList) noexcept
 Removes the last element of the list and frees occupied resources. More...
 
EXTERN_C std::size_t ListGetSize (HCHSVLIST hList) noexcept
 Returns a number of elements in the list. More...
 
EXTERN_C HCHSVLISTITERATOR ListBegin (HCHSVLIST hList) noexcept
 Returns a handle to the iterator bound with the first element of the list. More...
 
EXTERN_C HCHSVLISTITERATOR ListEnd (HCHSVLIST hList) noexcept
 Returns a handle to the iterator bound with the last element of the list. More...
 
EXTERN_C HCHSVLISTITERATOR ListIterPrev (HCHSVLISTITERATOR hListIterator) noexcept
 Returns a handle to the iterator bound with the element located before the element bound with the specified iterator. More...
 
EXTERN_C HCHSVLISTITERATOR ListIterNext (HCHSVLISTITERATOR hListIterator) noexcept
 Returns a handle to the iterator bound with the element located after the element bound with the specified iterator. More...
 
EXTERN_C void * ListGetDataFromIter (HCHSVLISTITERATOR hListIterator) noexcept
 Returns a pointer to data bound with the specified iterator. More...
 
EXTERN_C std::size_t ListGetDataSizeFromIter (HCHSVLISTITERATOR hListIterator) noexcept
 Returns a size of the data bound with the specified iterator. More...
 
EXTERN_C bool ListIterSetValueByPtr (HCHSVLISTITERATOR hListIterator, void *pData) noexcept
 Replaces data of an element bound with the specified iterator by a new pointer without any copying operations. More...
 
EXTERN_C bool ListIterSetValueByValue (HCHSVLISTITERATOR hListIterator, const void *pData, std::size_t nDataSize) noexcept
 Replaces data of an element bound with the specified iterator by contents of a pointer with per byte copying operation. More...
 
EXTERN_C bool ListInsertValueAfterIterByPtr (HCHSVLISTITERATOR hListIterator, void *lpData) noexcept
 Creates a new list element with by-pointer insertion to the position after the one specified by the iterator. More...
 
EXTERN_C bool ListInsertValueBeforeIterByPtr (HCHSVLISTITERATOR hListIterator, void *lpData) noexcept
 Creates a new list element with by-pointer insertion to the position before the one specified by the iterator. More...
 
EXTERN_C bool ListInsertValueAfterIterByValue (HCHSVLISTITERATOR hListIterator, const void *lpData, std::size_t nDataSize) noexcept
 Creates a new list element to the position after the one specified by the iterator copying the specified content to the internal buffers. More...
 
EXTERN_C bool ListInsertValueBeforeIterByValue (HCHSVLISTITERATOR hListIterator, void *lpData, std::size_t nDataSize) noexcept
 Creates a new list element to the position before the one specified by the iterator copying the specified content to the internal buffers. More...
 
EXTERN_C bool ListPopElementByIter (HCHSVLISTITERATOR hListIterator) noexcept
 Removes the element identified by the iterator from the list. More...
 
EXTERN_C bool ListApplyFuncToElements (HCHSVLIST hList, LPLISTELEMENTFUNCTION lpfnForEach, void *lpArg)
 Executes the specified callback function over each element of the list. More...
 

Detailed Description

The file contains the C definition of the binary list.