TeoCCl library
0.1.7
|
Functions | |
teoQueue * | teoQueueNew () |
Create new Teo Queue. More... | |
int | teoQueueDestroy (teoQueue *q) |
Destroy Teo Queue. More... | |
int | teoQueueFree (teoQueue *q) |
Remove all elements from Teo queue. More... | |
size_t | teoQueueSize (teoQueue *q) |
Get number of elements in Teo queue. More... | |
teoQueueData * | teoQueuePut (teoQueue *q, teoQueueData *qd) |
Put (add, copy) existing queue record to the end of selected queue. More... | |
teoQueueData * | teoQueueNewData (void *data, size_t data_length) |
Create new teoQueueData buffer. More... | |
teoQueueData * | teoQueueAdd (teoQueue *q, void *data, size_t data_length) |
Add new element to the end of Teo queue. More... | |
teoQueueData * | teoQueueAddTop (teoQueue *q, void *data, size_t data_length) |
Add new element to the top of Teo queue. More... | |
teoQueueData * | teoQueueAddAfter (teoQueue *q, void *data, size_t data_length, teoQueueData *qd) |
Add new element after selected in qd field. More... | |
teoQueueData * | teoQueueUpdate (teoQueue *q, void *data, size_t data_length, teoQueueData *qd) |
Update element: remove selected and set new one to it place. More... | |
teoQueueData * | teoQueueRemove (teoQueue *q, teoQueueData *qd) |
Remove element from queue but not free it. More... | |
int | teoQueueDelete (teoQueue *q, teoQueueData *qd) |
Delete element from queue and free it. More... | |
int | teoQueueDeleteFirst (teoQueue *q) |
Delete first element from queue and free it. More... | |
int | teoQueueDeleteLast (teoQueue *q) |
Delete last element from queue and free it. More... | |
teoQueueData * | teoQueueMoveToEnd (teoQueue *q, teoQueueData *qd) |
Move element from this queue to the end of queue. More... | |
teoQueueData * | teoQueueMoveToTop (teoQueue *q, teoQueueData *qd) |
Move element from this queue to the top of queue. More... | |
teoQueueIterator * | teoQueueIteratorNew (teoQueue *q) |
Create new Teo Queue iterator. More... | |
teoQueueIterator * | teoQueueIteratorReset (teoQueueIterator *it, teoQueue *q) |
Reset iterator (or swith to new Queue) More... | |
teoQueueData * | teoQueueIteratorNext (teoQueueIterator *it) |
Get next element from Teo Queue iterator. More... | |
teoQueueData * | teoQueueIteratorPrev (teoQueueIterator *it) |
Get previous element from Teo Queue iterator. More... | |
teoQueueData * | teoQueueIteratorElement (teoQueueIterator *it) |
Get current Teo Queue iterator element. More... | |
int | teoQueueIteratorFree (teoQueueIterator *it) |
Free (destroy) Teo Queue iterator. More... | |
int | teoQueueForeach (teoQueue *q, teoQueueForeachFunction callback, void *user_data) |
Loop through queue and call callback function with index and data in parameters. More... | |
teoQueueData* teoQueueAdd | ( | teoQueue * | q, |
void * | data, | ||
size_t | data_length | ||
) |
Add new element to the end of Teo queue.
q | Pointer to existing Teo Queue |
data | Pointer to data of new element |
data_length | Length of new element data |
References teoQueueNewData(), and teoQueuePut().
Referenced by teo::Queue::add(), teoMapAdd(), teoQueueAddAfter(), and teoQueueAddTop().
teoQueueData* teoQueueAddAfter | ( | teoQueue * | q, |
void * | data, | ||
size_t | data_length, | ||
teoQueueData * | qd | ||
) |
Add new element after selected in qd field.
q | Pointer to existing Teo Queue |
data | Pointer to data of new element |
data_length | Length of new element data |
qd | Pointer to teoQueueData of existing element |
References teoQueue::last, teoQueue::length, teoQueueData::next, teoQueueData::prev, teoQueueAdd(), teoQueueAddTop(), and teoQueueNewData().
Referenced by teo::Queue::addAfter().
teoQueueData* teoQueueAddTop | ( | teoQueue * | q, |
void * | data, | ||
size_t | data_length | ||
) |
Add new element to the top of Teo queue.
q | Pointer to existing Teo Queue |
data | Pointer to data of new element |
data_length | Length of new element data |
References teoQueueAdd(), and teoQueueMoveToTop().
Referenced by teo::Queue::addTop(), cclLruRefer(), and teoQueueAddAfter().
int teoQueueDelete | ( | teoQueue * | q, |
teoQueueData * | qd | ||
) |
Delete element from queue and free it.
q | Pointer to teoQueue |
qd | Pointer to teoQueueData |
References teoQueueRemove().
Referenced by teo::Queue::del(), teoMapDelete(), teoQueueDeleteFirst(), and teoQueueDeleteLast().
int teoQueueDeleteFirst | ( | teoQueue * | q | ) |
Delete first element from queue and free it.
q | Pointer to teoQueue |
References teoQueue::first, and teoQueueDelete().
Referenced by teo::Queue::delFirst().
int teoQueueDeleteLast | ( | teoQueue * | q | ) |
Delete last element from queue and free it.
q | Pointer to teoQueue |
References teoQueue::last, and teoQueueDelete().
Referenced by teo::Queue::delLast().
int teoQueueDestroy | ( | teoQueue * | q | ) |
Destroy Teo Queue.
q | Pointer to existing Teo Queue |
References teoQueueFree().
Referenced by cclLruDestroy(), teoMapDestroy(), and teo::Queue::~Queue().
int teoQueueForeach | ( | teoQueue * | q, |
teoQueueForeachFunction | callback, | ||
void * | user_data | ||
) |
Loop through queue and call callback function with index and data in parameters.
q | Pointer to teoQueue |
callback | Pointer to callback function teoQueueForeachFunction |
References teoQueueIteratorElement(), teoQueueIteratorNext(), and teoQueueIteratorReset().
Referenced by teo::Queue::foreach().
int teoQueueFree | ( | teoQueue * | q | ) |
Remove all elements from Teo queue.
q | Pointer to existing Teo Queue |
References teoQueue::first, and teoQueueData::next.
Referenced by teo::Queue::freeAll(), teoMapClear(), and teoQueueDestroy().
teoQueueData* teoQueueIteratorElement | ( | teoQueueIterator * | it | ) |
Get current Teo Queue iterator element.
it | Pointer to teoQueueIterator |
References teoQueueIterator::qd.
Referenced by cclLruForeach(), teo::Queue::iteratorElement(), and teoQueueForeach().
int teoQueueIteratorFree | ( | teoQueueIterator * | it | ) |
Free (destroy) Teo Queue iterator.
it | Pointer to teoQueueIterator |
Referenced by teo::Queue::iteratorFree().
teoQueueIterator* teoQueueIteratorNew | ( | teoQueue * | q | ) |
Create new Teo Queue iterator.
q | Pointer to teoQueue |
References ccl_malloc(), teoQueueIterator::q, and teoQueueIterator::qd.
Referenced by teo::Queue::iterator().
teoQueueData* teoQueueIteratorNext | ( | teoQueueIterator * | it | ) |
Get next element from Teo Queue iterator.
it | Pointer to teoQueueIterator |
References teoQueue::first, teoQueueData::next, teoQueueIterator::q, and teoQueueIterator::qd.
Referenced by cclLruForeach(), teo::Queue::iteratorNext(), teoMapIteratorNext(), and teoQueueForeach().
teoQueueData* teoQueueIteratorPrev | ( | teoQueueIterator * | it | ) |
Get previous element from Teo Queue iterator.
it | Pointer to teoQueueIterator |
References teoQueue::last, teoQueueData::prev, teoQueueIterator::q, and teoQueueIterator::qd.
Referenced by teo::Queue::iteratorPrev(), and teoMapIteratorPrev().
teoQueueIterator* teoQueueIteratorReset | ( | teoQueueIterator * | it, |
teoQueue * | q | ||
) |
Reset iterator (or swith to new Queue)
it | Pointer to teoQueueIterator |
q | Pointer to teoQueue to switch to or NULL to reset current queue |
References teoQueueIterator::q, and teoQueueIterator::qd.
Referenced by cclLruForeach(), teo::Queue::iteratorElement(), teoMapIteratorNext(), teoMapIteratorPrev(), teoMapIteratorReset(), teoMapIteratorReverseReset(), and teoQueueForeach().
teoQueueData* teoQueueMoveToEnd | ( | teoQueue * | q, |
teoQueueData * | qd | ||
) |
Move element from this queue to the end of queue.
q | Pointer to teoQueue |
qd | Pointer to teoQueueData |
References teoQueue::last, teoQueue::length, teoQueueData::next, teoQueueData::prev, and teoQueueRemove().
Referenced by teo::Queue::moveToEnd().
teoQueueData* teoQueueMoveToTop | ( | teoQueue * | q, |
teoQueueData * | qd | ||
) |
Move element from this queue to the top of queue.
q | Pointer to teoQueue |
qd | Pointer to teoQueueData |
References teoQueue::first, teoQueue::length, teoQueueData::next, teoQueueData::prev, and teoQueueRemove().
Referenced by teo::Queue::moveToTop(), and teoQueueAddTop().
teoQueue* teoQueueNew | ( | ) |
Create new Teo Queue.
References ccl_calloc(), teoQueue::first, teoQueue::last, and teoQueue::length.
Referenced by cclLruInit(), teo::Queue::Queue(), and teoMapNew().
teoQueueData* teoQueueNewData | ( | void * | data, |
size_t | data_length | ||
) |
Create new teoQueueData buffer.
data | Pointer to data |
data_length | Data length |
References ccl_malloc(), teoQueueData::data, teoQueueData::data_length, teoQueueData::next, and teoQueueData::prev.
Referenced by teo::Queue::newData(), teoQueueAdd(), teoQueueAddAfter(), and teoQueueUpdate().
teoQueueData* teoQueuePut | ( | teoQueue * | q, |
teoQueueData * | qd | ||
) |
Put (add, copy) existing queue record to the end of selected queue.
q | Pointer to teoQueue |
qd | Pointer to teoQueueData |
References teoQueue::first, teoQueue::last, teoQueue::length, teoQueueData::next, and teoQueueData::prev.
Referenced by teo::Queue::put(), and teoQueueAdd().
teoQueueData* teoQueueRemove | ( | teoQueue * | q, |
teoQueueData * | qd | ||
) |
Remove element from queue but not free it.
q | Pointer to teoQueue |
qd | Pointer to teoQueueData |
References teoQueue::first, teoQueue::last, teoQueue::length, teoQueueData::next, and teoQueueData::prev.
Referenced by cclLruRefer(), teo::Queue::remove(), teoQueueDelete(), teoQueueMoveToEnd(), and teoQueueMoveToTop().
size_t teoQueueSize | ( | teoQueue * | q | ) |
Get number of elements in Teo queue.
q |
References teoQueue::length.
Referenced by cclLruRefer(), and teo::Queue::size().
teoQueueData* teoQueueUpdate | ( | teoQueue * | q, |
void * | data, | ||
size_t | data_length, | ||
teoQueueData * | qd | ||
) |
Update element: remove selected and set new one to it place.
q | Pointer to existing Teo Queue |
data | Pointer to data of new element |
data_length | Length of new element data |
qd | Pointer to teoQueueData of existing element |
References teoQueue::first, teoQueue::last, teoQueueData::next, teoQueueData::prev, and teoQueueNewData().
Referenced by teoMapAdd().