Item *next; /* traverses all items */
Item *left, *right; /* traverses items matching current search pattern */
Item *next; /* traverses all items */
Item *left, *right; /* traverses items matching current search pattern */
};
/* forward declarations */
Item *appenditem(Item *i, Item *last);
void calcoffsets(void);
};
/* forward declarations */
Item *appenditem(Item *i, Item *last);
void calcoffsets(void);
unsigned int textnw(const char *text, unsigned int len);
unsigned int textw(const char *text);
unsigned int textnw(const char *text, unsigned int len);
unsigned int textw(const char *text);
+char *
+cistrstr(const char *s, const char *sub) {
+ int c, csub;
+ unsigned int len;
+
+ if(!sub)
+ return (char *)s;
+ if((c = *sub++) != 0) {
+ c = tolower(c);
+ len = strlen(sub);
+ do {
+ do {
+ if((csub = *s++) == 0)
+ return (NULL);
+ }
+ while(tolower(csub) != c);
+ }
+ while(strncasecmp(s, sub, len) != 0);
+ s--;
+ }
+ return (char *)s;
+}
+
- if(!fstrncmp(pattern, i->text, plen)
- || fstrstr(i->text, pattern))
+ if((i->matched = !fstrncmp(pattern, i->text, plen)))
+ j = appenditem(i, j);
+ for(i = allitems; i; i = i->next)
+ if(!i->matched && fstrstr(i->text, pattern))
wa.event_mask = ExposureMask | ButtonPressMask | KeyPressMask;
mw = w ? w : DisplayWidth(dpy, screen);
mh = dc.font.height + 2;
wa.event_mask = ExposureMask | ButtonPressMask | KeyPressMask;
mw = w ? w : DisplayWidth(dpy, screen);
mh = dc.font.height + 2;
win = XCreateWindow(dpy, root, x, y, mw, mh, 0,
DefaultDepth(dpy, screen), CopyFromParent,
DefaultVisual(dpy, screen),
win = XCreateWindow(dpy, root, x, y, mw, mh, 0,
DefaultDepth(dpy, screen), CopyFromParent,
DefaultVisual(dpy, screen),
-char *
-cistrstr(const char *s, const char *sub) {
- int c, csub;
- unsigned int len;
-
- if(!sub)
- return (char *)s;
- if((c = *sub++) != 0) {
- c = tolower(c);
- len = strlen(sub);
- do {
- do {
- if((csub = *s++) == 0)
- return (NULL);
- }
- while(tolower(csub) != c);
- }
- while(strncasecmp(s, sub, len) != 0);
- s--;
- }
- return (char *)s;
-}
-
if(++i < argc) x = atoi(argv[i]);
}
else if(!strcmp(argv[i], "-y")) {
if(++i < argc) x = atoi(argv[i]);
}
else if(!strcmp(argv[i], "-y")) {
}
else if(!strcmp(argv[i], "-w")) {
if(++i < argc) w = atoi(argv[i]);
}
else if(!strcmp(argv[i], "-w")) {
if(++i < argc) w = atoi(argv[i]);