X-Git-Url: https://git.auder.net/?p=cgds.git;a=blobdiff_plain;f=src%2FList.h;fp=src%2FList.h;h=0a36ea0177d55f0fa3056a87bd00fd78f7cd2f12;hp=3e1c4ad7b9ff3bf662795e030fc85f2e56b5d7bb;hb=1ff641f9960fa6c6081817a5641afb22fad91dcd;hpb=71e16e325e3936549a5f3a140e6298fce333fd27 diff --git a/src/List.h b/src/List.h index 3e1c4ad..0a36ea0 100644 --- a/src/List.h +++ b/src/List.h @@ -28,7 +28,7 @@ typedef struct ListCell { */ typedef struct List { UInt size; ///< Count elements in the list. - size_t dataSize; ///< Size of a list cell elements in bytes. + size_t dataSize; ///< Size of a list cell element in bytes. ListCell* head; ///< Pointer to the first cell in the list. ListCell* tail; ///< Pointer to the last cell in the list. } List; @@ -52,14 +52,14 @@ List* _list_new( /** * @brief Return an allocated and initialized list. * @param type Type of a list element (int, char*, ...). - * + * * Usage: List* list_new( type) */ #define list_new(type) \ _list_new(sizeof(type)) /** - * @brief Copy constructor (works well if items do not have allocated sub-pointers). + * @brief Copy constructor (shallow copy, ok for basic types). */ List* list_copy( List* list ///< "this" pointer. @@ -68,7 +68,7 @@ List* list_copy( /** * @brief Check if the list is empty. */ -Bool list_empty( +bool list_empty( List* list ///< "this" pointer. ); @@ -90,7 +90,7 @@ void* _list_get( * @brief Get data at the given list cell argument. * @param listCell Pointer to a cell inside "this" list. * @param data Data to be assigned. - * + * * Usage: void list_get(ListCell* listCell, void data) */ #define list_get(listCell, data) \ @@ -113,7 +113,7 @@ void _list_set( * @param list "this" pointer. * @param listCell Pointer to a cell inside "this" list. * @param data Data to be set. - * + * * Usage: void list_set(List* list, ListCell* listCell, void data); */ #define list_set(list, listCell, data) \ @@ -144,7 +144,7 @@ void _list_insert_before( * @param list "this" pointer. * @param listCell Pointer to a cell inside "this" list. * @param data Data to be inserted. - * + * * Usage: void list_insert_before(List* list, ListCell* listCell, void data) */ #define list_insert_before(list, listCell, data) \ @@ -167,7 +167,7 @@ void _list_insert_after( * @param list "this" pointer. * @param listCell Pointer to a cell inside "this" list. * @param data Data to be inserted. - * + * * Usage: void list_insert_after(List* list, ListCell* listCell, void data) */ #define list_insert_after(list, listCell, data) \ @@ -188,7 +188,7 @@ void _list_insert_front( * @brief Add data at the beginning of the list. * @param list "this" pointer. * @param data Data to be inserted. - * + * * Usage: void list_insert_front(List* list, void data) */ #define list_insert_front(list, data) \ @@ -209,7 +209,7 @@ void _list_insert_back( * @brief Add data at the end of the list. * @param list "this" pointer. * @param data Data to be inserted. - * + * * Usage: void list_insert_back(List* list, void data) */ #define list_insert_back(list, data) \ @@ -218,7 +218,7 @@ void _list_insert_back( _list_insert_back(list, &tmp); \ } -/** +/** * @brief Remove data at position given by 'listCell'. */ void list_remove( @@ -290,7 +290,7 @@ void listI_reset_tail( /** * @brief Tell if there is some data at the current index. */ -Bool listI_has_data( +bool listI_has_data( ListIterator* listI ///< "this" pointer. ); @@ -298,7 +298,7 @@ Bool listI_has_data( * @brief Return data contained in the current list cell. * @param listI "this" pointer. * @param data Data to be assigned. - * + * * Usage: void listI_get(ListIterator* listI, void data) */ #define listI_get(listI, data) \ @@ -308,8 +308,8 @@ Bool listI_has_data( * @brief Set data at the current iterator position. * @param listI "this" pointer * @param data Data to assign. - * - * Usage: void listI_set(ListIterator* listI, void data); + * + * Usage: void listI_set(ListIterator* listI, void data); */ #define listI_set(listI, data) \ list_set(listI->list, listI->current, data) @@ -318,7 +318,7 @@ Bool listI_has_data( * @brief Add data before current list cell. * @param listI "this" pointer * @param data Data to be inserted. - * + * * Usage: void listI_insert_before(ListIteratorI* listI, void data) */ #define listI_insert_before(listI, data) \ @@ -328,7 +328,7 @@ Bool listI_has_data( * @brief Add data after current list cell. * @param listI "this" pointer * @param data Data to be inserted. - * + * * Usage: void listI_insert_after(ListIteratorI* listI, void data) */ #define listI_insert_after(listI, data) \