ReactOS  0.4.14-dev-384-g5b37caa
tif_open.c File Reference
#include <precomp.h>
Include dependency graph for tif_open.c:

Go to the source code of this file.

Functions

static int _tiffDummyMapProc (thandle_t fd, void **pbase, toff_t *psize)
 
static void _tiffDummyUnmapProc (thandle_t fd, void *base, toff_t size)
 
int _TIFFgetMode (const char *mode, const char *module)
 
TIFFTIFFClientOpen (const char *name, const char *mode, thandle_t clientdata, TIFFReadWriteProc readproc, TIFFReadWriteProc writeproc, TIFFSeekProc seekproc, TIFFCloseProc closeproc, TIFFSizeProc sizeproc, TIFFMapFileProc mapproc, TIFFUnmapFileProc unmapproc)
 
const charTIFFFileName (TIFF *tif)
 
const charTIFFSetFileName (TIFF *tif, const char *name)
 
int TIFFFileno (TIFF *tif)
 
int TIFFSetFileno (TIFF *tif, int fd)
 
thandle_t TIFFClientdata (TIFF *tif)
 
thandle_t TIFFSetClientdata (TIFF *tif, thandle_t newvalue)
 
int TIFFGetMode (TIFF *tif)
 
int TIFFSetMode (TIFF *tif, int mode)
 
int TIFFIsTiled (TIFF *tif)
 
uint32 TIFFCurrentRow (TIFF *tif)
 
uint16 TIFFCurrentDirectory (TIFF *tif)
 
uint32 TIFFCurrentStrip (TIFF *tif)
 
uint32 TIFFCurrentTile (TIFF *tif)
 
int TIFFIsByteSwapped (TIFF *tif)
 
int TIFFIsUpSampled (TIFF *tif)
 
int TIFFIsMSB2LSB (TIFF *tif)
 
int TIFFIsBigEndian (TIFF *tif)
 
TIFFReadWriteProc TIFFGetReadProc (TIFF *tif)
 
TIFFReadWriteProc TIFFGetWriteProc (TIFF *tif)
 
TIFFSeekProc TIFFGetSeekProc (TIFF *tif)
 
TIFFCloseProc TIFFGetCloseProc (TIFF *tif)
 
TIFFSizeProc TIFFGetSizeProc (TIFF *tif)
 
TIFFMapFileProc TIFFGetMapFileProc (TIFF *tif)
 
TIFFUnmapFileProc TIFFGetUnmapFileProc (TIFF *tif)
 

Function Documentation

◆ _tiffDummyMapProc()

static int _tiffDummyMapProc ( thandle_t  fd,
void **  pbase,
toff_t psize 
)
static

Definition at line 35 of file tif_open.c.

