netcdf-c/ncgen
Dennis Heimbigner 9983b9d911 re e-support UBS-599337
re pull request https://github.com/Unidata/netcdf-c/pull/405
re pull request https://github.com/Unidata/netcdf-c/pull/446

Notes:
1. This branch is a cleanup of the magic.dmh branch.
2. magic.dmh was originally merged, but caused problems with parallel IO.
   It was re-issued as pull request https://github.com/Unidata/netcdf-c/pull/446.
3. This branch + pull request replace any previous pull requests and magic.dmh branch.

Given an otherwise valid netCDF file that has a corrupted header,
the netcdf library currently crashes. Instead, it should return
NC_ENOTNC.

Additionally, the NC_check_file_type code does not do the
forward search required by hdf5 files. It currently only looks
at file position 0 instead of 512, 1024, 2048,... Also, it turns
out that the HDF4 magic number is assumed to always be at the
beginning of the file (unlike HDF5).
The change is localized to libdispatch/dfile.c See
https://support.hdfgroup.org/release4/doc/DSpec_html/DS.pdf

Also, it turns out that the code in NC_check_file_type is duplicated
(mostly) in the function libsrc4/nc4file.c#nc_check_for_hdf.

This branch does the following.
1. Make NC_check_file_type return NC_ENOTNC instead of crashing.
2. Remove nc_check_for_hdf and centralize all file format checking
   NC_check_file_type.
3. Add proper forward search for HDF5 files (but not HDF4 files)
   to look for the magic number at offsets of 0, 512, 1024...
4. Add test tst_hdf5_offset.sh. This tests that hdf5 files with
   an offset are properly recognized. It does so by prefixing
   a legal file with some number of zero bytes: 512, 1024, etc.
5. Off-topic: Added -N flag to ncdump to force a specific output dataset name.
2017-10-24 16:25:09 -06:00
..
bindata.c support fixes for Github issue 323 2016-11-17 15:29:32 -07:00
bytebuffer.c Coverity: 1229128 corrected. 2014-10-03 12:38:32 -06:00
bytebuffer.h
c0_4.cdl Tweaking cdl files so that we can compare against them. 2016-11-18 11:07:20 -07:00
c0.cdl Tweaking cdl files so that we can compare against them. 2016-11-18 11:07:20 -07:00
c5.cdl merge-squash 2015-10-09 10:12:11 -06:00
cdata.c support fixes for Github issue 323 2016-11-17 15:29:32 -07:00
cdfdata.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
CMakeLists.txt Cmake 2017-06-06 16:21:04 -06:00
cmldata.c
compound_datasize_test2.cdl support fixes for Github issue 323 2016-11-17 15:29:32 -07:00
compound_datasize_test.cdl Reformated source cdl to allow for a diff test. 2016-11-16 10:57:36 -07:00
ctests.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
cvt.c Followon to 2017-02-20 13:19:25 -07:00
data.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
data.h support fixes for Github issue 323 2016-11-17 15:29:32 -07:00
debug.c
debug.h
depend
dump.c
dump.h
env Use short "-k" codes instead of deprecated version numbers for ncgen and nccopy tests 2014-12-28 22:42:05 -07:00
escapes.c re: pull request https://github.com/Unidata/netcdf-c/pull/364 2017-06-06 15:23:59 -06:00
f77data.c support fixes for Github issue 323 2016-11-17 15:29:32 -07:00
foo.cdl
ftests.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
genbin.c Fix issues with Github pull request 187 2016-01-08 12:55:11 -07:00
genc.c support fixes for Github issue 323 2016-11-17 15:29:32 -07:00
genchar.c Fix common typos 2015-08-20 11:42:05 +02:00
gencml.c
generate.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
generr.c Addressed coverity issue 719941, missing varargs cleanup. 2016-07-06 15:41:49 -06:00
generr.h Addressed coverity issue 719941, missing varargs cleanup. 2016-07-06 15:41:49 -06:00
genf77.c re: Jira NCF-309 2014-09-18 18:26:06 -06:00
genj.c Cleaned up clang-reported issue: dead assignment. 2014-04-21 10:56:57 -06:00
genjjni.c
genjstd.c
genlib.c re e-support UBS-599337 2017-10-24 16:25:09 -06:00
genlib.h Add provenance info for netcdf-4 files. 2016-05-07 14:32:07 -06:00
getfill.c Fix issues with Github pull request 187 2016-01-08 12:55:11 -07:00
includes.h Corrected a couple issues uncovered when revisiting https://github.com/Unidata/netcdf-c/issues/244 2017-06-14 14:01:09 -06:00
internals.html Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
jdata.c support fixes for Github issue 323 2016-11-17 15:29:32 -07:00
jdatajni.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
jdatastd.c Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
jtests.sh Use short "-k" codes instead of deprecated version numbers for ncgen and nccopy tests 2014-12-28 22:42:05 -07:00
lfs-tests Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
list.c fix some coverity complaints 2014-04-07 13:00:47 -06:00
list.h
main.c re e-support UBS-599337 2017-10-24 16:25:09 -06:00
Make0 Fix for Github issue 314. 2016-09-01 22:06:07 -06:00
Makefile.am re: pull request https://github.com/Unidata/netcdf-c/pull/364 2017-06-06 15:23:59 -06:00
nc_iter.c
nc_iter.h
ncf199.cdl Updating ncgen run_nc4_tests.sh script to ensure that results are tested in addition to whether or not ncgen exited successfully. 2016-11-16 11:09:14 -07:00
ncf345.cdl Added test for [NCF-345] 2015-11-13 10:33:19 -07:00
ncgen.1 Fix spelling errors. 2016-08-28 15:45:36 +02:00
ncgen.h Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
ncgen.l re e-support UBS-599337 2017-10-24 16:25:09 -06:00
ncgen.y When ncgen is invoked without a -k flag, 2017-09-15 21:03:05 -06:00
ncgenl.c re e-support UBS-599337 2017-10-24 16:25:09 -06:00
ncgeny.c re e-support UBS-599337 2017-10-24 16:25:09 -06:00
ncgeny.h re e-support UBS-599337 2017-10-24 16:25:09 -06:00
odom.c re: Jira NCF-309 2014-09-18 18:26:06 -06:00
odom.h re: Jira NCF-309 2014-09-18 18:26:06 -06:00
ref_camrun.cdl Reverted some of the spelling corrections. Some misspellings were intentional 2015-10-16 14:36:17 -06:00
run_tests2.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
semantics.c keep up-to-date with master 2017-03-27 12:16:24 -06:00
tst_gattenum.cdl Apparently we have no .cdl test cases that have 2017-03-18 17:57:48 -06:00
tst_usuffix.cdl re: gihub issue https://github.com/Unidata/netcdf-c/issues/380 2017-03-24 18:56:14 -06:00
util.c Oops, forgot to test nc3 only. 2016-05-07 14:32:07 -06:00
util.h Add provenance info for netcdf-4 files. 2016-05-07 14:32:07 -06:00
XGetopt.c