summaryrefslogtreecommitdiff
path: root/src/ratpoison.h
diff options
context:
space:
mode:
authorsabetts <sabetts>2000-09-15 04:27:08 +0000
committersabetts <sabetts>2000-09-15 04:27:08 +0000
commit459655b06ba8e3a15e52c9e9c0e8fd936a5e2673 (patch)
tree350d862dd9fb99fd4f538578629cd35b97c08301 /src/ratpoison.h
parentf8d987c9c391855fcc263a3adb93483705afe35b (diff)
downloadratpoison-459655b06ba8e3a15e52c9e9c0e8fd936a5e2673.zip
Added a standard error reporting function PRINT_ERROR and a standard
debug output function PRINT_DEBUG.
Diffstat (limited to 'src/ratpoison.h')
-rw-r--r--src/ratpoison.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/ratpoison.h b/src/ratpoison.h
index 8b83866..089fcb9 100644
--- a/src/ratpoison.h
+++ b/src/ratpoison.h
@@ -21,9 +21,22 @@
#define _RATPOISON_H
#ifdef HAVE_CONFIG_H
-# include "config.h"
+# include <config.h>
#endif /* HAVE_CONFIG_H */
+/* Some error reporting macros */
+#define PRE_PRINT_LOCATION fprintf (stderr, "%s:%s():%d: ", __FILE__, __FUNCTION__, __LINE__);
+#define PRINT_ERROR(format, args...) \
+ { fprintf (stderr, PACKAGE ":error -- "); PRE_PRINT_LOCATION; fprintf (stderr, format, ## args); }
+
+/* Some debugging macros */
+#ifdef DEBUG
+# define PRINT_DEBUG(format, args...) \
+ { fprintf (stderr, PACKAGE ":debug -- "); PRE_PRINT_LOCATION; fprintf (stderr, format, ## args); }
+#else
+# define PRINT_DEBUG(format, args...)
+#endif /* DEBUG */
+
#include "conf.h"
#include "data.h"