19 |
|
|
20 |
|
|
21 |
|
void |
22 |
+ |
quit(code) /* quit program */ |
23 |
+ |
int code; |
24 |
+ |
{ |
25 |
+ |
#ifdef MSTATS |
26 |
+ |
if (code == 2 && errno == ENOMEM) |
27 |
+ |
printmemstats(stderr); |
28 |
+ |
#endif |
29 |
+ |
if (ray_pnprocs > 0) /* close children if any */ |
30 |
+ |
ray_pclose(0); |
31 |
+ |
devclose(); |
32 |
+ |
exit(code); |
33 |
+ |
} |
34 |
+ |
|
35 |
+ |
|
36 |
+ |
void |
37 |
|
devopen( /* open device driver */ |
38 |
|
char *dname |
39 |
|
) |
100 |
|
(*dev->comout)(buf); |
101 |
|
refine(&ptrunk, pdepth+1); |
102 |
|
} |
88 |
– |
if (waitrays() < 0) |
89 |
– |
quit(1); |
103 |
|
if (dev->inpready) /* noticed some input */ |
104 |
|
command(": "); |
105 |
|
else /* finished this depth */ |
122 |
|
; |
123 |
|
if (*args) *args++ = '\0'; |
124 |
|
else *++args = '\0'; |
125 |
+ |
|
126 |
+ |
if (waitrays() < 0) /* clear ray queue */ |
127 |
+ |
quit(1); |
128 |
|
|
129 |
|
switch (inpbuf[0]) { |
130 |
|
case 'f': /* new frame (|focus|free) */ |
411 |
|
growth += refine(p->kid+DR, pd-1); |
412 |
|
if (my < pframe.u) |
413 |
|
growth += refine(p->kid+UR, pd-1); |
398 |
– |
} |
399 |
– |
/* recompute sum */ |
400 |
– |
if (growth) { |
401 |
– |
setcolor(p->v, 0.0, 0.0, 0.0); |
402 |
– |
for (i = 0; i < 4; i++) |
403 |
– |
addcolor(p->v, p->kid[i].v); |
404 |
– |
scalecolor(p->v, 0.25); |
414 |
|
} |
415 |
|
return(growth); |
416 |
|
} |