History

devdraw.9p: rename variables (preparing for drawfs)

yiyus committed 15 years ago

Commit bc61af91 parent 24569131 file · +27 −27Browse files

Unified · Split

util/9p-srv.c+27−27
@@ -25,7 +25,7 @@ void mousethread(void*); · 24 unmodified lines
2525
2626 int chatty = 0;
2727 int drawsleep;
28−int fd;
28+int wsysfd;
2929
3030 Channel *kbdchan;
3131 Channel *mousechan;
@@ -48,7 +48,7 @@ bell(void *v, char *msg) · 16 unmodified lines
4848 void
4949 threadmain(int argc, char **argv)
5050 {
51− char *addr, *defaddr, *ns;
51+ char *defwsys, *wsysaddr, *ns;
5252 uchar buf[4], *mbuf;
5353 int nmbuf, n, nn;
5454 Ioproc *io;
@@ -89,20 +89,20 @@ threadmain(int argc, char **argv) · 34 unmodified lines
8989 * Connect to 9P server defined by $WSYS
9090 * or unix!$NAMESPACE/wsys.
9191 */
92− addr = getenv("WSYS");
93− defaddr = nil;
94− if(addr == 0){
92+ wsysaddr = getenv("WSYS");
93+ defwsys = nil;
94+ if(wsysaddr == 0){
9595 ns = getns();
9696 if(ns == nil)
9797 sysfatal("no name space");
98− defaddr = smprint("unix!%s/wsys", ns);
99− addr = defaddr;
98+ defwsys = smprint("unix!%s/wsys", ns);
99+ wsysaddr = defwsys;
100100 }
101− fd = dial(addr, 0, 0, 0);
102− if(fd < 0)
103− sysfatal("dial %s: %r", addr);
104− if(addr == defaddr)
105− free(addr);
101+ wsysfd = dial(wsysaddr, 0, 0, 0);
102+ if(wsysfd < 0)
103+ sysfatal("dial %s: %r", wsysaddr);
104+ if(wsysaddr == defwsys)
105+ free(wsysaddr);
106106
107107 mbuf = nil;
108108 nmbuf = 0;
@@ -255,7 +255,7 @@ runmsg(Wsysmsg *m) · 146 unmodified lines
255255 Rectangle r;
256256 static int border;
257257 static CFid *fcons, *fcursor, *fmouse, *fctl, *fdata, *frddraw;
258− static CFsys *fsys;
258+ static CFsys *wsysfs;
259259
260260 static int na;
261261 static uchar *aa;
@@ -263,14 +263,14 @@ runmsg(Wsysmsg *m) · 1 unmodified line
263263 switch(m->type){
264264 case Tinit:
265265 sprint((char*)buf, "new %s", m->winsize);
266− if((fsys = fsmount(fd, (char*)buf)) == nil)
266+ if((wsysfs = fsmount(wsysfd, (char*)buf)) == nil)
267267 sysfatal("fsmount: %r");
268268
269− fcons = fsopen(fsys, "cons", OREAD);
270− fmouse = fsopen(fsys, "mouse", ORDWR);
271− fcursor = fsopen(fsys, "cursor", OWRITE);
269+ fcons = fsopen(wsysfs, "cons", OREAD);
270+ fmouse = fsopen(wsysfs, "mouse", ORDWR);
271+ fcursor = fsopen(wsysfs, "cursor", OWRITE);
272272
273− f = fsopen(fsys, "label", OWRITE);
273+ f = fsopen(wsysfs, "label", OWRITE);
274274 fsprint(f, m->label);
275275 fsclose(f);
276276
@@ -281,7 +281,7 @@ runmsg(Wsysmsg *m) · 4 unmodified lines
281281 */
282282 kbdchan = chancreate(sizeof(uchar), 12);
283283 mousechan = chancreate(sizeof(uchar), 12);
284− f= fsopen(fsys, "consctl", OWRITE);
284+ f= fsopen(wsysfs, "consctl", OWRITE);
285285 fsprint(f, "rawon");
286286 threadcreate(kbdthread, fcons, STACK);
287287 threadcreate(mousethread, fmouse, STACK);
@@ -290,11 +290,11 @@ runmsg(Wsysmsg *m) · 2 unmodified lines
290290 * Open draw(3) files and register
291291 * image named winname
292292 */
293− fctl = fsopen(fsys, "draw/new", ORDWR);
293+ fctl = fsopen(wsysfs, "draw/new", ORDWR);
294294 fsread(fctl, buf, 12*12);
295295 n = atoi((char*)buf);
296296 sprint((char*)buf, "draw/%d/data", n);
297− fdata = fsopen(fsys, (char*)buf, ORDWR);
297+ fdata = fsopen(wsysfs, (char*)buf, ORDWR);
298298
299299 replymsg(m);
300300 break;
@@ -338,14 +338,14 @@ runmsg(Wsysmsg *m) · 37 unmodified lines
338338 break;
339339
340340 case Tlabel:
341− f = fsopen(fsys, "label", OWRITE);
341+ f = fsopen(wsysfs, "label", OWRITE);
342342 fsprint(f, m->label);
343343 fsclose(f);
344344 replymsg(m);
345345 break;
346346
347347 case Trdsnarf:
348− f = fsopen(fsys, "snarf", OREAD);
348+ f = fsopen(wsysfs, "snarf", OREAD);
349349 fsread(f, buf, sizeof buf);
350350 fsclose(f);
351351 m->snarf = strdup((char*)buf);
@@ -353,7 +353,7 @@ runmsg(Wsysmsg *m) · 1 unmodified line
353353 break;
354354
355355 case Twrsnarf:
356− f = fsopen(fsys, "snarf", OWRITE);
356+ f = fsopen(wsysfs, "snarf", OWRITE);
357357 fsprint(f, m->snarf);
358358 fsclose(f);
359359 replymsg(m);
@@ -399,7 +399,7 @@ runmsg(Wsysmsg *m) · 39 unmodified lines
399399 */
400400 SET(n);
401401 if(m->count == 2 && m->data[0] == 'J' && m->data[1] == 'I'){
402− f = fsopen(fsys, "winname", OREAD);
402+ f = fsopen(wsysfs, "winname", OREAD);
403403 buf[0] = 'n';
404404 n = fsread(f, &buf[1+4+1], 64);
405405 border = (strncmp((char*)&buf[1+4+1], "noborder", 8) != 0);
@@ -441,14 +441,14 @@ End: · 35 unmodified lines
441441 break;
442442
443443 case Ttop:
444− f = fsopen(fsys, "wctl", OWRITE);
444+ f = fsopen(wsysfs, "wctl", OWRITE);
445445 fsprint(f, "top");
446446 fsclose(f);
447447 replymsg(m);
448448 break;
449449
450450 case Tresize:
451− f = fsopen(fsys, "wctl", OWRITE);
451+ f = fsopen(wsysfs, "wctl", OWRITE);
452452 fsprint(f, "resize %d %d", Dx(m->rect), Dy(m->rect));
453453 fsclose(f);
454454 replymsg(m);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t