netcdf-c/libdap4/d4debug.h
Dennis Heimbigner 65414eeaa4 Fix some protocol differences between netcdf-c and the Hyrax server.
re: Partly addresses issue https://github.com/Unidata/netcdf-c/issues/1712.

1. Turn on Hyrax Hack to accept Hyrax style attribute containers.
2. Support Url type as alias for String.
3. Accept the special attribute, "__DAP4_Checksum_CRC32",
   to control per-variable checksums.
4. Make _DAP4_xxx attributes be reserved and only accessible
   by name (ala _SuperBlock attribute).
5. Fix handling of checksums. There is a hack in the code
   that uses an extra flag in the chunk header to indicate
   that all variables have checksums. This violates the spec
   and will be removed once it is possible to regenerate the
   test cases.

Note that checksumming with the Hyrax test server has not
been tested. This, along with some other probable inconsistencies,
needs fixing when OPeNDAP and Unidata can agree on the proper
specification. Testing will be included.
2020-05-30 17:36:25 -06:00

70 lines
1.7 KiB
C

/*********************************************************************
* Copyright 2018, UCAR/Unidata
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
*********************************************************************/
#ifndef D4DEBUG_H
#define D4DEBUG_H
#include <assert.h>
#include <stdarg.h>
#undef D4DEBUG /* general debug */
#undef D4DEBUGPARSER
#undef D4DEBUGMETA
#undef D4DUMPDAP
#undef D4DUMPRAW
#undef D4DEBUGDATA
#undef D4DUMPDMR
#undef D4DUMPCSUM
#ifdef D4DEBUG
#define D4DEBUGPARSER
#define D4DEBUGMETA
#define D4DEBUGDATA
#define D4DUMPCSUM
#define D4DUMPDMR
#define D4DUMPDAP
#endif
#undef D4CATCH /* Warning: significant performance impact */
#define PANIC(msg) assert(d4panic(msg));
#define PANIC1(msg,arg) assert(d4panic(msg,arg));
#define PANIC2(msg,arg1,arg2) assert(d4panic(msg,arg1,arg2));
#define ASSERT(expr) if(!(expr)) {PANIC(#expr);} else {}
extern int ncd4debug;
extern int d4panic(const char* fmt, ...);
#define MEMCHECK(var) {if((var)==NULL) return (NC_ENOMEM);}
#ifdef D4CATCH
/* Place breakpoint on dapbreakpoint to catch errors close to where they occur*/
#define THROW(e) d4throw(e)
#define THROWCHK(e) (void)d4throw(e)
extern int d4breakpoint(int err);
extern int d4throw(int err);
#else
#define THROW(e) (e)
#define THROWCHK(e)
#endif
#ifdef D4DEBUG
#define SHOWFETCH (1)
#else
#define SHOWFETCH FLAGSET(nccomm->controls,NCF_SHOWFETCH)
#endif
#define LOG0(level,msg) nclog(level,msg)
#define LOG1(level,msg,a1) nclog(level,msg,a1)
#define LOG2(level,msg,a1,a2) nclog(level,msg,a1,a2)
extern const char* NCD4_sortname(NCD4sort sort);
extern const char* NCD4_subsortname(nc_type subsort);
extern int NCD4_debugcopy(NCD4INFO* info);
#endif /*D4DEBUG_H*/