15 #define JPEG_INTERNALS
21 extern void * malloc
JPP((
size_t size));
22 extern void free
JPP((
void *ptr));
29 #ifdef DONT_USE_B_MODE
30 #define READ_BINARY "r"
31 #define RW_BINARY "w+"
33 #define READ_BINARY "rb"
34 #define RW_BINARY "w+b"
64 #ifndef TEMP_DIRECTORY
65 #define TEMP_DIRECTORY "/usr/tmp/"
68 static int next_file_num;
72 #ifndef TEMP_FILE_NAME
73 #define TEMP_FILE_NAME "%sJPG%03d.TMP"
116 #ifndef TEMP_FILE_NAME
117 #define TEMP_FILE_NAME "%sJPG%dXXXXXX"
140 return (
void *) malloc(sizeofobject);
160 return (
void FAR *) malloc(sizeofobject);
178 #ifndef DEFAULT_MAX_MEM
179 #define DEFAULT_MAX_MEM 1000000L
184 long max_bytes_needed,
long already_allocated)
186 return cinfo->mem->max_memory_to_use - already_allocated;
200 void FAR * buffer_address,
201 long file_offset,
long byte_count)
204 ERREXIT(cinfo, JERR_TFILE_SEEK);
206 != (
size_t) byte_count)
207 ERREXIT(cinfo, JERR_TFILE_READ);
213 void FAR * buffer_address,
214 long file_offset,
long byte_count)
217 ERREXIT(cinfo, JERR_TFILE_SEEK);
219 != (
size_t) byte_count)
220 ERREXIT(cinfo, JERR_TFILE_WRITE);
243 long total_bytes_needed)
char temp_name[TEMP_NAME_LENGTH]
LOCAL void select_file_name(char *fname)
GLOBAL void FAR * jpeg_get_large(j_common_ptr cinfo, size_t sizeofobject)
GLOBAL long jpeg_mem_init(j_common_ptr cinfo)
#define ERREXIT(cinfo, code)
#define JFREAD(file, buf, sizeofbuf)
#define JFWRITE(file, buf, sizeofbuf)
GLOBAL void jpeg_free_large(j_common_ptr cinfo, void FAR *object, size_t sizeofobject)
GLOBAL void jpeg_free_small(j_common_ptr cinfo, void *object, size_t sizeofobject)
GLOBAL void jpeg_open_backing_store(j_common_ptr cinfo, backing_store_ptr info, long total_bytes_needed)
#define TRACEMSS(cinfo, lvl, code, str)
METHODDEF void write_backing_store(j_common_ptr cinfo, backing_store_ptr info, void FAR *buffer_address, long file_offset, long byte_count)
METHODDEF void close_backing_store(j_common_ptr cinfo, backing_store_ptr info)
GLOBAL void jpeg_mem_term(j_common_ptr cinfo)
GLOBAL void * jpeg_get_small(j_common_ptr cinfo, size_t sizeofobject)
GLOBAL long jpeg_mem_available(j_common_ptr cinfo, long min_bytes_needed, long max_bytes_needed, long already_allocated)
int sprintf(idStr &string, const char *fmt,...)
METHODDEF void read_backing_store(j_common_ptr cinfo, backing_store_ptr info, void FAR *buffer_address, long file_offset, long byte_count)
#define ERREXITS(cinfo, code, str)