summaryrefslogtreecommitdiffstats
path: root/src/H5PLpath.c
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2023-09-15 22:13:18 (GMT)
committerGitHub <noreply@github.com>2023-09-15 22:13:18 (GMT)
commit44a00ef876ad3e1922847e93feac57c479217fbe (patch)
tree5e9fc677913a06a71eba1342633f92e93bd07a6c /src/H5PLpath.c
parent59a90368cdb696205bdf15040d1a48b4f69af97f (diff)
downloadhdf5-44a00ef876ad3e1922847e93feac57c479217fbe.zip
hdf5-44a00ef876ad3e1922847e93feac57c479217fbe.tar.gz
hdf5-44a00ef876ad3e1922847e93feac57c479217fbe.tar.bz2
Strip HD prefix from string/char C API calls (#3540)
* Strip HD prefix from string/char C API calls * HD(f)(put|get)(s|c) * HDstr* * HDv*printf * HD(s)(print|scan)f * HDperror But NOT: * HDstrcase* * HDvasprintf * HDstrtok_r * HDstrndup As those are not C99 and have portability work-around implementations. They will be handled later. * Fix th5_system.c screwup
Diffstat (limited to 'src/H5PLpath.c')
-rw-r--r--src/H5PLpath.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/src/H5PLpath.c b/src/H5PLpath.c
index 9b2f987..fafce62 100644
--- a/src/H5PLpath.c
+++ b/src/H5PLpath.c
@@ -109,7 +109,7 @@ H5PL__insert_at(const char *path, unsigned int idx)
/* Check args - Just assert on package functions */
assert(path);
- assert(HDstrlen(path));
+ assert(strlen(path));
/* Expand the table if it is full */
if (H5PL_num_paths_g == H5PL_path_capacity_g)
@@ -190,7 +190,7 @@ H5PL__replace_at(const char *path, unsigned int idx)
/* Check args - Just assert on package functions */
assert(path);
- assert(HDstrlen(path));
+ assert(strlen(path));
/* Check that the table entry is in use */
if (!H5PL_paths_g[idx])
@@ -387,7 +387,7 @@ H5PL__append_path(const char *path)
/* Check args - Just assert on package functions */
assert(path);
- assert(HDstrlen(path));
+ assert(strlen(path));
/* Insert the path at the end of the table */
if (H5PL__insert_at(path, H5PL_num_paths_g) < 0)
@@ -415,7 +415,7 @@ H5PL__prepend_path(const char *path)
/* Check args - Just assert on package functions */
assert(path);
- assert(HDstrlen(path));
+ assert(strlen(path));
/* Insert the path at the beginning of the table */
if (H5PL__insert_at(path, 0) < 0)
@@ -443,7 +443,7 @@ H5PL__replace_path(const char *path, unsigned int idx)
/* Check args - Just assert on package functions */
assert(path);
- assert(HDstrlen(path));
+ assert(strlen(path));
assert(idx < H5PL_path_capacity_g);
/* Insert the path at the requested index */
@@ -473,7 +473,7 @@ H5PL__insert_path(const char *path, unsigned int idx)
/* Check args - Just assert on package functions */
assert(path);
- assert(HDstrlen(path));
+ assert(strlen(path));
assert(idx < H5PL_path_capacity_g);
/* Insert the path at the requested index */
@@ -625,10 +625,10 @@ H5PL__path_table_iterate_process_path(const char *plugin_path, H5PL_iterate_type
* or libxxx.xxx.dylib on Mac.
*/
#ifndef __CYGWIN__
- if (!HDstrncmp(dp->d_name, "lib", (size_t)3) &&
- (HDstrstr(dp->d_name, ".so") || HDstrstr(dp->d_name, ".dylib"))) {
+ if (!strncmp(dp->d_name, "lib", (size_t)3) &&
+ (strstr(dp->d_name, ".so") || strstr(dp->d_name, ".dylib"))) {
#else
- if (!HDstrncmp(dp->d_name, "cyg", (size_t)3) && HDstrstr(dp->d_name, ".dll")) {
+ if (!strncmp(dp->d_name, "cyg", (size_t)3) && strstr(dp->d_name, ".dll")) {
#endif
bool plugin_matches;
@@ -636,18 +636,18 @@ H5PL__path_table_iterate_process_path(const char *plugin_path, H5PL_iterate_type
size_t len;
/* Allocate & initialize the path name */
- len = HDstrlen(plugin_path) + HDstrlen(H5PL_PATH_SEPARATOR) + HDstrlen(dp->d_name) + 1 /*\0*/ +
+ len = strlen(plugin_path) + strlen(H5PL_PATH_SEPARATOR) + strlen(dp->d_name) + 1 /*\0*/ +
4; /* Extra "+4" to quiet GCC warning - 2019/07/05, QAK */
if (NULL == (path = (char *)H5MM_calloc(len)))
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, H5_ITER_ERROR, "can't allocate memory for path");
- HDsnprintf(path, len, "%s/%s", plugin_path, dp->d_name);
+ snprintf(path, len, "%s/%s", plugin_path, dp->d_name);
/* Get info for directory entry */
if (HDstat(path, &my_stat) == -1)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5_ITER_ERROR, "can't stat file %s -- error was: %s", path,
- HDstrerror(errno));
+ strerror(errno));
/* If it is a directory, skip it */
if (S_ISDIR(my_stat.st_mode))
@@ -681,7 +681,7 @@ done:
if (dirp)
if (HDclosedir(dirp) < 0)
HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, H5_ITER_ERROR, "can't close directory: %s",
- HDstrerror(errno));
+ strerror(errno));
path = (char *)H5MM_xfree(path);
@@ -709,24 +709,24 @@ H5PL__path_table_iterate_process_path(const char *plugin_path, H5PL_iterate_type
/* Specify a file mask. *.* = We want everything! -
* skip the path if the directory can't be opened */
- HDsnprintf(service, sizeof(service), "%s\\*.dll", plugin_path);
+ snprintf(service, sizeof(service), "%s\\*.dll", plugin_path);
if ((hFind = FindFirstFileA(service, &fdFile)) == INVALID_HANDLE_VALUE)
HGOTO_DONE(H5_ITER_CONT);
/* Loop over all the files */
do {
/* Ignore '.' and '..' */
- if (HDstrcmp(fdFile.cFileName, ".") != 0 && HDstrcmp(fdFile.cFileName, "..") != 0) {
+ if (strcmp(fdFile.cFileName, ".") != 0 && strcmp(fdFile.cFileName, "..") != 0) {
bool plugin_matches;
size_t len;
/* Allocate & initialize the path name */
- len = HDstrlen(plugin_path) + HDstrlen(H5PL_PATH_SEPARATOR) + HDstrlen(fdFile.cFileName) + 1;
+ len = strlen(plugin_path) + strlen(H5PL_PATH_SEPARATOR) + strlen(fdFile.cFileName) + 1;
if (NULL == (path = (char *)H5MM_calloc(len)))
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, H5_ITER_ERROR, "can't allocate memory for path");
- HDsnprintf(path, len, "%s\\%s", plugin_path, fdFile.cFileName);
+ snprintf(path, len, "%s\\%s", plugin_path, fdFile.cFileName);
/* Ignore directories */
if (fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
@@ -863,28 +863,28 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, bool *found
* or libxxx.xxx.dylib on Mac.
*/
#ifndef __CYGWIN__
- if (!HDstrncmp(dp->d_name, "lib", (size_t)3) &&
- (HDstrstr(dp->d_name, ".so") || HDstrstr(dp->d_name, ".dylib"))) {
+ if (!strncmp(dp->d_name, "lib", (size_t)3) &&
+ (strstr(dp->d_name, ".so") || strstr(dp->d_name, ".dylib"))) {
#else
- if (!HDstrncmp(dp->d_name, "cyg", (size_t)3) && HDstrstr(dp->d_name, ".dll")) {
+ if (!strncmp(dp->d_name, "cyg", (size_t)3) && strstr(dp->d_name, ".dll")) {
#endif
h5_stat_t my_stat;
size_t len;
/* Allocate & initialize the path name */
- len = HDstrlen(dir) + HDstrlen(H5PL_PATH_SEPARATOR) + HDstrlen(dp->d_name) + 1 /*\0*/ +
+ len = strlen(dir) + strlen(H5PL_PATH_SEPARATOR) + strlen(dp->d_name) + 1 /*\0*/ +
4; /* Extra "+4" to quiet GCC warning - 2019/07/05, QAK */
if (NULL == (path = (char *)H5MM_calloc(len)))
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path");
- HDsnprintf(path, len, "%s/%s", dir, dp->d_name);
+ snprintf(path, len, "%s/%s", dir, dp->d_name);
/* Get info for directory entry */
if (HDstat(path, &my_stat) == -1)
HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't stat file %s -- error was: %s", path,
- HDstrerror(errno));
+ strerror(errno));
/* If it is a directory, skip it */
if (S_ISDIR(my_stat.st_mode)) {
@@ -905,7 +905,7 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, bool *found
done:
if (dirp)
if (HDclosedir(dirp) < 0)
- HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", HDstrerror(errno));
+ HDONE_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "can't close directory: %s", strerror(errno));
path = (char *)H5MM_xfree(path);
@@ -934,26 +934,26 @@ H5PL__find_plugin_in_path(const H5PL_search_params_t *search_params, bool *found
*found = false;
/* Specify a file mask. *.* = We want everything! */
- HDsnprintf(service, sizeof(service), "%s\\*.dll", dir);
+ snprintf(service, sizeof(service), "%s\\*.dll", dir);
if ((hFind = FindFirstFileA(service, &fdFile)) == INVALID_HANDLE_VALUE)
HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory");
/* Loop over all the files */
do {
/* Ignore '.' and '..' */
- if (HDstrcmp(fdFile.cFileName, ".") != 0 && HDstrcmp(fdFile.cFileName, "..") != 0) {
+ if (strcmp(fdFile.cFileName, ".") != 0 && strcmp(fdFile.cFileName, "..") != 0) {
/* XXX: Probably just continue here and move the code below over one tab */
size_t len;
/* Allocate & initialize the path name */
- len = HDstrlen(dir) + HDstrlen(H5PL_PATH_SEPARATOR) + HDstrlen(fdFile.cFileName) + 1;
+ len = strlen(dir) + strlen(H5PL_PATH_SEPARATOR) + strlen(fdFile.cFileName) + 1;
if (NULL == (path = (char *)H5MM_calloc(len)))
HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path");
- HDsnprintf(path, len, "%s\\%s", dir, fdFile.cFileName);
+ snprintf(path, len, "%s\\%s", dir, fdFile.cFileName);
/* Ignore directories */
if (fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)