netcdf-c/libdap2/daputil.h

78 lines
2.8 KiB
C
Raw Normal View History

2011-04-18 02:56:10 +08:00
/*********************************************************************
2018-12-07 05:21:03 +08:00
* Copyright 2018, UCAR/Unidata
2011-04-18 02:56:10 +08:00
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
*********************************************************************/
#ifndef DAPUTIL_H
#define DAPUTIL_H 1
2012-02-04 05:31:50 +08:00
/* Define a set of flags to control path construction */
#define PATHNC 1 /*Use ->ncname*/
#define PATHELIDE 2 /*Leave out elided nodes*/
/* mnemonic */
#define WITHDATASET 1
#define WITHOUTDATASET 0
2011-04-18 02:56:10 +08:00
/* sigh!, Forwards */
struct CDFnode;
struct NCTMODEL;
struct NCDAPCOMMON;
extern nc_type nctypeconvert(struct NCDAPCOMMON*, nc_type);
extern nc_type octypetonc(OCtype);
extern OCtype nctypetodap(nc_type);
extern size_t nctypesizeof(nc_type);
extern char* nctypetostring(nc_type);
extern char* maketmppath(char* path, char* prefix);
extern void collectnodepath(struct CDFnode*, NClist* path, int dataset);
extern void collectocpath(OClink conn, OCobject node, NClist* path);
2012-02-04 05:31:50 +08:00
extern char* makecdfpathstring(struct CDFnode*,const char*);
extern void clonenodenamepath(struct CDFnode*, NClist*, int);
extern char* makepathstring(NClist* path, const char* separator, int flags);
2012-02-04 05:31:50 +08:00
extern char* makeocpathstring(OClink, OCobject, const char*);
2011-04-18 02:56:10 +08:00
extern char* cdflegalname(char* dapname);
2011-04-18 02:56:10 +08:00
2011-11-14 12:20:19 +08:00
/* Given a param string; return its value or null if not found*/
extern const char* dapparamvalue(struct NCDAPCOMMON* drno, const char* param);
2011-04-18 02:56:10 +08:00
/* Given a param string; check for a given substring */
extern int dapparamcheck(struct NCDAPCOMMON* drno, const char* param, const char* substring);
2011-04-18 02:56:10 +08:00
extern int nclistconcat(NClist* l1, NClist* l2);
extern int nclistminus(NClist* l1, NClist* l2);
extern int nclistdeleteall(NClist* l1, void*);
2011-04-18 02:56:10 +08:00
extern char* getvaraprint(void* gv);
extern int dapinsequence(struct CDFnode* node);
extern int dapinstructarray(struct CDFnode* node);
2011-04-18 02:56:10 +08:00
extern int daptopgrid(struct CDFnode* node);
extern int daptopseq(struct CDFnode* node);
extern int daptoplevel(struct CDFnode* node);
extern int dapgridmap(struct CDFnode* node);
extern int dapgridarray(struct CDFnode* node);
extern int dapgridelement(struct CDFnode* node);
extern unsigned int modeldecode(int, const char*, const struct NCTMODEL*, unsigned int);
extern unsigned long getlimitnumber(const char* limit);
extern void dapexpandescapes(char *termstring);
/* Only used by libncdap4 */
extern int dapalignbuffer(NCbytes*, int alignment);
extern size_t dapdimproduct(NClist* dimensions);
2011-04-18 02:56:10 +08:00
/* Provide a wrapper for oc_fetch so we can log what it does */
extern NCerror dap_fetch(struct NCDAPCOMMON*,OClink,const char*,OCdxd,OCobject*);
2011-04-18 02:56:10 +08:00
extern int dap_badname(char* name);
extern char* dap_repairname(char* name);
Primary change: add dap4 support Specific changes: 1. Add dap4 code: libdap4 and dap4_test. Note that until the d4ts server problem is solved, dap4 is turned off. 2. Modify various files to support dap4 flags: configure.ac, Makefile.am, CMakeLists.txt, etc. 3. Add nc_test/test_common.sh. This centralizes the handling of the locations of various things in the build tree: e.g. where is ncgen.exe located. See nc_test/test_common.sh for details. 4. Modify .sh files to use test_common.sh 5. Obsolete separate oc2 by moving it to be part of netcdf-c. This means replacing code with netcdf-c equivalents. 5. Add --with-testserver to configure.ac to allow override of the servers to be used for --enable-dap-remote-tests. 6. There were multiple versions of nctypealignment code. Try to centralize in libdispatch/doffset.c and include/ncoffsets.h 7. Add a unit test for the ncuri code because of its complexity. 8. Move the findserver code out of libdispatch and into a separate, self contained program in ncdap_test and dap4_test. 9. Move the dispatch header files (nc{3,4}dispatch.h) to .../include because they are now shared by modules. 10. Revamp the handling of TOPSRCDIR and TOPBUILDDIR for shell scripts. 11. Make use of MREMAP if available 12. Misc. minor changes e.g. - #include <config.h> -> #include "config.h" - Add some no-install headers to /include - extern -> EXTERNL and vice versa as needed - misc header cleanup - clean up checking for misc. unix vs microsoft functions 13. Change copyright decls in some files to point to LICENSE file. 14. Add notes to RELEASENOTES.md
2017-03-09 08:01:10 +08:00
extern char* dap_getselection(NCURI* uri);
Yet another fix for DAP2 double URL encoding. re: https://github.com/Unidata/netcdf-c/issues/1876 and: https://github.com/Unidata/netcdf-c/pull/1835 and: https://github.com/Unidata/netcdf4-python/issues/1041 The change in PR 1835 was correct with respect to using %20 instead of '+' for encoding blanks. However, it was a mistake to assume everything was unencoded and then to do encoding ourselves. The problem is that different servers do different things, with Columbia being an outlier. So, I have added a set of client controls that can at least give the caller some control over this. The caller can append the following fragment to his URL to control what gets encoded before sending it to the server. The syntax is as follows: ```` https://<host>/<path>/<query>#encode=path|query|all|none ```` The possible values: * path -- URL encode (i.e. %xx encode) as needed in the path part of the URL. * query -- URL encode as needed in the query part of the URL. * all -- equivalent to ````#encode=path,query````. * none -- do not url encode any part of the URL sent to the server; not strictly necessary, so mostly for completeness. Note that if "encode=" is used, then before it is processed, all encoding is turned of so that ````#encode=path```` will only encode the path and not the query. The default is ````#encode=query````, so the path is left untouched, but the query is always encoded. Internally, this required changes to pass the encode flags down into the OC2 library. Misc. Unrelated Changes: * Shut up those irritating warning from putget.m4
2020-11-06 02:04:56 +08:00
extern int dapparamparselist(const char* s0, int delim, NClist* list);
2011-04-18 02:56:10 +08:00
#endif /*DAPUTIL_H*/