8 |
|
#include <stdio.h> |
9 |
|
#include <math.h> |
10 |
|
#include <time.h> |
11 |
+ |
#include <string.h> |
12 |
+ |
|
13 |
|
#include "tiffio.h" |
14 |
|
#include "color.h" |
15 |
|
#include "tonemap.h" |
46 |
|
|
47 |
|
#define closepicture(p) (fclose((p)->fp),free((void *)(p))) |
48 |
|
|
49 |
+ |
static gethfunc headline; |
50 |
|
|
51 |
< |
main(argc, argv) |
52 |
< |
int argc; |
53 |
< |
char *argv[]; |
51 |
> |
|
52 |
> |
int |
53 |
> |
main( |
54 |
> |
int argc, |
55 |
> |
char *argv[] |
56 |
> |
) |
57 |
|
{ |
58 |
|
PICTURE *pin = NULL; |
59 |
|
TIFF *tin = NULL; |
132 |
|
} |
133 |
|
|
134 |
|
|
135 |
< |
int |
136 |
< |
headline(s, pp) /* process line from header */ |
137 |
< |
char *s; |
138 |
< |
register PICTURE *pp; |
135 |
> |
static int |
136 |
> |
headline( /* process line from header */ |
137 |
> |
char *s, |
138 |
> |
void *pp |
139 |
> |
) |
140 |
|
{ |
141 |
|
register char *cp; |
142 |
|
|
144 |
|
if (*cp & 0x80) |
145 |
|
return(-1); /* non-ascii in header */ |
146 |
|
if (isaspect(s)) |
147 |
< |
pp->pa *= aspectval(s); |
147 |
> |
((PICTURE *)pp)->pa *= aspectval(s); |
148 |
|
else |
149 |
< |
formatval(pp->fmt, s); |
149 |
> |
formatval(((PICTURE *)pp)->fmt, s); |
150 |
|
return(0); |
151 |
|
} |
152 |
|
|
177 |
|
return(NULL); /* serious error -- should exit? */ |
178 |
|
pp->fp = fp; pp->fmt[0] = '\0'; pp->pa = 1.; |
179 |
|
/* load header */ |
180 |
< |
if (getheader(fp, headline, (char *)pp) < 0) { |
180 |
> |
if (getheader(fp, headline, pp) < 0) { |
181 |
|
closepicture(pp); |
182 |
|
return(NULL); |
183 |
|
} |