From 31e3a0ef5a0866477a3b54dc6ffbeb0aca4e0029 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 1 Feb 2005 14:37:47 +0000 Subject: [PATCH] Added member user for COMSTACK that is an opaque pointer for user-defined data. --- include/yaz/comstack.h | 3 ++- src/tcpip.c | 3 ++- src/unix.c | 9 +++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/yaz/comstack.h b/include/yaz/comstack.h index d03e987..e830c39 100644 --- a/include/yaz/comstack.h +++ b/include/yaz/comstack.h @@ -23,7 +23,7 @@ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * - * $Id: comstack.h,v 1.19 2005-01-16 21:51:49 adam Exp $ + * $Id: comstack.h,v 1.20 2005-02-01 14:37:47 adam Exp $ */ /** @@ -89,6 +89,7 @@ struct comstack char *(*f_addrstr)(COMSTACK handle); void *(*f_straddr)(COMSTACK handle, const char *str); int (*f_set_blocking)(COMSTACK handle, int blocking); + void *user; /* user defined data associated with COMSTACK */ }; #define cs_put(handle, buf, size) ((*(handle)->f_put)(handle, buf, size)) diff --git a/src/tcpip.c b/src/tcpip.c index f13b90b..97449bf 100644 --- a/src/tcpip.c +++ b/src/tcpip.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: tcpip.c,v 1.14 2005-01-16 21:51:50 adam Exp $ + * $Id: tcpip.c,v 1.15 2005-02-01 14:37:47 adam Exp $ */ /** * \file tcpip.c @@ -192,6 +192,7 @@ COMSTACK tcpip_type(int s, int blocking, int protocol, void *vp) p->event = CS_NONE; p->cerrno = 0; p->stackerr = 0; + p->user = 0; #if HAVE_OPENSSL_SSL_H sp->ctx = sp->ctx_alloc = 0; diff --git a/src/unix.c b/src/unix.c index 1d2b925..c67b724 100644 --- a/src/unix.c +++ b/src/unix.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2005, Index Data ApS * See the file LICENSE for details. * - * $Id: unix.c,v 1.10 2005-01-17 10:29:00 adam Exp $ + * $Id: unix.c,v 1.11 2005-02-01 14:37:47 adam Exp $ * UNIX socket COMSTACK. By Morten Bøgeskov. */ /** @@ -22,6 +22,9 @@ #if HAVE_UNISTD_H #include #endif +#if HAVE_SYS_SOCKET_H +#include +#endif #include #include @@ -30,9 +33,6 @@ #include #endif -#if HAVE_SYS_SOCKET_H -#include -#endif #if HAVE_SYS_STAT_H #include #endif @@ -152,6 +152,7 @@ COMSTACK unix_type(int s, int blocking, int protocol, void *vp) p->event = CS_NONE; p->cerrno = 0; p->stackerr = 0; + p->user = 0; state->altbuf = 0; state->altsize = state->altlen = 0; -- 1.7.10.4