LibRCG
3.1.1
|
Implementation of a queue as linked list. More...
Go to the source code of this file.
Data Structures | |
struct | SQueueNode |
Queue node structure. More... | |
struct | SQueue |
Queue structure. More... | |
Typedefs | |
typedef SQueueNode * | QueueNode |
Queue node definition. More... | |
typedef SQueue * | Queue |
Queue definition. More... | |
Functions | |
Queue | newQueue (void) |
Creates a queue. More... | |
void | queueDelete (Queue queue) |
Deletes a queue. More... | |
int | queueInsert (Queue queue, void *value) |
Inserts an element in a queue. More... | |
int | queueRemove (Queue queue, void **value) |
Removes an element from a queue. More... | |
int | queueConsult (Queue queue, void **value) |
Provides the value at the head of a queue. More... | |
int | queueSize (Queue queue) |
Returns the size of a queue. More... | |
int | queueMap (Queue queue, void(*fun)(void *)) |
Applies a function to the elements of a queue. More... | |
Iterator | queueIterator (Queue queue) |
Creates an iterator from a queue. More... | |
Implementation of a queue as linked list.
Provides functions to create and manipulate a queue.
Definition in file queue.h.
typedef SQueueNode* QueueNode |
Queue newQueue | ( | void | ) |
int queueConsult | ( | Queue | queue, |
void ** | value | ||
) |
Provides the value at the head of a queue.
If the queue is empty, it will be put the value NULL
at value
.
value
a pointer to the value at the first position. Changes to this value will affect the element in the list.queue | the queue |
value | pointer where the value at the last position will be put |
void queueDelete | ( | Queue | queue | ) |
int queueInsert | ( | Queue | queue, |
void * | value | ||
) |
int queueMap | ( | Queue | queue, |
void(*)(void *) | fun | ||
) |
int queueRemove | ( | Queue | queue, |
void ** | value | ||
) |
Removes an element from a queue.
Provides the value of the removed element if the value of value
is not NULL
.
queue | the queue |
value | pointer where the removed value should be put (or NULL ) |
LibRCG © 2004-2015 Rui Carlos Gonçalves