Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ SET(PACKAGE_VERSION ${VERSION})

# Version of the dispatch table. This must match the value in
# configure.ac.
SET(NC_DISPATCH_VERSION 2)
SET(NC_DISPATCH_VERSION 3)

# Get system configuration, Use it to determine osname, os release, cpu. These
# will be used when committing to CDash.
Expand Down Expand Up @@ -163,8 +163,6 @@ SET(EXTRA_DEPS "")
# Set CTest Properties
################################



ENABLE_TESTING()
INCLUDE(CTest)

Expand Down Expand Up @@ -262,6 +260,7 @@ ENDIF()
#####
# System inspection checks
#####
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/oc2)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/libsrc)
Expand Down Expand Up @@ -2206,6 +2205,13 @@ configure_file(
${netCDF_SOURCE_DIR}/include/netcdf_meta.h.in
${netCDF_BINARY_DIR}/include/netcdf_meta.h @ONLY)

#####
# Create 'netcdf_dispatch.h' include file.
#####
configure_file(
${netCDF_SOURCE_DIR}/include/netcdf_dispatch.h.in
${netCDF_BINARY_DIR}/include/netcdf_dispatch.h @ONLY NEWLINE_STYLE LF)

#####
# Build test_common.sh
#####
Expand Down
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This file contains a high-level description of this package's evolution. Release

## 4.8.0 - TBD

