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
access to pointer type.
gpgme_decrypt_result_t
gpgme_op_decrypt_result (gpgme_ctx_t ctx)
{
+ void *hook;
op_data_t opd;
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)
return NULL;
{
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err;
+ void *hook;
op_data_t opd;
err = _gpgme_passphrase_status_handler (priv, code, args);
if (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)
return err;
gpgme_error_t
_gpgme_op_decrypt_init_result (gpgme_ctx_t ctx)
{
+ void *hook;
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);
}
edit_status_handler (void *priv, gpgme_status_code_t status, char *args)
{
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
+ gpgme_error_t err;
+ void *hook;
op_data_t opd;
- return _gpgme_passphrase_status_handler (priv, status, args)
- || _gpgme_progress_status_handler (priv, status, args)
- || _gpgme_op_data_lookup (ctx, OPDATA_EDIT, (void **) &opd, -1, NULL)
- || (*opd->fnc) (opd->fnc_value, status, args, -1);
+ err = _gpgme_passphrase_status_handler (priv, status, args);
+ if (err)
+ return err;
+
+ 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);
}
{
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err;
- op_data_t opd;
int processed = 0;
if (ctx->passphrase_cb)
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)
return err;
gpgme_edit_cb_t fnc, void *fnc_value, gpgme_data_t out)
{
gpgme_error_t err;
+ void *hook;
op_data_t opd;
err = _gpgme_op_reset (ctx, synchronous);
if (!fnc || !out)
return GPGME_Invalid_Value;
- err = _gpgme_op_data_lookup (ctx, OPDATA_EDIT, (void **) &opd,
- sizeof (*opd), NULL);
+ err = _gpgme_op_data_lookup (ctx, OPDATA_EDIT, &hook, sizeof (*opd), NULL);
+ opd = hook;
if (err)
return err;
gpgme_encrypt_result_t
gpgme_op_encrypt_result (gpgme_ctx_t ctx)
{
+ void *hook;
op_data_t opd;
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)
return NULL;
{
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err;
+ void *hook;
op_data_t opd;
- 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)
return err;
_gpgme_op_encrypt_init_result (gpgme_ctx_t ctx)
{
gpgme_error_t err;
+ void *hook;
op_data_t opd;
- err = _gpgme_op_data_lookup (ctx, OPDATA_ENCRYPT, (void **) &opd,
- sizeof (*opd), release_op_data);
+ err = _gpgme_op_data_lookup (ctx, OPDATA_ENCRYPT, &hook, sizeof (*opd),
+ release_op_data);
+ opd = hook;
if (err)
return err;
+
opd->lastp = &opd->result.invalid_recipients;
return 0;
}
gpgme_genkey_result_t
gpgme_op_genkey_result (gpgme_ctx_t ctx)
{
+ void *hook;
op_data_t opd;
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)
return NULL;
{
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err;
+ void *hook;
op_data_t opd;
/* Pipe the status code through the progress status handler. */
if (err)
return 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)
return err;
gpgme_data_t pubkey, gpgme_data_t seckey)
{
gpgme_error_t err;
+ void *hook;
op_data_t opd;
err = _gpgme_op_reset (ctx, synchronous);
if (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);
+ opd = hook;
if (err)
return err;
gpgme_import_result_t
gpgme_op_import_result (gpgme_ctx_t ctx)
{
+ void *hook;
op_data_t opd;
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)
return NULL;
{
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err;
+ void *hook;
op_data_t opd;
- 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)
return err;
_gpgme_op_import_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t keydata)
{
gpgme_error_t err;
+ void *hook;
op_data_t opd;
err = _gpgme_op_reset (ctx, synchronous);
if (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);
+ opd = hook;
if (err)
return err;
opd->lastp = &opd->result.imports;
gpgme_keylist_result_t
gpgme_op_keylist_result (gpgme_ctx_t ctx)
{
+ void *hook;
op_data_t opd;
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)
return NULL;
{
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err;
+ void *hook;
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)
return err;
#define NR_FIELDS 13
char *field[NR_FIELDS];
int fields = 0;
+ void *hook;
op_data_t opd;
gpgme_error_t err;
gpgme_key_t key;
DEBUG3 ("keylist_colon_handler ctx = %p, key = %p, line = %s\n",
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)
return err;
gpgme_error_t err;
gpgme_ctx_t ctx = (gpgme_ctx_t) data;
gpgme_key_t key = (gpgme_key_t) type_data;
+ void *hook;
op_data_t opd;
struct key_queue_item_s *q, *q2;
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)
return;
gpgme_op_keylist_start (gpgme_ctx_t ctx, const char *pattern, int secret_only)
{
gpgme_error_t err;
+ void *hook;
op_data_t opd;
err = _gpgme_op_reset (ctx, 2);
if (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);
+ opd = hook;
if (err)
return err;
int secret_only, int reserved)
{
gpgme_error_t err;
+ void *hook;
op_data_t opd;
err = _gpgme_op_reset (ctx, 2);
if (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);
+ opd = hook;
if (err)
return err;
{
gpgme_error_t err;
struct key_queue_item_s *queue_item;
+ void *hook;
op_data_t opd;
if (!ctx || !r_key)
if (!ctx)
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)
return err;
{
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err;
+ void *hook;
op_data_t opd;
if (!ctx->passphrase_cb)
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);
+ opd = hook;
if (err)
return err;
{
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err;
+ void *hook;
op_data_t opd;
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);
+ opd = hook;
if (err)
return err;
gpgme_sign_result_t
gpgme_op_sign_result (gpgme_ctx_t ctx)
{
+ void *hook;
op_data_t opd;
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)
return NULL;
{
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err;
+ void *hook;
op_data_t opd;
err = _gpgme_passphrase_status_handler (priv, code, args);
if (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)
return err;
_gpgme_op_sign_init_result (gpgme_ctx_t ctx)
{
gpgme_error_t err;
+ void *hook;
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);
+ opd = hook;
if (err)
return err;
opd->last_signer_p = &opd->result.invalid_signers;
{
gpgme_ctx_t ctx = (gpgme_ctx_t) data;
gpgme_error_t err;
+ void *hook;
op_data_t opd;
gpgme_trust_item_t item = (gpgme_trust_item_t) type_data;
struct trust_queue_item_s *q, *q2;
assert (type == GPGME_EVENT_NEXT_TRUSTITEM);
- err = _gpgme_op_data_lookup (ctx, OPDATA_TRUSTLIST, (void **) &opd,
- -1, NULL);
+ err = _gpgme_op_data_lookup (ctx, OPDATA_TRUSTLIST, &hook, -1, NULL);
+ opd = hook;
if (err)
return;
gpgme_op_trustlist_start (gpgme_ctx_t ctx, const char *pattern, int max_level)
{
gpgme_error_t err = 0;
+ void *hook;
op_data_t opd;
if (!pattern || !*pattern)
if (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);
+ opd = hook;
if (err)
return err;
gpgme_op_trustlist_next (gpgme_ctx_t ctx, gpgme_trust_item_t *r_item)
{
gpgme_error_t err;
+ void *hook;
op_data_t opd;
struct trust_queue_item_s *q;
if (!ctx)
return GPGME_Invalid_Value;
- err = _gpgme_op_data_lookup (ctx, OPDATA_TRUSTLIST, (void **) &opd,
- -1, NULL);
+ err = _gpgme_op_data_lookup (ctx, OPDATA_TRUSTLIST, &hook, -1, NULL);
+ opd = hook;
if (err)
return err;
gpgme_verify_result_t
gpgme_op_verify_result (gpgme_ctx_t ctx)
{
+ void *hook;
op_data_t opd;
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)
return NULL;
{
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err;
+ void *hook;
op_data_t opd;
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)
return err;
gpgme_error_t
_gpgme_op_verify_init_result (gpgme_ctx_t ctx)
{
+ void *hook;
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);
}