20 if (functionList != NULL)
33 if (functionList != NULL)
47 if (functionList != NULL && function != NULL)
75 printf(
" Error! Out of memory while allocating or reallocating space for the function list!\n");
89 if (functionList != NULL && function != NULL)
93 if (functionList->
functions[index] == function)
95 foundIndex = (int)index;
109 if (functionList != NULL && functionIndex >= 0 && (
size_t)functionIndex < functionList->functions_count)
111 for (
size_t index = functionIndex; index < functionList->
allocation_count - 1; index++)
126 if (sourceList != NULL && destinationList != NULL)
129 destinationList->
functions = calloc(1, arraySize);
139 printf(
" Error! Out of memory copying a NumberChangedFunctionList!\n");
void NumberChangedFunctionList_Initialize(NumberChangedFunctionList *functionList)
Initialize the given function pointer list.
bool NumberChangedFunctionList_Add(NumberChangedFunctionList *functionList, NumberChangedFunction function)
Add a function pointer to the given function pointer list.
bool NumberChangedFunctionList_Copy(NumberChangedFunctionList *sourceList, NumberChangedFunctionList *destinationList)
Duplicate the given source function pointer list into the destination function pointer list.
void NumberChangedFunctionList_Remove(NumberChangedFunctionList *functionList, int functionIndex)
Removed the function pointer at the given index from the function pointer list.
int NumberChangedFunctionList_Find(NumberChangedFunctionList *functionList, NumberChangedFunction function)
Search the function list for the specified function pointer.
void NumberChangedFunctionList_Clear(NumberChangedFunctionList *functionList)
Clear the given function pointer list, releasing all associated memory. The function list can then be...
Declaration of the NumberChangedFunctionList structure along with its support functions,...
void(* NumberChangedFunction)(uint32_t)
Alias for a function that receives notifications about a number change.
Represents a dynamic list of function pointers of the type NumberChangedFunction.
size_t functions_count
Number of active function pointers in the functions array.
size_t allocation_count
The number of function pointers that can be held in the functions array.
NumberChangedFunction * functions
Array of function pointers.