/* Set the current position from where the next read or write starts
in the data object with the handle DH to OFFSET, relativ to
WHENCE. */
-typedef off_t (*gpgme_data_seek_cb) (gpgme_data_t dh, off_t offset, int whence);
+typedef off_t (*gpgme_data_seek_cb) (gpgme_data_t dh, off_t offset,
+ int whence);
/* Release the data object with the handle DH. */
typedef void (*gpgme_data_release_cb) (gpgme_data_t dh);
};
\f
-gpgme_error_t _gpgme_data_new (gpgme_data_t *r_dh, struct _gpgme_data_cbs *cbs);
+gpgme_error_t _gpgme_data_new (gpgme_data_t *r_dh,
+ struct _gpgme_data_cbs *cbs);
void _gpgme_data_release (gpgme_data_t dh);
\f
static gpgme_error_t
-decrypt_verify_status_handler (void *priv, gpgme_status_code_t code, char *args)
+decrypt_verify_status_handler (void *priv, gpgme_status_code_t code,
+ char *args)
{
return _gpgme_decrypt_status_handler (priv, code, args)
|| _gpgme_verify_status_handler (priv, code, args);
if (ctx->passphrase_cb)
{
- err = _gpgme_engine_set_command_handler (ctx->engine,
- _gpgme_passphrase_command_handler,
- ctx, NULL);
+ err = _gpgme_engine_set_command_handler
+ (ctx->engine, _gpgme_passphrase_command_handler, ctx, NULL);
if (err)
return err;
}
/* Decrypt ciphertext CIPHER and make a signature verification within
CTX and store the resulting plaintext in PLAIN. */
gpgme_error_t
-gpgme_op_decrypt_verify_start (gpgme_ctx_t ctx, gpgme_data_t cipher, gpgme_data_t plain)
+gpgme_op_decrypt_verify_start (gpgme_ctx_t ctx, gpgme_data_t cipher,
+ gpgme_data_t plain)
{
return _gpgme_op_decrypt_verify_start (ctx, 0, cipher, plain);
}
/* Decrypt ciphertext CIPHER and make a signature verification within
CTX and store the resulting plaintext in PLAIN. */
gpgme_error_t
-gpgme_op_decrypt_verify (gpgme_ctx_t ctx, gpgme_data_t cipher, gpgme_data_t plain)
+gpgme_op_decrypt_verify (gpgme_ctx_t ctx, gpgme_data_t cipher,
+ gpgme_data_t plain)
{
gpgme_error_t err = _gpgme_op_decrypt_verify_start (ctx, 1, cipher, plain);
if (!err)
\f
gpgme_error_t
-_gpgme_decrypt_status_handler (void *priv, gpgme_status_code_t code, char *args)
+_gpgme_decrypt_status_handler (void *priv, gpgme_status_code_t code,
+ char *args)
{
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err;
if (ctx->passphrase_cb)
{
- err = _gpgme_engine_set_command_handler (ctx->engine,
- _gpgme_passphrase_command_handler,
- ctx, NULL);
+ err = _gpgme_engine_set_command_handler
+ (ctx->engine, _gpgme_passphrase_command_handler, ctx, NULL);
if (err)
return err;
}
gpgme_error_t
-gpgme_op_decrypt_start (gpgme_ctx_t ctx, gpgme_data_t cipher, gpgme_data_t plain)
+gpgme_op_decrypt_start (gpgme_ctx_t ctx, gpgme_data_t cipher,
+ gpgme_data_t plain)
{
return decrypt_start (ctx, 0, cipher, plain);
}
/* Delete KEY from the keyring. If ALLOW_SECRET is non-zero, secret
keys are also deleted. */
gpgme_error_t
-gpgme_op_delete_start (gpgme_ctx_t ctx, const gpgme_key_t key, int allow_secret)
+gpgme_op_delete_start (gpgme_ctx_t ctx, const gpgme_key_t key,
+ int allow_secret)
{
return delete_start (ctx, 0, key, allow_secret);
}
\f
gpgme_error_t
-_gpgme_encrypt_status_handler (void *priv, gpgme_status_code_t code, char *args)
+_gpgme_encrypt_status_handler (void *priv, gpgme_status_code_t code,
+ char *args)
{
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err;
if (symmetric && ctx->passphrase_cb)
{
/* Symmetric encryption requires a passphrase. */
- err = _gpgme_engine_set_command_handler (ctx->engine,
- _gpgme_passphrase_command_handler,
- ctx, NULL);
+ err = _gpgme_engine_set_command_handler
+ (ctx->engine, _gpgme_passphrase_command_handler, ctx, NULL);
if (err)
return err;
}
gpgme_error_t
-gpgme_op_encrypt_start (gpgme_ctx_t ctx, gpgme_recipients_t recp, gpgme_data_t plain,
- gpgme_data_t cipher)
+gpgme_op_encrypt_start (gpgme_ctx_t ctx, gpgme_recipients_t recp,
+ gpgme_data_t plain, gpgme_data_t cipher)
{
return encrypt_start (ctx, 0, recp, plain, cipher);
}
void (*set_status_handler) (void *engine, EngineStatusHandler fnc,
void *fnc_value);
gpgme_error_t (*set_command_handler) (void *engine, EngineCommandHandler fnc,
- void *fnc_value, gpgme_data_t data);
+ void *fnc_value, gpgme_data_t data);
gpgme_error_t (*set_colon_line_handler) (void *engine,
- EngineColonLineHandler fnc,
- void *fnc_value);
- gpgme_error_t (*decrypt) (void *engine, gpgme_data_t ciph, gpgme_data_t plain);
+ EngineColonLineHandler fnc,
+ void *fnc_value);
+ gpgme_error_t (*decrypt) (void *engine, gpgme_data_t ciph,
+ gpgme_data_t plain);
gpgme_error_t (*delete) (void *engine, gpgme_key_t key, int allow_secret);
gpgme_error_t (*edit) (void *engine, gpgme_key_t key, gpgme_data_t out,
gpgme_ctx_t ctx /* FIXME */);
gpgme_error_t (*encrypt) (void *engine, gpgme_recipients_t recp,
- gpgme_data_t plain, gpgme_data_t ciph, int use_armor);
+ gpgme_data_t plain, gpgme_data_t ciph,
+ int use_armor);
gpgme_error_t (*encrypt_sign) (void *engine, gpgme_recipients_t recp,
- gpgme_data_t plain, gpgme_data_t ciph,
- int use_armor, gpgme_ctx_t ctx /* FIXME */);
+ gpgme_data_t plain, gpgme_data_t ciph,
+ int use_armor, gpgme_ctx_t ctx /* FIXME */);
gpgme_error_t (*export) (void *engine, gpgme_recipients_t recp,
gpgme_data_t keydata, int use_armor);
gpgme_error_t (*genkey) (void *engine, gpgme_data_t help_data, int use_armor,
gpgme_error_t (*keylist) (void *engine, const char *pattern,
int secret_only, int keylist_mode);
gpgme_error_t (*keylist_ext) (void *engine, const char *pattern[],
- int secret_only, int reserved,
+ int secret_only, int reserved,
int keylist_mode);
gpgme_error_t (*sign) (void *engine, gpgme_data_t in, gpgme_data_t out,
- gpgme_sig_mode_t mode, int use_armor, int use_textmode,
+ gpgme_sig_mode_t mode, int use_armor,
+ int use_textmode,
int include_certs, gpgme_ctx_t ctx /* FIXME */);
gpgme_error_t (*trustlist) (void *engine, const char *pattern);
- gpgme_error_t (*verify) (void *engine, gpgme_data_t sig, gpgme_data_t signed_text,
+ gpgme_error_t (*verify) (void *engine, gpgme_data_t sig,
+ gpgme_data_t signed_text,
gpgme_data_t plaintext);
void (*set_io_cbs) (void *engine, gpgme_io_cbs_t io_cbs);
#endif
#endif /* ENGINE_BACKEND_H */
-
err = GPGME_Out_Of_Core;
goto leave;
}
- err = assuan_transact (gpgsm->assuan_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
- NULL);
+ err = assuan_transact (gpgsm->assuan_ctx, optstr, NULL, NULL, NULL,
+ NULL, NULL, NULL);
free (optstr);
if (err)
{
err = GPGME_Out_Of_Core;
goto leave;
}
- err = assuan_transact (gpgsm->assuan_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
- NULL);
+ err = assuan_transact (gpgsm->assuan_ctx, optstr, NULL, NULL, NULL,
+ NULL, NULL, NULL);
free (optstr);
if (err)
{
err = GPGME_Out_Of_Core;
else
{
- err = assuan_transact (gpgsm->assuan_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
- NULL);
+ err = assuan_transact (gpgsm->assuan_ctx, optstr, NULL, NULL,
+ NULL, NULL, NULL, NULL);
free (optstr);
if (err)
err = map_assuan_error (err);
static gpgme_status_code_t parse_status (const char *name);
static gpgme_error_t
-gpgsm_assuan_simple_command (ASSUAN_CONTEXT ctx, char *cmd, EngineStatusHandler status_fnc,
+gpgsm_assuan_simple_command (ASSUAN_CONTEXT ctx, char *cmd,
+ EngineStatusHandler status_fnc,
void *status_fnc_value)
{
AssuanError err;
static gpgme_error_t
-gpgsm_sign (void *engine, gpgme_data_t in, gpgme_data_t out, gpgme_sig_mode_t mode,
- int use_armor, int use_textmode, int include_certs,
- gpgme_ctx_t ctx /* FIXME */)
+gpgsm_sign (void *engine, gpgme_data_t in, gpgme_data_t out,
+ gpgme_sig_mode_t mode, int use_armor, int use_textmode,
+ int include_certs, gpgme_ctx_t ctx /* FIXME */)
{
GpgsmObject gpgsm = engine;
gpgme_error_t err;
}
gpgme_error_t
-_gpgme_engine_op_decrypt (EngineObject engine, gpgme_data_t ciph, gpgme_data_t plain)
+_gpgme_engine_op_decrypt (EngineObject engine, gpgme_data_t ciph,
+ gpgme_data_t plain)
{
if (!engine)
return GPGME_Invalid_Value;
}
gpgme_error_t
-_gpgme_engine_op_delete (EngineObject engine, gpgme_key_t key, int allow_secret)
+_gpgme_engine_op_delete (EngineObject engine, gpgme_key_t key,
+ int allow_secret)
{
if (!engine)
return GPGME_Invalid_Value;
gpgme_error_t
_gpgme_engine_op_encrypt_sign (EngineObject engine, gpgme_recipients_t recp,
- gpgme_data_t plain, gpgme_data_t ciph, int use_armor,
- gpgme_ctx_t ctx /* FIXME */)
+ gpgme_data_t plain, gpgme_data_t ciph,
+ int use_armor, gpgme_ctx_t ctx /* FIXME */)
{
if (!engine)
return GPGME_Invalid_Value;
gpgme_error_t
_gpgme_engine_op_genkey (EngineObject engine, gpgme_data_t help_data,
- int use_armor, gpgme_data_t pubkey, gpgme_data_t seckey)
+ int use_armor, gpgme_data_t pubkey,
+ gpgme_data_t seckey)
{
if (!engine)
return GPGME_Invalid_Value;
struct engine_object_s;
typedef struct engine_object_s *EngineObject;
-typedef gpgme_error_t (*EngineStatusHandler) (void *priv, gpgme_status_code_t code,
- char *args);
+typedef gpgme_error_t (*EngineStatusHandler) (void *priv,
+ gpgme_status_code_t code,
+ char *args);
typedef gpgme_error_t (*EngineColonLineHandler) (void *priv, char *line);
-typedef gpgme_error_t (*EngineCommandHandler) (void *priv, gpgme_status_code_t code,
- const char *keyword,
- const char **result);
+typedef gpgme_error_t (*EngineCommandHandler) (void *priv,
+ gpgme_status_code_t code,
+ const char *keyword,
+ const char **result);
-gpgme_error_t _gpgme_engine_new (gpgme_protocol_t proto, EngineObject *r_engine);
+gpgme_error_t _gpgme_engine_new (gpgme_protocol_t proto,
+ EngineObject *r_engine);
void _gpgme_engine_release (EngineObject engine);
void _gpgme_engine_set_status_handler (EngineObject engine,
EngineStatusHandler fnc,
gpgme_error_t _gpgme_engine_set_colon_line_handler (EngineObject engine,
EngineColonLineHandler fnc,
void *fnc_value);
-gpgme_error_t _gpgme_engine_op_decrypt (EngineObject engine, gpgme_data_t ciph,
- gpgme_data_t plain);
+gpgme_error_t _gpgme_engine_op_decrypt (EngineObject engine,
+ gpgme_data_t ciph,
+ gpgme_data_t plain);
gpgme_error_t _gpgme_engine_op_delete (EngineObject engine, gpgme_key_t key,
- int allow_secret);
+ int allow_secret);
gpgme_error_t _gpgme_engine_op_edit (EngineObject engine, gpgme_key_t key,
- gpgme_data_t out, gpgme_ctx_t ctx /* FIXME */);
-gpgme_error_t _gpgme_engine_op_encrypt (EngineObject engine, gpgme_recipients_t recp,
- gpgme_data_t plain, gpgme_data_t ciph,
- int use_armor);
+ gpgme_data_t out,
+ gpgme_ctx_t ctx /* FIXME */);
+gpgme_error_t _gpgme_engine_op_encrypt (EngineObject engine,
+ gpgme_recipients_t recp,
+ gpgme_data_t plain, gpgme_data_t ciph,
+ int use_armor);
gpgme_error_t _gpgme_engine_op_encrypt_sign (EngineObject engine,
- gpgme_recipients_t recp,
- gpgme_data_t plain, gpgme_data_t ciph,
- int use_armor,
- gpgme_ctx_t ctx /* FIXME */);
-gpgme_error_t _gpgme_engine_op_export (EngineObject engine, gpgme_recipients_t recp,
- gpgme_data_t keydata, int use_armor);
-gpgme_error_t _gpgme_engine_op_genkey (EngineObject engine, gpgme_data_t help_data,
- int use_armor, gpgme_data_t pubkey,
- gpgme_data_t seckey);
-gpgme_error_t _gpgme_engine_op_import (EngineObject engine, gpgme_data_t keydata);
-gpgme_error_t _gpgme_engine_op_keylist (EngineObject engine, const char *pattern,
- int secret_only,
- int keylist_mode);
+ gpgme_recipients_t recp,
+ gpgme_data_t plain,
+ gpgme_data_t ciph,
+ int use_armor,
+ gpgme_ctx_t ctx /* FIXME */);
+gpgme_error_t _gpgme_engine_op_export (EngineObject engine,
+ gpgme_recipients_t recp,
+ gpgme_data_t keydata, int use_armor);
+gpgme_error_t _gpgme_engine_op_genkey (EngineObject engine,
+ gpgme_data_t help_data,
+ int use_armor, gpgme_data_t pubkey,
+ gpgme_data_t seckey);
+gpgme_error_t _gpgme_engine_op_import (EngineObject engine,
+ gpgme_data_t keydata);
+gpgme_error_t _gpgme_engine_op_keylist (EngineObject engine,
+ const char *pattern,
+ int secret_only,
+ int keylist_mode);
gpgme_error_t _gpgme_engine_op_keylist_ext (EngineObject engine,
- const char *pattern[],
- int secret_only,
- int reserved,
- int keylist_mode);
+ const char *pattern[],
+ int secret_only,
+ int reserved,
+ int keylist_mode);
gpgme_error_t _gpgme_engine_op_sign (EngineObject engine, gpgme_data_t in,
- gpgme_data_t out, gpgme_sig_mode_t mode,
- int use_armor, int use_textmode,
- int include_certs,
- gpgme_ctx_t ctx /* FIXME */);
+ gpgme_data_t out, gpgme_sig_mode_t mode,
+ int use_armor, int use_textmode,
+ int include_certs,
+ gpgme_ctx_t ctx /* FIXME */);
gpgme_error_t _gpgme_engine_op_trustlist (EngineObject engine,
- const char *pattern);
+ const char *pattern);
gpgme_error_t _gpgme_engine_op_verify (EngineObject engine, gpgme_data_t sig,
- gpgme_data_t signed_text,
- gpgme_data_t plaintext);
+ gpgme_data_t signed_text,
+ gpgme_data_t plaintext);
void _gpgme_engine_set_io_cbs (EngineObject engine,
gpgme_io_cbs_t io_cbs);
/* Export the keys listed in RECP into KEYDATA. */
gpgme_error_t
-gpgme_op_export_start (gpgme_ctx_t ctx, gpgme_recipients_t recp, gpgme_data_t keydata)
+gpgme_op_export_start (gpgme_ctx_t ctx, gpgme_recipients_t recp,
+ gpgme_data_t keydata)
{
return export_start (ctx, 0, recp, keydata);
}
*
**/
void
-gpgme_set_passphrase_cb (gpgme_ctx_t ctx, gpgme_passphrase_cb_t cb, void *cb_value)
+gpgme_set_passphrase_cb (gpgme_ctx_t ctx, gpgme_passphrase_cb_t cb,
+ void *cb_value)
{
if (ctx)
{
* to the crypto engine.
**/
void
-gpgme_get_passphrase_cb (gpgme_ctx_t ctx, gpgme_passphrase_cb_t *r_cb, void **r_cb_value)
+gpgme_get_passphrase_cb (gpgme_ctx_t ctx, gpgme_passphrase_cb_t *r_cb,
+ void **r_cb_value)
{
if (ctx)
{
* progress indicator.
**/
void
-gpgme_get_progress_cb (gpgme_ctx_t ctx, gpgme_progress_cb_t *r_cb, void **r_cb_value)
+gpgme_get_progress_cb (gpgme_ctx_t ctx, gpgme_progress_cb_t *r_cb,
+ void **r_cb_value)
{
if (ctx)
{
const char *
-gpgme_key_sig_get_string_attr (gpgme_key_t key, int uid_idx, _gpgme_attr_t what,
+gpgme_key_sig_get_string_attr (gpgme_key_t key, int uid_idx,
+ _gpgme_attr_t what,
const void *reserved, int idx)
{
gpgme_key_sig_t certsig = get_keysig (key, uid_idx, idx);
\f
gpgme_error_t
-_gpgme_passphrase_status_handler (void *priv, gpgme_status_code_t code, char *args)
+_gpgme_passphrase_status_handler (void *priv, gpgme_status_code_t code,
+ char *args)
{
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
gpgme_error_t err;
if (!duped_stderr)
if (dup2 (fd, 2) == -1)
{
- DEBUG1 ("dup2(dev/null, 2) failed: %s\n", strerror (errno));
+ DEBUG1 ("dup2(dev/null, 2) failed: %s\n",
+ strerror (errno));
_exit (8);
}
close (fd);
do
{
- count = _gpgme_ath_select (max_fd + 1, &readfds, &writefds, NULL, &timeout);
+ count = _gpgme_ath_select (max_fd + 1, &readfds, &writefds, NULL,
+ &timeout);
}
while (count < 0 && errno == EINTR);
if (count < 0)
gpgme_error_t
-_gpgme_progress_status_handler (void *priv, gpgme_status_code_t code, char *args)
+_gpgme_progress_status_handler (void *priv, gpgme_status_code_t code,
+ char *args)
{
gpgme_ctx_t ctx = (gpgme_ctx_t) priv;
char *p;
static gpgme_error_t
-gpg_edit (void *engine, gpgme_key_t key, gpgme_data_t out, gpgme_ctx_t ctx /* FIXME */)
+gpg_edit (void *engine, gpgme_key_t key, gpgme_data_t out,
+ gpgme_ctx_t ctx /* FIXME */)
{
GpgObject gpg = engine;
gpgme_error_t err;
static gpgme_error_t
gpg_encrypt_sign (void *engine, gpgme_recipients_t recp, gpgme_data_t plain,
- gpgme_data_t ciph, int use_armor, gpgme_ctx_t ctx /* FIXME */)
+ gpgme_data_t ciph, int use_armor,
+ gpgme_ctx_t ctx /* FIXME */)
{
GpgObject gpg = engine;
gpgme_error_t err;
static gpgme_error_t
-gpg_sign (void *engine, gpgme_data_t in, gpgme_data_t out, gpgme_sig_mode_t mode,
- int use_armor, int use_textmode, int include_certs,
- gpgme_ctx_t ctx /* FIXME */)
+gpg_sign (void *engine, gpgme_data_t in, gpgme_data_t out,
+ gpgme_sig_mode_t mode, int use_armor, int use_textmode,
+ int include_certs, gpgme_ctx_t ctx /* FIXME */)
{
GpgObject gpg = engine;
gpgme_error_t err;
-/* sema.h - definitions for semaphores
- * Copyright (C) 2001 Werner Koch (dd9jn)
- * Copyright (C) 2001 g10 Code GmbH
- *
- * This file is part of GPGME.
- *
- * GPGME is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GPGME is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
+/* sema.h - Definitions for semaphores.
+ Copyright (C) 2000 Werner Koch (dd9jn)
+ Copyright (C) 2001, 2003 g10 Code GmbH
+
+ This file is part of GPGME.
+
+ GPGME is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ GPGME is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GPGME; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef SEMA_H
#define SEMA_H
-struct critsect_s {
- const char *name;
- void *private;
+struct critsect_s
+{
+ const char *name;
+ void *private;
};
#define DEFINE_GLOBAL_LOCK(name) \
- struct critsect_s name = { #name, NULL }
+ struct critsect_s name = { #name, NULL }
#define DEFINE_STATIC_LOCK(name) \
- static struct critsect_s name = { #name, NULL }
+ static struct critsect_s name = { #name, NULL }
-#define DECLARE_LOCK(name) struct critsect_s name
-#define INIT_LOCK(a) do { \
- (a).name = #a; \
- (a).private = NULL; \
- } while (0)
+#define DECLARE_LOCK(name) \
+ struct critsect_s name
+#define INIT_LOCK(a) \
+ do \
+ { \
+ (a).name = #a; \
+ (a).private = NULL; \
+ } \
+ while (0)
#define DESTROY_LOCK(name) _gpgme_sema_cs_destroy (&(name))
-#define LOCK(name) do { \
- _gpgme_sema_cs_enter ( &(name) );\
- } while (0)
-
-#define UNLOCK(name) do { \
- _gpgme_sema_cs_leave ( &(name) );\
- } while (0)
+#define LOCK(name) \
+ do \
+ { \
+ _gpgme_sema_cs_enter (&(name)); \
+ } \
+ while (0)
+#define UNLOCK(name) \
+ do \
+ { \
+ _gpgme_sema_cs_leave (&(name)); \
+ } \
+ while (0)
void _gpgme_sema_subsystem_init (void);
-void _gpgme_sema_cs_enter ( struct critsect_s *s );
-void _gpgme_sema_cs_leave ( struct critsect_s *s );
-void _gpgme_sema_cs_destroy ( struct critsect_s *s );
-
+void _gpgme_sema_cs_enter (struct critsect_s *s);
+void _gpgme_sema_cs_leave (struct critsect_s *s);
+void _gpgme_sema_cs_destroy (struct critsect_s *s);
#endif /* SEMA_H */
-
-
-
-
-
static gpgme_error_t
-sign_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t plain, gpgme_data_t sig,
- gpgme_sig_mode_t mode)
+sign_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t plain,
+ gpgme_data_t sig, gpgme_sig_mode_t mode)
{
gpgme_error_t err;
if (ctx->passphrase_cb)
{
- err = _gpgme_engine_set_command_handler (ctx->engine,
- _gpgme_passphrase_command_handler,
- ctx, NULL);
+ err = _gpgme_engine_set_command_handler
+ (ctx->engine, _gpgme_passphrase_command_handler, ctx, NULL);
if (err)
return err;
}
/* Sign the plaintext PLAIN and store the signature in SIG. */
gpgme_error_t
-gpgme_op_sign (gpgme_ctx_t ctx, gpgme_data_t plain, gpgme_data_t sig, gpgme_sig_mode_t mode)
+gpgme_op_sign (gpgme_ctx_t ctx, gpgme_data_t plain, gpgme_data_t sig,
+ gpgme_sig_mode_t mode)
{
gpgme_error_t err = sign_start (ctx, 1, plain, sig, mode);
if (!err)
void
-_gpgme_op_trustlist_event_cb (void *data, gpgme_event_io_t type, void *type_data)
+_gpgme_op_trustlist_event_cb (void *data, gpgme_event_io_t type,
+ void *type_data)
{
gpgme_ctx_t ctx = (gpgme_ctx_t) data;
gpgme_error_t err;
/* Decrypt ciphertext CIPHER and make a signature verification within
CTX and store the resulting plaintext in PLAIN. */
gpgme_error_t
-gpgme_op_verify_start (gpgme_ctx_t ctx, gpgme_data_t sig, gpgme_data_t signed_text,
- gpgme_data_t plaintext)
+gpgme_op_verify_start (gpgme_ctx_t ctx, gpgme_data_t sig,
+ gpgme_data_t signed_text, gpgme_data_t plaintext)
{
return _gpgme_op_verify_start (ctx, 0, sig, signed_text, plaintext);
}
#include "io.h"
-/*
- * We assume that a HANDLE can be represented by an int which should be true
- * for all i386 systems (HANDLE is defined as void *) and these are the only
- * systems for which Windows is available.
- * Further we assume that -1 denotes an invalid handle.
- */
+/* We assume that a HANDLE can be represented by an int which should
+ be true for all i386 systems (HANDLE is defined as void *) and
+ these are the only systems for which Windows is available. Further
+ we assume that -1 denotes an invalid handle. */
#define fd_to_handle(a) ((HANDLE)(a))
#define handle_to_fd(a) ((int)(a))
static int initialized;
if (!initialized) {
- /* the very first time we call this function, we assume that only
- * one thread is running, so that we can bootstrap the semaphore code
- */
+ /* The very first time we call this function, we assume that
+ only one thread is running, so that we can bootstrap the
+ semaphore code. */
InitializeCriticalSection (&init_lock);
initialized = 1;
}
{
if (!s->private)
critsect_init (s);
- LeaveCriticalSection ( (CRITICAL_SECTION*)s->private );
+ LeaveCriticalSection ((CRITICAL_SECTION*)s->private);
}
void
event loops. */
void
-_gpgme_wait_global_event_cb (void *data, gpgme_event_io_t type, void *type_data)
+_gpgme_wait_global_event_cb (void *data, gpgme_event_io_t type,
+ void *type_data)
{
gpgme_ctx_t ctx = (gpgme_ctx_t) data;
for (idx = 0; idx < ictx->fdt.size; idx++)
if (ictx->fdt.fds[idx].fd != -1)
_gpgme_io_close (ictx->fdt.fds[idx].fd);
- _gpgme_engine_io_event (ictx->engine, GPGME_EVENT_DONE, &err);
+ _gpgme_engine_io_event (ictx->engine, GPGME_EVENT_DONE,
+ &err);
}
}
}
event loops. */
void
-_gpgme_wait_private_event_cb (void *data, gpgme_event_io_t type, void *type_data)
+_gpgme_wait_private_event_cb (void *data, gpgme_event_io_t type,
+ void *type_data)
{
switch (type)
{
gpgme_error_t _gpgme_add_io_cb (void *data, int fd, int dir,
gpgme_io_cb_t fnc, void *fnc_data, void **r_tag);
void _gpgme_remove_io_cb (void *tag);
-void _gpgme_wait_private_event_cb (void *data, gpgme_event_io_t type, void *type_data);
-void _gpgme_wait_global_event_cb (void *data, gpgme_event_io_t type, void *type_data);
+void _gpgme_wait_private_event_cb (void *data, gpgme_event_io_t type,
+ void *type_data);
+void _gpgme_wait_global_event_cb (void *data, gpgme_event_io_t type,
+ void *type_data);
gpgme_error_t _gpgme_wait_user_add_io_cb (void *data, int fd, int dir,
gpgme_io_cb_t fnc, void *fnc_data,
void **r_tag);
void _gpgme_wait_user_remove_io_cb (void *tag);
-void _gpgme_wait_user_event_cb (void *data, gpgme_event_io_t type, void *type_data);
+void _gpgme_wait_user_event_cb (void *data, gpgme_event_io_t type,
+ void *type_data);
gpgme_error_t _gpgme_wait_one (gpgme_ctx_t ctx);