home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume34 / jpeg / part16 < prev    next >
Encoding:
Text File  |  1992-12-16  |  58.2 KB  |  1,539 lines

  1. Newsgroups: comp.sources.misc
  2. From: jpeg-info@uunet.uu.net (Independent JPEG Group)
  3. Subject:  v34i070:  jpeg - JPEG image compression, Part16/18
  4. Message-ID: <1992Dec17.165119.6877@sparky.imd.sterling.com>
  5. X-Md4-Signature: 60e32a087ee2e85a9dad1b12087b1186
  6. Date: Thu, 17 Dec 1992 16:51:19 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: jpeg-info@uunet.uu.net (Independent JPEG Group)
  10. Posting-number: Volume 34, Issue 70
  11. Archive-name: jpeg/part16
  12. Environment: UNIX, VMS, MS-DOS, Mac, Amiga, Atari, Cray
  13. Supersedes: jpeg: Volume 29, Issue 1-18
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then feed it
  17. # into a shell via "sh file" or similar.  To overwrite existing files,
  18. # type "sh file -c".
  19. # Contents:  cjpeg.1 codingrules jddeflts.c jmemname.c makefile.ansi
  20. #   makefile.bcc makefile.mms makefile.unix
  21. # Wrapped by kent@sparky on Wed Dec 16 20:52:31 1992
  22. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  23. echo If this archive is complete, you will see the following message:
  24. echo '          "shar: End of archive 16 (of 18)."'
  25. if test -f 'cjpeg.1' -a "${1}" != "-c" ; then 
  26.   echo shar: Will not clobber existing file \"'cjpeg.1'\"
  27. else
  28.   echo shar: Extracting \"'cjpeg.1'\" \(7838 characters\)
  29.   sed "s/^X//" >'cjpeg.1' <<'END_OF_FILE'
  30. X.TH CJPEG 1 "4 November 1992"
  31. X.SH NAME
  32. Xcjpeg \- compress an image file to a JPEG file
  33. X.SH SYNOPSIS
  34. X.B cjpeg
  35. X[
  36. X.BI \-quality " N"
  37. X]
  38. X[
  39. X.B \-grayscale
  40. X]
  41. X[
  42. X.B \-optimize
  43. X]
  44. X[
  45. X.B \-targa
  46. X]
  47. X[
  48. X.BI \-maxmemory " N"
  49. X]
  50. X[
  51. X.BI \-restart " N"
  52. X]
  53. X[
  54. X.BI \-smooth " N"
  55. X]
  56. X[
  57. X.B \-verbose
  58. X]
  59. X[
  60. X.B \-debug
  61. X]
  62. X[
  63. X.B \-arithmetic
  64. X]
  65. X[
  66. X.B \-nointerleave
  67. X]
  68. X[
  69. X.BI \-qtables " file"
  70. X]
  71. X[
  72. X.BI \-sample " HxV[,...]"
  73. X]
  74. X[
  75. X.I filename
  76. X]
  77. X.LP
  78. X.SH DESCRIPTION
  79. X.LP
  80. X.B cjpeg
  81. Xcompresses the named image file, or the standard input if no file is
  82. Xnamed, and produces a JPEG/JFIF file on the standard output.
  83. XThe currently supported input file formats are: PPM (PBMPLUS color
  84. Xformat), PGM (PBMPLUS gray-scale format), GIF, Targa, and RLE (Utah Raster
  85. XToolkit format).  (RLE is supported only if the URT library is available.)
  86. X.SH OPTIONS
  87. XAll switch names may be abbreviated; for example,
  88. X.B \-grayscale
  89. Xmay be written
  90. X.B \-gray
  91. Xor
  92. X.BR \-gr .
  93. XMost of the "basic" switches can be abbreviated to as little as one letter.
  94. XUpper and lower case are equivalent (thus
  95. X.B \-GIF
  96. Xis the same as
  97. X.BR \-gif ).
  98. XBritish spellings are also accepted (e.g.,
  99. X.BR \-greyscale ),
  100. Xthough for brevity these are not mentioned below.
  101. X.PP
  102. XThe basic switches are:
  103. X.TP
  104. X.BI \-quality " N"
  105. XScale quantization tables to adjust image quality.  Quality is 0 (worst) to
  106. X100 (best); default is 75.  (See below for more info.)
  107. X.TP
  108. X.B \-grayscale
  109. XCreate monochrome JPEG file from color input.  Be sure to use this switch when
  110. Xcompressing a grayscale GIF file, because
  111. X.B cjpeg
  112. Xisn't bright enough to notice whether a GIF file uses only shades of gray.
  113. XBy saying
  114. X.BR \-grayscale ,
  115. Xyou'll get a smaller JPEG file that takes less time to process.
  116. X.TP
  117. X.B \-optimize
  118. XPerform optimization of entropy encoding parameters.  Without this, default
  119. Xencoding parameters are used.
  120. X.B \-optimize
  121. Xusually makes the JPEG file a little smaller, but
  122. X.B cjpeg
  123. Xruns somewhat slower and needs much more memory.  Image quality and speed of
  124. Xdecompression are unaffected by
  125. X.BR \-optimize .
  126. X.TP
  127. X.B \-targa
  128. XInput file is Targa format.  Targa files that contain an "identification"
  129. Xfield will not be automatically recognized by
  130. X.BR cjpeg ;
  131. Xfor such files you must specify
  132. X.B \-targa
  133. Xto make
  134. X.B cjpeg
  135. Xtreat the input as Targa format.
  136. X.PP
  137. XThe
  138. X.B \-quality
  139. Xswitch lets you trade off compressed file size against quality of the
  140. Xreconstructed image: the higher the quality setting, the larger the JPEG file,
  141. Xand the closer the output image will be to the original input.  Normally you
  142. Xwant to use the lowest quality setting (smallest file) that decompresses into
  143. Xsomething visually indistinguishable from the original image.  For this
  144. Xpurpose the quality setting should be between 50 and 95; the default of 75 is
  145. Xoften about right.  If you see defects at
  146. X.B \-quality
  147. X75, then go up 5 or 10 counts at a time until you are happy with the output
  148. Ximage.  (The optimal setting will vary from one image to another.)
  149. X.PP
  150. X.B \-quality
  151. X100 will generate a quantization table of all 1's, eliminating loss in the
  152. Xquantization step (but there is still information loss in subsampling, as well
  153. Xas roundoff error).  This setting is mainly of interest for experimental
  154. Xpurposes.  Quality values above about 95 are
  155. X.B not
  156. Xrecommended for normal use; the compressed file size goes up dramatically for
  157. Xhardly any gain in output image quality.
  158. X.PP
  159. XIn the other direction, quality values below 50 will produce very small files
  160. Xof low image quality.  Settings around 5 to 10 might be useful in preparing an
  161. Xindex of a large image library, for example.  Try
  162. X.B \-quality
  163. X2 (or so) for some amusing Cubist effects.  (Note: quality
  164. Xvalues below about 25 generate 2-byte quantization tables, which are
  165. Xconsidered optional in the JPEG standard.
  166. X.B cjpeg
  167. Xemits a warning message when you give such a quality value, because some
  168. Xcommercial JPEG programs may be unable to decode the resulting file.)
  169. X.PP
  170. XSwitches for advanced users:
  171. X.TP
  172. X.BI \-maxmemory " N"
  173. XSet limit for amount of memory to use in processing large images.  Value is
  174. Xin thousands of bytes, or millions of bytes if "M" is attached to the
  175. Xnumber.  For example,
  176. X.B \-max 4m
  177. Xselects 4000000 bytes.  If more space is needed, temporary files will be used.
  178. X.TP
  179. X.BI \-restart " N"
  180. XEmit a JPEG restart marker every N MCU rows, or every N MCU blocks if "B" is
  181. Xattached to the number.
  182. X.B \-restart 0
  183. X(the default) means no restart markers.
  184. X.TP
  185. X.BI \-smooth " N"
  186. XSmooth the input image to eliminate dithering noise.  N, ranging from 1 to
  187. X100, indicates the strength of smoothing.  0 (the default) means no smoothing.
  188. X.TP
  189. X.B \-verbose
  190. XEnable debug printout.  More
  191. X.BR \-v 's
  192. Xgive more output.  Also, version information is printed at startup.
  193. X.TP
  194. X.B \-debug
  195. XSame as
  196. X.BR \-verbose .
  197. X.PP
  198. XThe
  199. X.B \-restart
  200. Xoption inserts extra markers that allow a JPEG decoder to resynchronize after
  201. Xa transmission error.  Without restart markers, any damage to a compressed
  202. Xfile will usually ruin the image from the point of the error to the end of the
  203. Ximage; with restart markers, the damage is usually confined to the portion of
  204. Xthe image up to the next restart marker.  Of course, the restart markers
  205. Xoccupy extra space.  We recommend
  206. X.B \-restart 1
  207. Xfor images that will be transmitted across unreliable networks such as Usenet.
  208. X.PP
  209. XThe
  210. X.B \-smooth
  211. Xoption filters the input to eliminate fine-scale noise.  This is often useful
  212. Xwhen converting GIF files to JPEG: a moderate smoothing factor of 10 to 50
  213. Xgets rid of dithering patterns in the input file, resulting in a smaller JPEG
  214. Xfile and a better-looking image.  Too large a smoothing factor will visibly
  215. Xblur the image, however.
  216. X.PP
  217. XSwitches for wizards:
  218. X.TP
  219. X.B \-arithmetic
  220. XUse arithmetic coding rather than Huffman coding.  (Not currently
  221. Xsupported for legal reasons.)
  222. X.TP
  223. X.B \-nointerleave
  224. XGenerate noninterleaved JPEG file (not yet supported).
  225. X.TP
  226. X.BI \-qtables " file"
  227. XUse the quantization tables given in the specified file.  The file should
  228. Xcontain one to four tables (64 values each) as plain text.  Comments preceded
  229. Xby '#' may be included in the file.  The tables are implicitly numbered
  230. X0,1,etc.  If
  231. X.B \-quality
  232. XN is also specified, the values in the file are scaled according to
  233. X.BR cjpeg 's
  234. Xquality scaling curve.
  235. X.TP
  236. X.BI \-sample " HxV[,...]"
  237. XSet JPEG sampling factors.  If you specify fewer H/V pairs than there are
  238. Xcomponents, the remaining components are set to 1x1 sampling.  The default
  239. Xsetting is equivalent to \fB\-sample 2x2\fR.
  240. X.PP
  241. XThe "wizard" switches are intended for experimentation with JPEG.  If you
  242. Xdon't know what you are doing, \fBdon't use them\fR.  You can easily produce
  243. Xfiles with worse image quality and/or poorer compression than you'll get from
  244. Xthe default settings.  Furthermore, these switches should not be used when
  245. Xmaking files intended for general use, because not all JPEG implementations
  246. Xwill support unusual JPEG parameter settings.
  247. X.SH EXAMPLES
  248. X.LP
  249. XThis example compresses the PPM file foo.ppm with a quality factor of
  250. X60 and saves the output as foo.jpg:
  251. X.IP
  252. X.B cjpeg \-quality
  253. X.I 60 foo.ppm
  254. X.B >
  255. X.I foo.jpg
  256. X.SH ENVIRONMENT
  257. X.TP
  258. X.B JPEGMEM
  259. XIf this environment variable is set, its value is the default memory limit.
  260. XThe value is specified as described for the
  261. X.B \-maxmemory
  262. Xswitch.
  263. X.B JPEGMEM
  264. Xoverrides the default value specified when the program was compiled, and
  265. Xitself is overridden by an explicit
  266. X.BR \-maxmemory .
  267. X.SH SEE ALSO
  268. X.BR djpeg (1)
  269. X.br
  270. X.BR ppm (5),
  271. X.BR pgm (5)
  272. X.br
  273. XWallace, Gregory K.  "The JPEG Still Picture Compression Standard",
  274. XCommunications of the ACM, April 1991 (vol. 34, no. 4), pp. 30-44.
  275. X.SH AUTHOR
  276. XIndependent JPEG Group
  277. X.SH BUGS
  278. XArithmetic coding and interleaved output not yet supported.
  279. X.PP
  280. XNot all variants of Targa file format are supported.
  281. X.PP
  282. XThe
  283. X.B -targa
  284. Xswitch is not a bug, it's a feature.  (It would be a bug if the Targa format
  285. Xdesigners had not been clueless.)
  286. X.PP
  287. XStill not as fast as we'd like.
  288. END_OF_FILE
  289.   if test 7838 -ne `wc -c <'cjpeg.1'`; then
  290.     echo shar: \"'cjpeg.1'\" unpacked with wrong size!
  291.   fi
  292.   # end of 'cjpeg.1'
  293. fi
  294. if test -f 'codingrules' -a "${1}" != "-c" ; then 
  295.   echo shar: Will not clobber existing file \"'codingrules'\"
  296. else
  297.   echo shar: Extracting \"'codingrules'\" \(3948 characters\)
  298.   sed "s/^X//" >'codingrules' <<'END_OF_FILE'
  299. X
  300. X    JPEG SYSTEM CODING RULES        27-SEP-91
  301. X
  302. XSince numerous people will be contributing code and bug fixes, it's important
  303. Xto establish a common coding style.  The goal of using similar coding styles
  304. Xis much more important than the details of just what that style is.
  305. X
  306. XI suggest we follow the recommendations of "Recommended C Style and Coding
  307. XStandards" revision 6.1 (Cannon et al. as modified by Spencer, Keppel and
  308. XBrader).  I have placed a copy of this document in the jpeg FTP archive (see
  309. Xjpeg/doc/cstyle.ms.tbl.Z, or cstyle.txt.Z for those without nroff/tbl).
  310. X
  311. XUnless someone has a real strong objection, let's do block comments thusly:
  312. X
  313. X/*
  314. X *  Block comments in this style.
  315. X */
  316. X
  317. Xand indent statements in K&R style, e.g.,
  318. X
  319. X    if (test) {
  320. X        then-part;
  321. X    } else {
  322. X        else-part;
  323. X    }
  324. X
  325. XI suggest that multi-word names be written in the style multi_word_name
  326. Xrather than multiWordName, but I am open to argument on this.
  327. X
  328. X
  329. XI would like to use function prototypes everywhere, and rely on automatic
  330. Xsource code transformation to feed non-ANSI C compilers.  The best tool
  331. XI have so far found for this is 'ansi2knr.c', which is part of Ghostscript.
  332. Xansi2knr is not very bright, so it imposes a format requirement on function
  333. Xdeclarations: the function name MUST BEGIN IN COLUMN 1.  Thus all functions
  334. Xshould be written in the following style:
  335. X
  336. Xstatic int *
  337. Xfunction_name (int a, char *b)
  338. X{
  339. X    code...
  340. X}
  341. X
  342. Xansi2knr won't help with method declarations (function pointers in structs).
  343. XI suggest we use a macro to declare method pointers, something like this:
  344. X
  345. X#ifdef PROTO
  346. X#define METHOD(type,methodname,arglist)  type (*methodname) arglist
  347. X#else
  348. X#define METHOD(type,methodname,arglist)  type (*methodname) ()
  349. X#endif
  350. X
  351. Xwhich is used like this:
  352. X
  353. Xstruct function_pointers {
  354. X    METHOD(void, init_entropy_encoder, (functptrs fptrs, jparms *jp));
  355. X    METHOD(void, term_entropy_encoder, (void));
  356. X};
  357. X
  358. XNote the set of parentheses surrounding the parameter list.
  359. X
  360. XA similar solution is used for external function declarations (see the PP
  361. Xmacro in jpegdata.h).
  362. X
  363. XIf the code is to work on non-ANSI compilers, you cannot rely on a prototype
  364. Xdeclaration to coerce actual parameters into the right types.  Therefore, use
  365. Xexplicit casts on actual parameters whenever the actual parameter type is not
  366. Xidentical to the formal parameter.  Beware of implicit conversions to "int".
  367. X
  368. XIt seems there are some non-ANSI compilers in which the sizeof() operator
  369. Xis defined to return int, while size_t is defined as long.  Needless to say,
  370. Xthis is brain-damaged.  Always use the SIZEOF() macro in place of sizeof(),
  371. Xso that the result is guaranteed to be of type size_t.
  372. X
  373. X
  374. XWe can expect that the JPEG compressor and decompressor will be incorporated
  375. Xinto larger programs.  Therefore, the following rules are important:
  376. X
  377. X1. Avoid direct use of any file I/O, "malloc", error report printouts, etc;
  378. Xpass these through the common routines provided.
  379. X
  380. X2. Assume that the JPEG code may be invoked more than once per program run;
  381. Xtherefore, do not rely on static initialization of variables, and be careful
  382. Xto release all allocated storage at the end of processing.
  383. X
  384. X3. Minimize global namespace pollution.  Functions should be declared static
  385. Xwherever possible.  (Note that our method-based calling conventions help this
  386. Xa lot: in many modules only the method-selector function will ever need to be
  387. Xcalled directly, so only that function need be externally visible.)  All
  388. Xglobal function names should begin with "j", and should be unique in the first
  389. Xsix characters for portability reasons.
  390. XDon't use global variables at all; anything that must be used in another
  391. Xmodule should be put into parameters (there'll be some large structs passed
  392. Xaround for this purpose).
  393. X
  394. X4. Source file names should also begin with "j"; remember to keep them to
  395. Xeight characters (plus ".c" or ".h", etc) to make life easy for MS-DOSers.
  396. XDo not put code for both compression and decompression into the same source
  397. Xfile.
  398. END_OF_FILE
  399.   if test 3948 -ne `wc -c <'codingrules'`; then
  400.     echo shar: \"'codingrules'\" unpacked with wrong size!
  401.   fi
  402.   # end of 'codingrules'
  403. fi
  404. if test -f 'jddeflts.c' -a "${1}" != "-c" ; then 
  405.   echo shar: Will not clobber existing file \"'jddeflts.c'\"
  406. else
  407.   echo shar: Extracting \"'jddeflts.c'\" \(6529 characters\)
  408.   sed "s/^X//" >'jddeflts.c' <<'END_OF_FILE'
  409. X/*
  410. X * jddeflts.c
  411. X *
  412. X * Copyright (C) 1991, 1992, Thomas G. Lane.
  413. X * This file is part of the Independent JPEG Group's software.
  414. X * For conditions of distribution and use, see the accompanying README file.
  415. X *
  416. X * This file contains optional default-setting code for the JPEG decompressor.
  417. X * User interfaces do not have to use this file, but those that don't use it
  418. X * must know more about the innards of the JPEG code.
  419. X */
  420. X
  421. X#include "jinclude.h"
  422. X
  423. X
  424. X/* Default do-nothing progress monitoring routine.
  425. X * This can be overridden by a user interface that wishes to
  426. X * provide progress monitoring; just set methods->progress_monitor
  427. X * after j_d_defaults is done.  The routine will be called periodically
  428. X * during the decompression process.
  429. X *
  430. X * During any one pass, loopcounter increases from 0 up to (not including)
  431. X * looplimit; the step size is not necessarily 1.  Both the step size and
  432. X * the limit may differ between passes.  The expected total number of passes
  433. X * is in cinfo->total_passes, and the number of passes already completed is
  434. X * in cinfo->completed_passes.  Thus the fraction of work completed may be
  435. X * estimated as
  436. X *        completed_passes + (loopcounter/looplimit)
  437. X *        ------------------------------------------
  438. X *                total_passes
  439. X * ignoring the fact that the passes may not be equal amounts of work.
  440. X *
  441. X * When decompressing, the total_passes figure is an estimate that may be
  442. X * on the high side; completed_passes will jump by more than one if some
  443. X * passes are skipped.
  444. X */
  445. X
  446. XMETHODDEF void
  447. Xprogress_monitor (decompress_info_ptr cinfo, long loopcounter, long looplimit)
  448. X{
  449. X  /* do nothing */
  450. X}
  451. X
  452. X
  453. X/*
  454. X * Reload the input buffer after it's been emptied, and return the next byte.
  455. X * See the JGETC macro for calling conditions.  Note in particular that
  456. X * read_jpeg_data may NOT return EOF.  If no more data is available, it must
  457. X * exit via ERREXIT, or perhaps synthesize fake data (such as an RST marker).
  458. X * In the present implementation, we insert an EOI marker; this might not be
  459. X * appropriate for non-JFIF file formats, but it usually allows us to handle
  460. X * a truncated JFIF file.
  461. X *
  462. X * This routine can be overridden by the system-dependent user interface,
  463. X * in case the data source is not a stdio stream or some other special
  464. X * condition applies.  Note, however, that this capability only applies for
  465. X * JFIF or similar serial-access JPEG file formats.  The input file control
  466. X * module for a random-access format such as TIFF/JPEG would most likely
  467. X * override the read_jpeg_data method with its own routine.
  468. X */
  469. X
  470. XMETHODDEF int
  471. Xread_jpeg_data (decompress_info_ptr cinfo)
  472. X{
  473. X  cinfo->next_input_byte = cinfo->input_buffer + MIN_UNGET;
  474. X
  475. X  cinfo->bytes_in_buffer = (int) JFREAD(cinfo->input_file,
  476. X                    cinfo->next_input_byte,
  477. X                    JPEG_BUF_SIZE);
  478. X  
  479. X  if (cinfo->bytes_in_buffer <= 0) {
  480. X    WARNMS(cinfo->emethods, "Premature EOF in JPEG file");
  481. X    cinfo->next_input_byte[0] = (char) 0xFF;
  482. X    cinfo->next_input_byte[1] = (char) 0xD9; /* EOI marker */
  483. X    cinfo->bytes_in_buffer = 2;
  484. X  }
  485. X
  486. X  return JGETC(cinfo);
  487. X}
  488. X
  489. X
  490. X
  491. X/* Default parameter setup for decompression.
  492. X *
  493. X * User interfaces that don't choose to use this routine must do their
  494. X * own setup of all these parameters.  Alternately, you can call this
  495. X * to establish defaults and then alter parameters selectively.  This
  496. X * is the recommended approach since, if we add any new parameters,
  497. X * your code will still work (they'll be set to reasonable defaults).
  498. X *
  499. X * standard_buffering should be TRUE to cause an input buffer to be allocated
  500. X * (the normal case); if FALSE, the user interface must provide a buffer.
  501. X * This option is most useful in the case that the buffer must not be freed
  502. X * at the end of an image.  (For example, when reading a sequence of images
  503. X * from a single file, the remaining data in the buffer represents the
  504. X * start of the next image and mustn't be discarded.)  To handle this,
  505. X * allocate the input buffer yourself at startup, WITHOUT using alloc_small
  506. X * (probably a direct call to malloc() instead).  Then pass FALSE on each
  507. X * call to j_d_defaults to ensure the buffer state is not modified.
  508. X *
  509. X * If the source of the JPEG data is not a stdio stream, override the
  510. X * read_jpeg_data method with your own routine after calling j_d_defaults.
  511. X * You can still use the standard buffer if it's appropriate.
  512. X *
  513. X * CAUTION: if you want to decompress multiple images per run, it's necessary
  514. X * to call j_d_defaults before *each* call to jpeg_decompress, since subsidiary
  515. X * structures like the quantization tables are automatically freed during
  516. X * cleanup.
  517. X */
  518. X
  519. XGLOBAL void
  520. Xj_d_defaults (decompress_info_ptr cinfo, boolean standard_buffering)
  521. X/* NB: the external methods must already be set up. */
  522. X{
  523. X  short i;
  524. X
  525. X  /* Initialize pointers as needed to mark stuff unallocated. */
  526. X  /* Outer application may fill in default tables for abbreviated files... */
  527. X  cinfo->comp_info = NULL;
  528. X  for (i = 0; i < NUM_QUANT_TBLS; i++)
  529. X    cinfo->quant_tbl_ptrs[i] = NULL;
  530. X  for (i = 0; i < NUM_HUFF_TBLS; i++) {
  531. X    cinfo->dc_huff_tbl_ptrs[i] = NULL;
  532. X    cinfo->ac_huff_tbl_ptrs[i] = NULL;
  533. X  }
  534. X  cinfo->colormap = NULL;
  535. X
  536. X  /* Default to RGB output */
  537. X  /* UI can override by changing out_color_space */
  538. X  cinfo->out_color_space = CS_RGB;
  539. X  cinfo->jpeg_color_space = CS_UNKNOWN;
  540. X  /* Setting any other value in jpeg_color_space overrides heuristics in */
  541. X  /* jrdjfif.c.  That might be useful when reading non-JFIF JPEG files, */
  542. X  /* but ordinarily the UI shouldn't change it. */
  543. X  
  544. X  /* Default to no gamma correction of output */
  545. X  cinfo->output_gamma = 1.0;
  546. X  
  547. X  /* Default to no color quantization */
  548. X  cinfo->quantize_colors = FALSE;
  549. X  /* but set reasonable default parameters for quantization, */
  550. X  /* so that turning on quantize_colors is sufficient to do something useful */
  551. X  cinfo->two_pass_quantize = TRUE;
  552. X  cinfo->use_dithering = TRUE;
  553. X  cinfo->desired_number_of_colors = 256;
  554. X  
  555. X  /* Default to no smoothing */
  556. X  cinfo->do_block_smoothing = FALSE;
  557. X  cinfo->do_pixel_smoothing = FALSE;
  558. X  
  559. X  /* Allocate memory for input buffer, unless outer application provides it. */
  560. X  if (standard_buffering) {
  561. X    cinfo->input_buffer = (char *) (*cinfo->emethods->alloc_small)
  562. X                    ((size_t) (JPEG_BUF_SIZE + MIN_UNGET));
  563. X    cinfo->bytes_in_buffer = 0;    /* initialize buffer to empty */
  564. X  }
  565. X
  566. X  /* Install standard buffer-reloading method (outer code may override). */
  567. X  cinfo->methods->read_jpeg_data = read_jpeg_data;
  568. X
  569. X  /* Install default do-nothing progress monitoring method. */
  570. X  cinfo->methods->progress_monitor = progress_monitor;
  571. X}
  572. END_OF_FILE
  573.   if test 6529 -ne `wc -c <'jddeflts.c'`; then
  574.     echo shar: \"'jddeflts.c'\" unpacked with wrong size!
  575.   fi
  576.   # end of 'jddeflts.c'
  577. fi
  578. if test -f 'jmemname.c' -a "${1}" != "-c" ; then 
  579.   echo shar: Will not clobber existing file \"'jmemname.c'\"
  580. else
  581.   echo shar: Extracting \"'jmemname.c'\" \(7779 characters\)
  582.   sed "s/^X//" >'jmemname.c' <<'END_OF_FILE'
  583. X/*
  584. X * jmemname.c  (jmemsys.c)
  585. X *
  586. X * Copyright (C) 1992, Thomas G. Lane.
  587. X * This file is part of the Independent JPEG Group's software.
  588. X * For conditions of distribution and use, see the accompanying README file.
  589. X *
  590. X * This file provides a generic implementation of the system-dependent
  591. X * portion of the JPEG memory manager.  This implementation assumes that
  592. X * you must explicitly construct a name for each temp file.
  593. X * Also, the problem of determining the amount of memory available
  594. X * is shoved onto the user.
  595. X */
  596. X
  597. X#include "jinclude.h"
  598. X#include "jmemsys.h"
  599. X
  600. X#ifdef INCLUDES_ARE_ANSI
  601. X#include <stdlib.h>        /* to declare malloc(), free() */
  602. X#else
  603. Xextern void * malloc PP((size_t size));
  604. Xextern void free PP((void *ptr));
  605. X#endif
  606. X
  607. X#ifndef SEEK_SET        /* pre-ANSI systems may not define this; */
  608. X#define SEEK_SET  0        /* if not, assume 0 is correct */
  609. X#endif
  610. X
  611. X#ifdef DONT_USE_B_MODE        /* define mode parameters for fopen() */
  612. X#define READ_BINARY    "r"
  613. X#define RW_BINARY    "w+"
  614. X#else
  615. X#define READ_BINARY    "rb"
  616. X#define RW_BINARY    "w+b"
  617. X#endif
  618. X
  619. X
  620. Xstatic external_methods_ptr methods; /* saved for access to error_exit */
  621. X
  622. Xstatic long total_used;        /* total memory requested so far */
  623. X
  624. X
  625. X/*
  626. X * Selection of a file name for a temporary file.
  627. X * This is system-dependent!
  628. X *
  629. X * The code as given is suitable for most Unix systems, and it is easily
  630. X * modified for most non-Unix systems.  Some notes:
  631. X *  1.  The temp file is created in the directory named by TEMP_DIRECTORY.
  632. X *      The default value is /usr/tmp, which is the conventional place for
  633. X *      creating large temp files on Unix.  On other systems you'll probably
  634. X *      want to change the file location.  You can do this by editing the
  635. X *      #define, or by defining TEMP_DIRECTORY in CFLAGS in the Makefile.
  636. X *      For example, you might say
  637. X *          CFLAGS= ... '-DTEMP_DIRECTORY="/tmp/"'
  638. X *      Note that double quotes are needed in the text of the macro.
  639. X *      With most make systems you have to put single quotes around the
  640. X *      -D construct to preserve the double quotes.
  641. X *    (Amiga SAS C has trouble with ":" and such in command-line options,
  642. X *    so we've put in a special case for the preferred Amiga temp directory.)
  643. X *
  644. X *  2.  If you need to change the file name as well as its location,
  645. X *      you can override the TEMP_FILE_NAME macro.  (Note that this is
  646. X *      actually a printf format string; it must contain %s and %d.)
  647. X *      Few people should need to do this.
  648. X *
  649. X *  3.  mktemp() is used to ensure that multiple processes running
  650. X *      simultaneously won't select the same file names.  If your system
  651. X *      doesn't have mktemp(), define NO_MKTEMP to do it the hard way.
  652. X *
  653. X *  4.  You probably want to define NEED_SIGNAL_CATCHER so that jcmain/jdmain
  654. X *      will cause the temp files to be removed if you stop the program early.
  655. X */
  656. X
  657. X#ifndef TEMP_DIRECTORY        /* so can override from Makefile */
  658. X#ifdef AMIGA
  659. X#define TEMP_DIRECTORY  "JPEGTMP:"  /* recommended setting for Amiga */
  660. X#else
  661. X#define TEMP_DIRECTORY  "/usr/tmp/" /* recommended setting for Unix */
  662. X#endif
  663. X#endif
  664. X
  665. Xstatic int next_file_num;    /* to distinguish among several temp files */
  666. X
  667. X#ifdef NO_MKTEMP
  668. X
  669. X#ifndef TEMP_FILE_NAME        /* so can override from Makefile */
  670. X#define TEMP_FILE_NAME  "%sJPG%03d.TMP"
  671. X#endif
  672. X
  673. XLOCAL void
  674. Xselect_file_name (char * fname)
  675. X{
  676. X  FILE * tfile;
  677. X
  678. X  /* Keep generating file names till we find one that's not in use */
  679. X  for (;;) {
  680. X    next_file_num++;        /* advance counter */
  681. X    sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num);
  682. X    if ((tfile = fopen(fname, READ_BINARY)) == NULL)
  683. X      break;
  684. X    fclose(tfile);        /* oops, it's there; close tfile & try again */
  685. X  }
  686. X}
  687. X
  688. X#else /* ! NO_MKTEMP */
  689. X
  690. X/* Note that mktemp() requires the initial filename to end in six X's */
  691. X#ifndef TEMP_FILE_NAME        /* so can override from Makefile */
  692. X#define TEMP_FILE_NAME  "%sJPG%dXXXXXX"
  693. X#endif
  694. X
  695. XLOCAL void
  696. Xselect_file_name (char * fname)
  697. X{
  698. X  next_file_num++;        /* advance counter */
  699. X  sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num);
  700. X  mktemp(fname);        /* make sure file name is unique */
  701. X  /* mktemp replaces the trailing XXXXXX with a unique string of characters */
  702. X}
  703. X
  704. X#endif /* NO_MKTEMP */
  705. X
  706. X
  707. X/*
  708. X * Memory allocation and freeing are controlled by the regular library
  709. X * routines malloc() and free().
  710. X */
  711. X
  712. XGLOBAL void *
  713. Xjget_small (size_t sizeofobject)
  714. X{
  715. X  total_used += sizeofobject;
  716. X  return (void *) malloc(sizeofobject);
  717. X}
  718. X
  719. XGLOBAL void
  720. Xjfree_small (void * object)
  721. X{
  722. X  free(object);
  723. X}
  724. X
  725. X/*
  726. X * We assume NEED_FAR_POINTERS is not defined and so the separate entry points
  727. X * jget_large, jfree_large are not needed.
  728. X */
  729. X
  730. X
  731. X/*
  732. X * This routine computes the total memory space available for allocation.
  733. X * It's impossible to do this in a portable way; our current solution is
  734. X * to make the user tell us (with a default value set at compile time).
  735. X * If you can actually get the available space, it's a good idea to subtract
  736. X * a slop factor of 5% or so.
  737. X */
  738. X
  739. X#ifndef DEFAULT_MAX_MEM        /* so can override from makefile */
  740. X#define DEFAULT_MAX_MEM        1000000L /* default: one megabyte */
  741. X#endif
  742. X
  743. XGLOBAL long
  744. Xjmem_available (long min_bytes_needed, long max_bytes_needed)
  745. X{
  746. X  return methods->max_memory_to_use - total_used;
  747. X}
  748. X
  749. X
  750. X/*
  751. X * Backing store (temporary file) management.
  752. X * Backing store objects are only used when the value returned by
  753. X * jmem_available is less than the total space needed.  You can dispense
  754. X * with these routines if you have plenty of virtual memory; see jmemnobs.c.
  755. X */
  756. X
  757. X
  758. XMETHODDEF void
  759. Xread_backing_store (backing_store_ptr info, void FAR * buffer_address,
  760. X            long file_offset, long byte_count)
  761. X{
  762. X  if (fseek(info->temp_file, file_offset, SEEK_SET))
  763. X    ERREXIT(methods, "fseek failed on temporary file");
  764. X  if (JFREAD(info->temp_file, buffer_address, byte_count)
  765. X      != (size_t) byte_count)
  766. X    ERREXIT(methods, "fread failed on temporary file");
  767. X}
  768. X
  769. X
  770. XMETHODDEF void
  771. Xwrite_backing_store (backing_store_ptr info, void FAR * buffer_address,
  772. X             long file_offset, long byte_count)
  773. X{
  774. X  if (fseek(info->temp_file, file_offset, SEEK_SET))
  775. X    ERREXIT(methods, "fseek failed on temporary file");
  776. X  if (JFWRITE(info->temp_file, buffer_address, byte_count)
  777. X      != (size_t) byte_count)
  778. X    ERREXIT(methods, "fwrite failed on temporary file --- out of disk space?");
  779. X}
  780. X
  781. X
  782. XMETHODDEF void
  783. Xclose_backing_store (backing_store_ptr info)
  784. X{
  785. X  fclose(info->temp_file);    /* close the file */
  786. X  unlink(info->temp_name);    /* delete the file */
  787. X/* If your system doesn't have unlink(), use remove() instead.
  788. X * remove() is the ANSI-standard name for this function, but if
  789. X * your system was ANSI you'd be using jmemansi.c, right?
  790. X */
  791. X}
  792. X
  793. X
  794. XGLOBAL void
  795. Xjopen_backing_store (backing_store_ptr info, long total_bytes_needed)
  796. X{
  797. X  char tracemsg[TEMP_NAME_LENGTH+40];
  798. X
  799. X  select_file_name(info->temp_name);
  800. X  if ((info->temp_file = fopen(info->temp_name, RW_BINARY)) == NULL) {
  801. X    /* hack to get around ERREXIT's inability to handle string parameters */
  802. X    sprintf(tracemsg, "Failed to create temporary file %s", info->temp_name);
  803. X    ERREXIT(methods, tracemsg);
  804. X  }
  805. X  info->read_backing_store = read_backing_store;
  806. X  info->write_backing_store = write_backing_store;
  807. X  info->close_backing_store = close_backing_store;
  808. X  /* hack to get around TRACEMS' inability to handle string parameters */
  809. X  sprintf(tracemsg, "Using temp file %s", info->temp_name);
  810. X  TRACEMS(methods, 1, tracemsg);
  811. X}
  812. X
  813. X
  814. X/*
  815. X * These routines take care of any system-dependent initialization and
  816. X * cleanup required.  Keep in mind that jmem_term may be called more than
  817. X * once.
  818. X */
  819. X
  820. XGLOBAL void
  821. Xjmem_init (external_methods_ptr emethods)
  822. X{
  823. X  methods = emethods;        /* save struct addr for error exit access */
  824. X  emethods->max_memory_to_use = DEFAULT_MAX_MEM;
  825. X  total_used = 0;
  826. X  next_file_num = 0;
  827. X}
  828. X
  829. XGLOBAL void
  830. Xjmem_term (void)
  831. X{
  832. X  /* no work */
  833. X}
  834. END_OF_FILE
  835.   if test 7779 -ne `wc -c <'jmemname.c'`; then
  836.     echo shar: \"'jmemname.c'\" unpacked with wrong size!
  837.   fi
  838.   # end of 'jmemname.c'
  839. fi
  840. if test -f 'makefile.ansi' -a "${1}" != "-c" ; then 
  841.   echo shar: Will not clobber existing file \"'makefile.ansi'\"
  842. else
  843.   echo shar: Extracting \"'makefile.ansi'\" \(6393 characters\)
  844.   sed "s/^X//" >'makefile.ansi' <<'END_OF_FILE'
  845. X# Makefile for Independent JPEG Group's software
  846. X
  847. X# This makefile is suitable for Unix-like systems with ANSI-capable compilers.
  848. X# If you have a non-ANSI compiler, makefile.unix is a better starting point.
  849. X
  850. X# Read SETUP instructions before saying "make" !!
  851. X
  852. X# The name of your C compiler:
  853. XCC= cc
  854. X
  855. X# You may need to adjust these cc options:
  856. XCFLAGS= -O
  857. X# In particular:
  858. X#   Add -DBSD if on a pure BSD system (see jinclude.h).
  859. X#   Add -DMEM_STATS to enable gathering of memory usage statistics.
  860. X#   You may also want to add -DTWO_FILE_COMMANDLINE or -D switches for other
  861. X#   symbols listed in jconfig.h, if you prefer not to change jconfig.h.
  862. X
  863. X# Link-time cc options:
  864. XLDFLAGS= 
  865. X
  866. X# To link any special libraries, add the necessary -l commands here.
  867. X# In particular, on some versions of HP-UX (and probably other SysV-derived
  868. X# systems) there is a faster alternate malloc(3) library that you can use
  869. X# by adding "-lmalloc" to this line.
  870. XLDLIBS= 
  871. X
  872. X# miscellaneous OS-dependent stuff
  873. X# linker
  874. XLN= $(CC)
  875. X# file deletion command
  876. XRM= rm -f
  877. X# library (.a) file creation command
  878. XAR= ar rc
  879. X# second step in .a creation (use "touch" if not needed)
  880. XAR2= ranlib
  881. X
  882. X
  883. X# source files (independently compilable files)
  884. XSOURCES= jbsmooth.c jcarith.c jccolor.c jcdeflts.c jcexpand.c jchuff.c \
  885. X        jcmain.c jcmaster.c jcmcu.c jcpipe.c jcsample.c jdarith.c jdcolor.c \
  886. X        jddeflts.c jdhuff.c jdmain.c jdmaster.c jdmcu.c jdpipe.c jdsample.c \
  887. X        jerror.c jquant1.c jquant2.c jfwddct.c jrevdct.c jutils.c jmemmgr.c \
  888. X        jrdjfif.c jrdgif.c jrdppm.c jrdrle.c jrdtarga.c jwrjfif.c jwrgif.c \
  889. X        jwrppm.c jwrrle.c jwrtarga.c
  890. X# virtual source files (not present in distribution file, see SETUP)
  891. XVIRTSOURCES= jmemsys.c
  892. X# system-dependent implementations of virtual source files
  893. XSYSDEPFILES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemdos.h \
  894. X        jmemdosa.asm
  895. X# files included by source files
  896. XINCLUDES= jinclude.h jconfig.h jpegdata.h jversion.h jmemsys.h
  897. X# documentation, test, and support files
  898. XDOCS= README SETUP USAGE CHANGELOG cjpeg.1 djpeg.1 architecture codingrules
  899. XMAKEFILES= makefile.ansi makefile.unix makefile.manx makefile.sas \
  900. X        makcjpeg.st makdjpeg.st makljpeg.st makefile.mc5 makefile.mc6 \
  901. X        makefile.bcc makefile.mms makefile.vms makvms.opt
  902. XOTHERFILES= ansi2knr.c ckconfig.c example.c
  903. XTESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.jpg
  904. XDISTFILES= $(DOCS) $(MAKEFILES) $(SOURCES) $(SYSDEPFILES) $(INCLUDES) \
  905. X        $(OTHERFILES) $(TESTFILES)
  906. X# objectfiles common to cjpeg and djpeg
  907. XCOMOBJECTS= jutils.o jerror.o jmemmgr.o jmemsys.o
  908. X# compression objectfiles
  909. XCLIBOBJECTS= jcmaster.o jcdeflts.o jcarith.o jccolor.o jcexpand.o jchuff.o \
  910. X        jcmcu.o jcpipe.o jcsample.o jfwddct.o jwrjfif.o jrdgif.o jrdppm.o \
  911. X        jrdrle.o jrdtarga.o
  912. XCOBJECTS= jcmain.o $(CLIBOBJECTS) $(COMOBJECTS)
  913. X# decompression objectfiles
  914. XDLIBOBJECTS= jdmaster.o jddeflts.o jbsmooth.o jdarith.o jdcolor.o jdhuff.o \
  915. X        jdmcu.o jdpipe.o jdsample.o jquant1.o jquant2.o jrevdct.o jrdjfif.o \
  916. X        jwrgif.o jwrppm.o jwrrle.o jwrtarga.o
  917. XDOBJECTS= jdmain.o $(DLIBOBJECTS) $(COMOBJECTS)
  918. X# These objectfiles are included in libjpeg.a
  919. XLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
  920. X
  921. X
  922. Xall: cjpeg djpeg
  923. X# By default, libjpeg.a is not built unless you explicitly request it.
  924. X# You can add libjpeg.a to the line above if you want it built by default.
  925. X
  926. X
  927. Xcjpeg: $(COBJECTS)
  928. X    $(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) $(LDLIBS)
  929. X
  930. Xdjpeg: $(DOBJECTS)
  931. X    $(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) $(LDLIBS)
  932. X
  933. X# libjpeg.a is useful if you are including the JPEG software in a larger
  934. X# program; you'd include it in your link, rather than the individual modules.
  935. Xlibjpeg.a: $(LIBOBJECTS)
  936. X    $(RM) libjpeg.a
  937. X    $(AR) libjpeg.a  $(LIBOBJECTS)
  938. X    $(AR2) libjpeg.a
  939. X
  940. Xjmemsys.c:
  941. X    echo You must select a system-dependent jmemsys.c file.
  942. X    echo Please read the SETUP directions.
  943. X    exit 1
  944. X
  945. Xclean:
  946. X    $(RM) *.o cjpeg djpeg libjpeg.a core testout.*
  947. X
  948. Xdistribute:
  949. X    $(RM) jpegsrc.tar*
  950. X    tar cvf jpegsrc.tar $(DISTFILES)
  951. X    compress -v jpegsrc.tar
  952. X
  953. Xtest: cjpeg djpeg
  954. X    $(RM) testout.ppm testout.gif testout.jpg
  955. X    ./djpeg testorig.jpg >testout.ppm
  956. X    ./djpeg -gif testorig.jpg >testout.gif
  957. X    ./cjpeg testimg.ppm >testout.jpg
  958. X    cmp testimg.ppm testout.ppm
  959. X    cmp testimg.gif testout.gif
  960. X    cmp testimg.jpg testout.jpg
  961. X
  962. X
  963. Xjbsmooth.o : jbsmooth.c jinclude.h jconfig.h jpegdata.h 
  964. Xjcarith.o : jcarith.c jinclude.h jconfig.h jpegdata.h 
  965. Xjccolor.o : jccolor.c jinclude.h jconfig.h jpegdata.h 
  966. Xjcdeflts.o : jcdeflts.c jinclude.h jconfig.h jpegdata.h 
  967. Xjcexpand.o : jcexpand.c jinclude.h jconfig.h jpegdata.h 
  968. Xjchuff.o : jchuff.c jinclude.h jconfig.h jpegdata.h 
  969. Xjcmain.o : jcmain.c jinclude.h jconfig.h jpegdata.h jversion.h 
  970. Xjcmaster.o : jcmaster.c jinclude.h jconfig.h jpegdata.h 
  971. Xjcmcu.o : jcmcu.c jinclude.h jconfig.h jpegdata.h 
  972. Xjcpipe.o : jcpipe.c jinclude.h jconfig.h jpegdata.h 
  973. Xjcsample.o : jcsample.c jinclude.h jconfig.h jpegdata.h 
  974. Xjdarith.o : jdarith.c jinclude.h jconfig.h jpegdata.h 
  975. Xjdcolor.o : jdcolor.c jinclude.h jconfig.h jpegdata.h 
  976. Xjddeflts.o : jddeflts.c jinclude.h jconfig.h jpegdata.h 
  977. Xjdhuff.o : jdhuff.c jinclude.h jconfig.h jpegdata.h 
  978. Xjdmain.o : jdmain.c jinclude.h jconfig.h jpegdata.h jversion.h 
  979. Xjdmaster.o : jdmaster.c jinclude.h jconfig.h jpegdata.h 
  980. Xjdmcu.o : jdmcu.c jinclude.h jconfig.h jpegdata.h 
  981. Xjdpipe.o : jdpipe.c jinclude.h jconfig.h jpegdata.h 
  982. Xjdsample.o : jdsample.c jinclude.h jconfig.h jpegdata.h 
  983. Xjerror.o : jerror.c jinclude.h jconfig.h jpegdata.h 
  984. Xjquant1.o : jquant1.c jinclude.h jconfig.h jpegdata.h 
  985. Xjquant2.o : jquant2.c jinclude.h jconfig.h jpegdata.h 
  986. Xjfwddct.o : jfwddct.c jinclude.h jconfig.h jpegdata.h 
  987. Xjrevdct.o : jrevdct.c jinclude.h jconfig.h jpegdata.h 
  988. Xjutils.o : jutils.c jinclude.h jconfig.h jpegdata.h 
  989. Xjmemmgr.o : jmemmgr.c jinclude.h jconfig.h jpegdata.h jmemsys.h 
  990. Xjrdjfif.o : jrdjfif.c jinclude.h jconfig.h jpegdata.h 
  991. Xjrdgif.o : jrdgif.c jinclude.h jconfig.h jpegdata.h 
  992. Xjrdppm.o : jrdppm.c jinclude.h jconfig.h jpegdata.h 
  993. Xjrdrle.o : jrdrle.c jinclude.h jconfig.h jpegdata.h 
  994. Xjrdtarga.o : jrdtarga.c jinclude.h jconfig.h jpegdata.h 
  995. Xjwrjfif.o : jwrjfif.c jinclude.h jconfig.h jpegdata.h 
  996. Xjwrgif.o : jwrgif.c jinclude.h jconfig.h jpegdata.h 
  997. Xjwrppm.o : jwrppm.c jinclude.h jconfig.h jpegdata.h 
  998. Xjwrrle.o : jwrrle.c jinclude.h jconfig.h jpegdata.h 
  999. Xjwrtarga.o : jwrtarga.c jinclude.h jconfig.h jpegdata.h 
  1000. Xjmemsys.o : jmemsys.c jinclude.h jconfig.h jpegdata.h jmemsys.h 
  1001. END_OF_FILE
  1002.   if test 6393 -ne `wc -c <'makefile.ansi'`; then
  1003.     echo shar: \"'makefile.ansi'\" unpacked with wrong size!
  1004.   fi
  1005.   # end of 'makefile.ansi'
  1006. fi
  1007. if test -f 'makefile.bcc' -a "${1}" != "-c" ; then 
  1008.   echo shar: Will not clobber existing file \"'makefile.bcc'\"
  1009. else
  1010.   echo shar: Extracting \"'makefile.bcc'\" \(7375 characters\)
  1011.   sed "s/^X//" >'makefile.bcc' <<'END_OF_FILE'
  1012. X# Makefile for Independent JPEG Group's software
  1013. X
  1014. X# This makefile is suitable for Borland C (Turbo C) on MS-DOS.
  1015. X# It is set up for Borland C++, revision 3.0 or later.
  1016. X# For older versions (pre-3.0), replace "-O2" with "-O -G -Z" in CFLAGS.
  1017. X# If you have an even older version of Turbo C, you may be able to make it
  1018. X# work by saying "CC= tcc" below.  (Very early versions of Turbo C++,
  1019. X# like 1.01, are so buggy that you may as well forget it.)
  1020. X# Thanks to Tom Wright and Ge' Weijers for this file.
  1021. X
  1022. X# Read SETUP instructions before saying "make" !!
  1023. X
  1024. X# The name of your C compiler:
  1025. XCC= bcc
  1026. X
  1027. X# You may need to adjust these cc options:
  1028. XCFLAGS= -DHAVE_STDC -DINCLUDES_ARE_ANSI \
  1029. X    -ms -DMSDOS -DUSE_FMEM -DINCOMPLETE_TYPES_BROKEN -w-par -O2
  1030. X# -DHAVE_STDC -DINCLUDES_ARE_ANSI enable ANSI-C features (we DON'T want -A)
  1031. X# -ms selects small memory model for most efficient code
  1032. X# -DMSDOS enables DOS-specific code
  1033. X# -DUSE_FMEM indicates we have _fmemcpy() and _fmemset()
  1034. X# -DINCOMPLETE_TYPES_BROKEN suppresses bogus warning about undefined structures
  1035. X# -w-par suppresses warnings about unused function parameters
  1036. X# -O2 enables full code optimization (for pre-3.0 Borland C++, use -O -G -Z)
  1037. X
  1038. X# Link-time cc options:
  1039. XLDFLAGS= -ms
  1040. X# memory model option here must match CFLAGS!
  1041. X
  1042. X# need linker response file because file list > 128 chars
  1043. XRFILE= libjpeg.ans
  1044. X
  1045. X
  1046. X# source files (independently compilable files)
  1047. XSOURCES= jbsmooth.c jcarith.c jccolor.c jcdeflts.c jcexpand.c jchuff.c \
  1048. X        jcmain.c jcmaster.c jcmcu.c jcpipe.c jcsample.c jdarith.c jdcolor.c \
  1049. X        jddeflts.c jdhuff.c jdmain.c jdmaster.c jdmcu.c jdpipe.c jdsample.c \
  1050. X        jerror.c jquant1.c jquant2.c jfwddct.c jrevdct.c jutils.c jmemmgr.c \
  1051. X        jrdjfif.c jrdgif.c jrdppm.c jrdrle.c jrdtarga.c jwrjfif.c jwrgif.c \
  1052. X        jwrppm.c jwrrle.c jwrtarga.c
  1053. X# virtual source files (not present in distribution file, see SETUP)
  1054. XVIRTSOURCES= jmemsys.c
  1055. X# system-dependent implementations of virtual source files
  1056. XSYSDEPFILES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemdos.h \
  1057. X        jmemdosa.asm
  1058. X# files included by source files
  1059. XINCLUDES= jinclude.h jconfig.h jpegdata.h jversion.h jmemsys.h
  1060. X# documentation, test, and support files
  1061. XDOCS= README SETUP USAGE CHANGELOG cjpeg.1 djpeg.1 architecture codingrules
  1062. XMAKEFILES= makefile.ansi makefile.unix makefile.manx makefile.sas \
  1063. X        makcjpeg.st makdjpeg.st makljpeg.st makefile.mc5 makefile.mc6 \
  1064. X        makefile.bcc makefile.mms makefile.vms makvms.opt
  1065. XOTHERFILES= ansi2knr.c ckconfig.c example.c
  1066. XTESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.jpg
  1067. XDISTFILES= $(DOCS) $(MAKEFILES) $(SOURCES) $(SYSDEPFILES) $(INCLUDES) \
  1068. X        $(OTHERFILES) $(TESTFILES)
  1069. X# objectfiles common to cjpeg and djpeg
  1070. XCOMOBJECTS= jutils.obj jerror.obj jmemmgr.obj jmemsys.obj jmemdosa.obj
  1071. X# compression objectfiles
  1072. XCLIBOBJECTS= jcmaster.obj jcdeflts.obj jcarith.obj jccolor.obj jcexpand.obj \
  1073. X        jchuff.obj jcmcu.obj jcpipe.obj jcsample.obj jfwddct.obj \
  1074. X        jwrjfif.obj jrdgif.obj jrdppm.obj jrdrle.obj jrdtarga.obj
  1075. XCOBJECTS= jcmain.obj $(CLIBOBJECTS) $(COMOBJECTS)
  1076. X# decompression objectfiles
  1077. XDLIBOBJECTS= jdmaster.obj jddeflts.obj jbsmooth.obj jdarith.obj jdcolor.obj \
  1078. X        jdhuff.obj jdmcu.obj jdpipe.obj jdsample.obj jquant1.obj \
  1079. X        jquant2.obj jrevdct.obj jrdjfif.obj jwrgif.obj jwrppm.obj \
  1080. X        jwrrle.obj jwrtarga.obj
  1081. XDOBJECTS= jdmain.obj $(DLIBOBJECTS) $(COMOBJECTS)
  1082. X# These objectfiles are included in libjpeg.lib
  1083. XLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
  1084. X
  1085. X
  1086. Xall: cjpeg.exe djpeg.exe
  1087. X
  1088. X
  1089. X# libjpeg.lib is useful if you are including the JPEG software in a larger
  1090. X# program; you'd include it in your link, rather than the individual modules.
  1091. Xlibjpeg.lib: $(LIBOBJECTS) $(RFILE)
  1092. X    del libjpeg.lib
  1093. X    tlib @$(RFILE)
  1094. X
  1095. X# linker response file for same
  1096. X$(RFILE) : Makefile
  1097. X    del $(RFILE)
  1098. X    echo libjpeg.lib & >$(RFILE)
  1099. X    echo +jcmaster.obj +jcdeflts.obj +jcarith.obj +jccolor.obj & >>$(RFILE)
  1100. X    echo +jcexpand.obj +jchuff.obj +jcmcu.obj +jcpipe.obj & >>$(RFILE)
  1101. X    echo +jcsample.obj +jfwddct.obj +jwrjfif.obj +jrdgif.obj & >>$(RFILE)
  1102. X    echo +jrdppm.obj +jrdrle.obj +jrdtarga.obj +jdmaster.obj & >>$(RFILE)
  1103. X    echo +jddeflts.obj +jbsmooth.obj +jdarith.obj +jdcolor.obj & >>$(RFILE)
  1104. X    echo +jdhuff.obj +jdmcu.obj +jdpipe.obj +jdsample.obj & >>$(RFILE)
  1105. X    echo +jquant1.obj +jquant2.obj +jrevdct.obj +jrdjfif.obj & >>$(RFILE)
  1106. X    echo +jwrgif.obj +jwrppm.obj +jwrrle.obj +jwrtarga.obj & >>$(RFILE)
  1107. X    echo +jutils.obj +jerror.obj +jmemmgr.obj +jmemsys.obj & >>$(RFILE)
  1108. X    echo +jmemdosa.obj >>$(RFILE)
  1109. X
  1110. Xcjpeg.exe: jcmain.obj libjpeg.lib
  1111. X    $(CC) $(LDFLAGS) -ecjpeg.exe jcmain.obj libjpeg.lib
  1112. X
  1113. Xdjpeg.exe: jdmain.obj libjpeg.lib
  1114. X    $(CC) $(LDFLAGS) -edjpeg.exe jdmain.obj libjpeg.lib
  1115. X
  1116. X.c.obj:
  1117. X    $(CC) $(CFLAGS) -c $<
  1118. X
  1119. Xjmemsys.c:
  1120. X    echo You must select a system-dependent jmemsys.c file.
  1121. X    echo Please read the SETUP directions.
  1122. X    exit 1
  1123. X
  1124. Xclean:
  1125. X    del *.obj
  1126. X    del libjpeg.lib
  1127. X    del cjpeg.exe
  1128. X    del djpeg.exe
  1129. X    del testout.*
  1130. X
  1131. Xtest:
  1132. X    del testout.*
  1133. X    djpeg testorig.jpg testout.ppm
  1134. X    djpeg -gif testorig.jpg testout.gif
  1135. X    cjpeg testimg.ppm testout.jpg
  1136. X    fc testimg.ppm testout.ppm
  1137. X    fc testimg.gif testout.gif
  1138. X    fc testimg.jpg testout.jpg
  1139. X
  1140. X
  1141. Xjbsmooth.obj : jbsmooth.c jinclude.h jconfig.h jpegdata.h
  1142. Xjcarith.obj : jcarith.c jinclude.h jconfig.h jpegdata.h
  1143. Xjccolor.obj : jccolor.c jinclude.h jconfig.h jpegdata.h
  1144. Xjcdeflts.obj : jcdeflts.c jinclude.h jconfig.h jpegdata.h
  1145. Xjcexpand.obj : jcexpand.c jinclude.h jconfig.h jpegdata.h
  1146. Xjchuff.obj : jchuff.c jinclude.h jconfig.h jpegdata.h
  1147. Xjcmain.obj : jcmain.c jinclude.h jconfig.h jpegdata.h jversion.h
  1148. Xjcmaster.obj : jcmaster.c jinclude.h jconfig.h jpegdata.h
  1149. Xjcmcu.obj : jcmcu.c jinclude.h jconfig.h jpegdata.h
  1150. Xjcpipe.obj : jcpipe.c jinclude.h jconfig.h jpegdata.h
  1151. Xjcsample.obj : jcsample.c jinclude.h jconfig.h jpegdata.h
  1152. Xjdarith.obj : jdarith.c jinclude.h jconfig.h jpegdata.h
  1153. Xjdcolor.obj : jdcolor.c jinclude.h jconfig.h jpegdata.h
  1154. Xjddeflts.obj : jddeflts.c jinclude.h jconfig.h jpegdata.h
  1155. Xjdhuff.obj : jdhuff.c jinclude.h jconfig.h jpegdata.h
  1156. Xjdmain.obj : jdmain.c jinclude.h jconfig.h jpegdata.h jversion.h
  1157. Xjdmaster.obj : jdmaster.c jinclude.h jconfig.h jpegdata.h
  1158. Xjdmcu.obj : jdmcu.c jinclude.h jconfig.h jpegdata.h
  1159. Xjdpipe.obj : jdpipe.c jinclude.h jconfig.h jpegdata.h
  1160. Xjdsample.obj : jdsample.c jinclude.h jconfig.h jpegdata.h
  1161. Xjerror.obj : jerror.c jinclude.h jconfig.h jpegdata.h
  1162. Xjquant1.obj : jquant1.c jinclude.h jconfig.h jpegdata.h
  1163. Xjquant2.obj : jquant2.c jinclude.h jconfig.h jpegdata.h
  1164. Xjfwddct.obj : jfwddct.c jinclude.h jconfig.h jpegdata.h
  1165. Xjrevdct.obj : jrevdct.c jinclude.h jconfig.h jpegdata.h
  1166. Xjutils.obj : jutils.c jinclude.h jconfig.h jpegdata.h
  1167. Xjmemmgr.obj : jmemmgr.c jinclude.h jconfig.h jpegdata.h jmemsys.h
  1168. Xjrdjfif.obj : jrdjfif.c jinclude.h jconfig.h jpegdata.h
  1169. Xjrdgif.obj : jrdgif.c jinclude.h jconfig.h jpegdata.h
  1170. Xjrdppm.obj : jrdppm.c jinclude.h jconfig.h jpegdata.h
  1171. Xjrdrle.obj : jrdrle.c jinclude.h jconfig.h jpegdata.h
  1172. Xjrdtarga.obj : jrdtarga.c jinclude.h jconfig.h jpegdata.h
  1173. Xjwrjfif.obj : jwrjfif.c jinclude.h jconfig.h jpegdata.h
  1174. Xjwrgif.obj : jwrgif.c jinclude.h jconfig.h jpegdata.h
  1175. Xjwrppm.obj : jwrppm.c jinclude.h jconfig.h jpegdata.h
  1176. Xjwrrle.obj : jwrrle.c jinclude.h jconfig.h jpegdata.h
  1177. Xjwrtarga.obj : jwrtarga.c jinclude.h jconfig.h jpegdata.h
  1178. Xjmemsys.obj : jmemsys.c jinclude.h jconfig.h jpegdata.h jmemsys.h
  1179. Xjmemdosa.obj : jmemdosa.asm
  1180. X    tasm /mx jmemdosa.asm
  1181. END_OF_FILE
  1182.   if test 7375 -ne `wc -c <'makefile.bcc'`; then
  1183.     echo shar: \"'makefile.bcc'\" unpacked with wrong size!
  1184.   fi
  1185.   # end of 'makefile.bcc'
  1186. fi
  1187. if test -f 'makefile.mms' -a "${1}" != "-c" ; then 
  1188.   echo shar: Will not clobber existing file \"'makefile.mms'\"
  1189. else
  1190.   echo shar: Extracting \"'makefile.mms'\" \(6975 characters\)
  1191.   sed "s/^X//" >'makefile.mms' <<'END_OF_FILE'
  1192. X# Makefile for Independent JPEG Group's software
  1193. X
  1194. X# This makefile is for use with MMS on VAX/VMS systems.
  1195. X# Thanks to Rick Dyson (dyson@iowasp.physics.uiowa.edu)
  1196. X# and Tim Bell (tbell@netcom.com) for their help.
  1197. X
  1198. X# Read SETUP instructions before saying "MMS" !!
  1199. X
  1200. XCFLAGS= $(CFLAGS) /NoDebug /Optimize /Define = (TWO_FILE_COMMANDLINE,HAVE_STDC,INCLUDES_ARE_ANSI)
  1201. XOPT= Sys$Disk:[]MAKVMS.OPT
  1202. X
  1203. X
  1204. X# source files (independently compilable files)
  1205. XSOURCES= jbsmooth.c jcarith.c jccolor.c jcdeflts.c jcexpand.c jchuff.c \
  1206. X        jcmain.c jcmaster.c jcmcu.c jcpipe.c jcsample.c jdarith.c jdcolor.c \
  1207. X        jddeflts.c jdhuff.c jdmain.c jdmaster.c jdmcu.c jdpipe.c jdsample.c \
  1208. X        jerror.c jquant1.c jquant2.c jfwddct.c jrevdct.c jutils.c jmemmgr.c \
  1209. X        jrdjfif.c jrdgif.c jrdppm.c jrdrle.c jrdtarga.c jwrjfif.c jwrgif.c \
  1210. X        jwrppm.c jwrrle.c jwrtarga.c
  1211. X# virtual source files (not present in distribution file, see SETUP)
  1212. XVIRTSOURCES= jmemsys.c
  1213. X# system-dependent implementations of virtual source files
  1214. XSYSDEPFILES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemdos.h \
  1215. X        jmemdosa.asm
  1216. X# files included by source files
  1217. XINCLUDES= jinclude.h jconfig.h jpegdata.h jversion.h jmemsys.h
  1218. X# documentation, test, and support files
  1219. XDOCS= README SETUP USAGE CHANGELOG cjpeg.1 djpeg.1 architecture codingrules
  1220. XMAKEFILES= makefile.ansi makefile.unix makefile.manx makefile.sas \
  1221. X        makcjpeg.st makdjpeg.st makljpeg.st makefile.mc5 makefile.mc6 \
  1222. X        makefile.bcc makefile.mms makefile.vms makvms.opt
  1223. XOTHERFILES= ansi2knr.c ckconfig.c example.c
  1224. XTESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.jpg
  1225. XDISTFILES= $(DOCS) $(MAKEFILES) $(SOURCES) $(SYSDEPFILES) $(INCLUDES) \
  1226. X        $(OTHERFILES) $(TESTFILES)
  1227. X# objectfiles common to cjpeg and djpeg
  1228. XCOMOBJECTS= jutils.obj jerror.obj jmemmgr.obj jmemsys.obj
  1229. X# compression objectfiles
  1230. XCLIBOBJECTS= jcmaster.obj jcdeflts.obj jcarith.obj jccolor.obj jcexpand.obj \
  1231. X        jchuff.obj jcmcu.obj jcpipe.obj jcsample.obj jfwddct.obj \
  1232. X        jwrjfif.obj jrdgif.obj jrdppm.obj jrdrle.obj jrdtarga.obj
  1233. XCOBJECTS= jcmain.obj $(CLIBOBJECTS) $(COMOBJECTS)
  1234. X# decompression objectfiles
  1235. XDLIBOBJECTS= jdmaster.obj jddeflts.obj jbsmooth.obj jdarith.obj jdcolor.obj \
  1236. X        jdhuff.obj jdmcu.obj jdpipe.obj jdsample.obj jquant1.obj \
  1237. X        jquant2.obj jrevdct.obj jrdjfif.obj jwrgif.obj jwrppm.obj \
  1238. X        jwrrle.obj jwrtarga.obj
  1239. XDOBJECTS= jdmain.obj $(DLIBOBJECTS) $(COMOBJECTS)
  1240. X# These objectfiles are included in libjpeg.olb
  1241. XLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
  1242. X# objectfile lists with commas --- what a crock
  1243. XCOBJLIST= jcmain.obj,jcmaster.obj,jcdeflts.obj,jcarith.obj,jccolor.obj,\
  1244. X          jcexpand.obj,jchuff.obj,jcmcu.obj,jcpipe.obj,jcsample.obj,\
  1245. X          jfwddct.obj,jwrjfif.obj,jrdgif.obj,jrdppm.obj,jrdrle.obj,\
  1246. X          jrdtarga.obj,jutils.obj,jerror.obj,jmemmgr.obj,jmemsys.obj
  1247. XDOBJLIST= jdmain.obj,jdmaster.obj,jddeflts.obj,jbsmooth.obj,jdarith.obj,\
  1248. X          jdcolor.obj,jdhuff.obj,jdmcu.obj,jdpipe.obj,jdsample.obj,\
  1249. X          jquant1.obj,jquant2.obj,jrevdct.obj,jrdjfif.obj,jwrgif.obj,\
  1250. X          jwrppm.obj,jwrrle.obj,jwrtarga.obj,jutils.obj,jerror.obj,\
  1251. X          jmemmgr.obj,jmemsys.obj
  1252. XLIBOBJLIST= jcmaster.obj,jcdeflts.obj,jcarith.obj,jccolor.obj,jcexpand.obj,\
  1253. X          jchuff.obj,jcmcu.obj,jcpipe.obj,jcsample.obj,jfwddct.obj,\
  1254. X          jwrjfif.obj,jrdgif.obj,jrdppm.obj,jrdrle.obj,jrdtarga.obj,\
  1255. X          jdmaster.obj,jddeflts.obj,jbsmooth.obj,jdarith.obj,jdcolor.obj,\
  1256. X          jdhuff.obj,jdmcu.obj,jdpipe.obj,jdsample.obj,jquant1.obj,\
  1257. X          jquant2.obj,jrevdct.obj,jrdjfif.obj,jwrgif.obj,jwrppm.obj,\
  1258. X          jwrrle.obj,jwrtarga.obj,jutils.obj,jerror.obj,jmemmgr.obj,\
  1259. X          jmemsys.obj
  1260. X
  1261. X
  1262. X.first
  1263. X    @ Define Sys Sys$Library
  1264. X
  1265. X# By default, libjpeg.olb is not built unless you explicitly request it.
  1266. X# You can add libjpeg.olb to the next line if you want it built by default.
  1267. XALL : cjpeg.exe djpeg.exe
  1268. X    @ Continue
  1269. X
  1270. Xcjpeg.exe : $(COBJECTS)
  1271. X    $(LINK) $(LFLAGS) /Executable = cjpeg.exe $(COBJLIST),$(OPT)/Option
  1272. X
  1273. Xdjpeg.exe : $(DOBJECTS)
  1274. X    $(LINK) $(LFLAGS) /Executable = djpeg.exe $(DOBJLIST),$(OPT)/Option
  1275. X
  1276. X# libjpeg.olb is useful if you are including the JPEG software in a larger
  1277. X# program; you'd include it in your link, rather than the individual modules.
  1278. Xlibjpeg.olb : $(LIBOBJECTS)
  1279. X    Library /Create libjpeg.olb $(LIBOBJLIST)
  1280. X
  1281. Xclean :
  1282. X    @- Set Protection = Owner:RWED *.*;-1
  1283. X    @- Set Protection = Owner:RWED *.OBJ
  1284. X    - Purge /NoLog /NoConfirm *.*
  1285. X    - Delete /NoLog /NoConfirm *.OBJ;
  1286. X
  1287. Xtest : cjpeg.exe djpeg.exe
  1288. X    mcr sys$disk:[]djpeg      testorig.jpg testout.ppm
  1289. X    mcr sys$disk:[]djpeg -gif testorig.jpg testout.gif
  1290. X    mcr sys$disk:[]cjpeg      testimg.ppm testout.jpg
  1291. X    - Backup /Compare/Log      testimg.ppm testout.ppm
  1292. X    - Backup /Compare/Log      testimg.gif testout.gif
  1293. X    - Backup /Compare/Log      testimg.jpg testout.jpg
  1294. X
  1295. X
  1296. Xjbsmooth.obj : jbsmooth.c jinclude.h jconfig.h jpegdata.h
  1297. Xjcarith.obj : jcarith.c jinclude.h jconfig.h jpegdata.h
  1298. Xjccolor.obj : jccolor.c jinclude.h jconfig.h jpegdata.h
  1299. Xjcdeflts.obj : jcdeflts.c jinclude.h jconfig.h jpegdata.h
  1300. Xjcexpand.obj : jcexpand.c jinclude.h jconfig.h jpegdata.h
  1301. Xjchuff.obj : jchuff.c jinclude.h jconfig.h jpegdata.h
  1302. Xjcmain.obj : jcmain.c jinclude.h jconfig.h jpegdata.h jversion.h
  1303. Xjcmaster.obj : jcmaster.c jinclude.h jconfig.h jpegdata.h
  1304. Xjcmcu.obj : jcmcu.c jinclude.h jconfig.h jpegdata.h
  1305. Xjcpipe.obj : jcpipe.c jinclude.h jconfig.h jpegdata.h
  1306. Xjcsample.obj : jcsample.c jinclude.h jconfig.h jpegdata.h
  1307. Xjdarith.obj : jdarith.c jinclude.h jconfig.h jpegdata.h
  1308. Xjdcolor.obj : jdcolor.c jinclude.h jconfig.h jpegdata.h
  1309. Xjddeflts.obj : jddeflts.c jinclude.h jconfig.h jpegdata.h
  1310. Xjdhuff.obj : jdhuff.c jinclude.h jconfig.h jpegdata.h
  1311. Xjdmain.obj : jdmain.c jinclude.h jconfig.h jpegdata.h jversion.h
  1312. Xjdmaster.obj : jdmaster.c jinclude.h jconfig.h jpegdata.h
  1313. Xjdmcu.obj : jdmcu.c jinclude.h jconfig.h jpegdata.h
  1314. Xjdpipe.obj : jdpipe.c jinclude.h jconfig.h jpegdata.h
  1315. Xjdsample.obj : jdsample.c jinclude.h jconfig.h jpegdata.h
  1316. Xjerror.obj : jerror.c jinclude.h jconfig.h jpegdata.h
  1317. Xjquant1.obj : jquant1.c jinclude.h jconfig.h jpegdata.h
  1318. Xjquant2.obj : jquant2.c jinclude.h jconfig.h jpegdata.h
  1319. Xjfwddct.obj : jfwddct.c jinclude.h jconfig.h jpegdata.h
  1320. Xjrevdct.obj : jrevdct.c jinclude.h jconfig.h jpegdata.h
  1321. Xjutils.obj : jutils.c jinclude.h jconfig.h jpegdata.h
  1322. Xjmemmgr.obj : jmemmgr.c jinclude.h jconfig.h jpegdata.h jmemsys.h
  1323. Xjrdjfif.obj : jrdjfif.c jinclude.h jconfig.h jpegdata.h
  1324. Xjrdgif.obj : jrdgif.c jinclude.h jconfig.h jpegdata.h
  1325. Xjrdppm.obj : jrdppm.c jinclude.h jconfig.h jpegdata.h
  1326. Xjrdrle.obj : jrdrle.c jinclude.h jconfig.h jpegdata.h
  1327. Xjrdtarga.obj : jrdtarga.c jinclude.h jconfig.h jpegdata.h
  1328. Xjwrjfif.obj : jwrjfif.c jinclude.h jconfig.h jpegdata.h
  1329. Xjwrgif.obj : jwrgif.c jinclude.h jconfig.h jpegdata.h
  1330. Xjwrppm.obj : jwrppm.c jinclude.h jconfig.h jpegdata.h
  1331. Xjwrrle.obj : jwrrle.c jinclude.h jconfig.h jpegdata.h
  1332. Xjwrtarga.obj : jwrtarga.c jinclude.h jconfig.h jpegdata.h
  1333. Xjmemsys.obj : jmemsys.c jinclude.h jconfig.h jpegdata.h jmemsys.h
  1334. END_OF_FILE
  1335.   if test 6975 -ne `wc -c <'makefile.mms'`; then
  1336.     echo shar: \"'makefile.mms'\" unpacked with wrong size!
  1337.   fi
  1338.   # end of 'makefile.mms'
  1339. fi
  1340. if test -f 'makefile.unix' -a "${1}" != "-c" ; then 
  1341.   echo shar: Will not clobber existing file \"'makefile.unix'\"
  1342. else
  1343.   echo shar: Extracting \"'makefile.unix'\" \(6829 characters\)
  1344.   sed "s/^X//" >'makefile.unix' <<'END_OF_FILE'
  1345. X# Makefile for Independent JPEG Group's software
  1346. X
  1347. X# This makefile is suitable for Unix-like systems with non-ANSI compilers.
  1348. X# If you have an ANSI compiler, makefile.ansi is a better starting point.
  1349. X
  1350. X# Read SETUP instructions before saying "make" !!
  1351. X
  1352. X# The name of your C compiler:
  1353. XCC= cc
  1354. X
  1355. X# You may need to adjust these cc options:
  1356. XCFLAGS= -O
  1357. X# In particular:
  1358. X#   Add -DBSD if on a pure BSD system (see jinclude.h).
  1359. X#   Add -DVMS if on a VMS system (see ansi2knr.c).
  1360. X#   Add -DMSDOS if on an MSDOS system (see ansi2knr.c).
  1361. X#   Add -DMEM_STATS to enable gathering of memory usage statistics.
  1362. X#   You may also want to add -DTWO_FILE_COMMANDLINE or -D switches for other
  1363. X#   symbols listed in jconfig.h, if you prefer not to change jconfig.h.
  1364. X
  1365. X# Link-time cc options:
  1366. XLDFLAGS= 
  1367. X
  1368. X# To link any special libraries, add the necessary -l commands here.
  1369. X# In particular, on some versions of HP-UX (and probably other SysV-derived
  1370. X# systems) there is a faster alternate malloc(3) library that you can use
  1371. X# by adding "-lmalloc" to this line.
  1372. XLDLIBS= 
  1373. X
  1374. X# miscellaneous OS-dependent stuff
  1375. X# linker
  1376. XLN= $(CC)
  1377. X# file deletion command
  1378. XRM= rm -f
  1379. X# library (.a) file creation command
  1380. XAR= ar rc
  1381. X# second step in .a creation (use "touch" if not needed)
  1382. XAR2= ranlib
  1383. X
  1384. X
  1385. X# source files (independently compilable files)
  1386. XSOURCES= jbsmooth.c jcarith.c jccolor.c jcdeflts.c jcexpand.c jchuff.c \
  1387. X        jcmain.c jcmaster.c jcmcu.c jcpipe.c jcsample.c jdarith.c jdcolor.c \
  1388. X        jddeflts.c jdhuff.c jdmain.c jdmaster.c jdmcu.c jdpipe.c jdsample.c \
  1389. X        jerror.c jquant1.c jquant2.c jfwddct.c jrevdct.c jutils.c jmemmgr.c \
  1390. X        jrdjfif.c jrdgif.c jrdppm.c jrdrle.c jrdtarga.c jwrjfif.c jwrgif.c \
  1391. X        jwrppm.c jwrrle.c jwrtarga.c
  1392. X# virtual source files (not present in distribution file, see SETUP)
  1393. XVIRTSOURCES= jmemsys.c
  1394. X# system-dependent implementations of virtual source files
  1395. XSYSDEPFILES= jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemdos.h \
  1396. X        jmemdosa.asm
  1397. X# files included by source files
  1398. XINCLUDES= jinclude.h jconfig.h jpegdata.h jversion.h jmemsys.h
  1399. X# documentation, test, and support files
  1400. XDOCS= README SETUP USAGE CHANGELOG cjpeg.1 djpeg.1 architecture codingrules
  1401. XMAKEFILES= makefile.ansi makefile.unix makefile.manx makefile.sas \
  1402. X        makcjpeg.st makdjpeg.st makljpeg.st makefile.mc5 makefile.mc6 \
  1403. X        makefile.bcc makefile.mms makefile.vms makvms.opt
  1404. XOTHERFILES= ansi2knr.c ckconfig.c example.c
  1405. XTESTFILES= testorig.jpg testimg.ppm testimg.gif testimg.jpg
  1406. XDISTFILES= $(DOCS) $(MAKEFILES) $(SOURCES) $(SYSDEPFILES) $(INCLUDES) \
  1407. X        $(OTHERFILES) $(TESTFILES)
  1408. X# objectfiles common to cjpeg and djpeg
  1409. XCOMOBJECTS= jutils.o jerror.o jmemmgr.o jmemsys.o
  1410. X# compression objectfiles
  1411. XCLIBOBJECTS= jcmaster.o jcdeflts.o jcarith.o jccolor.o jcexpand.o jchuff.o \
  1412. X        jcmcu.o jcpipe.o jcsample.o jfwddct.o jwrjfif.o jrdgif.o jrdppm.o \
  1413. X        jrdrle.o jrdtarga.o
  1414. XCOBJECTS= jcmain.o $(CLIBOBJECTS) $(COMOBJECTS)
  1415. X# decompression objectfiles
  1416. XDLIBOBJECTS= jdmaster.o jddeflts.o jbsmooth.o jdarith.o jdcolor.o jdhuff.o \
  1417. X        jdmcu.o jdpipe.o jdsample.o jquant1.o jquant2.o jrevdct.o jrdjfif.o \
  1418. X        jwrgif.o jwrppm.o jwrrle.o jwrtarga.o
  1419. XDOBJECTS= jdmain.o $(DLIBOBJECTS) $(COMOBJECTS)
  1420. X# These objectfiles are included in libjpeg.a
  1421. XLIBOBJECTS= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)
  1422. X
  1423. X
  1424. Xall: ansi2knr cjpeg djpeg
  1425. X# By default, libjpeg.a is not built unless you explicitly request it.
  1426. X# You can add libjpeg.a to the line above if you want it built by default.
  1427. X
  1428. X
  1429. X# This rule causes ansi2knr to be invoked.  If you use this makefile,
  1430. X# make sure PROTO is not defined by jconfig.h.
  1431. X
  1432. X.c.o:
  1433. X    ./ansi2knr $*.c tmpansi.c
  1434. X    $(CC) $(CFLAGS) -c tmpansi.c
  1435. X    mv tmpansi.o $*.o
  1436. X    $(RM) tmpansi.c
  1437. X
  1438. Xansi2knr: ansi2knr.c
  1439. X    $(CC) $(CFLAGS) -o ansi2knr ansi2knr.c
  1440. X
  1441. X
  1442. Xcjpeg: ansi2knr $(COBJECTS)
  1443. X    $(LN) $(LDFLAGS) -o cjpeg $(COBJECTS) $(LDLIBS)
  1444. X
  1445. Xdjpeg: ansi2knr $(DOBJECTS)
  1446. X    $(LN) $(LDFLAGS) -o djpeg $(DOBJECTS) $(LDLIBS)
  1447. X
  1448. X# libjpeg.a is useful if you are including the JPEG software in a larger
  1449. X# program; you'd include it in your link, rather than the individual modules.
  1450. Xlibjpeg.a: ansi2knr $(LIBOBJECTS)
  1451. X    $(RM) libjpeg.a
  1452. X    $(AR) libjpeg.a  $(LIBOBJECTS)
  1453. X    $(AR2) libjpeg.a
  1454. X
  1455. Xjmemsys.c:
  1456. X    echo You must select a system-dependent jmemsys.c file.
  1457. X    echo Please read the SETUP directions.
  1458. X    exit 1
  1459. X
  1460. Xclean:
  1461. X    $(RM) *.o cjpeg djpeg libjpeg.a ansi2knr core tmpansi.* testout.*
  1462. X
  1463. Xdistribute:
  1464. X    $(RM) jpegsrc.tar*
  1465. X    tar cvf jpegsrc.tar $(DISTFILES)
  1466. X    compress -v jpegsrc.tar
  1467. X
  1468. Xtest: cjpeg djpeg
  1469. X    $(RM) testout.ppm testout.gif testout.jpg
  1470. X    ./djpeg testorig.jpg >testout.ppm
  1471. X    ./djpeg -gif testorig.jpg >testout.gif
  1472. X    ./cjpeg testimg.ppm >testout.jpg
  1473. X    cmp testimg.ppm testout.ppm
  1474. X    cmp testimg.gif testout.gif
  1475. X    cmp testimg.jpg testout.jpg
  1476. X
  1477. X
  1478. Xjbsmooth.o : jbsmooth.c jinclude.h jconfig.h jpegdata.h 
  1479. Xjcarith.o : jcarith.c jinclude.h jconfig.h jpegdata.h 
  1480. Xjccolor.o : jccolor.c jinclude.h jconfig.h jpegdata.h 
  1481. Xjcdeflts.o : jcdeflts.c jinclude.h jconfig.h jpegdata.h 
  1482. Xjcexpand.o : jcexpand.c jinclude.h jconfig.h jpegdata.h 
  1483. Xjchuff.o : jchuff.c jinclude.h jconfig.h jpegdata.h 
  1484. Xjcmain.o : jcmain.c jinclude.h jconfig.h jpegdata.h jversion.h 
  1485. Xjcmaster.o : jcmaster.c jinclude.h jconfig.h jpegdata.h 
  1486. Xjcmcu.o : jcmcu.c jinclude.h jconfig.h jpegdata.h 
  1487. Xjcpipe.o : jcpipe.c jinclude.h jconfig.h jpegdata.h 
  1488. Xjcsample.o : jcsample.c jinclude.h jconfig.h jpegdata.h 
  1489. Xjdarith.o : jdarith.c jinclude.h jconfig.h jpegdata.h 
  1490. Xjdcolor.o : jdcolor.c jinclude.h jconfig.h jpegdata.h 
  1491. Xjddeflts.o : jddeflts.c jinclude.h jconfig.h jpegdata.h 
  1492. Xjdhuff.o : jdhuff.c jinclude.h jconfig.h jpegdata.h 
  1493. Xjdmain.o : jdmain.c jinclude.h jconfig.h jpegdata.h jversion.h 
  1494. Xjdmaster.o : jdmaster.c jinclude.h jconfig.h jpegdata.h 
  1495. Xjdmcu.o : jdmcu.c jinclude.h jconfig.h jpegdata.h 
  1496. Xjdpipe.o : jdpipe.c jinclude.h jconfig.h jpegdata.h 
  1497. Xjdsample.o : jdsample.c jinclude.h jconfig.h jpegdata.h 
  1498. Xjerror.o : jerror.c jinclude.h jconfig.h jpegdata.h 
  1499. Xjquant1.o : jquant1.c jinclude.h jconfig.h jpegdata.h 
  1500. Xjquant2.o : jquant2.c jinclude.h jconfig.h jpegdata.h 
  1501. Xjfwddct.o : jfwddct.c jinclude.h jconfig.h jpegdata.h 
  1502. Xjrevdct.o : jrevdct.c jinclude.h jconfig.h jpegdata.h 
  1503. Xjutils.o : jutils.c jinclude.h jconfig.h jpegdata.h 
  1504. Xjmemmgr.o : jmemmgr.c jinclude.h jconfig.h jpegdata.h jmemsys.h 
  1505. Xjrdjfif.o : jrdjfif.c jinclude.h jconfig.h jpegdata.h 
  1506. Xjrdgif.o : jrdgif.c jinclude.h jconfig.h jpegdata.h 
  1507. Xjrdppm.o : jrdppm.c jinclude.h jconfig.h jpegdata.h 
  1508. Xjrdrle.o : jrdrle.c jinclude.h jconfig.h jpegdata.h 
  1509. Xjrdtarga.o : jrdtarga.c jinclude.h jconfig.h jpegdata.h 
  1510. Xjwrjfif.o : jwrjfif.c jinclude.h jconfig.h jpegdata.h 
  1511. Xjwrgif.o : jwrgif.c jinclude.h jconfig.h jpegdata.h 
  1512. Xjwrppm.o : jwrppm.c jinclude.h jconfig.h jpegdata.h 
  1513. Xjwrrle.o : jwrrle.c jinclude.h jconfig.h jpegdata.h 
  1514. Xjwrtarga.o : jwrtarga.c jinclude.h jconfig.h jpegdata.h 
  1515. Xjmemsys.o : jmemsys.c jinclude.h jconfig.h jpegdata.h jmemsys.h 
  1516. END_OF_FILE
  1517.   if test 6829 -ne `wc -c <'makefile.unix'`; then
  1518.     echo shar: \"'makefile.unix'\" unpacked with wrong size!
  1519.   fi
  1520.   # end of 'makefile.unix'
  1521. fi
  1522. echo shar: End of archive 16 \(of 18\).
  1523. cp /dev/null ark16isdone
  1524. MISSING=""
  1525. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do
  1526.     if test ! -f ark${I}isdone ; then
  1527.     MISSING="${MISSING} ${I}"
  1528.     fi
  1529. done
  1530. if test "${MISSING}" = "" ; then
  1531.     echo You have unpacked all 18 archives.
  1532.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1533. else
  1534.     echo You still must unpack the following archives:
  1535.     echo "        " ${MISSING}
  1536. fi
  1537. exit 0
  1538. exit 0 # Just in case...
  1539.