summaryrefslogtreecommitdiffstats
path: root/info.c
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2012-06-10 07:06:04 +0200
committerRemi Collet <fedora@famillecollet.com>2012-06-10 07:06:04 +0200
commitc19c096a1381da06d33b66ec326e4de2f45ffcf2 (patch)
treeed4e37083b4a12f2ce63be44ae6be42301e65bf1 /info.c
repo reorg
Diffstat (limited to 'info.c')
-rw-r--r--info.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/info.c b/info.c
new file mode 100644
index 0000000..edcc53a
--- /dev/null
+++ b/info.c
@@ -0,0 +1,36 @@
+#include <stdio.h>
+#include <gpgme.h>
+
+int main (int argc, char *argv[]) {
+
+ gpgme_ctx_t ctx;
+ gpgme_error_t err;
+ const char *ver;
+ gpgme_engine_info_t info;
+
+ ver = gpgme_check_version(NULL);
+ printf("gpgme version: %s\n", ver);
+
+ err = gpgme_new(&ctx);
+ if (err != GPG_ERR_NO_ERROR) {
+ printf("** gpgme_new return %d\n", err);
+ }
+
+ info = gpgme_ctx_get_engine_info(ctx);
+ while(info) {
+ printf("protocol:%d, file_name:%s\n", info->protocol, info->file_name);
+ info = info->next;
+ }
+
+ err = gpgme_ctx_set_engine_info(ctx, GPGME_PROTOCOL_OpenPGP, "/usr/bin/gpg", NULL);
+ if (err != GPG_ERR_NO_ERROR) {
+ printf("** gpgme_ctx_set_engine_info return %d\n", err);
+ }
+
+ info = gpgme_ctx_get_engine_info(ctx);
+ while(info) {
+ printf("protocol:%d, file_name:%s\n", info->protocol, info->file_name);
+ info = info->next;
+ }
+ return 0;
+}