diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2022-08-05 23:11:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-05 23:11:13 (GMT) |
commit | b22984600a04120088f59bb5876c9d5258fd64b7 (patch) | |
tree | 9324ab3744739b1b10b5e35a659dbe32edd51baa /src/H5private.h | |
parent | 54f116b42db2d2aabd6fdb58cebb99f04f106310 (diff) | |
download | hdf5-b22984600a04120088f59bb5876c9d5258fd64b7.zip hdf5-b22984600a04120088f59bb5876c9d5258fd64b7.tar.gz hdf5-b22984600a04120088f59bb5876c9d5258fd64b7.tar.bz2 |
Adds platform-independent basename and dirname (#1951)
* Adds platform-independent basename and dirname
* Tidy up H5_dirname and H5_basename implementations and add tests
* Committing clang-format changes
* Fix misspelling
* Several fixes for H5_dirname/H5_basename from review
* Committing clang-format changes
* Add reason to VERIFY_STR macros in th5_system.c
* Use H5MM_free instead of HDfree in H5_dirname/H5_basename tests
Co-authored-by: Jordan Henderson <jhenderson@hdfgroup.org>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'src/H5private.h')
-rw-r--r-- | src/H5private.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/H5private.h b/src/H5private.h index f9e7aff..3130bb1 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1411,6 +1411,9 @@ H5_DLL H5_ATTR_CONST int Nflock(int fd, int operation); #ifndef HDstrncpy #define HDstrncpy(X, Y, Z) strncpy(X, Y, Z) #endif +#ifndef HDstrndup +#define HDstrndup(S, N) strndup(S, N) +#endif #ifndef HDstrpbrk #define HDstrpbrk(X, Y) strpbrk(X, Y) #endif @@ -2544,6 +2547,8 @@ H5_DLL double H5_get_time(void); /* Functions for building paths, etc. */ H5_DLL herr_t H5_build_extpath(const char *name, char **extpath /*out*/); H5_DLL herr_t H5_combine_path(const char *path1, const char *path2, char **full_name /*out*/); +H5_DLL herr_t H5_dirname(const char *path, char **dirname /*out*/); +H5_DLL herr_t H5_basename(const char *path, char **basename /*out*/); /* getopt(3) equivalent that papers over the lack of long options on BSD * and lack of Windows support. |