</para>
<synopsis>
- int cs_close(COMSTACK handle);
+ void cs_close(COMSTACK handle);
</synopsis>
<para>
</para>
<synopsis>
- char *cs_addrstr(COMSTACK);
+ const char *cs_addrstr(COMSTACK);
</synopsis>
<para>
</para>
<synopsis>
- char *cs_addrstr(COMSTACK h);
+ const char *cs_addrstr(COMSTACK h);
</synopsis>
<para>
</sect1>
<sect1 id="comstack.summary"><title>Summary and Synopsis</title>
- <synopsis>
- #include <yaz/comstack.h>
+ <synopsis><![CDATA[
+ #include <yaz/comstack.h>
- #include <yaz/tcpip.h> /* this is for TCP/IP and SSL support */
- #include <yaz/unix.h> /* this is for UNIX sockeL support */
+ #include <yaz/tcpip.h> /* this is for TCP/IP and SSL support */
+ #include <yaz/unix.h> /* this is for UNIX socket support */
-
COMSTACK cs_create(CS_TYPE type, int blocking, int protocol);
COMSTACK cs_createbysocket(int s, CS_TYPE type, int blocking,
int protocol);
- COMSTACK cs_create_host (const char *str, int blocking,
- void **vp);
+ COMSTACK cs_create_host(const char *str, int blocking,
+ void **vp);
int cs_bind(COMSTACK handle, int mode);
int cs_more(COMSTACK handle);
- int cs_close(COMSTACK handle);
+ void cs_close(COMSTACK handle);
int cs_look(COMSTACK handle);
void *cs_straddr(COMSTACK handle, const char *str);
- char *cs_addrstr(COMSTACK h);
-
- extern int cs_errno;
-
- void cs_perror(COMSTACK handle char *message);
-
- const char *cs_stackerr(COMSTACK handle);
-
- extern const char *cs_errlist[];
+ const char *cs_addrstr(COMSTACK h);
+]]>
</synopsis>
</sect1>
{
CS_TYPE type;
int cerrno; /* current error code of this stack */
- char *stackerr;/* current lower-layer error string, or null if none */
int iofile; /* UNIX file descriptor for iochannel */
int timeout; /* how long to wait for trailing blocks (ignored for now) */
void *cprivate;/* state info for lower stack */
int (*check_ip)(void *cd, const char *a, int len, int type),
void *cd);
COMSTACK (*f_accept)(COMSTACK handle);
- int (*f_close)(COMSTACK handle);
- char *(*f_addrstr)(COMSTACK handle);
+ void (*f_close)(COMSTACK handle);
+ const 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 */
((*type)(sock, blocking, proto, 0))
#define cs_type(handle) ((handle)->type)
#define cs_fileno(handle) ((handle)->iofile)
-#define cs_stackerr(handle) ((handle)->stackerr)
#define cs_getstate(handle) ((handle)->getstate)
#define cs_errno(handle) ((handle)->cerrno)
#define cs_getproto(handle) ((handle)->protocol)
static void *new_session(void *vp)
{
- char *a;
+ const char *a;
association *newas;
IOCHAN new_chan;
COMSTACK new_line = (COMSTACK) vp;
COMSTACK line;
IOCHAN chan;
association *assoc;
- char *addr;
+ const char *addr;
if ((line = cs_createbysocket(0, tcpip_type, 0, what)))
{
#include <yaz/tcpip.h>
#include <yaz/errno.h>
-static int tcpip_close(COMSTACK h);
+static void tcpip_close(COMSTACK h);
static int tcpip_put(COMSTACK h, char *buf, int size);
static int tcpip_get(COMSTACK h, char **buf, int *bufsize);
static int tcpip_put_connect(COMSTACK h, char *buf, int size);
#endif
static COMSTACK tcpip_accept(COMSTACK h);
-static char *tcpip_addrstr(COMSTACK h);
+static const char *tcpip_addrstr(COMSTACK h);
static void *tcpip_straddr(COMSTACK h, const char *str);
#if 0
p->state = s < 0 ? CS_ST_UNBND : CS_ST_IDLE; /* state of line */
p->event = CS_NONE;
p->cerrno = 0;
- p->stackerr = 0;
p->user = 0;
#if HAVE_GNUTLS_H
}
#endif
-int tcpip_close(COMSTACK h)
+void tcpip_close(COMSTACK h)
{
tcpip_state *sp = (struct tcpip_state *)h->cprivate;
xfree(sp->connect_response_buf);
xfree(sp);
xfree(h);
- return 0;
}
-char *tcpip_addrstr(COMSTACK h)
+const char *tcpip_addrstr(COMSTACK h)
{
tcpip_state *sp = (struct tcpip_state *)h->cprivate;
char *r = 0, *buf = sp->buf;
#endif
#endif
-static int unix_close(COMSTACK h);
+static void unix_close(COMSTACK h);
static int unix_put(COMSTACK h, char *buf, int size);
static int unix_get(COMSTACK h, char **buf, int *bufsize);
static int unix_connect(COMSTACK h, void *address);
static int unix_set_blocking(COMSTACK p, int blocking);
static COMSTACK unix_accept(COMSTACK h);
-static char *unix_addrstr(COMSTACK h);
+static const char *unix_addrstr(COMSTACK h);
static void *unix_straddr(COMSTACK h, const char *str);
#ifndef SUN_LEN
p->state = new_socket ? CS_ST_UNBND : CS_ST_IDLE; /* state of line */
p->event = CS_NONE;
p->cerrno = 0;
- p->stackerr = 0;
p->user = 0;
state->altbuf = 0;
return 0;
}
-static int unix_close(COMSTACK h)
+static void unix_close(COMSTACK h)
{
unix_state *sp = (struct unix_state *)h->cprivate;
xfree(sp->altbuf);
xfree(sp);
xfree(h);
- return 0;
}
-static char *unix_addrstr(COMSTACK h)
+static const char *unix_addrstr(COMSTACK h)
{
unix_state *sp = (struct unix_state *)h->cprivate;
char *buf = sp->buf;