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

Go to the source code of this file.

Functions

static voidtd_lfind (const void *key, const void *base, size_t *nmemb, size_t size, int(*compar)(const void *, const void *))
 
const TIFFFieldArray_TIFFGetFields (void)
 
const TIFFFieldArray_TIFFGetExifFields (void)
 
void _TIFFSetupFields (TIFF *tif, const TIFFFieldArray *fieldarray)
 
static int tagCompare (const void *a, const void *b)
 
static int tagNameCompare (const void *a, const void *b)
 
int _TIFFMergeFields (TIFF *tif, const TIFFField info[], uint32 n)
 
void _TIFFPrintFieldInfo (TIFF *tif, FILE *fd)
 
int TIFFDataWidth (TIFFDataType type)
 
int _TIFFDataSize (TIFFDataType type)
 
const TIFFFieldTIFFFindField (TIFF *tif, uint32 tag, TIFFDataType dt)
 
static const TIFFField_TIFFFindFieldByName (TIFF *tif, const char *field_name, TIFFDataType dt)
 
const TIFFFieldTIFFFieldWithTag (TIFF *tif, uint32 tag)
 
const TIFFFieldTIFFFieldWithName (TIFF *tif, const char *field_name)
 
uint32 TIFFFieldTag (const TIFFField *fip)
 
const charTIFFFieldName (const TIFFField *fip)
 
TIFFDataType TIFFFieldDataType (const TIFFField *fip)
 
int TIFFFieldPassCount (const TIFFField *fip)
 
int TIFFFieldReadCount (const TIFFField *fip)
 
int TIFFFieldWriteCount (const TIFFField *fip)
 
const TIFFField_TIFFFindOrRegisterField (TIFF *tif, uint32 tag, TIFFDataType dt)
 
TIFFField_TIFFCreateAnonField (TIFF *tif, uint32 tag, TIFFDataType field_type)
 
static TIFFSetGetFieldType _TIFFSetGetType (TIFFDataType type, short count, unsigned char passcount)
 
int TIFFMergeFieldInfo (TIFF *tif, const TIFFFieldInfo info[], uint32 n)
 
int _TIFFCheckFieldIsValidForCodec (TIFF *tif, ttag_t tag)
 

Variables

static const TIFFFieldArray tiffFieldArray = { tfiatImage, 0, TIFFArrayCount(tiffFields), (TIFFField*) tiffFields }
 
static const TIFFFieldArray exifFieldArray = { tfiatExif, 0, TIFFArrayCount(exifFields), (TIFFField*) exifFields }
 
static const TIFFField tiffFields []
 
static const TIFFField exifFields []
 

Function Documentation

◆ _TIFFCheckFieldIsValidForCodec()

int _TIFFCheckFieldIsValidForCodec ( TIFF tif,
ttag_t  tag 
)

Definition at line 958 of file tif_dirinfo.c.

