From 259b61f73cb40fd3cb7da21cba4b1a69bfa2da78 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Wed, 15 Jul 2015 21:41:15 -0400 Subject: Add per-ctx custom engine options. * src/gpgme.h.in (gpgme_ctx_set_engine_options): New prototype. (gpgme_ctx_get_engine_options): Ditto. * src/engine-backend.h (engine_ops): Add set_options and get_options. * src/engine.c (gpgme_ctx_set_engine_options): New. (gpgme_ctx_get_engine_options): Ditto. * src/engine-gpg.c (gpg_set_options): New. (gpg_get_options): Ditto. * src/op-support.c (_gpgme_op_reset): Keep custom options. * src/engine-gpg.c (_gpgme_engine_ops_gpg): Adjust for new members. * src/engine-assuan.c (_gpgme_engine_ops_assuan): Ditto. * src/engine-g13.c (_gpgme_engine_ops_g13): Ditto. * src/engine-gpgconf.c (_gpgme_engine_ops_gpgconf): Ditto. * src/engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Ditto. * src/engine-spawn.c (_gpgme_engine_ops_spawn): Ditto. * src/engine-uiserver.c (_gpgme_engine_ops_uiserver): Ditto. * src/gpgme.def: Export new symbols. * src/libgpgme.vers: Ditto. * doc/gpgme.texi: Document these new functions. -- Not all of gpg2's features are exposed to libgpgme and adding these functions makes it possible to do things like specify an --s2k-count, etc. --- src/gpgme.h.in | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/gpgme.h.in') diff --git a/src/gpgme.h.in b/src/gpgme.h.in index 15ed8037..ffa58c57 100644 --- a/src/gpgme.h.in +++ b/src/gpgme.h.in @@ -947,6 +947,15 @@ gpgme_error_t gpgme_ctx_set_engine_info (gpgme_ctx_t ctx, const char *file_name, const char *home_dir); +/* Set custom command line options for the engine associated with a + context. */ +gpgme_error_t gpgme_ctx_set_engine_options (gpgme_ctx_t ctx, + const char *options); + +/* Return previously set custom engine command line options. */ +gpgme_error_t gpgme_ctx_get_engine_options (gpgme_ctx_t ctx, + const char **result); + /* Return a statically allocated string with the name of the public key algorithm ALGO, or NULL if that name is not known. */ -- cgit v1.2.3