[Pkg-gnupg-commit] [libassuan] 198/437: doc/ 2007-09-03 Marcus Brinkmann <marcus at g10code.de>
Eric Dorland
eric at moszumanska.debian.org
Fri May 22 05:33:43 UTC 2015
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository libassuan.
commit 7422d0288f725b17eec4c9b39ea94276794afcdb
Author: Marcus Brinkmann <mb at g10code.com>
Date: Mon Sep 3 12:29:07 2007 +0000
doc/
2007-09-03 Marcus Brinkmann <marcus at g10code.de>
* assuan.texi: Fix prototype and documentation for
assuan_inquire_ext.
src/
2007-09-03 Marcus Brinkmann <marcus at g10code.de>
* assuan.h (assuan_inquire_ext): Move buffer and buffer_length
arguments callback in prototype.
* assuan-defs.h (struct assuan_context_s): Remove members
inquire_r_buffer and inquire_r_buffer_len. Add buffer and buffer
length arguments to inquire_cb.
* assuan-inquire.c (_assuan_inquire_ext_cb): Return buffer and
buffer length via callback.
(assuan_inquire_ext): Move buffer and buffer length arguments to
callback.
---
doc/ChangeLog | 5 +++++
doc/assuan.texi | 11 ++++++-----
src/ChangeLog | 15 +++++++++++++++
src/assuan-defs.h | 6 ++----
src/assuan-inquire.c | 40 ++++++++++++++++++++--------------------
src/assuan.h | 5 +++--
6 files changed, 51 insertions(+), 31 deletions(-)
diff --git a/doc/ChangeLog b/doc/ChangeLog
index 488a922..edd985e 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2007-09-03 Marcus Brinkmann <marcus at g10code.de>
+
+ * assuan.texi: Fix prototype and documentation for
+ assuan_inquire_ext.
+
2007-08-24 Werner Koch <wk at g10code.com>
* lgpl.texi: Replace by LGPLv2.1 version.
diff --git a/doc/assuan.texi b/doc/assuan.texi
index 27a9d9e..8bc72c4 100644
--- a/doc/assuan.texi
+++ b/doc/assuan.texi
@@ -1295,12 +1295,13 @@ zero and stop otherwise; @code{-1} or @code{GPG_ERR_EOF} indicate a
regular end.
@end deftypefun
- at deftypefun assuan_error_t assuan_inquire_ext (@w{assuan_context_t @var{ctx}}, @w{const char *@var{keyword}}, @w{unsigned char **@var{r_buffer}}, @w{size_t *@var{r_length}}, @w{size_t @var{maxlen}}, @w{int (*@var{cb}) (void *cb_data, int rc)}, @w{void *@var{cb_data}})
+ at deftypefun assuan_error_t assuan_inquire_ext (@w{assuan_context_t @var{ctx}}, @w{const char *@var{keyword}}, @w{size_t @var{maxlen}}, @w{int (*@var{cb}) (void *cb_data, int rc, unsigned char *buffer, size_t buffer_len)}, @w{void *@var{cb_data}})
-This is the same as @code{assuan_inquire} but the caller has to
-provide the outer loop (using @code{assuan_process_next}). The caller
-should specify a continuation with @var{cb}, which receives
- at var{cb_data} as its first argument.
+This is similar to @code{assuan_inquire} but the caller has to provide
+the outer loop (using @code{assuan_process_next}). The caller should
+specify a continuation with @var{cb}, which receives @var{cb_data} as
+its first argument, and the error code as well as the inquired data as
+its remaining arguments.
@end deftypefun
diff --git a/src/ChangeLog b/src/ChangeLog
index c11fb3a..65ec799 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,7 +1,22 @@
+<<<<<<< .mine
+2007-09-03 Marcus Brinkmann <marcus at g10code.de>
+
+ * assuan.h (assuan_inquire_ext): Move buffer and buffer_length
+ arguments callback in prototype.
+ * assuan-defs.h (struct assuan_context_s): Remove members
+ inquire_r_buffer and inquire_r_buffer_len. Add buffer and buffer
+ length arguments to inquire_cb.
+ * assuan-inquire.c (_assuan_inquire_ext_cb): Return buffer and
+ buffer length via callback.
+ (assuan_inquire_ext): Move buffer and buffer length arguments to
+ callback.
+
+=======
2007-08-24 Werner Koch <wk at g10code.com>
Switched license to back to LGPLv2.1.
+>>>>>>> .r250
2007-08-09 Marcus Brinkmann <marcus at g10code.de>
* assuan.h (assuan_process_done, assuan_inquire_ext): New
diff --git a/src/assuan-defs.h b/src/assuan-defs.h
index 52b0d8b..e423ab2 100644
--- a/src/assuan-defs.h
+++ b/src/assuan-defs.h
@@ -1,5 +1,5 @@
/* assuan-defs.c - Internal definitions to Assuan
- * Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2002, 2004, 2005, 2007 Free Software Foundation, Inc.
*
* This file is part of Assuan.
*
@@ -107,10 +107,8 @@ struct assuan_context_s
int in_command;
/* The following members are used by assuan_inquire_ext. */
- int (*inquire_cb) (void *cb_data, int rc);
+ int (*inquire_cb) (void *cb_data, int rc, unsigned char *buf, size_t len);
void *inquire_cb_data;
- unsigned char **inquire_r_buffer;
- size_t *inquire_r_buffer_len;
void *inquire_membuf;
char *hello_line;
diff --git a/src/assuan-inquire.c b/src/assuan-inquire.c
index d9d72be..94c72ef 100644
--- a/src/assuan-inquire.c
+++ b/src/assuan-inquire.c
@@ -1,5 +1,5 @@
/* assuan-inquire.c - handle inquire stuff
- * Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc.
*
* This file is part of Assuan.
*
@@ -310,15 +310,20 @@ _assuan_inquire_ext_cb (assuan_context_t ctx)
return 0;
leave:
- if (mb)
- {
- *(ctx->inquire_r_buffer) = get_membuf (mb, ctx->inquire_r_buffer_len);
- if (!*(ctx->inquire_r_buffer))
- rc = _assuan_error (ASSUAN_Out_Of_Core);
- free_membuf (mb);
- free (mb);
- }
- (ctx->inquire_cb) (ctx->inquire_cb_data, rc);
+ {
+ size_t buf_len = 0;
+ unsigned char *buf = NULL;
+
+ if (mb)
+ {
+ buf = get_membuf (mb, &buf_len);
+ if (!buf)
+ rc = _assuan_error (ASSUAN_Out_Of_Core);
+ free_membuf (mb);
+ free (mb);
+ }
+ (ctx->inquire_cb) (ctx->inquire_cb_data, rc, buf, buf_len);
+ }
return rc;
}
@@ -326,8 +331,6 @@ _assuan_inquire_ext_cb (assuan_context_t ctx)
* assuan_inquire_ext:
* @ctx: An assuan context
* @keyword: The keyword used for the inquire
- * @r_buffer: Returns an allocated buffer
- * @r_length: Returns the length of this buffer
* @maxlen: If not 0, the size limit of the inquired data.
* @cb: A callback handler which is invoked after the operation completed.
* @cb_data: A user-provided value passed to the callback handler.
@@ -339,9 +342,10 @@ _assuan_inquire_ext_cb (assuan_context_t ctx)
* Return value: 0 on success or an ASSUAN error code
**/
assuan_error_t
-assuan_inquire_ext (assuan_context_t ctx, const char *keyword,
- unsigned char **r_buffer, size_t *r_length, size_t maxlen,
- int (*cb) (void *cb_data, int rc), void *cb_data)
+assuan_inquire_ext (assuan_context_t ctx, const char *keyword, size_t maxlen,
+ int (*cb) (void *cb_data, int rc, unsigned char *buf,
+ size_t len),
+ void *cb_data)
{
assuan_error_t rc;
struct membuf *mb = NULL;
@@ -350,9 +354,7 @@ assuan_inquire_ext (assuan_context_t ctx, const char *keyword,
if (!ctx || !keyword || (10 + strlen (keyword) >= sizeof (cmdbuf)))
return _assuan_error (ASSUAN_Invalid_Value);
- nodataexpected = !r_buffer && !r_length && !maxlen;
- if (!nodataexpected && (!r_buffer || !r_length))
- return _assuan_error (ASSUAN_Invalid_Value);
+ nodataexpected = !maxlen;
if (!ctx->is_server)
return _assuan_error (ASSUAN_Not_A_Server);
if (ctx->in_inquire)
@@ -381,8 +383,6 @@ assuan_inquire_ext (assuan_context_t ctx, const char *keyword,
ctx->inquire_cb = cb;
ctx->inquire_cb_data = cb_data;
ctx->inquire_membuf = mb;
- ctx->inquire_r_buffer = r_buffer;
- ctx->inquire_r_buffer_len = r_length;
return 0;
}
diff --git a/src/assuan.h b/src/assuan.h
index a70fcde..1e627ce 100644
--- a/src/assuan.h
+++ b/src/assuan.h
@@ -466,9 +466,10 @@ assuan_error_t assuan_inquire (assuan_context_t ctx, const char *keyword,
unsigned char **r_buffer, size_t *r_length,
size_t maxlen);
assuan_error_t assuan_inquire_ext (assuan_context_t ctx, const char *keyword,
- unsigned char **r_buffer, size_t *r_length,
size_t maxlen,
- int (*cb) (void *cb_data, int rc),
+ int (*cb) (void *cb_data, int rc,
+ unsigned char *buf,
+ size_t buf_len),
void *cb_data);
/*-- assuan-buffer.c --*/
assuan_error_t assuan_read_line (assuan_context_t ctx,
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/libassuan.git
More information about the Pkg-gnupg-commit
mailing list