netcdf-c/libsrc4/nc4dispatch.c
Dennis Heimbigner f0f0f39950 Cleanup various Zarr-related build issues
# Description
Remove various obsolete build options. Also do some code movement.

## Specific Changes

* The remotetest server is sometimes unstable, so provide a mechanism
  to force disabling calls to remotetest.unidata.ucar.edu.
  This is enabled by adding a repository variable named
  REMOTETESTDOWN with the value "yes".
* Fix CMakeLists.txt to use the uname command as an alternate
  to using the hostname command (which does not work under cygwin).
* Remove the JNA stuff as obsolete
* Remove the ENABLE_CLIENTSIDE_FILTERS options since it has been
  disabled for a while.
* Fix bad option flag in some github action .yml files: change --disable-xml2 to --disable-libxml2
* Collect globalstate definitions into nc4internal.h
* Remove ENABLE_NCZARR_FILTERS_TESTING option as obsolete and replace
  with ENABLE_NCZARR_FILTERS
* Move some dispatcher independent functions from libsrc4/nc4internal.c to libdispatch/ddispatch.c
* As a long term goal, and because it is now the case that --enable-nczarr
    => USE_NETCDF4, make the external options --enable-netcdf-4 and
    --enable-netcdf4 obsolete in favor of --enable-hdf5
    We will do the following for one more release cycle.
        1. Make --enable-netcdf-4 be an alias for --enable-netcdf4.
        2. Make --enable-netcdf4 an alias for --enable-hdf5.
        3. Internally, convert most uses of USE_NETCDF_4 ad USE_NETCDF4 to USE_HDF5
    After the next release, --enable-netcdf-4 and --enable-netcdf4 will
    be removed.
2024-05-15 18:46:25 -06:00

80 lines
1.8 KiB
C

/* Copyright 2005-2018 University Corporation for Atmospheric
Research/Unidata. */
/**
* @file
* @internal This header file contains libsrc4 dispatch
* initialization, user-defined format, and logging prototypes and
* macros.
*
* @author Dennis Heimbigner, Ed Hartnett
*/
#include "config.h"
#include <stdlib.h>
#include "netcdf.h"
#include "nc4internal.h"
#include "nc4dispatch.h"
#include "nc.h"
/* If user-defined formats are in use, we need to declare their
* dispatch tables. */
#ifdef USE_UDF0
extern NC_Dispatch UDF0_DISPATCH;
#endif /* USE_UDF0 */
#ifdef USE_UDF1
extern NC_Dispatch UDF1_DISPATCH;
#endif /* USE_UDF1 */
/**
* @internal Initialize netCDF-4. If user-defined format(s) have been
* specified in configure, load their dispatch table(s).
*
* @return ::NC_NOERR No error.
* @author Dennis Heimbigner
*/
int
NC4_initialize(void)
{
int ret = NC_NOERR;
#ifdef USE_UDF0
/* If user-defined format 0 was specified during configure, set up
* it's dispatch table. */
if ((ret = nc_def_user_format(NC_UDF0, UDF0_DISPATCH_FUNC, NULL)))
return ret;
#endif /* USE_UDF0 */
#ifdef USE_UDF1
/* If user-defined format 0 was specified during configure, set up
* it's dispatch table. */
if ((ret = nc_def_user_format(NC_UDF1F, &UDF1_DISPATCH_FUNC, NULL)))
return ret;
#endif /* USE_UDF0 */
#ifdef LOGGING
if(getenv(NCLOGLEVELENV) != NULL) {
char* slevel = getenv(NCLOGLEVELENV);
long level = atol(slevel);
#ifdef USE_NETCDF4
if(level >= 0)
nc_set_log_level((int)level);
}
#endif
#endif
NC_initialize_reserved();
return ret;
}
/**
* @internal Finalize netCDF-4.
*
* @return ::NC_NOERR No error.
* @author Dennis Heimbigner
*/
int
NC4_finalize(void)
{
return NC_NOERR;
}