[prev in list] [next in list] [prev in thread] [next in thread]
List: gnupg-commit-watchers
Subject: [svn] GnuPG - r4629 - branches/STABLE-BRANCH-1-4/g10
From: cvs () trithemius ! gnupg ! org (svn author dshaw)
Date: 2007-11-28 14:59:23
Message-ID: E1IxOI9-0002sD-Oh () trithemius ! gnupg ! org
[Download RAW message or body]
Author: dshaw
Date: 2007-11-28 16:09:52 +0100 (Wed, 28 Nov 2007)
New Revision: 4629
Modified:
branches/STABLE-BRANCH-1-4/g10/ChangeLog
branches/STABLE-BRANCH-1-4/g10/gpg.c
Log:
* gpg.c (print_algo_names): New. (list_config): Use it here for the
"ciphername" and "digestname" config items so we can get a
script-parseable list of the names.
Modified: branches/STABLE-BRANCH-1-4/g10/ChangeLog
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/ChangeLog 2007-11-27 08:37:03 UTC (rev 4628)
+++ branches/STABLE-BRANCH-1-4/g10/ChangeLog 2007-11-28 15:09:52 UTC (rev 4629)
@@ -1,3 +1,9 @@
+2007-11-28 David Shaw <dshaw@jabberwocky.com>
+
+ * gpg.c (print_algo_names): New.
+ (list_config): Use it here for the "ciphername" and "digestname"
+ config items so we can get a script-parseable list of the names.
+
2007-11-19 Werner Koch <wk@g10code.com>
* keyedit.c (keyedit_menu): String grammar fix.
Modified: branches/STABLE-BRANCH-1-4/g10/gpg.c
===================================================================
--- branches/STABLE-BRANCH-1-4/g10/gpg.c 2007-11-27 08:37:03 UTC (rev 4628)
+++ branches/STABLE-BRANCH-1-4/g10/gpg.c 2007-11-28 15:09:52 UTC (rev 4629)
@@ -1324,7 +1324,6 @@
return 0;
}
-
static void
print_algo_numbers(int (*checker)(int))
{
@@ -1343,7 +1342,24 @@
}
}
+static void
+print_algo_names(int (*checker)(int),const char *(*mapper)(int))
+{
+ int i,first=1;
+ for(i=0;i<=110;i++)
+ {
+ if(!checker(i))
+ {
+ if(first)
+ first=0;
+ else
+ printf(";");
+ printf("%s",mapper(i));
+ }
+ }
+}
+
/* In the future, we can do all sorts of interesting configuration
output here. For now, just give "group" as the Enigmail folks need
it, and pubkey, cipher, hash, and compress as they may be useful
@@ -1410,6 +1426,14 @@
any=1;
}
+ if(show_all || ascii_strcasecmp(name,"ciphername")==0)
+ {
+ printf("cfg:ciphername:");
+ print_algo_names(check_cipher_algo,cipher_algo_to_string);
+ printf("\n");
+ any=1;
+ }
+
if(show_all
|| ascii_strcasecmp(name,"digest")==0
|| ascii_strcasecmp(name,"hash")==0)
@@ -1420,6 +1444,16 @@
any=1;
}
+ if(show_all
+ || ascii_strcasecmp(name,"digestname")==0
+ || ascii_strcasecmp(name,"hashname")==0)
+ {
+ printf("cfg:digestname:");
+ print_algo_names(check_digest_algo,digest_algo_to_string);
+ printf("\n");
+ any=1;
+ }
+
if(show_all || ascii_strcasecmp(name,"compress")==0)
{
printf("cfg:compress:");
_______________________________________________
Gnupg-commits mailing list
Gnupg-commits@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic