From 77a97f775a4e86bf4d4f97ab96eb3ce4d406ffcd Mon Sep 17 00:00:00 2001 From: Stephan Bosch <stephan.bosch@open-xchange.com> Date: Sun, 15 Sep 2024 00:09:15 +0200 Subject: [PATCH] lib-sieve: storage: file: Rename dirpath to dir_path --- src/lib-sieve/sieve-script.h | 2 +- .../storage/file/sieve-file-script.c | 20 +++++++++---------- .../storage/file/sieve-file-storage.h | 4 ++-- src/testsuite/testsuite-script.c | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/lib-sieve/sieve-script.h b/src/lib-sieve/sieve-script.h index 3cc218758..0be7cc334 100644 --- a/src/lib-sieve/sieve-script.h +++ b/src/lib-sieve/sieve-script.h @@ -119,7 +119,7 @@ bool sieve_script_is_open(const struct sieve_script *script) ATTR_PURE; bool sieve_script_is_default(const struct sieve_script *script) ATTR_PURE; const char * -sieve_file_script_get_dirpath(const struct sieve_script *script) ATTR_PURE; +sieve_file_script_get_dir_path(const struct sieve_script *script) ATTR_PURE; const char * sieve_file_script_get_path(const struct sieve_script *script) ATTR_PURE; diff --git a/src/lib-sieve/storage/file/sieve-file-script.c b/src/lib-sieve/storage/file/sieve-file-script.c index 5c5b210d8..5e1e44b7f 100644 --- a/src/lib-sieve/storage/file/sieve-file-script.c +++ b/src/lib-sieve/storage/file/sieve-file-script.c @@ -281,16 +281,16 @@ sieve_file_script_stat(const char *path, struct stat *st, struct stat *lnk_st) } static const char * -path_split_filename(const char *path, const char **dirpath_r) +path_split_filename(const char *path, const char **dir_path_r) { const char *filename; filename = strrchr(path, '/'); if (filename == NULL) { - *dirpath_r = ""; + *dir_path_r = ""; filename = path; } else { - *dirpath_r = t_strdup_until(path, filename); + *dir_path_r = t_strdup_until(path, filename); filename++; } return filename; @@ -307,7 +307,7 @@ sieve_file_script_open(struct sieve_script *script, container_of(storage, struct sieve_file_storage, storage); pool_t pool = script->pool; const char *filename, *name, *path; - const char *dirpath, *basename, *bin_path, *bin_prefix; + const char *dir_path, *basename, *bin_path, *bin_prefix; struct stat st, lnk_st; bool success = TRUE; int ret = 0; @@ -347,7 +347,7 @@ sieve_file_script_open(struct sieve_script *script, } else if (basename == NULL) { basename = name; } - dirpath = path; + dir_path = path; path = sieve_file_storage_path_extend(fstorage, filename); ret = sieve_file_script_stat(path, &st, &lnk_st); @@ -358,7 +358,7 @@ sieve_file_script_open(struct sieve_script *script, path = fstorage->active_path; /* Extract filename from path */ - filename = path_split_filename(path, &dirpath); + filename = path_split_filename(path, &dir_path); basename = sieve_script_file_get_scriptname(filename); if (basename == NULL) @@ -399,7 +399,7 @@ sieve_file_script_open(struct sieve_script *script, bprefix = name; } else { - bpath = dirpath; + bpath = dir_path; bfile = sieve_binfile_from_name(basename); bprefix = basename; } @@ -419,7 +419,7 @@ sieve_file_script_open(struct sieve_script *script, fscript->lnk_st = lnk_st; fscript->path = p_strdup(pool, path); fscript->filename = p_strdup(pool, filename); - fscript->dirpath = p_strdup(pool, dirpath); + fscript->dir_path = p_strdup(pool, dir_path); fscript->bin_path = p_strdup(pool, bin_path); fscript->bin_prefix = p_strdup(pool, bin_prefix); @@ -805,7 +805,7 @@ sieve_file_script_get_size(const struct sieve_script *script, uoff_t *size_r) return 1; } -const char *sieve_file_script_get_dirpath(const struct sieve_script *script) +const char *sieve_file_script_get_dir_path(const struct sieve_script *script) { const struct sieve_file_script *fscript = container_of(script, const struct sieve_file_script, script); @@ -813,7 +813,7 @@ const char *sieve_file_script_get_dirpath(const struct sieve_script *script) if (script->driver_name != sieve_file_script.driver_name) return NULL; - return fscript->dirpath; + return fscript->dir_path; } const char *sieve_file_script_get_path(const struct sieve_script *script) diff --git a/src/lib-sieve/storage/file/sieve-file-storage.h b/src/lib-sieve/storage/file/sieve-file-storage.h index 08d1969b8..7d3eda2a2 100644 --- a/src/lib-sieve/storage/file/sieve-file-storage.h +++ b/src/lib-sieve/storage/file/sieve-file-storage.h @@ -128,7 +128,7 @@ struct sieve_file_script { struct stat lnk_st; const char *path; - const char *dirpath; + const char *dir_path; const char *filename; const char *bin_path; const char *bin_prefix; @@ -162,7 +162,7 @@ int sieve_file_script_open_from_path(struct sieve_file_storage *fstorage, /* Return directory where script resides in. Returns NULL if this is not a file script. */ -const char *sieve_file_script_get_dirpath(const struct sieve_script *script); +const char *sieve_file_script_get_dir_path(const struct sieve_script *script); /* Return full path to file script. Returns NULL if this is not a file script. */ diff --git a/src/testsuite/testsuite-script.c b/src/testsuite/testsuite-script.c index 9d5a7d38b..7548f8128 100644 --- a/src/testsuite/testsuite-script.c +++ b/src/testsuite/testsuite-script.c @@ -42,7 +42,7 @@ _testsuite_script_compile(const struct sieve_runtime_env *renv, sieve_runtime_trace(renv, SIEVE_TRLVL_TESTS, "compile script '%s'", script); - script_path = sieve_file_script_get_dirpath(renv->script); + script_path = sieve_file_script_get_dir_path(renv->script); if (script_path == NULL) return NULL; -- GitLab