corinthia-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabriela Gibson <>
Subject Colo(u)rs?
Date Sun, 17 May 2015 23:48:53 GMT
I made (for my branch) a color.c and a color.h, which can be
handy if you're looking at a wall of text and want to spot
something in particular without straining your eyes too much.

It's easy to use:

 printf(MAGENTA "foo = %d" RESET, 5);

will give you a nice 'foo = 5' magenta output.  There's also
stuff like blue("bar") which can be stuffed into other string

I wrangled it so that this feature can be turned on with a -D
switch at compile time, ie, in CmakeLists.txt you can do:

  set(CMAKE_C_FLAGS "-std=c99 -D_GNU_SOURCE -g -fPIC -DCOLOR_ON=1")

otherwise it's not going to show up.

1) Does anyone else other than me find this kind of thing useful?

2) Is it portable?

3) If 1 & 2, would you enjoy this dev debugging feature being


Visit my Coding Diary:

View raw message