105 |
|
int argc; |
106 |
|
char *argv[]; |
107 |
|
{ |
108 |
< |
int onintr(); |
109 |
< |
double atof(); |
108 |
> |
int onintr(), checkhead(); |
109 |
|
char sbuf[256]; |
110 |
|
register int i; |
111 |
|
|
140 |
|
quitmsg(errmsg); |
141 |
|
} |
142 |
|
/* get header */ |
143 |
< |
while (fgets(sbuf, sizeof(sbuf), fin) != NULL && sbuf[0] != '\n') |
145 |
< |
if (!strncmp(sbuf, "EXPOSURE=", 9)) |
146 |
< |
exposure *= atof(sbuf+9); |
147 |
< |
|
143 |
> |
getheader(fin, checkhead); |
144 |
|
/* get picture dimensions */ |
145 |
|
if (fgetresolu(&xmax, &ymax, fin) != (YMAJOR|YDECR)) |
146 |
|
quitmsg("bad picture size"); |
163 |
|
userr: |
164 |
|
fprintf(stderr, "Usage: %s [-d][-b] input\n", progname); |
165 |
|
quit(1); |
166 |
+ |
} |
167 |
+ |
|
168 |
+ |
|
169 |
+ |
checkhead(line) /* deal with line from header */ |
170 |
+ |
char *line; |
171 |
+ |
{ |
172 |
+ |
if (!strncmp(line, "EXPOSURE=", 9)) |
173 |
+ |
exposure *= atof(line+9); |
174 |
|
} |
175 |
|
|
176 |
|
|