Debugging macros

I've put together a set of macros to make debugging easier. One day I'll learn how to use external debugging software, but until then...

trace_mac.h

Macros that print messages when the global tk_debug > level.
PING(level) Prints "PING file.line\n".
MSG(level,...) Prints the message ... .
DUMP(level,a,fmt) Dumps a variable a with a given format fmt.

err_mac.h

Macros controlling general error-checking and handling.
CHK(a) Fail verbosely if a != SUCCESS
AST(a) Fail verbosely if a == 0
E_AST(a, e_code) Like AST(), but return e_code instead of FAILURE
M_AST(a, e_code, ... ) Like E_AST(), but also print a message ...
M_EXIT(e_code, ... ) Print a message ... and return e_code.

maxmin_mac.h

Macros for comparison
MIN(a,b) Returns the min of a and b (not robust).
MAX(a,b) Returns the max of a and b (not robust).

str_mac.h

Macros that manipulate strings.
STRCAT(a,b) Concatenates two strings (not robust).

macro_test.c

C function to test the various macros.

tst

Bash script to put macro_test.c through its paces.