Commit Graph

232 Commits

Author SHA1 Message Date
Ward Fisher
16d6f94f30 Merge branch 'master' into filters.dmh 2017-11-13 11:15:02 -07:00
Ward Fisher
bb2505cf4e
Merge branch 'master' into newrc.dmh 2017-11-03 14:57:27 -06:00
Ward Fisher
e748341c3b Merge remote-tracking branch 'origin/dap2cvt.dmh' into dmh_multi_merge 2017-11-03 12:42:34 -06:00
Dennis Heimbigner
f827cf13f2 As a result of changes I made to
url parameter handling, the parameter
lookup code was ignoring parameters
because I was giving it a url stripped
of parameters instead of the one with
parameters.

This code change fixes the parameter processing
so it again used the correct url.

reference:
docs/OPeNDAP.dox#section Defined Client Parameters
2017-11-01 19:48:51 -06:00
Dennis Heimbigner
338f958e46 Force attribute value to be in-range vs causing error.
re: https://github.com/conda-forge/libnetcdf-feedstock/pull/26
(Note: note conda-forge, not Unidata).
Revert dap2 code to 4.4.1.1. behavior so that attribute values
are forced into a specific range. Current behavior generates
error if an attribute value is out of range.
2017-10-23 18:27:43 -06:00
Dennis Heimbigner
733da154c5 1. Keep up to date by merging master
2. Factored out the parameter string parsing for ncgen and nccopy
   int libdispatch/dfilter.c + include/ncfilter.h
3. Allow a parameter string to use constant types other than
   unsigned int. See docs/filters.md for details.
4. Moved the old content of  include/netcdf_filter.h into include/netcdf.h
   and removed include/netcdf_filter.h as no longer needed.
5. Force the test filter (bzip2) in nc_test4/filter_test to
   be built using BUILT_SOURCES.
2017-10-08 15:56:45 -06:00
Dennis Heimbigner
8e2abdeed8 Initial version 2017-08-31 14:19:56 -06:00
Dennis Heimbigner
ed44fd7306 Add szip support via libaec 2017-08-27 13:35:20 -06:00
Dennis Heimbigner
86fc8745dc merge master and resolve conflicts 2017-08-12 15:50:31 -06:00
Ward Fisher
05d3d7e9f5 Merge remote-tracking branch 'origin/d4tempfile.dmh' into v4.5.0-release-branch 2017-08-07 10:12:36 -06:00
Dennis Heimbigner
4d8fbbf501 If DAP (2 or 4) is enabled, but diskless is disabled, then the
dap code will create a real temporary file in which to store the
converted metadata for the DAP .dds or .dmr.

It was assumed that the nc_close code would reclaim the
temporary file. For DAP2, reclamation occurs in the ncio
code. For DAP4, it was assumed that the libsrc4 code would do
the reclamation, but for whatever reason, this is not happening.
Thus, in this situation, a temporary file is left in the file
system. Aside from being irritating to users, this screws up
'make distcheck'.

So the DAP4 code is fixed to ensure that the temporary file is
properly reclaimed independent of the libsrc4 code.
2017-08-05 22:41:31 -06:00
Dennis Heimbigner
0efc4e5023 Turn off debug noise 2017-07-14 15:32:17 -06:00
Dennis Heimbigner
eee41eea55 turn off debugging 2017-07-13 11:45:52 -06:00
Dennis Heimbigner
715a6fe5eb The files libdispatch/dwinpath.c and include/ncwinpath.h
were added to provide a path name converter from e.g. cygwin
paths to e.g. windows paths. This is necessary because
the shell scripts may produce cygwin paths, but the code
may have been compiled with Visual Studio. Similar issues
arise with Mingw.

At appropriate places, and if using Visual Studio or Mingw,
I added calls to the path conversion code.
Apparently I forgot to find all the places where this
conversion was needed. So this pr does the following:
1. Push the calls to the converter to the various libXXX
   directories and out of libdispatch/dfile.c.
