2
* Drizzle Client & Protocol Library
4
* Copyright (C) 2008 Eric Day (eday@oddments.org)
7
* Use and distribution licensed under the BSD license. See
8
* the COPYING file in this directory for full text.
13
* @brief Connection Declarations for Clients
16
#ifndef __DRIZZLE_CON_CLIENT_H
17
#define __DRIZZLE_CON_CLIENT_H
24
* @addtogroup drizzle_con_client Connection Declarations for Clients
25
* @ingroup drizzle_client_interface
32
* @param[in] con Connection structure previously initialized with
33
* drizzle_con_create(), drizzle_con_clone(), or related functions.
34
* @return Standard drizzle return value.
37
drizzle_return_t drizzle_con_connect(drizzle_con_st *con);
40
* Send quit command to server for a connection.
42
* @param[in] con Connection structure previously initialized with
43
* drizzle_con_create(), drizzle_con_clone(), or related functions.
44
* @param[in] result Caller allocated structure, or NULL to allocate one.
45
* @param[out] ret_ptr Standard drizzle return value.
46
* @return On success, a pointer to the (possibly allocated) structure. On
47
* failure this will be NULL.
50
drizzle_result_st *drizzle_con_quit(drizzle_con_st *con,
51
drizzle_result_st *result,
52
drizzle_return_t *ret_ptr);
55
* @todo Remove this with next major API change.
58
drizzle_result_st *drizzle_quit(drizzle_con_st *con,
59
drizzle_result_st *result,
60
drizzle_return_t *ret_ptr);
63
* Select a new default database for a connection.
65
* @param[in] con Connection structure previously initialized with
66
* drizzle_con_create(), drizzle_con_clone(), or related functions.
67
* @param[in] result Caller allocated structure, or NULL to allocate one.
68
* @param[in] db Default database to select.
69
* @param[out] ret_ptr Standard drizzle return value.
70
* @return On success, a pointer to the (possibly allocated) structure. On
71
* failure this will be NULL.
74
drizzle_result_st *drizzle_con_select_db(drizzle_con_st *con,
75
drizzle_result_st *result,
77
drizzle_return_t *ret_ptr);
80
* @todo Remove this with next major API change.
83
drizzle_result_st *drizzle_select_db(drizzle_con_st *con,
84
drizzle_result_st *result,
86
drizzle_return_t *ret_ptr);
89
* Send a shutdown message to the server.
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[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_shutdown(drizzle_con_st *con,
100
drizzle_result_st *result,
101
drizzle_return_t *ret_ptr);
104
* @todo Remove this with next major API change.
106
#define DRIZZLE_SHUTDOWN_DEFAULT 0
108
drizzle_result_st *drizzle_shutdown(drizzle_con_st *con,
109
drizzle_result_st *result, uint32_t level,
110
drizzle_return_t *ret_ptr);
113
* Send a ping request to the server.
115
* @param[in] con Connection structure previously initialized with
116
* drizzle_con_create(), drizzle_con_clone(), or related functions.
117
* @param[in] result Caller allocated structure, or NULL to allocate one.
118
* @param[out] ret_ptr Standard drizzle return value.
119
* @return On success, a pointer to the (possibly allocated) structure. On
120
* failure this will be NULL.
123
drizzle_result_st *drizzle_con_ping(drizzle_con_st *con,
124
drizzle_result_st *result,
125
drizzle_return_t *ret_ptr);
128
* @todo Remove this with next major API change.
131
drizzle_result_st *drizzle_ping(drizzle_con_st *con,
132
drizzle_result_st *result,
133
drizzle_return_t *ret_ptr);
136
* Send raw command to server, possibly in parts.
138
* @param[in] con Connection structure previously initialized with
139
* drizzle_con_create(), drizzle_con_clone(), or related functions.
140
* @param[in] result Caller allocated structure, or NULL to allocate one.
141
* @param[in] command Command to run on server.
142
* @param[in] data Data to send along with the command.
143
* @param[in] size Size of the current chunk of data being sent.
144
* @param[in] total Total size of all data being sent for command.
145
* @param[out] ret_ptr Standard drizzle return value.
146
* @return On success, a pointer to the (possibly allocated) structure. On
147
* failure this will be NULL.
150
drizzle_result_st *drizzle_con_command_write(drizzle_con_st *con,
151
drizzle_result_st *result,
152
drizzle_command_t command,
153
const void *data, size_t size,
155
drizzle_return_t *ret_ptr);
163
#endif /* __DRIZZLE_CON_CLIENT_H */