69 typedef unsigned char byte;
95 #define OSGBPB_Write 0x2 97 #define OSGBPB_Read 0x4 107 #define xosgbpb_write(file, data, size, unwritten) \ 108 (os_error*) _swix(OS_GBPB, _IN(0)|_IN(1)|_IN(2)|_IN(3)|_IN(4)|_OUT(3), \ 115 #define osgbpb_write(file, data, size) \ 116 _swi(OS_GBPB, _IN(0)|_IN(1)|_IN(2)|_IN(3)|_RETURN(3), \ 130 #define xosgbpb_read(file, buffer, size, unread) \ 131 (os_error*) _swix(OS_GBPB, _IN(0)|_IN(1)|_IN(2)|_IN(3)|_OUT(3), \ 138 #define osgbpb_read(file, buffer, size) \ 139 _swi(OS_GBPB, _IN(0)|_IN(1)|_IN(2)|_IN(3)|_RETURN(3), \ 149 #define OSFind_Openin 0x40 150 #undef OSFind_Openout 151 #define OSFind_Openout 0x80 153 #define OSFind_Openup 0xC0 155 #define OSFind_Close 0x0 157 #define xosfind_open(reason, file_name, path, file) \ 158 (os_error*) _swix(OS_Find, _IN(0)|_IN(1)|_IN(2)|_OUT(0), \ 159 reason, file_name, path, file) 161 #define osfind_open(reason, file_name, path) \ 162 (os_f) _swi(OS_Find, _IN(0)|_IN(1)|_IN(2)|_RETURN(0), \ 163 reason, file_name, path) 173 #define xosfind_openin(flags, file_name, path, file) \ 174 xosfind_open(flags | OSFind_Openin, file_name, path, file) 176 #define osfind_openin(flags, file_name, path) \ 177 osfind_open(flags | OSFind_Openin, file_name, path) 187 #define xosfind_openout(flags, file_name, path, file) \ 188 xosfind_open(flags | OSFind_Openout, file_name, path, file) 190 #define osfind_openout(flags, file_name, path) \ 191 osfind_open(flags | OSFind_Openout, file_name, path) 201 #define xosfind_openup(flags, file_name, path, file) \ 202 xosfind_open(flags | OSFind_Openup, file_name, path, file) 204 #define osfind_openup(flags, file_name, path) \ 205 osfind_open(flags | OSFind_Openup, file_name, path) 210 #define xosfind_close(file) \ 211 (os_error*) _swix(OS_Find, _IN(0)|_IN(1), \ 215 #define osfind_close(file) \ 216 (void) _swi(OS_Find, _IN(0)|_IN(1), \ 223 #undef OSArgs_ReadPtr 224 #define OSArgs_ReadPtr 0x0 226 #define OSArgs_SetPtr 0x1 227 #undef OSArgs_ReadExt 228 #define OSArgs_ReadExt 0x2 234 #define xosargs_read_ptr(file, ptr) \ 235 (os_error*) _swix(OS_Args, _IN(0)|_IN(1)|_OUT(2), \ 240 #define osargs_read_ptr(file) \ 241 _swi(OS_Args, _IN(0)|_IN(1)|_RETURN(2), \ 250 #define xosargs_set_ptr(file, ptr) \ 251 (os_error*) _swix(OS_Args, _IN(0)|_IN(1)|_IN(2), \ 256 #define osargs_set_ptr(file, ptr) \ 257 (void) _swi(OS_Args, _IN(0)|_IN(1)|_IN(2), \ 266 #define xosargs_read_ext(file, ext) \ 267 (os_error*) _swix(OS_Args, _IN(0)|_IN(1)|_OUT(2), \ 272 #define osargs_read_ext(file) \ 273 _swi(OS_Args, _IN(0)|_IN(1)|_RETURN(2), \ 302 case O_RDWR|O_CREAT|O_TRUNC:
325 extern int write(
int fd,
const char *
buf,
int nbytes)
331 extern int read(
int fd,
char *
buf,
int nbytes)
345 absolute = (
int) offset;
381 return ((
toff_t)
lseek((
int) fd, (off_t) off, whence));
387 return (
close((
int) fd));
397 #error "I didn't know Acorn had that!" 424 _tiffReadProc, _tiffWriteProc,
425 _tiffSeekProc, _tiffCloseProc, _tiffSizeProc,
426 _tiffMapProc, _tiffUnmapProc);
440 static const char module[] =
"TIFFOpen";
450 fd =
open(name, 0, m);
463 return (
malloc((
size_t) s));
475 return (realloc(p, (
size_t) s));
481 memset(p, v, (
size_t) c);
487 memcpy(d, s, (
size_t) c);
493 return (memcmp(p1, p2, (
size_t) c));
497 acornWarningHandler(
const char* module,
const char* fmt, va_list ap)
501 fprintf(stderr,
"%s: ", module);
503 fprintf(stderr,
"Warning, ");
504 vfprintf(stderr, fmt, ap);
505 fprintf(stderr,
".\n");
510 acornErrorHandler(
const char* module,
const char* fmt, va_list ap)
514 fprintf(stderr,
"%s: ", module);
516 vfprintf(stderr, fmt, ap);
517 fprintf(stderr,
".\n");
os_error * xosfind_close(os_f file)
os_error * xosgbpb_read(os_f file, byte *buffer, int size, int *unread)
int write(int fd, const char *buf, int nbytes)
int read(int fd, char *buf, int nbytes)
os_error * xosfind_openup(bits flags, char *file_name, char *path, os_f *file)
os_error * xosargs_set_ptr(os_f file, int ptr)
void(* TIFFErrorHandler)(const char *, const char *, va_list)
os_f osfind_openout(bits flags, char *file_name, char *path)
os_error * xosfind_openout(bits flags, char *file_name, char *path, os_f *file)
os_f osfind_openup(bits flags, char *file_name, char *path)
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
int osgbpb_read(os_f file, byte *buffer, int size)
void _TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c)
GLenum GLuint GLenum GLsizei const GLchar * buf
int _TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c)
TIFF * TIFFFdOpen(int fd, const char *name, const char *mode)
void osargs_set_ptr(os_f file, int ptr)
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)
GLsizei const GLchar ** path
GLsizei GLsizei GLenum GLenum const GLvoid * data
void * _TIFFrealloc(tdata_t p, tsize_t s)
os_f osfind_openin(bits flags, char *file_name, char *path)
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
os_error * xosargs_read_ext(os_f file, int *ext)
int osargs_read_ptr(os_f file)
TIFFErrorHandler _TIFFwarningHandler
void _TIFFmemset(tdata_t p, int v, tsize_t c)
GLuint const GLchar * name
void osfind_close(os_f file)
os_error * xosgbpb_write(os_f file, byte *data, int size, int *unwritten)
int osgbpb_write(os_f file, byte *data, int size)
TIFF * TIFFOpen(const char *name, const char *mode)
TIFFErrorHandler _TIFFerrorHandler
int open(const char *name, int flags, int mode)
int _TIFFgetMode(const char *mode, const char *module)
os_error * xosargs_read_ptr(os_f file, int *ptr)
os_error * xosfind_openin(bits flags, char *file_name, char *path, os_f *file)
void * _TIFFmalloc(tsize_t s)
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
void _TIFFfree(tdata_t p)
int osargs_read_ext(os_f file)