*/
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;
/**
* @brief Return an allocated and initialized list.
* @param type Type of a list element (int, char*, ...).
- *
+ *
* Usage: List* list_new(<Type> 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.
/**
* @brief Check if the list is empty.
*/
-Bool list_empty(
+bool list_empty(
List* list ///< "this" pointer.
);
* @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) \
* @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) \
* @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) \
* @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) \
* @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) \
* @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) \
_list_insert_back(list, &tmp); \
}
-/**
+/**
* @brief Remove data at position given by 'listCell'.
*/
void list_remove(
/**
* @brief Tell if there is some data at the current index.
*/
-Bool listI_has_data(
+bool listI_has_data(
ListIterator* listI ///< "this" pointer.
);
* @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) \
* @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)
* @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) \
* @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) \