Loading...
Searching...
No Matches
nc4dispatch.c
Go to the documentation of this file.
/* Copyright 2005-2018 University Corporation for Atmospheric
Research/Unidata. */
#include "config.h"
#include <stdlib.h>
#include "netcdf.h"
#include "nc4internal.h"
#include "nc4dispatch.h"
#include "nc.h"
#include "ncudfplugins.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 */
extern int nc_plugin_path_initialize(void);
extern int nc_plugin_path_finalize(void);
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
#if defined(USE_HDF5) || defined(NETCDF_ENABLE_NCZARR)
nc_plugin_path_initialize();
#endif
/* Load UDF plugins from RC file configuration */
if ((ret = NC_udf_load_plugins()))
return ret;
NC_initialize_reserved();
return ret;
}
int
NC4_finalize(void)
{
#if defined(USE_HDF5) || defined(NETCDF_ENABLE_NCZARR)
nc_plugin_path_finalize();
#endif
return NC_NOERR;
}
nc_def_user_format
EXTERNL int nc_def_user_format(int mode_flag, NC_Dispatch *dispatch_table, char *magic_number)
Add handling of user-defined format.
Definition dfile.c:166
netcdf.h
Main header file for the C API.
NC_UDF0
#define NC_UDF0
User-defined format 0 (bit 6).
Definition netcdf.h:152
NC_NOERR
#define NC_NOERR
No Error.
Definition netcdf.h:417