summaryrefslogtreecommitdiff
path: root/lout
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-12-08 17:35:18 +0100
committerSebastian Geerken <devnull@localhost>2014-12-08 17:35:18 +0100
commit3d521d286174264448cbd1b2315ff89f9d8e8edf (patch)
tree37515aa58dc935014b677c7212ada0fdfab7b2bd /lout
parentde2139f76ee1fa4f14970914bb6c87fe46feed17 (diff)
parent2bb03c759cb44241d42e3385336a1c6b9a8d7d9f (diff)
Merged with main repo (part 1/2).
Diffstat (limited to 'lout')
-rw-r--r--lout/debug_rtfl.hh36
1 files changed, 33 insertions, 3 deletions
diff --git a/lout/debug_rtfl.hh b/lout/debug_rtfl.hh
index c2ecfd8b..dad2c3c0 100644
--- a/lout/debug_rtfl.hh
+++ b/lout/debug_rtfl.hh
@@ -37,9 +37,10 @@
// Prints an RTFL message to stdout. "fmt" contains simple format
// characters how to deal with the additional arguments (no "%"
-// preceeding, as in printf), or other characters, which are simply
-// printed. No quoting: this function cannot be used to print the
-// characters "d", "p", and "s" directly.
+// preceeding, as in printf), or "c" (short for "#%06x" and used for
+// colors), or other characters, which are simply printed. No quoting:
+// this function cannot be used to print the characters "d", "p", and
+// "s" directly.
inline void rtfl_print (const char *version, const char *file, int line,
const char *fmt, ...)
@@ -76,6 +77,11 @@ inline void rtfl_print (const char *version, const char *file, int line,
}
break;
+ case 'c':
+ n = va_arg(args, int);
+ printf ("#06x", n);
+ break;
+
default:
putchar (fmt[i]);
break;
@@ -211,6 +217,12 @@ inline void rtfl_print (const char *version, const char *file, int line,
#define DBG_OBJ_SET_PTR_O(obj, var, val) \
RTFL_OBJ_PRINT ("set", "p:s:p", obj, var, val)
+#define DBG_OBJ_SET_COL(var, val) \
+ DBG_OBJ_SET_COL_O (this, var, val)
+
+#define DBG_OBJ_SET_COL_O(obj, var, val) \
+ RTFL_OBJ_PRINT ("set", "p:s:c", obj, var, val)
+
#define DBG_OBJ_ARRSET_NUM(var, ind, val) \
DBG_OBJ_ARRSET_NUM_O (this, var, ind, val)
@@ -241,6 +253,12 @@ inline void rtfl_print (const char *version, const char *file, int line,
#define DBG_OBJ_ARRSET_PTR_O(obj, var, ind, val) \
RTFL_OBJ_PRINT ("set", "p:s.d:p", obj, var, ind, val)
+#define DBG_OBJ_ARRSET_COL(var, ind, val) \
+ DBG_OBJ_ARRSET_COL_O (this, var, ind, val)
+
+#define DBG_OBJ_ARRSET_COL_O(obj, var, ind, val) \
+ RTFL_OBJ_PRINT ("set", "p:s.d:c", obj, var, ind, val)
+
#define DBG_OBJ_ARRATTRSET_NUM(var, ind, attr, val) \
DBG_OBJ_ARRATTRSET_NUM_O (this, var, ind, attr, val)
@@ -272,6 +290,12 @@ inline void rtfl_print (const char *version, const char *file, int line,
#define DBG_OBJ_ARRATTRSET_PTR_O(obj, var, ind, attr, val) \
RTFL_OBJ_PRINT ("set", "p:s.d.s:p", obj, var, ind, attr, val)
+#define DBG_OBJ_ARRATTRSET_COL(var, ind, attr, val) \
+ DBG_OBJ_ARRATTRSET_COL_O (this, var, ind, attr, val)
+
+#define DBG_OBJ_ARRATTRSET_COL_O(obj, var, ind, attr, val) \
+ RTFL_OBJ_PRINT ("set", "p:s.d.s:c", obj, var, ind, attr, val)
+
#define DBG_OBJ_CLASS_COLOR(klass, color) \
RTFL_OBJ_PRINT ("class-color", "s:s", klass, color)
@@ -313,6 +337,8 @@ inline void rtfl_print (const char *version, const char *file, int line,
#define DBG_OBJ_SET_STR_O(obj, var, val) STMT_NOP
#define DBG_OBJ_SET_PTR(var, val) STMT_NOP
#define DBG_OBJ_SET_PTR_O(obj, var, val) STMT_NOP
+#define DBG_OBJ_SET_COL(var, val) STMT_NOP
+#define DBG_OBJ_SET_COL_O(obj, var, val) STMT_NOP
#define DBG_OBJ_ARRSET_NUM(var, ind, val) STMT_NOP
#define DBG_OBJ_ARRSET_NUM_O(obj, var, ind, val) STMT_NOP
#define DBG_OBJ_ARRSET_SYM(var, ind, val) STMT_NOP
@@ -323,6 +349,8 @@ inline void rtfl_print (const char *version, const char *file, int line,
#define DBG_OBJ_ARRSET_STR_O(obj, var, ind, val) STMT_NOP
#define DBG_OBJ_ARRSET_PTR(var, ind, val) STMT_NOP
#define DBG_OBJ_ARRSET_PTR_O(obj, var, ind, val) STMT_NOP
+#define DBG_OBJ_ARRSET_COL(var, ind, val) STMT_NOP
+#define DBG_OBJ_ARRSET_COL_O(obj, var, ind, val) STMT_NOP
#define DBG_OBJ_ARRATTRSET_NUM(var, ind, attr, val) STMT_NOP
#define DBG_OBJ_ARRATTRSET_NUM_O(obj, var, ind, attr, val) STMT_NOP
#define DBG_OBJ_ARRATTRSET_SYM(var, ind, attr, val) STMT_NOP
@@ -333,6 +361,8 @@ inline void rtfl_print (const char *version, const char *file, int line,
#define DBG_OBJ_ARRATTRSET_STR_O(obj, var, ind, attr, val) STMT_NOP
#define DBG_OBJ_ARRATTRSET_PTR(var, ind, attr, val) STMT_NOP
#define DBG_OBJ_ARRATTRSET_PTR_O(obj, var, ind, attr, val) STMT_NOP
+#define DBG_OBJ_ARRATTRSET_COL(var, ind, attr, val) STMT_NOP
+#define DBG_OBJ_ARRATTRSET_COL_O(obj, var, ind, attr, val) STMT_NOP
#define DBG_OBJ_CLASS_COLOR(klass, color) STMT_NOP
#endif /* DBG_RTFL */