Commit Graph

673 Commits

Author SHA1 Message Date
Dennis Heimbigner
9062af4697 cleanup netcdf_mem.h and netcdf_dispatch.h 2019-10-28 10:56:24 -06:00
Dennis Heimbigner
5ec10a97e9 CMake: install netcdf_filter.h and netcdf_dispatch.h 2019-10-28 10:52:05 -06:00
Dennis Heimbigner
40cd180957 Fix includes/netcdf_xxx.h files to not include ncexternl.h
re: https://github.com/Unidata/netcdf-c/issues/1502

If you plan to use any of the netcdf_XXX.h files, then it it is assumed
that you first include netcdf.h, followed by any netcdf_XXX.h files
you need. The EXTERNL (and other things) are defined in netcdf.h
so they should be available for use by the netcdf_XXX.h files.

This PR ensures that the above assumption is true.  It also adds
some comments to that effect to the start of the netcdf_xxx.h files.
2019-10-28 10:29:39 -06:00
Ward Fisher
d001ec8590 Removing a problematic const causing issues on OSX. 2019-10-09 17:18:48 -06:00
Dennis Heimbigner
f1506d552e Change (again), and hopefully simplify, the file model inference algorithm.
* For URL paths, the new approach essentially centralizes all information
  in the URL into the "#mode=" fragment key and uses that value
  to determine the dispatcher for (most) URLs.

* The new approach has the following steps:

  1. canonicalize the path if it is a URL.
  2. use the mode= fragment key to determine the dispatcher
  3. if dispatcher still not determined, then use the mode flags
     argument to nc_open/nc_create to determine the dispatcher.
  4. if the path points to something readable, attempt to read the
     magic number at the front, and use that to determine the dispatcher.
     this case may override all previous cases.

* Misc changes.

  1. Update documentation
  2. Moved some unit tests from libdispatch to unit_test directory.
  3. Fixed use of wrong #ifdef macro in test_filter_reg.c
     [I think this may fix an previously reported esupport query].
2019-09-29 12:59:28 -06:00
John Buonagurio
fbc4d1a53d Add missing DLL exports for parallel functions. 2019-09-21 21:55:11 -04:00
Ward Fisher
e7cc899264 Merge branch 'ejh_try2' of https://github.com/NetCDF-World-Domination-Council/netcdf-c into gh1487.wif 2019-09-20 14:04:56 -06:00
Greg Sjaardema
56c0d5cf8a Spelling fixes 2019-09-18 08:03:01 -06:00
edwardhartnett
2cd228bcd4 porting changes from other PR 2019-09-16 11:28:18 -06:00
edwardhartnett
5d1e3b4593 more doxygen documentation for nc4internal.h 2019-08-21 18:31:37 -06:00
edwardhartnett
5b3891a253 more unit tests, starting on doxygen docs for nc4internal.h 2019-08-21 16:04:59 -06:00
edwardhartnett
100e000d43 more unit tests for nc4internal.c 2019-08-21 13:34:43 -06:00
edwardhartnett
e4ef7b1a65 more unit tests, this time for nc4internal.c 2019-08-21 04:46:00 -06:00
edwardhartnett
fb371d3c3e added 2019 to netcdf.h copyright notice 2019-08-16 04:38:26 -06:00
Ed Hartnett
bce3fa6169
Merge branch 'master' into ejh_next 2019-08-16 03:42:32 -06:00
edwardhartnett
94f1a89a40 final removal 2019-08-15 07:05:10 -06:00
edwardhartnett
2077729abc removed base_pe functions from dispatch table 2019-08-15 06:51:06 -06:00
edwardhartnett
c7e022f7e5 removed rest of LOCKNUMREC and _CRAYMPP obsolete macros 2019-08-14 06:53:33 -06:00
edwardhartnett
60f436e7ee starting to remove obsolete _CRAYMPP macros 2019-08-14 06:13:45 -06:00
edwardhartnett
3a9207d55c more changes for user-defined formats 2019-08-03 18:33:43 -06:00
edwardhartnett
83c6cd58a7 more changes in support of user-defined formats 2019-08-03 17:19:13 -06:00
edwardhartnett
d1ddc92818 fixed prototype 2019-08-03 12:25:46 -06:00
edwardhartnett
181f260a20 adding, and starting to use nc4_file_list_add() 2019-08-02 09:14:35 -06:00
edwardhartnett
170c5b0901 removed NC from open in dispatch table 2019-08-01 14:30:20 -06:00
Dennis Heimbigner
4c92fc3405 Remove netcdf-4 conditional on the dispatch table.
Partially address: https://github.com/Unidata/netcdf-c/issues/1056

