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.
39
* @brief Connection Declarations for Clients
42
#ifndef __DRIZZLE_CON_CLIENT_H
43
#define __DRIZZLE_CON_CLIENT_H
50
* @addtogroup drizzle_con_client Connection Declarations for Clients
51
* @ingroup drizzle_client_interface
58
* @param[in] con Connection structure previously initialized with
59
* drizzle_con_create(), drizzle_con_clone(), or related functions.
60
* @return Standard drizzle return value.
63
drizzle_return_t drizzle_con_connect(drizzle_con_st *con);
66
* Send quit command to server for a connection.
68
* @param[in] con Connection structure previously initialized with
69
* drizzle_con_create(), drizzle_con_clone(), or related functions.
70
* @param[in] result Caller allocated structure, or NULL to allocate one.
71
* @param[out] ret_ptr Standard drizzle return value.
72
* @return On success, a pointer to the (possibly allocated) structure. On
73
* failure this will be NULL.
76
drizzle_result_st *drizzle_con_quit(drizzle_con_st *con,
77
drizzle_result_st *result,
78
drizzle_return_t *ret_ptr);
81
* @todo Remove this with next major API change.
84
drizzle_result_st *drizzle_quit(drizzle_con_st *con,
85
drizzle_result_st *result,
86
drizzle_return_t *ret_ptr);
89
* Select a new default database for a connection.
91
* @param[in] con Connection structure previously initialized with
92
* drizzle_con_create(), drizzle_con_clone(), or related functions.
93
* @param[in] result Caller allocated structure, or NULL to allocate one.
94
* @param[in] db Default database to select.
95
* @param[out] ret_ptr Standard drizzle return value.
96
* @return On success, a pointer to the (possibly allocated) structure. On
97
* failure this will be NULL.
100
drizzle_result_st *drizzle_con_select_db(drizzle_con_st *con,
101
drizzle_result_st *result,
103
drizzle_return_t *ret_ptr);
106
* @todo Remove this with next major API change.
109
drizzle_result_st *drizzle_select_db(drizzle_con_st *con,
110
drizzle_result_st *result,
112
drizzle_return_t *ret_ptr);
115
* Send a shutdown message to the server.
117
* @param[in] con Connection structure previously initialized with
118
* drizzle_con_create(), drizzle_con_clone(), or related functions.
119
* @param[in] result Caller allocated structure, or NULL to allocate one.
120
* @param[out] ret_ptr Standard drizzle return value.
121
* @return On success, a pointer to the (possibly allocated) structure. On
122
* failure this will be NULL.
125
drizzle_result_st *drizzle_con_shutdown(drizzle_con_st *con,
126
drizzle_result_st *result,
127
drizzle_return_t *ret_ptr);
130
drizzle_result_st *drizzle_kill(drizzle_con_st *con,
131
drizzle_result_st *result,
133
drizzle_return_t *ret_ptr);
136
* @todo Remove this with next major API change.
138
#define DRIZZLE_SHUTDOWN_DEFAULT 0
140
drizzle_result_st *drizzle_shutdown(drizzle_con_st *con,
141
drizzle_result_st *result, uint32_t level,
142
drizzle_return_t *ret_ptr);
145
* Send a ping request to the server.
147
* @param[in] con Connection structure previously initialized with
148
* drizzle_con_create(), drizzle_con_clone(), or related functions.
149
* @param[in] result Caller allocated structure, or NULL to allocate one.
150
* @param[out] ret_ptr Standard drizzle return value.
151
* @return On success, a pointer to the (possibly allocated) structure. On
152
* failure this will be NULL.
155
drizzle_result_st *drizzle_con_ping(drizzle_con_st *con,
156
drizzle_result_st *result,
157
drizzle_return_t *ret_ptr);
160
* @todo Remove this with next major API change.
163
drizzle_result_st *drizzle_ping(drizzle_con_st *con,
164
drizzle_result_st *result,
165
drizzle_return_t *ret_ptr);
168
* Send raw command to server, possibly in parts.
170
* @param[in] con Connection structure previously initialized with
171
* drizzle_con_create(), drizzle_con_clone(), or related functions.
172
* @param[in] result Caller allocated structure, or NULL to allocate one.
173
* @param[in] command Command to run on server.
174
* @param[in] data Data to send along with the command.
175
* @param[in] size Size of the current chunk of data being sent.
176
* @param[in] total Total size of all data being sent for command.
177
* @param[out] ret_ptr Standard drizzle return value.
178
* @return On success, a pointer to the (possibly allocated) structure. On
179
* failure this will be NULL.
182
drizzle_result_st *drizzle_con_command_write(drizzle_con_st *con,
183
drizzle_result_st *result,
184
drizzle_command_t command,
185
const void *data, size_t size,
187
drizzle_return_t *ret_ptr);
195
#endif /* __DRIZZLE_CON_CLIENT_H */