daputil.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. /* Define a set of flags to control path construction */
  9. #define PATHNC 1 /*Use ->ncname*/
  10. #define PATHELIDE 2 /*Leave out elided nodes*/
  11. /* mnemonic */
  12. #define WITHDATASET 1
  13. #define WITHOUTDATASET 0
  14. /* sigh!, Forwards */
  15. struct CDFnode;
  16. struct NCTMODEL;
  17. struct NCDAPCOMMON;
  18. extern nc_type nctypeconvert(struct NCDAPCOMMON*, nc_type);
  19. extern nc_type octypetonc(OCtype);
  20. extern OCtype nctypetodap(nc_type);
  21. extern size_t nctypesizeof(nc_type);
  22. extern char* nctypetostring(nc_type);
  23. extern char* maketmppath(char* path, char* prefix);
  24. extern void collectnodepath3(struct CDFnode*, NClist* path, int dataset);
  25. extern void collectocpath(OCconnection conn, OCobject node, NClist* path);
  26. extern char* makecdfpathstring3(struct CDFnode*,const char*);
  27. extern void clonenodenamepath3(struct CDFnode*, NClist*, int);
  28. extern char* makepathstring3(NClist* path, const char* separator, int flags);
  29. extern char* makeocpathstring3(OCconnection, OCobject, const char*);
  30. extern char* cdflegalname3(char* dapname);
  31. /* Given a param string; return its value or null if not found*/
  32. extern const char* paramvalue34(struct NCDAPCOMMON* drno, const char* param);
  33. /* Given a param string; check for a given substring */
  34. extern int paramcheck34(struct NCDAPCOMMON* drno, const char* param, const char* substring);
  35. extern int nclistconcat(NClist* l1, NClist* l2);
  36. extern int nclistminus(NClist* l1, NClist* l2);
  37. extern int nclistdeleteall(NClist* l1, ncelem);
  38. extern char* getvaraprint(void* gv);
  39. extern int dapinsequence(struct CDFnode* node);
  40. extern int daptopgrid(struct CDFnode* node);
  41. extern int daptopseq(struct CDFnode* node);
  42. extern int daptoplevel(struct CDFnode* node);
  43. extern int dapgridmap(struct CDFnode* node);
  44. extern int dapgridarray(struct CDFnode* node);
  45. extern int dapgridelement(struct CDFnode* node);
  46. extern unsigned int modeldecode(int, const char*, const struct NCTMODEL*, unsigned int);
  47. extern unsigned long getlimitnumber(const char* limit);
  48. extern void dapexpandescapes(char *termstring);
  49. /* Only used by libncdap4 */
  50. extern int alignbuffer3(NCbytes*, int alignment);
  51. extern size_t dimproduct3(NClist* dimensions);
  52. #if defined(DLL_NETCDF)
  53. # if defined(DLL_EXPORT)
  54. # define NCC_EXTRA __declspec(dllexport)
  55. #else
  56. # define NCC_EXTRA __declspec(dllimport)
  57. # endif
  58. NCC_EXTRA extern int nc__testurl(const char* path, char** basename);
  59. #else
  60. extern int nc__testurl(const char* parth, char** basename);
  61. #endif
  62. /* Provide a wrapper for oc_fetch so we can log what it does */
  63. extern OCerror dap_fetch(struct NCDAPCOMMON*,OCconnection,const char*,OCdxd,OCobject*);
  64. extern int dap_badname(char* name);
  65. extern char* dap_repairname(char* name);
  66. #endif /*DAPUTIL_H*/