Added member user for COMSTACK that is an opaque pointer for
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 1 Feb 2005 14:37:47 +0000 (14:37 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 1 Feb 2005 14:37:47 +0000 (14:37 +0000)
user-defined data.

include/yaz/comstack.h
src/tcpip.c
src/unix.c

index d03e987..e830c39 100644 (file)
@@ -23,7 +23,7 @@
  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  * OF THIS SOFTWARE.
  *
  * 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);
     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))
 };
 
 #define cs_put(handle, buf, size) ((*(handle)->f_put)(handle, buf, size))
index f13b90b..97449bf 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2005, Index Data ApS
  * See the file LICENSE for details.
  *
  * 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
  */
 /**
  * \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->event = CS_NONE;
     p->cerrno = 0;
     p->stackerr = 0;
+    p->user = 0;
 
 #if HAVE_OPENSSL_SSL_H
     sp->ctx = sp->ctx_alloc = 0;
 
 #if HAVE_OPENSSL_SSL_H
     sp->ctx = sp->ctx_alloc = 0;
index 1d2b925..c67b724 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-2005, Index Data ApS
  * See the file LICENSE for details.
  *
  * 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.
  */
 /**
  * UNIX socket COMSTACK. By Morten Bøgeskov.
  */
 /**
@@ -22,6 +22,9 @@
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#if HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
 #include <fcntl.h>
 #include <signal.h>
 
 #include <fcntl.h>
 #include <signal.h>
 
@@ -30,9 +33,6 @@
 #include <pwd.h>
 #endif
 
 #include <pwd.h>
 #endif
 
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
 #if HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
 #if HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #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->event = CS_NONE;
     p->cerrno = 0;
     p->stackerr = 0;
+    p->user = 0;
 
     state->altbuf = 0;
     state->altsize = state->altlen = 0;
 
     state->altbuf = 0;
     state->altsize = state->altlen = 0;