959 {
960  /* Filter out non-codec specific tags */
961  switch (tag) {
962  /* Shared tags */
963  case TIFFTAG_PREDICTOR:
964  /* JPEG tags */
965  case TIFFTAG_JPEGTABLES:
966  /* OJPEG tags */
969  case TIFFTAG_JPEGQTABLES:
972  case TIFFTAG_JPEGPROC:
974  /* CCITT* */
975  case TIFFTAG_BADFAXLINES:
980  /* LERC */
982  break;
983  default:
984  return 1;
985  }
986  /* Check if codec specific tags are allowed for the current
987  * compression scheme (codec) */
988  switch (tif->tif_dir.td_compression) {
989  case COMPRESSION_LZW:
990  if (tag == TIFFTAG_PREDICTOR)
991  return 1;
992  break;
994  /* No codec-specific tags */
995  break;
997  /* No codec-specific tags */
998  break;
999  case COMPRESSION_NEXT:
1000  /* No codec-specific tags */
1001  break;
1002  case COMPRESSION_JPEG:
1003  if (tag == TIFFTAG_JPEGTABLES)
1004  return 1;
1005  break;
1006  case COMPRESSION_OJPEG:
1007  switch (tag) {
1008  case TIFFTAG_JPEGIFOFFSET:
1010  case TIFFTAG_JPEGQTABLES:
1011  case TIFFTAG_JPEGDCTABLES:
1012  case TIFFTAG_JPEGACTABLES:
1013  case TIFFTAG_JPEGPROC:
1015  return 1;
1016  }
1017  break;
1018  case COMPRESSION_CCITTRLE:
1019  case COMPRESSION_CCITTRLEW:
1020  case COMPRESSION_CCITTFAX3:
1021  case COMPRESSION_CCITTFAX4:
1022  switch (tag) {
1023  case TIFFTAG_BADFAXLINES:
1024  case TIFFTAG_CLEANFAXDATA:
1026  return 1;
1027  case TIFFTAG_GROUP3OPTIONS:
1029  return 1;
1030  break;
1031  case TIFFTAG_GROUP4OPTIONS:
1033  return 1;
1034  break;
1035  }
1036  break;
1037  case COMPRESSION_JBIG:
1038  /* No codec-specific tags */
1039  break;
1040  case COMPRESSION_DEFLATE:
1042  if (tag == TIFFTAG_PREDICTOR)
1043  return 1;
1044  break;
1045  case COMPRESSION_PIXARLOG:
1046  if (tag == TIFFTAG_PREDICTOR)
1047  return 1;
1048  break;
1049  case COMPRESSION_SGILOG:
1050  case COMPRESSION_SGILOG24:
1051  /* No codec-specific tags */
1052  break;
1053  case COMPRESSION_LZMA:
1054  if (tag == TIFFTAG_PREDICTOR)
1055  return 1;
1056  break;
1057  case COMPRESSION_ZSTD:
1058  if (tag == TIFFTAG_PREDICTOR)
1059  return 1;
1060  break;
1061  case COMPRESSION_LERC:
1063  return 1;
1064  break;
1065  case COMPRESSION_WEBP:
1066  if (tag == TIFFTAG_PREDICTOR)
1067  return 1;
1068  break;
1069  }
1070  return 0;
1071 }
#define TIFFTAG_JPEGTABLES
Definition: tiff.h:325
#define COMPRESSION_PACKBITS
Definition: tiff.h:171
#define TIFFTAG_JPEGIFOFFSET
Definition: tiff.h:358
#define COMPRESSION_WEBP
Definition: tiff.h:194
#define COMPRESSION_CCITTFAX3
Definition: tiff.h:160
#define COMPRESSION_SGILOG24
Definition: tiff.h:188
#define TIFFTAG_CONSECUTIVEBADFAXLINES
Definition: tiff.h:295
Definition: ecma_167.h:138
#define COMPRESSION_CCITTRLE
Definition: tiff.h:159
#define COMPRESSION_OJPEG
Definition: tiff.h:165
#define COMPRESSION_DEFLATE
Definition: tiff.h:181
#define TIFFTAG_LERC_PARAMETERS
Definition: tiff.h:456
#define COMPRESSION_CCITTFAX4
Definition: tiff.h:162
#define TIFFTAG_JPEGACTABLES
Definition: tiff.h:365
#define TIFFTAG_JPEGQTABLES
Definition: tiff.h:363
#define COMPRESSION_CCITTRLEW
Definition: tiff.h:170
#define COMPRESSION_PIXARLOG
Definition: tiff.h:180
#define COMPRESSION_JBIG
Definition: tiff.h:186
#define TIFFTAG_GROUP3OPTIONS
Definition: tiff.h:254
#define COMPRESSION_LERC
Definition: tiff.h:190
#define COMPRESSION_LZMA
Definition: tiff.h:192
#define TIFFTAG_BADFAXLINES
Definition: tiff.h:290
#define TIFFTAG_JPEGPROC
Definition: tiff.h:355
#define COMPRESSION_SGILOG
Definition: tiff.h:187
#define COMPRESSION_JPEG
Definition: tiff.h:166
#define TIFFTAG_JPEGDCTABLES
Definition: tiff.h:364
#define TIFFTAG_JPEGIFBYTECOUNT
Definition: tiff.h:359
#define COMPRESSION_THUNDERSCAN
Definition: tiff.h:172
#define COMPRESSION_ADOBE_DEFLATE
Definition: tiff.h:182
TIFFDirectory tif_dir
Definition: tiffiop.h:135
#define TIFFTAG_GROUP4OPTIONS
Definition: tiff.h:259
#define TIFFTAG_PREDICTOR
Definition: tiff.h:278
#define COMPRESSION_ZSTD
Definition: tiff.h:193
uint16 td_compression
Definition: tif_dir.h:76
#define COMPRESSION_LZW
Definition: tiff.h:164
#define TIFFTAG_CLEANFAXDATA
Definition: tiff.h:291
#define TIFFTAG_JPEGRESTARTINTERVAL
Definition: tiff.h:360
#define COMPRESSION_NEXT
Definition: tiff.h:169

Referenced by TIFFReadDirectory().

◆ _TIFFCreateAnonField()

TIFFField* _TIFFCreateAnonField ( TIFF tif,
uint32  tag,
TIFFDataType  field_type 
)

Definition at line 634 of file tif_dirinfo.c.

635 {
636  TIFFField *fld;
637  (void) tif;
638 
639  fld = (TIFFField *) _TIFFmalloc(sizeof (TIFFField));
640  if (fld == NULL)
641  return NULL;
642  _TIFFmemset(fld, 0, sizeof(TIFFField));
643 
644  fld->field_tag = tag;
647  fld->field_type = field_type;
648  fld->reserved = 0;
649  switch (field_type)
650  {
651  case TIFF_BYTE:
652  case TIFF_UNDEFINED:
655  break;
656  case TIFF_ASCII:
659  break;
660  case TIFF_SHORT:
663  break;
664  case TIFF_LONG:
667  break;
668  case TIFF_RATIONAL:
669  case TIFF_SRATIONAL:
670  case TIFF_FLOAT:
673  break;
674  case TIFF_SBYTE:
677  break;
678  case TIFF_SSHORT:
681  break;
682  case TIFF_SLONG:
685  break;
686  case TIFF_DOUBLE:
689  break;
690  case TIFF_IFD:
691  case TIFF_IFD8:
694  break;
695  case TIFF_LONG8:
698  break;
699  case TIFF_SLONG8:
702  break;
703  default:
706  break;
707  }
708  fld->field_bit = FIELD_CUSTOM;
709  fld->field_oktochange = TRUE;
710  fld->field_passcount = TRUE;
711  fld->field_name = (char *) _TIFFmalloc(32);
712  if (fld->field_name == NULL) {
713  _TIFFfree(fld);
714  return NULL;
715  }
716  fld->field_subfields = NULL;
717 
718  /*
719  * note that this name is a special sign to TIFFClose() and
720  * _TIFFSetupFields() to free the field
721  */
722  (void) snprintf(fld->field_name, 32, "Tag %d", (int) tag);
723 
724  return fld;
725 }
void _TIFFmemset(void *p, int v, tmsize_t c)
Definition: tif_unix.c:338
#define TRUE
Definition: types.h:120
#define FIELD_CUSTOM
Definition: tiffio.h:317
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define snprintf
Definition: wintirpc.h:48
TIFFFieldArray * field_subfields
Definition: tif_dir.h:290
unsigned short field_bit
Definition: tif_dir.h:286
char * field_name
Definition: tif_dir.h:289
short field_writecount
Definition: tif_dir.h:281
smooth NULL
Definition: ftsmooth.c:416
void * _TIFFmalloc(tmsize_t s)
Definition: tif_unix.c:309
TIFFSetGetFieldType get_field_type
Definition: tif_dir.h:285
unsigned char field_passcount
Definition: tif_dir.h:288
uint32 field_tag
Definition: tif_dir.h:279
uint32 reserved
Definition: tif_dir.h:283
unsigned char field_oktochange
Definition: tif_dir.h:287
#define TIFF_VARIABLE2
Definition: tiffio.h:315
TIFFDataType field_type
Definition: tif_dir.h:282
TIFFSetGetFieldType set_field_type
Definition: tif_dir.h:284
Definition: tiff.h:137
void _TIFFfree(void *p)
Definition: tif_unix.c:326
short field_readcount
Definition: tif_dir.h:280
char * tag
Definition: main.c:59

