2000-05-19 08:34:13 +00:00
|
|
|
--- pnm/jpegtopnm.c.orig Sun Apr 9 07:46:08 2000
|
|
|
|
+++ pnm/jpegtopnm.c Mon May 8 00:00:00 2000
|
|
|
|
@@ -112,12 +112,22 @@
|
2000-04-27 11:28:19 +00:00
|
|
|
char ** const argv_parse = malloc(argc*sizeof(char *));
|
|
|
|
/* argv, except we modify it as we parse */
|
|
|
|
|
|
|
|
+ /* Create the OptStruct structure describing our options */
|
|
|
|
+ #define OPTENTRY(shortvalue,longvalue,typevalue,outputvalue,flagvalue) {\
|
|
|
|
+ option_def[option_def_index].shortName = (shortvalue); \
|
|
|
|
+ option_def[option_def_index].longName = (longvalue); \
|
|
|
|
+ option_def[option_def_index].type = (typevalue); \
|
|
|
|
+ option_def[option_def_index].arg = (outputvalue); \
|
|
|
|
+ option_def[option_def_index].flags = (flagvalue); \
|
|
|
|
+ option_def_index++; \
|
|
|
|
+ }
|
|
|
|
option_def_index = 0; /* incremented by OPTENTRY */
|
|
|
|
OPTENTRY(0, "verbose", OPT_FLAG, &cmdline_p->verbose, 0);
|
|
|
|
OPTENTRY(0, "dct", OPT_STRING, &dctval, 0);
|
|
|
|
OPTENTRY(0, "maxmemory", OPT_STRING, &maxmemory, 0);
|
|
|
|
OPTENTRY(0, "nosmooth", OPT_FLAG, &cmdline_p->nosmooth, 0);
|
|
|
|
OPTENTRY(0, "tracelevel", OPT_UINT, &cmdline_p->trace_level, 0);
|
|
|
|
+ option_def[option_def_index].type = OPT_END;
|
|
|
|
|
|
|
|
/* Set the defaults */
|
|
|
|
cmdline_p->verbose = FALSE;
|
2000-05-19 08:34:13 +00:00
|
|
|
@@ -130,7 +140,7 @@
|
|
|
|
argc_parse = argc;
|
|
|
|
for (i=0; i < argc; i++) argv_parse[i] = argv[i];
|
|
|
|
|
|
|
|
- pm_optParseOptions(&argc_parse, argv_parse, option_def, 0);
|
|
|
|
+ optParseOptions(&argc_parse, argv_parse, option_def, 0);
|
|
|
|
/* Uses and sets argc_parse, argv_parse and all of *cmdline_p. */
|
|
|
|
|
|
|
|
if (argc_parse - 1 == 0)
|