commit cc596365ac9c522beb8978cfca741d23d3bf83ae from: Hiltjo Posthuma date: Sun Nov 8 22:03:34 2015 UTC unboolify dmenu commit - c9e4e152e61b22186ba4f4ca58ae8c8d3d83e81e commit + cc596365ac9c522beb8978cfca741d23d3bf83ae blob - bc2dc407dbe3726287fe4af41bb9ef248693950f blob + a9122f73add3418911a1b8a4b58c7b95796c43cb --- config.def.h +++ config.def.h @@ -1,7 +1,7 @@ /* See LICENSE file for copyright and license details. */ /* Default settings; can be overriden by command line. */ -static bool topbar = true; /* -b option; if False, dmenu appears at bottom */ +static int topbar = 1; /* -b option; if 0, dmenu appears at bottom */ /* -fn option overrides fonts[0]; default X11 font or font set */ static const char *fonts[] = { "monospace:size=10" blob - 6308fa9a10294cd4e04724f469a2b3deb18ea05a blob + a07f8e32145faae2a9ca75dfab9c6681617ea148 --- dmenu.c +++ dmenu.c @@ -1,7 +1,6 @@ /* See LICENSE file for copyright and license details. */ #include #include -#include #include #include #include @@ -32,7 +31,7 @@ enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; struct item { char *text; struct item *left, *right; - bool out; + int out; }; static char text[BUFSIZ] = ""; @@ -421,7 +420,7 @@ keypress(XKeyEvent *ev) exit(0); } if (sel) - sel->out = true; + sel->out = 1; break; case XK_Right: if (text[cursor] != '\0') { @@ -480,7 +479,7 @@ readstdin(void) *p = '\0'; if (!(items[i].text = strdup(buf))) die("cannot strdup %u bytes:", strlen(buf) + 1); - items[i].out = false; + items[i].out = 0; if (strlen(items[i].text) > max) max = strlen(maxstr = items[i].text); } @@ -617,8 +616,7 @@ usage(void) int main(int argc, char *argv[]) { - bool fast = false; - int i; + int i, fast = 0; for (i = 1; i < argc; i++) /* these options take no arguments */ @@ -626,9 +624,9 @@ main(int argc, char *argv[]) puts("dmenu-"VERSION); exit(0); } else if (!strcmp(argv[i], "-b")) /* appears at the bottom of the screen */ - topbar = false; + topbar = 0; else if (!strcmp(argv[i], "-f")) /* grabs keyboard before reading stdin */ - fast = true; + fast = 1; else if (!strcmp(argv[i], "-i")) { /* case-insensitive item matching */ fstrncmp = strncasecmp; fstrstr = cistrstr;