33 #ifdef HAVE_SYS_TYPES_H 34 # include <sys/types.h> 58 return ((
tsize_t)
read((
int) fd, buf, (
size_t) size));
70 return ((
toff_t)
lseek((
int) fd, (off_t) off, whence));
76 return (
close((
int) fd));
85 return ((fsize =
lseek((
int) fd, 0,
SEEK_END)) < 0 ? 0 : fsize);
88 return (
toff_t) (fstat((
int) fd, &sb) < 0 ? 0 : sb.st_size);
98 toff_t size = _tiffSizeProc(fd);
101 mmap(0, size, PROT_READ, MAP_SHARED, (
int) fd, 0);
141 _tiffReadProc, _tiffWriteProc,
142 _tiffSeekProc, _tiffCloseProc, _tiffSizeProc,
143 _tiffMapProc, _tiffUnmapProc);
155 static const char module[] =
"TIFFOpen";
171 fd =
open(name, m, 0666);
192 static const char module[] =
"TIFFOpenW";
207 fd = _wopen(name, m, 0666);
214 mbsize = WideCharToMultiByte(CP_ACP, 0, name, -1,
NULL, 0,
NULL,
NULL);
219 "Can't allocate space for filename conversion buffer");
223 WideCharToMultiByte(CP_ACP, 0, name, -1, mbname, mbsize,
227 tif =
TIFFFdOpen((
int)fd, (mbname !=
NULL) ? mbname :
"<unknown>",
241 return (
malloc((
size_t) s));
253 return (realloc(p, (
size_t) s));
259 memset(p, v, (
size_t) c);
265 memcpy(d, s, (
size_t) c);
271 return (memcmp(p1, p2, (
size_t) c));
275 unixWarningHandler(
const char* module,
const char* fmt, va_list ap)
278 fprintf(stderr,
"%s: ", module);
279 fprintf(stderr,
"Warning, ");
280 vfprintf(stderr, fmt, ap);
281 fprintf(stderr,
".\n");
286 unixErrorHandler(
const char* module,
const char* fmt, va_list ap)
289 fprintf(stderr,
"%s: ", module);
290 vfprintf(stderr, fmt, ap);
291 fprintf(stderr,
".\n");
TIFFErrorHandler _TIFFerrorHandler
int write(int fd, const char *buf, int nbytes)
int read(int fd, char *buf, int nbytes)
void _TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c)
TIFF * TIFFFdOpen(int fd, const char *name, const char *mode)
void _TIFFmemset(tdata_t p, int v, tsize_t c)
void(* TIFFErrorHandler)(const char *, const char *, va_list)
void * _TIFFmalloc(tsize_t s)
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
int _TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c)
TIFF * TIFFOpen(const char *name, const char *mode)
GLenum GLuint GLenum GLsizei const GLchar * buf
void * _TIFFrealloc(tdata_t p, tsize_t s)
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)
off_t lseek(int fd, off_t offset, int whence)
TIFF * TIFFOpenW(const wchar_t *name, const char *mode)
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
TIFFErrorHandler _TIFFwarningHandler
GLuint const GLchar * name
int open(const char *name, int flags, int mode)
int _TIFFgetMode(const char *mode, const char *module)
void _TIFFfree(tdata_t p)