54 #if defined(__PPCC__) || defined(__SC__) || defined(__MRC__) || defined(applec) 55 #define CtoPstr c2pstr 61 return (FSRead((
short) fd, (
long*) &size, (
char*) buf) == noErr ?
68 return (FSWrite((
short) fd, (
long*) &size, (
char*) buf) == noErr ?
77 if (GetEOF((
short) fd, &size) != noErr)
79 (
void) GetFPos((
short) fd, &fpos);
83 if (off + fpos > size)
84 SetEOF((
short) fd, off + fpos);
85 if (SetFPos((
short) fd, fsFromMark, off) != noErr)
90 SetEOF((
short) fd, off + size);
91 if (SetFPos((
short) fd, fsFromStart, off + size) != noErr)
96 SetEOF((
short) fd, off);
97 if (SetFPos((
short) fd, fsFromStart, off) != noErr)
102 return (
toff_t)(GetFPos((
short) fd, &fpos) == noErr ? fpos :
EOF);
119 return (FSClose((
short) fd));
127 if (GetEOF((
short) fd, &size) != noErr) {
128 TIFFErrorExt(fd,
"_tiffSizeProc",
"%s: Cannot get file size");
143 _tiffReadProc, _tiffWriteProc, _tiffSeekProc, _tiffCloseProc,
144 _tiffSizeProc, _tiffMapProc, _tiffUnmapProc);
150 static void ourc2pstr(
char* inString )
152 int sLen = strlen( inString );
153 BlockMoveData( inString, &inString[1], sLen );
163 static const char module[] =
"TIFFOpen";
170 strcpy((
char*) pname, name);
171 ourc2pstr((
char*) pname);
173 err = FSMakeFSSpec( 0, 0, pname, &fSpec );
178 case O_RDWR | O_CREAT | O_TRUNC:
179 if (FSpGetFInfo(&fSpec, &finfo) == noErr)
182 case O_RDWR | O_CREAT:
183 if ((err = FSpGetFInfo(&fSpec, &finfo)) == fnfErr) {
184 if (FSpCreate(&fSpec,
' ',
'TIFF', smSystemScript) != noErr)
186 if (FSpOpenDF(&fSpec, fsRdWrPerm, &fref) != noErr)
188 }
else if (err == noErr) {
189 if (FSpOpenDF(&fSpec, fsRdWrPerm, &fref) != noErr)
195 if (FSpOpenDF(&fSpec, fsRdPerm, &fref) != noErr)
199 if (FSpOpenDF(&fSpec, fsRdWrPerm, &fref) != noErr)
215 memset(p, v, (
size_t) c);
221 memcpy(d, s, (
size_t) c);
227 return (memcmp(p1, p2, (
size_t) c));
233 return (NewPtr((
size_t) s));
247 SetPtrSize(p, (
size_t) s);
248 if (MemError() && (n = NewPtr((
size_t) s)) !=
NULL) {
249 BlockMove(p, n, GetPtrSize(p));
256 appleWarningHandler(
const char* module,
const char* fmt, va_list ap)
259 fprintf(stderr,
"%s: ", module);
260 fprintf(stderr,
"Warning, ");
261 vfprintf(stderr, fmt, ap);
262 fprintf(stderr,
".\n");
267 appleErrorHandler(
const char* module,
const char* fmt, va_list ap)
270 fprintf(stderr,
"%s: ", module);
271 vfprintf(stderr, fmt, ap);
272 fprintf(stderr,
".\n");
void _TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c)
void _TIFFmemset(tdata_t p, int v, tsize_t c)
TIFF * TIFFFdOpen(int fd, const char *name, const char *mode)
void(* TIFFErrorHandler)(const char *, const char *, va_list)
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
tdata_t _TIFFmalloc(tsize_t s)
GLenum GLuint GLenum GLsizei const GLchar * buf
int _TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c)
TIFF * TIFFClientOpen(const char *name, const char *mode, thandle_t clientdata, TIFFReadWriteProc readproc, TIFFReadWriteProc writeproc, TIFFSeekProc seekproc, TIFFCloseProc closeproc, TIFFSizeProc sizeproc, TIFFMapFileProc mapproc, TIFFUnmapFileProc unmapproc)
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
TIFFErrorHandler _TIFFwarningHandler
GLuint const GLchar * name
int _TIFFgetMode(const char *mode, const char *module)
tdata_t _TIFFrealloc(tdata_t p, tsize_t s)
TIFFErrorHandler _TIFFerrorHandler
void _TIFFfree(tdata_t p)
TIFF * TIFFOpen(const char *name, const char *mode)