[Top] [Prev] [Next] [Bottom]

2.5 Header File Information

The "hdf.h" header file must be included in every HDF application program as it contains necessary declarations and definitions as well as prototypes for the HDF API routines. To use these routines, the HDF user must be familiar with the most-commonly used definitions stored in the "hdf.h" file.

2.5.1 File Access Code Definitions

These definitions are passed into API file access routines as parameters. The DFACC_RDONLY and DFACC_CLOBBER definitions exist in the "hdf.h" file to accommodate backward compatibility with applications designed to work with older versions of the HDF API library.

TABLE 2A File Access Code Definitions
Definition Name

Definition Value

Description

DFACC_READ

1

Read access.

DFACC_WRITE

2

Write access.

DFACC_RDWR

3

Read and write access.

DFACC_CREATE

4

File creation access.

DFACC_CLOBBER

4

Same as DFACC_CREATE.

DFACC_RDONLY

1

Same as DFACC_READ.

2.5.2 Data Type Definitions

These definitions are used in comparison expressions to determine the type of an input variable or a value returned by an API function. DFNT_FLOAT, DFNT_DOUBLE, DFNT_UCHAR, and DFNT_CHAR are included in the "hdf.h" file for backward compatibility. These definitions are located in the "hntdefs.h" header file.

TABLE 2B Data Type Definitions
Definition Name

Definition Value

Description

DFNT_CHAR8

4

8-bit character type.

DFNT_CHAR

4

Same as DFNT_CHAR8.

DFNT_UCHAR8

3

8-bit unsigned character type.

DFNT_UCHAR

3

Same as DFNT_UCHAR8.

DFNT_INT8

20

8-bit integer type.

DFNT_UINT8

21

8-bit unsigned integer type.

DFNT_INT16

22

16-bit integer type.

DFNT_UINT16

23

16-bit unsigned integer type.

DFNT_INT32

24

32-bit integer type.

DFNT_UINT32

25

32-bit unsigned integer type.

DFNT_INT64

26

64-bit integer type.

DFNT_UINT64

27

64-bit unsigned integer type.

DFNT_FLOAT32

5

32-bit floating-point type.

DFNT_FLOAT64

6

64-bit floating-point type.

2.5.3 Tag Definitions

These definitions identify the object tags defined and used by the HDF API library. The concept of object tags is introduced in Section 2.3.1 on page 8. Note that, in the tag list that follows in Table 2C, tags can also identify properties of data objects such as raster image compression and pixel interlacing type (these concepts are described in Chapter 6, titled 8-bit Raster Images. (DFR8 API) 8- and 24-raster images and scientific data sets are respectively described in Chapter 6, titled 8-bit Raster Images (DFR8 API), Chapter 7, titled 24-bit Raster Images (DF24 API) and Chapter 3, titled Scientific Data Sets (SD API).

TABLE 2C Tag Definitions
Definition Name

Definition Value

Description

DFTAG_FID

((uint16) 100)

File identifier.

DFTAG_FD

((uint16) 101)

File description.

DFTAG_TID

((uint16) 102)

Tag identifier.

DFTAG_TD

((uint16) 103)

Tag descriptor.

DFTAG_DIL

((uint16) 104)

Data identifier label.

DFTAG_DIA

((uint16) 105)

Data identifier annotation.

DFTAG_NT

((uint16) 106)

Number type.

DFTAG_ID8

((uint16) 200)

8-bit raster image dimension record.

DFTAG_IP8

((uint16) 201)

8-bit raster image palette.

DFTAG_RI8

((uint16) 202)

8-bit raster image data.

DFTAG_CI8

((uint16) 203)

8-bit raster image data - RLE compressed.

DFTAG_II8

((uint16) 204)

8-bit raster image data - IMCOMP compressed.

DFTAG_ID

((uint16) 300)

24-bit raster image dimension record.

DFTAG_LUT

((uint16) 301)

24-bit raster image palette.

DFTAG_RI

((uint16) 302)

24-bit raster image data.

DFTAG_CI

((uint16) 303)

24-bit raster image - compressed.

DFTAG_RIG

((uint16) 306)

Raster image group.

DFTAG_LD

((uint16) 307)

Palette dimension record.

DFTAG_SDG

((uint16) 700)

Scientific data group.

DFTAG_SDD

((uint16) 701)

Scientific data dimension record.

DFTAG_SD

((uint16) 702)

Scientific data group data.

DFTAG_SDS

((uint16) 703)

Scientific data scale.

DFTAG_SDL

((uint16) 704)

Scientific data label.

DFTAG_SDU

((uint16) 705)

Scientific data unit.

DFTAG_NDG

((uint16) 720)

Numeric data group.

DFTAG_CAL

((uint16) 731)

Calibration information.

DFTAG_VG

((uint16) 1965)

Vgroup.

DFTAG_VH

((uint16) 1962)

Vdata header.

DFTAG_VS

((uint16) 1963)

Vdata storage.

DFTAG_RLE

((uint16) 11)

Run-length encoding compression algorithm.

DFTAG_IMCOMP

((uint16) 12)

IMCOMP compression algorithm.

DFTAG_JPEG

((uint16) 13)

JPEG compression algorithm - 24-bit data.

DFTAG_GREYJPEG

((uint16) 14)

JPEG compression algorithm - 8-bit data.

DFIL_PIXEL

((uint16) 0)

Pixel interlacing.

DFIL_LINE

((uint16) 1)

Scan-line interlacing.

DFIL_PLANE

((uint16) 2)

Scan-plane interlacing.

2.5.4 Limit Definitions

These definitions declare the maximum size of specific data object parameters, such as the maximum length of a vdata field or the maximum number of objects in a vgroup. Vdata objects are discussed in Chapter 4, titled Vdatas (VS API), and vgroup objects are described in Chapter 5, titled Vgroups (V API). Except for FIELDNAMELENMAX, these can be safely altered by the HDF user.

TABLE 2D Limit Definitions
Definition Name

Definition Value

Description

FIELDNAMELENMAX

128

Maximum length of a vdata field in bits - 16 characters.

VSNAMELENMAX

64

Maximum length of a vdata name in bytes - 64 characters.

VGNAMELENMAX

64

Maximum length of a vgroup name in bytes - 64 characters.

MAX_VFILE

16

Maximum number of open data files.

MAXNVELT

64

Maximum number of objects in a vgroup.

MAX_ORDER

32000

Maximum order of a vdata field.

MAX_FIELD_SIZE

32000

Maximum length of a field.



[Top] [Prev] [Next] [Bottom]

hdfhelp@ncsa.uiuc.edu
HDF User's Guide - 06/04/97, NCSA HDF Development Group.