2. Add conversion calls to other parts of the code like oc2.

I also turns out that conversion code in dapcvt.c
had a bug when handling DAP Byte type under visual studio.

Notes:
1. there may still be places I missed that need to do path conversion.
2. need to make sure that calls to e.g. H5open also use converted path.
2017-07-13 10:40:07 -06:00
Dennis Heimbigner
dc9e31df68 Fix for github issue https://github.com/Unidata/netcdf-c/issues/310.
The problem was that for opendap, it is possible to use keywords
as identifiers
 when there is no ambiguity. However, the DAP2
parser lost the case of the identifier used the lower case version.
Fix is to use the actual text of the symbol when it is used as an identifier.
Also added a test case for this (kwcase.*).

Additionally cleaned up some misc. dap2 testing problems.
1. ncdap_test/tst_ncdap3.sh was using an empty test set.
   restored the testing of datasets.
2. as a consequence of #1, some tests needed to be updated with minor
   tweeks.
3. fix dapmerge to handle multiple DODS_EXTRAS attributes.
4. modify buildattribute to suppress nul characters and terminate
   the name at the first nul.
5. clean up various test scripts to remove residual, unused
   references to obsolete netcdf-4 translation.
6. export e.g. NCDUMP from test_common.in so that non-top-level
   shell scripts can access it.
2017-06-28 13:51:01 -06:00
Dennis Heimbigner
7c3164577e Finalize the compression support.
This relies on the HDF5 capability to
dynamically load compression filters.
Note that a compression filter is just
a subcase of filters.

The primary user-visible changes are as follows:
1. Add a standard header "netcdf_filter.h" that defines
   the necessary API extensions
2. Modify ncgen to support two new special attributes
   "_Filter_ID" and "_Filter_Parameters" so that compression
   can be turned on when creating a file using ncgen.
4. Add a detailed description of filtering support
   to the user's guide; see the file filters.md
5. Add a test case directory for this: nc_test4/filter_test.
   It is fragile and a ./configure flags (-enable-filter-test)
   is defined (default disabled) to shut this off this test
   to avoid spurious 'make check' failures.

Note that the HDF5 documentation is not up-to-date, so
much of what is encoded here comes from examining the
actual code in the file H5PL.c in the HDF5 source code.
2017-04-27 13:01:59 -06:00
Dennis Heimbigner
6d8809100f Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh)
1. When running under windows (as opposed to cygwin)
   we need to make sure to not user /cygdrive/ file paths.
   This was ocurring in libdap4/d4read.c, but may occur
   elsewhere.
2. Shell scripts in the git repo are not being checked-out
   with the executable mode set. Had core.filemode set to false.
   Was a major hassle to fix.
2017-04-03 21:39:44 -06:00
Dennis Heimbigner
be6e1b65dc Fix conflicts with master 2017-03-17 14:58:38 -06:00
Dennis Heimbigner
3213705205 Re: github issue https://github.com/Unidata/netcdf-c/issues/373
Github issue https://github.com/Unidata/netcdf-c/issues/152
requested that "orphaned" DAS attributes be included in the netcdf
metadata as global variables. The term orphaned here meant that
they were not connected to any variable in the DDS.
This was done in pull request https://github.com/Unidata/netcdf-c/pull/164

However, some servers (e.g. Thredds) include attributes for variables not
specified in a constraint expression, but which exist in the full DDS.
So I was adding these to the set of global attributes, but in retrospect
this should not have been done: they should have been elided.

Solution: modify oc2 code to be more distriminatory about
which orphaned attributes to include.
2017-03-11 16:17:20 -07:00
Dennis Heimbigner
1aab7556cf ckp 2017-03-11 15:20:20 -07:00
Dennis Heimbigner
3db4f013bf Primary change: add dap4 support
Specific changes:
1. Add dap4 code: libdap4 and dap4_test.
   Note that until the d4ts server problem is solved, dap4 is turned off.
