diff options
author | David Shaw <[email protected]> | 2002-11-03 00:00:42 +0000 |
---|---|---|
committer | David Shaw <[email protected]> | 2002-11-03 00:00:42 +0000 |
commit | 39e659312ee9afe170fc2fc8b9a62481d1c7af29 (patch) | |
tree | f8616502e8e11748acb2b85ba3a59cec2aa91834 /g10/misc.c | |
parent | * cipher.c (string_to_cipher_algo), md.c (string_to_digest_algo): Allow (diff) | |
download | gnupg-39e659312ee9afe170fc2fc8b9a62481d1c7af29.tar.gz gnupg-39e659312ee9afe170fc2fc8b9a62481d1c7af29.zip |
* keygen.c (set_one_pref, keygen_set_std_prefs): Allow using the full
algorithm name (CAST5, SHA1) rather than the short form (S3, H2).
* main.h, keygen.c (keygen_get_std_prefs), keyedit.c (keyedit_menu):
Return and use a fake uid packet rather than a string since we already
have a nice parser/printer in keyedit.c:show_prefs.
* main.h, misc.c (string_to_compress_algo): New.
Diffstat (limited to 'g10/misc.c')
-rw-r--r-- | g10/misc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/g10/misc.c b/g10/misc.c index ae553eb47..fee040f86 100644 --- a/g10/misc.c +++ b/g10/misc.c @@ -539,6 +539,25 @@ compress_algo_to_string(int algo) } int +string_to_compress_algo(const char *string) +{ + if(ascii_strcasecmp(string,"uncompressed")==0) + return 0; + else if(ascii_strcasecmp(string,"zip")==0) + return 1; + else if(ascii_strcasecmp(string,"zlib")==0) + return 2; + else if(ascii_strcasecmp(string,"z0")==0) + return 0; + else if(ascii_strcasecmp(string,"z1")==0) + return 1; + else if(ascii_strcasecmp(string,"z2")==0) + return 2; + else + return -1; +} + +int check_compress_algo(int algo) { if(algo>=0 && algo<=2) |