1 | /********************************************************************* |
---|
2 | * Copyright 1993, UCAR/Unidata |
---|
3 | * See netcdf/COPYRIGHT file for copying and redistribution conditions. |
---|
4 | * $Header: /upc/share/CVS/netcdf-3/libncdap3/daputil.h,v 1.25 2010/05/05 22:15:16 dmh Exp $ |
---|
5 | *********************************************************************/ |
---|
6 | #ifndef DAPUTIL_H |
---|
7 | #define DAPUTIL_H 1 |
---|
8 | |
---|
9 | /* Define a set of flags to control path construction */ |
---|
10 | #define PATHNC 1 /*Use ->ncname*/ |
---|
11 | #define PATHELIDE 2 /*Leave out elided nodes*/ |
---|
12 | |
---|
13 | /* mnemonic */ |
---|
14 | #define WITHDATASET 1 |
---|
15 | #define WITHOUTDATASET 0 |
---|
16 | |
---|
17 | /* sigh!, Forwards */ |
---|
18 | struct CDFnode; |
---|
19 | struct NCTMODEL; |
---|
20 | struct NCDAPCOMMON; |
---|
21 | |
---|
22 | extern nc_type nctypeconvert(struct NCDAPCOMMON*, nc_type); |
---|
23 | extern nc_type octypetonc(OCtype); |
---|
24 | extern OCtype nctypetodap(nc_type); |
---|
25 | extern size_t nctypesizeof(nc_type); |
---|
26 | extern char* nctypetostring(nc_type); |
---|
27 | extern char* maketmppath(char* path, char* prefix); |
---|
28 | |
---|
29 | extern void collectnodepath3(struct CDFnode*, NClist* path, int dataset); |
---|
30 | extern void collectocpath(OCconnection conn, OCobject node, NClist* path); |
---|
31 | |
---|
32 | extern char* makecdfpathstring3(struct CDFnode*,const char*); |
---|
33 | extern void clonenodenamepath3(struct CDFnode*, NClist*, int); |
---|
34 | extern char* makepathstring3(NClist* path, const char* separator, int flags); |
---|
35 | |
---|
36 | extern char* makeocpathstring3(OCconnection, OCobject, const char*); |
---|
37 | |
---|
38 | extern char* cdflegalname3(char* dapname); |
---|
39 | |
---|
40 | /* Given a param string; return its value or null if not found*/ |
---|
41 | extern const char* paramvalue34(struct NCDAPCOMMON* drno, const char* param); |
---|
42 | /* Given a param string; check for a given substring */ |
---|
43 | extern int paramcheck34(struct NCDAPCOMMON* drno, const char* param, const char* substring); |
---|
44 | |
---|
45 | extern int nclistconcat(NClist* l1, NClist* l2); |
---|
46 | extern int nclistminus(NClist* l1, NClist* l2); |
---|
47 | extern int nclistdeleteall(NClist* l1, ncelem); |
---|
48 | |
---|
49 | extern char* getvaraprint(void* gv); |
---|
50 | |
---|
51 | extern int dapinsequence(struct CDFnode* node); |
---|
52 | extern int daptopgrid(struct CDFnode* node); |
---|
53 | extern int daptopseq(struct CDFnode* node); |
---|
54 | extern int daptoplevel(struct CDFnode* node); |
---|
55 | extern int dapgridmap(struct CDFnode* node); |
---|
56 | extern int dapgridarray(struct CDFnode* node); |
---|
57 | extern int dapgridelement(struct CDFnode* node); |
---|
58 | |
---|
59 | extern unsigned int modeldecode(int, const char*, const struct NCTMODEL*, unsigned int); |
---|
60 | extern unsigned long getlimitnumber(const char* limit); |
---|
61 | |
---|
62 | extern void dapexpandescapes(char *termstring); |
---|
63 | |
---|
64 | /* Only used by libncdap4 */ |
---|
65 | extern int alignbuffer3(NCbytes*, int alignment); |
---|
66 | extern size_t dimproduct3(NClist* dimensions); |
---|
67 | |
---|
68 | #if defined(DLL_NETCDF) |
---|
69 | # if defined(DLL_EXPORT) |
---|
70 | # define NCC_EXTRA __declspec(dllexport) |
---|
71 | #else |
---|
72 | # define NCC_EXTRA __declspec(dllimport) |
---|
73 | # endif |
---|
74 | NCC_EXTRA extern int nc__testurl(const char* path, char** basename); |
---|
75 | #else |
---|
76 | extern int nc__testurl(const char* parth, char** basename); |
---|
77 | #endif |
---|
78 | |
---|
79 | |
---|
80 | /* Provide a wrapper for oc_fetch so we can log what it does */ |
---|
81 | extern OCerror dap_fetch(struct NCDAPCOMMON*,OCconnection,const char*,OCdxd,OCobject*); |
---|
82 | |
---|
83 | extern int dap_badname(char* name); |
---|
84 | extern char* dap_repairname(char* name); |
---|
85 | |
---|
86 | #endif /*DAPUTIL_H*/ |
---|