2. Modify various files to support dap4 flags:
	configure.ac, Makefile.am, CMakeLists.txt, etc.
3. Add nc_test/test_common.sh. This centralizes
   the handling of the locations of various
   things in the build tree: e.g. where is
   ncgen.exe located. See nc_test/test_common.sh
   for details.
4. Modify .sh files to use test_common.sh
5. Obsolete separate oc2 by moving it to be part of
   netcdf-c. This means replacing code with netcdf-c
   equivalents.
5. Add --with-testserver to configure.ac to allow
   override of the servers to be used for --enable-dap-remote-tests.
6. There were multiple versions of nctypealignment code. Try to
   centralize in libdispatch/doffset.c and include/ncoffsets.h
7. Add a unit test for the ncuri code because of its complexity.
8. Move the findserver code out of libdispatch and into
   a separate, self contained program in ncdap_test and dap4_test.
9. Move the dispatch header files (nc{3,4}dispatch.h) to
   .../include because they are now shared by modules.
10. Revamp the handling of TOPSRCDIR and TOPBUILDDIR for shell scripts.
11. Make use of MREMAP if available
12. Misc. minor changes e.g.
	- #include <config.h> -> #include "config.h"
	- Add some no-install headers to /include
	- extern -> EXTERNL and vice versa as needed
	- misc header cleanup
	- clean up checking for misc. unix vs microsoft functions
13. Change copyright decls in some files to point to LICENSE file.
14. Add notes to RELEASENOTES.md
2017-03-08 17:01:10 -07:00
Ward Fisher
696c200e29 Merge branch 'master' into dap2clean.dmh 2017-02-24 14:26:39 -07:00
Dennis Heimbigner
ee2916f60a Originally, libdap2 was also going to provide
a dap2->netcdf-4 translation. That is now
superceded by dap4. But there is some cruft
in the dap2 code around this that should be removed.
2017-02-21 15:13:37 -07:00
Dennis Heimbigner
f71b695530 Followon to
re: https://github.com/Unidata/netcdf-c/issues/365

1. Added to RELEASENOTES.md
2. Add a range check to more closely
   mimic unix sscanf
3. locate and fix same sscanf problems in ncgen/cvt.c

Still need a stable url for a test case.
2017-02-20 13:19:25 -07:00
Dennis Heimbigner
96bd037560 re: https://github.com/Unidata/netcdf-c/issues/365
Following command fails under visual studio.
    ncdump -h http://thredds.ucar.edu/thredds/dodsC/nexrad/composite/gini/n0r/1km/20170216/Level3_Composite_n0r_1km_20170216_1635.gini

The problem is that sscanf for windows does not appear to support
scanning 8bit integers: it appears to only allow scanning of characters.

Solution:
Scan the input as an integer (for type Byte) or unsigned int (for type UByte)
and then recast the result as a char or unsigned char.

Primary code fix is in libdap2/dapcvt.c#dapcvtattrval
2017-02-19 21:41:51 -07:00
Dennis Heimbigner
e2967bb622 Fix for Github issue 314.
Problem was in oc2/dap.y.
In definition of errormsg:, change WORD_WORD to WORD_STRING
since the msg field of an opendap error response is a quoted
string.

Also took the opportunity to modify ncgen to
transfer the logging level (-L flag) into the c-code
generated using -lc.
2016-09-01 22:06:07 -06:00
Dennis Heimbigner
d3f44747f1 A couple of people have reported that
the multiple definitions of
    typedef struct DCEparsestate
near lines 10 and 42 causes compiler
problems with some versions of gcc.
remove the second typedef.
2016-07-11 14:11:20 -06:00
Dennis Heimbigner
1bf34d8557 A netcdfgroup email
(Re: [netcdfgroup] nccopy fails with corrupted double link list)
shows that ncdump/nccopy was returning EPERM instead of
NC_EDAPCONSTRAINT as an error when we have a malformed constraint.
Also clean up a potential bug that might occur if the user invokes
nc_set_default_format before calling nc_open on a dap url.
2016-06-24 15:28:50 -06:00
Dennis Heimbigner
835511eaeb HDF5 is generating unnecessary error messages when netcdf4 logging is enabled
re: github netcdf-c issue #271

