mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-12-09 08:11:38 +08:00
715a6fe5eb
were added to provide a path name converter from e.g. cygwin paths to e.g. windows paths. This is necessary because the shell scripts may produce cygwin paths, but the code may have been compiled with Visual Studio. Similar issues arise with Mingw. At appropriate places, and if using Visual Studio or Mingw, I added calls to the path conversion code. Apparently I forgot to find all the places where this conversion was needed. So this pr does the following: 1. Push the calls to the converter to the various libXXX directories and out of libdispatch/dfile.c. 2. Add conversion calls to other parts of the code like oc2. I also turns out that conversion code in dapcvt.c had a bug when handling DAP Byte type under visual studio. Notes: 1. there may still be places I missed that need to do path conversion. 2. need to make sure that calls to e.g. H5open also use converted path.
60 lines
1.2 KiB
C
60 lines
1.2 KiB
C
/*********************************************************************
|
|
* 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, int lineno, const char* filename)
|
|
{
|
|
if(err == 0) return err;
|
|
fprintf(stderr,"$dapthrow: err=%d line=%d file=%s\n",err,lineno,filename); fflush(stderr);
|
|
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,".");
|
|
}
|