Currently, some of the entries in the dispatch table
are conditional'd on USE_NETCDF4.

As a step in upgrading the dispatch table for use
with user-defined tables, we remove that conditional.
This means that all dispatch tables must implement the
netcdf-4 specific functions even if only to make them
return NC_ENOTNC4. To simplify this, a set of default
functions are defined in libdispatch/dnotnc4.c to provide this
behavior. The file libdispatch/dnotnc3.c is also relevant to
this.

The primary fix is to modify the various dispatch tables to
remove the conditional and use the functions in
libdispatch/dnotnc4.c as appropriate. In practice, all of the
existing tables are prepared to handle this, so the only
real change is to remove the conditionals.

Misc. Unrelated fixes
1. Fix some annoying warnings in ncvalidator.

Notes:
1. This has not been tested with either pnetcdf or hdf4 enabled.
   When those are enabled, it is possible that there are still
   some conditionals that need to be fixed.
2019-07-20 13:59:40 -06:00
Ed Hartnett
162685cd73 moved prototypes for NC_RO, NC_NOTNC3, and NC_NOTNC4 functions to netcdf_dispatch.h 2019-07-16 20:34:11 -06:00
Ed Hartnett
d840c1864c removed unused prototype 2019-07-16 16:02:08 -06:00
Ward Fisher
9db0e26b80
Merge pull request #1432 from NetCDF-World-Domination-Council/ejh_dispatch
create header netcdf_dispatch.h
2019-07-09 12:58:28 -06:00
Ward Fisher
281ac5ff15
Merge pull request #1431 from NetCDF-World-Domination-Council/ejh_remove_macro
remove unused macro USE_REFCOUNT
2019-07-09 12:58:17 -06:00
Ed Hartnett
f5125a5b2e cleanup 2019-07-05 05:07:42 -06:00
Ed Hartnett
806ebc91b4 cleanup 2019-07-05 05:05:59 -06:00
Ed Hartnett
e6edc44439 cleanup 2019-07-05 05:04:07 -06:00
Ed Hartnett
72a000f4f9 moved dispatch table definition to netcdf_dispatch.h 2019-07-05 04:53:53 -06:00
Ed Hartnett
39ba4aae89 added netcdf_dispatch.h file 2019-07-05 04:50:36 -06:00
Ed Hartnett
cd79569e45 removed refcount from nc.h 2019-07-04 15:46:47 -06:00
Dennis Heimbigner
fbb47d50c1 Fix ncconfigure.h to solve a -ansi problem with strdup()
re: https://github.com/Unidata/netcdf-c/issues/1408

1. Add some function tests to configure.ac; these are functions
   not defined with -ansi.
2. When using -ansi, fix include/ncconfigure.h to check for
   the possibilty that certain functions are being defined
   by macros. Apparently Debian does this for some reason.
   No idea why.

