~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzleclient/net_serv.h

Moved the last of the libdrizzleclient calls into Protocol.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
 
21
 
#ifndef PLUGIN_DRIZZLE_PROTOCOL_NET_SERV_H
22
 
#define PLUGIN_DRIZZLE_PROTOCOL_NET_SERV_H
 
21
#ifndef LIBDRIZZLE_NET_SERV_H
 
22
#define LIBDRIZZLE_NET_SERV_H
 
23
 
 
24
 
 
25
#define net_new_transaction(net) ((net)->pkt_nr=0)
23
26
 
24
27
#include "vio.h"
25
28
 
26
29
#include <stdint.h>
27
30
 
28
 
namespace drizzle_protocol
29
 
{
30
 
 
31
31
#define LIBDRIZZLE_ERRMSG_SIZE 512
32
32
#define LIBDRIZZLE_SQLSTATE_LENGTH 5
33
33
 
 
34
#ifdef __cplusplus
 
35
extern "C" {
 
36
#endif
 
37
 
34
38
typedef struct st_net {
35
39
  Vio *vio;
36
40
  unsigned char *buff,*buff_end,*write_pos,*read_pos;
68
72
  void *extension;
69
73
} NET;
70
74
 
71
 
bool drizzleclient_net_init(NET *net, Vio* vio, uint32_t buffer_length);
72
 
void drizzleclient_net_end(NET *net);
73
 
void drizzleclient_net_clear(NET *net, bool clear_buffer);
74
 
bool drizzleclient_net_flush(NET *net);
75
 
bool drizzleclient_net_write(NET *net,const unsigned char *packet, size_t len);
76
 
bool drizzleclient_net_write_command(NET *net,unsigned char command,
77
 
                                     const unsigned char *header, size_t head_len,
78
 
                                     const unsigned char *packet, size_t len);
79
 
uint32_t drizzleclient_net_read(NET *net);
80
 
void drizzleclient_net_close(NET *net);
81
 
bool drizzleclient_net_init_sock(NET * net, int sock, int flags,
82
 
                                 uint32_t buffer_length);
83
 
bool drizzleclient_net_peer_addr(NET *net, char *buf, uint16_t *port, size_t buflen);
84
 
void drizzleclient_net_keepalive(NET *net, bool flag);
85
 
int drizzleclient_net_get_sd(NET *net);
86
 
bool drizzleclient_net_more_data(NET *net);
87
 
 
88
 
void drizzleclient_net_set_write_timeout(NET *net, uint32_t timeout);
89
 
void drizzleclient_net_set_read_timeout(NET *net, uint32_t timeout);
90
 
void drizzleclient_drizzleclient_net_clear_error(NET *net);
91
 
 
92
 
} /* namespace drizzle_protocol */
93
 
 
94
 
#endif /* PLUGIN_DRIZZLE_PROTOCOL_NET_SERV_H */
 
75
  bool drizzleclient_net_init(NET *net, Vio* vio);
 
76
  void drizzleclient_net_local_init(NET *net);
 
77
  void drizzleclient_net_end(NET *net);
 
78
  void drizzleclient_net_clear(NET *net, bool clear_buffer);
 
79
  bool drizzleclient_net_realloc(NET *net, size_t length);
 
80
  bool drizzleclient_net_flush(NET *net);
 
81
  bool drizzleclient_net_write(NET *net,const unsigned char *packet, size_t len);
 
82
  bool drizzleclient_net_write_command(NET *net,unsigned char command,
 
83
                         const unsigned char *header, size_t head_len,
 
84
                         const unsigned char *packet, size_t len);
 
85
  int32_t drizzleclient_net_real_write(NET *net,const unsigned char *packet, size_t len);
 
86
  uint32_t drizzleclient_net_read(NET *net);
 
87
  void drizzleclient_net_close(NET *net);
 
88
  bool drizzleclient_net_init_sock(NET * net, int sock, int flags);
 
89
  bool drizzleclient_net_peer_addr(NET *net, char *buf, uint16_t *port, size_t buflen);
 
90
  void drizzleclient_net_keepalive(NET *net, bool flag);
 
91
  int drizzleclient_net_get_sd(NET *net);
 
92
  bool drizzleclient_net_should_close(NET *net);
 
93
  bool drizzleclient_net_more_data(NET *net);
 
94
 
 
95
  void drizzleclient_net_set_write_timeout(NET *net, uint32_t timeout);
 
96
  void drizzleclient_net_set_read_timeout(NET *net, uint32_t timeout);
 
97
  void drizzleclient_drizzleclient_net_clear_error(NET *net);
 
98
 
 
99
#ifdef __cplusplus
 
100
}
 
101
#endif
 
102
 
 
103
#endif