1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

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.
This commit is contained in:
Werner Koch 2022-03-18 13:47:10 +01:00
parent 8631d4cfe2
commit 449d2fbcde
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
4 changed files with 86 additions and 5 deletions

View file

@ -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*/