X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=helpers.h;h=9be286aff5e675e35b8395a0147678890c858553;hb=d77f7e33704119ad1ce2ea7b4d45b19b86bafd12;hp=27badcad035a529b539036aff4401694e7e26958;hpb=ad7dfb9776553aefa94360bcf87032bea8a069fa;p=bspwm.git diff --git a/helpers.h b/helpers.h index 27badca..9be286a 100644 --- a/helpers.h +++ b/helpers.h @@ -1,6 +1,7 @@ #ifndef _HELPERS_H #define _HELPERS_H +#include #include #include #include @@ -8,11 +9,15 @@ #define LENGTH(x) (sizeof(x) / sizeof(*x)) #define MAX(A, B) ((A) > (B) ? (A) : (B)) #define MIN(A, B) ((A) < (B) ? (A) : (B)) +#define ABS(A) ((A) < 0 ? -(A) : (A)) #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 REMLEN(x) (BUFSIZ - strlen(x) - 1) #ifdef DEBUG # define PUTS(x) puts(x) @@ -22,10 +27,10 @@ # define PRINTF(x,...) ((void)0) #endif -void logmsg(FILE *, char *, va_list); void warn(char *, ...); __attribute__((noreturn)) -void die(char *, ...); +void err(char *, ...); uint32_t get_color(char *); +double distance(xcb_point_t, xcb_point_t); #endif