Skip to content

Commit

Permalink
further progress on netcdf integration layer
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Jul 3, 2019
1 parent 50a24e2 commit 2ad312e
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 39 deletions.
3 changes: 2 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if BUILD_NCINT
NCINT = ncint
endif # BUILD_NCINT

SUBDIRS = clib ${NCINT} ${GPTL} $(FLIB)
# Build these subdirectories.
SUBDIRS = ${NCINT} clib ${GPTL} $(FLIB)

EXTRA_DIST = CMakeLists.txt
5 changes: 5 additions & 0 deletions src/clib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
# The library we are building.
lib_LTLIBRARIES = libpioc.la

# Are we building with netCDF integration?
if BUILD_NCINT
libpioc_la_LIBADD = ../ncint/libncint.la
endif # BUILD_NCINT

# These linker flags specify libtool version info.
# See http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning
# for information regarding incrementing `-version-info`.
Expand Down
39 changes: 39 additions & 0 deletions src/ncint/ncintdispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,42 @@ NC_NCINT_finalize(void)
{
return NC_NOERR;
}

#define TEST_VAL_42 42
int
tst_open(const char *path, int mode, int basepe, size_t *chunksizehintp,
void *parameters, const NC_Dispatch *dispatch, NC *nc_file)
{
return NC_NOERR;
}

int
tst_abort(int ncid)
{
return TEST_VAL_42;
}

int
tst_close(int ncid, void *v)
{
return NC_NOERR;
}

int
tst_inq_format(int ncid, int *formatp)
{
return TEST_VAL_42;
}

int
tst_inq_format_extended(int ncid, int *formatp, int *modep)
{
return TEST_VAL_42;
}

int
tst_get_vara(int ncid, int varid, const size_t *start, const size_t *count,
void *value, nc_type t)
{
return TEST_VAL_42;
}
1 change: 1 addition & 0 deletions tests/ncint/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

# Put together AM_CPPFLAGS and AM_LDFLAGS.
include $(top_srcdir)/set_flags.am
LDADD = ${top_builddir}/src/clib/libpioc.la

# Build the test for make check.
check_PROGRAMS = tst_pio_udf
Expand Down
76 changes: 38 additions & 38 deletions tests/ncint/tst_pio_udf.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,43 @@

#define FILE_NAME "tst_pio_udf.nc"

int
tst_open(const char *path, int mode, int basepe, size_t *chunksizehintp,
void *parameters, const NC_Dispatch *dispatch, NC *nc_file)
{
return NC_NOERR;
}

int
tst_abort(int ncid)
{
return TEST_VAL_42;
}

int
tst_close(int ncid, void *v)
{
return NC_NOERR;
}

int
tst_inq_format(int ncid, int *formatp)
{
return TEST_VAL_42;
}

int
tst_inq_format_extended(int ncid, int *formatp, int *modep)
{
return TEST_VAL_42;
}

int
tst_get_vara(int ncid, int varid, const size_t *start, const size_t *count,
void *value, nc_type t)
{
return TEST_VAL_42;
}
/* int */
/* tst_open(const char *path, int mode, int basepe, size_t *chunksizehintp, */
/* void *parameters, const NC_Dispatch *dispatch, NC *nc_file) */
/* { */
/* return NC_NOERR; */
/* } */

/* int */
/* tst_abort(int ncid) */
/* { */
/* return TEST_VAL_42; */
/* } */

/* int */
/* tst_close(int ncid, void *v) */
/* { */
/* return NC_NOERR; */
/* } */

/* int */
/* tst_inq_format(int ncid, int *formatp) */
/* { */
/* return TEST_VAL_42; */
/* } */

/* int */
/* tst_inq_format_extended(int ncid, int *formatp, int *modep) */
/* { */
/* return TEST_VAL_42; */
/* } */

/* int */
/* tst_get_vara(int ncid, int varid, const size_t *start, const size_t *count, */
/* void *value, nc_type t) */
/* { */
/* return TEST_VAL_42; */
/* } */

/* This is the dispatch object that holds pointers to all the
* functions that make up the HDF4 dispatch interface. */
Expand Down Expand Up @@ -155,7 +155,7 @@ main(int argc, char **argv)
if (nc_close(ncid)) ERR;

/* Add our user defined format. */
if (nc_def_user_format(NC_UDF0, &tst_dispatcher, NULL)) ERR;
if (nc_def_user_format(NC_UDF0, &NCINT_dispatcher, NULL)) ERR;

/* Check that our user-defined format has been added. */
if (nc_inq_user_format(NC_UDF0, &disp_in, NULL)) ERR;
Expand Down

0 comments on commit 2ad312e

Please sign in to comment.