MISR Toolkit  1.5.1
hlimits.h
Go to the documentation of this file.
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 /*+ hlimits.h
17  *** This file contains all hard coded limits for the library
18  *** and reserved vdata/vgroup names and classes.
19  *** Also pre-defined attribute names are contained in thie file.
20  + */
21 
22 #ifndef _HLIMITS_H
23 #define _HLIMITS_H
24 
25 #ifndef _WIN32
26 #define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,Z)
27 #endif
28 /**************************************************************************
29 * Generally useful macro definitions
30 * (These are copied from hdfi.h and shoudl remain included in both files
31 * because hlimits.h is included from netcdf.h which is used in some
32 * netCDF utilities which don't need or want the rest of the HDF header
33 * files. -QAK - 2/17/99 )
34 **************************************************************************/
35 #ifndef MIN
36 #define MIN(a,b) (((a)<(b)) ? (a) : (b))
37 #endif
38 #ifndef MAX
39 #define MAX(a,b) (((a)>(b)) ? (a) : (b))
40 #endif
41 
42 /* ------------------------- General Constants hdf.h --------------------- */
43 /* tbuf used as a temporary buffer for small jobs. The size is
44  preferably > 512 but MUST be > ~256. It is advised that if an
45  arbitrarily large buffer (> 100 bytes) is require, dynamic space be
46  used. tbuf lives in the hfile.c */
47 
48 #ifndef TBUF_SZ
49 # define TBUF_SZ 1024
50 #endif
51 
52 /* File name max length (old annotations) */
53 #define DF_MAXFNLEN 256
54 
55 /*
56  * some max lengths for the Vset interface
57  *
58  * Except for FIELDNAMELENMAX, change these as you please, they
59  * affect memory only, not the file.
60  *
61  */
62 
63 #define FIELDNAMELENMAX 128 /* fieldname : 128 chars max */
64 #define VSFIELDMAX 256 /* max no of fields per vdata */
65 #define VSNAMELENMAX 64 /* vdata name : 64 chars max */
66 #define VGNAMELENMAX 64 /* vgroup name : 64 chars max */
67 /* Note: VGNAMELENMAX has been removed from library, test, and tools
68  except in mfgr.c and Fortran interface, in favor of dynamic allocation.
69  BMR- 1/28/2010 */
70 
71 /*
72  * default max no of objects in a vgroup
73  * VGroup will grow dynamically if needed
74  */
75 #define MAXNVELT 64
76 
77 /*
78  * Defaults for linked block operations with Vsets
79  */
80 #define VDEFAULTBLKSIZE 4096
81 #define VDEFAULTNBLKS 32
82 
83 /* Max order of a field in a Vdata */
84 #define MAX_ORDER 65535
85 #define MAX_FIELD_SIZE 65535
86 
87 
88 /* ------------------------- Constants for hfile.c --------------------- */
89 /* Maximum number of files (number of slots for file records) */
90 #ifndef MAX_FILE
91 # define MAX_FILE 32
92 #endif /* MAX_FILE */
93 
94 /* Maximum length of external filename(s) (used in hextelt.c) */
95 #ifndef MAX_PATH_LEN
96 #define MAX_PATH_LEN 1024
97 #endif /* MAX_PATH_LEN */
98 
99 /* ndds (number of dd's in a block) default,
100  so user need not specify */
101 #ifndef DEF_NDDS
102 # define DEF_NDDS 16
103 #endif /* DEF_NDDS */
104 
105 /* ndds minimum, to prevent excessive overhead of very small dd-blocks */
106 #ifndef MIN_NDDS
107 # define MIN_NDDS 4
108 #endif /* MIN_NDDS */
109 
110 /* largest number that will fit into 16-bit word ref variable */
111 #define MAX_REF ((uint16)65535)
112 
113 /* length of block and number of blocks for converting 'appendable' data */
114 /* elements into linked blocks (will eventually be replaced by the newer */
115 /* variable-length blocks */
116 #define HDF_APPENDABLE_BLOCK_LEN 4096
117 #define HDF_APPENDABLE_BLOCK_NUM 16
118 
119 /* hashing information */
120 #define HASH_MASK 0xff
121 #define HASH_BLOCK_SIZE 100
122 
123 /* ------------------------- Constants for Vxx interface --------------------- */
124 
125 /*
126  * Private conversion buffer stuff
127  * VDATA_BUFFER_MAX is the largest buffer that can be allocated for
128  * writing (haven't implemented reading yet).
129  * Vtbuf is the buffer
130  * Vtbufsize is the buffer size in bytes at any given time.
131  * Vtbuf is increased in size as need be
132  * BUG: the final Vtbuf never gets freed
133  */
134 #define VDATA_BUFFER_MAX 1000000
135 
136 /* --------------------- Constants for DFSDxx interface --------------------- */
137 
138 #define DFS_MAXLEN 255 /* Max length of label/unit/format strings */
139 #define DFSD_MAXFILL_LEN 16 /* Current max length for fill_value space */
140 
141 /* ----------------- Constants for COMPRESSION interface --------------------- */
142 
143 /* Set the following macro to the value the highest compression scheme is */
144 #define COMP_MAX_COMP 12
145 #define COMP_HEADER_LENGTH 14
146 
147 /* ----------------- Constants for DGROUP interface --------------------- */
148 #define MAX_GROUPS 8
149 
150 /* ----------------- Constants for HERROR interface --------------------- */
151 #define FUNC_NAME_LEN 32
152 
153 /* error_stack is the error stack. error_top is the stack top pointer,
154  and points tothe next available slot on the stack */
155 #ifndef ERR_STACK_SZ
156 # define ERR_STACK_SZ 10
157 #endif
158 
159 /* max size of a stored error description */
160 #ifndef ERR_STRING_SIZE
161 # define ERR_STRING_SIZE 512
162 #endif
163 
164 /* ----------------- Constants for NETCDF interface(netcdf.h) ---------------- */
165 /*
166  * This can be as large as the maximum number of stdio streams
167  * you can have open on your system.
168  */
169 #define H4_MAX_NC_OPEN MAX_FILE
170 
171 /*
172  * These maximums are enforced by the interface, to facilitate writing
173  * applications and utilities. However, nothing is statically allocated to
174  * these sizes internally.
175  */
176 #define H4_MAX_NC_DIMS 5000 /* max dimensions per file */
177 #define H4_MAX_NC_ATTRS 3000 /* max global or per variable attributes */
178 #define H4_MAX_NC_VARS 5000 /* max variables per file */
179 /* This macro changed the behavior of the SDcreate function in HDF4r1.3
180  * SDcreate started to fail if SDS name length was greater than 64, instead of truncating
181  * it to 64 characters and creating a dataset. Switched back to the old definition.
182  * EP 5/5/2000
183 #define H4_MAX_NC_NAME MIN(256,MIN(VSNAMELENMAX,VGNAMELENMAX)) */
184 
185 #define H4_MAX_NC_NAME 256 /* max length of a name */
186 #define H4_MAX_NC_CLASS 128 /* max length of a class name - added this
187  because 128 was used commonly in SD for class name, and this will help
188  changing the class name variable declaration much easier - BMR 4/1/02*/
189 #define H4_MAX_VAR_DIMS 32 /* max per variable dimensions */
190 
191 /* These definitions here are for backward/forward compatibiliy since major
192  constants were modified with H4 prefix to avoid conflicts with the
193  real NetCDF-3 library - EIP 9/5/07 */
194 
195 #ifdef H4_HAVE_NETCDF
196 #define MAX_NC_OPEN H4_MAX_NC_OPEN
197 #define MAX_NC_DIMS H4_MAX_NC_DIMS
198 #define MAX_NC_VARS H4_MAX_NC_VARS
199 #define MAX_NC_NAME H4_MAX_NC_NAME
200 #define MAX_NC_CLASS H4_MAX_NC_CLASS
201 #define MAX_VAR_DIMS H4_MAX_VAR_DIMS
202 #endif
203 
204 /* ----------------- Constants for MFGR interface --------------------- */
205 #define H4_MAX_GR_NAME 256 /* max length of a name */
206 
207 #endif /* _HLIMITS_H */
208 
209 /* ----------- Reserved classes and names for vdatas/vgroups -----*/
210 
211 /* The names of the Vgroups created by the GR interface, from mfgr.h */
212 #define GR_NAME "RIG0.0" /* name of the Vgroup containing all the images */
213 #define RI_NAME "RI0.0" /* name of a Vgroup containing information a
214  bout one image */
215 #define RIGATTRNAME "RIATTR0.0N" /* name of a Vdata containing an
216  attribute */
217 #define RIGATTRCLASS "RIATTR0.0C" /* class of a Vdata containing an
218  attribute */
219 /* Vdata and Vgroup attributes use the same class as that of SD attr,
220  * _HDF_ATTRIBUTE "Attr0.0" 8/1/96 */
221 
222 /* classes of the Vdatas/Vgroups created by the SD interface,
223  from local_nc.h */
224 #define _HDF_ATTRIBUTE "Attr0.0"
225  /* class of a Vdata containing SD interface attribute */
226 #define _HDF_VARIABLE "Var0.0"
227  /* class of a Vgroup representing an SD NDG */
228 #define _HDF_SDSVAR "SDSVar"
229  /* class of a Vdata indicating its group is an SDS variable */
230  /* - only after hdf4r2 */
231 #define _HDF_CRDVAR "CoordVar"
232  /* name of a Vdata indicating its group is a coordinate variable */
233  /* - only after hdf4r2 */
234 #define _HDF_DIMENSION "Dim0.0"
235  /* class of a Vgroup representing an SD dimension */
236 #define _HDF_UDIMENSION "UDim0.0"
237  /* class of a Vgroup representing an SD UNLIMITED dimension*/
238 #define DIM_VALS "DimVal0.0"
239  /* class of a Vdata containing an SD dimension size and fake values */
240 #define DIM_VALS01 "DimVal0.1"
241  /* class of a Vdata containing an SD dimension size */
242 #define _HDF_CDF "CDF0.0"
243 /* DATA is defined in DTM. Change DATA to DATA0
244  #define DATA "Data0.0" */
245 #define DATA0 "Data0.0"
246 #define ATTR_FIELD_NAME "VALUES"
247 
248 /* The following vdata class name is reserved by the Chunking interface.
249  originally defined in 'hchunks.h'. The full class name
250  currently is "_HDF_CHK_TBL_0". -GV 9/25/97
251 
252  Made the vdata class name available to other interfaces since it is needed
253  during hmap project. -BMR 11/11/2010 */
254 #define _HDF_CHK_TBL_CLASS "_HDF_CHK_TBL_" /* 13 bytes */
255 #define _HDF_CHK_TBL_CLASS_VER 0 /* zero version number for class */
256 
257 /*
258 #define NUM_INTERNAL_VGS 6
259 char *INTERNAL_HDF_VGS[] = {_HDF_VARIABLE, _HDF_DIMENSION, _HDF_UDIMENSION,
260  _HDF_CDF, GR_NAME, RI_NAME};
261 
262 #define NUM_INTERNAL_VDS 8
263 char *INTERNAL_HDF_VDS[] = {DIM_VALS, DIM_VALS01, _HDF_ATTRIBUTE, _HDF_SDSVAR,
264  _HDF_CRDVAR, "_HDF_CHK_TBL_", RIGATTRNAME, RIGATTRCLASS};
265 
266 */
267 /* ------------ pre-defined attribute names ---------------- */
268 /* For MFGR interface */
269 #define FILL_ATTR "FillValue"
270  /* name of an attribute containing the fill value */
271 
272 /* For SD interface */
273 #define _FillValue "_FillValue"
274  /* name of an attribute to set fill value for an SDS */
275 #define _HDF_LongName "long_name" /* data/dimension label string */
276 #define _HDF_Units "units" /* data/dimension unit string */
277 #define _HDF_Format "format" /* data/dimension format string */
278 #define _HDF_CoordSys "coordsys" /* data coordsys string */
279 #define _HDF_ValidRange "valid_range" /* valid range of data values */
280 #define _HDF_ScaleFactor "scale_factor" /* data calibration factor */
281 #define _HDF_ScaleFactorErr "scale_factor_err" /* data calibration factor error */
282 #define _HDF_AddOffset "add_offset" /* calibration offset */
283 #define _HDF_AddOffsetErr "add_offset_err" /* calibration offset error */
284 #define _HDF_CalibratedNt "calibrated_nt" /* data type of uncalibrated data */
285 #define _HDF_ValidMax "valid_max"
286 #define _HDF_ValidMin "valid_min"
287 #define _HDF_Remarks "remarks" /* annotation, by DFAN */
288 #define _HDF_AnnoLabel "anno_label" /* annotation label, by DFAN */

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:52