diff options
author | Werner Koch <[email protected]> | 2022-03-18 12:47:10 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2022-03-18 13:14:39 +0000 |
commit | 449d2fbcde630974628285d3405feb6ab2a812f9 (patch) | |
tree | e2eef0f8d1ff5e68d3bacb5a8193829cb31333b1 /common/stringhelp.h | |
parent | gpg: Allow decryption of symencr even for non-compliant cipher. (diff) | |
download | gnupg-449d2fbcde630974628285d3405feb6ab2a812f9.tar.gz gnupg-449d2fbcde630974628285d3405feb6ab2a812f9.zip |
common: New function map_static_strings
* common/mapstrings.c (struct intmapping_s): New.
(map_static_strings): New.
* common/stringhelp.c (do_strconcat): Rename to ...
(vstrconcat): this and make global.
* common/t-mapstrings.c (test_map_static_strings): New test.
Diffstat (limited to 'common/stringhelp.h')
-rw-r--r-- | common/stringhelp.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/common/stringhelp.h b/common/stringhelp.h index cd874af2e..915b3aa72 100644 --- a/common/stringhelp.h +++ b/common/stringhelp.h @@ -141,9 +141,12 @@ char *try_percent_escape (const char *str, const char *extra); NULL. Returns a malloced buffer with the new string or NULL on a malloc error or if too many arguments are given. */ char *strconcat (const char *s1, ...) GPGRT_ATTR_SENTINEL(0); +/* Same but taking a va_list. */ +char *vstrconcat (const char *s1, va_list arg_ptr); /* Ditto, but die on error. */ char *xstrconcat (const char *s1, ...) GPGRT_ATTR_SENTINEL(0); + char **strsplit (char *string, char delim, char replacement, int *count); /* Tokenize STRING using the set of delimiters in DELIM. */ @@ -172,5 +175,7 @@ char *substitute_envvars (const char *string); /*-- mapstrings.c --*/ const char *map_static_macro_string (const char *string); +const char *map_static_strings (const char *domain, int key1, int key2, + const char *string1, ...); #endif /*GNUPG_COMMON_STRINGHELP_H*/ |