lifo.h

Go to the documentation of this file.
00001 
00006 #ifndef LIFO_H
00007 #define LIFO_H
00008 
00009 /* Get preprocessor macros this needs */
00010 #ifndef PP_H
00011 #include "pp.h"
00012 #endif
00013 
00017 #define LIFO_decl(type,count, label)\
00018     type    label[count];\
00019     type*   ppConcat(label,_sp)
00020 
00023 #define LIFO_extern(type,count, label)\
00024     extern type     label[count];\
00025     extern type*    ppConcat(label,_sp)
00026 
00031 #define LIFO_init(type, ilabel)         ( ppConcat(ilabel,_sp) = ilabel )
00032 
00035 #define LIFO_auto(type,count, ilabel)\
00036     type    ilabel[count];\
00037     type*   ppConcat(ilabel,_sp) = ilabel
00038 
00041 #define LIFO_empty(type, ilabel)        ( ppConcat(ilabel,_sp) == ilabel )
00042 
00045 #define LIFO_full(type, ilabel)         ( ppConcat(ilabel,_sp) == (type*)((char*)ilabel+sizeof(ilabel)) )
00046 
00052 #define LIFO_back(type, ilabel)         ( ppConcat(ilabel,_sp) )
00053 
00057 #define LIFO_front(type, ilabel)        ( ppConcat(ilabel,_sp)-1 )
00058 
00062 #define LIFO_push(type, ilabel)         ( ppConcat(ilabel,_sp)++ )
00063 
00067 #define LIFO_pop(type, ilabel)          ( --ppConcat(ilabel,_sp) )
00068 
00069 
00070 
00071 #endif /* LIFO_H */

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