Leptonica 1.68
C Image Processing Library
|
Struct for generic expandable queue (L_Queue) More...
Go to the source code of this file.
Data Structures | |
struct | L_Queue |
Typedefs | |
typedef struct L_Queue | L_QUEUE |
Struct for generic expandable queue (L_Queue)
Expandable pointer queue for arbitrary void* data. The L_Queue is a fifo that implements a queue of void* pointers. It can be used to hold a queue of any type of struct. Internally, it maintains two counters: nhead: location of head (in ptrs) from the beginning of the array. nelem: number of ptr elements stored in the queue. The element at the head of the queue, which is the next to be removed, is array[nhead]. The location at the tail of the queue to which the next element will be added is array[nhead + nelem]. As items are added to the queue, nelem increases. As items are removed, nhead increases and nelem decreases. Any time the tail reaches the end of the allocated array, all the pointers are shifted to the left, so that the head is at the beginning of the array. If the array becomes more than 3/4 full, it doubles in size. The auxiliary stack can be used in a wrapper for re-using items popped from the queue. It is not made by default. For further implementation details, see queue.c.
Definition in file queue.h.