libcomps ..
|
A Documented file. Details. More...
Go to the source code of this file.
Data Structures | |
struct | COMPS_ObjListIt |
struct | COMPS_ObjList |
A Documented file. Details.
int comps_objlist_append | ( | COMPS_ObjList * | objlist, |
COMPS_Object * | obj ) |
Append new object to list
This function increment object's reference counter
objlist | COMPS_ObjList instance |
obj | appended object |
int comps_objlist_append_x | ( | COMPS_ObjList * | objlist, |
COMPS_Object * | obj ) |
Append new object to list
Does not incremented object's reference counter
objlist | COMPS_ObjList instance |
obj | appended object |
void comps_objlist_clear | ( | COMPS_ObjList * | objlist | ) |
Clear the list Remove all items from list and call destructor on each one
objlist | COMPS_ObjList object |
COMPS_ObjList * comps_objlist_filter | ( | COMPS_ObjList * | list, |
char(*)(COMPS_Object *) | filter_func ) |
Returns new sublist from original list
Returns new sublist from original list, with items passed through filter
list | COMPS_ObjList instance |
filter_func | filter callback |
COMPS_Object * comps_objlist_get | ( | COMPS_ObjList * | objlist, |
unsigned int | atpos ) |
Return item's object at specified position
Returned object has incremented reference counter
objlist | COMPS_ObjList object |
atpos | item's position |
COMPS_Object * comps_objlist_get_x | ( | COMPS_ObjList * | objlist, |
unsigned int | atpos ) |
Return item's object at specified position
Returned object HASN'T incremented reference count
objlist | COMPS_ObjList object |
atpos | item's position |
int comps_objlist_insert_at | ( | COMPS_ObjList * | objlist, |
unsigned int | pos, | ||
COMPS_Object * | obj ) |
Insert item at specified position
If list doesn't have enough items (specified position is greater then items count, even if position is greater only by 1) fails and returns 0
objlist | COMPS_ObjList object |
pos | item's position |
obj | inserted object |
int comps_objlist_remove | ( | COMPS_ObjList * | objlist, |
COMPS_Object * | obj ) |
Remove item with specified object from list
Remove first matching items with object pointer eqaul specifed object pointer.
objlist | COMPS_ObjList object |
obj | removed object |
int comps_objlist_remove_at | ( | COMPS_ObjList * | objlist, |
unsigned int | atpos ) |
Remove item on specified position from list
If list doesn't have enough items fails. On succes decrements item object's reference counter and remove item from list
objlist | COMPS_ObjList object |
atpos | item's position |
int comps_objlist_set | ( | COMPS_ObjList * | objlist, |
unsigned int | atpos, | ||
COMPS_Object * | obj ) |
Set item's object at specified positoin
set new item to specified position, increment new item's reference counter and destroy old item (decrement reference counter). If list hasn't enough items, returns 0.
objlist | COMPS_ObjList object |
atpos | item's position @parma obj new object |
COMPS_ObjList * comps_objlist_sublist_it | ( | COMPS_ObjListIt * | startit, |
COMPS_ObjListIt * | end ) |
Returns new sublist from original list
Returns new sublist from original list, starting item startit and ending item end
startit | start item iterator |
end | end item iterator |
list | COMPS_ObjList instance |
int comps_objlist_walk | ( | COMPS_ObjListIt ** | walker, |
COMPS_Object ** | result ) |
Traverse the list
Start traversing list from walker position to end of list. Each call store actual item object to result parameter and move walker iterator forward
walker | Iterator position in list |
result | object of actual item |
return | non-zero if walker hasn't reached end, otherwise zero |
int comps_objlist_walk_r | ( | COMPS_ObjListIt * | walker_start, |
COMPS_ObjListIt * | mantinel, | ||
COMPS_Object ** | result ) |
Traverse the list with sentinel iterator
Same as comps_objlist_walk with additional sentinel iterator supplying end of list.
walker | Iterator position in list |
result | object of actual item |
return | non-zero if walker hasn't reached end, otherwise zero |