summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorDennis Camera <skonfig@dtnr.ch>2022-08-14 22:39:24 +0200
committerDennis Camera <skonfig@dtnr.ch>2022-08-14 23:47:33 +0200
commit289a2e94910d3b30256799f6c261dc01b194f254 (patch)
treec634e450838a35a84a7d10cca2e0a40b7ac30638 /src/util
parenta08bb6903495fb562fc3f2b881ee69eb36ac01cf (diff)
downloadskonfig-c-289a2e94910d3b30256799f6c261dc01b194f254.tar.gz
skonfig-c-289a2e94910d3b30256799f6c261dc01b194f254.zip
Implement logging module
Diffstat (limited to 'src/util')
-rw-r--r--src/util/font.h33
-rw-r--r--src/util/string.h4
2 files changed, 36 insertions, 1 deletions
diff --git a/src/util/font.h b/src/util/font.h
new file mode 100644
index 0000000..60c1b31
--- /dev/null
+++ b/src/util/font.h
@@ -0,0 +1,33 @@
+#ifndef _SK_UTIL_FONT_H
+#define _SK_UTIL_FONT_H
+
+#include "string.h"
+
+#define _sk_font_set(code) "\033[" quote(code) "m"
+
+#define SK_FONT_RESET _sk_font_set(0)
+#define SK_FONT_BOLD _sk_font_set(1)
+#define SK_FONT_UNDERLINE _sk_font_set(4)
+#define SK_FONT_SLOW_BLINK _sk_font_set(5)
+#define SK_FONT_NORMAL _sk_font_set(22)
+#define SK_FONT_NO_UNDERLINE _sk_font_set(24)
+#define SK_FONT_FG_BLACK _sk_font_set(30)
+#define SK_FONT_FG_RED _sk_font_set(31)
+#define SK_FONT_FG_GREEN _sk_font_set(32)
+#define SK_FONT_FG_YELLOW _sk_font_set(33)
+#define SK_FONT_FG_BLUE _sk_font_set(34)
+#define SK_FONT_FG_MAGENTA _sk_font_set(35)
+#define SK_FONT_FG_CYAN _sk_font_set(36)
+#define SK_FONT_FG_WHITE _sk_font_set(37)
+#define SK_FONT_FG_DEFAULT _sk_font_set(39)
+#define SK_FONT_BG_BLACK _sk_font_set(40)
+#define SK_FONT_BG_RED _sk_font_set(41)
+#define SK_FONT_BG_GREEN _sk_font_set(42)
+#define SK_FONT_BG_YELLOW _sk_font_set(43)
+#define SK_FONT_BG_BLUE _sk_font_set(44)
+#define SK_FONT_BG_MAGENTA _sk_font_set(45)
+#define SK_FONT_BG_CYAN _sk_font_set(46)
+#define SK_FONT_BG_WHITE _sk_font_set(47)
+#define SK_FONT_BG_DEFAULT _sk_font_set(49)
+
+#endif
diff --git a/src/util/string.h b/src/util/string.h
index 6f71a11..39c9268 100644
--- a/src/util/string.h
+++ b/src/util/string.h
@@ -1,6 +1,8 @@
#ifndef _SK_UTIL_STRING_H
#define _SK_UTIL_STRING_H
+#include "../../config.h"
+
#include "array.h"
#include <stddef.h>
@@ -23,7 +25,7 @@
#ifdef HAVE_STRINGIZE
#define quote(x) #x
#else
-#define quote(x) "x"
+#error "No CPP stringize operator available?"
#endif
/**