2003-05-27 Marcus Brinkmann <marcus@g10code.de>

* encrypt.c (gpgme_op_encrypt_result): Use intermediate variable
	HOOK to avoid compiler warning.  Don't ask, you don't want to know.
	(_gpgme_encrypt_status_handler): Likewise.
	(_gpgme_op_encrypt_init_result): Likewise.
	* decrypt.c (gpgme_op_decrypt_result): Likewise.
	(_gpgme_decrypt_status_handler): Likewise.
	(_gpgme_op_decrypt_init_result): Likewise.
	* verify.c (gpgme_op_verify_result): Likewise.
	(_gpgme_verify_status_handler): Likewise.
	(_gpgme_op_verify_init_result): Likewise.
	* edit.c (edit_status_handler): Likewise.
	(command_handler): Likewise.
	(edit_start): Likewise.
	* genkey.c (gpgme_op_genkey_result): Likewise.
	(genkey_status_handler): Likewise.
	(genkey_start): Likewise.
	* import.c (gpgme_op_import_result): Likewise.
	(import_status_handler): Likewise.
	(_gpgme_op_import_start): Likewise.
	* trustlist.c (gpgme_op_trustlist_next): Likewise.
	(_gpgme_op_trustlist_event_cb): Likewise.
	(gpgme_op_trustlist_start): Likewise.
	* keylist.c (gpgme_op_keylist_result): Likewise.
	(keylist_colon_handler): Likewise.
	(keylist_status_handler): Likewise.
	(_gpgme_op_keylist_event_cb): Likewise.
	(gpgme_op_keylist_start): Likewise.
	(gpgme_op_keylist_ext_start): Likewise.
	(gpgme_op_keylist_next): Likewise.
	* passphrase.c (_gpgme_passphrase_status_handler): Likewise.
	(_gpgme_passphrase_command_handler_internal): Likewise.
	* sign.c (gpgme_op_sign_result): Likewise.
	(_gpgme_sign_status_handler): Likewise.
	(_gpgme_op_sign_init_result): Likewise.
This commit is contained in:
Marcus Brinkmann 2003-05-27 02:54:36 +00:00
parent d0c0963b90
commit 3d476c73de
11 changed files with 150 additions and 44 deletions

View File

@ -1,5 +1,40 @@
2003-05-27 Marcus Brinkmann <marcus@g10code.de> 2003-05-27 Marcus Brinkmann <marcus@g10code.de>
* encrypt.c (gpgme_op_encrypt_result): Use intermediate variable
HOOK to avoid compiler warning. Don't ask, you don't want to know.
(_gpgme_encrypt_status_handler): Likewise.
(_gpgme_op_encrypt_init_result): Likewise.
* decrypt.c (gpgme_op_decrypt_result): Likewise.
(_gpgme_decrypt_status_handler): Likewise.
(_gpgme_op_decrypt_init_result): Likewise.
* verify.c (gpgme_op_verify_result): Likewise.
(_gpgme_verify_status_handler): Likewise.
(_gpgme_op_verify_init_result): Likewise.
* edit.c (edit_status_handler): Likewise.
(command_handler): Likewise.
(edit_start): Likewise.
* genkey.c (gpgme_op_genkey_result): Likewise.
(genkey_status_handler): Likewise.
(genkey_start): Likewise.
* import.c (gpgme_op_import_result): Likewise.
(import_status_handler): Likewise.
(_gpgme_op_import_start): Likewise.
* trustlist.c (gpgme_op_trustlist_next): Likewise.
(_gpgme_op_trustlist_event_cb): Likewise.
(gpgme_op_trustlist_start): Likewise.
* keylist.c (gpgme_op_keylist_result): Likewise.
(keylist_colon_handler): Likewise.
(keylist_status_handler): Likewise.
(_gpgme_op_keylist_event_cb): Likewise.
(gpgme_op_keylist_start): Likewise.
(gpgme_op_keylist_ext_start): Likewise.
(gpgme_op_keylist_next): Likewise.
* passphrase.c (_gpgme_passphrase_status_handler): Likewise.
(_gpgme_passphrase_command_handler_internal): Likewise.
* sign.c (gpgme_op_sign_result): Likewise.
(_gpgme_sign_status_handler): Likewise.
(_gpgme_op_sign_init_result): Likewise.
* passphrase.c (_gpgme_passphrase_command_handler_internal): Fix * passphrase.c (_gpgme_passphrase_command_handler_internal): Fix
access to pointer type. access to pointer type.

