Skip to content

Commit

Permalink
test1
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisHeimbigner committed Sep 7, 2024
1 parent 6388421 commit c519426
Show file tree
Hide file tree
Showing 26 changed files with 420 additions and 1,107 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main-cmake.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: NetCDF-C CMake CI - Windows

on: [pull_request, workflow_dispatch]
on: [push,pull_request, workflow_dispatch]

env:
REMOTETESTDOWN: ${{ vars.REMOTETESTDOWN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

name: Run macOS-based netCDF Tests

on: [pull_request,workflow_dispatch]
on: [push,pull_request,workflow_dispatch]

concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

name: Run Ubuntu/Linux netCDF Tests

on: [pull_request,workflow_dispatch]
on: [push,pull_request,workflow_dispatch]

env:
REMOTETESTDOWN: ${{ vars.REMOTETESTDOWN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_win_cygwin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Run Cygwin-based tests

on: [pull_request,workflow_dispatch]
on: [push,pull_request,workflow_dispatch]

concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_win_mingw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
CPPFLAGS: "-D_BSD_SOURCE"
REMOTETESTDOWN: ${{ vars.REMOTETESTDOWN }}

on: [pull_request,workflow_dispatch]
on: [push,pull_request,workflow_dispatch]

concurrency:
group: ${{ github.workflow}}-${{ github.head_ref }}
Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ AC_ARG_ENABLE([benchmarks],
are timed. We use these tests to check netCDF performance.])])
test "x$enable_benchmarks" = xyes || enable_benchmarks=no
AC_MSG_RESULT($enable_benchmarks)
if test "x$enable_HDF5" = xno -a "x$enable_benchmarks" = xyes; then
if test "x$enable_hdf5" = xno -a "x$enable_benchmarks" = xyes; then
AC_MSG_ERROR([Can't use benchmarks if HDF5 is disabled.])
fi
AM_CONDITIONAL(BUILD_BENCHMARKS, [test x$enable_benchmarks = xyes])
Expand Down Expand Up @@ -1595,7 +1595,7 @@ enable_hdf5_szip=no
has_hdf5_ros3=no

if test "x$enable_hdf5" = xyes; then

AC_DEFINE([NETCDF_ENABLE_HDF5], [1], [if true, use HDF5])
AC_DEFINE([USE_HDF5], [1], [if true, use HDF5])
AC_DEFINE([H5_USE_16_API], [1], [use HDF5 1.6 API])

Expand Down
11 changes: 3 additions & 8 deletions include/ncplugins.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@ typedef struct NC_PluginPathDispatch {
int dispatch_version;
int (*initialize)(void** statep, const struct NClist* initialpaths);
int (*finalize)(void** statep);
int (*getall)(void* state, size_t* npathsp, char** pathlist);
int (*getith)(void* state, size_t index, char** entryp);
int (*load)(void* state, const char* paths);
int (*append)(void* state, const char* path);
int (*prepend)(void* state, const char* path);
int (*remove)(void* state, const char* dir);
int (*read)(void* state, size_t* ndirsp, char** dirs);
int (*write)(void* state, size_t ndirs, char** const dirs);
} NC_PluginPathDispatch;

#if defined(__cplusplus)
Expand All @@ -37,8 +33,7 @@ extern "C" {
EXTERNL const NC_PluginPathDispatch NC4_hdf5_pluginpathtable;
EXTERNL const NC_PluginPathDispatch NCZ_pluginpathtable;

EXTERNL int NC_plugin_path_parse(const char* path0, NClist* list);
EXTERNL const char* NC_plugin_path_tostring(size_t npaths, char** paths);
/* See the file netcdf_aux.h for plugin-related utility functions */

#if defined(__cplusplus)
}
Expand Down
65 changes: 60 additions & 5 deletions include/netcdf_aux.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,68 @@ EXTERNL int ncaux_add_field(void* tag, const char *name, nc_type field_type,
int ndims, const int* dimsizes);

/**************************************************/
/* Path-list Parser */
/* Path-list Utilities */

/* Call twice: once for npaths, second to get the parsed path list.
Caller must free the contents of paths argument.
/**
Parse a string into a sequence of path directories.
The pathlist argument has the following syntax:
paths := <empty> | dirlist
dirlist := dir | dirlist separator dir
separator := ';' | ':'
dir := <OS specific directory path>
@param pathlist a string encoding a list of directories
@param sep one of ';' | ':' | '\0' where '\0' means use the platform's default separator.
@param ndirsp return the number of directories in dirsp
@param dirsp return a vector of strings representing the directories parsed from pathlist; caller frees
@return ::NC_NOERR
Note that this function is called twice: first time to get the number of directories
and second to get the directories.
Author: Dennis Heimbigner
*/

EXTERNL int ncaux_plugin_path_parse(const char* pathlist, char sep, size_t* ndirsp, char** dirs);

/**
Concatenate a vector of directories with the separator between.
This is more-or-less the inverse of the ncaux_plugin_path_parse function
The resulting string has following syntax:
paths := <empty> | dirlist
dirlist := dir | dirlist separator dir
separator := ';' | ':'
dir := <OS specific directory path>
@param ndirs the number of directories
@param dirsp the directory vector to concatenate
@param sep one of ';', ':', or '\0'
@param catlen length of the cat arg including a nul terminator
@param cat user provided space for holding the concatenation; nul termination guaranteed if catlen > 0.
@return ::NC_NOERR
@return ::NC_EINVAL for illegal arguments
Note that this function is called twice: first time to get the expected size of
the concatenated string and second to get the contents of the concatenation.
Author: Dennis Heimbigner
*/

EXTERNL int ncaux_plugin_path_tostring(size_t ndirs, char** const dirs, char sep, size_t* catlen, char* cat);


/*
Reclaim a char** object possibly produced by ncaux_plugin_parse function.
@param veclen the number of entries in vec
@param vec a char** vectore
@return ::NC_NOERR
@return ::NC_EINVAL for illegal arguments
*/
EXTERNL int ncaux_plugin_path_parse(const char* pathlist, size_t* npaths, char** paths);
EXTERNL char* ncaux_plugin_path_tostring(size_t ndirs, char** const dirs);

EXTERNL int ncaux_plugin_path_freestringvec(size_t veclen, char** vec);

#if defined(__cplusplus)
}
Expand Down
6 changes: 0 additions & 6 deletions include/netcdf_dispatch.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,6 @@ extern "C" {
EXTERNL int NC_NOOP_inq_var_filter_info(int ncid, int varid, unsigned int id, size_t* nparams, unsigned int* params);
EXTERNL int NC_NOOP_inq_filter_avail(int ncid, unsigned id);

EXTERNL int NC_NOOP_plugin_path_list(int ncid, size_t* npaths, char** pluginlist); /* Caller must free return value*/
EXTERNL int NC_NOOP_plugin_path_append(int ncid, const char *dir);
EXTERNL int NC_NOOP_plugin_path_prepend(int ncid, const char *dir);
EXTERNL int NC_NOOP_plugin_path_remove(int ncid, const char *dir);
EXTERNL int NC_NOOP_plugin_path_load(int ncid, const char *paths);

EXTERNL int NC_NOTNC4_def_grp(int, const char *, int *);
EXTERNL int NC_NOTNC4_rename_grp(int, const char *);
EXTERNL int NC_NOTNC4_def_compound(int, size_t, const char *, nc_type *);
Expand Down
65 changes: 10 additions & 55 deletions include/netcdf_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,9 @@ EXTERNL int nc_plugin_path_finalize(void);
/**
* Return the current sequence of directories in the internal plugin path list.
* Since this function does not modify the plugin path, it can be called at any time.
* @param npaths return the number of paths in the path list
* @param pathlist return the sequence of directies in the path list
* @param formatx specify which dispatch implementatio to read: currently NC_FORMATX_NC_HDF5 or NC_FORMATX_NCZARR.
* @param ndirsp return the number of dirs in the internal path list
* @param dirsp return the sequence of directies in the internal path list; caller must free.
* @return NC_NOERR
* @author Dennis Heimbigner
*
Expand All @@ -150,67 +151,21 @@ EXTERNL int nc_plugin_path_finalize(void);
* The second time with pathlist not NULL to get the actual sequence of paths.
*/

EXTERNL int nc_plugin_path_getall(int formatx, size_t* npathsp, char** pathlist);

/**
* Get ith directory the internal path sequence.
* The index starts at 0 (zero).
* Caller frees the returned string.
* @param index of path to return
* @entryp store copy of the index'th dir from the internal path or NULL if out of range.
* @return NC_NOERR||NC_ERANGE if out of range
* @author Dennis Heimbigner
*/

EXTERNL int nc_plugin_path_getith(int formatx, size_t index, char** entryp);
EXTERNL int nc_plugin_path_read(int formatx, size_t* ndirsp, char** dirs);

/**
* Empty the current internal path sequence
* and replace with the sequence of directories
* parsed from the paths argument.
* In effect, this is sort of bulk loader for the path list.
* and replace with the sequence of directories argument.
*
* The path argument has the following syntax:
* paths := <empty> | dirlist
* dirlist := dir | dirlist separator dir
* separator := ';' | ':'
* dir := <OS specific directory path>
* Note that the ':' separator is not legal on Windows machines.
* The ';' separator is legal on all machines.
* Using a paths argument of "" will clear the set of plugin paths.
* @param paths to overwrite the current internal path list
* @return NC_NOERR
* @author Dennis Heimbigner
*/

EXTERNL int nc_plugin_path_load(int formatx, const char* paths);

/**
* Append a directory to the end of the current internal path list.
* @param dir directory to append.
* @return NC_NOERR
* @author Dennis Heimbigner
*/

EXTERNL int nc_plugin_path_append(int formatx, const char* path);

/**
* Prepend a directory to the front of the current internal path list.
* @param dir directory to prepend
* @return NC_NOERR
* @author Dennis Heimbigner
*/

EXTERNL int nc_plugin_path_prepend(int formatx, const char* path);

/**
* Remove all occurrences of a directory from the internal path sequence
* @param dir directory to prepend
* Using a paths argument of NULL or npaths argument of 0 will clear the set of plugin paths.
* @param formatx specify which dispatch implementation to write: currently NC_FORMATX_NC_HDF5 or NC_FORMATX_NCZARR.
* @param ndirs length of the dirs argument
* @param dirs to overwrite the current internal path list
* @return NC_NOERR
* @author Dennis Heimbigner
*/

EXTERNL int nc_plugin_path_remove(int formatx, const char* dir);
EXTERNL int nc_plugin_path_write(int formatx, size_t ndirs, char** const dirs);

#if defined(__cplusplus)
}
Expand Down
Loading

0 comments on commit c519426

Please sign in to comment.