Referenced by _TIFFFindOrRegisterField(), TIFFReadCustomDirectory(), and TIFFReadDirectory().

◆ _TIFFDataSize()

int _TIFFDataSize ( TIFFDataType  type)

Definition at line 476 of file tif_dirinfo.c.

477 {
478  switch (type)
479  {
480  case TIFF_BYTE:
481  case TIFF_SBYTE:
482  case TIFF_ASCII:
483  case TIFF_UNDEFINED:
484  return 1;
485  case TIFF_SHORT:
486  case TIFF_SSHORT:
487  return 2;
488  case TIFF_LONG:
489  case TIFF_SLONG:
490  case TIFF_FLOAT:
491  case TIFF_IFD:
492  case TIFF_RATIONAL:
493  case TIFF_SRATIONAL:
494  return 4;
495  case TIFF_DOUBLE:
496  case TIFF_LONG8:
497  case TIFF_SLONG8:
498  case TIFF_IFD8:
499  return 8;
500  default:
501  return 0;
502  }
503 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
Definition: tiff.h:137

Referenced by _TIFFVSetField(), and TIFFPrintDirectory().

◆ _TIFFFindFieldByName()

static const TIFFField* _TIFFFindFieldByName ( TIFF tif,
const char field_name,
TIFFDataType  dt 
)
static

Definition at line 531 of file tif_dirinfo.c.

532 {
533  TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0, 0, 0, NULL, NULL};
534  TIFFField* pkey = &key;
535  const TIFFField **ret;
536  if (tif->tif_foundfield
537  && streq(tif->tif_foundfield->field_name, field_name)
538  && (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type))
539  return (tif->tif_foundfield);
540 
541  /* If we are invoked with no field information, then just return. */
542  if (!tif->tif_fields)
543  return NULL;
544 
545  /* NB: use linear search since list is sorted by key#, not name */
546 
547  key.field_name = (char *)field_name;
548  key.field_type = dt;
549 
550  ret = (const TIFFField **)
551  td_lfind(&pkey, tif->tif_fields, &tif->tif_nfields,
552  sizeof(TIFFField *), tagNameCompare);
553 
554  return tif->tif_foundfield = (ret ? *ret : NULL);
555 }
#define TIFF_ANY
Definition: tiffio.h:312
static int tagNameCompare(const void *a, const void *b)
Definition: tif_dirinfo.c:355
char * field_name
Definition: tif_dir.h:289
#define streq(a, b)
Definition: mkg3states.c:46
smooth NULL
Definition: ftsmooth.c:416
size_t tif_nfields
Definition: tiffiop.h:201
int ret
HKEY key
Definition: reg.c:42
static void * td_lfind(const void *key, const void *base, size_t *nmemb, size_t size, int(*compar)(const void *, const void *))
Definition: tif_dirinfo.c:291
TIFFField ** tif_fields
Definition: tiffiop.h:200
TIFFDataType field_type
Definition: tif_dir.h:282
const TIFFField * tif_foundfield
Definition: tiffiop.h:202
Definition: path.c:42

Referenced by TIFFFieldWithName().

◆ _TIFFFindOrRegisterField()

const TIFFField* _TIFFFindOrRegisterField ( TIFF tif,
uint32  tag,
TIFFDataType  dt 
)

Definition at line 618 of file tif_dirinfo.c.

620 {
621  const TIFFField *fld;
622 
623  fld = TIFFFindField(tif, tag, dt);
624  if (fld == NULL) {
625  fld = _TIFFCreateAnonField(tif, tag, dt);
626  if (!_TIFFMergeFields(tif, fld, 1))
627  return NULL;
628  }
629 
630  return fld;
631 }
TIFFField * _TIFFCreateAnonField(TIFF *tif, uint32 tag, TIFFDataType field_type)
Definition: tif_dirinfo.c:634
Definition: ecma_167.h:138
int _TIFFMergeFields(TIFF *tif, const TIFFField info[], uint32 n)
Definition: tif_dirinfo.c:369
smooth NULL
Definition: ftsmooth.c:416
const TIFFField * TIFFFindField(TIFF *tif, uint32 tag, TIFFDataType dt)
Definition: tif_dirinfo.c:506

