File: ncdap3.h

package info (click to toggle)
netcdf 1%3A4.1.3-7.2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 46,040 kB
  • ctags: 25,265
  • sloc: ansic: 169,389; fortran: 17,742; sh: 13,203; cpp: 10,960; f90: 7,903; yacc: 2,832; xml: 2,129; makefile: 2,034; lex: 1,210
file content (179 lines) | stat: -rwxr-xr-x 5,827 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/*********************************************************************
  *   Copyright 1993, UCAR/Unidata
  *   See netcdf/COPYRIGHT file for copying and redistribution conditions.
  *   $Header: /upc/share/CVS/netcdf-3/libncdap3/ncdap3.h,v 1.40 2010/05/30 19:45:52 dmh Exp $
  *********************************************************************/
#ifndef NCDAP3_H
#define NCDAP3_H 1

#include "config.h"
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <string.h>
#include <stdio.h>

#include "ncbytes.h"
#include "nclist.h"
#include "nchashmap.h"
#include "nclog.h"
#include "dceconstraints.h"

#include "oc.h"
#include "ocuri.h"

#include "nc.h"
#include "netcdf.h"
#include "ncdispatch.h"
 /* netcdf overrides*/
#include "dapnc.h"

#include "dapdebug.h"
#include "daputil.h"

/**************************************************/
/* sigh, do the forwards */
struct NCprojection;
struct NCselection;
struct Getvara;
struct NCcachenode;
struct NCcache;
struct NCslice;
struct NCsegment;

/**************************************************/

#include "nccommon.h"
#include "getvara.h"
#include "constraints3.h"

/**************************************************/

#ifndef USE_NETCDF4
#define	NC_UBYTE 	7	/* unsigned 1 byte int */
#define	NC_USHORT 	8	/* unsigned 2-byte int */
#define	NC_UINT 	9	/* unsigned 4-byte int */
#define	NC_INT64 	10	/* signed 8-byte int */
#define	NC_UINT64 	11	/* unsigned 8-byte int */
#define	NC_STRING 	12	/* string */

#define NC_MAX_BYTE 127
#define NC_MIN_BYTE (-NC_MAX_BYTE-1)
#define NC_MAX_CHAR 255
#define NC_MAX_SHORT 32767
#define NC_MIN_SHORT (-NC_MAX_SHORT - 1)
#define NC_MAX_INT 2147483647
#define NC_MIN_INT (-NC_MAX_INT - 1)
#define NC_MAX_FLOAT 3.402823466e+38f
#define NC_MIN_FLOAT (-NC_MAX_FLOAT)
#define NC_MAX_DOUBLE 1.7976931348623157e+308 
#define NC_MIN_DOUBLE (-NC_MAX_DOUBLE)
#define NC_MAX_UBYTE NC_MAX_CHAR
#define NC_MAX_USHORT 65535U
#define NC_MAX_UINT 4294967295U
#define NC_MAX_INT64 (9223372036854775807LL)
#define NC_MIN_INT64 (-9223372036854775807LL-1)
#define NC_MAX_UINT64 (18446744073709551615ULL)
#define X_INT64_MAX     (9223372036854775807LL)
#define X_INT64_MIN     (-X_INT64_MAX - 1)
#define X_UINT64_MAX    (18446744073709551615ULL)
#endif /*USE_NETCDF4*/


/**************************************************/
/* The NCDAP3 structure is an extension of the NC structure (libsrc/nc.h) */

typedef struct NCDAP3 {
    NC nc; /* Used to store meta-data */
    NCDAPCOMMON dap;
} NCDAP3;

/**************************************************/

extern struct NCTMODEL nctmodels[];

/**************************************************/
/* Import some internal procedures from libsrc*/

