netcdf-c/liblib/stub.c

84 lines
1.7 KiB
C
Raw Normal View History

2010-06-03 21:24:43 +08:00
/*********************************************************************
* Copyright 2010, UCAR/Unidata
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
*********************************************************************/
#include "config.h"
#include "ncdispatch.h"
2010-06-03 21:24:43 +08:00
extern int NC3_initialize(void);
2011-09-21 04:39:04 +08:00
2013-03-16 04:31:07 +08:00
extern int NCSUBSTRATE_initialize(void);
2010-06-03 21:24:43 +08:00
#ifdef USE_NETCDF4
extern int NC4_initialize(void);
#endif
#ifdef USE_DAP
extern int NCD3_initialize(void);
#ifdef USE_NETCDF4
extern int NCD4_initialize(void);
#endif
#endif
2011-04-17 04:56:36 +08:00
#ifdef USE_CDMREMOTE
2010-12-16 05:45:05 +08:00
extern int NCCR_initialize(void);
#endif
2013-03-16 04:31:07 +08:00
#ifdef USE_PNETCDF
extern int NC5_initialize(void);
2011-09-21 04:39:04 +08:00
#endif
2013-03-16 04:31:07 +08:00
/**
This procedure invokes all defined
initializers, and there is an initializer
for every known dispatch table.
So if you modify the format of NC_Dispatch,
then you need to fix it everywhere.
*/
2010-06-03 21:24:43 +08:00
int
NC_initialize(void)
{
int stat = NC_NOERR;
2011-09-19 04:57:51 +08:00
/* Allow libdispatch to do initialization */
if((stat = NCDISPATCH_initialize())) return stat;
/* Initialize each active protocol */
2010-06-03 21:24:43 +08:00
if((stat = NC3_initialize())) return stat;
#ifdef USE_DAP
if((stat = NCD3_initialize())) return stat;
#endif
2013-03-16 04:31:07 +08:00
#ifdef USE_PNETCDF
if((stat = NC5_initialize())) return stat;
#endif
2011-09-21 04:39:04 +08:00
#ifdef USE_NETCDF4
if((stat = NC4_initialize())) return stat;
/* if((stat = NCD_initialize())) return stat; */
2011-09-21 04:39:04 +08:00
#ifdef USE_DAP
#ifdef NOTUSED
2010-06-03 21:24:43 +08:00
if((stat = NCD4_initialize())) return stat;
#endif
#endif
2010-06-03 21:24:43 +08:00
2011-04-17 04:56:36 +08:00
#ifdef USE_CDMREMOTE
2010-12-16 05:45:05 +08:00
if((stat = NCCR_initialize())) return stat;
#endif
2011-09-21 04:39:04 +08:00
#endif /* USE_NETCDF4 */
2013-03-16 04:31:07 +08:00
/* Finally, initialize the SUBSTRATE table (dsubstrate.c) */
if((stat = NCSUBSTRATE_initialize())) return stat;
2011-09-21 04:39:04 +08:00
2010-06-03 21:24:43 +08:00
return NC_NOERR;
}