◆ _TIFFGetExifFields()

const TIFFFieldArray* _TIFFGetExifFields ( void  )

Definition at line 311 of file tif_dirinfo.c.

312 {
313  return(&exifFieldArray);
314 }
static const TIFFFieldArray exifFieldArray
Definition: tif_dirinfo.c:49

Referenced by TIFFCreateEXIFDirectory(), and TIFFReadEXIFDirectory().

◆ _TIFFGetFields()

const TIFFFieldArray* _TIFFGetFields ( void  )

Definition at line 305 of file tif_dirinfo.c.

306 {
307  return(&tiffFieldArray);
308 }
static const TIFFFieldArray tiffFieldArray
Definition: tif_dirinfo.c:48

Referenced by TIFFDefaultDirectory().

◆ _TIFFMergeFields()

int _TIFFMergeFields ( TIFF tif,
const TIFFField  info[],
uint32  n 
)

Definition at line 369 of file tif_dirinfo.c.

370 {
371  static const char module[] = "_TIFFMergeFields";
372  static const char reason[] = "for fields array";
373  /* TIFFField** tp; */
374  uint32 i;
375 
376  tif->tif_foundfield = NULL;
377 
378  if (tif->tif_fields && tif->tif_nfields > 0) {
379  tif->tif_fields = (TIFFField**)
380  _TIFFCheckRealloc(tif, tif->tif_fields,
381  (tif->tif_nfields + n),
382  sizeof(TIFFField *), reason);
383  } else {
384  tif->tif_fields = (TIFFField **)
385  _TIFFCheckMalloc(tif, n, sizeof(TIFFField *),
386  reason);
387  }
388  if (!tif->tif_fields) {
390  "Failed to allocate fields array");
391  return 0;
392  }
393 
394  /* tp = tif->tif_fields + tif->tif_nfields; */
395  for (i = 0; i < n; i++) {
396  const TIFFField *fip =
397  TIFFFindField(tif, info[i].field_tag, TIFF_ANY);
398 
399  /* only add definitions that aren't already present */
400  if (!fip) {
401  tif->tif_fields[tif->tif_nfields] = (TIFFField *) (info+i);
402  tif->tif_nfields++;
403  }
404  }
405 
406  /* Sort the field info by tag number */
407  qsort(tif->tif_fields, tif->tif_nfields,
408  sizeof(TIFFField *), tagCompare);
409 
410  return n;
411 }
#define TIFF_ANY
Definition: tiffio.h:312
void * _TIFFCheckRealloc(TIFF *tif, void *buffer, tmsize_t nmemb, tmsize_t elem_size, const char *what)
Definition: tif_aux.c:62
unsigned int uint32
Definition: types.h:32
GLdouble n
Definition: glext.h:7729
thandle_t tif_clientdata
Definition: tiffiop.h:191
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
void __cdecl qsort(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ int(__cdecl *_PtFuncCompare)(const void *, const void *))
void * _TIFFCheckMalloc(TIFF *tif, tmsize_t nmemb, tmsize_t elem_size, const char *what)
Definition: tif_aux.c:85
smooth NULL
Definition: ftsmooth.c:416
size_t tif_nfields
Definition: tiffiop.h:201
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
TIFFField ** tif_fields
Definition: tiffiop.h:200
const TIFFField * TIFFFindField(TIFF *tif, uint32 tag, TIFFDataType dt)
Definition: tif_dirinfo.c:506
const TIFFField * tif_foundfield
Definition: tiffiop.h:202
static int tagCompare(const void *a, const void *b)
Definition: tif_dirinfo.c:342

Referenced by _TIFFFindOrRegisterField(), _TIFFSetupFields(), TIFFMergeFieldInfo(), TIFFPredictorInit(), TIFFReadCustomDirectory(), and TIFFReadDirectory().

◆ _TIFFPrintFieldInfo()

void _TIFFPrintFieldInfo ( TIFF tif,
FILE fd 
)

Definition at line 414 of file tif_dirinfo.c.

415 {
416  uint32 i;
417 
418  fprintf(fd, "%s: \n", tif->tif_name);
419  for (i = 0; i < tif->tif_nfields; i++) {
420  const TIFFField* fip = tif->tif_fields[i];
421  fprintf(fd, "field[%2d] %5lu, %2d, %2d, %d, %2d, %5s, %5s, %s\n"
422  , (int)i
423  , (unsigned long) fip->field_tag
424  , fip->field_readcount, fip->field_writecount
425  , fip->field_type
426  , fip->field_bit
427  , fip->field_oktochange ? "TRUE" : "FALSE"
428  , fip->field_passcount ? "TRUE" : "FALSE"
429  , fip->field_name
430  );
431  }
432 }
unsigned int uint32
Definition: types.h:32
static int fd
Definition: io.c:51
char * tif_name
Definition: tiffiop.h:103
unsigned short field_bit
Definition: tif_dir.h:286
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
char * field_name
Definition: tif_dir.h:289
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
short field_writecount
Definition: tif_dir.h:281
size_t tif_nfields
Definition: tiffiop.h:201
unsigned char field_passcount
Definition: tif_dir.h:288
uint32 field_tag
Definition: tif_dir.h:279
unsigned char field_oktochange
Definition: tif_dir.h:287
TIFFField ** tif_fields
Definition: tiffiop.h:200
TIFFDataType field_type
Definition: tif_dir.h:282
short field_readcount
Definition: tif_dir.h:280

◆ _TIFFSetGetType()

