home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / hdf / unix / hdf3_2r2.lha / HDF3.2r2 / src / dfsd.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-11-03  |  8.5 KB  |  218 lines

  1. /***************************************************************************
  2. *
  3. *
  4. *                         NCSA HDF version 3.2r2
  5. *                            October 30, 1992
  6. *
  7. * NCSA HDF Version 3.2 source code and documentation are in the public
  8. * domain.  Specifically, we give to the public domain all rights for future
  9. * licensing of the source code, all resale rights, and all publishing rights.
  10. *
  11. * We ask, but do not require, that the following message be included in all
  12. * derived works:
  13. *
  14. * Portions developed at the National Center for Supercomputing Applications at
  15. * the University of Illinois at Urbana-Champaign, in collaboration with the
  16. * Information Technology Institute of Singapore.
  17. *
  18. * THE UNIVERSITY OF ILLINOIS GIVES NO WARRANTY, EXPRESSED OR IMPLIED, FOR THE
  19. * SOFTWARE AND/OR DOCUMENTATION PROVIDED, INCLUDING, WITHOUT LIMITATION,
  20. * WARRANTY OF MERCHANTABILITY AND WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE
  21. *
  22. ****************************************************************************
  23. */
  24.  
  25. /*
  26. $Header: /hdf/hdf/v3.2r2/src/RCS/dfsd.h,v 1.9 1992/10/30 18:36:52 koziol beta koziol $
  27.  
  28. $Log: dfsd.h,v $
  29.  * Revision 1.9  1992/10/30  18:36:52  koziol
  30.  * Fixed casts in a bunch of functions to make the SGI ANSI compiler happy
  31.  *
  32.  * Revision 1.8  1992/10/27  22:18:31  koziol
  33.  * changed prototype for DFSDpre32() to reflect new calling interface
  34.  *
  35.  * Revision 1.7  1992/10/23  19:51:58  koziol
  36.  * Added _HUGE keyword for MS-Windows and MS-DOS compatibility.  On
  37.  * all other machines it gets pre-processed out.  Please use this
  38.  * in all future prototype declarations with pointers in them.
  39.  *
  40.  * Revision 1.6  1992/10/23  00:14:11  koziol
  41.  * Changed all DFIstr*() and DFImem*() calls to HDstr*() and HDmem*() calls
  42.  * #ifdef'd out the macros Jason defined for Hopen, Hclose, etc. for Vsets
  43.  * Replaced Vset VFREESPACE and VGETSPACE calls with actual calls to HDfreespace
  44.  * and HDgetspace
  45.  * Added a MS-Windows lower lower for file I/O (which may not be completely working
  46.  *
  47.  * Revision 1.4  1992/10/12  18:11:51  koziol
  48.  * Updated for v3.2r2 release
  49.  *
  50.  * Revision 1.3  1992/08/31  16:14:52  chouck
  51.  * Added Fortran support for calibration tags
  52.  *
  53.  * Revision 1.2  1992/08/27  22:18:42  chouck
  54.  * Added support for calibration tag reading and writing
  55.  *
  56.  * Revision 1.1  1992/08/25  21:40:44  koziol
  57.  * Initial revision
  58.  *
  59. */
  60. /*-----------------------------------------------------------------------------
  61.  * File:    dfsd.h
  62.  * Purpose: header file for the Scientific Data set
  63.  * Invokes: dfrig.h
  64.  * Contents: 
  65.  *  Structure definitions: DFSsdg
  66.  *  Constant definitions: DFS_MAXLEN
  67.  * Remarks: This is included with user programs which use SDG
  68.  *          Currently defined to be 2-D.  Will later be increased to
  69.  *          multiple dimensions
  70.  *---------------------------------------------------------------------------*/
  71.  
  72. #ifndef DFSDG                       /* avoid re-inclusion */
  73. #define DFSDG
  74.  
  75. #include "hdf.h"
  76.  
  77. #define DFS_MAXLEN 255        /*  Max length of label/unit/format strings */
  78.  
  79. /* include numbertype and aid for 3.2   S. Xu   */
  80. /* structure to hold SDG info */
  81. typedef struct DFSsdg {
  82.     DFdi    data;               /* tag/ref of data in file */
  83.     intn    rank;               /* number of dimensions */
  84.     int32   _HUGE *dimsizes;     /* dimensions of data */
  85.     char    _HUGE *coordsys;
  86.     char    _HUGE *dataluf[3];   /* label/unit/format of data */
  87.     char    _HUGE **dimluf[3];   /* label/unit/format for each dim */
  88.     uint8   _HUGE **dimscales;   /* scales for each dimension */
  89.     uint8   max_min[16];        /* max, min values of data, */
  90.                                 /* currently atmost 8 bytes each */
  91.     int32   numbertype;         /* default is float32      */
  92.     uint8   filenumsubclass;    /* number format in the file, default is IEEE */
  93.     int32   aid;                /* access id     */
  94.     int32   compression;        /* 0 -- not compressed  */
  95.     int32   isndg;              /* 0 -- pure sdg, written by 3.1 else ndg */
  96.     float64 cal, cal_err;       /* calibration multiplier stuff          */
  97.     float64 ioff, ioff_err;     /* calibration offset stuff              */
  98.     int32   cal_type;           /* number type of data after calibration */
  99. } DFSsdg;
  100.  
  101. /* DFnsdgle is the internal structure which stores SDG or NDS and   */
  102. /* related SDG in an HDF file.                        */
  103. /* It is a linked list.                            */
  104.  
  105. typedef struct DFnsdgle   {
  106.     DFdi nsdg;            /* NDG from 3.2 or SDG from 3.1  */
  107.     DFdi sdg;            /* Only special NDF has values in this field */
  108.     struct DFnsdgle *next;
  109. }  DFnsdgle;
  110.  
  111. typedef struct DFnsdg_t_hdr    {
  112.     uint32 size;
  113.     DFnsdgle *nsdg_t;
  114. }  DFnsdg_t_hdr;
  115.  
  116. extern int DFSDgetdims
  117.     PROTO((char _HUGE *filename, intn _HUGE *prank, int32 _HUGE sizes[], intn maxrank));
  118. extern int DFSDgetdatastrs
  119.     PROTO((char _HUGE *label, char _HUGE *unit, char _HUGE *format,char _HUGE *coordsys));
  120. extern int DFSDgetdimstrs
  121.     PROTO((int dim, char _HUGE *label, char _HUGE *unit, char _HUGE *format));
  122. extern int DFSDgetdatalen
  123.     PROTO((int _HUGE *llabel, int _HUGE *lunit, int _HUGE *lformat,int _HUGE *lcoordsys));
  124. extern int DFSDgetdimlen
  125.     PROTO((int dim, int _HUGE *llabel, int _HUGE *lunit, int _HUGE *lformat));
  126. extern int DFSDgetdimscale
  127.     PROTO((int dim, int32 maxsize, void _HUGE *scale));
  128. extern int DFSDgetrange
  129.     PROTO((void _HUGE *pmax, void _HUGE *pmin));
  130. extern int DFSDgetdata
  131.     PROTO((char _HUGE *filename, intn rank, int32 _HUGE maxsizes[], void _HUGE *data));
  132. extern int DFSDsetlengths
  133.     PROTO((int maxlen_label, int maxlen_unit, int maxlen_format,
  134.                 int maxlen_coordsys));
  135. extern int DFSDsetdims
  136.     PROTO((intn rank, int32 _HUGE dimsizes[]));
  137. extern int DFSDsetdatastrs
  138.     PROTO((char _HUGE *label, char _HUGE *unit, char _HUGE *format,char _HUGE *coordsys));
  139. extern int DFSDsetdimstrs
  140.     PROTO((int dim, char _HUGE *label, char _HUGE *unit, char _HUGE *format));
  141. extern int DFSDsetdimscale
  142.     PROTO((int dim, int32 dimsize, void _HUGE *scale));
  143. extern int DFSDsetrange
  144.     PROTO((void _HUGE *maxi, void _HUGE *mini));
  145. extern int DFSDputdata
  146.     PROTO((char _HUGE *filename, intn rank, int32 _HUGE dimsizes[], void _HUGE *data));
  147. extern int DFSDadddata
  148.     PROTO((char _HUGE *filename, intn rank, int32 _HUGE dimsizes[], void _HUGE *data));
  149. extern int DFSDrestart
  150.     PROTO((void));
  151. extern int32 DFSDnumber
  152.     PROTO((char _HUGE *filename));
  153. extern int DFSDclear
  154.     PROTO((void));
  155. extern int DFSDlastref
  156.     PROTO((void));
  157. extern int DFSDreadref
  158.     PROTO((char _HUGE *filename, uint16 ref));
  159. extern int DFSDgetslice
  160.     PROTO((char _HUGE *filename, int32 _HUGE winst[], int32 _HUGE windims[],void _HUGE *data,
  161.                 int32 _HUGE dims[]));
  162. extern int DFSDstartslice
  163.     PROTO((char _HUGE *filename));
  164. extern int DFSDputslice
  165.     PROTO((int32 _HUGE winend[], void _HUGE *data, int32 _HUGE dims[]));
  166. extern int DFSDendslice
  167.     PROTO((void));
  168. extern int DFSDsetNT
  169.     PROTO((int32 numbertype));
  170. extern int DFSDsetorder
  171.     PROTO((int arrayorder));
  172. extern int DFSDgetNT
  173.     PROTO((int32 _HUGE *pnumbertype));
  174. extern intn DFSDpre32
  175.     PROTO((void));
  176. extern int DFSDgetsdg
  177.     PROTO((int32 file_id, uint16 ref, DFSsdg _HUGE *sdg));
  178. extern int DFSDputsdg
  179.     PROTO((int32 file_id, uint16 ref, DFSsdg _HUGE *sdg));
  180. extern int32 DFSDIopen
  181.     PROTO((char _HUGE *filename, int access));
  182. extern int DFSDIsdginfo
  183.     PROTO((int32 file_id));
  184. extern int DFSDIclear
  185.     PROTO((DFSsdg _HUGE *sdg));
  186. extern int DFSDIclearNT
  187.     PROTO((DFSsdg _HUGE *sdg));
  188. extern int DFSDIgetdata
  189.     PROTO((char _HUGE *filename, intn rank, int32 _HUGE maxsizes[], void _HUGE *data,
  190.                 int isfortran));
  191. extern int DFSDIputdata
  192.     PROTO((char _HUGE *filename, intn rank, int32 _HUGE *dimsizes, void _HUGE *data,
  193.                 int accmode, int isfortran));
  194. extern int DFSDIgetslice
  195.     PROTO((char _HUGE *filename, int32 _HUGE winst[], int32 _HUGE windims[], void _HUGE *data,
  196.                 int32 _HUGE dims[], int isfortran));
  197. extern int DFSDIputslice
  198.     PROTO((int32 _HUGE windims[], void _HUGE *data, int32 _HUGE dims[], int isfortran));
  199. extern int DFSDIendslice
  200.     PROTO((int isfortran));
  201. extern intn DFSDIrefresh
  202.     PROTO((char _HUGE *filename));
  203. extern int DFSDIisndg
  204.     PROTO((intn _HUGE *isndg));
  205. extern int DFSDIgetrrank
  206.     PROTO((intn _HUGE *rank));
  207. extern int DFSDIgetwrank
  208.     PROTO((intn _HUGE *rank));
  209.  
  210. extern int DFSDsetcal
  211.     PROTO((float64 cal, float64 cal_err, float64 ioff, 
  212.            float64 ioff_err, int32 cal_nt));
  213. extern int DFSDgetcal
  214.     PROTO((float64 _HUGE *pcal, float64 _HUGE *pcal_err, float64 _HUGE *pioff,
  215.                float64 _HUGE *pioff_err, int32 _HUGE *cal_nt));
  216.  
  217. #endif /*DFSDG*/
  218.