This occurs for several reasons, including:
1. using H5Aopen_name instead of H5Aexists to test if attribute exists.
2. using H5Eset_auto instead of H5Eset_auto2.
There are probably others that will have to be extinguished as encountered.
p.s Hope I did not overdo this and kill too much.
2016-05-27 10:08:01 -06:00
Ward Fisher
9ccb1bcd60 Correction. 2016-04-28 15:29:48 -06:00
Ward Fisher
9b15f9c0dc Restored some accidentally-deleted lines. 2016-04-28 15:20:11 -06:00
Ward Fisher
107a670419 Oops, that should have goe into ncd2dispatch.h of course. 2016-04-28 14:30:29 -06:00
Ward Fisher
0e05f0e32f Added config.h to ncd2dispatch.c 2016-04-28 14:30:00 -06:00
Ward Fisher
2e56f02497 Cordoned off netcdf4-only functions that were exposed when netcdf-4 was disabled (but DAP was turned on), causing link errors. See https://github.com/Unidata/netcdf-c/issues/255 for details. 2016-04-28 14:28:16 -06:00
dmh
764a1c40a3 ckp 2016-04-06 19:51:40 -06:00
Dennis Heimbigner
a8ff523677 ckp 2016-04-06 14:05:58 -06:00
Dennis Heimbigner
66fcf79d77 Github issue: https://github.com/Unidata/netcdf-c/issues/206
Re e-eupport VGQ-678069
It was noticed that an attribute value of "nan." was being treated as
legal (it should be "nan"). The reason is that sscanf was not be checked
to see that all the attribute value characters were being read.
Solution is to verify that all characters were being consumed.
2016-02-02 13:06:57 -07:00
dmh
47e10591b4 ckp 2015-11-19 13:44:55 -07:00
Ward Fisher
c053de5d0c Corrected a static-analysis detected error state where a null pointer could be passed to strcmp 2015-11-17 11:26:38 -07:00
Ward Fisher
612b35a84c Merge branch 'master' into cdf-5, in preparation for merging the CDF-5 functionality into the master branch. This will be the key new feature for netcdf 4.4.0. 2015-11-05 13:40:35 -07:00
tbeu
e2820e4d8a Fix common typos
Detected by https://github.com/vlajos/misspell_fixer
2015-08-20 11:42:05 +02:00
dmh
859f105005 merge-squash 2015-08-15 16:26:35 -06:00
dmh
c5fe913d54 re: https://github.com/Unidata/netcdf-c/issues/117
It appears the problem is that synth9 was erroneously
included in testing. It involves a nested sequence which
is not translatable. Not sure why it was still there,
but fix is to suppress the test.
2015-07-05 19:26:01 -06:00
dmh
7bb344982e Undo commit 6f753dacd1.
Apparently not needed after all.
2015-06-17 15:31:52 -06:00
dmh
6f753dacd1 1. fix a missing socklen_t problem. 2015-06-17 14:06:51 -06:00
Ward Fisher
0693b42078 For some reason, setting DAPDEBUG and OCDEBUG to 1 causes a bunch of failures on OSX. 2015-05-27 11:04:09 -06:00
dmh
ab5022256d need to set -e many of the .sh programs 2015-05-16 15:46:39 -06:00
Ward Fisher
62aef5e262 Modified a couple other sscanf calls. 2015-05-08 14:02:12 -06:00
Ward Fisher
2574f11dbd Removed additional debug info. 2015-05-08 14:02:12 -06:00
Ward Fisher
0d8be16398 Removed some debugging stanzas. 2015-05-08 14:02:11 -06:00