ncdap3.h 4.6 KB

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