1 |
< |
/* Copyright (c) 1993 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1995 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
69 |
|
|
70 |
|
char *progname; |
71 |
|
int verbose = 0; |
72 |
+ |
unsigned timelim = 0; |
73 |
|
int rvrlim = -1; |
74 |
|
|
75 |
|
extern long lseek(), ftell(); |
121 |
|
break; |
122 |
|
pixaspect = atof(argv[i+1]); |
123 |
|
continue; |
124 |
+ |
case 'T': /* time limit (hours) */ |
125 |
+ |
if (argv[i][2]) |
126 |
+ |
break; |
127 |
+ |
timelim = atof(argv[++i])*3600. + .5; |
128 |
+ |
break; |
129 |
|
case 'x': /* overall x resolution */ |
130 |
|
if (argv[i][2]) |
131 |
|
break; |
286 |
|
exit(1); |
287 |
|
} |
288 |
|
signal(SIGALRM, onalrm); |
289 |
+ |
if (timelim) |
290 |
+ |
alarm(timelim); |
291 |
|
return; |
292 |
|
filerr: |
293 |
|
fprintf(stderr, "%s: i/o error on file \"%s\"\n", progname, outfile); |
353 |
|
return(0); /* only check if asked */ |
354 |
|
if (pdone == NULL) /* first call */ |
355 |
|
pdone = calloc(hmult*vmult, sizeof(char)); |
356 |
+ |
if (pdone == NULL) { |
357 |
+ |
fprintf(stderr, "%s: out of memory\n", progname); |
358 |
+ |
exit(1); |
359 |
+ |
} |
360 |
|
if (readpos != -1) /* mark what's been done */ |
361 |
|
fseek(syncfp, readpos, 0); |
362 |
|
while (fscanf(syncfp, "%d %d", xp, yp) == 2) |