Leptonica  1.82.0
Image processing and image analysis suite
stack.h File Reference

Go to the source code of this file.

Data Structures

struct  L_Stack
 

Typedefs

typedef struct L_Stack L_STACK
 

Detailed Description

      Expandable pointer stack for arbitrary void* data.
      The L_Stack is an array of void * ptrs, onto which arbitrary
      objects can be stored.  At any time, the number of
      stored objects is stack->n.  The object at the bottom
      of the stack is at array[0]; the object at the top of
      the stack is at array[n-1].  New objects are added
      to the top of the stack, at the first available location,
      which is array[n].  Objects are removed from the top of the
      stack.  When an attempt is made to remove an object from an
      empty stack, the result is null.   When the stack becomes
      filled, so that n = nalloc, the size is doubled.
      The auxiliary stack can be used to store and remove
      objects for re-use.  It must be created by a separate
      call to pstackCreate().  [Just imagine the chaos if
      pstackCreate() created the auxiliary stack!]
      pstackDestroy() checks for the auxiliary stack and removes it.

Definition in file stack.h.