aboutsummaryrefslogtreecommitdiffstats
path: root/src/assuan-util.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2002-05-23 09:07:12 +0000
committerWerner Koch <[email protected]>2002-05-23 09:07:12 +0000
commit1e45cc2fb3618cdfcb0b790d563201c6ecb16334 (patch)
treee2f48bc1bb2ddcf26da429393e6483f40d3ceccc /src/assuan-util.c
parent* assuan-buffer.c (my_log_prefix): New. Use it for all i/o debug output. (diff)
downloadlibassuan-1e45cc2fb3618cdfcb0b790d563201c6ecb16334.tar.gz
libassuan-1e45cc2fb3618cdfcb0b790d563201c6ecb16334.zip
* assuan-util.c (assuan_set_io_func): New.V0-3-8V0-3-7NEWPG-0-3-8NEWPG-0-3-7
* assuan-buffer.c (writen, readline): Use the new functions instead of pth. * assuan-socket-server.c (accept_connection): Don't use the pth_accept - using the assuan included accept code would be a bad idea within Pth so we don't need a replacement function.
Diffstat (limited to 'src/assuan-util.c')
-rw-r--r--src/assuan-util.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/assuan-util.c b/src/assuan-util.c
index 4153ef8..15b9fe5 100644
--- a/src/assuan-util.c
+++ b/src/assuan-util.c
@@ -29,6 +29,9 @@
#include "../jnlib/logging.h"
#endif
+ssize_t (*_assuan_read_wrapper)(int,void*,size_t) = NULL;
+ssize_t (*_assuan_write_wrapper)(int,const void*,size_t) = NULL;
+
static void *(*alloc_func)(size_t n) = malloc;
static void *(*realloc_func)(void *p, size_t n) = realloc;
@@ -74,6 +77,17 @@ _assuan_free (void *p)
free_func (p);
}
+/* For use with Pth it is required to have special read and write
+ functions. We can't assume an ELF based system so we have to
+ explicitly set them if we are going to use Pth. */
+void
+assuan_set_io_func (ssize_t (*r)(int,void*,size_t),
+ ssize_t (*w)(int,const void*,size_t))
+{
+ _assuan_read_wrapper = r;
+ _assuan_write_wrapper = w;
+}
+
/* Store the error in the context so that the error sending function