Unrelated: modify the debug/cf.cmake debug shell script.
2019-05-29 14:35:29 -06:00
Ed Hartnett
150662dd0b changes to support build of libsrc4 without libhdf5 2019-05-22 07:50:12 -06:00
Ward Fisher
3b34a82e19 Merge branch 'master' into threads_part1.dmh 2019-05-01 14:41:13 -06:00
Ward Fisher
5410967b00 Merge branch 'master' into addfilter.dmh 2019-04-30 14:51:25 -06:00
Dennis Heimbigner
2eb1a8d8cf For some reason, the code for this was incorrect.
Anyway, I repaired it as follows:
1. Created NC4_write_provenance as parallel to NC4_read_provenance
2. Modified hdf5file.c to use NC4_write_provenance
3. Modified hdf5open.c to use NC4_read_provenance (was NC4_read_ncproperties).
4. The creation of the _NCProperties string was seriously hosed:
   was using all the wrong fields.
2019-04-18 14:23:20 -06:00
Ward Fisher
c776039eba Updated call to NC4_read_provenance. 2019-04-18 10:53:16 -06:00
Dennis Heimbigner
6934aa2e8b Thread safety: step 1: cleanup
re: https://github.com/Unidata/netcdf-c/issues/1373 (partial)

* Mark some global constants be const to indicate to make them easier to track.
* Hide direct access to the ncrc_globalstate behind a function call.
* Convert dispatch tables to constants (except the user defined ones)
  This has some consequences in terms of function arguments needing to be marked
  as const also.
* Remove some no longer needed global fields
* Aggregate all the globals in nclog.c
* Uniformly replace nc_sizevector{0,1} with NC_coord_{zero,one}
* Uniformly replace nc_ptrdffvector1 with NC_stride_one
* Remove some obsolete code
2019-03-30 14:06:20 -06:00
Dennis Heimbigner
4026323383 Fix minor --ansi warnings in dinfermodel.c and bzlib.c
re:

Needed to provide centralized definitions of fileno and fdopen;
also need to #include sys/types.h
2019-03-22 15:16:47 -06:00
Dennis Heimbigner
8d0bced60d Allow in-line definition of filters
Priority: Low

re: issue https://github.com/Unidata/netcdf-c/issues/1329

HDF5 has the ability to programmatically define new filters,
as opposed to using HDF5_PLUGIN_PATH env variable.
This PR adds support for that feature.
Not clear how useful this is, though.
See docs/filters.md for details.
2019-03-21 11:33:27 -06:00
Ward Fisher
e2b31ffae4
Merge branch 'master' into byterange.dmh 2019-03-19 12:05:44 -06:00
Dennis Heimbigner
88a7a1753c Simplify libhdf5/nc5info.c to move to lazy parsing
re: https://github.com/Unidata/netcdf-c/issues/1352

When nc4info.c encounters an _NCProperties attribute
with a version number it does not recognize, it does not
show it correctly.

Solution chosen is to arrange so that accessing the attribute
returns the raw value of the Attribute from the file. This way,
even if the version is unrecognized, it will return something
usable.

The changes were primarily to never attempt to parse the value
of _NCProperties until actually required. Which since they
are currently not used means that parsing never occurs.

Also modified ncdump/tst_fileinfo.sh to include some extra testing

I tested the original failure by changing the value of NCPROPS to 3.
However, there is no way to test this at build time.

Misc. Changes
* Inlined the provenance info in the NC_FILE_INFO_T structure
* Centralized stuff from elsewhere into include/nc_provenance.h

Misc. Unrelated Changes
* Removed/turned off some misc debug output left on by accident
* Fix CPPFLAGS name error in libhdf5/Makefile.am
2019-03-09 20:35:57 -07:00
Wei-keng Liao
8ebe73059c revise comments about the deprecated flags in netcdf.h to avoid confusion 2019-02-26 11:16:54 -06:00
Dennis Heimbigner
0c59e13bf7 Master merge, conflict resolution, cleanup 2019-02-24 16:54:13 -07:00
Dennis Heimbigner
45a8a265b8 master merge 2019-02-23 17:14:12 -07:00
Ward Fisher
3ea1ea7b01
Merge pull request #1328 from NetCDF-World-Domination-Council/ejh_whitespace
whitespace changes only
2019-02-21 14:04:04 -07:00