diff options
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) |