source: XIOS/trunk/extern/src_netcdf4/dapdebug.c @ 409

Last change on this file since 409 was 409, checked in by ymipsl, 11 years ago

Add improved nectdf internal library src

YM

  • Property svn:eol-style set to native
File size: 1016 bytes
Line 
1/*********************************************************************
2 *   Copyright 1993, UCAR/Unidata
3 *   See netcdf/COPYRIGHT file for copying and redistribution conditions.
4 *   $Header: /upc/share/CVS/netcdf-3/libncdap3/dapdebug.c,v 1.9 2009/09/23 22:26:00 dmh Exp $
5 *********************************************************************/
6#include "config.h"
7#include <stdarg.h>
8#include <stdio.h>
9
10#include "nclog.h"
11#include "oc.h"
12#include "dapdebug.h"
13
14int ncdap3debug = 0;
15
16#ifdef CATCHERROR
17/* Place breakpoint here to catch errors close to where they occur*/
18int
19dapbreakpoint(int err) {return err;}
20
21int
22dapthrow(int err)
23{
24    if(err == 0) return err;
25    return dapbreakpoint(err);
26}
27#endif
28
29int
30dappanic(const char* fmt, ...)
31{
32    va_list args;
33    if(fmt != NULL) {
34      va_start(args, fmt);
35      vfprintf(stderr, fmt, args);
36      fprintf(stderr, "\n" );
37      va_end( args );
38    } else {
39      fprintf(stderr, "panic" );
40    }
41    fprintf(stderr, "\n" );
42    fflush(stderr);
43    return 0;
44}
Note: See TracBrowser for help on using the repository browser.