1
/* stackc - critcl - layer 0 declarations
2
* API general utilities
10
/* Allocation macros for common situations.
13
#define ALLOC(type) (type *) ckalloc (sizeof (type))
14
#define NALLOC(n,type) (type *) ckalloc ((n) * sizeof (type))
16
/* Assertions in general, and asserting the proper range of an array index.
20
#define STACKC_DEBUG 1
24
#define STR(x) XSTR(x)
25
#define RANGEOK(i,n) ((0 <= (i)) && (i < (n)))
26
#define ASSERT(x,msg) if (!(x)) { Tcl_Panic (msg " (" #x "), in file " __FILE__ " @line " STR(__LINE__));}
27
#define ASSERT_BOUNDS(i,n) ASSERT (RANGEOK(i,n),"array index out of bounds: " STR(i) " > " STR(n))
30
#define ASSERT_BOUNDS(i,n)