~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/conn_client.h

  • Committer: Brian Aker
  • Date: 2009-02-21 00:18:15 UTC
  • Revision ID: brian@tangent.org-20090221001815-x20e8h71e984lvs1
Completion (?) of uint conversion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Drizzle Client & Protocol Library
3
 
 *
4
 
 * Copyright (C) 2008 Eric Day (eday@oddments.org)
5
 
 * All rights reserved.
6
 
 *
7
 
 * Redistribution and use in source and binary forms, with or without
8
 
 * modification, are permitted provided that the following conditions are
9
 
 * met:
10
 
 *
11
 
 *     * Redistributions of source code must retain the above copyright
12
 
 * notice, this list of conditions and the following disclaimer.
13
 
 *
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
17
 
 * distribution.
18
 
 *
19
 
 *     * The names of its contributors may not be used to endorse or
20
 
 * promote products derived from this software without specific prior
21
 
 * written permission.
22
 
 *
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.
34
 
 *
35
 
 */
36
 
 
37
 
/**
38
 
 * @file
39
 
 * @brief Connection Declarations for Clients
40
 
 */
41
 
 
42
 
#ifndef __DRIZZLE_CON_CLIENT_H
43
 
#define __DRIZZLE_CON_CLIENT_H
44
 
 
45
 
#ifdef __cplusplus
46
 
extern "C" {
47
 
#endif
48
 
 
49
 
/**
50
 
 * @addtogroup drizzle_con_client Connection Declarations for Clients
51
 
 * @ingroup drizzle_client_interface
52
 
 * @{
53
 
 */
54
 
 
55
 
/**
56
 
 * Connect to server.
57
 
 *
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.
61
 
 */
62
 
DRIZZLE_API
63
 
drizzle_return_t drizzle_con_connect(drizzle_con_st *con);
64
 
 
65
 
/**
66
 
 * Send quit command to server for a connection.
67
 
 *
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.
74
 
 */
75
 
DRIZZLE_API
76
 
drizzle_result_st *drizzle_con_quit(drizzle_con_st *con,
77
 
                                    drizzle_result_st *result,
78
 
                                    drizzle_return_t *ret_ptr);
79
 
 
80
 
/**
81
 
 * @todo Remove this with next major API change.
82
 
 */
83
 
DRIZZLE_API
84
 
drizzle_result_st *drizzle_quit(drizzle_con_st *con,
85
 
                                drizzle_result_st *result,
86
 
                                drizzle_return_t *ret_ptr);
87
 
 
88
 
/**
89
 
 * Select a new default database for a connection.
90
 
 *
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.
98
 
 */
99
 
DRIZZLE_API
100
 
drizzle_result_st *drizzle_con_select_db(drizzle_con_st *con,
101
 
                                         drizzle_result_st *result,
102
 
                                         const char *db,
103
 
                                         drizzle_return_t *ret_ptr);
104
 
 
105
 
/**
106
 
 * @todo Remove this with next major API change.
107
 
 */
108
 
DRIZZLE_API
109
 
drizzle_result_st *drizzle_select_db(drizzle_con_st *con,
110
 
                                     drizzle_result_st *result,
111
 
                                     const char *db,
112
 
                                     drizzle_return_t *ret_ptr);
113
 
 
114
 
/**
115
 
 * Send a shutdown message to the server.
116
 
 *
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.
123
 
 */
124
 
DRIZZLE_API
125
 
drizzle_result_st *drizzle_con_shutdown(drizzle_con_st *con,
126
 
                                        drizzle_result_st *result,
127
 
                                        drizzle_return_t *ret_ptr);
128
 
 
129
 
/**
130
 
 * @todo Remove this with next major API change.
131
 
 */
132
 
#define DRIZZLE_SHUTDOWN_DEFAULT 0
133
 
DRIZZLE_API
134
 
drizzle_result_st *drizzle_shutdown(drizzle_con_st *con,
135
 
                                    drizzle_result_st *result, uint32_t level,
136
 
                                    drizzle_return_t *ret_ptr);
137
 
 
138
 
/**
139
 
 * Send a ping request to the server.
140
 
 *
141
 
 * @param[in] con Connection structure previously initialized with
142
 
 *  drizzle_con_create(), drizzle_con_clone(), or related functions.
143
 
 * @param[in] result Caller allocated structure, or NULL to allocate one.
144
 
 * @param[out] ret_ptr Standard drizzle return value.
145
 
 * @return On success, a pointer to the (possibly allocated) structure. On
146
 
 *  failure this will be NULL.
147
 
 */
148
 
DRIZZLE_API
149
 
drizzle_result_st *drizzle_con_ping(drizzle_con_st *con,
150
 
                                    drizzle_result_st *result,
151
 
                                    drizzle_return_t *ret_ptr);
152
 
 
153
 
/**
154
 
 * @todo Remove this with next major API change.
155
 
 */
156
 
DRIZZLE_API
157
 
drizzle_result_st *drizzle_ping(drizzle_con_st *con,
158
 
                                drizzle_result_st *result,
159
 
                                drizzle_return_t *ret_ptr);
160
 
 
161
 
/**
162
 
 * Send raw command to server, possibly in parts.
163
 
 *
164
 
 * @param[in] con Connection structure previously initialized with
165
 
 *  drizzle_con_create(), drizzle_con_clone(), or related functions.
166
 
 * @param[in] result Caller allocated structure, or NULL to allocate one.
167
 
 * @param[in] command Command to run on server.
168
 
 * @param[in] data Data to send along with the command.
169
 
 * @param[in] size Size of the current chunk of data being sent.
170
 
 * @param[in] total Total size of all data being sent for command.
171
 
 * @param[out] ret_ptr Standard drizzle return value.
172
 
 * @return On success, a pointer to the (possibly allocated) structure. On
173
 
 *  failure this will be NULL.
174
 
 */
175
 
DRIZZLE_API
176
 
drizzle_result_st *drizzle_con_command_write(drizzle_con_st *con,
177
 
                                             drizzle_result_st *result,
178
 
                                             drizzle_command_t command,
179
 
                                             const void *data, size_t size,
180
 
                                             size_t total,
181
 
                                             drizzle_return_t *ret_ptr);
182
 
 
183
 
/** @} */
184
 
 
185
 
#ifdef __cplusplus
186
 
}
187
 
#endif
188
 
 
189
 
#endif /* __DRIZZLE_CON_CLIENT_H */