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