fred-mod-eppd
|
Classes | |
struct | qitem |
struct | qhead |
Macros | |
#define | q_length(_qhead) ((_qhead).count) |
#define | q_next(_qhead) ((_qhead)->cur = ((_qhead)->cur) ? (_qhead)->cur->next : NULL) |
#define | q_content(_qhead) ((_qhead)->cur->content) |
#define | q_reset(_qhead) ((_qhead)->cur = (_qhead)->body) |
#define | q_foreach(_qhead) for ((_qhead)->cur = (_qhead)->body; (_qhead)->cur != NULL; (_qhead)->cur = (_qhead)->cur->next) |
Typedefs | |
typedef struct qitem | qitem |
Functions | |
int | q_add (void *pool, qhead *head, void *data) |
#define q_content | ( | _qhead | ) | ((_qhead)->cur->content) |
Get content of current item.
#define q_foreach | ( | _qhead | ) | for ((_qhead)->cur = (_qhead)->body; (_qhead)->cur != NULL; (_qhead)->cur = (_qhead)->cur->next) |
Iterate through items in a list. At first, internal pointer is set to the list begining then it advances each round to the next item in a list, until the sentinel is encountered.
#define q_length | ( | _qhead | ) | ((_qhead).count) |
Get length of a queue.
#define q_next | ( | _qhead | ) | ((_qhead)->cur = ((_qhead)->cur) ? (_qhead)->cur->next : NULL) |
Shift to next item in a queue.
#define q_reset | ( | _qhead | ) | ((_qhead)->cur = (_qhead)->body) |
Reset current item to the first one.
int q_add | ( | void * | pool, |
qhead * | head, | ||
void * | data | ||
) |
Add new item to a queue (the item will be enqueued at the end of queue).
pool | Pool from which the new item will be allocated. |
head | The queue. |
data | Pointer to data which shoud be enqueued. |