1 | /********************************************************************* |
---|
2 | * Copyright 1993, UCAR/Unidata |
---|
3 | * See netcdf/COPYRIGHT file for copying and redistribution conditions. |
---|
4 | * $Header: /upc/share/CVS/netcdf-3/libncdap3/ncdap3.h,v 1.40 2010/05/30 19:45:52 dmh Exp $ |
---|
5 | *********************************************************************/ |
---|
6 | #ifndef NCDAP3_H |
---|
7 | #define NCDAP3_H 1 |
---|
8 | |
---|
9 | #include "config.h" |
---|
10 | #include <stdlib.h> |
---|
11 | #include <unistd.h> |
---|
12 | #include <fcntl.h> |
---|
13 | #include <sys/stat.h> |
---|
14 | #include <string.h> |
---|
15 | #include <stdio.h> |
---|
16 | |
---|
17 | #include "ncbytes.h" |
---|
18 | #include "nclist.h" |
---|
19 | #include "nchashmap.h" |
---|
20 | #include "nclog.h" |
---|
21 | #include "nc_uri.h" |
---|
22 | #include "fbits.h" |
---|
23 | #include "dceconstraints.h" |
---|
24 | |
---|
25 | #include "oc.h" |
---|
26 | |
---|
27 | #include "nc.h" |
---|
28 | #include "netcdf.h" |
---|
29 | #include "ncdispatch.h" |
---|
30 | /* netcdf overrides*/ |
---|
31 | #include "dapnc.h" |
---|
32 | |
---|
33 | #include "dapdebug.h" |
---|
34 | #include "daputil.h" |
---|
35 | |
---|
36 | /**************************************************/ |
---|
37 | /* sigh, do the forwards */ |
---|
38 | struct NCprojection; |
---|
39 | struct NCselection; |
---|
40 | struct Getvara; |
---|
41 | struct NCcachenode; |
---|
42 | struct NCcache; |
---|
43 | struct NCslice; |
---|
44 | struct NCsegment; |
---|
45 | |
---|
46 | /**************************************************/ |
---|
47 | |
---|
48 | #include "nccommon.h" |
---|
49 | #include "getvara.h" |
---|
50 | #include "constraints3.h" |
---|
51 | |
---|
52 | /**************************************************/ |
---|
53 | |
---|
54 | #ifndef USE_NETCDF4 |
---|
55 | #define NC_UBYTE 7 /* unsigned 1 byte int */ |
---|
56 | #define NC_USHORT 8 /* unsigned 2-byte int */ |
---|
57 | #define NC_UINT 9 /* unsigned 4-byte int */ |
---|
58 | #define NC_INT64 10 /* signed 8-byte int */ |
---|
59 | #define NC_UINT64 11 /* unsigned 8-byte int */ |
---|
60 | #define NC_STRING 12 /* string */ |
---|
61 | |
---|
62 | #define NC_MAX_BYTE 127 |
---|
63 | #define NC_MIN_BYTE (-NC_MAX_BYTE-1) |
---|
64 | #define NC_MAX_CHAR 255 |
---|
65 | #define NC_MAX_SHORT 32767 |
---|
66 | #define NC_MIN_SHORT (-NC_MAX_SHORT - 1) |
---|
67 | #define NC_MAX_INT 2147483647 |
---|
68 | #define NC_MIN_INT (-NC_MAX_INT - 1) |
---|
69 | #define NC_MAX_FLOAT 3.402823466e+38f |
---|
70 | #define NC_MIN_FLOAT (-NC_MAX_FLOAT) |
---|
71 | #define NC_MAX_DOUBLE 1.7976931348623157e+308 |
---|
72 | #define NC_MIN_DOUBLE (-NC_MAX_DOUBLE) |
---|
73 | #define NC_MAX_UBYTE NC_MAX_CHAR |
---|
74 | #define NC_MAX_USHORT 65535U |
---|
75 | #define NC_MAX_UINT 4294967295U |
---|
76 | #define NC_MAX_INT64 (9223372036854775807LL) |
---|
77 | #define NC_MIN_INT64 (-9223372036854775807LL-1) |
---|
78 | #define NC_MAX_UINT64 (18446744073709551615ULL) |
---|
79 | #define X_INT64_MAX (9223372036854775807LL) |
---|
80 | #define X_INT64_MIN (-X_INT64_MAX - 1) |
---|
81 | #define X_UINT64_MAX (18446744073709551615ULL) |
---|
82 | #endif /*USE_NETCDF4*/ |
---|
83 | |
---|
84 | |
---|
85 | /**************************************************/ |
---|
86 | |
---|
87 | extern struct NCTMODEL nctmodels[]; |
---|
88 | |
---|
89 | /**************************************************/ |
---|
90 | /* Import some internal procedures from libsrc*/ |
---|
91 | |
---|
92 | /* Internal, but non-static procedures */ |
---|
93 | extern NCerror computecdfvarnames3(NCDAPCOMMON*,CDFnode*,NClist*); |
---|
94 | extern NCerror computecdfnodesets3(NCDAPCOMMON* drno); |
---|
95 | extern NCerror computevarnodes3(NCDAPCOMMON*, NClist*, NClist*); |
---|
96 | extern NCerror collectvardefdims(NCDAPCOMMON* drno, CDFnode* var, NClist* dimset); |
---|
97 | extern NCerror fixgrids3(NCDAPCOMMON* drno); |
---|
98 | extern NCerror dapmerge3(NCDAPCOMMON* drno, CDFnode* node, OCobject dasroot); |
---|
99 | extern NCerror sequencecheck3(NCDAPCOMMON* drno); |
---|
100 | extern NCerror computecdfdimnames3(NCDAPCOMMON*); |
---|
101 | extern NCerror attachdatadds3(struct NCDAPCOMMON*); |
---|
102 | extern NCerror detachdatadds3(struct NCDAPCOMMON*); |
---|
103 | extern void dapdispatch3init(void); |
---|
104 | |
---|
105 | /* |
---|
106 | extern void dereference3(NCconstraint* constraint); |
---|
107 | extern NCerror rereference3(NCconstraint*, NClist*); |
---|
108 | */ |
---|
109 | |
---|
110 | extern NCerror buildvaraprojection3(struct Getvara*, |
---|
111 | const size_t* startp, const size_t* countp, const ptrdiff_t* stridep, |
---|
112 | struct DCEprojection** projectionlist); |
---|
113 | |
---|
114 | extern NCerror nc3d_getvarx(int ncid, int varid, |
---|
115 | const size_t *startp, |
---|
116 | const size_t *countp, |
---|
117 | const ptrdiff_t *stridep, |
---|
118 | void *data, |
---|
119 | nc_type dsttype0); |
---|
120 | |
---|
121 | /**************************************************/ |
---|
122 | |
---|
123 | /* From: ncdap3.c*/ |
---|
124 | extern NCerror nc3d_open(const char* path, int mode, int* ncidp); |
---|
125 | extern int nc3d_close(int ncid); |
---|
126 | extern int nc3dinitialize(void); |
---|
127 | extern NCerror regrid3(CDFnode* ddsroot, CDFnode* template, NClist*); |
---|
128 | extern void setvisible(CDFnode* root, int visible); |
---|
129 | extern NCerror mapnodes3(CDFnode* dstroot, CDFnode* srcroot); |
---|
130 | extern void unmap3(CDFnode* root); |
---|
131 | |
---|
132 | /* From: ncdap3a.c*/ |
---|
133 | extern NCerror fetchtemplatemetadata3(NCDAPCOMMON* nccomm); |
---|
134 | extern NCerror fetchconstrainedmetadata3(NCDAPCOMMON* nccomm); |
---|
135 | extern void applyclientparamcontrols3(NCDAPCOMMON*); |
---|
136 | extern NCerror suppressunusablevars3(NCDAPCOMMON*); |
---|
137 | extern NCerror addstringdims(NCDAPCOMMON* drno); |
---|
138 | extern NCerror defseqdims(NCDAPCOMMON* drno); |
---|
139 | extern NCerror fixzerodims3(NCDAPCOMMON*); |
---|
140 | extern void estimatevarsizes3(NCDAPCOMMON*); |
---|
141 | extern NCerror defrecorddim3(NCDAPCOMMON*); |
---|
142 | extern NCerror showprojection3(NCDAPCOMMON*, CDFnode* var); |
---|
143 | |
---|
144 | |
---|
145 | /* From: dapcvt.c*/ |
---|
146 | extern NCerror dapconvert3(nc_type, nc_type, char*, char*, size_t); |
---|
147 | extern int dapcvtattrval3(nc_type, void*, NClist*); |
---|
148 | |
---|
149 | #endif /*NCDAP3_H*/ |
---|