libdrizzle Developer Documentation
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
libdrizzle
structs.h
Go to the documentation of this file.
1
/*
2
* Drizzle Client & Protocol Library
3
*
4
* Copyright (C) 2008 Eric Day (eday@oddments.org)
5
* All rights reserved.
6
*
7
* Use and distribution licensed under the BSD license. See
8
* the COPYING file in this directory for full text.
9
*/
10
16
#ifndef __DRIZZLE_STRUCTS_H
17
#define __DRIZZLE_STRUCTS_H
18
19
#ifdef __cplusplus
20
extern
"C"
{
21
#endif
22
26
struct
drizzle_st
27
{
28
uint16_t
error_code
;
29
drizzle_options_t
options
;
30
drizzle_verbose_t
verbose
;
31
uint32_t
con_count
;
32
uint32_t
pfds_size
;
33
uint32_t
query_count
;
34
uint32_t
query_new
;
35
uint32_t
query_running
;
36
int
last_errno
;
37
int
timeout
;
38
drizzle_con_st
*
con_list
;
39
void
*
context
;
40
drizzle_context_free_fn
*
context_free_fn
;
41
drizzle_event_watch_fn
*
event_watch_fn
;
42
void
*
event_watch_context
;
43
drizzle_log_fn
*
log_fn
;
44
void
*
log_context
;
45
struct
pollfd *
pfds
;
46
drizzle_query_st
*
query_list
;
47
char
sqlstate
[
DRIZZLE_MAX_SQLSTATE_SIZE
+ 1];
48
char
last_error
[
DRIZZLE_MAX_ERROR_SIZE
];
49
};
50
54
struct
drizzle_con_tcp_st
55
{
56
in_port_t
port
;
57
struct
addrinfo
*
addrinfo
;
58
char
*
host
;
59
char
host_buffer
[NI_MAXHOST];
60
};
61
65
struct
drizzle_con_uds_st
66
{
67
struct
addrinfo
addrinfo
;
68
struct
sockaddr_un
sockaddr
;
69
};
70
74
struct
drizzle_con_st
75
{
76
uint8_t
packet_number
;
77
uint8_t
protocol_version
;
78
uint8_t
state_current
;
79
short
events
;
80
short
revents
;
81
drizzle_capabilities_t
capabilities
;
82
drizzle_charset_t
charset
;
83
drizzle_command_t
command
;
84
drizzle_con_options_t
options
;
85
drizzle_con_socket_t
socket_type
;
86
drizzle_con_status_t
status
;
87
uint32_t
max_packet_size
;
88
uint32_t
result_count
;
89
uint32_t
thread_id
;
90
int
backlog
;
91
int
fd
;
92
size_t
buffer_size
;
93
size_t
command_offset
;
94
size_t
command_size
;
95
size_t
command_total
;
96
size_t
packet_size
;
97
struct
addrinfo *
addrinfo_next
;
98
uint8_t *
buffer_ptr
;
99
uint8_t *
command_buffer
;
100
uint8_t *
command_data
;
101
void
*
context
;
102
drizzle_con_context_free_fn
*
context_free_fn
;
103
drizzle_st
*
drizzle
;
104
drizzle_con_st
*
next
;
105
drizzle_con_st
*
prev
;
106
drizzle_query_st
*
query
;
107
drizzle_result_st
*
result
;
108
drizzle_result_st
*
result_list
;
109
uint8_t *
scramble
;
110
union
111
{
112
drizzle_con_tcp_st
tcp
;
113
drizzle_con_uds_st
uds
;
114
}
socket
;
115
uint8_t
buffer
[
DRIZZLE_MAX_BUFFER_SIZE
];
116
char
db
[
DRIZZLE_MAX_DB_SIZE
];
117
char
password
[
DRIZZLE_MAX_PASSWORD_SIZE
];
118
uint8_t
scramble_buffer
[
DRIZZLE_MAX_SCRAMBLE_SIZE
];
119
char
server_version
[
DRIZZLE_MAX_SERVER_VERSION_SIZE
];
120
drizzle_state_fn
*
state_stack
[
DRIZZLE_STATE_STACK_SIZE
];
121
char
user
[
DRIZZLE_MAX_USER_SIZE
];
122
};
123
127
struct
drizzle_query_st
128
{
129
drizzle_st
*
drizzle
;
130
drizzle_query_st
*
next
;
131
drizzle_query_st
*
prev
;
132
drizzle_query_options_t
options
;
133
drizzle_query_state_t
state
;
134
drizzle_con_st
*
con
;
135
drizzle_result_st
*
result
;
136
const
char
*
string
;
137
size_t
size
;
138
void
*
context
;
139
drizzle_query_context_free_fn
*
context_free_fn
;
140
};
141
145
struct
drizzle_result_st
146
{
147
drizzle_con_st
*
con
;
148
drizzle_result_st
*
next
;
149
drizzle_result_st
*
prev
;
150
drizzle_result_options_t
options
;
151
152
char
info
[
DRIZZLE_MAX_INFO_SIZE
];
153
uint16_t
error_code
;
154
char
sqlstate
[
DRIZZLE_MAX_SQLSTATE_SIZE
+ 1];
155
uint64_t
insert_id
;
156
uint16_t
warning_count
;
157
uint64_t
affected_rows
;
158
159
uint16_t
column_count
;
160
uint16_t
column_current
;
161
drizzle_column_st
*
column_list
;
162
drizzle_column_st
*
column
;
163
drizzle_column_st
*
column_buffer
;
164
165
uint64_t
row_count
;
166
uint64_t
row_current
;
167
168
uint16_t
field_current
;
169
size_t
field_total
;
170
size_t
field_offset
;
171
size_t
field_size
;
172
drizzle_field_t
field
;
173
drizzle_field_t
field_buffer
;
174
175
uint64_t
row_list_size
;
176
drizzle_row_t
row
;
177
drizzle_row_t
*
row_list
;
178
size_t
*
field_sizes
;
179
size_t
**
field_sizes_list
;
180
};
181
185
struct
drizzle_column_st
186
{
187
drizzle_result_st
*
result
;
188
drizzle_column_st
*
next
;
189
drizzle_column_st
*
prev
;
190
drizzle_column_options_t
options
;
191
char
catalog
[
DRIZZLE_MAX_CATALOG_SIZE
];
192
char
db
[
DRIZZLE_MAX_DB_SIZE
];
193
char
table
[
DRIZZLE_MAX_TABLE_SIZE
];
194
char
orig_table
[
DRIZZLE_MAX_TABLE_SIZE
];
195
char
name
[
DRIZZLE_MAX_COLUMN_NAME_SIZE
];
196
char
orig_name
[
DRIZZLE_MAX_COLUMN_NAME_SIZE
];
197
drizzle_charset_t
charset
;
198
uint32_t
size
;
199
size_t
max_size
;
200
drizzle_column_type_t
type
;
201
drizzle_column_flags_t
flags
;
202
uint8_t
decimals
;
203
uint8_t
default_value
[
DRIZZLE_MAX_DEFAULT_VALUE_SIZE
];
204
size_t
default_value_size
;
205
};
206
207
#ifdef __cplusplus
208
}
209
#endif
210
211
#endif
/* __DRIZZLE_STRUCTS_H */
Generated by
1.8.1.1