netcdf-c/libsrc4
Dennis Heimbigner 0428c38b1e Regularize the scoping of types
re: Github issue https://github.com/Unidata/netcdf-c/issues/1956

The function NC_compare_nc_types in libdispatch/dcopy.c uses an
incorrect algorithm to search for types. The core of this is the
function NC_rec_find_nc_type in libdispatch/dcopy.c. Currently
it searchs the current group and its subtree.

Additionally, the function NC4_inq_typeid in libsrc4/nc4internal.c
has been extended to handle fully qualified names. It was originally
designed to do this, but for some reason never completed.

The NC_rec_find_nc_type algorithm has been altered to match the
algorithm used by NC4_inq_typeid. It operates as follows.

Given a file F, group G and a type T. It searches file F2, group
G2, for another type T2 that is equivalent to T.

The search order is as follows.
1. Search G2 for a type T2 equivalent to T.
2. Search upwards in the ancestor groups of G2 for a type T2 equivalent to T.
3. Search the complete group tree of F2 in pre-order, breadth-first order to locate T2 equivalent to T.

Also add a test case to validate algorithm: ncdump/test_scope.sh.

Note, this change may cause compatibility problems, though it is
unlikely because two different equivalent type declarations in
one dataset is unlikely.
2021-03-06 14:09:37 -07:00
..
CMakeLists.txt Ensure MPI header found without wrapper 2021-01-19 09:38:07 -07:00
error4.c Additional Fixes to NCZarr 2020-12-16 20:48:02 -07:00
Makefile.am Additional Fixes to NCZarr 2020-12-16 20:48:02 -07:00
nc4attr.c Spelling fixes 2019-09-18 08:03:01 -06:00
nc4cache.c Additional Fixes to NCZarr 2020-12-16 20:48:02 -07:00
nc4dim.c cleanup of whitespace in HDF5 directory 2019-02-19 05:55:22 -07:00
nc4dispatch.c Add support for multiple filters per variable. 2020-02-16 12:59:33 -07:00
nc4filters.c Mostly revert the filter code to reduce its complexity of use. 2020-09-27 12:43:46 -06:00
nc4grp.c cleanup of whitespace in libsrc4 directory 2019-02-19 05:55:36 -07:00
nc4internal.c Provide a Number of fixes/improvements to NCZarr 2020-11-19 17:01:04 -07:00
nc4type.c Regularize the scoping of types 2021-03-06 14:09:37 -07:00
nc4var.c Fix missing casts of var->filters 2020-10-09 21:26:29 -06:00
ncfunc.c Spelling fixes 2019-09-18 08:03:01 -06:00
ncindex.c Provide a Number of fixes/improvements to NCZarr 2020-11-19 17:01:04 -07:00