From b61a983ee759f7229450023b3f7f0986f07c4aee Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Wed, 28 May 2003 01:59:25 +0000 Subject: [PATCH] 2003-05-28 Marcus Brinkmann * engine-gpgsm.c: Rename GpgsmObject to engine_gpgsm_t. (struct gpgsm_object_s): Rename to struct engine_gpgsm. * rungpg.c: Rename GpgObject to engine_gpg_t. (struct gpg_object_s): Rename to struct engine_gpg. --- gpgme/ChangeLog | 5 ++++ gpgme/engine-gpgsm.c | 46 ++++++++++++++--------------- gpgme/rungpg.c | 70 ++++++++++++++++++++++---------------------- 3 files changed, 63 insertions(+), 58 deletions(-) diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index 10a8e2c..757afa9 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,5 +1,10 @@ 2003-05-28 Marcus Brinkmann + * engine-gpgsm.c: Rename GpgsmObject to engine_gpgsm_t. + (struct gpgsm_object_s): Rename to struct engine_gpgsm. + * rungpg.c: Rename GpgObject to engine_gpg_t. + (struct gpg_object_s): Rename to struct engine_gpg. + * context.h (struct gpgme_context): Change EngineObject to engine_object_t. (enum ctx_op_data_type): Rename to ctx_op_data_id_t. diff --git a/gpgme/engine-gpgsm.c b/gpgme/engine-gpgsm.c index 1f5105e..627b159 100644 --- a/gpgme/engine-gpgsm.c +++ b/gpgme/engine-gpgsm.c @@ -52,7 +52,7 @@ typedef struct } iocb_data_t; -struct gpgsm_object_s +struct engine_gpgsm { ASSUAN_CONTEXT assuan_ctx; @@ -90,7 +90,7 @@ struct gpgsm_object_s struct gpgme_io_cbs io_cbs; }; -typedef struct gpgsm_object_s *GpgsmObject; +typedef struct engine_gpgsm *engine_gpgsm_t; static const char * @@ -118,7 +118,7 @@ gpgsm_get_req_version (void) static void close_notify_handler (int fd, void *opaque) { - GpgsmObject gpgsm = opaque; + engine_gpgsm_t gpgsm = opaque; assert (fd != -1); if (gpgsm->status_cb.fd == fd) @@ -252,7 +252,7 @@ map_assuan_error (AssuanError err) static void gpgsm_release (void *engine) { - GpgsmObject gpgsm = engine; + engine_gpgsm_t gpgsm = engine; if (!gpgsm) return; @@ -277,7 +277,7 @@ static gpgme_error_t gpgsm_new (void **engine) { gpgme_error_t err = 0; - GpgsmObject gpgsm; + engine_gpgsm_t gpgsm; char *argv[3]; int fds[2]; int child_fds[4]; @@ -659,7 +659,7 @@ status_handler (void *opaque, int fd) { AssuanError assuan_err; gpgme_error_t err = 0; - GpgsmObject gpgsm = opaque; + engine_gpgsm_t gpgsm = opaque; char *line; size_t linelen; @@ -804,7 +804,7 @@ status_handler (void *opaque, int fd) static gpgme_error_t -add_io_cb (GpgsmObject gpgsm, iocb_data_t *iocbd, gpgme_io_cb_t handler) +add_io_cb (engine_gpgsm_t gpgsm, iocb_data_t *iocbd, gpgme_io_cb_t handler) { gpgme_error_t err; @@ -821,7 +821,7 @@ add_io_cb (GpgsmObject gpgsm, iocb_data_t *iocbd, gpgme_io_cb_t handler) static gpgme_error_t -start (GpgsmObject gpgsm, const char *command) +start (engine_gpgsm_t gpgsm, const char *command) { gpgme_error_t err; @@ -846,7 +846,7 @@ start (GpgsmObject gpgsm, const char *command) static gpgme_error_t gpgsm_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain) { - GpgsmObject gpgsm = engine; + engine_gpgsm_t gpgsm = engine; gpgme_error_t err; if (!gpgsm) @@ -871,7 +871,7 @@ gpgsm_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain) static gpgme_error_t gpgsm_delete (void *engine, gpgme_key_t key, int allow_secret) { - GpgsmObject gpgsm = engine; + engine_gpgsm_t gpgsm = engine; gpgme_error_t err; char *fpr = key->subkeys ? key->subkeys->fpr : NULL; char *linep = fpr; @@ -936,7 +936,7 @@ gpgsm_delete (void *engine, gpgme_key_t key, int allow_secret) static gpgme_error_t -set_recipients (GpgsmObject gpgsm, gpgme_user_id_t uid) +set_recipients (engine_gpgsm_t gpgsm, gpgme_user_id_t uid) { gpgme_error_t err; ASSUAN_CONTEXT ctx = gpgsm->assuan_ctx; @@ -985,7 +985,7 @@ static gpgme_error_t gpgsm_encrypt (void *engine, gpgme_user_id_t recp, gpgme_data_t plain, gpgme_data_t ciph, int use_armor) { - GpgsmObject gpgsm = engine; + engine_gpgsm_t gpgsm = engine; gpgme_error_t err; if (!gpgsm) @@ -1018,7 +1018,7 @@ static gpgme_error_t gpgsm_export (void *engine, gpgme_user_id_t uid, gpgme_data_t keydata, int use_armor) { - GpgsmObject gpgsm = engine; + engine_gpgsm_t gpgsm = engine; gpgme_error_t err = 0; char *cmd = NULL; int cmdi; @@ -1074,7 +1074,7 @@ static gpgme_error_t gpgsm_genkey (void *engine, gpgme_data_t help_data, int use_armor, gpgme_data_t pubkey, gpgme_data_t seckey) { - GpgsmObject gpgsm = engine; + engine_gpgsm_t gpgsm = engine; gpgme_error_t err; if (!gpgsm || !pubkey || seckey) @@ -1100,7 +1100,7 @@ gpgsm_genkey (void *engine, gpgme_data_t help_data, int use_armor, static gpgme_error_t gpgsm_import (void *engine, gpgme_data_t keydata) { - GpgsmObject gpgsm = engine; + engine_gpgsm_t gpgsm = engine; gpgme_error_t err; if (!gpgsm) @@ -1123,7 +1123,7 @@ static gpgme_error_t gpgsm_keylist (void *engine, const char *pattern, int secret_only, int keylist_mode) { - GpgsmObject gpgsm = engine; + engine_gpgsm_t gpgsm = engine; char *line; gpgme_error_t err; @@ -1166,7 +1166,7 @@ static gpgme_error_t gpgsm_keylist_ext (void *engine, const char *pattern[], int secret_only, int reserved, int keylist_mode) { - GpgsmObject gpgsm = engine; + engine_gpgsm_t gpgsm = engine; char *line; gpgme_error_t err; /* Length is "LISTSECRETKEYS " + p + '\0'. */ @@ -1268,7 +1268,7 @@ 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; + engine_gpgsm_t gpgsm = engine; gpgme_error_t err; char *assuan_cmd; int i; @@ -1338,7 +1338,7 @@ static gpgme_error_t gpgsm_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text, gpgme_data_t plaintext) { - GpgsmObject gpgsm = engine; + engine_gpgsm_t gpgsm = engine; gpgme_error_t err; if (!gpgsm) @@ -1377,7 +1377,7 @@ static void gpgsm_set_status_handler (void *engine, engine_status_handler_t fnc, void *fnc_value) { - GpgsmObject gpgsm = engine; + engine_gpgsm_t gpgsm = engine; gpgsm->status.fnc = fnc; gpgsm->status.fnc_value = fnc_value; @@ -1388,7 +1388,7 @@ static gpgme_error_t gpgsm_set_colon_line_handler (void *engine, engine_colon_line_handler_t fnc, void *fnc_value) { - GpgsmObject gpgsm = engine; + engine_gpgsm_t gpgsm = engine; gpgsm->colon.fnc = fnc; gpgsm->colon.fnc_value = fnc_value; @@ -1400,7 +1400,7 @@ gpgsm_set_colon_line_handler (void *engine, engine_colon_line_handler_t fnc, static void gpgsm_set_io_cbs (void *engine, gpgme_io_cbs_t io_cbs) { - GpgsmObject gpgsm = engine; + engine_gpgsm_t gpgsm = engine; gpgsm->io_cbs = *io_cbs; } @@ -1408,7 +1408,7 @@ gpgsm_set_io_cbs (void *engine, gpgme_io_cbs_t io_cbs) static void gpgsm_io_event (void *engine, gpgme_event_io_t type, void *type_data) { - GpgsmObject gpgsm = engine; + engine_gpgsm_t gpgsm = engine; if (gpgsm->io_cbs.event) (*gpgsm->io_cbs.event) (gpgsm->io_cbs.event_priv, type, type_data); diff --git a/gpgme/rungpg.c b/gpgme/rungpg.c index 2aaa72c..0a13e68 100644 --- a/gpgme/rungpg.c +++ b/gpgme/rungpg.c @@ -70,7 +70,7 @@ struct fd_data_map_s }; -struct gpg_object_s +struct engine_gpg { struct arg_and_data_s *arglist; struct arg_and_data_s **argtail; @@ -124,13 +124,13 @@ struct gpg_object_s struct gpgme_io_cbs io_cbs; }; -typedef struct gpg_object_s *GpgObject; +typedef struct engine_gpg *engine_gpg_t; static void gpg_io_event (void *engine, gpgme_event_io_t type, void *type_data) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; if (gpg->io_cbs.event) (*gpg->io_cbs.event) (gpg->io_cbs.event_priv, type, type_data); @@ -140,7 +140,7 @@ gpg_io_event (void *engine, gpgme_event_io_t type, void *type_data) static void close_notify_handler (int fd, void *opaque) { - GpgObject gpg = opaque; + engine_gpg_t gpg = opaque; assert (fd != -1); if (gpg->status.fd[0] == fd) @@ -182,7 +182,7 @@ close_notify_handler (int fd, void *opaque) } static gpgme_error_t -add_arg (GpgObject gpg, const char *arg) +add_arg (engine_gpg_t gpg, const char *arg) { struct arg_and_data_s *a; @@ -205,7 +205,7 @@ add_arg (GpgObject gpg, const char *arg) } static gpgme_error_t -add_data (GpgObject gpg, gpgme_data_t data, int dup_to, int inbound) +add_data (engine_gpg_t gpg, gpgme_data_t data, int dup_to, int inbound) { struct arg_and_data_s *a; @@ -292,7 +292,7 @@ free_fd_data_map (struct fd_data_map_s *fd_data_map) static void gpg_release (void *engine) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; if (!gpg) return; @@ -334,7 +334,7 @@ gpg_release (void *engine) static gpgme_error_t gpg_new (void **engine) { - GpgObject gpg; + engine_gpg_t gpg; int rc = 0; gpg = calloc (1, sizeof *gpg); @@ -405,7 +405,7 @@ static void gpg_set_status_handler (void *engine, engine_status_handler_t fnc, void *fnc_value) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; gpg->status.fnc = fnc; gpg->status.fnc_value = fnc_value; @@ -416,7 +416,7 @@ static gpgme_error_t gpg_set_colon_line_handler (void *engine, engine_colon_line_handler_t fnc, void *fnc_value) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; gpg->colon.bufsize = 1024; gpg->colon.readpos = 0; @@ -445,7 +445,7 @@ static gpgme_error_t command_handler (void *opaque, int fd) { gpgme_error_t err; - GpgObject gpg = (GpgObject) opaque; + engine_gpg_t gpg = (engine_gpg_t) opaque; assert (gpg->cmd.used); assert (gpg->cmd.code); @@ -477,7 +477,7 @@ static gpgme_error_t gpg_set_command_handler (void *engine, engine_command_handler_t fnc, void *fnc_value, gpgme_data_t linked_data) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; add_arg (gpg, "--command-fd"); /* This is a hack. We don't have a real data object. The only @@ -494,7 +494,7 @@ gpg_set_command_handler (void *engine, engine_command_handler_t fnc, static gpgme_error_t -build_argv (GpgObject gpg) +build_argv (engine_gpg_t gpg) { struct arg_and_data_s *a; struct fd_data_map_s *fd_data_map; @@ -705,7 +705,7 @@ build_argv (GpgObject gpg) static gpgme_error_t -add_io_cb (GpgObject gpg, int fd, int dir, gpgme_io_cb_t handler, void *data, +add_io_cb (engine_gpg_t gpg, int fd, int dir, gpgme_io_cb_t handler, void *data, void **tag) { gpgme_error_t err; @@ -738,7 +738,7 @@ status_cmp (const void *ap, const void *bp) with status line code we know about and skip all other stuff without buffering (i.e. without extending the buffer). */ static gpgme_error_t -read_status (GpgObject gpg) +read_status (engine_gpg_t gpg) { char *p; int nread; @@ -898,7 +898,7 @@ read_status (GpgObject gpg) static gpgme_error_t status_handler (void *opaque, int fd) { - GpgObject gpg = opaque; + engine_gpg_t gpg = opaque; int err; assert (fd == gpg->status.fd[0]); @@ -912,7 +912,7 @@ status_handler (void *opaque, int fd) static gpgme_error_t -read_colon_line (GpgObject gpg) +read_colon_line (engine_gpg_t gpg) { char *p; int nread; @@ -992,7 +992,7 @@ read_colon_line (GpgObject gpg) static gpgme_error_t colon_line_handler (void *opaque, int fd) { - GpgObject gpg = opaque; + engine_gpg_t gpg = opaque; gpgme_error_t rc = 0; assert (fd == gpg->colon.fd[0]); @@ -1006,7 +1006,7 @@ colon_line_handler (void *opaque, int fd) static gpgme_error_t -start (GpgObject gpg) +start (engine_gpg_t gpg) { gpgme_error_t rc; int i, n; @@ -1136,7 +1136,7 @@ start (GpgObject gpg) static gpgme_error_t gpg_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; gpgme_error_t err; err = add_arg (gpg, "--decrypt"); @@ -1159,7 +1159,7 @@ gpg_decrypt (void *engine, gpgme_data_t ciph, gpgme_data_t plain) static gpgme_error_t gpg_delete (void *engine, gpgme_key_t key, int allow_secret) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; gpgme_error_t err; err = add_arg (gpg, allow_secret ? "--delete-secret-and-public-key" @@ -1181,7 +1181,7 @@ gpg_delete (void *engine, gpgme_key_t key, int allow_secret) static gpgme_error_t -append_args_from_signers (GpgObject gpg, gpgme_ctx_t ctx /* FIXME */) +append_args_from_signers (engine_gpg_t gpg, gpgme_ctx_t ctx /* FIXME */) { gpgme_error_t err = 0; int i; @@ -1208,7 +1208,7 @@ static gpgme_error_t gpg_edit (void *engine, gpgme_key_t key, gpgme_data_t out, gpgme_ctx_t ctx /* FIXME */) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; gpgme_error_t err; err = add_arg (gpg, "--with-colons"); @@ -1236,7 +1236,7 @@ gpg_edit (void *engine, gpgme_key_t key, gpgme_data_t out, static gpgme_error_t -append_args_from_recipients (GpgObject gpg, gpgme_user_id_t uid) +append_args_from_recipients (engine_gpg_t gpg, gpgme_user_id_t uid) { gpgme_error_t err = 0; @@ -1257,7 +1257,7 @@ static gpgme_error_t gpg_encrypt (void *engine, gpgme_user_id_t recp, gpgme_data_t plain, gpgme_data_t ciph, int use_armor) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; gpgme_error_t err; int symmetric = !recp; @@ -1301,7 +1301,7 @@ gpg_encrypt_sign (void *engine, gpgme_user_id_t recp, gpgme_data_t plain, gpgme_data_t ciph, int use_armor, gpgme_ctx_t ctx /* FIXME */) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; gpgme_error_t err; err = add_arg (gpg, "--encrypt"); @@ -1344,7 +1344,7 @@ static gpgme_error_t gpg_export (void *engine, gpgme_user_id_t uids, gpgme_data_t keydata, int use_armor) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; gpgme_error_t err; err = add_arg (gpg, "--export"); @@ -1372,7 +1372,7 @@ static gpgme_error_t gpg_genkey (void *engine, gpgme_data_t help_data, int use_armor, gpgme_data_t pubkey, gpgme_data_t seckey) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; gpgme_error_t err; if (!gpg) @@ -1401,7 +1401,7 @@ gpg_genkey (void *engine, gpgme_data_t help_data, int use_armor, static gpgme_error_t gpg_import (void *engine, gpgme_data_t keydata) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; gpgme_error_t err; err = add_arg (gpg, "--import"); @@ -1419,7 +1419,7 @@ static gpgme_error_t gpg_keylist (void *engine, const char *pattern, int secret_only, int keylist_mode) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; gpgme_error_t err; err = add_arg (gpg, "--with-colons"); @@ -1451,7 +1451,7 @@ static gpgme_error_t gpg_keylist_ext (void *engine, const char *pattern[], int secret_only, int reserved, int keylist_mode) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; gpgme_error_t err; if (reserved) @@ -1490,7 +1490,7 @@ 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; + engine_gpg_t gpg = engine; gpgme_error_t err; if (mode == GPGME_SIG_MODE_CLEAR) @@ -1524,7 +1524,7 @@ gpg_sign (void *engine, gpgme_data_t in, gpgme_data_t out, static gpgme_error_t gpg_trustlist (void *engine, const char *pattern) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; gpgme_error_t err; err = add_arg (gpg, "--with-colons"); @@ -1548,7 +1548,7 @@ static gpgme_error_t gpg_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text, gpgme_data_t plaintext) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; gpgme_error_t err = 0; if (plaintext) @@ -1591,7 +1591,7 @@ gpg_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text, static void gpg_set_io_cbs (void *engine, gpgme_io_cbs_t io_cbs) { - GpgObject gpg = engine; + engine_gpg_t gpg = engine; gpg->io_cbs = *io_cbs; } -- 2.26.2