diff options
author | Werner Koch <[email protected]> | 2019-02-08 08:32:55 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2019-02-08 10:13:33 +0000 |
commit | e2f18023b3b3b7e55b35218f65e37448d1011172 (patch) | |
tree | 2844ce521fde92a777e00ef91e0bd7ff41722b7c /common/server-help.h | |
parent | card: Print the used algorithm of all keys. (diff) | |
download | gnupg-e2f18023b3b3b7e55b35218f65e37448d1011172.tar.gz gnupg-e2f18023b3b3b7e55b35218f65e37448d1011172.zip |
common: New functions get_option_value and ascii_strupr.
* common/server-help.c (get_option_value): New.
* common/stringhelp.c (ascii_strupr): New.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'common/server-help.h')
-rw-r--r-- | common/server-help.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/server-help.h b/common/server-help.h index 9e3d7ada1..9d2f4cfba 100644 --- a/common/server-help.h +++ b/common/server-help.h @@ -55,6 +55,14 @@ int has_leading_option (const char *line, const char *name); or a space. */ const char *has_option_name (const char *line, const char *name); +/* Same as has_option_name but ignores all options after a "--" and + * does not return a const char ptr. */ +char *has_leading_option_name (char *line, const char *name); + +/* Parse an option with the format "--NAME=VALUE" and return the value + * as a malloced string. */ +gpg_error_t get_option_value (char *line, const char *name, char **r_value); + /* Return a pointer to the argument of the option with NAME. If such an option is not given, NULL is returned. */ char *option_value (const char *line, const char *name); |