36 {
37  (void) fd; (void) pbase; (void) psize;
38  return (0);
39 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
_Must_inspect_result_ _Out_ LPSIZE psize
Definition: ntgdi.h:1569
static int fd
Definition: io.c:51

Referenced by TIFFClientOpen().

◆ _tiffDummyUnmapProc()

static void _tiffDummyUnmapProc ( thandle_t  fd,
void base,
toff_t  size 
)
static

Definition at line 42 of file tif_open.c.

43 {
44  (void) fd; (void) base; (void) size;
45 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
static int fd
Definition: io.c:51
GLsizeiptr size
Definition: glext.h:5919

Referenced by TIFFClientOpen().

◆ _TIFFgetMode()

int _TIFFgetMode ( const char mode,
const char module 
)

Definition at line 48 of file tif_open.c.

49 {
50  int m = -1;
51 
52  switch (mode[0]) {
53  case 'r':
54  m = O_RDONLY;
55  if (mode[1] == '+')
56  m = O_RDWR;
57  break;
58  case 'w':
59  case 'a':
60  m = O_RDWR|O_CREAT;
61  if (mode[0] == 'w')
62  m |= O_TRUNC;
63  break;
64  default:
65  TIFFErrorExt(0, module, "\"%s\": Bad mode", mode);
66  break;
67  }
68  return (m);
69 }
const GLfloat * m
Definition: glext.h:10848
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
#define O_TRUNC
Definition: acwin.h:112
GLenum mode
Definition: glext.h:6217
#define O_RDWR
Definition: fcntl.h:36
#define O_CREAT
Definition: acwin.h:110
#define O_RDONLY
Definition: acwin.h:108

Referenced by TIFFClientOpen(), TIFFOpen(), and TIFFOpenW().

◆ TIFFClientdata()

thandle_t TIFFClientdata ( TIFF tif)

Definition at line 536 of file tif_open.c.

537 {
538  return (tif->tif_clientdata);
539 }
thandle_t tif_clientdata
Definition: tiffiop.h:191

◆ TIFFClientOpen()

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 
)

Definition at line 72 of file tif_open.c.

83 {
84  static const char module[] = "TIFFClientOpen";
85  TIFF *tif;
86  int m;
87  const char* cp;
88 
89  /* The following are configuration checks. They should be redundant, but should not
90  * compile to any actual code in an optimised release build anyway. If any of them
91  * fail, (makefile-based or other) configuration is not correct */
92  assert(sizeof(uint8)==1);
93  assert(sizeof(int8)==1);
94  assert(sizeof(uint16)==2);
95  assert(sizeof(int16)==2);
96  assert(sizeof(uint32)==4);
97  assert(sizeof(int32)==4);
98  assert(sizeof(uint64)==8);
99  assert(sizeof(int64)==8);
100  assert(sizeof(tmsize_t)==sizeof(void*));
101  {
102  union{
103  uint8 a8[2];
104  uint16 a16;
105  } n;
106  n.a8[0]=1;
107  n.a8[1]=0;
108  #ifdef WORDS_BIGENDIAN
109  assert(n.a16==256);
110  #else
111  assert(n.a16==1);
112  #endif
113  }
114 
116  if (m == -1)
117  goto bad2;
118  tif = (TIFF *)_TIFFmalloc((tmsize_t)(sizeof (TIFF) + strlen(name) + 1));
119  if (tif == NULL) {
120  TIFFErrorExt(clientdata, module, "%s: Out of memory (TIFF structure)", name);
121  goto bad2;
122  }
123  _TIFFmemset(tif, 0, sizeof (*tif));
124  tif->tif_name = (char *)tif + sizeof (TIFF);
125  strcpy(tif->tif_name, name);
126  tif->tif_mode = m &~ (O_CREAT|O_TRUNC);
127  tif->tif_curdir = (uint16) -1; /* non-existent directory */
128  tif->tif_curoff = 0;
129  tif->tif_curstrip = (uint32) -1; /* invalid strip */
130  tif->tif_row = (uint32) -1; /* read/write pre-increment */
131  tif->tif_clientdata = clientdata;
132  if (!readproc || !writeproc || !seekproc || !closeproc || !sizeproc) {
133  TIFFErrorExt(clientdata, module,
134  "One of the client procedures is NULL pointer.");
135  goto bad2;
136  }
137  tif->tif_readproc = readproc;
138  tif->tif_writeproc = writeproc;
139  tif->tif_seekproc = seekproc;
140  tif->tif_closeproc = closeproc;
141  tif->tif_sizeproc = sizeproc;
142  if (mapproc)
143  tif->tif_mapproc = mapproc;
144  else
146  if (unmapproc)
147  tif->tif_unmapproc = unmapproc;
148  else
150  _TIFFSetDefaultCompressionState(tif); /* setup default state */
151  /*
152  * Default is to return data MSB2LSB and enable the
153  * use of memory-mapped files and strip chopping when
154  * a file is opened read-only.
155  */
157  if (m == O_RDONLY )
158  tif->tif_flags |= TIFF_MAPPED;
159 
160  #ifdef STRIPCHOP_DEFAULT
161  if (m == O_RDONLY || m == O_RDWR)
163  #endif
164 
165  /*
166  * Process library-specific flags in the open mode string.
167  * The following flags may be used to control intrinsic library
168  * behaviour that may or may not be desirable (usually for
169  * compatibility with some application that claims to support
170  * TIFF but only supports some brain dead idea of what the
171  * vendor thinks TIFF is):
172  *
173  * 'l' use little-endian byte order for creating a file
174  * 'b' use big-endian byte order for creating a file
175  * 'L' read/write information using LSB2MSB bit order
176  * 'B' read/write information using MSB2LSB bit order
177  * 'H' read/write information using host bit order
178  * 'M' enable use of memory-mapped files when supported
179  * 'm' disable use of memory-mapped files
180  * 'C' enable strip chopping support when reading
181  * 'c' disable strip chopping support
182  * 'h' read TIFF header only, do not load the first IFD
183  * '4' ClassicTIFF for creating a file (default)
184  * '8' BigTIFF for creating a file
185  *
186  * The use of the 'l' and 'b' flags is strongly discouraged.
187  * These flags are provided solely because numerous vendors,
188  * typically on the PC, do not correctly support TIFF; they
189  * only support the Intel little-endian byte order. This
190  * support is not configured by default because it supports
191  * the violation of the TIFF spec that says that readers *MUST*
192  * support both byte orders. It is strongly recommended that
193  * you not use this feature except to deal with busted apps
194  * that write invalid TIFF. And even in those cases you should
195  * bang on the vendors to fix their software.
196  *
197  * The 'L', 'B', and 'H' flags are intended for applications
198  * that can optimize operations on data by using a particular
199  * bit order. By default the library returns data in MSB2LSB
200  * bit order for compatibility with older versions of this
201  * library. Returning data in the bit order of the native CPU
202  * makes the most sense but also requires applications to check
203  * the value of the FillOrder tag; something they probably do
204  * not do right now.
205  *
206  * The 'M' and 'm' flags are provided because some virtual memory
207  * systems exhibit poor behaviour when large images are mapped.
208  * These options permit clients to control the use of memory-mapped
209  * files on a per-file basis.
210  *
211  * The 'C' and 'c' flags are provided because the library support
212  * for chopping up large strips into multiple smaller strips is not
213  * application-transparent and as such can cause problems. The 'c'
214  * option permits applications that only want to look at the tags,
215  * for example, to get the unadulterated TIFF tag information.
216  */
217  for (cp = mode; *cp; cp++)
218  switch (*cp) {
219  case 'b':
220  #ifndef WORDS_BIGENDIAN
221  if (m&O_CREAT)
222  tif->tif_flags |= TIFF_SWAB;
223  #endif
224  break;
225  case 'l':
226  #ifdef WORDS_BIGENDIAN
227  if ((m&O_CREAT))
228  tif->tif_flags |= TIFF_SWAB;
229  #endif
230  break;
231  case 'B':
232  tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |
234  break;
235  case 'L':
236  tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |
238  break;
239  case 'H':
240  tif->tif_flags = (tif->tif_flags &~ TIFF_FILLORDER) |
242  break;
243  case 'M':
244  if (m == O_RDONLY)
245  tif->tif_flags |= TIFF_MAPPED;
246  break;
247  case 'm':
248  if (m == O_RDONLY)
249  tif->tif_flags &= ~TIFF_MAPPED;
250  break;
251  case 'C':
252  if (m == O_RDONLY)
253  tif->tif_flags |= TIFF_STRIPCHOP;
254  break;
255  case 'c':
256  if (m == O_RDONLY)
257  tif->tif_flags &= ~TIFF_STRIPCHOP;
258  break;
259  case 'h':
260  tif->tif_flags |= TIFF_HEADERONLY;
261  break;
262  case '8':
263  if (m&O_CREAT)
264  tif->tif_flags |= TIFF_BIGTIFF;
265  break;
266  }
267  /*
268  * Read in TIFF header.
269  */
270  if ((m & O_TRUNC) ||
271  !ReadOK(tif, &tif->tif_header, sizeof (TIFFHeaderClassic))) {
272  if (tif->tif_mode == O_RDONLY) {
274  "Cannot read TIFF header");
275  goto bad;
276  }
277  /*
278  * Setup header and write.
279  */
280  #ifdef WORDS_BIGENDIAN
283  #else
286  #endif
287  if (!(tif->tif_flags&TIFF_BIGTIFF))
288  {
290  tif->tif_header.classic.tiff_diroff = 0;
291  if (tif->tif_flags & TIFF_SWAB)
293  tif->tif_header_size = sizeof(TIFFHeaderClassic);
294  }
295  else
296  {
298  tif->tif_header.big.tiff_offsetsize = 8;
299  tif->tif_header.big.tiff_unused = 0;
300  tif->tif_header.big.tiff_diroff = 0;
301  if (tif->tif_flags & TIFF_SWAB)
302  {
305  }
306  tif->tif_header_size = sizeof (TIFFHeaderBig);
307  }
308  /*
309  * The doc for "fopen" for some STD_C_LIBs says that if you
310  * open a file for modify ("+"), then you must fseek (or
311  * fflush?) between any freads and fwrites. This is not
312  * necessary on most systems, but has been shown to be needed
313  * on Solaris.
314  */
315  TIFFSeekFile( tif, 0, SEEK_SET );
316  if (!WriteOK(tif, &tif->tif_header, (tmsize_t)(tif->tif_header_size))) {
318  "Error writing TIFF header");
319  goto bad;
320  }
321  /*
322  * Setup the byte order handling.
323  */
325  #ifndef WORDS_BIGENDIAN
326  tif->tif_flags |= TIFF_SWAB;
327  #endif
328  } else {
329  #ifdef WORDS_BIGENDIAN
330  tif->tif_flags |= TIFF_SWAB;
331  #endif
332  }
333  /*
334  * Setup default directory.
335  */
336  if (!TIFFDefaultDirectory(tif))
337  goto bad;
338  tif->tif_diroff = 0;
339  tif->tif_dirlist = NULL;
340  tif->tif_dirlistsize = 0;
341  tif->tif_dirnumber = 0;
342  return (tif);
343  }
344  /*
345  * Setup the byte order handling.
346  */
349  #if MDI_SUPPORT
350  &&
351  #if HOST_BIGENDIAN
353  #else
355  #endif
356  ) {
358  "Not a TIFF or MDI file, bad magic number %d (0x%x)",
359  #else
360  ) {
362  "Not a TIFF file, bad magic number %d (0x%x)",
363  #endif
366  goto bad;
367  }
369  #ifndef WORDS_BIGENDIAN
370  tif->tif_flags |= TIFF_SWAB;
371  #endif
372  } else {
373  #ifdef WORDS_BIGENDIAN
374  tif->tif_flags |= TIFF_SWAB;
375  #endif
376  }
377  if (tif->tif_flags & TIFF_SWAB)
382  "Not a TIFF file, bad version number %d (0x%x)",
385  goto bad;
386  }
388  {
389  if (tif->tif_flags & TIFF_SWAB)
391  tif->tif_header_size = sizeof(TIFFHeaderClassic);
392  }
393  else
394  {
395  if (!ReadOK(tif, ((uint8*)(&tif->tif_header) + sizeof(TIFFHeaderClassic)), (sizeof(TIFFHeaderBig)-sizeof(TIFFHeaderClassic))))
396  {
398  "Cannot read TIFF header");
399  goto bad;
400  }
401  if (tif->tif_flags & TIFF_SWAB)
402  {
405  }
406  if (tif->tif_header.big.tiff_offsetsize != 8)
407  {
409  "Not a TIFF file, bad BigTIFF offsetsize %d (0x%x)",
412  goto bad;
413  }
414  if (tif->tif_header.big.tiff_unused != 0)
415  {
417  "Not a TIFF file, bad BigTIFF unused %d (0x%x)",
419  tif->tif_header.big.tiff_unused);
420  goto bad;
421  }
422  tif->tif_header_size = sizeof(TIFFHeaderBig);
423  tif->tif_flags |= TIFF_BIGTIFF;
424  }
425  tif->tif_flags |= TIFF_MYBUFFER;
426  tif->tif_rawcp = tif->tif_rawdata = 0;
427  tif->tif_rawdatasize = 0;
428  tif->tif_rawdataoff = 0;
429  tif->tif_rawdataloaded = 0;
430 
431  switch (mode[0]) {
432  case 'r':
433  if (!(tif->tif_flags&TIFF_BIGTIFF))
435  else
437  /*
438  * Try to use a memory-mapped file if the client
439  * has not explicitly suppressed usage with the
440  * 'm' flag in the open mode (see above).
441  */
442  if (tif->tif_flags & TIFF_MAPPED)
443  {
444  toff_t n;
445  if (TIFFMapFileContents(tif,(void**)(&tif->tif_base),&n))
446  {
447  tif->tif_size=(tmsize_t)n;
448  assert((toff_t)tif->tif_size==n);
449  }
450  else
451  tif->tif_flags &= ~TIFF_MAPPED;
452  }
453  /*
454  * Sometimes we do not want to read the first directory (for example,
455  * it may be broken) and want to proceed to other directories. I this
456  * case we use the TIFF_HEADERONLY flag to open file and return
457  * immediately after reading TIFF header.
458  */
459  if (tif->tif_flags & TIFF_HEADERONLY)
460  return (tif);
461 
462  /*
463  * Setup initial directory.
464  */
465  if (TIFFReadDirectory(tif)) {
466  tif->tif_rawcc = (tmsize_t)-1;
467  tif->tif_flags |= TIFF_BUFFERSETUP;
468  return (tif);
469  }
470  break;
471  case 'a':
472  /*
473  * New directories are automatically append
474  * to the end of the directory chain when they
475  * are written out (see TIFFWriteDirectory).
476  */
477  if (!TIFFDefaultDirectory(tif))
478  goto bad;
479  return (tif);
480  }
481 bad:
482  tif->tif_mode = O_RDONLY; /* XXX avoid flush */
483  TIFFCleanup(tif);
484 bad2:
485  return ((TIFF*)0);
486 }
unsigned long long uint64
Definition: platform.h:18
static int _tiffDummyMapProc(thandle_t fd, void **pbase, toff_t *psize)
Definition: tif_open.c:35
TIFFSeekProc tif_seekproc
Definition: tiffiop.h:194
uint8 * tif_rawcp
Definition: tiffiop.h:183
void _TIFFmemset(void *p, int v, tmsize_t c)
Definition: tif_unix.c:338
uint16 tif_header_size
Definition: tiffiop.h:142
int TIFFReadDirectory(TIFF *tif)
Definition: tif_dirread.c:3542
uint8 * tif_base
Definition: tiffiop.h:186
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define TIFF_STRIPCHOP
Definition: tiffiop.h:121
TIFFUnmapFileProc tif_unmapproc
Definition: tiffiop.h:189
#define WriteOK(tif, buf, size)
Definition: tiffiop.h:243
unsigned int uint32
Definition: types.h:32
#define TIFFSeekFile(tif, off, whence)
Definition: tiffiop.h:221
uint64 toff_t
Definition: tiffio.h:66
uint32 tif_curstrip
Definition: tiffiop.h:145
#define FILLORDER_LSB2MSB
Definition: tiff.h:217
GLdouble n
Definition: glext.h:7729
#define assert(x)
Definition: debug.h:53
struct tiff TIFF
Definition: tiffio.h:38
uint8 * tif_rawdata
Definition: tiffiop.h:179
uint64 tif_curoff
Definition: tiffiop.h:146
thandle_t tif_clientdata
Definition: tiffiop.h:191
tmsize_t tif_rawdataoff
Definition: tiffiop.h:181
#define STRIPCHOP_DEFAULT
Definition: tiffconf.h:124
long long int64
Definition: platform.h:13
tmsize_t tif_rawcc
Definition: tiffiop.h:184
uint16 tif_curdir
Definition: tiffiop.h:144
char * tif_name
Definition: tiffiop.h:103
const GLfloat * m
Definition: glext.h:10848
Definition: tiffiop.h:102
void TIFFCleanup(TIFF *tif)
Definition: tif_close.c:46
#define TIFF_HEADERONLY
Definition: tiffiop.h:122
TIFFHeaderCommon common
Definition: tiffiop.h:138
#define TIFF_BIGTIFF
Definition: tiffiop.h:125
#define TIFF_SWAB
Definition: tiffiop.h:113
static BOOL readproc(HANDLE proc, LPVOID address, PVOID target, DWORD size)
Definition: env.c:189
TIFF_SSIZE_T tmsize_t
Definition: tiffio.h:65
int tif_mode
Definition: tiffiop.h:105
uint32 tif_flags
Definition: tiffiop.h:106
smooth NULL
Definition: ftsmooth.c:416
uint64 tif_nextdiroff
Definition: tiffiop.h:131
void * _TIFFmalloc(tmsize_t s)
Definition: tif_unix.c:309
union tiff::@3329 tif_header
#define TIFFMapFileContents(tif, paddr, psize)
Definition: tiffiop.h:227
TIFFMapFileProc tif_mapproc
Definition: tiffiop.h:188
#define MDI_BIGENDIAN
Definition: tiff.h:54
#define SEEK_SET
Definition: jmemansi.c:26
#define TIFF_FILLORDER
Definition: tiffiop.h:107
void TIFFSwabShort(uint16 *wp)
Definition: tif_swab.c:34
#define TIFF_BIGENDIAN
Definition: tiff.h:51
uint32 tiff_diroff
Definition: tiff.h:98
if(!(yy_init))
Definition: macro.lex.yy.c:714
unsigned char uint8
Definition: types.h:28
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
static void _tiffDummyUnmapProc(thandle_t fd, void *base, toff_t size)
Definition: tif_open.c:42
tmsize_t tif_rawdatasize
Definition: tiffiop.h:180
tmsize_t tif_rawdataloaded
Definition: tiffiop.h:182
#define HOST_BIGENDIAN
Definition: tiffconf.h:86
uint64 * tif_dirlist
Definition: tiffiop.h:132
uint16 tif_dirnumber
Definition: tiffiop.h:134
uint64 tif_diroff
Definition: tiffiop.h:130
TIFFReadWriteProc tif_readproc
Definition: tiffiop.h:192
tmsize_t tif_size
Definition: tiffiop.h:187
#define O_TRUNC
Definition: acwin.h:112
TIFFSizeProc tif_sizeproc
Definition: tiffiop.h:196
void _TIFFSetDefaultCompressionState(TIFF *tif)
Definition: tif_compress.c:135
GLenum mode
Definition: glext.h:6217
#define MDI_SUPPORT
Definition: tiffconf.h:139
TIFFCloseProc tif_closeproc
Definition: tiffiop.h:195
#define TIFF_BUFFERSETUP
Definition: tiffiop.h:110
TIFFReadWriteProc tif_writeproc
Definition: tiffiop.h:193
TIFFHeaderBig big
Definition: tiffiop.h:140
#define HOST_FILLORDER
Definition: tif_config.h:113
uint16 tiff_version
Definition: tiff.h:93
uint16 tiff_magic
Definition: tiff.h:92
#define TIFF_MAPPED
Definition: tiffiop.h:117
uint32 tif_row
Definition: tiffiop.h:143
void TIFFSwabLong(uint32 *lp)
Definition: tif_swab.c:45
#define TIFF_LITTLEENDIAN
Definition: tiff.h:52
int _TIFFgetMode(const char *mode, const char *module)
Definition: tif_open.c:48
unsigned short uint16
Definition: types.h:30
short int16
Definition: platform.h:11
#define O_RDWR
Definition: fcntl.h:36
int TIFFDefaultDirectory(TIFF *tif)
Definition: tif_dir.c:1356
POINT cp
Definition: magnifier.c:59
Definition: name.c:36
long int32
Definition: platform.h:12
#define ReadOK(tif, buf, size)
Definition: tiffiop.h:236
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define TIFF_VERSION_CLASSIC
Definition: tiff.h:48
uint64 tiff_diroff
Definition: tiff.h:105
TIFFHeaderClassic classic
Definition: tiffiop.h:139
#define MDI_LITTLEENDIAN
Definition: tiff.h:53
uint16 tiff_offsetsize
Definition: tiff.h:103
uint16 tiff_unused
Definition: tiff.h:104
#define O_CREAT
Definition: acwin.h:110
#define TIFF_VERSION_BIG
Definition: tiff.h:49
uint16 tif_dirlistsize
Definition: tiffiop.h:133
#define FILLORDER_MSB2LSB
Definition: tiff.h:216
#define TIFF_MYBUFFER
Definition: tiffiop.h:115
void TIFFSwabLong8(uint64 *lp)
Definition: tif_swab.c:57
char int8
Definition: platform.h:10
#define O_RDONLY
Definition: acwin.h:108

