58 |
|
int warnings = 1; /* print warnings? */ |
59 |
|
|
60 |
|
extern char *fgetline(), *fgetword(), *sskip(), |
61 |
< |
*atos(), *iskip(), *fskip(); |
61 |
> |
*atos(), *iskip(), *fskip(), *strcpy(); |
62 |
|
extern FILE *popen(); |
63 |
|
|
64 |
|
|
158 |
|
if (rt.buf == NULL || rt.dest == NULL) |
159 |
|
error(SYSTEM, "out of memory in init"); |
160 |
|
rt.nrays = 0; |
161 |
+ |
/* set up urand */ |
162 |
+ |
initurand(2048); |
163 |
|
} |
164 |
|
|
165 |
|
|
255 |
|
if (*++cp != '=') |
256 |
|
break; |
257 |
|
if (!*++cp) { |
258 |
+ |
strcpy(thisillum.datafile,thisillum.matname); |
259 |
|
thisillum.flags &= ~IL_DATCLB; |
260 |
|
continue; |
261 |
|
} |
266 |
|
continue; |
267 |
|
case 'i': /* include material */ |
268 |
|
case 'e': /* exclude material */ |
269 |
< |
matselect = (*cp == 'i') ? S_ELEM : S_COMPL; |
267 |
< |
if (*++cp != '=') |
269 |
> |
if (cp[1] != '=') |
270 |
|
break; |
271 |
+ |
matselect = (*++cp == 'i') ? S_ELEM : S_COMPL; |
272 |
|
atos(matcheck, MAXSTR, ++cp); |
273 |
|
cp = sskip(cp); |
274 |
|
continue; |
285 |
|
break; |
286 |
|
switch (*++cp) { |
287 |
|
case 'a': /* average */ |
288 |
< |
thisillum.flags |= IL_COLAVG; |
289 |
< |
thisillum.flags &= ~IL_COLDST; |
288 |
> |
thisillum.flags = (thisillum.flags|IL_COLAVG) |
289 |
> |
& ~IL_COLDST; |
290 |
|
break; |
291 |
|
case 'd': /* distribution */ |
292 |
|
thisillum.flags |= (IL_COLDST|IL_COLAVG); |
339 |
|
} |
340 |
|
doneheader = 0; |
341 |
|
continue; |
342 |
+ |
case '!': /* processed file! */ |
343 |
+ |
sprintf(errmsg, "(%s): processed by mkillum already!", |
344 |
+ |
nm); |
345 |
+ |
error(WARNING, errmsg); |
346 |
+ |
return; |
347 |
|
} |
348 |
|
opterr: /* skip faulty option */ |
349 |
|
cp = sskip(cp); |
374 |
|
putchar(' '); |
375 |
|
fputs(*av++, stdout); |
376 |
|
} |
377 |
< |
putchar('\n'); |
377 |
> |
fputs("\n#@mkillum !\n", stdout); |
378 |
|
} |
379 |
|
|
380 |
|
|