aboutsummaryrefslogtreecommitdiffstats
path: root/calmwm.h
diff options
context:
space:
mode:
authorokan2018-02-04 22:56:26 +0000
committerokan2018-02-04 22:56:26 +0000
commit69612bdea7ce4935bf16e616320045742af5ca20 (patch)
tree55d7999dde386acd6e4490b9686f126c104d1cb8 /calmwm.h
parent49f8a10570f46a2a33c393e2bc578feff7a3bbca (diff)
downloadcwm-69612bdea7ce4935bf16e616320045742af5ca20.tar.gz
Slightly expand and expose verbose debugging.
Diffstat (limited to 'calmwm.h')
-rw-r--r--calmwm.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/calmwm.h b/calmwm.h
index ccb0736..a493347 100644
--- a/calmwm.h
+++ b/calmwm.h
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: calmwm.h,v 1.355 2018/02/02 13:40:55 okan Exp $
+ * $OpenBSD: calmwm.h,v 1.356 2018/02/04 22:56:26 okan Exp $
*/
#ifndef _CALMWM_H_
@@ -31,12 +31,10 @@
#include <X11/extensions/Xrandr.h>
#include <X11/keysym.h>
-/* #define DEBUG */
-#ifdef DEBUG
-#define DPRINTF(...) log_debug(__func__, __VA_ARGS__)
-#else
-#define DPRINTF(...) do {} while (0)
-#endif /* DEBUG */
+#define LOG_DEBUG0(...) log_debug(0, __func__, __VA_ARGS__)
+#define LOG_DEBUG1(...) log_debug(1, __func__, __VA_ARGS__)
+#define LOG_DEBUG2(...) log_debug(2, __func__, __VA_ARGS__)
+#define LOG_DEBUG3(...) log_debug(3, __func__, __VA_ARGS__)
#undef MIN
#undef MAX
@@ -313,6 +311,7 @@ struct conf {
char *homedir;
char *known_hosts;
char *wm_argv;
+ u_int32_t debug;
};
/* MWM hints */
@@ -591,9 +590,9 @@ void xu_ewmh_restore_net_wm_state(struct client_ctx *);
char *u_argv(char * const *);
void u_exec(char *);
void u_spawn(char *);
-void log_debug(const char *, const char *, ...)
- __attribute__((__format__ (printf, 2, 3)))
- __attribute__((__nonnull__ (2)));
+void log_debug(int, const char *, const char *, ...)
+ __attribute__((__format__ (printf, 3, 4)))
+ __attribute__((__nonnull__ (3)));
void *xcalloc(size_t, size_t);
void *xmalloc(size_t);