Referenced by _tiffStreamOpen(), and TIFFFdOpen().

◆ TIFFCurrentDirectory()

uint16 TIFFCurrentDirectory ( TIFF tif)

Definition at line 595 of file tif_open.c.

596 {
597  return (tif->tif_curdir);
598 }
uint16 tif_curdir
Definition: tiffiop.h:144

◆ TIFFCurrentRow()

uint32 TIFFCurrentRow ( TIFF tif)

Definition at line 586 of file tif_open.c.

587 {
588  return (tif->tif_row);
589 }
uint32 tif_row
Definition: tiffiop.h:143

◆ TIFFCurrentStrip()

uint32 TIFFCurrentStrip ( TIFF tif)

Definition at line 604 of file tif_open.c.

605 {
606  return (tif->tif_curstrip);
607 }
uint32 tif_curstrip
Definition: tiffiop.h:145

◆ TIFFCurrentTile()

uint32 TIFFCurrentTile ( TIFF tif)

Definition at line 613 of file tif_open.c.

614 {
615  return (tif->tif_curtile);
616 }
uint32 tif_curtile
Definition: tiffiop.h:153

◆ TIFFFileName()

◆ TIFFFileno()

int TIFFFileno ( TIFF tif)

Definition at line 516 of file tif_open.c.

