~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
779.3.37 by Monty Taylor
Renmaed libdrizzle in the tree to libdrizzleclient to avoid namespace clashes
21
#ifndef LIBDRIZZLE_NET_SERV_H
22
#define LIBDRIZZLE_NET_SERV_H
23
24
25
#define net_new_transaction(net) ((net)->pkt_nr=0)
26
27
#include "vio.h"
575.4.7 by Monty Taylor
More header cleanup.
28
575.2.2 by Monty Taylor
Moved vio stuff into libdrizzle.
29
#include <stdint.h>
629.1.1 by Monty Taylor
More solaris fixes.
30
#if !defined(__cplusplus)
31
# include <stdbool.h>
32
#endif
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...
33
520.6.1 by Monty Taylor
Removed common.h from common_includes.h.
34
#define LIBDRIZZLE_ERRMSG_SIZE 512
35
#define LIBDRIZZLE_SQLSTATE_LENGTH 5
36
779.3.37 by Monty Taylor
Renmaed libdrizzle in the tree to libdrizzleclient to avoid namespace clashes
37
#ifdef __cplusplus
38
extern "C" {
39
#endif
40
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...
41
typedef struct st_net {
42
  Vio *vio;
43
  unsigned char *buff,*buff_end,*write_pos,*read_pos;
44
  int fd;					/* For Perl DBI/dbd */
45
  /*
46
    The following variable is set if we are doing several queries in one
47
    command ( as in LOAD TABLE ... FROM MASTER ),
48
    and do not want to confuse the client with OK at the wrong time
49
  */
50
  unsigned long remain_in_buf,length, buf_length, where_b;
51
  unsigned long max_packet,max_packet_size;
52
  unsigned int pkt_nr,compress_pkt_nr;
53
  unsigned int write_timeout;
54
  unsigned int read_timeout;
55
  unsigned int retry_count;
56
  int fcntl;
57
  unsigned int *return_status;
58
  unsigned char reading_or_writing;
59
  char save_char;
60
  bool compress;
61
  /*
62
    Pointer to query object in query cache, do not equal NULL (0) for
63
    queries in cache that have not stored its results yet
64
  */
65
  /*
66
    Unused, please remove with the next incompatible ABI change.
67
  */
68
  unsigned char *unused;
69
  unsigned int last_errno;
660.1.3 by Eric Herman
removed trailing whitespace with simple script:
70
  unsigned char error;
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...
71
  /** Client library error message buffer. Actually belongs to struct MYSQL. */
520.6.1 by Monty Taylor
Removed common.h from common_includes.h.
72
  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...
73
  /** Client library sqlstate buffer. Set along with the error message. */
520.6.1 by Monty Taylor
Removed common.h from common_includes.h.
74
  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...
75
  void *extension;
76
} NET;
77
78
  bool my_net_init(NET *net, Vio* vio);
79
  void my_net_local_init(NET *net);
80
  void net_end(NET *net);
81
  void net_clear(NET *net, bool clear_buffer);
82
  bool net_realloc(NET *net, size_t length);
83
  bool net_flush(NET *net);
84
  bool my_net_write(NET *net,const unsigned char *packet, size_t len);
85
  bool net_write_command(NET *net,unsigned char command,
86
                         const unsigned char *header, size_t head_len,
87
                         const unsigned char *packet, size_t len);
88
  int32_t net_real_write(NET *net,const unsigned char *packet, size_t len);
89
  uint32_t my_net_read(NET *net);
90
  void net_close(NET *net);
91
  bool net_init_sock(NET * net, int sock, int flags);
92
  bool net_peer_addr(NET *net, char *buf, uint16_t *port, size_t buflen);
93
  void net_keepalive(NET *net, bool flag);
94
  int net_get_sd(NET *net);
95
  bool net_should_close(NET *net);
96
  bool net_more_data(NET *net);
97
395 by Brian Aker
Fixed uint/ushort issue in libdrizzle
98
  void my_net_set_write_timeout(NET *net, uint32_t timeout);
99
  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...
100
  void net_clear_error(NET *net);
101
102
#ifdef __cplusplus
103
}
104
#endif
105
106
#endif