Leptonica  1.83.1
Image processing and image analysis suite
queue.h File Reference

Go to the source code of this file.

Data Structures

struct  L_Queue
 

Typedefs

typedef struct L_Queue L_QUEUE
 

Detailed Description

     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.