Declaration of the UIntArray structure and the supporting functions that represents an array of 32-bit unsigned integers. More...
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
Go to the source code of this file.
Classes | |
struct | UIntArray |
Represents an array of 32-bit unsigned integers. The data field points to a block of memory allocated on the heap and needs to be freed when the pointer is no longer needed. More... | |
Macros | |
#define | __UINTARRAY_H__ |
Functions | |
void | UIntArray_Initialize (UIntArray *array) |
Initialize the given UIntArray object. | |
void | UIntArray_Clear (UIntArray *array) |
Clear the given UIntArray object so it can be reused again. Releases the list of integers. | |
bool | UIntArray_AddInt (UIntArray *array, uint32_t value) |
Add an unsigned 32-bit integer to the given UIntArray object. | |
void | UIntArray_RemoveInt (UIntArray *array, int removeIndex) |
Remove the unsigned 32-bit integer from the given UIntArray object at the given index. All subsequent integers are moved up one. Does nothing if the index is not valid. | |
int | UIntArray_Find (UIntArray *array, uint32_t value) |
Search the given UIntArray object for the specified value and return the index of that found value. | |
bool | UIntArray_Copy (UIntArray *sourceArray, UIntArray *destinationArray) |
Copy the source UIntArray to the destination UIntArray. The destination UIntArray is erased before getting a copy of the contents of the source. | |
Declaration of the UIntArray structure and the supporting functions that represents an array of 32-bit unsigned integers.
Definition in file uintarray.h.
#define __UINTARRAY_H__ |
Definition at line 8 of file uintarray.h.
bool UIntArray_AddInt | ( | UIntArray * | array, |
uint32_t | value | ||
) |
Add an unsigned 32-bit integer to the given UIntArray object.
Definition at line 38 of file uintarray.c.
References UIntArray::allocatedLength, UIntArray::data, and UIntArray::length.
Referenced by DeviceChain_GetIdCodesForVisibleNodes(), and HandlerChain_AddWindow().
void UIntArray_Clear | ( | UIntArray * | array | ) |
Clear the given UIntArray object so it can be reused again. Releases the list of integers.
array | A UIntArray object to clear. |
Definition at line 26 of file uintarray.c.
References UIntArray::data, and UIntArray_Initialize().
Referenced by Facade_Exercise(), HandlerChain_SendMessage(), HandlerChain_ToString(), and UIntArray_Copy().
Copy the source UIntArray to the destination UIntArray. The destination UIntArray is erased before getting a copy of the contents of the source.
Definition at line 116 of file uintarray.c.
References UIntArray::allocatedLength, UIntArray::data, UIntArray::length, and UIntArray_Clear().
Referenced by HandlerChain_SendMessage(), and HandlerChain_ToString().
int UIntArray_Find | ( | UIntArray * | array, |
uint32_t | value | ||
) |
Search the given UIntArray object for the specified value and return the index of that found value.
array | The UIntArray object to search. |
value | The value to search for. |
Definition at line 93 of file uintarray.c.
References UIntArray::data, and UIntArray::length.
Referenced by HandlerChain_AddWindow(), and HandlerChain_RemoveWindow().
void UIntArray_Initialize | ( | UIntArray * | array | ) |
Initialize the given UIntArray object.
array | A UIntArray object to initialize. |
Definition at line 13 of file uintarray.c.
References UIntArray::allocatedLength, UIntArray::data, and UIntArray::length.
Referenced by Facade_Exercise(), and UIntArray_Clear().
void UIntArray_RemoveInt | ( | UIntArray * | array, |
int | removeIndex | ||
) |
Remove the unsigned 32-bit integer from the given UIntArray object at the given index. All subsequent integers are moved up one. Does nothing if the index is not valid.
array | The UIntArray object to update. |
removeIndex | Index of the value to remove. |
Definition at line 75 of file uintarray.c.
References UIntArray::allocatedLength, UIntArray::data, and UIntArray::length.
Referenced by HandlerChain_RemoveWindow().