aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarg@10ksloc.org <unknown>2006-08-07 07:39:31 +0200
committerarg@10ksloc.org <unknown>2006-08-07 07:39:31 +0200
commitd32fd15ea47bab2bb9cc2674b75c3cc008ef04aa (patch)
treee818e2d411e3116e38b972491a5d0391b9ec3719
parentbb393554fda90ce4016ab7236a9a47428bac45a9 (diff)
renamed some functions to make it more readable
-rw-r--r--main.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/main.c b/main.c
index f151819..ee32011 100644
--- a/main.c
+++ b/main.c
@@ -109,7 +109,7 @@ drawmenu()
109} 109}
110 110
111static void 111static void
112input(char *pattern) 112match(char *pattern)
113{ 113{
114 unsigned int plen; 114 unsigned int plen;
115 Item *i, *j; 115 Item *i, *j;
@@ -178,7 +178,7 @@ kpress(XKeyEvent * e)
178 case XK_U: 178 case XK_U:
179 case XK_u: 179 case XK_u:
180 text[0] = 0; 180 text[0] = 0;
181 input(text); 181 match(text);
182 drawmenu(); 182 drawmenu();
183 return; 183 return;
184 break; 184 break;
@@ -201,7 +201,7 @@ kpress(XKeyEvent * e)
201 if(!sel) 201 if(!sel)
202 return; 202 return;
203 strncpy(text, sel->text, sizeof(text)); 203 strncpy(text, sel->text, sizeof(text));
204 input(text); 204 match(text);
205 break; 205 break;
206 case XK_Right: 206 case XK_Right:
207 if(!(sel && sel->right)) 207 if(!(sel && sel->right))
@@ -233,9 +233,9 @@ kpress(XKeyEvent * e)
233 prev_nitem = nitem; 233 prev_nitem = nitem;
234 do { 234 do {
235 text[--i] = 0; 235 text[--i] = 0;
236 input(text); 236 match(text);
237 } while(i && nitem && prev_nitem == nitem); 237 } while(i && nitem && prev_nitem == nitem);
238 input(text); 238 match(text);
239 } 239 }
240 break; 240 break;
241 default: 241 default:
@@ -245,14 +245,14 @@ kpress(XKeyEvent * e)
245 strncat(text, buf, sizeof(text)); 245 strncat(text, buf, sizeof(text));
246 else 246 else
247 strncpy(text, buf, sizeof(text)); 247 strncpy(text, buf, sizeof(text));
248 input(text); 248 match(text);
249 } 249 }
250 } 250 }
251 drawmenu(); 251 drawmenu();
252} 252}
253 253
254static char * 254static char *
255readinput() 255readstdin()
256{ 256{
257 static char *maxname = NULL; 257 static char *maxname = NULL;
258 char *p, buf[1024]; 258 char *p, buf[1024];
@@ -309,7 +309,7 @@ main(int argc, char *argv[])
309 screen = DefaultScreen(dpy); 309 screen = DefaultScreen(dpy);
310 root = RootWindow(dpy, screen); 310 root = RootWindow(dpy, screen);
311 311
312 maxname = readinput(); 312 maxname = readstdin();
313 313
314 /* grab as early as possible, but after reading all items!!! */ 314 /* grab as early as possible, but after reading all items!!! */
315 while(XGrabKeyboard(dpy, root, True, GrabModeAsync, 315 while(XGrabKeyboard(dpy, root, True, GrabModeAsync,
@@ -346,7 +346,7 @@ main(int argc, char *argv[])
346 cmdw = mw / 3; 346 cmdw = mw / 3;
347 347
348 text[0] = 0; 348 text[0] = 0;
349 input(text); 349 match(text);
350 XMapRaised(dpy, win); 350 XMapRaised(dpy, win);
351 drawmenu(); 351 drawmenu();
352 XSync(dpy, False); 352 XSync(dpy, False);