forked from Unidata/netcdf-c
/
dapdebug.c
55 lines (48 loc) · 1.07 KB
/
dapdebug.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*********************************************************************
* Copyright 1993, UCAR/Unidata
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
*********************************************************************/
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include "dapincludes.h"
#include "nclog.h"
int ncdap3debug = 0;
#ifdef CATCHERROR
/* Place breakpoint here to catch errors close to where they occur*/
int
dapbreakpoint(int err) {return err;}
int
dapthrow(int err)
{
if(err == 0) return err;
return dapbreakpoint(err);
}
#endif
int
dappanic(const char* fmt, ...)
{
va_list args;
if(fmt != NULL) {
va_start(args, fmt);
vfprintf(stderr, fmt, args);
fprintf(stderr, "\n" );
va_end( args );
} else {
fprintf(stderr, "panic" );
}
fprintf(stderr, "\n" );
fflush(stderr);
return 0;
}
/*
Provide a way to print the oc full name for
an ocnode
*/
char*
ocfqn(OCddsnode node)
{
OClink conn;
oc_get_connection(node,&conn);
return makeocpathstring(conn,node,".");
}