#ifndef KIT_TEST_SHARED_INL_H #define KIT_TEST_SHARED_INL_H #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif #include #include #include #include #include #include enum { white, blue, light, yellow, red, green }; static char const *const color_codes[] = { [white] = "\x1b[38m", [blue] = "\x1b[34m", [light] = "\x1b[37m", [yellow] = "\x1b[33m", [red] = "\x1b[31m", [green] = "\x1b[32m" }; static int print_color(int c) { return printf("%s", color_codes[c]); } static int const signums[] = { SIGINT, SIGILL, SIGABRT, SIGFPE, SIGSEGV, SIGTERM }; static char const *const signames[] = { [SIGINT] = "Interactive attention signal", [SIGILL] = "Illegal instruction", [SIGABRT] = "Abnormal termination", [SIGFPE] = "Erroneous arithmetic operation", [SIGSEGV] = "Invalid access to storage", [SIGTERM] = "Termination request" }; #endif