Merge pull request #1698 from DennisHeimbigner/dispnoop.dmh

Support no-op dispatch functions
This commit is contained in:
Ward Fisher 2020-05-04 13:39:06 -06:00 committed by GitHub
commit 524bdd5224
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 144 additions and 98 deletions

View File

@ -7,6 +7,10 @@ This file contains a high-level description of this package's evolution. Release
## 4.8.0 - TBD
* [Bug Fix] Add functions to libdispatch/dnotnc4.c to support
dispatch table operations that should work for any dispatch
table, even if they do not do anything; functions such as
nc_inq_var_filter [https://github.com/Unidata/netcdf-c/issues/1693].
* [Bug Fix] Fixed a scalar annotation error when scalar == 0; see [Github #1707](https://github.com/Unidata/netcdf-c/issues/1707) for more information.
* [Bug Fix] Use proper CURLOPT values for VERIFYHOST and VERIFYPEER; the semantics for VERIFYHOST in particular changed. Documented in NUG/DAP2.md. See [https://github.com/Unidata/netcdf-c/issues/1684].
* [Bug Fix][cmake] Correct an issue with parallel filter test logic in CMake-based builds.

View File

@ -180,16 +180,6 @@ extern "C" {
EXTERNL int NC_RO_rename_dim(int ncid, int dimid, const char *name);
EXTERNL int NC_RO_set_fill(int ncid, int fillmode, int *old_modep);
/* These functions are for dispatch layers that don't implement
* these legacy functions. They return NC_ENOTNC3. */
EXTERNL int NC_NOTNC3_put_varm(int ncid, int varid, const size_t * start,
const size_t *edges, const ptrdiff_t *stride,
const ptrdiff_t *imapp, const void *value0,
nc_type memtype);
EXTERNL int NC_NOTNC3_get_varm(int ncid, int varid, const size_t *start,
const size_t *edges, const ptrdiff_t *stride,
const ptrdiff_t *imapp, void *value0, nc_type memtype);
/* These functions are for dispatch layers that don't implement
* the enhanced model. They return NC_ENOTNC4. */
EXTERNL int NC_NOTNC4_def_var_filter(int, int, unsigned int, size_t,
@ -230,9 +220,16 @@ extern "C" {
EXTERNL int NC_NOTNC4_inq_typeids(int, int *, int *);
EXTERNL int NC_NOTNC4_inq_user_type(int, nc_type, char *, size_t *,
nc_type *, size_t *, int *);
EXTERNL int NC_NOTNC4_inq_typeid(int, const char *, nc_type *);
EXTERNL int NC_NOTNC4_filter_actions(int, int, int, struct NC_Filterobject*);
/* These functions are for dispatch layers that don't implement
* the enhanced model, but want to succeed anyway.
* They return NC_NOERR plus properly set the out parameters.
* In some cases (filter actions), some cases may succeed and some
* will fail.
*/
EXTERNL int NC_NOOP_filter_actions(int, int, int, struct NC_Filterobject*);
#if defined(__cplusplus)
}
#endif

View File

@ -175,7 +175,7 @@ NCD2_def_var_filter,
NCD2_set_var_chunk_cache,
NCD2_get_var_chunk_cache,
NC_NOTNC4_filter_actions,
NC_NOOP_filter_actions,
};

View File

@ -241,14 +241,6 @@ NCD4_set_var_chunk_cache(int ncid, int p2, size_t p3, size_t p4, float p5)
return (NC_EPERM);
}
struct NC_FILTER_ACTION;
static int
NCD4_filter_actions(int ncid, int varid, int action, struct NC_Filterobject* spec)
{
return (NC_EPERM);
}
/**************************************************/
/*
Following functions basically return the netcdf-4 value WRT to the nc4id.
@ -870,7 +862,7 @@ NCD4_def_var_filter,
NCD4_set_var_chunk_cache,
NCD4_get_var_chunk_cache,
NCD4_filter_actions,
NC_NOOP_filter_actions,
};

View File

@ -19,7 +19,7 @@ libdispatch_la_SOURCES = dparallel.c dcopy.c dfile.c ddim.c datt.c \
dattinq.c dattput.c dattget.c derror.c dvar.c dvarget.c dvarput.c \
dvarinq.c dinternal.c ddispatch.c dutf8.c nclog.c dstring.c ncuri.c \
nclist.c ncbytes.c nchashmap.c nctime.c nc.c nclistmgr.c \
dauth.c doffsets.c dwinpath.c dutil.c dreadonly.c dnotnc4.c dnotnc3.c \
dauth.c doffsets.c dwinpath.c dutil.c dreadonly.c dnotnc4.c \
crc32.c crc32.h daux.c dinfermodel.c
# Add the utf8 codebase

View File

@ -2,10 +2,15 @@
* and redistribution conditions.*/
/**
* @file
* @internal This file contains functions that return NC_ENOTNC4, for
* dispatch layers that only implement the classic model.
* @internal This file contains functions that
* can be used in dispatch tables to handle
* such things as unimplemented functions.
* As a rule, these functions will return NC_ENOTNC4.
* In some cases, the function may succeed and set
* appropriate output parameter values. These are indicated
* by the NC_NOOP prefix to the function name.
*
* @author Ed Hartnett
* @author Ed Hartnett, Dennis Heimbigner
*/
#include "netcdf.h"
@ -14,7 +19,7 @@
#include "nc4internal.h"
/**
* @internal Not allowed for classic model.
* @internal Not implemented in some dispatch tables
*
* @param ncid Ignored.
* @param varid Ignored.
@ -22,7 +27,7 @@
* @param nparams Ignored.
* @param parms Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table
* @author Ed Hartnett
*/
int
@ -40,7 +45,7 @@ NC_NOTNC4_def_var_filter(int ncid, int varid, unsigned int id, size_t nparams,
* @param name Ignored.
* @param new_ncid Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -50,12 +55,12 @@ NC_NOTNC4_def_grp(int parent_ncid, const char *name, int *new_ncid)
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param grpid Ignored.
* @param name Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -65,14 +70,14 @@ NC_NOTNC4_rename_grp(int grpid, const char *name)
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param size Ignored.
* @param name Ignored.
* @param typeidp Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -82,7 +87,7 @@ NC_NOTNC4_def_compound(int ncid, size_t size, const char *name, nc_type *typeidp
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param typeid1 Ignored.
@ -90,7 +95,7 @@ NC_NOTNC4_def_compound(int ncid, size_t size, const char *name, nc_type *typeidp
* @param offset Ignored.
* @param field Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -101,7 +106,7 @@ NC_NOTNC4_insert_compound(int ncid, nc_type typeid1, const char *name, size_t of
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param typeid1 Ignored.
@ -111,7 +116,7 @@ NC_NOTNC4_insert_compound(int ncid, nc_type typeid1, const char *name, size_t of
* @param ndims Ignored.
* @param dim Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
extern int
@ -123,7 +128,7 @@ NC_NOTNC4_insert_array_compound(int ncid, int typeid1, const char *name,
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param typeid1 Ignored.
@ -134,7 +139,7 @@ NC_NOTNC4_insert_array_compound(int ncid, int typeid1, const char *name,
* @param ndimsp Ignored.
* @param dim Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -146,14 +151,14 @@ NC_NOTNC4_inq_compound_field(int ncid, nc_type typeid1, int fieldid, char *name,
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param typeid1 Ignored.
* @param name Ignored.
* @param fieldidp Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -165,14 +170,14 @@ NC_NOTNC4_inq_compound_fieldindex(int ncid, nc_type typeid1, const char *name, i
/* Opaque type. */
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param datum Ignored.
* @param name Ignored.
* @param typeidp Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -183,14 +188,14 @@ NC_NOTNC4_def_opaque(int ncid, size_t datum_size, const char *name,
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param name Ignored.
* @param base_typeid Ignored.
* @param typeidp Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -201,14 +206,14 @@ NC_NOTNC4_def_vlen(int ncid, const char *name, nc_type base_typeid,
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param base_typeid Ignored.
* @param name Ignored.
* @param typeidp Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -220,14 +225,14 @@ NC_NOTNC4_def_enum(int ncid, nc_type base_typeid, const char *name,
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param xtype Ignored.
* @param value Ignored.
* @param identifier Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -237,7 +242,7 @@ NC_NOTNC4_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identif
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param typeid1 Ignored.
@ -245,7 +250,7 @@ NC_NOTNC4_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identif
* @param identifier Ignored.
* @param value Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -256,14 +261,14 @@ NC_NOTNC4_inq_enum_member(int ncid, nc_type typeid1, int idx, char *identifier,
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param typeid1 Ignored.
* @param identifier Ignored.
* @param value Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -274,7 +279,7 @@ NC_NOTNC4_insert_enum(int ncid, nc_type typeid1, const char *identifier,
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param typeid1 Ignored.
@ -293,7 +298,7 @@ NC_NOTNC4_put_vlen_element(int ncid, int typeid1, void *vlen_element,
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param typeid1 Ignored.
@ -301,7 +306,7 @@ NC_NOTNC4_put_vlen_element(int ncid, int typeid1, void *vlen_element,
* @param len Ignored.
* @param data Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -312,7 +317,7 @@ NC_NOTNC4_get_vlen_element(int ncid, int typeid1, const void *vlen_element,
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param varid Ignored.
@ -320,7 +325,7 @@ NC_NOTNC4_get_vlen_element(int ncid, int typeid1, const void *vlen_element,
* @param nelems Ignored.
* @param preemption Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -331,7 +336,7 @@ NC_NOTNC4_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems,
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param varid Ignored.
@ -339,7 +344,7 @@ NC_NOTNC4_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems,
* @param nelemsp Ignored.
* @param preemptionp Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -350,7 +355,7 @@ NC_NOTNC4_get_var_chunk_cache(int ncid, int varid, size_t *sizep,
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param varid Ignored.
@ -358,7 +363,7 @@ NC_NOTNC4_get_var_chunk_cache(int ncid, int varid, size_t *sizep,
* @param deflate Ignored.
* @param deflate_level Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett, Dennis Heimbigner
*/
int
@ -369,13 +374,13 @@ NC_NOTNC4_def_var_deflate(int ncid, int varid, int shuffle, int deflate,
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param varid Ignored.
* @param fletcher32 Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett, Dennis Heimbigner
*/
int
@ -385,14 +390,14 @@ NC_NOTNC4_def_var_fletcher32(int ncid, int varid, int fletcher32)
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param varid Ignored.
* @param contiguous Ignored.
* @param chunksizesp Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett, Dennis Heimbigner
*/
int
@ -403,13 +408,13 @@ NC_NOTNC4_def_var_chunking(int ncid, int varid, int contiguous, const size_t *ch
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param varid Ignored.
* @param endianness Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -419,13 +424,13 @@ NC_NOTNC4_def_var_endian(int ncid, int varid, int endianness)
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param varid Ignored.
* @param par_access Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett, Dennis Heimbigner
*/
int
@ -435,13 +440,13 @@ NC_NOTNC4_var_par_access(int ncid, int varid, int par_access)
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param name Ignored.
* @param grp_ncid Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -451,13 +456,13 @@ NC_NOTNC4_inq_ncid(int ncid, const char *name, int *grp_ncid)
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param numgrps Ignored.
* @param ncids Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -467,12 +472,12 @@ NC_NOTNC4_inq_grps(int ncid, int *numgrps, int *ncids)
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param name Ignored.
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -482,13 +487,13 @@ NC_NOTNC4_inq_grpname(int ncid, char *name)
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param lenp Ignored.
* @param full_name Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -498,12 +503,12 @@ NC_NOTNC4_inq_grpname_full(int ncid, size_t *lenp, char *full_name)
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param parent_ncid Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -513,13 +518,13 @@ NC_NOTNC4_inq_grp_parent(int ncid, int *parent_ncid)
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param full_name Ignored.
* @param grp_ncid Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -529,13 +534,13 @@ NC_NOTNC4_inq_grp_full_ncid(int ncid, const char *full_name, int *grp_ncid)
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param nvars Ignored.
* @param varids Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -545,14 +550,14 @@ NC_NOTNC4_inq_varids(int ncid, int *nvars, int *varids)
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param ndims Ignored.
* @param dimids Ignored.
* @param include_parents Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -562,13 +567,13 @@ NC_NOTNC4_inq_dimids(int ncid, int *ndims, int *dimids, int include_parents)
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param ntypes Ignored.
* @param typeids Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -578,7 +583,7 @@ NC_NOTNC4_inq_typeids(int ncid, int *ntypes, int *typeids)
}
/**
* @internal Not allowed for classic model.
* @internal Not implemented for a dispatch table.
*
* @param ncid Ignored.
* @param typeid1 Ignored.
@ -588,7 +593,7 @@ NC_NOTNC4_inq_typeids(int ncid, int *ntypes, int *typeids)
* @param nfieldsp Ignored.
* @param classp Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
@ -605,11 +610,28 @@ NC_NOTNC4_inq_user_type(int ncid, nc_type typeid1, char *name, size_t *size,
* @param name Ignored.
* @param typeidp Ignored.
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author Ed Hartnett
*/
int
NC_NOTNC4_inq_typeid(int ncid, const char *name, nc_type *typeidp)
{
/* Note that this should actually work for atomic types */
return NC_ENOTNC4;
}
/**
* @internal Carry out one of several filter actions
*
* @param ncid Containing group id
* @param varid Containing variable id
* @param action Action to perform
*
* @return ::NC_ENOTNC4 Not implemented for a dispatch table.
* @author D. Heimbigner
*/
int
NC_NOTNC4_filter_actions(int ncid, int varid, int action, struct NC_Filterobject* spec)
{
return NC_ENOTNC4;
}
@ -621,11 +643,23 @@ NC_NOTNC4_inq_typeid(int ncid, const char *name, nc_type *typeidp)
* @param varid Containing variable id
* @param action Action to perform
*
* @return ::NC_ENOTNC4 Not allowed for classic model.
* @return ::NC_NOERR Implemented as a no-op.
* @return ::NC_ENOTNC4 Not implemented
* @return ::NC_ENOFILTER No filter defined
* @author D. Heimbigner
*/
int
NC_NOTNC4_filter_actions(int ncid, int varid, int action, struct NC_Filterobject* spec)
NC_NOOP_filter_actions(int ncid, int varid, int action, struct NC_Filterobject* args)
{
return NC_ENOTNC4;
NC_FILTER_OBJ_HDF5* obj = (NC_FILTER_OBJ_HDF5*)args;
switch (action) {
case NCFILTER_FILTERIDS:
obj->u.ids.nfilters = 0;
return NC_NOERR;
case NCFILTER_INQ: /* fall thrue */
case NCFILTER_INFO:
return NC_ENOFILTER;
default:
return NC_ENOTNC4;
}
}

View File

@ -103,7 +103,7 @@ static const NC_Dispatch HDF4_dispatcher = {
NC_NOTNC4_set_var_chunk_cache,
NC_NOTNC4_get_var_chunk_cache,
NC_NOTNC4_filter_actions,
NC_NOOP_filter_actions,
};
const NC_Dispatch *HDF4_dispatch_table = NULL;

View File

@ -164,7 +164,7 @@ NC3_def_var_filter,
NC3_set_var_chunk_cache,
NC3_get_var_chunk_cache,
NC_NOTNC4_filter_actions,
NC_NOOP_filter_actions,
};
const NC_Dispatch* NC3_dispatch_table = NULL; /*!< NC3 Dispatch table, moved here from ddispatch.c */

View File

@ -1461,7 +1461,7 @@ NC_NOTNC4_def_var_filter,
NC_NOTNC4_set_var_chunk_cache,
NC_NOTNC4_get_var_chunk_cache,
NC_NOTNC4_filter_actions,
NC_NOOP_filter_actions,
};
const NC_Dispatch *NCP_dispatch_table = NULL; /* moved here from ddispatch.c */

View File

@ -175,6 +175,9 @@ main(int argc, char **argv)
int options_mask_in, pixels_per_block_in;
int storage_in;
unsigned int filterid;
size_t nfilters;
/* Try to set fill mode after data have been written. */
sprintf(file_name, "%s_%d_%d_%d_elatefill.nc", FILE_NAME_BASE, format[f], d, a);
if (nc_set_default_format(format[f], NULL)) ERR;
@ -199,6 +202,16 @@ main(int argc, char **argv)
if (nc_inq_var_chunking(ncid, varid, &storage_in, NULL)) ERR;
if (storage_in != NC_CONTIGUOUS) ERR;
/* Since there are no filters defined, all of these
should succeed or return NC_ENOFILTER */
if (nc_inq_var_filter(ncid, varid, &filterid, NULL, NULL) != NC_ENOFILTER) ERR;
filterid = H5Z_FILTER_DEFLATE;
if (nc_inq_var_filter_info(ncid, varid, filterid, NULL, NULL) != NC_ENOFILTER) ERR;
nfilters = 0;
if (nc_inq_var_filterids(ncid, varid, &nfilters, NULL))
ERR;
if(nfilters != 0) ERR;
if (nc_enddef(ncid)) ERR;
/* For netCDF-4, we don't actually have to write data to
* prevent future setting of the fill value. Once the user

View File

@ -150,7 +150,10 @@ static NC_Dispatch tst_dispatcher = {
NC_NOTNC4_def_var_endian,
NC_NOTNC4_def_var_filter,
NC_NOTNC4_set_var_chunk_cache,
NC_NOTNC4_get_var_chunk_cache
NC_NOTNC4_get_var_chunk_cache,
#if NC_DISPATCH_VERSION >= 2
NC_NOOP_filter_actions
#endif
};
/* This is the dispatch object that holds pointers to all the
@ -242,7 +245,10 @@ static NC_Dispatch tst_dispatcher_bad_version = {
NC_NOTNC4_def_var_endian,
NC_NOTNC4_def_var_filter,
NC_NOTNC4_set_var_chunk_cache,
NC_NOTNC4_get_var_chunk_cache
NC_NOTNC4_get_var_chunk_cache,
#if NC_DISPATCH_VERSION >= 2
NC_NOOP_filter_actions
#endif
};
#define NUM_UDFS 2