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"
90 DisposePtr((Ptr)
object);
110 DisposePtr((Ptr)
object);
139 if (mem > limit && limit > 0)
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;