517 {
518  return (tif->tif_fd);
519 }
int tif_fd
Definition: tiffiop.h:104

◆ TIFFGetCloseProc()

TIFFCloseProc TIFFGetCloseProc ( TIFF tif)

Definition at line 685 of file tif_open.c.

686 {
687  return (tif->tif_closeproc);
688 }
TIFFCloseProc tif_closeproc
Definition: tiffiop.h:195

◆ TIFFGetMapFileProc()

TIFFMapFileProc TIFFGetMapFileProc ( TIFF tif)

Definition at line 703 of file tif_open.c.

704 {
705  return (tif->tif_mapproc);
706 }
TIFFMapFileProc tif_mapproc
Definition: tiffiop.h:188

◆ TIFFGetMode()

int TIFFGetMode ( TIFF tif)

Definition at line 556 of file tif_open.c.

557 {
558  return (tif->tif_mode);
559 }
int tif_mode
Definition: tiffiop.h:105

◆ TIFFGetReadProc()

TIFFReadWriteProc TIFFGetReadProc ( TIFF tif)

Definition at line 658 of file tif_open.c.

659 {
660  return (tif->tif_readproc);
661 }
TIFFReadWriteProc tif_readproc
Definition: tiffiop.h:192

◆ TIFFGetSeekProc()

