52 #define JPEG_INTERNALS 57 #ifndef USE_MAC_MEMMGR 58 You forgot to define USE_MAC_MEMMGR
in jconfig.h.
67 #ifndef TEMP_FILE_NAME 68 #define TEMP_FILE_NAME "JPG%03d.TMP" 71 static int next_file_num;
84 return (
void *) NewPtr(sizeofobject);
90 DisposePtr((Ptr)
object);
110 DisposePtr((Ptr)
object);
155 void FAR * buffer_address,
156 long file_offset,
long byte_count)
158 long bytes = byte_count;
161 if ( SetFPos (
info->
temp_file, fsFromStart, file_offset ) != noErr )
162 ERREXIT(cinfo, JERR_TFILE_SEEK);
165 (
unsigned char *) buffer_address );
166 if ( retVal != noErr || bytes != byte_count )
167 ERREXIT(cinfo, JERR_TFILE_READ);
173 void FAR * buffer_address,
174 long file_offset,
long byte_count)
176 long bytes = byte_count;
179 if ( SetFPos (
info->
temp_file, fsFromStart, file_offset ) != noErr )
180 ERREXIT(cinfo, JERR_TFILE_SEEK);
183 (
unsigned char *) buffer_address );
184 if ( retVal != noErr || bytes != byte_count )
185 ERREXIT(cinfo, JERR_TFILE_WRITE);
193 FSpDelete ( &(
info->tempSpec) );
208 short tmpRef, vRefNum;
214 long gestaltResponse = 0;
217 osErr = Gestalt( gestaltFSAttr, &gestaltResponse );
218 if ( ( osErr != noErr )
219 || !( gestaltResponse & (1<<gestaltHasFSSpecCalls) ) )
220 ERREXITS(cinfo, JERR_TFILE_CREATE,
"- System 7.0 or later required");
224 osErr = Gestalt( gestaltFindFolderAttr, &gestaltResponse );
225 if ( ( osErr != noErr )
226 || !( gestaltResponse & (1<<gestaltFindFolderPresent) ) )
227 ERREXITS(cinfo, JERR_TFILE_CREATE,
"- System 7.0 or later required.");
230 osErr = FindFolder ( kOnSystemDisk, kTemporaryFolderType, kCreateFolder,
232 if ( osErr != noErr )
233 ERREXITS(cinfo, JERR_TFILE_CREATE,
"- temporary items folder unavailable");
243 osErr = FSMakeFSSpec ( vRefNum, dirID, fName, &theSpec );
245 if ( (osErr = FSpGetFInfo ( &theSpec, &finderInfo ) ) != noErr )
249 osErr = FSpCreate ( &theSpec,
'????',
'????', smSystemScript );
250 if ( osErr != noErr )
253 osErr = FSpOpenDF ( &theSpec, fsRdWrPerm, &(
info->
temp_file) );
254 if ( osErr != noErr )
257 info->tempSpec = theSpec;
jpeg_mem_init(j_common_ptr cinfo)
char temp_name[TEMP_NAME_LENGTH]
jpeg_free_small(j_common_ptr cinfo, void *object, size_t sizeofobject)
long long max_bytes_needed
jpeg_mem_available(j_common_ptr cinfo, long min_bytes_needed, long max_bytes_needed, long already_allocated)
#define ERREXIT(cinfo, code)
jpeg_get_small(j_common_ptr cinfo, size_t sizeofobject)
backing_store_ptr long total_bytes_needed
#define TRACEMSS(cinfo, lvl, code, str)
jpeg_mem_term(j_common_ptr cinfo)
jpeg_free_large(j_common_ptr cinfo, void FAR *object, size_t sizeofobject)
long long long already_allocated
write_backing_store(j_common_ptr cinfo, backing_store_ptr info, void FAR *buffer_address, long file_offset, long byte_count)
jpeg_get_large(j_common_ptr cinfo, size_t sizeofobject)
read_backing_store(j_common_ptr cinfo, backing_store_ptr info, void FAR *buffer_address, long file_offset, long byte_count)
close_backing_store(j_common_ptr cinfo, backing_store_ptr info)
jpeg_open_backing_store(j_common_ptr cinfo, backing_store_ptr info, long total_bytes_needed)
#define ERREXITS(cinfo, code, str)