Index: cdjpeg.h |
diff --git a/cdjpeg.h b/cdjpeg.h |
index ed024ac3ae8518cf8b52d64d3855f1148bec2872..a65310e77ea0fad45d1b768d75239016cfb5b038 100644 |
--- a/cdjpeg.h |
+++ b/cdjpeg.h |
@@ -1,35 +1,35 @@ |
/* |
* cdjpeg.h |
* |
+ * This file was part of the Independent JPEG Group's software: |
* Copyright (C) 1994-1997, Thomas G. Lane. |
- * This file is part of the Independent JPEG Group's software. |
- * For conditions of distribution and use, see the accompanying README file. |
+ * It was modified by The libjpeg-turbo Project to include only code relevant |
+ * to libjpeg-turbo. |
+ * For conditions of distribution and use, see the accompanying README.ijg |
+ * file. |
* |
* This file contains common declarations for the sample applications |
* cjpeg and djpeg. It is NOT used by the core JPEG library. |
*/ |
-#define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */ |
-#define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */ |
+#define JPEG_CJPEG_DJPEG /* define proper options in jconfig.h */ |
+#define JPEG_INTERNAL_OPTIONS /* cjpeg.c,djpeg.c need to see xxx_SUPPORTED */ |
#include "jinclude.h" |
#include "jpeglib.h" |
-#include "jerror.h" /* get library error codes too */ |
-#include "cderror.h" /* get application-specific error codes */ |
+#include "jerror.h" /* get library error codes too */ |
+#include "cderror.h" /* get application-specific error codes */ |
/* |
* Object interface for cjpeg's source file decoding modules |
*/ |
-typedef struct cjpeg_source_struct * cjpeg_source_ptr; |
+typedef struct cjpeg_source_struct *cjpeg_source_ptr; |
struct cjpeg_source_struct { |
- JMETHOD(void, start_input, (j_compress_ptr cinfo, |
- cjpeg_source_ptr sinfo)); |
- JMETHOD(JDIMENSION, get_pixel_rows, (j_compress_ptr cinfo, |
- cjpeg_source_ptr sinfo)); |
- JMETHOD(void, finish_input, (j_compress_ptr cinfo, |
- cjpeg_source_ptr sinfo)); |
+ void (*start_input) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo); |
+ JDIMENSION (*get_pixel_rows) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo); |
+ void (*finish_input) (j_compress_ptr cinfo, cjpeg_source_ptr sinfo); |
FILE *input_file; |
@@ -42,24 +42,21 @@ struct cjpeg_source_struct { |
* Object interface for djpeg's output file encoding modules |
*/ |
-typedef struct djpeg_dest_struct * djpeg_dest_ptr; |
+typedef struct djpeg_dest_struct *djpeg_dest_ptr; |
struct djpeg_dest_struct { |
/* start_output is called after jpeg_start_decompress finishes. |
* The color map will be ready at this time, if one is needed. |
*/ |
- JMETHOD(void, start_output, (j_decompress_ptr cinfo, |
- djpeg_dest_ptr dinfo)); |
+ void (*start_output) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo); |
/* Emit the specified number of pixel rows from the buffer. */ |
- JMETHOD(void, put_pixel_rows, (j_decompress_ptr cinfo, |
- djpeg_dest_ptr dinfo, |
- JDIMENSION rows_supplied)); |
+ void (*put_pixel_rows) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo, |
+ JDIMENSION rows_supplied); |
/* Finish up at the end of the image. */ |
- JMETHOD(void, finish_output, (j_decompress_ptr cinfo, |
- djpeg_dest_ptr dinfo)); |
+ void (*finish_output) (j_decompress_ptr cinfo, djpeg_dest_ptr dinfo); |
/* Target file spec; filled in by djpeg.c after object is created. */ |
- FILE * output_file; |
+ FILE *output_file; |
/* Output pixel-row buffer. Created by module init or start_output. |
* Width is cinfo->output_width * cinfo->output_components; |
@@ -79,109 +76,70 @@ struct djpeg_dest_struct { |
*/ |
struct cdjpeg_progress_mgr { |
- struct jpeg_progress_mgr pub; /* fields known to JPEG library */ |
- int completed_extra_passes; /* extra passes completed */ |
- int total_extra_passes; /* total extra */ |
+ struct jpeg_progress_mgr pub; /* fields known to JPEG library */ |
+ int completed_extra_passes; /* extra passes completed */ |
+ int total_extra_passes; /* total extra */ |
/* last printed percentage stored here to avoid multiple printouts */ |
int percent_done; |
}; |
-typedef struct cdjpeg_progress_mgr * cd_progress_ptr; |
- |
- |
-/* Short forms of external names for systems with brain-damaged linkers. */ |
- |
-#ifdef NEED_SHORT_EXTERNAL_NAMES |
-#define jinit_read_bmp jIRdBMP |
-#define jinit_write_bmp jIWrBMP |
-#define jinit_read_gif jIRdGIF |
-#define jinit_write_gif jIWrGIF |
-#define jinit_read_ppm jIRdPPM |
-#define jinit_write_ppm jIWrPPM |
-#define jinit_read_rle jIRdRLE |
-#define jinit_write_rle jIWrRLE |
-#define jinit_read_targa jIRdTarga |
-#define jinit_write_targa jIWrTarga |
-#define read_quant_tables RdQTables |
-#define read_scan_script RdScnScript |
-#define set_quality_ratings SetQRates |
-#define set_quant_slots SetQSlots |
-#define set_sample_factors SetSFacts |
-#define read_color_map RdCMap |
-#define enable_signal_catcher EnSigCatcher |
-#define start_progress_monitor StProgMon |
-#define end_progress_monitor EnProgMon |
-#define read_stdin RdStdin |
-#define write_stdout WrStdout |
-#endif /* NEED_SHORT_EXTERNAL_NAMES */ |
+typedef struct cdjpeg_progress_mgr *cd_progress_ptr; |
+ |
/* Module selection routines for I/O modules. */ |
-EXTERN(cjpeg_source_ptr) jinit_read_bmp JPP((j_compress_ptr cinfo)); |
-EXTERN(djpeg_dest_ptr) jinit_write_bmp JPP((j_decompress_ptr cinfo, |
- boolean is_os2)); |
-EXTERN(cjpeg_source_ptr) jinit_read_gif JPP((j_compress_ptr cinfo)); |
-EXTERN(djpeg_dest_ptr) jinit_write_gif JPP((j_decompress_ptr cinfo)); |
-EXTERN(cjpeg_source_ptr) jinit_read_ppm JPP((j_compress_ptr cinfo)); |
-EXTERN(djpeg_dest_ptr) jinit_write_ppm JPP((j_decompress_ptr cinfo)); |
-EXTERN(cjpeg_source_ptr) jinit_read_rle JPP((j_compress_ptr cinfo)); |
-EXTERN(djpeg_dest_ptr) jinit_write_rle JPP((j_decompress_ptr cinfo)); |
-EXTERN(cjpeg_source_ptr) jinit_read_targa JPP((j_compress_ptr cinfo)); |
-EXTERN(djpeg_dest_ptr) jinit_write_targa JPP((j_decompress_ptr cinfo)); |
+EXTERN(cjpeg_source_ptr) jinit_read_bmp (j_compress_ptr cinfo); |
+EXTERN(djpeg_dest_ptr) jinit_write_bmp (j_decompress_ptr cinfo, |
+ boolean is_os2); |
+EXTERN(cjpeg_source_ptr) jinit_read_gif (j_compress_ptr cinfo); |
+EXTERN(djpeg_dest_ptr) jinit_write_gif (j_decompress_ptr cinfo); |
+EXTERN(cjpeg_source_ptr) jinit_read_ppm (j_compress_ptr cinfo); |
+EXTERN(djpeg_dest_ptr) jinit_write_ppm (j_decompress_ptr cinfo); |
+EXTERN(cjpeg_source_ptr) jinit_read_rle (j_compress_ptr cinfo); |
+EXTERN(djpeg_dest_ptr) jinit_write_rle (j_decompress_ptr cinfo); |
+EXTERN(cjpeg_source_ptr) jinit_read_targa (j_compress_ptr cinfo); |
+EXTERN(djpeg_dest_ptr) jinit_write_targa (j_decompress_ptr cinfo); |
/* cjpeg support routines (in rdswitch.c) */ |
-EXTERN(boolean) read_quant_tables JPP((j_compress_ptr cinfo, char * filename, |
- boolean force_baseline)); |
-EXTERN(boolean) read_scan_script JPP((j_compress_ptr cinfo, char * filename)); |
-EXTERN(boolean) set_quality_ratings JPP((j_compress_ptr cinfo, char *arg, |
- boolean force_baseline)); |
-EXTERN(boolean) set_quant_slots JPP((j_compress_ptr cinfo, char *arg)); |
-EXTERN(boolean) set_sample_factors JPP((j_compress_ptr cinfo, char *arg)); |
+EXTERN(boolean) read_quant_tables (j_compress_ptr cinfo, char *filename, |
+ boolean force_baseline); |
+EXTERN(boolean) read_scan_script (j_compress_ptr cinfo, char *filename); |
+EXTERN(boolean) set_quality_ratings (j_compress_ptr cinfo, char *arg, |
+ boolean force_baseline); |
+EXTERN(boolean) set_quant_slots (j_compress_ptr cinfo, char *arg); |
+EXTERN(boolean) set_sample_factors (j_compress_ptr cinfo, char *arg); |
/* djpeg support routines (in rdcolmap.c) */ |
-EXTERN(void) read_color_map JPP((j_decompress_ptr cinfo, FILE * infile)); |
+EXTERN(void) read_color_map (j_decompress_ptr cinfo, FILE *infile); |
/* common support routines (in cdjpeg.c) */ |
-EXTERN(void) enable_signal_catcher JPP((j_common_ptr cinfo)); |
-EXTERN(void) start_progress_monitor JPP((j_common_ptr cinfo, |
- cd_progress_ptr progress)); |
-EXTERN(void) end_progress_monitor JPP((j_common_ptr cinfo)); |
-EXTERN(boolean) keymatch JPP((char * arg, const char * keyword, int minchars)); |
-EXTERN(FILE *) read_stdin JPP((void)); |
-EXTERN(FILE *) write_stdout JPP((void)); |
+EXTERN(void) enable_signal_catcher (j_common_ptr cinfo); |
+EXTERN(void) start_progress_monitor (j_common_ptr cinfo, |
+ cd_progress_ptr progress); |
+EXTERN(void) end_progress_monitor (j_common_ptr cinfo); |
+EXTERN(boolean) keymatch (char *arg, const char *keyword, int minchars); |
+EXTERN(FILE *) read_stdin (void); |
+EXTERN(FILE *) write_stdout (void); |
/* miscellaneous useful macros */ |
-#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ |
-#define READ_BINARY "r" |
-#define WRITE_BINARY "w" |
+#ifdef DONT_USE_B_MODE /* define mode parameters for fopen() */ |
+#define READ_BINARY "r" |
+#define WRITE_BINARY "w" |
#else |
-#ifdef VMS /* VMS is very nonstandard */ |
-#define READ_BINARY "rb", "ctx=stm" |
-#define WRITE_BINARY "wb", "ctx=stm" |
-#else /* standard ANSI-compliant case */ |
-#define READ_BINARY "rb" |
-#define WRITE_BINARY "wb" |
-#endif |
+#define READ_BINARY "rb" |
+#define WRITE_BINARY "wb" |
#endif |
-#ifndef EXIT_FAILURE /* define exit() codes if not provided */ |
+#ifndef EXIT_FAILURE /* define exit() codes if not provided */ |
#define EXIT_FAILURE 1 |
#endif |
#ifndef EXIT_SUCCESS |
-#ifdef VMS |
-#define EXIT_SUCCESS 1 /* VMS is very nonstandard */ |
-#else |
#define EXIT_SUCCESS 0 |
#endif |
-#endif |
#ifndef EXIT_WARNING |
-#ifdef VMS |
-#define EXIT_WARNING 1 /* VMS is very nonstandard */ |
-#else |
#define EXIT_WARNING 2 |
#endif |
-#endif |