home *** CD-ROM | disk | FTP | other *** search
Wrap
B.1NCSA HDF Calling Interfaces and Utilities Header FilesB.1 National Center for Supercomputing Applications November 1989 November 1989 Appendix BHeader Files This appendix includes the general header files used in compiling all HDF libraries. These files do not have to be included with most applications, but they could be usefully added to code that refers to specific tags by name, or code that is designed to be responsive to different error conditions. You get these files when you get the HDF source code. You will see that the C header (df.h) shown in Figure B.2 is more completely commented than the FORTRAN header () shown in Figure B.1. Thus, you may want to look at the C header for explanations of some definitions, even if you plan to use the #define statements from the FORTRAN header. Other headers used for specific applications, such as the RIS interface and the SDS interface can be found by obtaining the source code from NCSA. These headers also do not normally have to be included with your source code. Figure B.1 FORTRAN Header File: dfF.h /***************************************************************************** * * NCSA HDF version 2.0 *December 20, 1988 * * NCSA HDF Version 2.0 source code and documentation are in the public domain. * Specifically, we give to the public domain all rights for future licensing * of the source code, all resale rights, and all publishing rights. * * We ask, but do not require, that the following message be included in all * derived works: * * Portions developed at the National Center for Supercomputing Applications at * the University of Illinois at Urbana-Champaign. * * THE UNIVERSITY OF ILLINOIS GIVES NO WARRANTY, EXPRESSED OR IMPLIED, FOR THE * SOFTWARE AND/OR DOCUMENTATION PROVIDED, INCLUDING, WITHOUT LIMITATION, * WARRANTY OF MERCHANTABILITY AND WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE * *****************************************************************************/ C *----------------------------------------------------------------------------- C * File: dfF.h C * Purpose:Fortran header file for HDF routines C * Contents: C *Tag definitions C * Error return codes C *Logical constants C * Remarks: This file can be included with user programs C *----------------------------------------------------------------------------* #ifndef DFTAG_NULL #defineDFREF_WILDCARD 0 #defineDFTAG_WILDCARD 0 #defineDFTAG_NULL1 #defineDFTAG_FID100 #defineDFTAG_FD101 #defineDFTAG_TID102 #defineDFTAG_TD103 #defineDFTAG_DIL104 #defineDFTAG_DIA105 #defineDFTAG_NT106 #defineDFTAG_MT107 #defineDFTAG_ID8200 #defineDFTAG_IP8201 #defineDFTAG_RI8202 #defineDFTAG_CI8203 #defineDFTAG_II8204 #defineDFTAG_ID300 #defineDFTAG_LUT301 #defineDFTAG_RI302 #defineDFTAG_CI303 #defineDFTAG_RIG306 #defineDFTAG_LD307 #defineDFTAG_MD308 #defineDFTAG_MA309 Figure B.1 FORTRAN Header File: dfF.h (Continued) #defineDFTAG_CCN310 #defineDFTAG_CFM311 #defineDFTAG_AR312 #defineDFTAG_DRAW400 #defineDFTAG_RUN401 #defineDFTAG_XYP500 #defineDFTAG_MTO501 #defineDFTAG_T14602 #defineDFTAG_T105603 #defineDFTAG_RLE11 #defineDFTAG_IMCOMP 12 C Error Return Codes #defineDFE_NOERROR0 #defineDFE_FNF-1 #defineDFE_DENIED-2 #defineDFE_ALROPEN-3 #defineDFE_TOOMANY-4 #defineDFE_BADNAME-5 #defineDFE_BADACC-6 #defineDFE_NOTOPEN-8 #defineDFE_CANTCLOSE-9 #defineDFE_DFNULL-10 #defineDFE_ILLTYPE-11 #defineDFE_UNSUPPORTED-12 #defineDFE_BADDDLIST-13 #defineDFE_NOTDFFILE-14 #defineDFE_SEEDTWICE-15 #defineDFE_NOSPACE-16 #defineDFE_READERROR-18 #defineDFE_WRITEERROR-19 #defineDFE_SEEKERROR-20 #defineDFE_NOFREEDD-21 #defineDFE_BADTAG-22 #defineDFE_BADREF-23 #defineDFE_RDONLY-24 #defineDFE_BADCALL-25 #defineDFE_BADPTR-26 #defineDFE_BADLEN-27 #defineDFE_BADSEEK-28 #defineDFE_NOMATCH-29 #defineDFE_NOTINSET-30 #defineDFE_BADDIM-31 #defineDFE_BADOFFSET-32 #defineDFE_BADSCHEME-33 #defineDFE_NODIM-34 #defineDFE_NOTENOUGH-35 CLogical Constants #defineDFACC_READ1 #defineDFACC_WRITE2 #defineDFACC_CREATE4 #defineDFACC_ALL7 #endif DFTAG_NULL Figure B.2 C Header File: df.h /***************************************************************************** * * NCSA HDF version 2.0 *December 20, 1988 * * NCSA HDF Version 2.0 source code and documentation are in the public domain. * Specifically, we give to the public domain all rights for future licensing * of the source code, all resale rights, and all publishing rights. * * We ask, but do not require, that the following message be included in all * derived works: * * Portions developed at the National Center for Supercomputing Applications at * the University of Illinois at Urbana-Champaign. * * * THE UNIVERSITY OF ILLINOIS GIVES NO WARRANTY, EXPRESSED OR IMPLIED, FOR THE * SOFTWARE AND/OR DOCUMENTATION PROVIDED, INCLUDING, WITHOUT LIMITATION, * WARRANTY OF MERCHANTABILITY AND WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE * *****************************************************************************/ /*------------------------------------------------------------------------------ * File: df.h * Purpose:header file for HDF routines * Invokes:dfi.h * Contents: *Structure definitions: DFddh, DFdd, DFdesc, DFdle, DF, DFdi, DFdata *Procedure type definitions *Global variables *Tag definitions * Error return codes *Logical constants * Remarks: This file is included with user programs *Since it includes stdio.h etc., do not include these after df.h *----------------------------------------------------------------------------*/ #ifndef DFTAG_NULL/* avoid re-inclusion */ /* include DF (internal) header information */ #include "dfi.h" /*--------------------------------------------------------------------------*/ /*Type declarations */ typedef struct DFddh {/* format of data descriptor headers as in file */ int16 dds;/* number of dds in header block */ int32 next;/* offset of next header block */ } DFddh; typedef struct uint16 tag,/* data tag */ ref;/* data reference number */ int32 offset,/* offset of data element in file */ length;/* number of bytes */ } DFdd; Figure B.2 C Header File: df.h (Continued) /* descriptor strucdure is same as dd structure. ###Note: may be changed */ #defineDFdescDFdd /* DLE is the internal structure that stores data descriptor information */ /* It is a linked list of DDs */ typedef struct DFdle {/* Data List element */ struct DFdle *next;/* link to next dle */ DFddh ddh;/* To store headers */ DFdd dd[1];/* dummy size */ } DFdle; /* DF is the internal structure associated with each DF file */ /* It holds information associated with the file as a whole */ /* ### Note: there are hooks for having multiple DF files open at a time */ typedef struct DF { DFdle *list,/* Pointer to the DLE list */ *last_dle;/* last_dle and last_dd are used in searches to indicate element returned by previous call to DFfind */ int type,/* 0= not in use, 1= normal, -1 = multiple */ /* this is a hook for when multiple files are open */ access,/* permitted access types: 0=none, 1=r, 2=w, 3=r/w */ changed, /* True if anything in DDs modified since last write */ last_tag,/* Last tag searched for by DFfind */ last_ref,/* Last reference number searched for */ last_dd,/* see last_dle */ defdds,/* default number of DD's in each block */ up_access;/* access permissions to element being read/updated */ /* Used by DFstart */ DFdd *up_dd;/* DD of element being read/updated, used by DFstart */ /* file handle is a file pointer or file descriptor */ /* depending whether we use buffered or unbuffered i/o */ #ifdef DF_BUFFIO FILE */* file pointer */ #else DF_BUFFIO int/* file descriptor */ #endif DF_BUFFIO file;/* File handle for real file */ } DF; typedef struct DFdi {/* data identifier: specifies data element uniquely */ uint16 tag; uint16 ref; } DFdi; typedef struct DFdata {/* structure for returning status information */ int version;/* version number of program */ } DFdata; Figure B.2 C Header File: df.h (Continued) /*--------------------------------------------------------------------------*/ /*Procedure types */ DF *DFopen(); int32 DFgetelement(); int32 DFread(); int32 DFseek(); int32 DFwrite(); /*--------------------------------------------------------------------------*/ /*Global Variables */ #ifndef DFMASTER extern #endif DFMASTER int DFerror;/* Error code for DF routines */ /*--------------------------------------------------------------------------*/ /*Tag Definitions */ #defineDFREF_WILDCARD 0/* wildcard ref for searches */ #defineDFTAG_WILDCARD 0/* wildcard tag for searches */ #defineDFTAG_NULL1/* empty DD */ /* utility set */ #defineDFTAG_FID100/* File identifier */ #defineDFTAG_FD101/* File description */ #defineDFTAG_TID102/* Tag identifier */ #defineDFTAG_TD103/* Tag descriptor */ #defineDFTAG_DIL104/* data identifier label */ #defineDFTAG_DIA105/* data identifier annotation */ #defineDFTAG_NT106/* number type */ #defineDFTAG_MT107/* machine type */ /* raster-8 set */ #defineDFTAG_ID8200/* 8-bit Image dimension */ #defineDFTAG_IP8201/* 8-bit Image palette */ #defineDFTAG_RI8202/* Raster-8 image */ #defineDFTAG_CI8203/* RLE compressed 8-bit image */ #defineDFTAG_II8204/* IMCOMP compressed 8-bit image */ /* Raster Image set */ #defineDFTAG_ID300/* Image DimRec */ #defineDFTAG_LUT301/* Image Palette */ #defineDFTAG_RI302/* Raster Image */ #defineDFTAG_CI303/* Compressed Image */ #defineDFTAG_RIG306/* Raster Image Group */ #defineDFTAG_LD307/* Palette DimRec */ #defineDFTAG_MD308/* Matte DimRec */ #defineDFTAG_MA309/* Matte Data */ #defineDFTAG_CCN310/* color correction */ #defineDFTAG_CFM311/* color format */ #defineDFTAG_AR312/* aspect ratio */ #defineDFTAG_DRAW400/* Draw these images in sequence */ #defineDFTAG_RUN401/* run this as a program/script */ Figure B.2 C Header File: df.h (Continued) #defineDFTAG_XYP500/* x-y position */ #defineDFTAG_MTO501/* machine-type override */ /* Tektronix */ #defineDFTAG_T14602/* TEK 4014 data */ #defineDFTAG_T105603/* TEK 4105 data */ /* Scientific Data set */ #defineDFTAG_SDG700/* Scientific Data Group */ #defineDFTAG_SDD701/* Scientific Data DimRec */ #defineDFTAG_SD702/* Scientific Data */ #defineDFTAG_SDS703/* Scales */ #defineDFTAG_SDL704/* Labels */ #defineDFTAG_SDU705/* Units */ #defineDFTAG_SDF706/* Formats */ #defineDFTAG_SDM707/* Max/Min */ #defineDFTAG_SDC708/* Coord sys */ /* compression schemes */ #defineDFTAG_RLE11/* run length encoding */ #defineDFTAG_IMCOMP 12/* IMCOMP compression */ /*--------------------------------------------------------------------------*/ /*Error Return Codes */ #defineDFE_NOERROR0/* No error */ #defineDFE_FNF-1/* File not found error */ #defineDFE_DENIED-2/* Access to file denied */ #defineDFE_ALROPEN-3/* File already open */ #defineDFE_TOOMANY-4/* Too Many DF's or files open */ #defineDFE_BADNAME-5/* Bad file name on open */ #defineDFE_BADACC-6/* Bad file access mode */ #defineDFE_BADOPEN-7/* Other open error */ #defineDFE_NOTOPEN-8/* File can't be closed: it isn't open */ #defineDFE_CANTCLOSE-9/* fclose wouldn't work! */ #defineDFE_DFNULL-10/* DF is a null pointer */ #defineDFE_ILLTYPE-11/* DF has an illegal type: internal error */ #defineDFE_UNSUPPORTED-12/* Feature not currently supported */ #defineDFE_BADDDLIST-13/* No DD list: internal error */ #defineDFE_NOTDFFILE-14/* Not a DF file and it is not 0 length */ #defineDFE_SEEDTWICE-15/* DD list already seeded: internal error */ #defineDFE_NOSPACE-16/* Malloc failed */ #defineDFE_NOSUCHTAG-17/* No such tag in the file: search failed*/ #defineDFE_READERROR-18/* There was a read error */ #defineDFE_WRITEERROR-19/* There was a write error */ #defineDFE_SEEKERROR-20/* There was a seek error */ #defineDFE_NOFREEDD-21/* No free DD's left: internal error */ #defineDFE_BADTAG-22/* illegal WILDCARD tag */ #defineDFE_BADREF-23/* illegal WILDCARD reference # */ #defineDFE_RDONLY-24/* The DF is read only */ #defineDFE_BADCALL-25/* Calls in wrong order */ #defineDFE_BADPTR-26 /* NULL ptr argument */ #defineDFE_BADLEN-27/* negative len specified */ #defineDFE_BADSEEK-28/* Attempt to seek past end of element */ #defineDFE_NOMATCH-29/* No (more) DDs which match specified tag/ref */ #defineDFE_NOTINSET-30/* Warning: Set contained unknown tag: ignored */ #defineDFE_BADDIM-31/* negative or zero dimensions specified */ #defineDFE_BADOFFSET-32/* Illegal offset specified */ #defineDFE_BADSCHEME-33/* Unknown compression scheme specified */ #defineDFE_NODIM-34/* No dimension record associated with image */ #defineDFE_NOTENOUGH-35/* space provided insufficient for size of data Figure B.2 C Header File: df.h (Continued) */ #defineDFE_NOVALS-36/* Values not available */ #defineDFE_CORRUPT-37/* File is corrupted */ #defineDFE_BADCONV-37/* Don't know how to convert data type */ #defineDFE_BADFP-38/* The file contained an illegal floating point no*/ /*--------------------------------------------------------------------------*/ /*Logical Constants */ #defineDFACC_READ1/* Read Access */ #defineDFACC_WRITE2/* Write Access */ #defineDFACC_CREATE4/* force file to be created */ #defineDFACC_ALL7/* logical and of all the above values */ #endif DFTAG_NULL