57 |
|
|
58 |
|
int nfile; /* number of files */ |
59 |
|
|
60 |
+ |
int echoheader = 1; |
61 |
|
char ourfmt[LPICFMT+1] = PICFMT; |
62 |
|
int wrongformat = 0; |
63 |
|
|
64 |
|
|
65 |
< |
static gethfunc tabputs; |
65 |
> |
static gethfunc headline; |
66 |
|
static void compos(void); |
67 |
|
static int cmpcolr(COLR c1, double lv2); |
68 |
|
static FILE * lblopen(char *s, int *xp, int *yp); |
70 |
|
|
71 |
|
|
72 |
|
static int |
73 |
< |
tabputs( /* print line preceded by a tab */ |
73 |
> |
headline( /* print line preceded by a tab */ |
74 |
|
char *s, |
75 |
|
void *p |
76 |
|
) |
85 |
|
strcpy(ourfmt, fmt); |
86 |
|
} else |
87 |
|
wrongformat = 1; |
88 |
< |
} else { |
88 |
> |
} else if (echoheader) { |
89 |
|
putc('\t', stdout); |
90 |
|
fputs(s, stdout); |
91 |
|
} |
112 |
|
|
113 |
|
for (an = 1; an < argc && argv[an][0] == '-'; an++) |
114 |
|
switch (argv[an][1]) { |
115 |
+ |
case 'h': |
116 |
+ |
echoheader = !echoheader; |
117 |
+ |
break; |
118 |
|
case 'x': |
119 |
|
xsiz = atoi(argv[++an]); |
120 |
|
break; |
228 |
|
} |
229 |
|
an++; |
230 |
|
/* get header */ |
231 |
< |
printf("%s:\n", input[nfile].name); |
232 |
< |
getheader(input[nfile].fp, tabputs, NULL); |
231 |
> |
if (echoheader) |
232 |
> |
printf("%s:\n", input[nfile].name); |
233 |
> |
getheader(input[nfile].fp, headline, NULL); |
234 |
|
if (wrongformat) { |
235 |
|
fprintf(stderr, "%s: incompatible input format\n", |
236 |
|
input[nfile].name); |
309 |
|
quit(0); |
310 |
|
userr: |
311 |
|
fprintf(stderr, |
312 |
< |
"Usage: %s [-x xr][-y yr][-b r g b][-a n][-s p][-o x0 y0][-la][-lh h] ", |
312 |
> |
"Usage: %s [-h][-x xr][-y yr][-b r g b][-a n][-s p][-o x0 y0][-la][-lh h] ", |
313 |
|
progname); |
314 |
|
fprintf(stderr, "[-t min1][+t max1][-l lab][=SS] pic1 x1 y1 ..\n"); |
315 |
|
quit(1); |