NetCDF  4.6.3
 All Data Structures Files Functions Variables Typedefs Macros Modules Pages
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 "nc4internal.h"
15 #include "nc4dispatch.h"
16 #include "nc.h"
17 
18 /* If user-defined formats are in use, we need to declare their
19  * dispatch tables. */
20 #ifdef USE_UDF0
21 extern NC_Dispatch UDF0_DISPATCH;
22 #endif /* USE_UDF0 */
23 #ifdef USE_UDF1
24 extern NC_Dispatch UDF1_DISPATCH;
25 #endif /* USE_UDF1 */
26 
27 #ifdef USE_NETCDF4
28 /* Pointers to dispatch tables for user-defined formats. */
29 extern NC_Dispatch *UDF0_dispatch_table;
30 extern NC_Dispatch *UDF1_dispatch_table;
31 #endif /* USE_NETCDF4 */
32 
33 
34 
42 int
43 NC4_initialize(void)
44 {
45  int ret = NC_NOERR;
46 
47 #ifdef USE_UDF0
48  /* If user-defined format 0 was specified during configure, set up
49  * it's dispatch table. */
50  if ((ret = nc_def_user_format(NC_UDF0, UDF0_DISPATCH_FUNC, NULL)))
51  return ret;
52 #endif /* USE_UDF0 */
53 
54 #ifdef USE_UDF1
55  /* If user-defined format 0 was specified during configure, set up
56  * it's dispatch table. */
57  if ((ret = nc_def_user_format(NC_UDF1F, &UDF1_DISPATCH_FUNC, NULL)))
58  return ret;
59 #endif /* USE_UDF0 */
60 
61 #ifdef LOGGING
62  if(getenv(NCLOGLEVELENV) != NULL) {
63  char* slevel = getenv(NCLOGLEVELENV);
64  long level = atol(slevel);
65  if(level >= 0)
66  nc_set_log_level((int)level);
67  }
68 #endif
69  return ret;
70 }
71 
78 int
79 NC4_finalize(void)
80 {
81  return NC_NOERR;
82 }
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:136
#define NC_UDF0
User-defined format 0.
Definition: netcdf.h:135
#define NC_NOERR
No Error.
Definition: netcdf.h:323

Return to the Main Unidata NetCDF page.
Generated on Sat Apr 6 2019 08:19:00 for NetCDF. NetCDF is a Unidata library.