X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=utils.h;h=22e2c883119bc6fe69dd558f5a80340dd63f9673;hb=10599b94f040092f189787e5e555aca26c6af0ed;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hpb=9aeac98b6c4347d1fcf1f291583d6cde6e964b19;p=bspwm.git diff --git a/utils.h b/utils.h index e69de29..22e2c88 100644 --- a/utils.h +++ b/utils.h @@ -0,0 +1,24 @@ +#ifndef _UTILS_H +#define _UTILS_H + +#define LENGTH(x) (sizeof(x) / sizeof(*x)) +#define MAX(A, B) ((A) > (B) ? (A) : (B)) +#define MIN(A, B) ((A) < (B) ? (A) : (B)) +#define RESPONSE_TYPE(e) (e->response_type & ~0x80) + +#if 1 +# define PUTS(x) puts(x); +# define PRINTF(x,...) printf(x, ##__VA_ARGS__); +#else +# define PUTS(x) ; +# define PRINTF(x) ; +#endif + +typedef enum { + false, + true +} bool; + +void die(const char *, ...); + +#endif