View File

@ -52,10 +52,12 @@ release_op_data (void *hook)
gpgme_decrypt_result_t gpgme_decrypt_result_t
gpgme_op_decrypt_result (gpgme_ctx_t ctx) gpgme_op_decrypt_result (gpgme_ctx_t ctx)
{ {
void *hook;
op_data_t opd; op_data_t opd;
gpgme_error_t err; gpgme_error_t err;
err = _gpgme_op_data_lookup (ctx, OPDATA_DECRYPT, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_DECRYPT, &hook, -1, NULL);
opd = hook;
if (err || !opd) if (err || !opd)
return NULL; return NULL;
@ -69,13 +71,15 @@ _gpgme_decrypt_status_handler (void *priv, gpgme_status_code_t code,
{ {
gpgme_ctx_t ctx = (gpgme_ctx_t) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
err = _gpgme_passphrase_status_handler (priv, code, args); err = _gpgme_passphrase_status_handler (priv, code, args);
if (err) if (err)
return err; return err;
err = _gpgme_op_data_lookup (ctx, OPDATA_DECRYPT, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_DECRYPT, &hook, -1, NULL);
opd = hook;
if (err) if (err)
return err; return err;
@ -148,9 +152,10 @@ decrypt_status_handler (void *priv, gpgme_status_code_t code, char *args)
gpgme_error_t gpgme_error_t
_gpgme_op_decrypt_init_result (gpgme_ctx_t ctx) _gpgme_op_decrypt_init_result (gpgme_ctx_t ctx)
{ {
void *hook;
op_data_t opd; op_data_t opd;
return _gpgme_op_data_lookup (ctx, OPDATA_DECRYPT, (void **) &opd, return _gpgme_op_data_lookup (ctx, OPDATA_DECRYPT, &hook,
sizeof (*opd), release_op_data); sizeof (*opd), release_op_data);
} }

View File

@ -39,12 +39,24 @@ static gpgme_error_t
edit_status_handler (void *priv, gpgme_status_code_t status, char *args) edit_status_handler (void *priv, gpgme_status_code_t status, char *args)
{ {
gpgme_ctx_t ctx = (gpgme_ctx_t) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
return _gpgme_passphrase_status_handler (priv, status, args) err = _gpgme_passphrase_status_handler (priv, status, args);
|| _gpgme_progress_status_handler (priv, status, args) if (err)
|| _gpgme_op_data_lookup (ctx, OPDATA_EDIT, (void **) &opd, -1, NULL) return err;
|| (*opd->fnc) (opd->fnc_value, status, args, -1);
err = _gpgme_progress_status_handler (priv, status, args);
if (err)
return err;
err = _gpgme_op_data_lookup (ctx, OPDATA_EDIT, &hook, -1, NULL);
opd = hook;
if (err)
return err;
return (*opd->fnc) (opd->fnc_value, status, args, -1);
} }
@ -54,7 +66,6 @@ command_handler (void *priv, gpgme_status_code_t status, const char *args,
{ {
gpgme_ctx_t ctx = (gpgme_ctx_t) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err; gpgme_error_t err;
op_data_t opd;
int processed = 0; int processed = 0;
if (ctx->passphrase_cb) if (ctx->passphrase_cb)
@ -67,7 +78,11 @@ command_handler (void *priv, gpgme_status_code_t status, const char *args,
if (!processed) if (!processed)
{ {
err = _gpgme_op_data_lookup (ctx, OPDATA_EDIT, (void **) &opd, -1, NULL); void *hook;
op_data_t opd;
err = _gpgme_op_data_lookup (ctx, OPDATA_EDIT, &hook, -1, NULL);
opd = hook;
if (err) if (err)
return err; return err;
@ -82,6 +97,7 @@ edit_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t key,
gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out) gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
{ {
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
err = _gpgme_op_reset (ctx, synchronous); err = _gpgme_op_reset (ctx, synchronous);
@ -91,8 +107,8 @@ edit_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t key,
if (!fnc || !out) if (!fnc || !out)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
err = _gpgme_op_data_lookup (ctx, OPDATA_EDIT, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_EDIT, &hook, sizeof (*opd), NULL);
sizeof (*opd), NULL); opd = hook;
if (err) if (err)
return err; return err;

View File

@ -59,10 +59,13 @@ release_op_data (void *hook)
gpgme_encrypt_result_t gpgme_encrypt_result_t
gpgme_op_encrypt_result (gpgme_ctx_t ctx) gpgme_op_encrypt_result (gpgme_ctx_t ctx)
{ {
void *hook;
op_data_t opd; op_data_t opd;
gpgme_error_t err; gpgme_error_t err;
err = _gpgme_op_data_lookup (ctx, OPDATA_ENCRYPT, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_ENCRYPT, &hook, -1, NULL);
opd = hook;
if (err || !opd) if (err || !opd)
return NULL; return NULL;
@ -76,10 +79,11 @@ _gpgme_encrypt_status_handler (void *priv, gpgme_status_code_t code,
{ {
gpgme_ctx_t ctx = (gpgme_ctx_t) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
err = _gpgme_op_data_lookup (ctx, OPDATA_ENCRYPT, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_ENCRYPT, &hook, -1, NULL);
-1, NULL); opd = hook;
if (err) if (err)
return err; return err;
@ -129,12 +133,15 @@ gpgme_error_t
_gpgme_op_encrypt_init_result (gpgme_ctx_t ctx) _gpgme_op_encrypt_init_result (gpgme_ctx_t ctx)
{ {
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
err = _gpgme_op_data_lookup (ctx, OPDATA_ENCRYPT, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_ENCRYPT, &hook, sizeof (*opd),
sizeof (*opd), release_op_data); release_op_data);
opd = hook;
if (err) if (err)
return err; return err;
opd->lastp = &opd->result.invalid_recipients; opd->lastp = &opd->result.invalid_recipients;
return 0; return 0;
} }

View File

@ -53,10 +53,12 @@ release_op_data (void *hook)
gpgme_genkey_result_t gpgme_genkey_result_t
gpgme_op_genkey_result (gpgme_ctx_t ctx) gpgme_op_genkey_result (gpgme_ctx_t ctx)
{ {
void *hook;
op_data_t opd; op_data_t opd;
gpgme_error_t err; gpgme_error_t err;
err = _gpgme_op_data_lookup (ctx, OPDATA_GENKEY, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_GENKEY, &hook, -1, NULL);
opd = hook;
if (err || !opd) if (err || !opd)
return NULL; return NULL;
@ -69,6 +71,7 @@ genkey_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
gpgme_ctx_t ctx = (gpgme_ctx_t) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
/* Pipe the status code through the progress status handler. */ /* Pipe the status code through the progress status handler. */
@ -76,8 +79,8 @@ genkey_status_handler (void *priv, gpgme_status_code_t code, char *args)
if (err) if (err)
return err; return err;
err = _gpgme_op_data_lookup (ctx, OPDATA_GENKEY, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_GENKEY, &hook, -1, NULL);
-1, NULL); opd = hook;
if (err) if (err)
return err; return err;
@ -150,13 +153,15 @@ genkey_start (gpgme_ctx_t ctx, int synchronous, const char *parms,
gpgme_data_t pubkey, gpgme_data_t seckey) gpgme_data_t pubkey, gpgme_data_t seckey)
{ {
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
err = _gpgme_op_reset (ctx, synchronous); err = _gpgme_op_reset (ctx, synchronous);
if (err) if (err)
return err; return err;
err = _gpgme_op_data_lookup (ctx, OPDATA_GENKEY, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_GENKEY, &hook,
sizeof (*opd), release_op_data); sizeof (*opd), release_op_data);
opd = hook;
if (err) if (err)
return err; return err;

View File

@ -60,10 +60,12 @@ release_op_data (void *hook)
gpgme_import_result_t gpgme_import_result_t
gpgme_op_import_result (gpgme_ctx_t ctx) gpgme_op_import_result (gpgme_ctx_t ctx)
{ {
void *hook;
op_data_t opd; op_data_t opd;
gpgme_error_t err; gpgme_error_t err;
err = _gpgme_op_data_lookup (ctx, OPDATA_IMPORT, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_IMPORT, &hook, -1, NULL);
opd = hook;
if (err || !opd) if (err || !opd)
return NULL; return NULL;
@ -179,10 +181,11 @@ import_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
gpgme_ctx_t ctx = (gpgme_ctx_t) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
err = _gpgme_op_data_lookup (ctx, OPDATA_IMPORT, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_IMPORT, &hook, -1, NULL);
-1, NULL); opd = hook;
if (err) if (err)
return err; return err;
@ -213,14 +216,16 @@ static gpgme_error_t
_gpgme_op_import_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t keydata) _gpgme_op_import_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t keydata)
{ {
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
err = _gpgme_op_reset (ctx, synchronous); err = _gpgme_op_reset (ctx, synchronous);
if (err) if (err)
return err; return err;
err = _gpgme_op_data_lookup (ctx, OPDATA_IMPORT, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_IMPORT, &hook,
sizeof (*opd), release_op_data); sizeof (*opd), release_op_data);
opd = hook;
if (err) if (err)
return err; return err;
opd->lastp = &opd->result.imports; opd->lastp = &opd->result.imports;

View File

@ -76,10 +76,12 @@ release_op_data (void *hook)
gpgme_keylist_result_t gpgme_keylist_result_t
gpgme_op_keylist_result (gpgme_ctx_t ctx) gpgme_op_keylist_result (gpgme_ctx_t ctx)
{ {
void *hook;
op_data_t opd; op_data_t opd;
gpgme_error_t err; gpgme_error_t err;
err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, &hook, -1, NULL);
opd = hook;
if (err || !opd) if (err || !opd)
return NULL; return NULL;
@ -92,9 +94,11 @@ keylist_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
gpgme_ctx_t ctx = (gpgme_ctx_t) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, &hook, -1, NULL);
opd = hook;
if (err) if (err)
return err; return err;
@ -352,6 +356,7 @@ keylist_colon_handler (void *priv, char *line)
#define NR_FIELDS 13 #define NR_FIELDS 13
char *field[NR_FIELDS]; char *field[NR_FIELDS];
int fields = 0; int fields = 0;
void *hook;
op_data_t opd; op_data_t opd;
gpgme_error_t err; gpgme_error_t err;
gpgme_key_t key; gpgme_key_t key;
@ -361,7 +366,8 @@ keylist_colon_handler (void *priv, char *line)
DEBUG3 ("keylist_colon_handler ctx = %p, key = %p, line = %s\n", DEBUG3 ("keylist_colon_handler ctx = %p, key = %p, line = %s\n",
ctx, key, line ? line : "(null)"); ctx, key, line ? line : "(null)");
err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, &hook, -1, NULL);
opd = hook;
if (err) if (err)
return err; return err;
@ -666,12 +672,14 @@ _gpgme_op_keylist_event_cb (void *data, gpgme_event_io_t type, void *type_data)
gpgme_error_t err; gpgme_error_t err;
gpgme_ctx_t ctx = (gpgme_ctx_t) data; gpgme_ctx_t ctx = (gpgme_ctx_t) data;
gpgme_key_t key = (gpgme_key_t) type_data; gpgme_key_t key = (gpgme_key_t) type_data;
void *hook;
op_data_t opd; op_data_t opd;
struct key_queue_item_s *q, *q2; struct key_queue_item_s *q, *q2;
assert (type == GPGME_EVENT_NEXT_KEY); assert (type == GPGME_EVENT_NEXT_KEY);
err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, &hook, -1, NULL);
opd = hook;
if (err) if (err)
return; return;
@ -704,14 +712,16 @@ gpgme_error_t
gpgme_op_keylist_start (gpgme_ctx_t ctx, const char *pattern, int secret_only) gpgme_op_keylist_start (gpgme_ctx_t ctx, const char *pattern, int secret_only)
{ {
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
err = _gpgme_op_reset (ctx, 2); err = _gpgme_op_reset (ctx, 2);
if (err) if (err)
return err; return err;
err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, &hook,
sizeof (*opd), release_op_data); sizeof (*opd), release_op_data);
opd = hook;
if (err) if (err)
return err; return err;
@ -735,14 +745,16 @@ gpgme_op_keylist_ext_start (gpgme_ctx_t ctx, const char *pattern[],
int secret_only, int reserved) int secret_only, int reserved)
{ {
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
err = _gpgme_op_reset (ctx, 2); err = _gpgme_op_reset (ctx, 2);
if (err) if (err)
return err; return err;
err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, &hook,
sizeof (*opd), release_op_data); sizeof (*opd), release_op_data);
opd = hook;
if (err) if (err)
return err; return err;
@ -763,6 +775,7 @@ gpgme_op_keylist_next (gpgme_ctx_t ctx, gpgme_key_t *r_key)
{ {
gpgme_error_t err; gpgme_error_t err;
struct key_queue_item_s *queue_item; struct key_queue_item_s *queue_item;
void *hook;
op_data_t opd; op_data_t opd;
if (!ctx || !r_key) if (!ctx || !r_key)
@ -771,7 +784,8 @@ gpgme_op_keylist_next (gpgme_ctx_t ctx, gpgme_key_t *r_key)
if (!ctx) if (!ctx)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_KEYLIST, &hook, -1, NULL);
opd = hook;
if (err) if (err)
return err; return err;

View File

@ -58,13 +58,15 @@ _gpgme_passphrase_status_handler (void *priv, gpgme_status_code_t code,
{ {
gpgme_ctx_t ctx = (gpgme_ctx_t) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
if (!ctx->passphrase_cb) if (!ctx->passphrase_cb)
return 0; return 0;
err = _gpgme_op_data_lookup (ctx, OPDATA_PASSPHRASE, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_PASSPHRASE, &hook,
sizeof (*opd), release_op_data); sizeof (*opd), release_op_data);
opd = hook;
if (err) if (err)
return err; return err;
@ -121,12 +123,14 @@ _gpgme_passphrase_command_handler_internal (void *priv,
{ {
gpgme_ctx_t ctx = (gpgme_ctx_t) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
assert (ctx->passphrase_cb); assert (ctx->passphrase_cb);
err = _gpgme_op_data_lookup (ctx, OPDATA_PASSPHRASE, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_PASSPHRASE, &hook,
sizeof (*opd), release_op_data); sizeof (*opd), release_op_data);
opd = hook;
if (err) if (err)
return err; return err;

View File

@ -72,10 +72,12 @@ release_op_data (void *hook)
gpgme_sign_result_t gpgme_sign_result_t
gpgme_op_sign_result (gpgme_ctx_t ctx) gpgme_op_sign_result (gpgme_ctx_t ctx)
{ {
void *hook;
op_data_t opd; op_data_t opd;
gpgme_error_t err; gpgme_error_t err;
err = _gpgme_op_data_lookup (ctx, OPDATA_SIGN, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_SIGN, &hook, -1, NULL);
opd = hook;
if (err || !opd) if (err || !opd)
return NULL; return NULL;
@ -187,13 +189,15 @@ _gpgme_sign_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
gpgme_ctx_t ctx = (gpgme_ctx_t) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
err = _gpgme_passphrase_status_handler (priv, code, args); err = _gpgme_passphrase_status_handler (priv, code, args);
if (err) if (err)
return err; return err;
err = _gpgme_op_data_lookup (ctx, OPDATA_SIGN, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_SIGN, &hook, -1, NULL);
opd = hook;
if (err) if (err)
return err; return err;
@ -239,10 +243,12 @@ gpgme_error_t
_gpgme_op_sign_init_result (gpgme_ctx_t ctx) _gpgme_op_sign_init_result (gpgme_ctx_t ctx)
{ {
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
err = _gpgme_op_data_lookup (ctx, OPDATA_SIGN, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_SIGN, &hook,
sizeof (*opd), release_op_data); sizeof (*opd), release_op_data);
opd = hook;
if (err) if (err)
return err; return err;
opd->last_signer_p = &opd->result.invalid_signers; opd->last_signer_p = &opd->result.invalid_signers;

View File

@ -126,14 +126,15 @@ _gpgme_op_trustlist_event_cb (void *data, gpgme_event_io_t type,
{ {
gpgme_ctx_t ctx = (gpgme_ctx_t) data; gpgme_ctx_t ctx = (gpgme_ctx_t) data;
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
gpgme_trust_item_t item = (gpgme_trust_item_t) type_data; gpgme_trust_item_t item = (gpgme_trust_item_t) type_data;
struct trust_queue_item_s *q, *q2; struct trust_queue_item_s *q, *q2;
assert (type == GPGME_EVENT_NEXT_TRUSTITEM); assert (type == GPGME_EVENT_NEXT_TRUSTITEM);
err = _gpgme_op_data_lookup (ctx, OPDATA_TRUSTLIST, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_TRUSTLIST, &hook, -1, NULL);
-1, NULL); opd = hook;
if (err) if (err)
return; return;
@ -165,6 +166,7 @@ gpgme_error_t
gpgme_op_trustlist_start (gpgme_ctx_t ctx, const char *pattern, int max_level) gpgme_op_trustlist_start (gpgme_ctx_t ctx, const char *pattern, int max_level)
{ {
gpgme_error_t err = 0; gpgme_error_t err = 0;
void *hook;
op_data_t opd; op_data_t opd;
if (!pattern || !*pattern) if (!pattern || !*pattern)
@ -174,8 +176,9 @@ gpgme_op_trustlist_start (gpgme_ctx_t ctx, const char *pattern, int max_level)
if (err) if (err)
return err; return err;
err = _gpgme_op_data_lookup (ctx, OPDATA_TRUSTLIST, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_TRUSTLIST, &hook,
sizeof (*opd), NULL); sizeof (*opd), NULL);
opd = hook;
if (err) if (err)
return err; return err;
@ -194,6 +197,7 @@ gpgme_error_t
gpgme_op_trustlist_next (gpgme_ctx_t ctx, gpgme_trust_item_t *r_item) gpgme_op_trustlist_next (gpgme_ctx_t ctx, gpgme_trust_item_t *r_item)
{ {
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
struct trust_queue_item_s *q; struct trust_queue_item_s *q;
@ -203,8 +207,8 @@ gpgme_op_trustlist_next (gpgme_ctx_t ctx, gpgme_trust_item_t *r_item)
if (!ctx) if (!ctx)
return GPGME_Invalid_Value; return GPGME_Invalid_Value;
err = _gpgme_op_data_lookup (ctx, OPDATA_TRUSTLIST, (void **) &opd, err = _gpgme_op_data_lookup (ctx, OPDATA_TRUSTLIST, &hook, -1, NULL);
-1, NULL); opd = hook;
if (err) if (err)
return err; return err;

View File

@ -72,10 +72,12 @@ release_op_data (void *hook)
gpgme_verify_result_t gpgme_verify_result_t
gpgme_op_verify_result (gpgme_ctx_t ctx) gpgme_op_verify_result (gpgme_ctx_t ctx)
{ {
void *hook;
op_data_t opd; op_data_t opd;
gpgme_error_t err; gpgme_error_t err;
err = _gpgme_op_data_lookup (ctx, OPDATA_VERIFY, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_VERIFY, &hook, -1, NULL);
opd = hook;
if (err || !opd) if (err || !opd)
return NULL; return NULL;
@ -448,10 +450,12 @@ _gpgme_verify_status_handler (void *priv, gpgme_status_code_t code, char *args)
{ {
gpgme_ctx_t ctx = (gpgme_ctx_t) priv; gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err; gpgme_error_t err;
void *hook;
op_data_t opd; op_data_t opd;
gpgme_signature_t sig; gpgme_signature_t sig;
err = _gpgme_op_data_lookup (ctx, OPDATA_VERIFY, (void **) &opd, -1, NULL); err = _gpgme_op_data_lookup (ctx, OPDATA_VERIFY, &hook, -1, NULL);
opd = hook;
if (err) if (err)
return err; return err;
@ -521,9 +525,10 @@ verify_status_handler (void *priv, gpgme_status_code_t code, char *args)
gpgme_error_t gpgme_error_t
_gpgme_op_verify_init_result (gpgme_ctx_t ctx) _gpgme_op_verify_init_result (gpgme_ctx_t ctx)
{ {
void *hook;
op_data_t opd; op_data_t opd;
return _gpgme_op_data_lookup (ctx, OPDATA_VERIFY, (void **) &opd, return _gpgme_op_data_lookup (ctx, OPDATA_VERIFY, &hook,
sizeof (*opd), release_op_data); sizeof (*opd), release_op_data);
} }