#ifdef IGNORE
extern void drno_add_to_NCList(struct NC *ncp);
extern void drno_del_from_NCList(struct NC *ncp);
extern void drno_free_NC(struct NC *ncp);
extern struct NC* drno_new_NC(const size_t *chunkp);
extern void drno_set_numrecs(NC* ncp, size_t size);
extern size_t drno_get_numrecs(NC* ncp);
extern int drno_ncio_open(NC* ncp, const char* path, int mode);
#endif

 /* Internal, but non-static procedures */
extern NCerror computecdfvarnames3(NCDAPCOMMON*,CDFnode*,NClist*);
extern NCerror computecdfnodesets3(NCDAPCOMMON* drno);
extern NCerror computevarnodes3(NCDAPCOMMON*, NClist*, NClist*);
extern NCerror collectvardefdims(NCDAPCOMMON* drno, CDFnode* var, NClist* dimset);
extern NCerror fixgrids3(NCDAPCOMMON* drno);
extern NCerror dapmerge3(NCDAPCOMMON* drno, CDFnode* node, OCobject dasroot);
extern NCerror sequencecheck3(NCDAPCOMMON* drno);
extern NCerror computecdfdimnames3(NCDAPCOMMON*);
extern NCerror attachdatadds3(struct NCDAPCOMMON*);
extern NCerror detachdatadds3(struct NCDAPCOMMON*);
extern void dapdispatch3init(void);

/*
extern void dereference3(NCconstraint* constraint);
extern NCerror rereference3(NCconstraint*, NClist*);
*/

extern NCerror buildvaraprojection3(struct Getvara*,
		     const size_t* startp, const size_t* countp, const ptrdiff_t* stridep,
		     struct DCEprojection** projectionlist);

extern NCerror nc3d_getvarx(int ncid, int varid,
	    const size_t *startp,
	    const size_t *countp,
	    const ptrdiff_t *stridep,
	    void *data,
	    nc_type dsttype0);

/**************************************************/

/* From: ncdap3.c*/
extern NCerror nc3d_open(const char* path, int mode, int* ncidp);
extern int nc3d_close(int ncid);
extern int nc3dinitialize(void);
extern NCerror regrid3(CDFnode* ddsroot, CDFnode* template, NClist*);
extern NCerror imprint3(CDFnode* dstroot, CDFnode* srcroot);
extern void unimprint3(CDFnode* root);
extern NCerror imprintself3(CDFnode* root);
extern void setvisible(CDFnode* root, int visible);

/* From: ncdap3a.c*/
extern NCerror fetchtemplatemetadata3(NCDAPCOMMON* nccomm);
extern NCerror fetchconstrainedmetadata3(NCDAPCOMMON* nccomm);
extern void applyclientparamcontrols3(NCDAPCOMMON*);
extern NCerror suppressunusablevars3(NCDAPCOMMON*);
extern NCerror addstringdims(NCDAP3* drno);
extern NCerror defseqdims(NCDAP3* drno);
extern NCerror fixzerodims3(NCDAPCOMMON*);
extern void estimatevarsizes3(NCDAPCOMMON*);
extern NCerror defrecorddim3(NCDAP3*);
extern NClist* getalldims3(NClist* vars, int visibleonly);
extern NCerror showprojection3(NCDAP3*, CDFnode* var);


/* From: dapcvt.c*/
extern NCerror dapconvert3(nc_type, nc_type, char*, char*, size_t);
extern int dapcvtattrval3(nc_type, void*, NClist*);

#ifdef IGNORE
/* allow access url parse and params without exposing ocuri.h */
extern int NCDAP_urlparse(const char* s, void** dapurl);
extern void NCDAP_urlfree(void* dapurl);
extern const char* NCDAP_urllookup(void* dapurl, const char* param);
#endif

extern size_t dapzerostart3[NC_MAX_VAR_DIMS];
extern size_t dapsinglecount3[NC_MAX_VAR_DIMS];
extern ptrdiff_t dapsinglestride3[NC_MAX_VAR_DIMS];

#endif /*NCDAP3_H*/