From 9815596f64265cd4f87e2df374de23f54c26985e Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 22 Nov 2006 13:29:47 +0000 Subject: Again one of these last commits --- src/ChangeLog | 2 +- src/assuan-handler.c | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 98b0f81..9767e15 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,6 @@ 2006-11-22 Werner Koch - * assuan-handler.c (fun_cookie_write): New. + * assuan-handler.c (fun1_cookie_write, fun2_cookie_write): New. (assuan_get_data_fp) [HAVE_FUNOPEN]: Use it. 2006-11-21 Werner Koch diff --git a/src/assuan-handler.c b/src/assuan-handler.c index 44b655f..866db22 100644 --- a/src/assuan-handler.c +++ b/src/assuan-handler.c @@ -653,15 +653,21 @@ assuan_get_active_fds (assuan_context_t ctx, int what, } -/* funopen uses a different prototype for the write fucntions. We use - this wrapper here to fix it. */ +/* Two simple wrappers to make the expected function types match. */ #ifdef HAVE_FUNOPEN static int -fun_cookie_write (void *cookie, const char *buffer, int orig_size) +fun1_cookie_write (void *cookie, const char *buffer, int orig_size) { return _assuan_cookie_write_data (cookie, buffer, orig_size); } #endif /*HAVE_FUNOPEN*/ +#ifdef HAVE_FOPENCOOKIE +static ssize_t +fun2_cookie_write (void *cookie, const char *buffer, size_t orig_size) +{ + return _assuan_cookie_write_data (cookie, buffer, orig_size); +} +#endif /*HAVE_FOPENCOOKIE*/ /* Return a FP to be used for data output. The FILE pointer is valid until the end of a handler. So a close is not needed. Assuan does @@ -679,10 +685,10 @@ assuan_get_data_fp (assuan_context_t ctx) return ctx->outbound.data.fp; #ifdef HAVE_FUNOPEN - ctx->outbound.data.fp = funopen (ctx, 0, fun_cookie_write, + ctx->outbound.data.fp = funopen (ctx, 0, fun1_cookie_write, 0, _assuan_cookie_write_flush); #else - ctx->outbound.data.fp = funopen (ctx, 0, _assuan_cookie_write_data, + ctx->outbound.data.fp = funopen (ctx, 0, fun2_cookie_write, 0, _assuan_cookie_write_flush); #endif -- cgit v1.2.3