TIFFSeekProc TIFFGetSeekProc ( TIFF tif)

Definition at line 676 of file tif_open.c.

677 {
678  return (tif->tif_seekproc);
679 }
TIFFSeekProc tif_seekproc
Definition: tiffiop.h:194

◆ TIFFGetSizeProc()

TIFFSizeProc TIFFGetSizeProc ( TIFF tif)

Definition at line 694 of file tif_open.c.

695 {
696  return (tif->tif_sizeproc);
697 }
TIFFSizeProc tif_sizeproc
Definition: tiffiop.h:196

◆ TIFFGetUnmapFileProc()

TIFFUnmapFileProc TIFFGetUnmapFileProc ( TIFF tif)

Definition at line 712 of file tif_open.c.

713 {
714  return (tif->tif_unmapproc);
715 }
TIFFUnmapFileProc tif_unmapproc
Definition: tiffiop.h:189

◆ TIFFGetWriteProc()

TIFFReadWriteProc TIFFGetWriteProc ( TIFF tif)

Definition at line 667 of file tif_open.c.

668 {
669  return (tif->tif_writeproc);
670 }
TIFFReadWriteProc tif_writeproc
Definition: tiffiop.h:193

◆ TIFFIsBigEndian()

int TIFFIsBigEndian ( TIFF tif)

