1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group.                                               *
3  * Copyright by the Board of Trustees of the University of Illinois.         *
4  * All rights reserved.                                                      *
5  *                                                                           *
6  * This file is part of HDF.  The full HDF copyright notice, including       *
7  * terms governing use, modification, and redistribution, is contained in    *
8  * the COPYING file, which can be found at the root of the source code       *
9  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF/releases/.  *
10  * If you do not have access to either file, you may request a copy from     *
11  * help@hdfgroup.org.                                                        *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 /* $Id$ */
15 
16 /*-----------------------------------------------------------------------------
17  * File:    dfsd.h
18  * Purpose: header file for the Scientific Data set
19  * Invokes: dfrig.h
20  * Contents:
21  *  Structure definitions: DFSsdg
22  *  Constant definitions: DFS_MAXLEN
23  * Remarks: This is included with user programs which use SDG
24  *          Currently defined to be 2-D.  Will later be increased to
25  *          multiple dimensions
26  *---------------------------------------------------------------------------*/
27 
28 #ifndef _DFSD_H   /* avoid re-inclusion */
29 #define _DFSD_H
30 
31 #include "H4api_adpt.h"
32 
33 #include "hdf.h"
34 
35 /* include numbertype and aid for 3.2   S. Xu   */
36 /* structure to hold SDG info */
37 typedef struct DFSsdg
38   {
39       DFdi        data;         /* tag/ref of data in file */
40       intn        rank;         /* number of dimensions */
41       int32 *dimsizes;    /* dimensions of data */
42       char *coordsys;
43       char *dataluf[3];   /* label/unit/format of data */
44       char **dimluf[3];   /* label/unit/format for each dim */
45       uint8 **dimscales;  /* scales for each dimension */
46       uint8       max_min[16];  /* max, min values of data, */
47       /*  currently atmost 8 bytes each   */
48       int32       numbertype;   /* default is float32      */
49       uint8       filenumsubclass;  /* number format in the file, default is IEEE */
50       int32       aid;          /* access id     */
51       int32       compression;  /* 0 -- not compressed  */
52       int32       isndg;        /* 0 -- pure sdg, written by 3.1 else ndg */
53       float64     cal, cal_err; /* calibration multiplier stuff          */
54       float64     ioff, ioff_err;   /* calibration offset stuff              */
55       int32       cal_type;     /* number type of data after calibration */
56       uint8       fill_value[DFSD_MAXFILL_LEN];     /* fill value if any specified  */
57       intn        fill_fixed;   /* whether ther fill value is a fixed value, or it can change */
58   }
59 DFSsdg;
60 
61 /* DFnsdgle is the internal structure which stores SDG or NDS and   */
62 /* related SDG in an HDF file.                                      */
63 /* It is a linked list.                                             */
64 
65 typedef struct DFnsdgle
66   {
67       DFdi        nsdg;         /* NDG from 3.2 or SDG from 3.1  */
68       DFdi        sdg;          /* Only special NDF has values in this field */
69       struct DFnsdgle *next;
70   }
71 DFnsdgle;
72 
73 typedef struct DFnsdg_t_hdr
74   {
75       uint32      size;
76       DFnsdgle   *nsdg_t;
77   }
78 DFnsdg_t_hdr;
79 
80 #if defined c_plusplus || defined __cplusplus
81 extern      "C"
82 {
83 #endif                          /* c_plusplus || __cplusplus */
84 
85     HDFLIBAPI int32 DFSDIopen
86                 (const char * filename, int acc_mode);
87 
88     HDFLIBAPI int  DFSDIsdginfo
89                 (int32 file_id);
90 
91     HDFLIBAPI int  DFSDIclear
92                 (DFSsdg * sdg);
93 
94     HDFLIBAPI int  DFSDIclearNT
95                 (DFSsdg * sdg);
96 
97     HDFLIBAPI int  DFSDIgetdata
98                 (const char * filename, intn rank, int32 maxsizes[], VOIDP data,
99                  int isfortran);
100 
101     HDFLIBAPI int  DFSDIputdata
102                 (const char * filename, intn rank, int32 * dimsizes, VOIDP data,
103                  int accmode, int isfortran);
104 
105     HDFLIBAPI int  DFSDIgetslice
106                 (const char * filename, int32 winst[], int32 windims[], VOIDP data,
107                  int32 dims[], int isfortran);
108 
109     HDFLIBAPI int  DFSDIputslice
110                 (int32 windims[], VOIDP data, int32 dims[], int isfortran);
111 
112     HDFLIBAPI int  DFSDIendslice
113                 (int isfortran);
114 
115     HDFLIBAPI intn DFSDIrefresh
116                 (char * filename);
117 
118     HDFLIBAPI int  DFSDIisndg
119                 (intn * isndg);
120 
121     HDFLIBAPI int  DFSDIgetrrank
122                 (intn * rank);
123 
124     HDFLIBAPI int  DFSDIgetwrank
125                 (intn * rank);
126 
127     HDFLIBAPI int  DFSDIsetdimstrs
128                 (int dim, const char * label, const char * unit, const char * format);
129 
130     HDFLIBAPI int  DFSDIsetdatastrs
131                 (const char * label, const char * unit, const char * format,
132                  const char * coordsys);
133 
134 #if defined c_plusplus || defined __cplusplus
135 }
136 #endif                          /* c_plusplus || __cplusplus */
137 
138 #endif                          /* _DFSD_H */
139