parent
2c6e8805ba
commit
ee6cf2f59d
@ -263,7 +263,7 @@ typedef struct {
|
|||||||
|
|
||||||
/* These functions are called by main. */
|
/* These functions are called by main. */
|
||||||
|
|
||||||
void tiff2pdf_usage(void);
|
static void tiff2pdf_usage(int);
|
||||||
int tiff2pdf_match_paper_size(float*, float*, char*);
|
int tiff2pdf_match_paper_size(float*, float*, char*);
|
||||||
|
|
||||||
/* These functions are used to generate a PDF from a TIFF. */
|
/* These functions are used to generate a PDF from a TIFF. */
|
||||||
@ -755,10 +755,11 @@ int main(int argc, char** argv){
|
|||||||
t2p->pdf_image_interpolate = 1;
|
t2p->pdf_image_interpolate = 1;
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
case '?':
|
tiff2pdf_usage(EXIT_SUCCESS);
|
||||||
tiff2pdf_usage();
|
|
||||||
goto success;
|
goto success;
|
||||||
break;
|
case '?':
|
||||||
|
tiff2pdf_usage(EXIT_FAILURE);
|
||||||
|
goto fail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -775,14 +776,14 @@ int main(int argc, char** argv){
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TIFFError(TIFF2PDF_MODULE, "No input file specified");
|
TIFFError(TIFF2PDF_MODULE, "No input file specified");
|
||||||
tiff2pdf_usage();
|
tiff2pdf_usage(EXIT_FAILURE);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(argc > optind) {
|
if(argc > optind) {
|
||||||
TIFFError(TIFF2PDF_MODULE,
|
TIFFError(TIFF2PDF_MODULE,
|
||||||
"No support for multiple input files");
|
"No support for multiple input files");
|
||||||
tiff2pdf_usage();
|
tiff2pdf_usage(EXIT_FAILURE);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -844,8 +845,8 @@ success:
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tiff2pdf_usage(){
|
static void tiff2pdf_usage(int code) {
|
||||||
char* lines[]={
|
static const char* lines[]={
|
||||||
"usage: tiff2pdf [options] input.tiff",
|
"usage: tiff2pdf [options] input.tiff",
|
||||||
"options:",
|
"options:",
|
||||||
" -o: output to file name",
|
" -o: output to file name",
|
||||||
@ -880,10 +881,11 @@ void tiff2pdf_usage(){
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
int i=0;
|
int i=0;
|
||||||
|
FILE * out = (code == EXIT_SUCCESS) ? stdout : stderr;
|
||||||
|
|
||||||
fprintf(stderr, "%s\n\n", TIFFGetVersion());
|
fprintf(out, "%s\n\n", TIFFGetVersion());
|
||||||
for (i=0;lines[i]!=NULL;i++){
|
for (i=0;lines[i]!=NULL;i++){
|
||||||
fprintf(stderr, "%s\n", lines[i]);
|
fprintf(out, "%s\n", lines[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user