28 #ifndef _RTXARRAYLIST_H_ 29 #define _RTXARRAYLIST_H_ 33 #define OSRT_ARRAYLIST_CAPACITY 10 35 typedef struct _OSRTArrayList {
40 OSBOOL (*equalsFunc)(
void*,
void*,OSSIZE);
43 typedef struct _OSRTArrayListIter {
44 const OSRTArrayList* pArrayList;
66 (OSRTArrayList* pArrayList, OSSIZE capacity);
100 (
OSCTXT* pctxt, OSRTArrayList* pArrayList,
void* pdata, OSSIZE* pindex);
110 (
OSCTXT* pctxt, OSRTArrayList* pArrayList,
void* pdata);
121 (
OSCTXT* pctxt, OSRTArrayList* pArrayList, OSSIZE idx);
134 (
OSCTXT* pctxt, OSRTArrayList* pArrayList,
void* pdata, OSSIZE idx);
147 (OSRTArrayList* pArrayList,
void* pdata, OSSIZE idx);
158 (
const OSRTArrayList* pArrayList, OSSIZE idx);
184 const OSRTArrayList* pArrayList, OSSIZE startIndex);
EXTERNRT void rtxArrayListRemoveIndexed(OSCTXT *pctxt, OSRTArrayList *pArrayList, OSSIZE idx)
This function removes the element at the given index from the array list.
EXTERNRT OSRTArrayList * rtxNewArrayList(OSCTXT *pctxt, OSSIZE capacity)
This function creates a new array list to hold the initial capacity of elements.
EXTERNRT int rtxArrayListAdd(OSCTXT *pctxt, OSRTArrayList *pArrayList, void *pdata, OSSIZE *pindex)
This function adds an element to an array list.
EXTERNRT void rtxArrayListRemove(OSCTXT *pctxt, OSRTArrayList *pArrayList, void *pdata)
This function removes an element from an array list.
This is the main list structure.
EXTERNRT OSBOOL rtxArrayListHasNextItem(OSRTArrayListIter *piter)
This function determines if another element exists at the next sequential position in the array list...
Common run-time context definitions.
EXTERNRT void * rtxArrayListNextItem(OSRTArrayListIter *piter)
This function gets the next item from the array list.
EXTERNRT void rtxFreeArrayList(OSCTXT *pctxt, OSRTArrayList *pArrayList)
This function frees all dynamic memory held by the array list.
This structure is used to hold a single data item within the list.
EXTERNRT int rtxArrayListInsert(OSCTXT *pctxt, OSRTArrayList *pArrayList, void *pdata, OSSIZE idx)
This function inserts an element at the given position in the array list.
EXTERNRT int rtxArrayListInitIter(OSRTArrayListIter *piter, const OSRTArrayList *pArrayList, OSSIZE startIndex)
This function initializes an array list iterator with the given start index.
EXTERNRT void * rtxArrayListGetIndexed(const OSRTArrayList *pArrayList, OSSIZE idx)
This function gets the indexed data item from the array list.
EXTERNRT int rtxArrayListIndexOf(OSRTArrayList *pArrayList, void *pdata)
This function returns the index of the given data item in the list.
Run-time context structure.
EXTERNRT void rtxArrayListInit(OSRTArrayList *pArrayList, OSSIZE capacity)
This function initializes an array list structure.
EXTERNRT int rtxArrayListReplace(OSRTArrayList *pArrayList, void *pdata, OSSIZE idx)
This function replaces (overwrites) the element at the given position in the array list with the new ...