|
Coconut Framework
beta
|
Define CNList data structure. More...
Go to the source code of this file.
Classes | |
| struct | CNList |
| List of pointers. More... | |
Functions | |
| static struct CNList | CNMakeEmptyList (struct CNResource *resource) |
| Initialize CNList. More... | |
| void | CNDestroyList (struct CNList *dst) |
| Destroy CNObject(s) in the list and list items. More... | |
| static size_t | CNCountOfItemsInList (const struct CNList *src) |
| Get count of items in the list. More... | |
| static struct CNListItem * | CNFirstListItem (const struct CNList *src) |
| Get 1st item in the list. More... | |
| static struct CNListItem * | CNLastListItem (const struct CNList *src) |
| Get last item in the list. More... | |
| static struct CNListItem * | CNCentinelListItem (const struct CNList *src) |
| Get centinel item of the list. More... | |
| void | CNAppendItemToList (struct CNList *dst, void *src) |
| Append object to the list. More... | |
| void | CNPrependItemToList (struct CNList *dst, void *src) |
| Prepend object to the list. More... | |
| struct CNList | CNCopyList (const struct CNList *src) |
| Make the copy of source list. More... | |
| void | CNInsertItemToList (struct CNList *owner, struct CNListItem *prev, void *src) |
| Insert item to the list. More... | |
| void | CNInsertItemsToList (struct CNList *owner, struct CNListItem *prev, const struct CNList *src) |
| Insert items to the list. More... | |
| void * | CNUnlinkItemFromList (struct CNList *owner, struct CNListItem *dst) |
| Unlink an item from the list and return it's data. More... | |
| void * | CNUnlinkFirstItemFromList (struct CNList *dst) |
| Get and unlink 1st item in the list. More... | |
| void * | CNUnlinkLastItemFromList (struct CNList *dst) |
| Get and unlink last item in the list. More... | |
| void | CNMoveList (struct CNList *dst, struct CNList *src) |
| Move items from source to destination. More... | |
| void | CNAppendItemsToList (struct CNList *dst, struct CNList *src) |
| Copy items from source to destination. More... | |
| struct CNListItem * | CNSearchDataInList (const struct CNList *list, void *data) |
| Search list item which has source data reference. More... | |
| struct CNListItem * | CNSearchMatchedDataInList (const struct CNList *list, CNMatchDataFuncRef func, void *info) |
| Search list item which matched source data. More... | |
Define CNList data structure.
|
static |
Initialize CNList.
| resource | Resource for the list |
References CNList::centinelItem, CNAllocateListItem(), CNList::itemCount, and CNList::resource.
Referenced by CNMakeEmptyObjectList().
| void CNDestroyList | ( | struct CNList * | dst | ) |
Destroy CNObject(s) in the list and list items.
| dst | Destination list |
|
inlinestatic |
Get count of items in the list.
| src | Source list |
References CNList::itemCount.
Referenced by CNCountOfObjectsInList().
|
static |
Get 1st item in the list.
| src | Source list |
References CNListItem::_nextItem, and CNList::centinelItem.
Referenced by CNFirstListObject().
|
static |
Get last item in the list.
| src | Source list |
References CNListItem::_prevItem, and CNList::centinelItem.
Referenced by CNLastListObject().
|
static |
Get centinel item of the list.
| src | Source list |
References CNList::centinelItem.
Referenced by CNCentinelListObject().
| void CNAppendItemToList | ( | struct CNList * | dst, |
| void * | src | ||
| ) |
Append object to the list.
| dst | Destination list |
| src | Source object |
Referenced by CNAppendObjectToList().
| void CNPrependItemToList | ( | struct CNList * | dst, |
| void * | src | ||
| ) |
Prepend object to the list.
| dst | Destination list |
| src | Source object |
Referenced by CNPrependObjectToList().
Make the copy of source list.
| src | Source list |
| void CNInsertItemToList | ( | struct CNList * | owner, |
| struct CNListItem * | prev, | ||
| void * | src | ||
| ) |
Insert item to the list.
| owner | Destination list |
| prev | Item in the owner list, the source data will be linked as the next of this. |
| src | Source data |
Referenced by CNInsertObjectToList().
| void CNInsertItemsToList | ( | struct CNList * | owner, |
| struct CNListItem * | prev, | ||
| const struct CNList * | src | ||
| ) |
Insert items to the list.
| owner | Destination list |
| prev | Item in the owner list, the source data will be linked as the next of this. |
| src | Source data list |
| void* CNUnlinkItemFromList | ( | struct CNList * | owner, |
| struct CNListItem * | dst | ||
| ) |
Unlink an item from the list and return it's data.
| owner | Destination list |
| dst | Destination list item to be removed |
Referenced by CNUnlinkObjectFromList().
| void* CNUnlinkFirstItemFromList | ( | struct CNList * | dst | ) |
Get and unlink 1st item in the list.
| data | Pointer of the 1st item |
| NULL | There are not items in the list |
| dst | Source and destination list After this operation, the 1st item will be removed from list |
Referenced by CNUnlinkFirstObjectFromList().
| void* CNUnlinkLastItemFromList | ( | struct CNList * | dst | ) |
Get and unlink last item in the list.
| data | Pointer of the 1st item |
| NULL | There are not items in the list |
| dst | Source and destination list After this operation, the last item will be removed from list |
Referenced by CNUnlinkLastObjectFromList().
Move items from source to destination.
| dst | Destination list |
| src | Source list |
Referenced by CNMoveObjectList().
Copy items from source to destination.
| dst | Destination list |
| src | Source list |
| struct CNListItem* CNSearchDataInList | ( | const struct CNList * | list, |
| void * | data | ||
| ) |
Search list item which has source data reference.
| listitem | The list item which has source data |
| NULL | There are no list item |
| list | List to be searched |
| data | Source data |
Referenced by CNSearchObjectInList().
| struct CNListItem* CNSearchMatchedDataInList | ( | const struct CNList * | list, |
| CNMatchDataFuncRef | func, | ||
| void * | info | ||
| ) |
Search list item which matched source data.
| listitem | The list item which mached with source data |
| NULL | There are no list item |
| list | List to be searched |
| func | Maching function |
| info | Maching information |
Referenced by CNSearchMatchedObjectInList().
1.8.5