static TIFFSetGetFieldType _TIFFSetGetType ( TIFFDataType  type,
short  count,
unsigned char  passcount 
)
static

Definition at line 735 of file tif_dirinfo.c.

736 {
737  if (type == TIFF_ASCII && count == TIFF_VARIABLE && passcount == 0)
738  return TIFF_SETGET_ASCII;
739 
740  else if (count == 1 && passcount == 0) {
741  switch (type)
742  {
743  case TIFF_BYTE:
744  case TIFF_UNDEFINED:
745  return TIFF_SETGET_UINT8;
746  case TIFF_ASCII:
747  return TIFF_SETGET_ASCII;
748  case TIFF_SHORT:
749  return TIFF_SETGET_UINT16;
750  case TIFF_LONG:
751  return TIFF_SETGET_UINT32;
752  case TIFF_RATIONAL:
753  case TIFF_SRATIONAL:
754  case TIFF_FLOAT:
755  return TIFF_SETGET_FLOAT;
756  case TIFF_SBYTE:
757  return TIFF_SETGET_SINT8;
758  case TIFF_SSHORT:
759  return TIFF_SETGET_SINT16;
760  case TIFF_SLONG:
761  return TIFF_SETGET_SINT32;
762  case TIFF_DOUBLE:
763  return TIFF_SETGET_DOUBLE;
764  case TIFF_IFD:
765  case TIFF_IFD8:
766  return TIFF_SETGET_IFD8;
767  case TIFF_LONG8:
768  return TIFF_SETGET_UINT64;
769  case TIFF_SLONG8:
770  return TIFF_SETGET_SINT64;
771  default:
772  return TIFF_SETGET_UNDEFINED;
773  }
774  }
775 
776  else if (count >= 1 && passcount == 0) {
777  switch (type)
778  {
779  case TIFF_BYTE:
780  case TIFF_UNDEFINED:
781  return TIFF_SETGET_C0_UINT8;
782  case TIFF_ASCII:
783  return TIFF_SETGET_C0_ASCII;
784  case TIFF_SHORT:
785  return TIFF_SETGET_C0_UINT16;
786  case TIFF_LONG:
787  return TIFF_SETGET_C0_UINT32;
788  case TIFF_RATIONAL:
789  case TIFF_SRATIONAL:
790  case TIFF_FLOAT:
791  return TIFF_SETGET_C0_FLOAT;
792  case TIFF_SBYTE:
793  return TIFF_SETGET_C0_SINT8;
794  case TIFF_SSHORT:
795  return TIFF_SETGET_C0_SINT16;
796  case TIFF_SLONG:
797  return TIFF_SETGET_C0_SINT32;
798  case TIFF_DOUBLE:
799  return TIFF_SETGET_C0_DOUBLE;
800  case TIFF_IFD:
801  case TIFF_IFD8:
802  return TIFF_SETGET_C0_IFD8;
803  case TIFF_LONG8:
804  return TIFF_SETGET_C0_UINT64;
805  case TIFF_SLONG8:
806  return TIFF_SETGET_C0_SINT64;
807  default:
808  return TIFF_SETGET_UNDEFINED;
809  }
810  }
811 
812  else if (count == TIFF_VARIABLE && passcount == 1) {
813  switch (type)
814  {
815  case TIFF_BYTE:
816  case TIFF_UNDEFINED:
817  return TIFF_SETGET_C16_UINT8;
818  case TIFF_ASCII:
819  return TIFF_SETGET_C16_ASCII;
820  case TIFF_SHORT:
821  return TIFF_SETGET_C16_UINT16;
822  case TIFF_LONG:
823  return TIFF_SETGET_C16_UINT32;
824  case TIFF_RATIONAL:
825  case TIFF_SRATIONAL:
826  case TIFF_FLOAT:
827  return TIFF_SETGET_C16_FLOAT;
828  case TIFF_SBYTE:
829  return TIFF_SETGET_C16_SINT8;
830  case TIFF_SSHORT:
831  return TIFF_SETGET_C16_SINT16;
832  case TIFF_SLONG:
833  return TIFF_SETGET_C16_SINT32;
834  case TIFF_DOUBLE:
835  return TIFF_SETGET_C16_DOUBLE;
836  case TIFF_IFD:
837  case TIFF_IFD8:
838  return TIFF_SETGET_C16_IFD8;
839  case TIFF_LONG8:
840  return TIFF_SETGET_C16_UINT64;
841  case TIFF_SLONG8:
842  return TIFF_SETGET_C16_SINT64;
843  default:
844  return TIFF_SETGET_UNDEFINED;
845  }
846  }
847 
848  else if (count == TIFF_VARIABLE2 && passcount == 1) {
849  switch (type)
850  {
851  case TIFF_BYTE:
852  case TIFF_UNDEFINED:
853  return TIFF_SETGET_C32_UINT8;
854  case TIFF_ASCII:
855  return TIFF_SETGET_C32_ASCII;
856  case TIFF_SHORT:
857  return TIFF_SETGET_C32_UINT16;
858  case TIFF_LONG:
859  return TIFF_SETGET_C32_UINT32;
860  case TIFF_RATIONAL:
861  case TIFF_SRATIONAL:
862  case TIFF_FLOAT:
863  return TIFF_SETGET_C32_FLOAT;
864  case TIFF_SBYTE:
865  return TIFF_SETGET_C32_SINT8;
866  case TIFF_SSHORT:
867  return TIFF_SETGET_C32_SINT16;
868  case TIFF_SLONG:
869  return TIFF_SETGET_C32_SINT32;
870  case TIFF_DOUBLE:
871  return TIFF_SETGET_C32_DOUBLE;
872  case TIFF_IFD:
873  case TIFF_IFD8:
874  return TIFF_SETGET_C32_IFD8;
875  case TIFF_LONG8:
876  return TIFF_SETGET_C32_UINT64;
877  case TIFF_SLONG8:
878  return TIFF_SETGET_C32_SINT64;
879  default:
880  return TIFF_SETGET_UNDEFINED;
881  }
882  }
883 
884  return TIFF_SETGET_UNDEFINED;
885 }
#define TIFF_VARIABLE
Definition: tiffio.h:313
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define TIFF_VARIABLE2
Definition: tiffio.h:315
Definition: tiff.h:137

