ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro-Mysql/violite.h
(Generate patch)

Comparing Coro-Mysql/violite.h (file contents):
Revision 1.1 by root, Mon May 18 15:19:38 2009 UTC vs.
Revision 1.2 by root, Tue Aug 31 14:42:29 2010 UTC

1/* adapted from violite.h from mysql 5.0.51 *( 1/* adapted from violite.h from mysql 5.0.51 */
2/* all modifications public domain */ 2/* all modifications public domain */
3/* Copyright (C) 2000 MySQL AB 3/* Copyright (C) 2000 MySQL AB
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
26/* Simple vio interface in C; The functions are implemented in violite.c */ 26/* Simple vio interface in C; The functions are implemented in violite.c */
27 27
28#ifdef __cplusplus 28#ifdef __cplusplus
29extern "C" { 29extern "C" {
30#endif /* __cplusplus */ 30#endif /* __cplusplus */
31
32typedef char *xgptr;
31 33
32enum enum_vio_type 34enum enum_vio_type
33{ 35{
34 VIO_CLOSED, VIO_TYPE_TCPIP, VIO_TYPE_SOCKET, VIO_TYPE_NAMEDPIPE, 36 VIO_CLOSED, VIO_TYPE_TCPIP, VIO_TYPE_SOCKET, VIO_TYPE_NAMEDPIPE,
35 VIO_TYPE_SSL, VIO_TYPE_SHARED_MEMORY 37 VIO_TYPE_SSL, VIO_TYPE_SHARED_MEMORY
48 HANDLE event_server_wrote, 50 HANDLE event_server_wrote,
49 HANDLE event_server_read, 51 HANDLE event_server_read,
50 HANDLE event_client_wrote, 52 HANDLE event_client_wrote,
51 HANDLE event_client_read, 53 HANDLE event_client_read,
52 HANDLE event_conn_closed); 54 HANDLE event_conn_closed);
53int vio_read_pipe(Vio *vio, gptr buf, int size); 55int vio_read_pipe(Vio *vio, xgptr buf, int size);
54int vio_write_pipe(Vio *vio, const gptr buf, int size); 56int vio_write_pipe(Vio *vio, const xgptr buf, int size);
55int vio_close_pipe(Vio * vio); 57int vio_close_pipe(Vio * vio);
56#else 58#else
57#define HANDLE void * 59#define HANDLE void *
58#endif /* __WIN__ */ 60#endif /* __WIN__ */
59 61
60void vio_delete(Vio* vio); 62void vio_delete(Vio* vio);
61int vio_close(Vio* vio); 63int vio_close(Vio* vio);
62void vio_reset(Vio* vio, enum enum_vio_type type, 64void vio_reset(Vio* vio, enum enum_vio_type type,
63 my_socket sd, HANDLE hPipe, uint flags); 65 my_socket sd, HANDLE hPipe, uint flags);
64int vio_read(Vio *vio, gptr buf, int size); 66int vio_read(Vio *vio, xgptr buf, int size);
65int vio_read_buff(Vio *vio, gptr buf, int size); 67int vio_read_buff(Vio *vio, xgptr buf, int size);
66int vio_write(Vio *vio, const gptr buf, int size); 68int vio_write(Vio *vio, const xgptr buf, int size);
67int vio_blocking(Vio *vio, my_bool onoff, my_bool *old_mode); 69int vio_blocking(Vio *vio, my_bool onoff, my_bool *old_mode);
68my_bool vio_is_blocking(Vio *vio); 70my_bool vio_is_blocking(Vio *vio);
69/* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible */ 71/* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible */
70int vio_fastsend(Vio *vio); 72int vio_fastsend(Vio *vio);
71/* setsockopt SO_KEEPALIVE at SOL_SOCKET level, when possible */ 73/* setsockopt SO_KEEPALIVE at SOL_SOCKET level, when possible */
125 const char *ca_file,const char *ca_path, 127 const char *ca_file,const char *ca_path,
126 const char *cipher); 128 const char *cipher);
127#endif /* HAVE_OPENSSL */ 129#endif /* HAVE_OPENSSL */
128 130
129#ifdef HAVE_SMEM 131#ifdef HAVE_SMEM
130int vio_read_shared_memory(Vio *vio, gptr buf, int size); 132int vio_read_shared_memory(Vio *vio, xgptr buf, int size);
131int vio_write_shared_memory(Vio *vio, const gptr buf, int size); 133int vio_write_shared_memory(Vio *vio, const xgptr buf, int size);
132int vio_close_shared_memory(Vio * vio); 134int vio_close_shared_memory(Vio * vio);
133#endif 135#endif
134 136
135void vio_end(void); 137void vio_end(void);
136 138
184 read buffer */ 186 read buffer */
185 char *read_end; /* end of unfetched data */ 187 char *read_end; /* end of unfetched data */
186 /* function pointers. They are similar for socket/SSL/whatever */ 188 /* function pointers. They are similar for socket/SSL/whatever */
187 void (*viodelete)(Vio*); 189 void (*viodelete)(Vio*);
188 int (*vioerrno)(Vio*); 190 int (*vioerrno)(Vio*);
189 int (*read)(Vio*, gptr, int); 191 int (*read)(Vio*, xgptr, int);
190 int (*write)(Vio*, const gptr, int); 192 int (*write)(Vio*, const xgptr, int);
191 int (*vioblocking)(Vio*, my_bool, my_bool *); 193 int (*vioblocking)(Vio*, my_bool, my_bool *);
192 my_bool (*is_blocking)(Vio*); 194 my_bool (*is_blocking)(Vio*);
193 int (*viokeepalive)(Vio*, my_bool); 195 int (*viokeepalive)(Vio*, my_bool);
194 int (*fastsend)(Vio*); 196 int (*fastsend)(Vio*);
195 my_bool (*peer_addr)(Vio*, char *, uint16*); 197 my_bool (*peer_addr)(Vio*, char *, uint16*);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines