110 |
|
lastin = -1; /* flag full sort */ |
111 |
|
break; |
112 |
|
} |
113 |
– |
if (lastin < 0) /* sort updated list */ |
114 |
– |
sortcomplist(); |
113 |
|
return; /* no display */ |
114 |
|
default: |
115 |
|
error(CONSISTENCY, "bundle_set called with unknown operation"); |
116 |
|
} |
117 |
< |
n = 0; /* allocate packet holder */ |
118 |
< |
for (i = 0; i < nents; i++) |
119 |
< |
if (clist[i].nr > n) |
122 |
< |
n = clist[i].nr; |
117 |
> |
if (outdev == NULL) |
118 |
> |
return; |
119 |
> |
n = 8*RPACKSIZ; /* allocate packet holder */ |
120 |
|
p = (PACKHEAD *)malloc(packsiz(n)); |
121 |
|
if (p == NULL) |
122 |
|
goto memerr; |
123 |
|
/* display what we have */ |
124 |
|
for (i = 0; i < nents; i++) |
125 |
|
if ((b = hdgetbeam(hdlist[clist[i].hd], clist[i].bi)) != NULL) { |
126 |
+ |
if (b->nrm > n) { |
127 |
+ |
n = b->nrm; |
128 |
+ |
p = (PACKHEAD *)realloc((char *)p, packsiz(n)); |
129 |
+ |
if (p == NULL) |
130 |
+ |
goto memerr; |
131 |
+ |
} |
132 |
|
bcopy((char *)hdbray(b), (char *)packra(p), |
133 |
|
(p->nr=b->nrm)*sizeof(RAYVAL)); |
134 |
+ |
p->hd = clist[i].hd; |
135 |
+ |
p->bi = clist[i].bi; |
136 |
|
disp_packet(p); |
137 |
|
} |
138 |
|
free((char *)p); /* clean up */ |
289 |
|
complist+listpos, complen-listpos); |
290 |
|
free((char *)list2); |
291 |
|
} |
287 |
– |
/* check for all finished */ |
288 |
– |
if (complist[0].nr <= bnrays(hdlist[complist[0].hd],complist[0].bi)) { |
289 |
– |
free((char *)complist); |
290 |
– |
complist = NULL; |
291 |
– |
complen = 0; |
292 |
– |
} |
292 |
|
/* drop satisfied requests */ |
293 |
|
for (i = complen; i-- && complist[i].nr <= |
294 |
|
bnrays(hdlist[complist[i].hd],complist[i].bi); ) |
328 |
|
int ncomp; |
329 |
|
register int i; |
330 |
|
|
332 |
– |
if (complen <= 0) |
333 |
– |
return(0); |
331 |
|
if (listpos > lastin) /* time to sort the list */ |
332 |
|
sortcomplist(); |
333 |
+ |
if (complen <= 0) |
334 |
+ |
return(0); |
335 |
|
p->hd = complist[listpos].hd; |
336 |
|
p->bi = complist[listpos].bi; |
337 |
|
ncomp = bnrays(hdlist[p->hd],p->bi); |