From f57672b3f1f07798741330dc09f0cba06136bfca Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Sun, 28 Apr 2024 15:39:57 -0600 Subject: [PATCH] m1 --- include/ncdispatch.h | 65 ++++++++++++++++++------------------- unit_test/tst_nc4internal.c | 14 ++++---- 2 files changed, 39 insertions(+), 40 deletions(-) diff --git a/include/ncdispatch.h b/include/ncdispatch.h index 109151362e..51120b5d24 100644 --- a/include/ncdispatch.h +++ b/include/ncdispatch.h @@ -96,51 +96,51 @@ typedef struct NC_MPI_INFO { /* Define known dispatch tables and initializers */ -extern int NCDISPATCH_initialize(void); -extern int NCDISPATCH_finalize(void); +EXTERNL int NCDISPATCH_initialize(void); +EXTERNL int NCDISPATCH_finalize(void); -extern const NC_Dispatch* NC3_dispatch_table; -extern int NC3_initialize(void); -extern int NC3_finalize(void); +EXTERNL const NC_Dispatch* NC3_dispatch_table; +EXTERNL int NC3_initialize(void); +EXTERNL int NC3_finalize(void); #ifdef NETCDF_ENABLE_DAP -extern const NC_Dispatch* NCD2_dispatch_table; -extern int NCD2_initialize(void); -extern int NCD2_finalize(void); +EXTERNL const NC_Dispatch* NCD2_dispatch_table; +EXTERNL int NCD2_initialize(void); +EXTERNL int NCD2_finalize(void); #endif #ifdef NETCDF_ENABLE_DAP4 -extern const NC_Dispatch* NCD4_dispatch_table; -extern int NCD4_initialize(void); -extern int NCD4_finalize(void); +EXTERNL const NC_Dispatch* NCD4_dispatch_table; +EXTERNL int NCD4_initialize(void); +EXTERNL int NCD4_finalize(void); #endif #ifdef USE_PNETCDF -extern const NC_Dispatch* NCP_dispatch_table; -extern int NCP_initialize(void); -extern int NCP_finalize(void); +EXTERNL const NC_Dispatch* NCP_dispatch_table; +EXTERNL int NCP_initialize(void); +EXTERNL int NCP_finalize(void); #endif #ifdef USE_NETCDF4 -extern int NC4_initialize(void); -extern int NC4_finalize(void); +EXTERNL int NC4_initialize(void); +EXTERNL int NC4_finalize(void); #endif #ifdef USE_HDF5 -extern const NC_Dispatch* HDF5_dispatch_table; -extern int NC_HDF5_initialize(void); -extern int NC_HDF5_finalize(void); +EXTERNL const NC_Dispatch* HDF5_dispatch_table; +EXTERNL int NC_HDF5_initialize(void); +EXTERNL int NC_HDF5_finalize(void); #endif #ifdef USE_HDF4 -extern const NC_Dispatch* HDF4_dispatch_table; -extern int HDF4_initialize(void); -extern int HDF4_finalize(void); +EXTERNL const NC_Dispatch* HDF4_dispatch_table; +EXTERNL int HDF4_initialize(void); +EXTERNL int HDF4_finalize(void); #endif #ifdef NETCDF_ENABLE_NCZARR -extern const NC_Dispatch* NCZ_dispatch_table; -extern int NCZ_initialize(void); -extern int NCZ_finalize(void); +EXTERNL const NC_Dispatch* NCZ_dispatch_table; +EXTERNL int NCZ_initialize(void); +EXTERNL int NCZ_finalize(void); #endif /* User-defined formats.*/ @@ -150,8 +150,7 @@ extern NC_Dispatch* UDF1_dispatch_table; extern char UDF1_magic_number[NC_MAX_MAGIC_NUMBER_LEN + 1]; /* Prototypes. */ -int NC_check_nulls(int ncid, int varid, const size_t *start, size_t **count, - ptrdiff_t **stride); +EXTERNL int NC_check_nulls(int ncid, int varid, const size_t *start, size_t **count, ptrdiff_t **stride); /**************************************************/ /* Forward */ @@ -166,10 +165,10 @@ struct nc_vlen_t; struct NC; struct NCglobalstate; -int NC_create(const char *path, int cmode, +EXTERNL int NC_create(const char *path, int cmode, size_t initialsz, int basepe, size_t *chunksizehintp, int useparallel, void *parameters, int *ncidp); -int NC_open(const char *path, int cmode, +EXTERNL int NC_open(const char *path, int cmode, int basepe, size_t *chunksizehintp, int useparallel, void *parameters, int *ncidp); @@ -216,9 +215,9 @@ EXTERNL char* NC_atomictypename(nc_type xtype); /* Misc */ -extern int NC_getshape(int ncid, int varid, int ndims, size_t* shape); -extern int NC_is_recvar(int ncid, int varid, size_t* nrecs); -extern int NC_inq_recvar(int ncid, int varid, int* nrecdims, int* is_recdim); +EXTERNL int NC_getshape(int ncid, int varid, int ndims, size_t* shape); +EXTERNL int NC_is_recvar(int ncid, int varid, size_t* nrecs); +EXTERNL int NC_inq_recvar(int ncid, int varid, int* nrecdims, int* is_recdim); #define nullstring(s) (s==NULL?"(null)":s) @@ -270,8 +269,6 @@ EXTERNL const char* nc4_atomic_name[NUM_ATOMIC_TYPES]; extern "C" { #endif -EXTERNL int NCDISPATCH_initialize(void); -EXTERNL int NCDISPATCH_finalize(void); EXTERNL struct NCglobalstate* NC_getglobalstate(void); EXTERNL void NC_freeglobalstate(void); diff --git a/unit_test/tst_nc4internal.c b/unit_test/tst_nc4internal.c index 11410f17db..448429817b 100644 --- a/unit_test/tst_nc4internal.c +++ b/unit_test/tst_nc4internal.c @@ -8,7 +8,7 @@ */ #include "config.h" -#include +#include "nc_tests.h" #include "nc.h" #include "nc4internal.h" #include "ncdispatch.h" @@ -23,8 +23,8 @@ #define DIM_LEN 5 #define TYPE_NAME "Madonna" #define TYPE_SIZE TEST_VAL_42 -#define FIELD_NAME "Britany_Spears" -#define FIELD_OFFSET 9 +#define TST_FIELD_NAME "Britany_Spears" +#define TST_FIELD_OFFSET 9 int main(int argc, char **argv) @@ -85,8 +85,10 @@ main(int argc, char **argv) char *path; void *dispatchdata_in; int mode = 0, mode_in; - NC_GRP_INFO_T *grp, *grp2; - NC_FILE_INFO_T *h5, *h52; + NC_GRP_INFO_T *grp; + NC_GRP_INFO_T *grp2; + NC_FILE_INFO_T *h5; + NC_FILE_INFO_T *h52; /* Create the NC* instance and insert its dispatcher */ if (new_NC(NC3_dispatch_table, FILE_NAME, mode, &ncp)) ERR; @@ -244,7 +246,7 @@ main(int argc, char **argv) if (nc4_type_list_add(grp, TYPE_SIZE, TYPE_NAME, &type)) ERR; /* Add a field to the type. */ - /* if (nc4_field_list_add(type, FIELD_NAME, FIELD_OFFSET, NC_INT, 0, */ + /* if (nc4_field_list_add(type, TST_FIELD_NAME, TST_FIELD_OFFSET, NC_INT, 0, */ /* NULL)) ERR; */ /* Find it. */