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