lifo.h File Reference

Simple Last-in, first-out stack. More...

#include "pp.h"

Include dependency graph for lifo.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define LIFO_decl(type, count, label)
 Declare a LIFO.
#define LIFO_extern(type, count, label)
 Make a global LIFO available elsewhere.
#define LIFO_init(type, ilabel)   ( ppConcat(ilabel,_sp) = ilabel )
 Initialize a declared LIFO If it was declared as part of a compound, the indirection to that compound is also reqiured as part of ilabel.
#define LIFO_auto(type, count, ilabel)
 Declare a LIFO as a global or on the stack.
#define LIFO_empty(type, ilabel)   ( ppConcat(ilabel,_sp) == ilabel )
 Tell us if a LIFO is empty, and therefore that LIFO_pop is invalid.
#define LIFO_full(type, ilabel)   ( ppConcat(ilabel,_sp) == (type*)((char*)ilabel+sizeof(ilabel)) )
 Tell us if a LIFO is full, and therefore that LIFO_add is invalid.
#define LIFO_back(type, ilabel)   ( ppConcat(ilabel,_sp) )
 Get a pointer to where next add will add a member Useful for where you want to get a pointer to where data would be added so it can be initialized in place before invoking LIFO_add. You should check LIFO64K_empty before doing this.
#define LIFO_front(type, ilabel)   ( ppConcat(ilabel,_sp)-1 )
 Get a pointer to who will be next to be popped without popping it You should check LIFO64K_empty before doing this.
#define LIFO_push(type, ilabel)   ( ppConcat(ilabel,_sp)++ )
 Add a new value to the LIFO queue You should check LIFO_full before doing this, maybe in a debug assertion.
#define LIFO_pop(type, ilabel)   ( --ppConcat(ilabel,_sp) )
 Pop the oldest value off the queue You should check LIFO_empty before doing this.


Detailed Description

Simple Last-in, first-out stack.

Author:
David Mace

Definition in file lifo.h.


Generated on Fri Jan 2 15:28:35 2009 for Squat by  doxygen 1.5.6