commit - b048eacc9ddc6ca995783411d4df84c23f3a0351
commit + 10fd4f275feaef0b505cc8e65a2deccae69a0968
blob - cf5d97655d03db9cac670352dee971708813cb6f
blob + 050b858dac99d237c0cc1315b1ebd3e3e97b2bda
--- dmenu.c
+++ dmenu.c
/* enums */
enum { SchemeNorm, SchemeSel, SchemeOut, SchemeLast }; /* color schemes */
-typedef struct Item Item;
-struct Item {
+struct item {
char *text;
- Item *left, *right;
+ struct item *left, *right;
bool out;
};
-static void appenditem(Item *, Item **, Item **);
+static void appenditem(struct item *, struct item **, struct item **);
static void calcoffsets(void);
static char *cistrstr(const char *, const char *);
static void cleanup(void);
static int sw, sh; /* X display screen geometry width, height */
static int inputw, promptw;
static size_t cursor;
-static Item *items = NULL;
-static Item *matches, *matchend;
-static Item *prev, *curr, *next, *sel;
+static struct item *items = NULL;
+static struct item *matches, *matchend;
+static struct item *prev, *curr, *next, *sel;
static int mon = -1, screen;
static Atom clip, utf8;
static char *(*fstrstr)(const char *, const char *) = strstr;
static void
-appenditem(Item *item, Item **list, Item **last)
+appenditem(struct item *item, struct item **list, struct item **last)
{
if (*last)
(*last)->right = item;
drawmenu(void)
{
int curpos;
- Item *item;
+ struct item *item;
int x = 0, y = 0, h = bh, w;
drw_setscheme(drw, &scheme[SchemeNorm]);
char buf[sizeof text], *s;
int i, tokc = 0;
size_t len;
- Item *item, *lprefix, *lsubstr, *prefixend, *substrend;
+ struct item *item, *lprefix, *lsubstr, *prefixend, *substrend;
strcpy(buf, text);
/* separate input text into tokens to be matched individually */