diff options
Diffstat (limited to 'include/i3lock.h')
| -rw-r--r-- | include/i3lock.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/i3lock.h b/include/i3lock.h new file mode 100644 index 0000000..6cf7694 --- /dev/null +++ b/include/i3lock.h | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #ifndef _I3LOCK_H | ||
| 2 | #define _I3LOCK_H | ||
| 3 | |||
| 4 | /* This macro will only print debug output when started with --debug. | ||
| 5 | * This is important because xautolock (for example) closes stdout/stderr by | ||
| 6 | * default, so just printing something to stdout will lead to the data ending | ||
| 7 | * up on the X11 socket (!). */ | ||
| 8 | #define DEBUG(fmt, ...) \ | ||
| 9 | do { \ | ||
| 10 | if (debug_mode) { \ | ||
| 11 | fprintf(stderr, "[i3lock-extended-debug] " fmt, ##__VA_ARGS__); \ | ||
| 12 | } \ | ||
| 13 | } while (0) | ||
| 14 | |||
| 15 | #endif | ||
