]> git.lizzy.rs Git - bspwm.git/blobdiff - helpers.h
Keep the *name* section straightforward
[bspwm.git] / helpers.h
index 27badcad035a529b539036aff4401694e7e26958..17ebcb9f1f82ca225bc879c69227e79d74a5ad2f 100644 (file)
--- a/helpers.h
+++ b/helpers.h
@@ -1,8 +1,10 @@
 #ifndef _HELPERS_H
 #define _HELPERS_H
 
+#include <xcb/xcb.h>
 #include <stdarg.h>
 #include <stdio.h>
+#include <stdbool.h>
 #include <stdint.h>
 
 #define LENGTH(x)         (sizeof(x) / sizeof(*x))
 #define MIN(A, B)         ((A) < (B) ? (A) : (B))
 #define BOOLSTR(A)        ((A) ? "true" : "false")
 
-#define MAXLEN  256
-#define XCB_CONFIG_WINDOW_X_Y_WIDTH_HEIGHT XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT
-#define XCB_CONFIG_WINDOW_X_Y XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y
+#define XCB_CONFIG_WINDOW_X_Y               XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y
+#define XCB_CONFIG_WINDOW_WIDTH_HEIGHT      XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT
+#define XCB_CONFIG_WINDOW_X_Y_WIDTH_HEIGHT  XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT
+
+#define MAXLEN    256
+#define INIT_CAP    8
+
+#define REMLEN(x)         (BUFSIZ - strlen(x) - 1)
+#define streq(s1, s2)     (strcmp((s1), (s2)) == 0)
 
 #ifdef DEBUG
 #  define PUTS(x)         puts(x)
 #  define PRINTF(x,...)   ((void)0)
 #endif
 
-void logmsg(FILE *, char *, va_list);
 void warn(char *, ...);
 __attribute__((noreturn))
-void die(char *, ...);
-uint32_t get_color(char *);
+void err(char *, ...);
+bool get_color(char *, xcb_window_t, uint32_t *);
+double distance(xcb_point_t, xcb_point_t);
 
 #endif