Referenced by TIFFMergeFieldInfo().

◆ _TIFFSetupFields()

void _TIFFSetupFields ( TIFF tif,
const TIFFFieldArray fieldarray 
)

Definition at line 317 of file tif_dirinfo.c.

318 {
319  if (tif->tif_fields && tif->tif_nfields > 0) {
320  uint32 i;
321 
322  for (i = 0; i < tif->tif_nfields; i++) {
323  TIFFField *fld = tif->tif_fields[i];
324  if (fld->field_bit == FIELD_CUSTOM &&
325  strncmp("Tag ", fld->field_name, 4) == 0) {
326  _TIFFfree(fld->field_name);
327  _TIFFfree(fld);
328  }
329  }
330 
331  _TIFFfree(tif->tif_fields);
332  tif->tif_fields = NULL;
333  tif->tif_nfields = 0;
334  }
335  if (!_TIFFMergeFields(tif, fieldarray->fields, fieldarray->count)) {
336  TIFFErrorExt(tif->tif_clientdata, "_TIFFSetupFields",
337  "Setting up field info failed");
338  }
339 }
#define FIELD_CUSTOM
Definition: tiffio.h:317
unsigned int uint32
Definition: types.h:32
thandle_t tif_clientdata
Definition: tiffiop.h:191
unsigned short field_bit
Definition: tif_dir.h:286
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
char * field_name
Definition: tif_dir.h:289
int _TIFFMergeFields(TIFF *tif, const TIFFField info[], uint32 n)
Definition: tif_dirinfo.c:369
smooth NULL
Definition: ftsmooth.c:416
size_t tif_nfields
Definition: tiffiop.h:201
TIFFField * fields
Definition: tif_dir.h:275
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
uint32 count
Definition: tif_dir.h:274
TIFFField ** tif_fields
Definition: tiffiop.h:200
void _TIFFfree(void *p)
Definition: tif_unix.c:326

Referenced by TIFFCreateCustomDirectory(), TIFFDefaultDirectory(), and TIFFReadCustomDirectory().

◆ tagCompare()

static int tagCompare ( const void a,
const void b 
)
static

Definition at line 342 of file tif_dirinfo.c.

343 {
344  const TIFFField* ta = *(const TIFFField**) a;
345  const TIFFField* tb = *(const TIFFField**) b;
346  /* NB: be careful of return values for 16-bit platforms */
347  if (ta->field_tag != tb->field_tag)
348  return (int)ta->field_tag - (int)tb->field_tag;
349  else
350  return (ta->field_type == TIFF_ANY) ?
351  0 : ((int)tb->field_type - (int)ta->field_type);
352 }
return
Definition: dirsup.c:529
#define TIFF_ANY
Definition: tiffio.h:312
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
uint32 field_tag
Definition: tif_dir.h:279
static const WCHAR tb[]
Definition: suminfo.c:286
TIFFDataType field_type
Definition: tif_dir.h:282
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by _TIFFMergeFields(), and TIFFFindField().

◆ tagNameCompare()

static int tagNameCompare ( const void a,
const void b 
)
static

Definition at line 355 of file tif_dirinfo.c.

356 {
357  const TIFFField* ta = *(const TIFFField**) a;
358  const TIFFField* tb = *(const TIFFField**) b;
359  int ret = strcmp(ta->field_name, tb->field_name);
360 
361  if (ret)
362  return ret;
363  else
364  return (ta->field_type == TIFF_ANY) ?
365  0 : ((int)tb->field_type - (int)ta->field_type);
366 }
#define TIFF_ANY
Definition: tiffio.h:312
char * field_name
Definition: tif_dir.h:289
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
static const WCHAR tb[]
Definition: suminfo.c:286
int ret
TIFFDataType field_type
Definition: tif_dir.h:282
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31

Referenced by _TIFFFindFieldByName().

◆ td_lfind()

static void* td_lfind ( const void key,
const void base,
size_t nmemb,
size_t  size,
int(*)(const void *, const void *)  compar 
)
static

Definition at line 291 of file tif_dirinfo.c.

293 {
294  char *element, *end;
295 
296  end = (char *)base + *nmemb * size;
297  for (element = (char *)base; element < end; element += size)
298  if (!compar(key, element)) /* key found */
299  return element;
300 
301  return NULL;
302 }
GLuint GLuint end
Definition: gl.h:1545
GLuint base
Definition: 3dtext.c:35
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
Definition: path.c:42

Referenced by _TIFFFindFieldByName().

◆ TIFFDataWidth()

int TIFFDataWidth ( TIFFDataType  type)

Definition at line 438 of file tif_dirinfo.c.

