aboutsummaryrefslogtreecommitdiffstats
path: root/src/assuan-defs.h
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2007-08-09 10:44:02 +0000
committerMarcus Brinkmann <[email protected]>2007-08-09 10:44:02 +0000
commit0571557e17f9b18446b2f23c697e21987f6fec6e (patch)
tree02ab19ff204dccc9767f4652d8c3867f0340d9c6 /src/assuan-defs.h
parentBetter error code mapping. (diff)
downloadlibassuan-0571557e17f9b18446b2f23c697e21987f6fec6e.tar.gz
libassuan-0571557e17f9b18446b2f23c697e21987f6fec6e.zip
doc/
2007-08-09 Marcus Brinkmann <[email protected]> * assuan.texi (External I/O Loop): New chapter. src/ 2007-08-09 Marcus Brinkmann <[email protected]> * assuan.h (assuan_process_done, assuan_inquire_ext): New prototypes. * assuan-defs.h (struct assuan_context_s): New members in_process_next, in_command, inquire_cb, inquire_cb_data, inquire_r_buffer, inquire_r_buffer_len, inquire_membuf. (_assuan_inquire_ext_cb, _assuan_inquire_release): New prototypes. * assuan-handler.c (PROCESS_DONE): New macro. (dummy_handler, std_handler_nop, std_handler_cancel) (std_handler_option, std_handler_bye, std_handler_auth) (std_handler_reset, std_handler_end): Use PROCESS_DONE to optionally call assuan_process_done if CTX->in_process_next is true. (assuan_process_done, process_next): New functions. (assuan_process_next): Rewritten to support external event handling. * mkerrors: Do not clear high bits of -1 for old style EOF. * assuan-inquire.c (_assuan_inquire_release) (_assuan_inquire_ext_cb, assuan_inquire_ext): New functions. * assuan-pipe-server.c (_assuan_release_context): Call _assuan_inquire_release.
Diffstat (limited to 'src/assuan-defs.h')
-rw-r--r--src/assuan-defs.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/assuan-defs.h b/src/assuan-defs.h
index d1037c8..52b0d8b 100644
--- a/src/assuan-defs.h
+++ b/src/assuan-defs.h
@@ -103,6 +103,16 @@ struct assuan_context_s
int confidential;
int is_server; /* Set if this is context belongs to a server */
int in_inquire;
+ int in_process_next;
+ int in_command;
+
+ /* The following members are used by assuan_inquire_ext. */
+ int (*inquire_cb) (void *cb_data, int rc);
+ void *inquire_cb_data;
+ unsigned char **inquire_r_buffer;
+ size_t *inquire_r_buffer_len;
+ void *inquire_membuf;
+
char *hello_line;
char *okay_line; /* See assuan_set_okay_line() */
@@ -229,17 +239,20 @@ assuan_error_t _assuan_read_from_server (assuan_context_t ctx,
/*-- assuan-error.c --*/
+/*-- assuan-inquire.c --*/
+int _assuan_inquire_ext_cb (assuan_context_t ctx);
+void _assuan_inquire_release (assuan_context_t ctx);
-/* Map error codes as used in this implementaion to the libgpg-error
+/* Map error codes as used in this implementation to the libgpg-error
codes. */
assuan_error_t _assuan_error (int oldcode);
-/* Extrac the erro code from A. This works for both the old and the
- new style error codes. This needs to be whenever an error code is
- compared. */
+/* Extract the error code from A. This works for both the old and the
+ new style error codes. This needs to be used whenever an error
+ code is compared. */
#define err_code(a) ((a) & 0x00ffffff)
-/* Check whether A is the erro code for EOF. We allow forold and new
+/* Check whether A is the erro code for EOF. We allow for old and new
style EOF error codes here. */
#define err_is_eof(a) ((a) == (-1) || err_code (a) == 16383)