summaryrefslogtreecommitdiff
path: root/src/scapx.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/scapx.h')
-rw-r--r--src/scapx.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/scapx.h b/src/scapx.h
index 00659d5..c232067 100644
--- a/src/scapx.h
+++ b/src/scapx.h
@@ -1,9 +1,7 @@
#ifndef SCAPX_H
#define SCAPX_H
-#include <xcb/xcb.h>
-
-#define OPTS(msg) \
+#define POPTS(msg) \
do { \
fprintf(stderr, "Usage: scapx\n"); \
fprintf(stderr, "%s\n\n\n", msg); \
@@ -14,11 +12,19 @@
exit(EXIT_FAILURE); \
} while (0)
-typedef struct {
- xcb_connection_t *con;
- xcb_screen_t *scr;
- xcb_screen_iterator_t iter;
- int scr_nbr;
-} Server_context_t;
+
+#define SLOG(...) (fprintf(stderr, __VA_ARGS__))
+
+#define DEBUG_INFO(FMT, ARGS...) do { \
+ if (DEBUG) \
+ fprintf(stderr, "%s:%d " FMT "\n", __FUNCTION__, __LINE__, ## ARGS); \
+ } while (0)
+
+#define FATAL_ERROR(errstr, ...) \
+ do { \
+ fprintf(stderr, (errstr), ##__VA_ARGS__); \
+ exit(EXIT_FAILURE); \
+ } while (0)
+
#endif