31 #if defined(__WATCOMC__) || defined(__BORLANDC__) || defined(_MSC_VER) 42 return (_hread(fd, buf, size));
48 return (_hwrite(fd, buf, size));
54 return (_llseek(fd, (off_t) off, whence));
69 return (fstat((
int) fd, &sb) < 0 ? 0 : sb.st_size);
93 _tiffReadProc, _tiffWriteProc, _tiffSeekProc, _tiffCloseProc,
94 _tiffSizeProc, _tiffMapProc, _tiffUnmapProc);
106 static const char module[] =
"TIFFOpen";
115 if ((m & O_TRUNC) || OpenFile(name, &of, OF_EXIST) != HFILE_ERROR)
122 fd = OpenFile(name, &of, mm);
133 return (
tdata_t) GlobalAllocPtr(GHND, (DWORD) s);
145 return (
tdata_t) GlobalReAllocPtr(p, (DWORD) s, GHND);
151 char* pp = (
char*) p;
159 memset(pp, v, chunk);
160 pp = (
char*) (chunk + (
char huge*) pp);
169 hmemcpy((
void _huge*) d, (
void _huge*) s, c);
171 (
void) memcpy(d, s, (
size_t) c);
177 char* dd = (
char*) d;
178 char* ss = (
char*) s;
183 chunks = 0x10000 - ((
uint32) ss & 0xffff);
184 chunkd = 0x10000 - ((
uint32) dd & 0xffff);
192 result = memcmp(dd, ss, chunk);
195 dd = (
char*) (chunk + (
char huge*) dd);
196 ss = (
char*) (chunk + (
char huge*) ss);
203 win3WarningHandler(
const char* module,
const char* fmt, va_list ap)
205 char e[512] = {
'\0' };
207 strcat(strcpy(e, module),
":");
208 vsprintf(e+strlen(e), fmt, ap);
210 MessageBox(GetActiveWindow(), e,
"LibTIFF Warning",
211 MB_OK|MB_ICONEXCLAMATION);
216 win3ErrorHandler(
const char* module,
const char* fmt, va_list ap)
218 char e[512] = {
'\0' };
220 strcat(strcpy(e, module),
":");
221 vsprintf(e+strlen(e), fmt, ap);
223 MessageBox(GetActiveWindow(), e,
"LibTIFF Error", MB_OK|MB_ICONSTOP);
tdata_t _TIFFrealloc(tdata_t p, tsize_t s)
TIFFErrorHandler _TIFFerrorHandler
void _TIFFfree(tdata_t p)
void(* TIFFErrorHandler)(const char *, const char *, va_list)
void _TIFFmemset(tdata_t p, int v, tsize_t c)
GLenum GLuint GLenum GLsizei const GLchar * buf
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 _TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c)
tdata_t _TIFFmalloc(tsize_t s)
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
GLuint const GLchar * name
TIFF * TIFFOpen(const char *name, const char *mode)
int _TIFFgetMode(const char *mode, const char *module)
TIFFErrorHandler _TIFFwarningHandler
int _TIFFmemcmp(const tdata_t d, const tdata_t s, tsize_t c)
TIFF * TIFFFdOpen(int fd, const char *name, const char *mode)