Definition at line 649 of file tif_open.c.

650 {
651  return (tif->tif_header.common.tiff_magic == TIFF_BIGENDIAN);
652 }
TIFFHeaderCommon common
Definition: tiffiop.h:138
union tiff::@3329 tif_header
#define TIFF_BIGENDIAN
Definition: tiff.h:51
uint16 tiff_magic
Definition: tiff.h:92

◆ TIFFIsByteSwapped()

int TIFFIsByteSwapped ( TIFF tif)

Definition at line 622 of file tif_open.c.

623 {
624  return ((tif->tif_flags & TIFF_SWAB) != 0);
625 }
#define TIFF_SWAB
Definition: tiffiop.h:113
uint32 tif_flags
Definition: tiffiop.h:106

◆ TIFFIsMSB2LSB()

int TIFFIsMSB2LSB ( TIFF tif)

Definition at line 640 of file tif_open.c.

641 {
642  return (isFillOrder(tif, FILLORDER_MSB2LSB));
643 }
#define isFillOrder(tif, o)
Definition: tiffiop.h:215
#define FILLORDER_MSB2LSB
Definition: tiff.h:216

◆ TIFFIsTiled()

int TIFFIsTiled ( TIFF tif)

Definition at line 577 of file tif_open.c.

578 {
579  return (isTiled(tif));
580 }
#define isTiled(tif)
Definition: tiffiop.h:213

