MISR Toolkit  1.5.1
local_nc.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright 1993, University Corporation for Atmospheric Research *
3  * See netcdf/COPYRIGHT file for copying and redistribution conditions. *
4  * *
5  * Copyright by The HDF Group. *
6  * Copyright by the Board of Trustees of the University of Illinois. *
7  * All rights reserved. *
8  * *
9  * This file is part of HDF. The full HDF copyright notice, including *
10  * terms governing use, modification, and redistribution, is contained in *
11  * the COPYING file, which can be found at the root of the source code *
12  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF/releases/. *
13  * If you do not have access to either file, you may request a copy from *
14  * help@hdfgroup.org. *
15  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
16 
17 /* $Id$ */
18 #ifndef _LOCAL_NC_
19 #define _LOCAL_NC_
20 
21 #include "H4api_adpt.h"
22 /*
23  * netcdf library 'private' data structures, objects and interfaces
24  */
25 
26 #include <stddef.h> /* size_t */
27 #include <stdio.h> /* FILENAME_MAX */
28 
29 #ifndef FILENAME_MAX
30 #define FILENAME_MAX 255
31 #endif
32 
33 /* Do we have system XDR files */
34 #ifndef NO_SYS_XDR_INC
35 
36 #ifdef __CYGWIN__
37 #ifndef __u_char_defined
38 typedef unsigned char u_char;
39 #define __u_char_defined
40 #endif
41 #ifndef __u_short_defined
42 typedef unsigned short u_short;
43 #define __u_short_defined
44 #endif
45 #ifndef __u_int_defined
46 typedef unsigned int u_int;
47 #define __u_int_defined
48 #endif
49 #ifndef __u_long_defined
50 typedef unsigned long u_long;
51 #define __u_long_defined
52 #endif
53 #endif /* __CYGWIN__ */
54 
55 #include <rpc/types.h>
56 #include <rpc/xdr.h>
57 #else /* NO_SYS_XDR_INC */
58 #include <types.h> /* <types.h */
59 #include <xdr.h> /* <xdr.h> */
60 #endif /* NO_SYSTEM_XDR_INCLUDES */
61 
62 #include "H4api_adpt.h"
63 #ifdef H4_HAVE_NETCDF
64 #include "netcdf.h" /* needed for defs of nc_type, ncvoid, ... */
65 #else
66 #include "hdf4_netcdf.h"
67 #endif
68 
69 /* ptr argument type in internal functions */
70 #define Void char
71 
72 /*
73 ** Include HDF stuff
74 */
75 #ifdef HDF
76 
77 #include "hdf.h"
78 #include "vg.h"
79 #include "hfile.h"
80 #include "mfhdfi.h"
81 
82 #define ATTR_TAG DFTAG_VH
83 #define DIM_TAG DFTAG_VG
84 #define VAR_TAG DFTAG_VG
85 #define DATA_TAG DFTAG_SD
86 #define BOGUS_TAG ((uint16) 721)
87 
88 #if 0
89 #define ATTRIBUTE "Attr0.0"
90 #define VARIABLE "Var0.0"
91 #define DIMENSION "Dim0.0"
92 #define UDIMENSION "UDim0.0"
93 #define DIM_VALS "DimVal0.0"
94 #define DIM_VALS01 "DimVal0.1"
95 #define CDF "CDF0.0"
96 /* DATA is defined in DTM. Change DATA to DATA0 *
97 #define DATA "Data0.0"
98 */
99 #define DATA0 "Data0.0"
100 #define ATTR_FIELD_NAME "VALUES"
101 #endif
102 
103 #define DIMVAL_VERSION00 0 /* <dimsize> fake values */
104 #define DIMVAL_VERSION01 1 /* 1 elt with value of <dimsize> */
105 #define BLOCK_MULT 64 /* multiplier for bytes in linked blocks */
106 #define MAX_BLOCK_SIZE 65536 /* maximum size of block in linked blocks */
107 #define BLOCK_COUNT 128 /* size of linked block pointer objects */
108 
109 #endif /* HDF */
110 
111 /* from cdflib.h CDF 2.3 */
112 #ifndef MAX_VXR_ENTRIES
113 #define MAX_VXR_ENTRIES 10
114 #endif /* MAX_VXR_ENTRIES */
115 
116 #ifdef HDF
117 /* VIX record for CDF variable data storage */
118 typedef struct vix_t_def {
119  int32 nEntries; /* number of entries in this vix */
120  int32 nUsed; /* number of entries containing valid data */
121  int32 firstRec[MAX_VXR_ENTRIES]; /* number of first records */
122  int32 lastRec[MAX_VXR_ENTRIES]; /* number of last records */
123  int32 offset[MAX_VXR_ENTRIES]; /* file offset of records */
124  struct vix_t_def * next; /* next one in line */
125 } vix_t;
126 #endif /* HDF */
127 
128 /* like, a discriminated union in the sense of xdr */
129 typedef struct {
130  nc_type type ; /* the discriminant */
131  size_t len ; /* the total length originally allocated */
132  size_t szof ; /* sizeof each value */
133  unsigned count ; /* length of the array */
134  Void *values ; /* the actual data */
135 } NC_array ;
136 
137 /* Counted string for names and such */
138 /*
139 
140  count is the actual size of the buffer for the string
141  len is the length of the string in the buffer
142 
143  count != len when a string is resized to something smaller
144 
145 */
146 #ifdef HDF
147 #define NC_compare_string(s1,s2) ((s1)->hash!=(s2)->hash ? 1 : HDstrcmp((s1)->values,(s2)->values))
148 #endif /* HDF */
149 
150 typedef struct {
151  unsigned count ;
152  unsigned len ;
153 #ifdef HDF
154  uint32 hash; /* [non-perfect] hash value for faster comparisons */
155 #endif /* HDF */
156  char *values ;
157 } NC_string ;
158 
159 /* Counted array of ints for assoc list */
160 typedef struct {
161  unsigned count ;
162  int *values ;
163 } NC_iarray ;
164 
165 /* NC dimension stucture */
166 typedef struct {
167  NC_string *name ;
168  long size ;
169 #ifdef HDF
170  int32 dim00_compat; /* compatible with Dim0.0 */
171  int32 vgid; /* id of the Vgroup representing this dimension */
172  int32 count; /* Number of pointers to this dimension */
173 #endif
174 } NC_dim ;
175 
176 /* NC attribute */
177 typedef struct {
178  NC_string *name ;
179  NC_array *data ;
180 #ifdef HDF
181  int32 HDFtype; /* it should be in NC_array *data. However, */
182  /* NC.dims and NC.vars are NC_array too. */
183 #endif
184 } NC_attr ;
185 
186 typedef struct {
187  char path[FILENAME_MAX + 1] ;
188  unsigned flags ;
189  XDR *xdrs ;
190  long begin_rec ; /* (off_t) postion of the first 'record' */
191  unsigned long recsize ; /* length of 'record' */
192  int redefid ;
193  /* below gets xdr'd */
194  unsigned long numrecs ; /* number of 'records' allocated */
195  NC_array *dims ;
196  NC_array *attrs ;
197  NC_array *vars ;
198 #ifdef HDF
199  int32 hdf_file;
200  int file_type;
201  int32 vgid;
202  int hdf_mode; /* mode we are attached for */
203  hdf_file_t cdf_fp; /* file pointer used for CDF files */
204 #endif
205 } NC ;
206 
207 /* NC variable: description and data */
208 typedef struct {
209  NC_string *name ; /* name->values shows data set's name */
210  NC_iarray *assoc ; /* user definition */
211  unsigned long *shape ; /* compiled info (Each holds a dimension size. -BMR) */
212  unsigned long *dsizes ; /* compiled info (Each element holds the amount of space
213  needed to hold values in that dimension, e.g., first dimension
214  size is 10, value type is int32=4, then dsizes[0]=4*10=40. -BMR) */
215  NC_array *attrs; /* list of attribute structures */
216  nc_type type ; /* the discriminant */
217  unsigned long len ; /* the total length originally allocated */
218  size_t szof ; /* sizeof each value */
219  long begin ; /* seek index, often an off_t */
220 #ifdef HDF
221  NC *cdf; /* handle of the file where this var belongs to */
222  int32 vgid; /* id of the variable's Vgroup */
223  uint16 data_ref;/* ref of the variable's data storage (if exists), default 0 */
224  uint16 data_tag;/* tag of the variable's data storage (if exists), default DATA_TAG */
225  uint16 ndg_ref; /* ref of ndg for this dataset */
226  hdf_vartype_t var_type; /* type of this variable, default UNKNOWN
227  IS_SDSVAR == this var is an SDS variable
228  IS_CRDVAR == this var is a coordinate variable
229  UNKNOWN == because the var was created prior to this distinction.
230  This is to distinguish b/w a one-dim data set and a coord var of the same name.
231  It's less riskier than using a flag and change the file format, I think. -BMR */
232  intn data_offset; /* non-traditional data may not begin at 0 */
233  int32 block_size; /* size of the blocks for unlimited dim. datasets, default -1 */
234  int numrecs; /* number of records this has been filled up to, for unlimited dim */
235  int32 aid; /* aid for DFTAG_SD data */
236  int32 HDFtype; /* type of this variable as HDF thinks */
237  int32 HDFsize; /* size of this variable as HDF thinks */
238  /* These next two flags control when space in the file is allocated
239  for a new dataset. They are used (currently) in SDwritedata() and
240  hdf_get_vp_aid() to allocate the full length of a new fixed-size dataset
241  which is not writing fill values, instead of letting them get created
242  as an "appendable" dataset and probably get converted into a linked-
243  block special element when they don't need to be one */
244  int32 created; /* BOOLEAN == is newly created */
245  int32 set_length; /* BOOLEAN == needs length set */
246  int32 is_ragged; /* BOOLEAN == is a ragged array */
247  int32 * rag_list; /* size of ragged array lines */
248  int32 rag_fill; /* last line in rag_list to be set */
249  vix_t * vixHead; /* list of VXR records for CDF data storage */
250 #endif
251 } NC_var ;
252 
253 #define IS_RECVAR(vp) \
254  ((vp)->shape != NULL ? (*(vp)->shape == NC_UNLIMITED) : 0 )
255 
256 #define netCDF_FILE 0
257 #define HDF_FILE 1
258 #define CDF_FILE 2
259 
260 HDFLIBAPI const char *cdf_routine_name ; /* defined in lerror.c */
261 
262 #define MAGICOFFSET 0 /* Offset where format version number is written */
263 
264 /* Format version number for CDF file */
265 /* Written twice at the beginning of pre-2.6 CDF file */
266 #define CDFMAGIC 0x0000FFFF
267 
268 /* Format version number for HDF file */
269 #define HDFXMAGIC 0x0e031301 /* ^N^C^S^A */
270 
271 /* Format version number for netCDF classic file */
272 #define NCMAGIC 0x43444601 /* C D F 1 */
273 
274 /* Format version number for 64-bit offset file */
275 #define NCMAGIC64 0x43444602 /* C D F 2 */
276 
277 /* Format version number for link file */
278 #define NCLINKMAGIC 0x43444c01 /* C D L 1 */
279 
280 /* #ifndef HDF *//* HDF has already worked out if we have prototypes */
281 #ifdef HDF
282 #define PROTOTYPE
283 #endif
284 #undef PROTO
285 #ifndef NO_HAVE_PROTOTYPES
286 # define PROTO(x) x
287 #else
288 # define PROTO(x) ()
289 #endif
290 /* #endif */ /* HDF */
291 
292 #ifdef __cplusplus
293 extern "C" {
294 #endif
295 
296 /* If using the real netCDF library and API (when --disable-netcdf configure flag is used)
297  need to mangle the HDF versions of netCDF API function names
298  to not conflict w/ oriinal netCDF ones */
299 #ifndef H4_HAVE_NETCDF
300 #define nc_serror HNAME(nc_serror)
301 #define NCadvise HNAME(NCadvise)
302 #define NC_computeshapes HNAME(NC_computeshapes)
303 #define NC_xtypelen HNAME(NC_xtypelen)
304 #define NC_xlen_array HNAME(NC_xlen_array)
305 #define NC_xlen_attr HNAME(NC_xlen_attr)
306 #define NC_xlen_cdf HNAME(NC_xlen_cdf)
307 #define NC_xlen_dim HNAME(NC_xlen_dim)
308 #define NC_xlen_iarray HNAME(NC_xlen_iarray)
309 #define NC_xlen_string HNAME(NC_xlen_string)
310 #define NC_xlen_var HNAME(NC_xlen_var)
311 #define NCmemset HNAME(NCmemset)
312 #define NC_arrayfill HNAME(NC_arrayfill)
313 #define NC_copy_arrayvals HNAME(NC_copy_arrayvals)
314 #define NC_free_array HNAME(NC_free_array)
315 #define NC_free_attr HNAME(NC_free_attr)
316 #define NC_free_cdf HNAME(NC_free_cdf)
317 #define NC_free_dim HNAME(NC_free_dim)
318 #define NC_free_iarray HNAME(NC_free_iarray)
319 #define NC_free_string HNAME(NC_free_string)
320 #define NC_free_var HNAME(NC_free_var)
321 #define NC_incr_array HNAME(NC_incr_array)
322 #define NC_dimid HNAME(NC_dimid)
323 #define NCcktype HNAME(NCcktype)
324 #define NC_indefine HNAME(NC_indefine)
325 #define xdr_cdf HNAME(xdr_cdf)
326 #define xdr_numrecs HNAME(xdr_numrecs)
327 #define xdr_shorts HNAME(xdr_shorts)
328 #define xdr_NC_array HNAME(xdr_NC_array)
329 #define xdr_NC_attr HNAME(xdr_NC_attr)
330 #define xdr_NC_dim HNAME(xdr_NC_dim)
331 #define xdr_NC_fill HNAME(xdr_NC_fill)
332 #define xdr_NC_iarray HNAME(xdr_NC_iarray)
333 #define xdr_NC_string HNAME(xdr_NC_string)
334 #define xdr_NC_var HNAME(xdr_NC_var)
335 #define NC_typelen HNAME(NC_typelen)
336 #define NC_check_id HNAME(NC_check_id)
337 #define NC_dup_cdf HNAME(NC_dup_cdf)
338 #define NC_new_cdf HNAME(NC_new_cdf)
339 #define NC_new_array HNAME(NC_new_array)
340 #define NC_re_array HNAME(NC_re_array)
341 #define NC_new_attr HNAME(NC_new_attr)
342 #define NC_findattr HNAME(NC_findattr)
343 #define NC_new_dim HNAME(NC_new_dim)
344 #define NC_new_iarray HNAME(NC_new_iarray)
345 #define NC_new_string HNAME(NC_new_string)
346 #define NC_re_string HNAME(NC_re_string)
347 #define NC_hlookupvar HNAME(NC_hlookupvar)
348 #define NC_new_var HNAME(NC_new_var)
349 #define NCvario HNAME(NCvario)
350 #define NCcoordck HNAME(NCcoordck)
351 #define xdr_NCvshort HNAME(xdr_NCvshort)
352 #define NC_dcpy HNAME(NC_dcpy)
353 #define NCxdrfile_sync HNAME(NCxdrfile_sync)
354 #define NCxdrfile_create HNAME(NCxdrfile_create)
355 #ifdef HDF
356 #define NCgenio HNAME(NCgenio) /* from putgetg.c */
357 #define NC_var_shape HNAME(NC_var_shape) /* from var.c */
358 #endif
359 #endif /* !H4_HAVE_NETCDF ie. NOT USING HDF version of netCDF ncxxx API */
360 
361 #define nncpopt H4_F77_FUNC(ncpopt, NCPOPT)
362 #define nncgopt H4_F77_FUNC(ncgopt, NCGOPT)
363 #define nnccre H4_F77_FUNC(nccre, NCCRE)
364 #define nncopn H4_F77_FUNC(ncopn, NCOPN)
365 #define nncddef H4_F77_FUNC(ncddef, NCDDEF)
366 #define nncdid H4_F77_FUNC(ncdid, NCDID)
367 #define nncvdef H4_F77_FUNC(ncvdef, NCVDEF)
368 #define nncvid H4_F77_FUNC(ncvid, NCVID)
369 #define nnctlen H4_F77_FUNC(nctlen, NCTLEN)
370 #define nncclos H4_F77_FUNC(ncclos, NCCLOS)
371 #define nncredf H4_F77_FUNC(ncredf, NCREDF)
372 #define nncendf H4_F77_FUNC(ncendf, NCENDF)
373 #define nncinq H4_F77_FUNC(ncinq, NCINQ)
374 #define nncsnc H4_F77_FUNC(ncsnc, NCSNC)
375 #define nncabor H4_F77_FUNC(ncabor, NCABOR)
376 #define nncdinq H4_F77_FUNC(ncdinq, NCDINQ)
377 #define nncdren H4_F77_FUNC(ncdren, NCDREN)
378 #define nncvinq H4_F77_FUNC(ncvinq, NCVINQ)
379 #define nncvpt1 H4_F77_FUNC(ncvpt1, NCVPT1)
380 #define nncvp1c H4_F77_FUNC(ncvp1c, NCVP1C)
381 #define nncvpt H4_F77_FUNC(ncvpt, NCVPT)
382 #define nncvptc H4_F77_FUNC(ncvptc, NCVPTC)
383 #define nncvptg H4_F77_FUNC(ncvptg, NCVPTG)
384 #define nncvpgc H4_F77_FUNC(ncvpgc, NCVPGC)
385 #define nncvgt1 H4_F77_FUNC(ncvgt1, NCVGT1)
386 #define nncvg1c H4_F77_FUNC(ncvg1c, NCVG1C)
387 #define nncvgt H4_F77_FUNC(ncvgt, NCVGT)
388 #define nncvgtc H4_F77_FUNC(ncvgtc, NCVGTC)
389 #define nncvgtg H4_F77_FUNC(ncvgtg, NCVGTG)
390 #define nncvggc H4_F77_FUNC(ncvggc, NCVGGC)
391 #define nncvren H4_F77_FUNC(ncvren, NCVREN)
392 #define nncapt H4_F77_FUNC(ncapt, NCAPT)
393 #define nncaptc H4_F77_FUNC(ncaptc, NCAPTC)
394 #define nncainq H4_F77_FUNC(ncainq, NCAINQ)
395 #define nncagt H4_F77_FUNC(ncagt, NCAGT)
396 #define nncagtc H4_F77_FUNC(ncagtc, NCAGTC)
397 #define nncacpy H4_F77_FUNC(ncacpy, NCACPY)
398 #define nncanam H4_F77_FUNC(ncanam, NCANAM)
399 #define nncaren H4_F77_FUNC(ncaren, NCAREN)
400 #define nncadel H4_F77_FUNC(ncadel, NCADEL)
401 #define nncsfil H4_F77_FUNC(ncsfil, NCSFIL)
402 
403 #ifdef WIN32
404 HDFFCLIBAPI void nncpopt
405  PROTO((int* val));
406 HDFFCLIBAPI void nncgopt
407  PROTO((int* val));
409  PROTO((char* pathname, int* clobmode, int* rcode, int pathnamelen));
411  PROTO((char* pathname, int* rwmode, int* rcode, int pathnamelen));
413  PROTO((int* cdfid, char* dimname, int* dimlen, int* rcode, int dimnamelen));
415  PROTO((int* cdfid, char* dimname, int* rcode, int dimnamelen));
417  PROTO((int* cdfid, char* varname, int* datatype, int* ndims, int* dimarray, int* rcode, int varnamelen));
419  PROTO((int* cdfid, char* varname, int* rcode, int varnamelen));
421  PROTO((int* datatype, int* rcode));
422 HDFFCLIBAPI void nncclos
423  PROTO((int* cdfid, int* rcode));
424 HDFFCLIBAPI void nncredf
425  PROTO((int* cdfid, int* rcode));
426 HDFFCLIBAPI void nncendf
427  PROTO((int* cdfid, int* rcode));
428 HDFFCLIBAPI void nncinq
429  PROTO((int* cdfid, int* ndims, int* nvars, int* natts, int* recdim, int* rcode));
430 HDFFCLIBAPI void nncsnc
431  PROTO((int* cdfid, int* rcode));
432 HDFFCLIBAPI void nncabor
433  PROTO((int* cdfid, int* rcode));
434 HDFFCLIBAPI void nncdinq
435  PROTO((int* cdfid, int* dimid, char* dimname, int* size, int* rcode, int dimnamelen));
436 HDFFCLIBAPI void nncdren
437  PROTO((int* cdfid, int* dimid, char* dimname, int* rcode, int dimnamelen));
438 HDFFCLIBAPI void nncvinq
439  PROTO((int* cdfid, int* varid, char* varname, int* datatype, int* ndims, int* dimarray, int* natts, int* rcode, int varnamelen));
440 HDFFCLIBAPI void nncvpt1
441  PROTO((int* cdfid, int* varid, int* indices, void* value, int* rcode));
442 HDFFCLIBAPI void nncvp1c
443  PROTO((int* cdfid, int* varid, int* indices, char* chval, int* rcode, int chvallen));
444 HDFFCLIBAPI void nncvpt
445  PROTO((int* cdfid, int* varid, int* start, int* count, void* value, int* rcode));
446 HDFFCLIBAPI void nncvptc
447  PROTO((int* cdfid, int* varid, int* start, int* count, char* string, int* lenstr, int* rcode, int stringlen));
448 HDFFCLIBAPI void nncvptg
449  PROTO((int* cdfid, int* varid, int* start, int* count, int* stride, int* basis, void* value, int* rcode));
450 HDFFCLIBAPI void nncvpgc
451  PROTO((int* cdfid, int* varid, int* start, int* count, int* stride, int* basis, char* string, int* rcode, int stringlen));
452 HDFFCLIBAPI void nncvgt1
453  PROTO((int* cdfid, int* varid, int* indices, void* value, int* rcode));
454 HDFFCLIBAPI void nncvg1c
455  PROTO((int* cdfid, int* varid, int* indices, char* chval, int* rcode, int chvallen));
456 HDFFCLIBAPI void nncvgt
457  PROTO((int* cdfid, int* varid, int* start, int* count, void* value, int* rcode));
458 HDFFCLIBAPI void nncvgtc
459  PROTO((int* cdfid, int* varid, int* start, int* count, char* string, int* lenstr, int* rcode, int stringlen));
460 HDFFCLIBAPI void nncvgtg
461  PROTO((int* cdfid, int* varid, int* start, int* count, int* stride, int* basis, void* value, int* rcode));
462 HDFFCLIBAPI void nncvggc
463  PROTO((int* cdfid, int* varid, int* start, int* count, int* stride, int* basis, char* string, int* rcode, int stringlen));
464 HDFFCLIBAPI void nncvren
465  PROTO((int* cdfid, int* varid, char* varname, int* rcode, int varnamelen));
466 HDFFCLIBAPI void nncapt
467  PROTO((int* cdfid, int* varid, char* attname, int* datatype, int* attlen, void* value, int* rcode, int attnamelen));
468 HDFFCLIBAPI void nncaptc
469  PROTO((int* cdfid, int* varid, char* attname, int* datatype, int* lenstr, char* string, int* rcode, int attnamelen, int stringlen));
470 HDFFCLIBAPI void nncainq
471  PROTO((int* cdfid, int* varid, char* attname, int* datatype, int* attlen, int* rcode, int attnamelen));
472 HDFFCLIBAPI void nncagt
473  PROTO((int* cdfid, int* varid, char* attname, void* value, int* rcode, int attnamelen));
474 HDFFCLIBAPI void nncagtc
475  PROTO((int* cdfid, int* varid, char* attname, char* string, int* lenstr, int* rcode, int attnamelen, int stringlen));
476 HDFFCLIBAPI void nncacpy
477  PROTO((int* incdfid, int* invarid, char* attname, int* outcdfid, int* outvarid, int* rcode, int attnamelen));
478 HDFFCLIBAPI void nncanam
479  PROTO((int* cdfid, int* varid, int* attnum, char* attname, int* rcode, int attnamelen));
480 HDFFCLIBAPI void nncaren
481  PROTO((int* cdfid, int* varid, char* attname, char* newname, int* rcode, int attnamelen, int newnamelen));
482 HDFFCLIBAPI void nncadel
483  PROTO((int* cdfid, int* varid, char* attname, int* rcode, int attnamelen));
485  PROTO((int* cdfid, int* fillmode, int* rcode));
486 #endif
487 
489  const char *fmt,
490  ...
491 )) ;
492 HDFLIBAPI void NCadvise PROTO((
493  int err,
494  const char *fmt,
495  ...
496 )) ;
497 
499  NC *handle
500 ));
502  nc_type type
503 ));
505  NC_array *array
506 ));
508  NC_attr **app
509 ));
511  NC *cdf
512 ));
514  NC_dim **dpp
515 ));
517  NC_iarray *iarray
518 ));
520  NC_string *cdfstr
521 ));
523  NC_var **vpp
524 ));
525 
526 HDFLIBAPI char *NCmemset PROTO((
527  char *s,
528  int c,
529  int n
530 ));
531 
533  void *lo,
534  size_t len,
535  nc_type type
536 ));
538  char *target,
539  NC_array *array
540 ));
542  NC_array *array
543 ));
545  NC_attr *attr
546 ));
548  NC *handle
549 ));
551  NC_dim *dim
552 ));
554  NC_iarray *iarray
555 ));
557  NC_string *cdfstr
558 ));
560  NC_var *var
561 ));
562 
564  NC_array *array,
565  Void *tail
566 ));
567 
569  NC *handle,
570  char *name
571 ));
572 HDFLIBAPI bool_t NCcktype PROTO((
574 ));
575 HDFLIBAPI bool_t NC_indefine PROTO((
576  int cdfid,
577  bool_t iserr
578 ));
579 HDFLIBAPI bool_t xdr_cdf PROTO((
580  XDR *xdrs,
581  NC **handlep
582 ));
583 HDFLIBAPI bool_t xdr_numrecs PROTO((
584  XDR *xdrs,
585  NC *handle
586 ));
587 HDFLIBAPI bool_t xdr_shorts PROTO((
588  XDR *xdrs,
589  short *sp,
590  u_int cnt
591 ));
593  XDR *xdrs,
594  NC_array **app
595 ));
596 HDFLIBAPI bool_t xdr_NC_attr PROTO((
597  XDR *xdrs,
598  NC_attr **app
599 ));
600 HDFLIBAPI bool_t xdr_NC_dim PROTO((
601  XDR *xdrs,
602  NC_dim **dpp
603 ));
604 HDFLIBAPI bool_t xdr_NC_fill PROTO((
605  XDR *xdrs,
606  NC_var *vp
607 ));
609  XDR *xdrs,
610  NC_iarray **ipp
611 ));
613  XDR *xdrs,
614  NC_string **spp
615 ));
616 HDFLIBAPI bool_t xdr_NC_var PROTO((
617  XDR *xdrs,
618  NC_var **vpp
619 ));
620 
621 HDFLIBAPI size_t NC_typelen PROTO((
622  nc_type type
623 ));
624 
626  int cdfid
627 ));
629  const char *name,
630  int mode,
631  NC *old
632 ));
634  const char *name,
635  int mode
636 ));
638  nc_type type,
639  unsigned count,
640  const void *values
641 ));
643  NC_array *old,
644  nc_type type,
645  unsigned count,
646  const void *values
647 ));
649  const char *name,
650  nc_type type,
651  unsigned count ,
652  const void *values
653 ));
655  NC_array **ap,
656  const char *name
657 ));
659  const char *name,
660  long size
661 ));
663  unsigned count,
664  const int values[]
665 ));
667  unsigned count,
668  const char *str
669 ));
671  NC_string *old,
672  unsigned count,
673  const char *str
674 ));
676  NC *handle,
677  int varid
678 ));
680  const char *name,
681  nc_type type,
682  int ndims,
683  const int *dims
684 ));
685 HDFLIBAPI int NCvario PROTO((
686  NC *handle,
687  int varid,
688  const long *start,
689  const long *edges,
690  void *values
691 ));
692 HDFLIBAPI bool_t NCcoordck PROTO((
693  NC *handle,
694  NC_var *vp,
695  const long *coords
696 ));
698  XDR *xdrs,
699  unsigned which,
700  short *values
701 ));
702 HDFLIBAPI bool_t NC_dcpy PROTO((
703  XDR *target,
704  XDR *source,
705  long nbytes
706 ));
708  PROTO((XDR *xdrs));
709 
711  PROTO((XDR *xdrs,const char *path,int ncmode));
712 
713 #ifdef HDF
714 /* this routine is found in 'xdrposix.c' */
715 HDFLIBAPI void hdf_xdrfile_create
716  PROTO(( XDR *xdrs, int ncop));
717 
718 HDFLIBAPI intn hdf_fill_array
719  PROTO((Void * storage,int32 len,Void * value,int32 type));
720 
721 HDFLIBAPI intn hdf_get_data
722  PROTO((NC *handle,NC_var *vp));
723 
724 HDFLIBAPI int32 hdf_get_vp_aid
725  PROTO((NC *handle, NC_var *vp));
726 
727 HDFLIBAPI int hdf_map_type
728  PROTO((nc_type ));
729 
730 HDFLIBAPI nc_type hdf_unmap_type
731  PROTO((int ));
732 
733 HDFLIBAPI intn hdf_get_ref
734  PROTO((NC *,int ));
735 
736 HDFLIBAPI intn hdf_create_dim_vdata
737  PROTO((XDR *,NC *,NC_dim *));
738 
739 HDFLIBAPI intn hdf_create_compat_dim_vdata
740  PROTO((XDR *xdrs, NC *handle, NC_dim *dim, int32 dimval_ver));
741 
742 HDFLIBAPI intn hdf_write_attr
743  PROTO((XDR *,NC *,NC_attr **));
744 
745 HDFLIBAPI int32 hdf_write_dim
746  PROTO((XDR *,NC *,NC_dim **,int32));
747 
748 HDFLIBAPI int32 hdf_write_var
749  PROTO((XDR *,NC *,NC_var **));
750 
751 HDFLIBAPI intn hdf_write_xdr_cdf
752  PROTO((XDR *,NC **));
753 
754 HDFLIBAPI intn hdf_conv_scales
755  PROTO((NC **));
756 
757 HDFLIBAPI intn hdf_read_dims
758  PROTO((XDR *,NC *,int32 ));
759 
760 HDFLIBAPI NC_array *hdf_read_attrs
761  PROTO((XDR *,NC *,int32 ));
762 
763 HDFLIBAPI intn hdf_read_vars
764  PROTO((XDR *,NC *,int32 ));
765 
766 HDFLIBAPI intn hdf_read_xdr_cdf
767  PROTO((XDR *,NC **));
768 
769 HDFLIBAPI intn hdf_xdr_cdf
770  PROTO((XDR *,NC **));
771 
772 HDFLIBAPI intn hdf_vg_clobber
773  PROTO((NC *,int ));
774 
775 HDFLIBAPI intn hdf_cdf_clobber
776  PROTO((NC *));
777 
778 HDFLIBAPI intn hdf_close
779  PROTO((NC *));
780 
781 HDFLIBAPI intn hdf_read_sds_dims
782  PROTO((NC *));
783 
784 HDFLIBAPI intn hdf_read_sds_cdf
785  PROTO((XDR *,NC **));
786 
787 HDFLIBAPI intn SDPfreebuf PROTO((void));
788 
789 HDFLIBAPI intn NCgenio
790  PROTO((NC *handle, int varid, const long *start, const long *count,
791  const long *stride, const long *imap, void *values));
792 
793 HDFLIBAPI intn NC_var_shape
794  PROTO((NC_var *var,NC_array *dims));
795 
796 HDFLIBAPI intn NC_reset_maxopenfiles
797  PROTO((intn req_max));
798 
799 HDFLIBAPI intn NC_get_maxopenfiles
800  PROTO(());
801 
802 HDFLIBAPI intn NC_get_systemlimit
803  PROTO(());
804 
805 HDFLIBAPI int NC_get_numopencdfs
806  PROTO(());
807 
808 /* CDF stuff. don't need anymore? -GV */
809 HDFLIBAPI nc_type cdf_unmap_type
810  PROTO((int type));
811 
812 HDFLIBAPI bool_t nssdc_read_cdf
813  PROTO((XDR *xdrs, NC **handlep));
814 
815 HDFLIBAPI bool_t nssdc_write_cdf
816  PROTO((XDR *xdrs, NC **handlep));
817 
818 HDFLIBAPI bool_t nssdc_xdr_cdf
819  PROTO((XDR *xdrs, NC **handlep));
820 
821 HDFLIBAPI intn HDiscdf
822  (const char *filename);
823 
824 HDFLIBAPI intn HDisnetcdf
825  (const char *filename);
826 
827 HDFLIBAPI intn HDisnetcdf64
828  (const char *filename);
829 
830 #endif /* HDF */
831 
832 #ifdef __cplusplus
833 }
834 #endif
835 
836 #endif /* _LOCAL_NC_ */
#define NC_re_string
Definition: local_nc.h:346
HDFFCLIBAPI intf intf intf * count
#define NC_xlen_cdf
Definition: local_nc.h:306
#define xdr_numrecs
Definition: local_nc.h:326
HDFFCLIBAPI intf * len
#define xdr_NC_dim
Definition: local_nc.h:330
#define nncacpy
Definition: local_nc.h:397
#define nc_serror
Definition: local_nc.h:300
nc_type
Definition: netcdf.h:253
#define NC_xlen_var
Definition: local_nc.h:310
HDFFCLIBAPI intf * block_size
#define nncsnc
Definition: local_nc.h:374
HDFFCLIBAPI _fcd _fcd intf intf * datatype
char * filename
Definition: cdjpeg.h:133
#define xdr_NC_iarray
Definition: local_nc.h:332
#define xdr_cdf
Definition: local_nc.h:325
#define NC_findattr
Definition: local_nc.h:342
#define nncdid
Definition: local_nc.h:366
HDFFCLIBAPI void intf dims[]
HDFFCLIBAPI intf intf * begin
#define NC_xlen_dim
Definition: local_nc.h:307
#define NCxdrfile_sync
Definition: local_nc.h:353
#define nncpopt
Definition: local_nc.h:361
#define NC_xlen_string
Definition: local_nc.h:309
#define Void
Definition: local_nc.h:70
#define NCcoordck
Definition: local_nc.h:350
#define nncadel
Definition: local_nc.h:400
#define NC_free_array
Definition: local_nc.h:314
#define NC_re_array
Definition: local_nc.h:340
#define nncvren
Definition: local_nc.h:391
#define nncvpt1
Definition: local_nc.h:379
#define nncvptc
Definition: local_nc.h:382
#define nncvptg
Definition: local_nc.h:383
hdf_vartype_t
Definition: mfhdfi.h:21
#define nncapt
Definition: local_nc.h:392
#define nncddef
Definition: local_nc.h:365
#define nncdren
Definition: local_nc.h:377
#define NC_free_cdf
Definition: local_nc.h:316
#define nncvg1c
Definition: local_nc.h:386
#define NC_xlen_iarray
Definition: local_nc.h:308
#define NCmemset
Definition: local_nc.h:311
#define NC_new_dim
Definition: local_nc.h:343
#define nncvggc
Definition: local_nc.h:390
#define xdr_shorts
Definition: local_nc.h:327
#define NCadvise
Definition: local_nc.h:301
#define NCvario
Definition: local_nc.h:349
#define nncvpgc
Definition: local_nc.h:384
#define NC_new_string
Definition: local_nc.h:345
#define xdr_NC_attr
Definition: local_nc.h:329
#define nncopn
Definition: local_nc.h:364
#define xdr_NC_string
Definition: local_nc.h:333
HDFFCLIBAPI _fcd name
#define nncinq
Definition: local_nc.h:373
#define MAX_VXR_ENTRIES
Definition: local_nc.h:113
#define NC_incr_array
Definition: local_nc.h:321
#define nncabor
Definition: local_nc.h:375
#define NC_new_array
Definition: local_nc.h:339
#define NC_arrayfill
Definition: local_nc.h:312
#define nncvinq
Definition: local_nc.h:378
#define nncagtc
Definition: local_nc.h:396
#define xdr_NCvshort
Definition: local_nc.h:351
#define NC_new_cdf
Definition: local_nc.h:338
#define NC_dcpy
Definition: local_nc.h:352
#define NC_new_attr
Definition: local_nc.h:341
#define NCcktype
Definition: local_nc.h:323
#define NC_hlookupvar
Definition: local_nc.h:347
HDFFCLIBAPI intf * size
HDFFCLIBAPI intf _fcd intf intf intf * values
#define nncendf
Definition: local_nc.h:372
#define nncvdef
Definition: local_nc.h:367
#define nnccre
Definition: local_nc.h:363
#define nncvp1c
Definition: local_nc.h:380
#define xdr_NC_array
Definition: local_nc.h:328
HDFFCLIBAPI _fcd _fcd intf * n
#define HDFFCLIBAPI
Definition: H4api_adpt.h:196
#define nncaren
Definition: local_nc.h:399
HDFFCLIBAPI intf * which
#define NC_xlen_array
Definition: local_nc.h:304
#define nnctlen
Definition: local_nc.h:369
#define NC_dimid
Definition: local_nc.h:322
#define nncgopt
Definition: local_nc.h:362
#define nncvgt
Definition: local_nc.h:387
#define NC_copy_arrayvals
Definition: local_nc.h:313
#define NC_xtypelen
Definition: local_nc.h:303
#define nncsfil
Definition: local_nc.h:401
#define nncclos
Definition: local_nc.h:370
#define NC_indefine
Definition: local_nc.h:324
#define PROTO(x)
Definition: local_nc.h:286
#define nncdinq
Definition: local_nc.h:376
#define nncvgtc
Definition: local_nc.h:388
HDFFCLIBAPI intf intf start[]
HDFFCLIBAPI void * data
#define NC_dup_cdf
Definition: local_nc.h:337
#define NC_computeshapes
Definition: local_nc.h:302
HDFFCLIBAPI intf * vgid
#define FILENAME_MAX
Definition: local_nc.h:30
#define xdr_NC_var
Definition: local_nc.h:334
#define NC_new_var
Definition: local_nc.h:348
#define xdr_NC_fill
Definition: local_nc.h:331
#define nncvgt1
Definition: local_nc.h:385
HDFFCLIBAPI intf intf intf * type
#define NC_free_dim
Definition: local_nc.h:317
#define nncredf
Definition: local_nc.h:371
#define NC_check_id
Definition: local_nc.h:336
HDFFCLIBAPI intf intf * flags
#define NC_typelen
Definition: local_nc.h:335
#define nncanam
Definition: local_nc.h:398
#define nncaptc
Definition: local_nc.h:393
HDFFCLIBAPI intf stride[]
Definition: local_nc.h:194
#define nncvid
Definition: local_nc.h:368
#define nncvpt
Definition: local_nc.h:381
#define HDFLIBAPI
Definition: H4api_adpt.h:195
#define NC_free_attr
Definition: local_nc.h:315
#define NC_free_iarray
Definition: local_nc.h:318
#define nncagt
Definition: local_nc.h:395
HDFLIBAPI const char * cdf_routine_name
Definition: local_nc.h:264
#define NC_new_iarray
Definition: local_nc.h:344
HDFFCLIBAPI intf * offset
int val
Definition: jpeglib.h:956
#define nncainq
Definition: local_nc.h:394
#define NC_xlen_attr
Definition: local_nc.h:305
#define NCxdrfile_create
Definition: local_nc.h:354
#define NC_free_string
Definition: local_nc.h:319
#define NC_free_var
Definition: local_nc.h:320
#define nncvgtg
Definition: local_nc.h:389
FILE * hdf_file_t
Definition: hfile.h:73

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