NetCDF 4.9.3-rc1
Loading...
Searching...
No Matches
nc4dispatch.c
Go to the documentation of this file.
1/* Copyright 2005-2018 University Corporation for Atmospheric
2 Research/Unidata. */
12#include "config.h"
13#include <stdlib.h>
14#include "netcdf.h"
15#include "nc4internal.h"
16#include "nc4dispatch.h"
17#include "nc.h"
18
19/* If user-defined formats are in use, we need to declare their
20 * dispatch tables. */
21#ifdef USE_UDF0
22extern NC_Dispatch UDF0_DISPATCH;
23#endif /* USE_UDF0 */
24#ifdef USE_UDF1
25extern NC_Dispatch UDF1_DISPATCH;
26#endif /* USE_UDF1 */
27
28
36int
37NC4_initialize(void)
38{
39 int ret = NC_NOERR;
40
41#ifdef USE_UDF0
42 /* If user-defined format 0 was specified during configure, set up
43 * it's dispatch table. */
44 if ((ret = nc_def_user_format(NC_UDF0, UDF0_DISPATCH_FUNC, NULL)))
45 return ret;
46#endif /* USE_UDF0 */
47
48#ifdef USE_UDF1
49 /* If user-defined format 0 was specified during configure, set up
50 * it's dispatch table. */
51 if ((ret = nc_def_user_format(NC_UDF1F, &UDF1_DISPATCH_FUNC, NULL)))
52 return ret;
53#endif /* USE_UDF0 */
54
55#ifdef LOGGING
56 if(getenv(NCLOGLEVELENV) != NULL) {
57 char* slevel = getenv(NCLOGLEVELENV);
58 long level = atol(slevel);
59#ifdef USE_NETCDF4
60 if(level >= 0)
61 nc_set_log_level((int)level);
62 }
63#endif
64#endif
65 NC_initialize_reserved();
66 return ret;
67}
68
75int
76NC4_finalize(void)
77{
78 return NC_NOERR;
79}
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:123
Main header file for the C API.
#define NC_UDF0
User-defined format 0.
Definition netcdf.h:138
#define NC_NOERR
No Error.
Definition netcdf.h:369