A collection of utilities for debugging C programs.
- ANSI-escape sequence colors
- All colors can be disabled by defining
MUL_COLOR_DISABLE
MUL_COLOR_BOLD
MUL_COLOR_RED
MUL_COLOR_GREEN
MUL_COLOR_YELLOW
MUL_COLOR_BLUE
MUL_COLOR_MAGENTA
MUL_COLOR_CYAN
MUL_COLOR_RESET
- All colors can be disabled by defining
- Logging
- Logging can be disabled by defining
MUL_LOG_DISABLE
MUL_LOG(message, ...)
followsprintf()
-style formatting
- Logging can be disabled by defining
- Assertions
- Assertions can be disabled by defining
MUL_ASSERT_DISABLE
MUL_ASSERT(condition, messsage, ...)
followsprintf()
-style formatting andabort()
s ifcondition
is false-y
- Assertions can be disabled by defining
- "What-is"
- The "what-is" function-like macro is disabled if not compiling with GNU C
MUL_WHAT_IS(x)
is available for all built-in C types (if you find one missing, please open an issue)
#include "mul.h"
int main(void) {
MUL_LOG("Hello, world!");
int i = 42;
MUL_WHAT_IS(i);
MUL_WHAT_IS(&i);
MUL_ASSERT(i == 42, "i == %d", i);
i += 1;
MUL_ASSERT(i == 42, "i == %d", i);
return 0;
}