aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2003-04-27 23:05:03 +0000
committerMarcus Brinkmann <[email protected]>2003-04-27 23:05:03 +0000
commit32096efd58e66bc5a0546a0d3da845eab86ab232 (patch)
tree91f6f1a58b7346eb326e5563f292e33cd5edca28
parentAdd item about passphrase handler. (diff)
downloadgpgme-32096efd58e66bc5a0546a0d3da845eab86ab232.tar.gz
gpgme-32096efd58e66bc5a0546a0d3da845eab86ab232.zip
2003-04-27 Marcus Brinkmann <[email protected]>
* encrypt-sign.c: Do not include <stddef.h>, <stdio.h>, <stdlib.h>, <string.h>, <assert.h> and "util.h", but "gpgme.h". (_gpgme_op_encrypt_sign_start): Rename to ... (encrypt_sign_start): ... this. (gpgme_op_encrypt_sign_start): Use encrypt_sign_start, not _gpgme_op_encrypt_sign_start. (gpgme_op_encrypt_sign): Likewise.
-rw-r--r--gpgme/ChangeLog8
-rw-r--r--gpgme/encrypt-sign.c40
2 files changed, 22 insertions, 26 deletions
diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog
index 3b44aacc..0a798c6c 100644
--- a/gpgme/ChangeLog
+++ b/gpgme/ChangeLog
@@ -1,5 +1,13 @@
2003-04-27 Marcus Brinkmann <[email protected]>
+ * encrypt-sign.c: Do not include <stddef.h>, <stdio.h>,
+ <stdlib.h>, <string.h>, <assert.h> and "util.h", but "gpgme.h".
+ (_gpgme_op_encrypt_sign_start): Rename to ...
+ (encrypt_sign_start): ... this.
+ (gpgme_op_encrypt_sign_start): Use encrypt_sign_start, not
+ _gpgme_op_encrypt_sign_start.
+ (gpgme_op_encrypt_sign): Likewise.
+
* gpgme.h (GpgmeEncryptResult): New data type.
(gpgme_op_encrypt_result): New prototype.
* ops.h (_gpgme_op_encrypt_init_result): New prototype.
diff --git a/gpgme/encrypt-sign.c b/gpgme/encrypt-sign.c
index 2a3dba2d..466f664e 100644
--- a/gpgme/encrypt-sign.c
+++ b/gpgme/encrypt-sign.c
@@ -21,17 +21,12 @@
#if HAVE_CONFIG_H
#include <config.h>
#endif
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include "util.h"
+#include "gpgme.h"
#include "context.h"
#include "ops.h"
-
+
static GpgmeError
encrypt_sign_status_handler (void *priv, GpgmeStatusCode code, char *args)
{
@@ -41,9 +36,8 @@ encrypt_sign_status_handler (void *priv, GpgmeStatusCode code, char *args)
static GpgmeError
-_gpgme_op_encrypt_sign_start (GpgmeCtx ctx, int synchronous,
- GpgmeRecipients recp,
- GpgmeData plain, GpgmeData cipher)
+encrypt_sign_start (GpgmeCtx ctx, int synchronous, GpgmeRecipients recp,
+ GpgmeData plain, GpgmeData cipher)
{
GpgmeError err;
@@ -75,37 +69,31 @@ _gpgme_op_encrypt_sign_start (GpgmeCtx ctx, int synchronous,
_gpgme_engine_set_status_handler (ctx->engine,
encrypt_sign_status_handler, ctx);
-
+
return _gpgme_engine_op_encrypt_sign (ctx->engine, recp, plain, cipher,
ctx->use_armor, ctx /* FIXME */);
}
+
+/* Encrypt plaintext PLAIN within CTX for the recipients RECP and
+ store the resulting ciphertext in CIPHER. Also sign the ciphertext
+ with the signers in CTX. */
GpgmeError
gpgme_op_encrypt_sign_start (GpgmeCtx ctx, GpgmeRecipients recp,
GpgmeData plain, GpgmeData cipher)
{
- return _gpgme_op_encrypt_sign_start (ctx, 0, recp, plain, cipher);
+ return encrypt_sign_start (ctx, 0, recp, plain, cipher);
}
-/**
- * gpgme_op_encrypt_sign:
- * @ctx: The context
- * @recp: The set of recipients
- * @plain: plaintext input
- * @cipher: signed ciphertext
- *
- * This function encrypts @plain for all recipients in recp, signs it,
- * and returns the ciphertext in @out. The function does wait for the
- * result.
- *
- * Return value: 0 on success or an errorcode.
- **/
+/* Encrypt plaintext PLAIN within CTX for the recipients RECP and
+ store the resulting ciphertext in CIPHER. Also sign the ciphertext
+ with the signers in CTX. */
GpgmeError
gpgme_op_encrypt_sign (GpgmeCtx ctx, GpgmeRecipients recp,
GpgmeData plain, GpgmeData cipher)
{
- GpgmeError err = _gpgme_op_encrypt_sign_start (ctx, 1, recp, plain, cipher);
+ GpgmeError err = encrypt_sign_start (ctx, 1, recp, plain, cipher);
if (!err)
err = _gpgme_wait_one (ctx);
return err;