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);
|
|
|
|
|
2014-03-25 04:02:52 +08:00
|
|
|
extern void collectnodepath(struct CDFnode*, NClist* path, int dataset);
|
2012-08-01 04:34:13 +08:00
|
|
|
extern void collectocpath(OClink conn, OCobject node, NClist* path);
|
2012-02-04 05:31:50 +08:00
|
|
|
|
2014-03-25 04:02:52 +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
|
|
|
|
2014-03-25 04:02:52 +08:00
|
|
|
extern char* makeocpathstring(OClink, OCobject, const char*);
|
2011-04-18 02:56:10 +08:00
|
|
|
|
2014-03-25 04:02:52 +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*/
|
2014-03-25 04:02:52 +08:00
|
|
|
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 */
|
2014-03-25 04:02:52 +08:00
|
|
|
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);
|
2012-08-20 05:12:35 +08:00
|
|
|
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);
|
2013-03-03 12:06:43 +08:00
|
|
|
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 */
|
2014-03-25 04:02:52 +08:00
|
|
|
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 */
|
2014-03-12 01:58:22 +08:00
|
|
|
extern NCerror dap_fetch(struct NCDAPCOMMON*,OClink,const char*,OCdxd,OCobject*);
|
2011-04-18 02:56:10 +08:00
|
|
|
|
2011-05-13 01:51:32 +08:00
|
|
|
extern int dap_badname(char* name);
|
2012-04-09 06:47:38 +08:00
|
|
|
extern char* dap_repairname(char* name);
|
2017-03-09 08:01:10 +08:00
|
|
|
extern char* dap_getselection(NCURI* uri);
|
2011-05-13 01:51:32 +08:00
|
|
|
|
2011-04-18 02:56:10 +08:00
|
|
|
#endif /*DAPUTIL_H*/
|