2
* Drizzle Client & Protocol Library
4
* Copyright (C) 2008 Eric Day (eday@oddments.org)
7
* Redistribution and use in source and binary forms, with or without
8
* modification, are permitted provided that the following conditions are
11
* * Redistributions of source code must retain the above copyright
12
* notice, this list of conditions and the following disclaimer.
14
* * Redistributions in binary form must reproduce the above
15
* copyright notice, this list of conditions and the following disclaimer
16
* in the documentation and/or other materials provided with the
19
* * The names of its contributors may not be used to endorse or
20
* promote products derived from this software without specific prior
23
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41
* @brief Connection Declarations for Clients
49
* @addtogroup drizzle_con_client Connection Declarations for Clients
50
* @ingroup drizzle_client_interface
57
* @param[in] con Connection structure previously initialized with
58
* drizzle_con_create(), drizzle_con_clone(), or related functions.
59
* @return Standard drizzle return value.
62
drizzle_return_t drizzle_con_connect(drizzle_con_st *con);
65
* Send quit command to server for a connection.
67
* @param[in] con Connection structure previously initialized with
68
* drizzle_con_create(), drizzle_con_clone(), or related functions.
69
* @param[in] result Caller allocated structure, or NULL to allocate one.
70
* @param[out] ret_ptr Standard drizzle return value.
71
* @return On success, a pointer to the (possibly allocated) structure. On
72
* failure this will be NULL.
75
drizzle_result_st *drizzle_con_quit(drizzle_con_st *con,
76
drizzle_result_st *result,
77
drizzle_return_t *ret_ptr);
80
* @todo Remove this with next major API change.
83
drizzle_result_st *drizzle_quit(drizzle_con_st *con,
84
drizzle_result_st *result,
85
drizzle_return_t *ret_ptr);
88
* Select a new default database for a connection.
90
* @param[in] con Connection structure previously initialized with
91
* drizzle_con_create(), drizzle_con_clone(), or related functions.
92
* @param[in] result Caller allocated structure, or NULL to allocate one.
93
* @param[in] db Default database to select.
94
* @param[out] ret_ptr Standard drizzle return value.
95
* @return On success, a pointer to the (possibly allocated) structure. On
96
* failure this will be NULL.
99
drizzle_result_st *drizzle_con_select_db(drizzle_con_st *con,
100
drizzle_result_st *result,
102
drizzle_return_t *ret_ptr);
105
* @todo Remove this with next major API change.
108
drizzle_result_st *drizzle_select_db(drizzle_con_st *con,
109
drizzle_result_st *result,
111
drizzle_return_t *ret_ptr);
114
* Send a shutdown message to the server.
116
* @param[in] con Connection structure previously initialized with
117
* drizzle_con_create(), drizzle_con_clone(), or related functions.
118
* @param[in] result Caller allocated structure, or NULL to allocate one.
119
* @param[out] ret_ptr Standard drizzle return value.
120
* @return On success, a pointer to the (possibly allocated) structure. On
121
* failure this will be NULL.
124
drizzle_result_st *drizzle_con_shutdown(drizzle_con_st *con,
125
drizzle_result_st *result,
126
drizzle_return_t *ret_ptr);
129
drizzle_result_st *drizzle_kill(drizzle_con_st *con,
130
drizzle_result_st *result,
132
drizzle_return_t *ret_ptr);
135
* @todo Remove this with next major API change.
137
#define DRIZZLE_SHUTDOWN_DEFAULT 0
139
drizzle_result_st *drizzle_shutdown(drizzle_con_st *con,
140
drizzle_result_st *result, uint32_t level,
141
drizzle_return_t *ret_ptr);
144
* Send a ping request to the server.
146
* @param[in] con Connection structure previously initialized with
147
* drizzle_con_create(), drizzle_con_clone(), or related functions.
148
* @param[in] result Caller allocated structure, or NULL to allocate one.
149
* @param[out] ret_ptr Standard drizzle return value.
150
* @return On success, a pointer to the (possibly allocated) structure. On
151
* failure this will be NULL.
154
drizzle_result_st *drizzle_con_ping(drizzle_con_st *con,
155
drizzle_result_st *result,
156
drizzle_return_t *ret_ptr);
159
* @todo Remove this with next major API change.
162
drizzle_result_st *drizzle_ping(drizzle_con_st *con,
163
drizzle_result_st *result,
164
drizzle_return_t *ret_ptr);
167
* Send raw command to server, possibly in parts.
169
* @param[in] con Connection structure previously initialized with
170
* drizzle_con_create(), drizzle_con_clone(), or related functions.
171
* @param[in] result Caller allocated structure, or NULL to allocate one.
172
* @param[in] command Command to run on server.
173
* @param[in] data Data to send along with the command.
174
* @param[in] size Size of the current chunk of data being sent.
175
* @param[in] total Total size of all data being sent for command.
176
* @param[out] ret_ptr Standard drizzle return value.
177
* @return On success, a pointer to the (possibly allocated) structure. On
178
* failure this will be NULL.
181
drizzle_result_st *drizzle_con_command_write(drizzle_con_st *con,
182
drizzle_result_st *result,
183
drizzle_command_t command,
184
const void *data, size_t size,
186
drizzle_return_t *ret_ptr);