439 {
440  switch(type)
441  {
442  case 0: /* nothing */
443  case TIFF_BYTE:
444  case TIFF_ASCII:
445  case TIFF_SBYTE:
446  case TIFF_UNDEFINED:
447  return 1;
448  case TIFF_SHORT:
449  case TIFF_SSHORT:
450  return 2;
451  case TIFF_LONG:
452  case TIFF_SLONG:
453  case TIFF_FLOAT:
454  case TIFF_IFD:
455  return 4;
456  case TIFF_RATIONAL:
457  case TIFF_SRATIONAL:
458  case TIFF_DOUBLE:
459  case TIFF_LONG8:
460  case TIFF_SLONG8:
461  case TIFF_IFD8:
462  return 8;
463  default:
464  return 0; /* will return 0 for unknown types */
465  }
466 }
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
Definition: tiff.h:137

Referenced by _TIFFRewriteField(), EstimateStripByteCounts(), and TIFFReadDirEntryArrayWithLimit().

◆ TIFFFieldDataType()

TIFFDataType TIFFFieldDataType ( const TIFFField fip)

Definition at line 594 of file tif_dirinfo.c.

595 {
596  return fip->field_type;
597 }
TIFFDataType field_type
Definition: tif_dir.h:282

◆ TIFFFieldName()

const char* TIFFFieldName ( const TIFFField fip)

Definition at line 588 of file tif_dirinfo.c.

589 {
590  return fip->field_name;
591 }
char * field_name
Definition: tif_dir.h:289

◆ TIFFFieldPassCount()

int TIFFFieldPassCount ( const TIFFField fip)

Definition at line 600 of file tif_dirinfo.c.

601 {
602  return fip->field_passcount;
603 }
unsigned char field_passcount
Definition: tif_dir.h:288

◆ TIFFFieldReadCount()

int TIFFFieldReadCount ( const TIFFField fip)

Definition at line 606 of file tif_dirinfo.c.

607 {
608  return fip->field_readcount;
609 }
short field_readcount
Definition: tif_dir.h:280

◆ TIFFFieldTag()

uint32 TIFFFieldTag ( const TIFFField fip)

Definition at line 582 of file tif_dirinfo.c.

583 {
584  return fip->field_tag;
585 }
uint32 field_tag
Definition: tif_dir.h:279

Referenced by TIFFWriteDirectorySec().

◆ TIFFFieldWithName()

const TIFFField* TIFFFieldWithName ( TIFF tif,
const char field_name 
)

Definition at line 570 of file tif_dirinfo.c.

571 {
572  const TIFFField* fip =
573  _TIFFFindFieldByName(tif, field_name, TIFF_ANY);
574  if (!fip) {
575  TIFFErrorExt(tif->tif_clientdata, "TIFFFieldWithName",
576  "Internal error, unknown tag %s", field_name);
577  }
578  return (fip);
579 }
static const TIFFField * _TIFFFindFieldByName(TIFF *tif, const char *field_name, TIFFDataType dt)
Definition: tif_dirinfo.c:531
#define TIFF_ANY
Definition: tiffio.h:312
thandle_t tif_clientdata
Definition: tiffiop.h:191
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65

◆ TIFFFieldWithTag()

const TIFFField* TIFFFieldWithTag ( TIFF tif,
uint32  tag 
)

Definition at line 558 of file tif_dirinfo.c.

559 {
560  const TIFFField* fip = TIFFFindField(tif, tag, TIFF_ANY);
561  if (!fip) {
562  TIFFErrorExt(tif->tif_clientdata, "TIFFFieldWithTag",
563  "Internal error, unknown tag 0x%x",
564  (unsigned int) tag);
565  }
566  return (fip);
567 }
#define TIFF_ANY
Definition: tiffio.h:312
Definition: ecma_167.h:138
thandle_t tif_clientdata
Definition: tiffiop.h:191
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
const TIFFField * TIFFFindField(TIFF *tif, uint32 tag, TIFFDataType dt)
Definition: tif_dirinfo.c:506

Referenced by _TIFFVSetField(), CheckDirCount(), TIFFFetchStripThing(), TIFFPrintDirectory(), TIFFReadDirectory(), and TIFFUnsetField().

◆ TIFFFieldWriteCount()

int TIFFFieldWriteCount ( const TIFFField fip)

Definition at line 612 of file tif_dirinfo.c.

613 {
614  return fip->field_writecount;
615 }
short field_writecount
Definition: tif_dir.h:281

◆ TIFFFindField()

const TIFFField* TIFFFindField ( TIFF tif,
uint32  tag,
TIFFDataType  dt 
)

Definition at line 506 of file tif_dirinfo.c.

507 {
508  TIFFField key = {0, 0, 0, TIFF_NOTYPE, 0, 0, 0, 0, 0, 0, NULL, NULL};
509  TIFFField* pkey = &key;
510  const TIFFField **ret;
511  if (tif->tif_foundfield && tif->tif_foundfield->field_tag == tag &&
512  (dt == TIFF_ANY || dt == tif->tif_foundfield->field_type))
513  return tif->tif_foundfield;
514 
515  /* If we are invoked with no field information, then just return. */
516  if (!tif->tif_fields)
517  return NULL;
518 
519  /* NB: use sorted search (e.g. binary search) */
520 
521  key.field_tag = tag;
522  key.field_type = dt;
523 
524  ret = (const TIFFField **) bsearch(&pkey, tif->tif_fields,
525  tif->tif_nfields,
526  sizeof(TIFFField *), tagCompare);
527  return tif->tif_foundfield = (ret ? *ret : NULL);
528 }
#define TIFF_ANY
Definition: tiffio.h:312
Definition: ecma_167.h:138
smooth NULL
Definition: ftsmooth.c:416
size_t tif_nfields
Definition: tiffiop.h:201
uint32 field_tag
Definition: tif_dir.h:279
int ret
HKEY key
Definition: reg.c:42
TIFFField ** tif_fields
Definition: tiffiop.h:200
TIFFDataType field_type
Definition: tif_dir.h:282
const TIFFField * tif_foundfield
Definition: tiffiop.h:202
static int tagCompare(const void *a, const void *b)
Definition: tif_dirinfo.c:342
Definition: path.c:42
#define bsearch
char * tag
Definition: main.c:59

