1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
115
116
117
118
119
120
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
157
158
171
172
173
174
175
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
/* ... */
#ifdef NEED_SHORT_EXTERNAL_NAMES
#define jpeg_get_small jGetSmall
#define jpeg_free_small jFreeSmall
#define jpeg_get_large jGetLarge
#define jpeg_free_large jFreeLarge
#define jpeg_mem_available jMemAvail
#define jpeg_open_backing_store jOpenBackStore
#define jpeg_mem_init jMemInit
#define jpeg_mem_term jMemTerm
/* ... */#endif
/* ... */
EXTERN(void *) jpeg_get_small JPP((j_common_ptr cinfo, size_t sizeofobject));
EXTERN(void) jpeg_free_small JPP((j_common_ptr cinfo, void * object,
size_t sizeofobject));
/* ... */
EXTERN(void FAR *) jpeg_get_large JPP((j_common_ptr cinfo,
size_t sizeofobject));
EXTERN(void) jpeg_free_large JPP((j_common_ptr cinfo, void FAR * object,
size_t sizeofobject));
/* ... */
#ifndef MAX_ALLOC_CHUNK
#define MAX_ALLOC_CHUNK 1000000000L
#endif
/* ... */
EXTERN(long) jpeg_mem_available JPP((j_common_ptr cinfo,
long min_bytes_needed,
long max_bytes_needed,
long already_allocated));
/* ... */
#define TEMP_NAME_LENGTH 64
#ifdef USE_MSDOS_MEMMGR
typedef unsigned short XMSH;
typedef unsigned short EMSH;
typedef union {
short file_handle;
XMSH xms_handle;
EMSH ems_handle;
...} handle_union;
/* ... */
#endif
#ifdef USE_MAC_MEMMGR
#include <Files.h>
#endif
typedef struct backing_store_struct * backing_store_ptr;
typedef struct backing_store_struct {
JMETHOD(void, read_backing_store, (j_common_ptr cinfo,
backing_store_ptr info,
void FAR * buffer_address,
long file_offset, long byte_count));
JMETHOD(void, write_backing_store, (j_common_ptr cinfo,
backing_store_ptr info,
void FAR * buffer_address,
long file_offset, long byte_count));
JMETHOD(void, close_backing_store, (j_common_ptr cinfo,
backing_store_ptr info));
#ifdef USE_MSDOS_MEMMGR
handle_union handle;
char temp_name[TEMP_NAME_LENGTH]; /* ... */
#else
#ifdef USE_MAC_MEMMGR
short temp_file;
FSSpec tempSpec;
char temp_name[TEMP_NAME_LENGTH]; /* ... */
#else
#ifdef USE_HEAP_MEM
#else
JFILE * temp_file;
char temp_name[TEMP_NAME_LENGTH]; /* ... */
#endif/* ... */
#endif/* ... */
#endif
...} backing_store_info;
/* ... */
EXTERN(void) jpeg_open_backing_store JPP((j_common_ptr cinfo,
backing_store_ptr info,
long total_bytes_needed));
/* ... */
EXTERN(long) jpeg_mem_init JPP((j_common_ptr cinfo));
EXTERN(void) jpeg_mem_term JPP((j_common_ptr cinfo));