Skip to content

Commit

Permalink
m1
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisHeimbigner committed Apr 28, 2024
1 parent ee78229 commit f57672b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 40 deletions.
65 changes: 31 additions & 34 deletions include/ncdispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.*/
Expand All @@ -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 */
Expand All @@ -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);

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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);

Expand Down
14 changes: 8 additions & 6 deletions unit_test/tst_nc4internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

#include "config.h"
#include <nc_tests.h>
#include "nc_tests.h"
#include "nc.h"
#include "nc4internal.h"
#include "ncdispatch.h"
Expand All @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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. */
Expand Down

0 comments on commit f57672b

Please sign in to comment.