Referenced by _TIFFFindOrRegisterField(), _TIFFMergeFields(), _TIFFRewriteField(), _TIFFVGetField(), _TIFFVSetField(), OkToChangeTag(), TIFFFieldWithTag(), and TIFFVGetField().

◆ TIFFMergeFieldInfo()

int TIFFMergeFieldInfo ( TIFF tif,
const TIFFFieldInfo  info[],
uint32  n 
)

Definition at line 888 of file tif_dirinfo.c.

889 {
890  static const char module[] = "TIFFMergeFieldInfo";
891  static const char reason[] = "for fields array";
892  TIFFField *tp;
893  size_t nfields;
894  uint32 i;
895 
896  if (tif->tif_nfieldscompat > 0) {
899  tif->tif_nfieldscompat + 1,
900  sizeof(TIFFFieldArray), reason);
901  } else {
903  _TIFFCheckMalloc(tif, 1, sizeof(TIFFFieldArray),
904  reason);
905  }
906  if (!tif->tif_fieldscompat) {
908  "Failed to allocate fields array");
909  return -1;
910  }
911  nfields = tif->tif_nfieldscompat++;
912 
913  tif->tif_fieldscompat[nfields].type = tfiatOther;
914  tif->tif_fieldscompat[nfields].allocated_size = n;
915  tif->tif_fieldscompat[nfields].count = n;
916  tif->tif_fieldscompat[nfields].fields =
917  (TIFFField *)_TIFFCheckMalloc(tif, n, sizeof(TIFFField),
918  reason);
919  if (!tif->tif_fieldscompat[nfields].fields) {
921  "Failed to allocate fields array");
922  return -1;
923  }
924 
925  tp = tif->tif_fieldscompat[nfields].fields;
926  for (i = 0; i < n; i++) {
927  tp->field_tag = info[i].field_tag;
928  tp->field_readcount = info[i].field_readcount;
929  tp->field_writecount = info[i].field_writecount;
930  tp->field_type = info[i].field_type;
931  tp->reserved = 0;
932  tp->set_field_type =
933  _TIFFSetGetType(info[i].field_type,
934  info[i].field_readcount,
935  info[i].field_passcount);
936  tp->get_field_type =
937  _TIFFSetGetType(info[i].field_type,
938  info[i].field_readcount,
939  info[i].field_passcount);
940  tp->field_bit = info[i].field_bit;
941  tp->field_oktochange = info[i].field_oktochange;
942  tp->field_passcount = info[i].field_passcount;
943  tp->field_name = info[i].field_name;
944  tp->field_subfields = NULL;
945  tp++;
946  }
947 
948  if (!_TIFFMergeFields(tif, tif->tif_fieldscompat[nfields].fields, n)) {
950  "Setting up field info failed");
951  return -1;
952  }
953 
954  return 0;
955 }
void * _TIFFCheckRealloc(TIFF *tif, void *buffer, tmsize_t nmemb, tmsize_t elem_size, const char *what)
Definition: tif_aux.c:62
unsigned int uint32
Definition: types.h:32
static TIFFSetGetFieldType _TIFFSetGetType(TIFFDataType type, short count, unsigned char passcount)
Definition: tif_dirinfo.c:735
GLdouble n
Definition: glext.h:7729
thandle_t tif_clientdata
Definition: tiffiop.h:191
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
void * _TIFFCheckMalloc(TIFF *tif, tmsize_t nmemb, tmsize_t elem_size, const char *what)
Definition: tif_aux.c:85
int _TIFFMergeFields(TIFF *tif, const TIFFField info[], uint32 n)
Definition: tif_dirinfo.c:369
smooth NULL
Definition: ftsmooth.c:416
TIFFFieldArray * tif_fieldscompat
Definition: tiffiop.h:207
uint32 allocated_size
Definition: tif_dir.h:273
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2855
TIFFField * fields
Definition: tif_dir.h:275
void TIFFErrorExt(thandle_t fd, const char *module, const char *fmt,...)
Definition: tif_error.c:65
TIFFFieldArrayType type
Definition: tif_dir.h:272
uint32 count
Definition: tif_dir.h:274
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
size_t tif_nfieldscompat
Definition: tiffiop.h:208

Variable Documentation

◆ exifFieldArray

static const TIFFFieldArray exifFieldArray = { tfiatExif, 0, TIFFArrayCount(exifFields), (TIFFField*) exifFields }
static

◆ exifFields

const TIFFField exifFields[]
static

Definition at line 221 of file tif_dirinfo.c.

◆ tiffFieldArray

static const TIFFFieldArray tiffFieldArray = { tfiatImage, 0, TIFFArrayCount(tiffFields), (TIFFField*) tiffFields }
static

Definition at line 48 of file tif_dirinfo.c.

Referenced by _TIFFGetFields(), and TIFFDefaultDirectory().

◆ tiffFields

const TIFFField tiffFields[]
static

Definition at line 55 of file tif_dirinfo.c.