renamed some functions to make it more readable
d32fd15e
1 file(s) · +9 −9
| 109 | 109 | } |
|
| 110 | 110 | ||
| 111 | 111 | static void |
|
| 112 | - | input(char *pattern) |
|
| 112 | + | match(char *pattern) |
|
| 113 | 113 | { |
|
| 114 | 114 | unsigned int plen; |
|
| 115 | 115 | Item *i, *j; |
|
| 178 | 178 | case XK_U: |
|
| 179 | 179 | case XK_u: |
|
| 180 | 180 | text[0] = 0; |
|
| 181 | - | input(text); |
|
| 181 | + | match(text); |
|
| 182 | 182 | drawmenu(); |
|
| 183 | 183 | return; |
|
| 184 | 184 | break; |
|
| 201 | 201 | if(!sel) |
|
| 202 | 202 | return; |
|
| 203 | 203 | strncpy(text, sel->text, sizeof(text)); |
|
| 204 | - | input(text); |
|
| 204 | + | match(text); |
|
| 205 | 205 | break; |
|
| 206 | 206 | case XK_Right: |
|
| 207 | 207 | if(!(sel && sel->right)) |
|
| 233 | 233 | prev_nitem = nitem; |
|
| 234 | 234 | do { |
|
| 235 | 235 | text[--i] = 0; |
|
| 236 | - | input(text); |
|
| 236 | + | match(text); |
|
| 237 | 237 | } while(i && nitem && prev_nitem == nitem); |
|
| 238 | - | input(text); |
|
| 238 | + | match(text); |
|
| 239 | 239 | } |
|
| 240 | 240 | break; |
|
| 241 | 241 | default: |
|
| 245 | 245 | strncat(text, buf, sizeof(text)); |
|
| 246 | 246 | else |
|
| 247 | 247 | strncpy(text, buf, sizeof(text)); |
|
| 248 | - | input(text); |
|
| 248 | + | match(text); |
|
| 249 | 249 | } |
|
| 250 | 250 | } |
|
| 251 | 251 | drawmenu(); |
|
| 252 | 252 | } |
|
| 253 | 253 | ||
| 254 | 254 | static char * |
|
| 255 | - | readinput() |
|
| 255 | + | readstdin() |
|
| 256 | 256 | { |
|
| 257 | 257 | static char *maxname = NULL; |
|
| 258 | 258 | char *p, buf[1024]; |
|
| 309 | 309 | screen = DefaultScreen(dpy); |
|
| 310 | 310 | root = RootWindow(dpy, screen); |
|
| 311 | 311 | ||
| 312 | - | maxname = readinput(); |
|
| 312 | + | maxname = readstdin(); |
|
| 313 | 313 | ||
| 314 | 314 | /* grab as early as possible, but after reading all items!!! */ |
|
| 315 | 315 | while(XGrabKeyboard(dpy, root, True, GrabModeAsync, |
|
| 346 | 346 | cmdw = mw / 3; |
|
| 347 | 347 | ||
| 348 | 348 | text[0] = 0; |
|
| 349 | - | input(text); |
|
| 349 | + | match(text); |
|
| 350 | 350 | XMapRaised(dpy, win); |
|
| 351 | 351 | drawmenu(); |
|
| 352 | 352 | XSync(dpy, False); |
|