* [Enhancement] Bump the NC_DISPATCH_VERSION from 2 to 3, and as a side effect, unify the definition of NC_DISPATCH_VERSION so it only needs to be defined in CMakeLists.txt and configure.ac. See [Github #1945](https://github.com/Unidata/netcdf-c/pull/1945) for more information.
* [Enhancement] Provide better cross platform path name management. This converts paths for various platforms (e.g. Windows, MSYS, etc.) so that they are in the proper format for the executing platform. See [Github #1958](https://github.com/Unidata/netcdf-c/pull/1958) for more information.
* [Bug Fixes] The nccopy program was treating -d0 as turning deflation on rather than interpreting it as "turn off deflation". See [Github #1944](https://github.com/Unidata/netcdf-c/pull/1944) for more information.
* [Enhancement] Add support for storing NCZarr data in zip files. See [Github #1942](https://github.com/Unidata/netcdf-c/pull/1942) for more information.
Expand Down
3 changes: 3 additions & 0 deletions config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,9 @@ with zip */
/* Add extra properties to _NCProperties attribute */
#cmakedefine NCPROPERTIES_EXTRA ${NCPROPERTIES_EXTRA}

/* Idspatch table version */
#cmakedefine NC_DISPATCH_VERSION ${NC_DISPATCH_VERSION}

/* no IEEE float on this platform */
#cmakedefine NO_IEEE_FLOAT 1

Expand Down
5 changes: 4 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,9 @@ AX_SET_META([NC_HAS_MULTIFILTERS],[$has_multifilters],[yes])
# applications like PIO can determine whether they have an appropriate
# dispatch table to submit. If this is changed, make sure the value in
# CMakeLists.txt also changes to match.
AC_SUBST([NC_DISPATCH_VERSION], [2])

AC_SUBST([NC_DISPATCH_VERSION], [3])
AC_DEFINE_UNQUOTED([NC_DISPATCH_VERSION], [${NC_DISPATCH_VERSION}], [Dispatch table version.])

#####
# End netcdf_meta.h definitions.
Expand Down Expand Up @@ -1723,6 +1725,7 @@ AC_CONFIG_FILES([Makefile
libnetcdf.settings
postinstall.sh
include/netcdf_meta.h
include/netcdf_dispatch.h
include/Makefile
h5_test/Makefile
hdf4_test/Makefile
Expand Down
2 changes: 1 addition & 1 deletion include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ INSTALL(FILES ${netCDF_SOURCE_DIR}/include/netcdf_filter.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT headers)

INSTALL(FILES ${netCDF_SOURCE_DIR}/include/netcdf_dispatch.h
INSTALL(FILES ${netCDF_BINARY_DIR}/include/netcdf_dispatch.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
COMPONENT headers)

Expand Down
2 changes: 1 addition & 1 deletion include/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ if ENABLE_BYTERANGE
noinst_HEADERS += nchttp.h
endif

EXTRA_DIST = CMakeLists.txt XGetopt.h netcdf_meta.h.in
EXTRA_DIST = CMakeLists.txt XGetopt.h netcdf_meta.h.in netcdf_dispatch.in
3 changes: 0 additions & 3 deletions include/ncdispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@
#define ATOMICTYPEMAX3 NC_DOUBLE
#define ATOMICTYPEMAX5 NC_UINT64

/* Define an alias for int to indicate an error return */
typedef int NCerror;

#if !defined HDF5_PARALLEL && !defined USE_PNETCDF
typedef int MPI_Comm;
typedef int MPI_Info;
Expand Down
2 changes: 1 addition & 1 deletion include/nchttp.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ typedef struct NC_HTTP_STATE {
char errbuf[1024]; /* assert(CURL_ERROR_SIZE <= 1024) */
} NC_HTTP_STATE;

extern int nc_http_open(const char* objecturl, NC_HTTP_STATE** state, size64_t* lenp);
extern int nc_http_open(const char* objecturl, NC_HTTP_STATE** state, long long* lenp);
extern int nc_http_size(NC_HTTP_STATE* state, const char* url, size64_t* sizep);
extern int nc_http_read(NC_HTTP_STATE* state, const char* url, size64_t start, size64_t count, NCbytes* buf);
extern int nc_http_close(NC_HTTP_STATE* state);
Expand Down
4 changes: 3 additions & 1 deletion include/netcdf_dispatch.h → include/netcdf_dispatch.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@

/* This is the version of the dispatch table. It should be changed
* when new functions are added to the dispatch table. */
#define NC_DISPATCH_VERSION 3
#ifndef NC_DISPATCH_VERSION
#define NC_DISPATCH_VERSION @NC_DISPATCH_VERSION@
#endif /*NC_DISPATCH_VERSION*/

/* This is the dispatch table, with a pointer to each netCDF
* function. */
Expand Down
2 changes: 1 addition & 1 deletion libdap2/dapincludes.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "oc.h"

#include "ncdap.h"
#include "nccommon.h"
#include "dapdebug.h"
#include "daputil.h"

Expand All @@ -47,7 +48,6 @@ struct NCsegment;

/**************************************************/

#include "nccommon.h"
#include "getvara.h"
#include "constraints.h"

Expand Down
16 changes: 8 additions & 8 deletions libdap2/daputil.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ simplepathstring(NClist* names, char* separator)
/* Define a number of location tests */

/* Is node contained (transitively) in a sequence ? */
BOOL
int
dapinsequence(CDFnode* node)
{
if(node == NULL || node->container == NULL) return TRUE;
Expand All @@ -446,7 +446,7 @@ dapinsequence(CDFnode* node)
}

/* Is node contained (transitively) in a structure array */
BOOL
int
dapinstructarray(CDFnode* node)
{
if(node == NULL) return TRUE;
Expand All @@ -459,7 +459,7 @@ dapinstructarray(CDFnode* node)
}

/* Is node a map field of a grid? */
BOOL
int
dapgridmap(CDFnode* node)
{
if(node != NULL && node->container != NULL
Expand All @@ -471,7 +471,7 @@ dapgridmap(CDFnode* node)
}

/* Is node an array field of a grid? */
BOOL
int
dapgridarray(CDFnode* node)
{
if(node != NULL && node->container != NULL
Expand All @@ -482,31 +482,31 @@ dapgridarray(CDFnode* node)
return FALSE;
}

BOOL
int
dapgridelement(CDFnode* node)
{
return dapgridarray(node)
|| dapgridmap(node);
}

/* Is node a top-level grid node? */
BOOL
int
daptopgrid(CDFnode* grid)
{
if(grid == NULL || grid->nctype != NC_Grid) return FALSE;
return daptoplevel(grid);
}

/* Is node a top-level sequence node? */
BOOL
int
daptopseq(CDFnode* seq)
{
if(seq == NULL || seq->nctype != NC_Sequence) return FALSE;
return daptoplevel(seq);
}

/* Is node a top-level node? */
BOOL
int
daptoplevel(CDFnode* node)
{
if(node->container == NULL
Expand Down
22 changes: 11 additions & 11 deletions libdap2/nccommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
#include "dapincludes.h"

/* Mnemonics */
#ifndef BOOL
#define BOOL int
#endif
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif

/* Define an alias for int to indicate an error return */
typedef int NCerror;

#ifndef nullfree
#define nullfree(m) {if((m)!=NULL) {free(m);} else {}}
#endif
Expand Down Expand Up @@ -206,7 +206,7 @@ typedef struct NCD2alignment {
} NCD2alignment;

typedef struct NCtypesize {
BOOL aligned; /* have instance and field been defined? */
int aligned; /* have instance and field been defined? */
NCD2alignment instance; /* Alignment, etc for instance data */
NCD2alignment field; /* Alignment, etc WRT to parent */
} NCtypesize;
Expand All @@ -232,13 +232,13 @@ typedef struct CDFnode {
int ncid; /* relevant NC id for this object*/
unsigned long maxstringlength;
unsigned long sequencelimit; /* 0=>unlimited */
BOOL usesequence; /* If this sequence is usable */
BOOL elided; /* 1 => node does not partipate in naming*/
int usesequence; /* If this sequence is usable */
int elided; /* 1 => node does not partipate in naming*/
struct CDFnode* basenode; /* derived tree map to pattern tree */
BOOL invisible; /* 1 => do not show to user */
BOOL zerodim; /* 1 => node has a zero dimension */
int invisible; /* 1 => do not show to user */
int zerodim; /* 1 => node has a zero dimension */
/* These two flags track the effects on grids of constraints */
BOOL nc_virtual; /* node added by regrid */
int nc_virtual; /* node added by regrid */
struct CDFnode* attachment; /* DDS<->DATADDS cross link*/
struct CDFnode* pattern; /* temporary field for regridding */
/* Fields for use by libncdap4 */
Expand All @@ -249,8 +249,8 @@ typedef struct CDFnode {
char* vlenname; /* for sequence types */
int singleton; /* for singleton sequences */
unsigned long estimatedsize; /* > 0 Only for var nodes */
BOOL whole; /* projected as whole node */
BOOL prefetchable; /* eligible to be prefetched (if whole) */
int whole; /* projected as whole node */
int prefetchable; /* eligible to be prefetched (if whole) */
} CDFnode;

/**************************************************/
Expand Down
12 changes: 0 additions & 12 deletions libdap4/ncd4.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,6 @@ extern int dsp_close(ND4dsp* dsp);
/* DSP API */
extern int dsp_open(const char* path, ND4dsp** dspp);

/*
extern NCerror dapbuildvaraprojection(CDFnode*,
const size_t* startp, const size_t* countp, const ptrdiff_t* stridep,
struct DCEprojection** projectionlist);
extern NCerror NCD4_getvarx(int ncid, int varid,
const size_t *startp,
const size_t *countp,
const ptrdiff_t *stridep,
void *data,
nc_type dsttype0);
*/
#endif

/**************************************************/
Expand Down
2 changes: 1 addition & 1 deletion libdispatch/dhttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ Trace(const char* fcn)
*/

int
nc_http_open(const char* objecturl, NC_HTTP_STATE** statep, size64_t* filelenp)
nc_http_open(const char* objecturl, NC_HTTP_STATE** statep, long long* filelenp)
{
int stat = NC_NOERR;
int i;
Expand Down
4 changes: 2 additions & 2 deletions libdispatch/dinfermodel.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct MagicFile {
struct NCURI* uri;
int omode;
NCmodel* model;
fileoffset_t filelen;
long long filelen;
int use_parallel;
void* parameters; /* !NULL if inmemory && !diskless */
FILE* fp;
Expand Down Expand Up @@ -937,7 +937,7 @@ check_file_type(const char *path, int omode, int use_parallel,
if((status = openmagic(&magicinfo))) goto done;

/* Verify we have a large enough file */
if(magicinfo.filelen < MAGIC_NUMBER_LEN)
if(magicinfo.filelen < (long long)MAGIC_NUMBER_LEN)
{status = NC_ENOTNC; goto done;}
if((status = readmagic(&magicinfo,0L,magic)) != NC_NOERR) {
status = NC_ENOTNC;
Expand Down