~drizzle-trunk/drizzle/development

390.1.6 by Monty Taylor
Oh dear god the changes. The changes. I'd tell you what they are, but I'd just be making stuff up. Suffice it to day it's mostly all around splitting files in libdrizzle into different files and removing interdepends. And whatever else I happened to see...
1
/* - mode: c; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
4
 *  Copyright (C) 2008 Sun Microsystems, Inc.
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; version 2 of the License.
9
 *
10
 *  This program is distributed in the hope that it will be useful,
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 *  GNU General Public License for more details.
14
 *
15
 *  You should have received a copy of the GNU General Public License
16
 *  along with this program; if not, write to the Free Software
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 */
19
20
21
#ifndef _libdrizzle_net_serv_h_
22
#define _libdrizzle_net_serv_h_
23
575.2.2 by Monty Taylor
Moved vio stuff into libdrizzle.
24
#ifdef __cplusplus
25
extern "C" {
575.4.7 by Monty Taylor
More header cleanup.
26
#endif
27
575.2.2 by Monty Taylor
Moved vio stuff into libdrizzle.
28
#include <stdint.h>
29
#include <stdbool.h>
390.1.6 by Monty Taylor
Oh dear god the changes. The changes. I'd tell you what they are, but I'd just be making stuff up. Suffice it to day it's mostly all around splitting files in libdrizzle into different files and removing interdepends. And whatever else I happened to see...
30
31
#define net_new_transaction(net) ((net)->pkt_nr=0)
32
575.2.2 by Monty Taylor
Moved vio stuff into libdrizzle.
33
#include <libdrizzle/vio.h>
390.1.6 by Monty Taylor
Oh dear god the changes. The changes. I'd tell you what they are, but I'd just be making stuff up. Suffice it to day it's mostly all around splitting files in libdrizzle into different files and removing interdepends. And whatever else I happened to see...
34
520.6.1 by Monty Taylor
Removed common.h from common_includes.h.
35
#define LIBDRIZZLE_ERRMSG_SIZE 512
36
#define LIBDRIZZLE_SQLSTATE_LENGTH 5
37
390.1.6 by Monty Taylor
Oh dear god the changes. The changes. I'd tell you what they are, but I'd just be making stuff up. Suffice it to day it's mostly all around splitting files in libdrizzle into different files and removing interdepends. And whatever else I happened to see...
38
typedef struct st_net {
39
  Vio *vio;
40
  unsigned char *buff,*buff_end,*write_pos,*read_pos;
41
  int fd;					/* For Perl DBI/dbd */
42
  /*
43
    The following variable is set if we are doing several queries in one
44
    command ( as in LOAD TABLE ... FROM MASTER ),
45
    and do not want to confuse the client with OK at the wrong time
46
  */
47
  unsigned long remain_in_buf,length, buf_length, where_b;
48
  unsigned long max_packet,max_packet_size;
49
  unsigned int pkt_nr,compress_pkt_nr;
50
  unsigned int write_timeout;
51
  unsigned int read_timeout;
52
  unsigned int retry_count;
53
  int fcntl;
54
  unsigned int *return_status;
55
  unsigned char reading_or_writing;
56
  char save_char;
57
  bool compress;
58
  /*
59
    Pointer to query object in query cache, do not equal NULL (0) for
60
    queries in cache that have not stored its results yet
61
  */
62
  /*
63
    Unused, please remove with the next incompatible ABI change.
64
  */
65
  unsigned char *unused;
66
  unsigned int last_errno;
67
  unsigned char error; 
68
  /** Client library error message buffer. Actually belongs to struct MYSQL. */
520.6.1 by Monty Taylor
Removed common.h from common_includes.h.
69
  char last_error[LIBDRIZZLE_ERRMSG_SIZE];
390.1.6 by Monty Taylor
Oh dear god the changes. The changes. I'd tell you what they are, but I'd just be making stuff up. Suffice it to day it's mostly all around splitting files in libdrizzle into different files and removing interdepends. And whatever else I happened to see...
70
  /** Client library sqlstate buffer. Set along with the error message. */
520.6.1 by Monty Taylor
Removed common.h from common_includes.h.
71
  char sqlstate[LIBDRIZZLE_SQLSTATE_LENGTH+1];
390.1.6 by Monty Taylor
Oh dear god the changes. The changes. I'd tell you what they are, but I'd just be making stuff up. Suffice it to day it's mostly all around splitting files in libdrizzle into different files and removing interdepends. And whatever else I happened to see...
72
  void *extension;
73
} NET;
74
75
  bool my_net_init(NET *net, Vio* vio);
76
  void my_net_local_init(NET *net);
77
  void net_end(NET *net);
78
  void net_clear(NET *net, bool clear_buffer);
79
  bool net_realloc(NET *net, size_t length);
80
  bool net_flush(NET *net);
81
  bool my_net_write(NET *net,const unsigned char *packet, size_t len);
82
  bool 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 net_real_write(NET *net,const unsigned char *packet, size_t len);
86
  uint32_t my_net_read(NET *net);
87
  void net_close(NET *net);
88
  bool net_init_sock(NET * net, int sock, int flags);
89
  bool net_peer_addr(NET *net, char *buf, uint16_t *port, size_t buflen);
90
  void net_keepalive(NET *net, bool flag);
91
  int net_get_sd(NET *net);
92
  bool net_should_close(NET *net);
93
  bool net_more_data(NET *net);
94
395 by Brian Aker
Fixed uint/ushort issue in libdrizzle
95
  void my_net_set_write_timeout(NET *net, uint32_t timeout);
96
  void my_net_set_read_timeout(NET *net, uint32_t timeout);
390.1.6 by Monty Taylor
Oh dear god the changes. The changes. I'd tell you what they are, but I'd just be making stuff up. Suffice it to day it's mostly all around splitting files in libdrizzle into different files and removing interdepends. And whatever else I happened to see...
97
  void net_clear_error(NET *net);
98
99
#ifdef __cplusplus
100
}
101
#endif
102
103
#endif