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 |
+ |
else if (!ray_pnprocs) /* in parent */ |
32 |
+ |
devclose(); |
33 |
+ |
exit(code); |
34 |
+ |
} |
35 |
+ |
|
36 |
+ |
|
37 |
+ |
void |
38 |
|
devopen( /* open device driver */ |
39 |
|
char *dname |
40 |
|
) |
101 |
|
(*dev->comout)(buf); |
102 |
|
refine(&ptrunk, pdepth+1); |
103 |
|
} |
88 |
– |
if (waitrays() < 0) |
89 |
– |
quit(1); |
104 |
|
if (dev->inpready) /* noticed some input */ |
105 |
|
command(": "); |
106 |
|
else /* finished this depth */ |
123 |
|
; |
124 |
|
if (*args) *args++ = '\0'; |
125 |
|
else *++args = '\0'; |
126 |
+ |
|
127 |
+ |
if (waitrays() < 0) /* clear ray queue */ |
128 |
+ |
quit(1); |
129 |
|
|
130 |
|
switch (inpbuf[0]) { |
131 |
|
case 'f': /* new frame (|focus|free) */ |
412 |
|
growth += refine(p->kid+DR, pd-1); |
413 |
|
if (my < pframe.u) |
414 |
|
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); |
415 |
|
} |
416 |
|
return(growth); |
417 |
|
} |