Referenced by PickContigCase(), PickSeparateCase(), TIFFFlush(), TIFFReadRGBAStripExt(), and TIFFReadRGBATileExt().

◆ TIFFIsUpSampled()

int TIFFIsUpSampled ( TIFF tif)

Definition at line 631 of file tif_open.c.

632 {
633  return (isUpSampled(tif));
634 }
#define isUpSampled(tif)
Definition: tiffiop.h:216

◆ TIFFSetClientdata()

thandle_t TIFFSetClientdata ( TIFF tif,
thandle_t  newvalue 
)

Definition at line 545 of file tif_open.c.

546 {
547  thandle_t m = tif->tif_clientdata;
548  tif->tif_clientdata = newvalue;
549  return m;
550 }
thandle_t tif_clientdata
Definition: tiffiop.h:191
const GLfloat * m
Definition: glext.h:10848

◆ TIFFSetFileName()

const char* TIFFSetFileName ( TIFF tif,
const char name 
)

Definition at line 505 of file tif_open.c.

506 {
507  const char* old_name = tif->tif_name;
508  tif->tif_name = (char *)name;
509  return (old_name);
510 }
char * tif_name
Definition: tiffiop.h:103
Definition: name.c:36

◆ TIFFSetFileno()

int TIFFSetFileno ( TIFF tif,
int  fd 
)

Definition at line 525 of file tif_open.c.

526 {
527  int old_fd = tif->tif_fd;
528  tif->tif_fd = fd;
529  return old_fd;
530 }
static int fd
Definition: io.c:51
int tif_fd
Definition: tiffiop.h:104

◆ TIFFSetMode()

int TIFFSetMode ( TIFF tif,
int  mode 
)

Definition at line 565 of file tif_open.c.

566 {
567  int old_mode = tif->tif_mode;
568  tif->tif_mode = mode;
569  return (old_mode);
570 }
int tif_mode
Definition: tiffiop.h:105
GLenum mode
Definition: glext.h:6217