~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to vio/violite.h

  • Committer: Andy Lester
  • Date: 2008-08-09 05:13:22 UTC
  • mto: (266.1.29 use-replace-funcs)
  • mto: This revision was merged to the branch mainline in revision 287.
  • Revision ID: andy@petdance.com-20080809051322-dzas70no2mv6c9i5
removed incorrect comment

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef vio_violite_h_
22
22
#define vio_violite_h_
23
23
 
24
 
#include <sys/socket.h>
25
 
#include <errno.h>
26
 
 
27
24
/* Simple vio interface in C;  The functions are implemented in violite.c */
28
25
 
29
26
#ifdef  __cplusplus
41
38
#define VIO_BUFFERED_READ 2                     /* use buffered read */
42
39
#define VIO_READ_BUFFER_SIZE 16384              /* size of read buffer */
43
40
 
44
 
Vio*    vio_new(int sd, enum enum_vio_type type, unsigned int flags);
 
41
Vio*    vio_new(int sd, enum enum_vio_type type, uint flags);
45
42
 
46
43
void    vio_delete(Vio* vio);
47
44
int     vio_close(Vio* vio);
48
45
void    vio_reset(Vio* vio, enum enum_vio_type type, int sd, uint32_t flags);
49
 
size_t  vio_read(Vio *vio, unsigned char *      buf, size_t size);
50
 
size_t  vio_read_buff(Vio *vio, unsigned char * buf, size_t size);
51
 
size_t  vio_write(Vio *vio, const unsigned char * buf, size_t size);
 
46
size_t  vio_read(Vio *vio, uchar *      buf, size_t size);
 
47
size_t  vio_read_buff(Vio *vio, uchar * buf, size_t size);
 
48
size_t  vio_write(Vio *vio, const uchar * buf, size_t size);
52
49
int     vio_blocking(Vio *vio, bool onoff, bool *old_mode);
53
50
bool    vio_is_blocking(Vio *vio);
54
51
/* setsockopt TCP_NODELAY at IPPROTO_TCP level, when possible */
70
67
/* Remote peer's address and name in text form */
71
68
bool vio_peer_addr(Vio *vio, char *buf, uint16_t *port, size_t buflen);
72
69
bool vio_poll_read(Vio *vio, int timeout);
73
 
bool vio_peek_read(Vio *vio, unsigned int *bytes);
 
70
bool vio_peek_read(Vio *vio, uint *bytes);
74
71
 
75
72
void vio_end(void);
76
73
 
124
121
  /* function pointers. They are similar for socket/SSL/whatever */
125
122
  void    (*viodelete)(Vio*);
126
123
  int32_t     (*vioerrno)(Vio*);
127
 
  size_t  (*read)(Vio*, unsigned char *, size_t);
128
 
  size_t  (*write)(Vio*, const unsigned char *, size_t);
 
124
  size_t  (*read)(Vio*, uchar *, size_t);
 
125
  size_t  (*write)(Vio*, const uchar *, size_t);
129
126
  int32_t     (*vioblocking)(Vio*, bool, bool *);
130
127
  bool (*is_blocking)(Vio*);
131
128
  int32_t     (*viokeepalive)(Vio*, bool);