summaryrefslogtreecommitdiffstats
path: root/common/stringhelp.h
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2023-06-06 18:19:37 +0200
committerWerner Koch <wk@gnupg.org>2023-06-06 18:19:37 +0200
commit7b7fdf45e5d8b3b066c5efbf6ec872e1249f3a24 (patch)
tree43c321d951f444f1869596013427c21e3705ba11 /common/stringhelp.h
parentgpg: Set default expiration date to 3 years. (diff)
downloadgnupg2-7b7fdf45e5d8b3b066c5efbf6ec872e1249f3a24.tar.xz
gnupg2-7b7fdf45e5d8b3b066c5efbf6ec872e1249f3a24.zip
common: New function substitute_vars.
* common/stringhelp.c (substitute_envvars): Factor code out to (substitute_vars): new. (subst_getenv): New. -- This is a generalized version of substitute_envvars.
Diffstat (limited to '')
-rw-r--r--common/stringhelp.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/stringhelp.h b/common/stringhelp.h
index 915b3aa72..cd185e49a 100644
--- a/common/stringhelp.h
+++ b/common/stringhelp.h
@@ -169,7 +169,10 @@ int compare_version_strings (const char *my_version, const char *req_version);
/* Format a string so that it fits within about TARGET_COLS columns. */
char *format_text (const char *text, int target_cols, int max_cols);
-/* Substitute environmen variabales in STRING. */
+/* Substitute variables in STRING. */
+char *substitute_vars (const char *string,
+ const char *(*getval)(void *cookie, const char *name),
+ void *cookie);
char *substitute_envvars (const char *string);