30 |
|
|
31 |
|
char *outdev = NULL; /* output device name */ |
32 |
|
|
33 |
+ |
int readinp = 0; /* read commands from stdin */ |
34 |
+ |
|
35 |
|
time_t starttime; /* time we got started */ |
36 |
|
time_t endtime; /* time we should end by */ |
37 |
|
time_t reporttime; /* time for next report */ |
62 |
|
int force = 0; |
63 |
|
/* mark start time */ |
64 |
|
starttime = time(NULL); |
65 |
< |
initurand(10240); /* initialize urand */ |
65 |
> |
initurand(16384); /* initialize urand */ |
66 |
|
progname = argv[0]; /* get arguments */ |
67 |
|
for (i = 1; i < argc && argv[i][0] == '-'; i++) |
68 |
|
switch (argv[i][1]) { |
72 |
|
case 'f': /* force overwrite */ |
73 |
|
force++; |
74 |
|
break; |
75 |
+ |
case 'i': /* read input from stdin */ |
76 |
+ |
readinp++; |
77 |
+ |
break; |
78 |
|
case 'n': /* compute processes */ |
79 |
|
if (i >= argc-2) |
80 |
|
goto userr; |
192 |
|
{ |
193 |
|
extern int global_packet(); |
194 |
|
register int i; |
195 |
+ |
/* close holodeck on exec() */ |
196 |
+ |
fcntl(hdlist[0]->fd, F_SETFD, FD_CLOEXEC); |
197 |
|
|
198 |
|
if (outdev != NULL) /* open output device */ |
199 |
|
disp_open(outdev); |
370 |
|
if (gp == NULL) /* already initialized? */ |
371 |
|
return; |
372 |
|
/* set grid parameters */ |
373 |
+ |
gp->grid[0] = gp->grid[1] = gp->grid[2] = 0; |
374 |
|
if (sscanf(vval(SECTION), |
375 |
< |
"%lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf", |
375 |
> |
"%lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %lf %hd %hd %hd", |
376 |
|
&gp->orig[0], &gp->orig[1], &gp->orig[2], |
377 |
|
&gp->xv[0][0], &gp->xv[0][1], &gp->xv[0][2], |
378 |
|
&gp->xv[1][0], &gp->xv[1][1], &gp->xv[1][2], |
379 |
< |
&gp->xv[2][0], &gp->xv[2][1], &gp->xv[2][2]) != 12) |
379 |
> |
&gp->xv[2][0], &gp->xv[2][1], &gp->xv[2][2], |
380 |
> |
&gp->grid[0], &gp->grid[1], &gp->grid[2]) < 12) |
381 |
|
badvalue(SECTION); |
382 |
|
maxlen = 0.; |
383 |
|
for (i = 0; i < 3; i++) |
391 |
|
if ((d = vflt(GRID)) <= FTINY) |
392 |
|
badvalue(GRID); |
393 |
|
for (i = 0; i < 3; i++) |
394 |
< |
gp->grid[i] = len[i]/d + (1.-FTINY); |
394 |
> |
if (gp->grid[i] <= 0) |
395 |
> |
gp->grid[i] = len[i]/d + (1.-FTINY); |
396 |
|
} |
397 |
|
|
398 |
|
|