Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

617 lines
19 KiB

  1. /*
  2. * djpeg.c
  3. *
  4. * Copyright (C) 1991-1997, Thomas G. Lane.
  5. * Modified 2009 by Guido Vollbeding.
  6. * This file is part of the Independent JPEG Group's software.
  7. * For conditions of distribution and use, see the accompanying README file.
  8. *
  9. * This file contains a command-line user interface for the JPEG decompressor.
  10. * It should work on any system with Unix- or MS-DOS-style command lines.
  11. *
  12. * Two different command line styles are permitted, depending on the
  13. * compile-time switch TWO_FILE_COMMANDLINE:
  14. * djpeg [options] inputfile outputfile
  15. * djpeg [options] [inputfile]
  16. * In the second style, output is always to standard output, which you'd
  17. * normally redirect to a file or pipe to some other program. Input is
  18. * either from a named file or from standard input (typically redirected).
  19. * The second style is convenient on Unix but is unhelpful on systems that
  20. * don't support pipes. Also, you MUST use the first style if your system
  21. * doesn't do binary I/O to stdin/stdout.
  22. * To simplify script writing, the "-outfile" switch is provided. The syntax
  23. * djpeg [options] -outfile outputfile inputfile
  24. * works regardless of which command line style is used.
  25. */
  26. #include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
  27. #include "jversion.h" /* for version message */
  28. #include <ctype.h> /* to declare isprint() */
  29. #ifdef USE_CCOMMAND /* command-line reader for Macintosh */
  30. #ifdef __MWERKS__
  31. #include <SIOUX.h> /* Metrowerks needs this */
  32. #include <console.h> /* ... and this */
  33. #endif
  34. #ifdef THINK_C
  35. #include <console.h> /* Think declares it here */
  36. #endif
  37. #endif
  38. /* Create the add-on message string table. */
  39. #define JMESSAGE(code,string) string ,
  40. static const char * const cdjpeg_message_table[] = {
  41. #include "cderror.h"
  42. NULL
  43. };
  44. /*
  45. * This list defines the known output image formats
  46. * (not all of which need be supported by a given version).
  47. * You can change the default output format by defining DEFAULT_FMT;
  48. * indeed, you had better do so if you undefine PPM_SUPPORTED.
  49. */
  50. typedef enum {
  51. FMT_BMP, /* BMP format (Windows flavor) */
  52. FMT_GIF, /* GIF format */
  53. FMT_OS2, /* BMP format (OS/2 flavor) */
  54. FMT_PPM, /* PPM/PGM (PBMPLUS formats) */
  55. FMT_RLE, /* RLE format */
  56. FMT_TARGA, /* Targa format */
  57. FMT_TIFF /* TIFF format */
  58. } IMAGE_FORMATS;
  59. #ifndef DEFAULT_FMT /* so can override from CFLAGS in Makefile */
  60. #define DEFAULT_FMT FMT_PPM
  61. #endif
  62. static IMAGE_FORMATS requested_fmt;
  63. /*
  64. * Argument-parsing code.
  65. * The switch parser is designed to be useful with DOS-style command line
  66. * syntax, ie, intermixed switches and file names, where only the switches
  67. * to the left of a given file name affect processing of that file.
  68. * The main program in this file doesn't actually use this capability...
  69. */
  70. static const char * progname; /* program name for error messages */
  71. static char * outfilename; /* for -outfile switch */
  72. LOCAL(void)
  73. usage (void)
  74. /* complain about bad command line */
  75. {
  76. fprintf(stderr, "usage: %s [switches] ", progname);
  77. #ifdef TWO_FILE_COMMANDLINE
  78. fprintf(stderr, "inputfile outputfile\n");
  79. #else
  80. fprintf(stderr, "[inputfile]\n");
  81. #endif
  82. fprintf(stderr, "Switches (names may be abbreviated):\n");
  83. fprintf(stderr, " -colors N Reduce image to no more than N colors\n");
  84. fprintf(stderr, " -fast Fast, low-quality processing\n");
  85. fprintf(stderr, " -grayscale Force grayscale output\n");
  86. #ifdef IDCT_SCALING_SUPPORTED
  87. fprintf(stderr, " -scale M/N Scale output image by fraction M/N, eg, 1/8\n");
  88. #endif
  89. #ifdef BMP_SUPPORTED
  90. fprintf(stderr, " -bmp Select BMP output format (Windows style)%s\n",
  91. (DEFAULT_FMT == FMT_BMP ? " (default)" : ""));
  92. #endif
  93. #ifdef GIF_SUPPORTED
  94. fprintf(stderr, " -gif Select GIF output format%s\n",
  95. (DEFAULT_FMT == FMT_GIF ? " (default)" : ""));
  96. #endif
  97. #ifdef BMP_SUPPORTED
  98. fprintf(stderr, " -os2 Select BMP output format (OS/2 style)%s\n",
  99. (DEFAULT_FMT == FMT_OS2 ? " (default)" : ""));
  100. #endif
  101. #ifdef PPM_SUPPORTED
  102. fprintf(stderr, " -pnm Select PBMPLUS (PPM/PGM) output format%s\n",
  103. (DEFAULT_FMT == FMT_PPM ? " (default)" : ""));
  104. #endif
  105. #ifdef RLE_SUPPORTED
  106. fprintf(stderr, " -rle Select Utah RLE output format%s\n",
  107. (DEFAULT_FMT == FMT_RLE ? " (default)" : ""));
  108. #endif
  109. #ifdef TARGA_SUPPORTED
  110. fprintf(stderr, " -targa Select Targa output format%s\n",
  111. (DEFAULT_FMT == FMT_TARGA ? " (default)" : ""));
  112. #endif
  113. fprintf(stderr, "Switches for advanced users:\n");
  114. #ifdef DCT_ISLOW_SUPPORTED
  115. fprintf(stderr, " -dct int Use integer DCT method%s\n",
  116. (JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : ""));
  117. #endif
  118. #ifdef DCT_IFAST_SUPPORTED
  119. fprintf(stderr, " -dct fast Use fast integer DCT (less accurate)%s\n",
  120. (JDCT_DEFAULT == JDCT_IFAST ? " (default)" : ""));
  121. #endif
  122. #ifdef DCT_FLOAT_SUPPORTED
  123. fprintf(stderr, " -dct float Use floating-point DCT method%s\n",
  124. (JDCT_DEFAULT == JDCT_FLOAT ? " (default)" : ""));
  125. #endif
  126. fprintf(stderr, " -dither fs Use F-S dithering (default)\n");
  127. fprintf(stderr, " -dither none Don't use dithering in quantization\n");
  128. fprintf(stderr, " -dither ordered Use ordered dither (medium speed, quality)\n");
  129. #ifdef QUANT_2PASS_SUPPORTED
  130. fprintf(stderr, " -map FILE Map to colors used in named image file\n");
  131. #endif
  132. fprintf(stderr, " -nosmooth Don't use high-quality upsampling\n");
  133. #ifdef QUANT_1PASS_SUPPORTED
  134. fprintf(stderr, " -onepass Use 1-pass quantization (fast, low quality)\n");
  135. #endif
  136. fprintf(stderr, " -maxmemory N Maximum memory to use (in kbytes)\n");
  137. fprintf(stderr, " -outfile name Specify name for output file\n");
  138. fprintf(stderr, " -verbose or -debug Emit debug output\n");
  139. exit(EXIT_FAILURE);
  140. }
  141. LOCAL(int)
  142. parse_switches (j_decompress_ptr cinfo, int argc, char **argv,
  143. int last_file_arg_seen, boolean for_real)
  144. /* Parse optional switches.
  145. * Returns argv[] index of first file-name argument (== argc if none).
  146. * Any file names with indexes <= last_file_arg_seen are ignored;
  147. * they have presumably been processed in a previous iteration.
  148. * (Pass 0 for last_file_arg_seen on the first or only iteration.)
  149. * for_real is FALSE on the first (dummy) pass; we may skip any expensive
  150. * processing.
  151. */
  152. {
  153. int argn;
  154. char * arg;
  155. /* Set up default JPEG parameters. */
  156. requested_fmt = DEFAULT_FMT; /* set default output file format */
  157. outfilename = NULL;
  158. cinfo->err->trace_level = 0;
  159. /* Scan command line options, adjust parameters */
  160. for (argn = 1; argn < argc; argn++) {
  161. arg = argv[argn];
  162. if (*arg != '-') {
  163. /* Not a switch, must be a file name argument */
  164. if (argn <= last_file_arg_seen) {
  165. outfilename = NULL; /* -outfile applies to just one input file */
  166. continue; /* ignore this name if previously processed */
  167. }
  168. break; /* else done parsing switches */
  169. }
  170. arg++; /* advance past switch marker character */
  171. if (keymatch(arg, "bmp", 1)) {
  172. /* BMP output format. */
  173. requested_fmt = FMT_BMP;
  174. } else if (keymatch(arg, "colors", 1) || keymatch(arg, "colours", 1) ||
  175. keymatch(arg, "quantize", 1) || keymatch(arg, "quantise", 1)) {
  176. /* Do color quantization. */
  177. int val;
  178. if (++argn >= argc) /* advance to next argument */
  179. usage();
  180. if (sscanf(argv[argn], "%d", &val) != 1)
  181. usage();
  182. cinfo->desired_number_of_colors = val;
  183. cinfo->quantize_colors = TRUE;
  184. } else if (keymatch(arg, "dct", 2)) {
  185. /* Select IDCT algorithm. */
  186. if (++argn >= argc) /* advance to next argument */
  187. usage();
  188. if (keymatch(argv[argn], "int", 1)) {
  189. cinfo->dct_method = JDCT_ISLOW;
  190. } else if (keymatch(argv[argn], "fast", 2)) {
  191. cinfo->dct_method = JDCT_IFAST;
  192. } else if (keymatch(argv[argn], "float", 2)) {
  193. cinfo->dct_method = JDCT_FLOAT;
  194. } else
  195. usage();
  196. } else if (keymatch(arg, "dither", 2)) {
  197. /* Select dithering algorithm. */
  198. if (++argn >= argc) /* advance to next argument */
  199. usage();
  200. if (keymatch(argv[argn], "fs", 2)) {
  201. cinfo->dither_mode = JDITHER_FS;
  202. } else if (keymatch(argv[argn], "none", 2)) {
  203. cinfo->dither_mode = JDITHER_NONE;
  204. } else if (keymatch(argv[argn], "ordered", 2)) {
  205. cinfo->dither_mode = JDITHER_ORDERED;
  206. } else
  207. usage();
  208. } else if (keymatch(arg, "debug", 1) || keymatch(arg, "verbose", 1)) {
  209. /* Enable debug printouts. */
  210. /* On first -d, print version identification */
  211. static boolean printed_version = FALSE;
  212. if (! printed_version) {
  213. fprintf(stderr, "Independent JPEG Group's DJPEG, version %s\n%s\n",
  214. JVERSION, JCOPYRIGHT);
  215. printed_version = TRUE;
  216. }
  217. cinfo->err->trace_level++;
  218. } else if (keymatch(arg, "fast", 1)) {
  219. /* Select recommended processing options for quick-and-dirty output. */
  220. cinfo->two_pass_quantize = FALSE;
  221. cinfo->dither_mode = JDITHER_ORDERED;
  222. if (! cinfo->quantize_colors) /* don't override an earlier -colors */
  223. cinfo->desired_number_of_colors = 216;
  224. cinfo->dct_method = JDCT_FASTEST;
  225. cinfo->do_fancy_upsampling = FALSE;
  226. } else if (keymatch(arg, "gif", 1)) {
  227. /* GIF output format. */
  228. requested_fmt = FMT_GIF;
  229. } else if (keymatch(arg, "grayscale", 2) || keymatch(arg, "greyscale",2)) {
  230. /* Force monochrome output. */
  231. cinfo->out_color_space = JCS_GRAYSCALE;
  232. } else if (keymatch(arg, "map", 3)) {
  233. /* Quantize to a color map taken from an input file. */
  234. if (++argn >= argc) /* advance to next argument */
  235. usage();
  236. if (for_real) { /* too expensive to do twice! */
  237. #ifdef QUANT_2PASS_SUPPORTED /* otherwise can't quantize to supplied map */
  238. FILE * mapfile;
  239. if ((mapfile = fopen(argv[argn], READ_BINARY)) == NULL) {
  240. fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
  241. exit(EXIT_FAILURE);
  242. }
  243. read_color_map(cinfo, mapfile);
  244. fclose(mapfile);
  245. cinfo->quantize_colors = TRUE;
  246. #else
  247. ERREXIT(cinfo, JERR_NOT_COMPILED);
  248. #endif
  249. }
  250. } else if (keymatch(arg, "maxmemory", 3)) {
  251. /* Maximum memory in Kb (or Mb with 'm'). */
  252. long lval;
  253. char ch = 'x';
  254. if (++argn >= argc) /* advance to next argument */
  255. usage();
  256. if (sscanf(argv[argn], "%ld%c", &lval, &ch) < 1)
  257. usage();
  258. if (ch == 'm' || ch == 'M')
  259. lval *= 1000L;
  260. cinfo->mem->max_memory_to_use = lval * 1000L;
  261. } else if (keymatch(arg, "nosmooth", 3)) {
  262. /* Suppress fancy upsampling */
  263. cinfo->do_fancy_upsampling = FALSE;
  264. } else if (keymatch(arg, "onepass", 3)) {
  265. /* Use fast one-pass quantization. */
  266. cinfo->two_pass_quantize = FALSE;
  267. } else if (keymatch(arg, "os2", 3)) {
  268. /* BMP output format (OS/2 flavor). */
  269. requested_fmt = FMT_OS2;
  270. } else if (keymatch(arg, "outfile", 4)) {
  271. /* Set output file name. */
  272. if (++argn >= argc) /* advance to next argument */
  273. usage();
  274. outfilename = argv[argn]; /* save it away for later use */
  275. } else if (keymatch(arg, "pnm", 1) || keymatch(arg, "ppm", 1)) {
  276. /* PPM/PGM output format. */
  277. requested_fmt = FMT_PPM;
  278. } else if (keymatch(arg, "rle", 1)) {
  279. /* RLE output format. */
  280. requested_fmt = FMT_RLE;
  281. } else if (keymatch(arg, "scale", 1)) {
  282. /* Scale the output image by a fraction M/N. */
  283. if (++argn >= argc) /* advance to next argument */
  284. usage();
  285. if (sscanf(argv[argn], "%d/%d",
  286. &cinfo->scale_num, &cinfo->scale_denom) < 1)
  287. usage();
  288. } else if (keymatch(arg, "targa", 1)) {
  289. /* Targa output format. */
  290. requested_fmt = FMT_TARGA;
  291. } else {
  292. usage(); /* bogus switch */
  293. }
  294. }
  295. return argn; /* return index of next arg (file name) */
  296. }
  297. /*
  298. * Marker processor for COM and interesting APPn markers.
  299. * This replaces the library's built-in processor, which just skips the marker.
  300. * We want to print out the marker as text, to the extent possible.
  301. * Note this code relies on a non-suspending data source.
  302. */
  303. LOCAL(unsigned int)
  304. jpeg_getc (j_decompress_ptr cinfo)
  305. /* Read next byte */
  306. {
  307. struct jpeg_source_mgr * datasrc = cinfo->src;
  308. if (datasrc->bytes_in_buffer == 0) {
  309. if (! (*datasrc->fill_input_buffer) (cinfo))
  310. ERREXIT(cinfo, JERR_CANT_SUSPEND);
  311. }
  312. datasrc->bytes_in_buffer--;
  313. return GETJOCTET(*datasrc->next_input_byte++);
  314. }
  315. METHODDEF(boolean)
  316. print_text_marker (j_decompress_ptr cinfo)
  317. {
  318. boolean traceit = (cinfo->err->trace_level >= 1);
  319. INT32 length;
  320. unsigned int ch;
  321. unsigned int lastch = 0;
  322. length = jpeg_getc(cinfo) << 8;
  323. length += jpeg_getc(cinfo);
  324. length -= 2; /* discount the length word itself */
  325. if (traceit) {
  326. if (cinfo->unread_marker == JPEG_COM)
  327. fprintf(stderr, "Comment, length %ld:\n", (long) length);
  328. else /* assume it is an APPn otherwise */
  329. fprintf(stderr, "APP%d, length %ld:\n",
  330. cinfo->unread_marker - JPEG_APP0, (long) length);
  331. }
  332. while (--length >= 0) {
  333. ch = jpeg_getc(cinfo);
  334. if (traceit) {
  335. /* Emit the character in a readable form.
  336. * Nonprintables are converted to \nnn form,
  337. * while \ is converted to \\.
  338. * Newlines in CR, CR/LF, or LF form will be printed as one newline.
  339. */
  340. if (ch == '\r') {
  341. fprintf(stderr, "\n");
  342. } else if (ch == '\n') {
  343. if (lastch != '\r')
  344. fprintf(stderr, "\n");
  345. } else if (ch == '\\') {
  346. fprintf(stderr, "\\\\");
  347. } else if (isprint(ch)) {
  348. putc(ch, stderr);
  349. } else {
  350. fprintf(stderr, "\\%03o", ch);
  351. }
  352. lastch = ch;
  353. }
  354. }
  355. if (traceit)
  356. fprintf(stderr, "\n");
  357. return TRUE;
  358. }
  359. /*
  360. * The main program.
  361. */
  362. int
  363. main (int argc, char **argv)
  364. {
  365. struct jpeg_decompress_struct cinfo;
  366. struct jpeg_error_mgr jerr;
  367. #ifdef PROGRESS_REPORT
  368. struct cdjpeg_progress_mgr progress;
  369. #endif
  370. int file_index;
  371. djpeg_dest_ptr dest_mgr = NULL;
  372. FILE * input_file;
  373. FILE * output_file;
  374. JDIMENSION num_scanlines;
  375. /* On Mac, fetch a command line. */
  376. #ifdef USE_CCOMMAND
  377. argc = ccommand(&argv);
  378. #endif
  379. progname = argv[0];
  380. if (progname == NULL || progname[0] == 0)
  381. progname = "djpeg"; /* in case C library doesn't provide it */
  382. /* Initialize the JPEG decompression object with default error handling. */
  383. cinfo.err = jpeg_std_error(&jerr);
  384. jpeg_create_decompress(&cinfo);
  385. /* Add some application-specific error messages (from cderror.h) */
  386. jerr.addon_message_table = cdjpeg_message_table;
  387. jerr.first_addon_message = JMSG_FIRSTADDONCODE;
  388. jerr.last_addon_message = JMSG_LASTADDONCODE;
  389. /* Insert custom marker processor for COM and APP12.
  390. * APP12 is used by some digital camera makers for textual info,
  391. * so we provide the ability to display it as text.
  392. * If you like, additional APPn marker types can be selected for display,
  393. * but don't try to override APP0 or APP14 this way (see libjpeg.doc).
  394. */
  395. jpeg_set_marker_processor(&cinfo, JPEG_COM, print_text_marker);
  396. jpeg_set_marker_processor(&cinfo, JPEG_APP0+12, print_text_marker);
  397. /* Now safe to enable signal catcher. */
  398. #ifdef NEED_SIGNAL_CATCHER
  399. enable_signal_catcher((j_common_ptr) &cinfo);
  400. #endif
  401. /* Scan command line to find file names. */
  402. /* It is convenient to use just one switch-parsing routine, but the switch
  403. * values read here are ignored; we will rescan the switches after opening
  404. * the input file.
  405. * (Exception: tracing level set here controls verbosity for COM markers
  406. * found during jpeg_read_header...)
  407. */
  408. file_index = parse_switches(&cinfo, argc, argv, 0, FALSE);
  409. #ifdef TWO_FILE_COMMANDLINE
  410. /* Must have either -outfile switch or explicit output file name */
  411. if (outfilename == NULL) {
  412. if (file_index != argc-2) {
  413. fprintf(stderr, "%s: must name one input and one output file\n",
  414. progname);
  415. usage();
  416. }
  417. outfilename = argv[file_index+1];
  418. } else {
  419. if (file_index != argc-1) {
  420. fprintf(stderr, "%s: must name one input and one output file\n",
  421. progname);
  422. usage();
  423. }
  424. }
  425. #else
  426. /* Unix style: expect zero or one file name */
  427. if (file_index < argc-1) {
  428. fprintf(stderr, "%s: only one input file\n", progname);
  429. usage();
  430. }
  431. #endif /* TWO_FILE_COMMANDLINE */
  432. /* Open the input file. */
  433. if (file_index < argc) {
  434. if ((input_file = fopen(argv[file_index], READ_BINARY)) == NULL) {
  435. fprintf(stderr, "%s: can't open %s\n", progname, argv[file_index]);
  436. exit(EXIT_FAILURE);
  437. }
  438. } else {
  439. /* default input file is stdin */
  440. input_file = read_stdin();
  441. }
  442. /* Open the output file. */
  443. if (outfilename != NULL) {
  444. if ((output_file = fopen(outfilename, WRITE_BINARY)) == NULL) {
  445. fprintf(stderr, "%s: can't open %s\n", progname, outfilename);
  446. exit(EXIT_FAILURE);
  447. }
  448. } else {
  449. /* default output file is stdout */
  450. output_file = write_stdout();
  451. }
  452. #ifdef PROGRESS_REPORT
  453. start_progress_monitor((j_common_ptr) &cinfo, &progress);
  454. #endif
  455. /* Specify data source for decompression */
  456. jpeg_stdio_src(&cinfo, input_file);
  457. /* Read file header, set default decompression parameters */
  458. (void) jpeg_read_header(&cinfo, TRUE);
  459. /* Adjust default decompression parameters by re-parsing the options */
  460. file_index = parse_switches(&cinfo, argc, argv, 0, TRUE);
  461. /* Initialize the output module now to let it override any crucial
  462. * option settings (for instance, GIF wants to force color quantization).
  463. */
  464. switch (requested_fmt) {
  465. #ifdef BMP_SUPPORTED
  466. case FMT_BMP:
  467. dest_mgr = jinit_write_bmp(&cinfo, FALSE);
  468. break;
  469. case FMT_OS2:
  470. dest_mgr = jinit_write_bmp(&cinfo, TRUE);
  471. break;
  472. #endif
  473. #ifdef GIF_SUPPORTED
  474. case FMT_GIF:
  475. dest_mgr = jinit_write_gif(&cinfo);
  476. break;
  477. #endif
  478. #ifdef PPM_SUPPORTED
  479. case FMT_PPM:
  480. dest_mgr = jinit_write_ppm(&cinfo);
  481. break;
  482. #endif
  483. #ifdef RLE_SUPPORTED
  484. case FMT_RLE:
  485. dest_mgr = jinit_write_rle(&cinfo);
  486. break;
  487. #endif
  488. #ifdef TARGA_SUPPORTED
  489. case FMT_TARGA:
  490. dest_mgr = jinit_write_targa(&cinfo);
  491. break;
  492. #endif
  493. default:
  494. ERREXIT(&cinfo, JERR_UNSUPPORTED_FORMAT);
  495. break;
  496. }
  497. dest_mgr->output_file = output_file;
  498. /* Start decompressor */
  499. (void) jpeg_start_decompress(&cinfo);
  500. /* Write output file header */
  501. (*dest_mgr->start_output) (&cinfo, dest_mgr);
  502. /* Process data */
  503. while (cinfo.output_scanline < cinfo.output_height) {
  504. num_scanlines = jpeg_read_scanlines(&cinfo, dest_mgr->buffer,
  505. dest_mgr->buffer_height);
  506. (*dest_mgr->put_pixel_rows) (&cinfo, dest_mgr, num_scanlines);
  507. }
  508. #ifdef PROGRESS_REPORT
  509. /* Hack: count final pass as done in case finish_output does an extra pass.
  510. * The library won't have updated completed_passes.
  511. */
  512. progress.pub.completed_passes = progress.pub.total_passes;
  513. #endif
  514. /* Finish decompression and release memory.
  515. * I must do it in this order because output module has allocated memory
  516. * of lifespan JPOOL_IMAGE; it needs to finish before releasing memory.
  517. */
  518. (*dest_mgr->finish_output) (&cinfo, dest_mgr);
  519. (void) jpeg_finish_decompress(&cinfo);
  520. jpeg_destroy_decompress(&cinfo);
  521. /* Close files, if we opened them */
  522. if (input_file != stdin)
  523. fclose(input_file);
  524. if (output_file != stdout)
  525. fclose(output_file);
  526. #ifdef PROGRESS_REPORT
  527. end_progress_monitor((j_common_ptr) &cinfo);
  528. #endif
  529. /* All done. */
  530. exit(jerr.num_warnings ? EXIT_WARNING : EXIT_SUCCESS);
  531. return 0; /* suppress no-return-value warnings */
  532. }