X-Git-Url: https://git.subgeniuskitty.com/xmenu/.git/blobdiff_plain/9cfea60e8e9b9efd63063f0f76d2598e6ca07b28..6abae763c6cce70c9b753778b5e3742a7719715a:/xmenu.h diff --git a/xmenu.h b/xmenu.h index ecb0d14..051bc4a 100644 --- a/xmenu.h +++ b/xmenu.h @@ -11,6 +11,11 @@ enum {LeftAlignment, CenterAlignment, RightAlignment}; #define MAX(x,y) ((x)>(y)?(x):(y)) #define MIN(x,y) ((x)<(y)?(x):(y)) #define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b)) +#define GETNUM(n, s) { \ + unsigned long __TMP__; \ + if ((__TMP__ = strtoul((s), NULL, 10)) < INT_MAX) \ + (n) = __TMP__; \ + } /* color enum */ enum {ColorFG, ColorBG, ColorLast};