#define FALSE 0
#endif
+typedef struct client_info {
+ struct client_info *next;
+ void *data;
+ char *name;
+} TIFFClientInfoLink;
+
/*
* Typedefs for ``method pointers'' used internally.
*/
typedef int (*TIFFCodeMethod)(TIFF*, tidata_t, tsize_t, tsample_t);
typedef int (*TIFFSeekMethod)(TIFF*, uint32);
typedef void (*TIFFPostMethod)(TIFF*, tidata_t, tsize_t);
-typedef int (*TIFFVSetMethod)(TIFF*, ttag_t, va_list);
-typedef int (*TIFFVGetMethod)(TIFF*, ttag_t, va_list);
-typedef void (*TIFFPrintMethod)(TIFF*, FILE*, long);
typedef uint32 (*TIFFStripMethod)(TIFF*, uint32);
typedef void (*TIFFTileMethod)(TIFF*, uint32*, uint32*);
#define TIFF_STRIPCHOP 0x8000 /* enable strip chopping support */
toff_t tif_diroff; /* file offset of current directory */
toff_t tif_nextdiroff; /* file offset of following directory */
+ toff_t* tif_dirlist; /* list of offsets to already seen */
+ /* directories to prevent IFD looping */
+ uint16 tif_dirnumber; /* number of already seen directories */
TIFFDirectory tif_dir; /* internal rep of current directory */
TIFFHeader tif_header; /* file's header block */
- tidata_t tif_clientdir; /* client TIFF directory */
const int* tif_typeshift; /* data type shift counts */
const long* tif_typemask; /* data type masks */
uint32 tif_row; /* current scanline */
ttile_t tif_curtile; /* current tile for read/write */
tsize_t tif_tilesize; /* # of bytes in a tile */
/* compression scheme hooks */
+ int tif_decodestatus;
TIFFBoolMethod tif_setupdecode;/* called once before predecode */
TIFFPreMethod tif_predecode; /* pre- row/strip/tile decoding */
TIFFBoolMethod tif_setupencode;/* called once before preencode */
+ int tif_encodestatus;
TIFFPreMethod tif_preencode; /* pre- row/strip/tile encoding */
TIFFBoolMethod tif_postencode; /* post- row/strip/tile encoding */
TIFFCodeMethod tif_decoderow; /* scanline decoding routine */
/* tag support */
TIFFFieldInfo** tif_fieldinfo; /* sorted table of registered tags */
int tif_nfields; /* # entries in registered tag table */
- TIFFVSetMethod tif_vsetfield; /* tag set routine */
- TIFFVGetMethod tif_vgetfield; /* tag get routine */
- TIFFPrintMethod tif_printdir; /* directory print routine */
+ TIFFTagMethods tif_tagmethods; /* tag get/set/print routines */
+ TIFFClientInfoLink *tif_clientinfo; /* extra client information. */
};
#define isPseudoTag(t) (t > 0xffff) /* is tag value normal or pseudo */
*/
#ifndef ReadOK
#define ReadOK(tif, buf, size) \
- (TIFFReadFile(tif, (tdata_t) buf, (tsize_t) size) == (tsize_t) size)
+ (TIFFReadFile(tif, (tdata_t) buf, (tsize_t)(size)) == (tsize_t)(size))
#endif
#ifndef SeekOK
#define SeekOK(tif, off) \
#endif
/* NB: the uint32 casts are to silence certain ANSI-C compilers */
-#define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y)))
-#define TIFFroundup(x, y) (TIFFhowmany(x,y)*((uint32)(y)))
+#define TIFFhowmany(x, y) ((((uint32)(x))+(((uint32)(y))-1))/((uint32)(y)))
+#define TIFFhowmany8(x) (((x)&0x07)?((uint32)(x)>>3)+1:(uint32)(x)>>3)
+#define TIFFroundup(x, y) (TIFFhowmany(x,y)*(y))
+
+#define TIFFmax(A,B) ((A)>(B)?(A):(B))
+#define TIFFmin(A,B) ((A)<(B)?(A):(B))
#if defined(__cplusplus)
extern "C" {
extern int _TIFFNoStripDecode(TIFF*, tidata_t, tsize_t, tsample_t);
extern int _TIFFNoTileDecode(TIFF*, tidata_t, tsize_t, tsample_t);
extern void _TIFFNoPostDecode(TIFF*, tidata_t, tsize_t);
+extern int _TIFFNoPreCode (TIFF*, tsample_t);
extern int _TIFFNoSeek(TIFF*, uint32);
extern void _TIFFSwab16BitData(TIFF*, tidata_t, tsize_t);
extern void _TIFFSwab32BitData(TIFF*, tidata_t, tsize_t);