Skip to content

Commit 524bdd5

Browse files
authored
Merge pull request #1698 from DennisHeimbigner/dispnoop.dmh
Support no-op dispatch functions
2 parents aa0b0db + 91060e9 commit 524bdd5

File tree

11 files changed

+142
-96
lines changed

11 files changed

+142
-96
lines changed

RELEASE_NOTES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ This file contains a high-level description of this package's evolution. Release
77

88
## 4.8.0 - TBD
99

10+
* [Bug Fix] Add functions to libdispatch/dnotnc4.c to support
11+
dispatch table operations that should work for any dispatch
12+
table, even if they do not do anything; functions such as
13+
nc_inq_var_filter [https://github.com/Unidata/netcdf-c/issues/1693].
1014
* [Bug Fix] Fixed a scalar annotation error when scalar == 0; see [Github #1707](https://github.com/Unidata/netcdf-c/issues/1707) for more information.
1115
* [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].
1216
* [Bug Fix][cmake] Correct an issue with parallel filter test logic in CMake-based builds.

include/netcdf_dispatch.h

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -180,16 +180,6 @@ extern "C" {
180180
EXTERNL int NC_RO_rename_dim(int ncid, int dimid, const char *name);
181181
EXTERNL int NC_RO_set_fill(int ncid, int fillmode, int *old_modep);
182182

183-
/* These functions are for dispatch layers that don't implement
184-
* these legacy functions. They return NC_ENOTNC3. */
185-
EXTERNL int NC_NOTNC3_put_varm(int ncid, int varid, const size_t * start,
186-
const size_t *edges, const ptrdiff_t *stride,
187-
const ptrdiff_t *imapp, const void *value0,
188-
nc_type memtype);
189-
EXTERNL int NC_NOTNC3_get_varm(int ncid, int varid, const size_t *start,
190-
const size_t *edges, const ptrdiff_t *stride,
191-
const ptrdiff_t *imapp, void *value0, nc_type memtype);
192-
193183
/* These functions are for dispatch layers that don't implement
194184
* the enhanced model. They return NC_ENOTNC4. */
195185
EXTERNL int NC_NOTNC4_def_var_filter(int, int, unsigned int, size_t,
@@ -230,9 +220,16 @@ extern "C" {
230220
EXTERNL int NC_NOTNC4_inq_typeids(int, int *, int *);
231221
EXTERNL int NC_NOTNC4_inq_user_type(int, nc_type, char *, size_t *,
232222
nc_type *, size_t *, int *);
233-
EXTERNL int NC_NOTNC4_inq_typeid(int, const char *, nc_type *);
234223
EXTERNL int NC_NOTNC4_filter_actions(int, int, int, struct NC_Filterobject*);
235224

225+
/* These functions are for dispatch layers that don't implement
226+
* the enhanced model, but want to succeed anyway.
227+
* They return NC_NOERR plus properly set the out parameters.
228+
* In some cases (filter actions), some cases may succeed and some
229+
* will fail.
230+
*/
231+
EXTERNL int NC_NOOP_filter_actions(int, int, int, struct NC_Filterobject*);
232+
236233
#if defined(__cplusplus)
237234
}
238235
#endif

libdap2/ncd2dispatch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ NCD2_def_var_filter,
175175
NCD2_set_var_chunk_cache,
176176
NCD2_get_var_chunk_cache,
177177

178-
NC_NOTNC4_filter_actions,
178+
NC_NOOP_filter_actions,
179179

180180
};
181181

libdap4/ncd4dispatch.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,6 @@ NCD4_set_var_chunk_cache(int ncid, int p2, size_t p3, size_t p4, float p5)
241241
return (NC_EPERM);
242242
}
243243

244-
struct NC_FILTER_ACTION;
245-
246-
static int
247-
NCD4_filter_actions(int ncid, int varid, int action, struct NC_Filterobject* spec)
248-
{
249-
return (NC_EPERM);
250-
}
251-
252244
/**************************************************/
253245
/*
254246
Following functions basically return the netcdf-4 value WRT to the nc4id.
@@ -870,7 +862,7 @@ NCD4_def_var_filter,
870862
NCD4_set_var_chunk_cache,
871863
NCD4_get_var_chunk_cache,
872864

873-
NCD4_filter_actions,
865+
NC_NOOP_filter_actions,
874866
};
875867

876868

libdispatch/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ libdispatch_la_SOURCES = dparallel.c dcopy.c dfile.c ddim.c datt.c \
1919
dattinq.c dattput.c dattget.c derror.c dvar.c dvarget.c dvarput.c \
2020
dvarinq.c dinternal.c ddispatch.c dutf8.c nclog.c dstring.c ncuri.c \
2121
nclist.c ncbytes.c nchashmap.c nctime.c nc.c nclistmgr.c \
22-
dauth.c doffsets.c dwinpath.c dutil.c dreadonly.c dnotnc4.c dnotnc3.c \
22+
dauth.c doffsets.c dwinpath.c dutil.c dreadonly.c dnotnc4.c \
2323
crc32.c crc32.h daux.c dinfermodel.c
2424

2525
# Add the utf8 codebase

0 commit comments

Comments
 (0)