~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/net_serv.h

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

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
23
 
 
24
 
#include "vio.h"
25
 
 
26
 
#include <stdint.h>
27
 
 
28
 
namespace drizzle_protocol
29
 
{
30
 
 
31
 
#define LIBDRIZZLE_ERRMSG_SIZE 512
32
 
#define LIBDRIZZLE_SQLSTATE_LENGTH 5
 
21
#ifndef _libdrizzle_net_serv_h_
 
22
#define _libdrizzle_net_serv_h_
 
23
 
 
24
#include <vio/violite.h>
 
25
 
 
26
#define net_new_transaction(net) ((net)->pkt_nr=0)
 
27
 
 
28
#ifdef __cplusplus
 
29
extern "C" {
 
30
#endif
33
31
 
34
32
typedef struct st_net {
35
33
  Vio *vio;
60
58
  */
61
59
  unsigned char *unused;
62
60
  unsigned int last_errno;
63
 
  unsigned char error;
 
61
  unsigned char error; 
64
62
  /** Client library error message buffer. Actually belongs to struct MYSQL. */
65
 
  char last_error[LIBDRIZZLE_ERRMSG_SIZE];
 
63
  char last_error[DRIZZLE_ERRMSG_SIZE];
66
64
  /** Client library sqlstate buffer. Set along with the error message. */
67
 
  char sqlstate[LIBDRIZZLE_SQLSTATE_LENGTH+1];
 
65
  char sqlstate[SQLSTATE_LENGTH+1];
68
66
  void *extension;
69
67
} NET;
70
68
 
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 */
 
69
  bool my_net_init(NET *net, Vio* vio);
 
70
  void my_net_local_init(NET *net);
 
71
  void net_end(NET *net);
 
72
  void net_clear(NET *net, bool clear_buffer);
 
73
  bool net_realloc(NET *net, size_t length);
 
74
  bool net_flush(NET *net);
 
75
  bool my_net_write(NET *net,const unsigned char *packet, size_t len);
 
76
  bool 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
  int32_t net_real_write(NET *net,const unsigned char *packet, size_t len);
 
80
  uint32_t my_net_read(NET *net);
 
81
  void net_close(NET *net);
 
82
  bool net_init_sock(NET * net, int sock, int flags);
 
83
  bool net_peer_addr(NET *net, char *buf, uint16_t *port, size_t buflen);
 
84
  void net_keepalive(NET *net, bool flag);
 
85
  int net_get_sd(NET *net);
 
86
  bool net_should_close(NET *net);
 
87
  bool net_more_data(NET *net);
 
88
 
 
89
  void my_net_set_write_timeout(NET *net, uint32_t timeout);
 
90
  void my_net_set_read_timeout(NET *net, uint32_t timeout);
 
91
  void net_clear_error(NET *net);
 
92
 
 
93
#ifdef __cplusplus
 
94
}
 
95
#endif
 
96
 
 
97
#endif