Merge lp:~linuxjedi/libdrizzle/5.1-docs2 into lp:libdrizzle

Proposed by Andrew Hutchings
Status: Merged
Approved by: Andrew Hutchings
Approved revision: 107
Merged at revision: 107
Proposed branch: lp:~linuxjedi/libdrizzle/5.1-docs2
Merge into: lp:libdrizzle
Diff against target: 418 lines (+155/-157)
6 files modified
docs/api/connection.rst (+114/-50)
docs/api/constants.rst (+0/-52)
docs/api/query.rst (+5/-30)
docs/examples/binlog.rst (+34/-23)
docs/examples/buffered.rst (+1/-1)
docs/examples/unbuffered.rst (+1/-1)
To merge this branch: bzr merge lp:~linuxjedi/libdrizzle/5.1-docs2
Reviewer Review Type Date Requested Status
Drizzle Trunk Pending
Review via email: mp+147166@code.launchpad.net

Description of the change

Documentation updates for the API changes made in Seattle

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'docs/api/connection.rst'
--- docs/api/connection.rst 2013-01-28 01:43:28 +0000
+++ docs/api/connection.rst 2013-02-07 16:43:36 +0000
@@ -13,30 +13,26 @@
1313
14 The internal drizzle connection object struct14 The internal drizzle connection object struct
1515
16.. c:type:: drizzle_options_st
17
18 The internal structure containing connection options
19
16Functions20Functions
17---------21---------
1822
19.. c:function:: drizzle_st* drizzle_create_tcp(const char *host, in_port_t port, const char *user, const char *password, const char *db, drizzle_options_t options)23.. c:function:: drizzle_st* drizzle_create(const char *host, in_port_t port, const char *user, const char *password, const char *db, drizzle_options_st *options)
2024
21 Creates a TCP/IP connection connection object25 Creates a connection connection object. If a path beginning with ``/`` is given as the host the library will connect as a UDS socket. Otherwise a TCP/IP conection is made.
2226
23 :param host: The hostname or IP of the server27 .. note::
24 :param port: The port number of the server28 a connection does not happen until the first query or an explicit :c:func:`drizzle_connect` call is made
25 :param user: The username of the server29
26 :param password: The password of the server30 :param host: The socket path, hostname or IP of the server
27 :param db: The default DB to connect to on the server31 :param port: The port number of the server (if TCP/IP)
28 :param options: The connection options to set32 :param user: The username of the server
29 :returns: A newly allocated and setup connection object33 :param password: The password of the server
3034 :param db: The default DB to connect to on the server
31.. c:function:: drizzle_st* drizzle_create_uds(const char *uds, const char *user, const char *password, const char *db, drizzle_options_t options)35 :param options: A pointer to a :c:type:`drizzle_options_st` created using :c:func:`drizzle_options_create` or :c:type:`NULL`
32
33 Creates a Unix Domain Socket connection object
34
35 :param uds: The path of the UDS file
36 :param user: The username of the server
37 :param password: The password of the server
38 :param db: The default DB to connect to on the server
39 :param options: The connection options to set
40 :returns: A newly allocated and setup connection object36 :returns: A newly allocated and setup connection object
4137
42.. c:function:: int drizzle_timeout(const drizzle_st *con)38.. c:function:: int drizzle_timeout(const drizzle_st *con)
@@ -51,7 +47,7 @@
51 Sets the connection timeout for the connection object47 Sets the connection timeout for the connection object
5248
53 :param drizzle: A connection object49 :param drizzle: A connection object
54 :param int: The new timeout to set50 :param timeout: The new timeout to set
5551
56.. c:function:: drizzle_verbose_t drizzle_verbose(const drizzle_st *con)52.. c:function:: drizzle_verbose_t drizzle_verbose(const drizzle_st *con)
5753
@@ -103,34 +99,102 @@
103 :param con: A connection object99 :param con: A connection object
104 :returns: A string containing the sqlstate100 :returns: A string containing the sqlstate
105101
106.. c:function:: drizzle_options_t drizzle_options(const drizzle_st *con)102.. c:function:: drizzle_options_st *drizzle_options_create(void)
107103
108 Gets the connection options104 Create a new connection options object
109105
110 :param con: A connection object106 :returns: The new connection options object
111 :returns: The options for the connection107
112108.. c:function:: void drizzle_options_destroy(drizzle_options_st *options)
113.. c:function:: void drizzle_set_options(drizzle_st *con, drizzle_options_t options)109
114110 Destroys a connection options object
115 Sets the connection options111
116112 :param options: The options object to be destroyed
117 :param con: A connection object113
118 :param options: A bit field of the :c:type:`drizzle_options_t` options114.. c:function:: void drizzle_options_set_non_blocking(drizzle_options_st *options, bool state)
119115
120.. c:function:: void drizzle_add_options(drizzle_st *con, drizzle_options_t options)116 Sets/unsets non-blocking connect option
121117
122 Add connection options118 :param options: The options object to modify
123119 :param state: Set option to true/false
124 :param con: A connection object120
125 :param options: A bit field of the :c:type:`drizzle_options_t` options121.. c:function:: bool drizzle_options_get_non_blocking(drizzle_options_st *options)
126122
127.. c:function:: void drizzle_remove_options(drizzle_st *con, drizzle_options_t options)123 Gets the non-blocking connect option
128124
129 Removes connection options125 :param options: The options object to get the value from
130126 :returns: The state of the non-blocking option
131 :param con: A connection object127
132 :param options: A bit field of the :c:type:`drizzle_options_t` options128.. c:function:: void drizzle_options_set_raw_scramble(drizzle_options_st *options, bool state)
133129
130 Sets/unsets the raw scramble connect option
131
132 :param options: The options object to modify
133 :param state: Set to true/false
134
135.. c:function:: bool drizzle_options_get_raw_scramble(drizzle_options_st *options)
136
137 Gets the raw scramble connect option
138
139 :param options: The options object to get the value from
140 :returns: The state of the raw scramble option
141
142.. c:function:: void drizzle_options_set_found_rows(drizzle_options_st *options, bool state)
143
144 Sets/unsets the found rows connect option
145
146 :param options: The options object to modify
147 :param state: Set to true/false
148
149.. c:function:: bool drizzle_options_get_found_rows(drizzle_options_st *options)
150
151 Gets the found rows connect option
152
153 :param options: The options object to get the value from
154 :returns: The state of the found rows option
155
156.. c:function:: void drizzle_options_set_interactive(drizzle_options_st *options, bool state)
157
158 Sets/unsets the interactive connect option
159
160 :param options: The options object to modify
161 :param state: Set to true/false
162
163.. c:function:: bool drizzle_options_get_interactive(drizzle_options_st *option)
164
165 Gets the interactive connect option
166
167 :param options: The options object to get the value from
168 :returns: The state of the interactive option
169
170.. c:function:: void drizzle_options_set_multi_statements(drizzle_options_st *options, bool state)
171
172 Sets/unsets the multi-statements connect option
173
174 :param options: The options object to modify
175 :parma state: Set to true/false
176
177.. c:function:: bool drizzle_options_get_multi_statements(drizzle_options_st *options)
178
179 Gets the multi-statements connect option
180
181 :param options: The options object to get the value from
182 :returns: The state of the multi-statements option
183
184.. c:function:: void drizzle_options_set_auth_plugin(drizzle_options_st *options, bool state)
185
186 Sets/unsets the auth plugin connect option
187
188 :param options: The optoins object to modify
189 :param state: Set to true/false
190
191.. c:function:: bool drizzle_options_get_auth_plugin(drizzle_options_st *options)
192
193 Gets the auth plugin connect option
194
195 :param options: The options object to get the value from
196 :returns: The state of the auth plugin option
197
134.. c:function:: const char* drizzle_host(const drizzle_st *con)198.. c:function:: const char* drizzle_host(const drizzle_st *con)
135199
136 Gets the host name from a TCP/IP connection200 Gets the host name from a TCP/IP connection
137201
=== modified file 'docs/api/constants.rst'
--- docs/api/constants.rst 2013-01-05 11:25:32 +0000
+++ docs/api/constants.rst 2013-02-07 16:43:36 +0000
@@ -179,58 +179,6 @@
179Connection179Connection
180----------180----------
181181
182.. c:type:: drizzle_options_t
183
184 An ENUM of connection options intended to be used in a bit field
185
186 .. py:data:: DRIZZLE_CON_NONE
187
188 No option set
189
190 .. py:data:: DRIZZLE_CON_NON_BLOCKING
191
192 Connect in non-blocking mode
193
194 .. py:data:: DRIZZLE_CON_RAW_PACKET
195
196 Raw packet data mode (for low-level clients)
197
198 .. py:data:: DRIZZLE_CON_RAW_SCRAMBLE
199
200 Raw auth scramble data (for low-level clients)
201
202 .. py:data:: DRIZZLE_CON_READY
203
204 Connection is ready
205
206 .. py:data:: DRIZZLE_CON_NO_RESULT_READ
207
208 Don't read result data from buffer (advanced feature, use with caution)
209
210 .. py:data:: DRIZZLE_CON_IO_READY
211
212 Used for event handling
213
214 .. py:data:: DRIZZLE_CON_LISTEN
215
216 Unused
217
218 .. py:data:: DRIZZLE_CON_FOUND_ROWS
219
220 Enable the FOUND_ROWS functionality
221
222 .. py:data:: DRIZZLE_CON_INTERACTIVE
223
224 This is an interactive client
225
226 .. py:data:: DRIZZLE_CON_MULTI_STATEMENTS
227
228 Multi-statement support
229
230 .. py:data:: DRIZZLE_CON_AUTH_PLUGIN
231
232 Authentiaction plugin support
233
234.. c:type:: drizzle_charset_t182.. c:type:: drizzle_charset_t
235183
236 An ENUM of the possible character set with colation ID184 An ENUM of the possible character set with colation ID
237185
=== modified file 'docs/api/query.rst'
--- docs/api/query.rst 2013-01-28 01:43:28 +0000
+++ docs/api/query.rst 2013-02-07 16:43:36 +0000
@@ -46,41 +46,16 @@
46 :param ret_ptr: A pointer to a :c:type:`drizzle_return_t` to store the return status into46 :param ret_ptr: A pointer to a :c:type:`drizzle_return_t` to store the return status into
47 :returns: A newly allocated result object47 :returns: A newly allocated result object
4848
49.. c:function:: ssize_t drizzle_escape_string(char *to, const size_t max_to_size, const char *from, const size_t from_size)49.. c:function:: ssize_t drizzle_escape_string(drizzle_st *con, char **to, const const char *from, const size_t from_size)
5050
51 Escape a string for an SQL query51 Escape a string for an SQL query. The ``to`` parameter is allocated by the function and needs to be freed by the application when finished with.
5252
53 :param con: a connection object
53 :param to: the destination string54 :param to: the destination string
54 :param max_to_size: the maximum length of the 'to' parameter
55 :param from: the source string55 :param from: the source string
56 :param from_size: the length of the source string56 :param from_size: the length of the source string
57 :returns: the length of the 'to' string or -1 upon error due to empty parameters or overflow57 :returns: the length of the 'to' string or -1 upon error due to empty parameters or overflow
5858
59.. c:function:: bool drizzle_hex_string(char *to, const unsigned char *from, const size_t from_size)
60
61 Convert data into a hexadecimal string of the data.
62
63 .. note::
64 The allocated length of the 'to' string should always be at least double
65 the length of the 'from' string
66
67 :param to: the destination string
68 :param from: the source string
69 :param from_size: the length of the source string
70 :returns: a true upon success or false upon empty parameters
71
72.. c:function:: bool drizzle_mysql_password_hash(char *to, const char *from, const size_t from_size)
73
74 Convert data into a MySQL password hash string.
75
76 .. note::
77 The allocated length of the 'to' string should always be at least 41 bytes
78
79 :param to: the destination string
80 :param from: the source string:
81 :param from_size: the length of the source string
82 :returns: a true upons success or false upon empty parameters
83
84.. c:function:: void drizzle_result_free(drizzle_result_st *result)59.. c:function:: void drizzle_result_free(drizzle_result_st *result)
8560
86 Frees a result object61 Frees a result object
8762
=== modified file 'docs/examples/binlog.rst'
--- docs/examples/binlog.rst 2013-01-05 10:27:32 +0000
+++ docs/examples/binlog.rst 2013-02-07 16:43:36 +0000
@@ -7,15 +7,43 @@
7 #include <stdio.h>7 #include <stdio.h>
8 #include <stdlib.h>8 #include <stdlib.h>
99
10 void binlog_error(drizzle_return_t ret, drizzle_st *connection, void *context)
11 {
12 (void) context;
13 if (ret != DRIZZLE_RETURN_EOF)
14 {
15 printf("Error retrieving binlog: %s\n", drizzle_error(connection));
16 }
17 }
18
19
20 void binlog_event(drizzle_binlog_event_st *event, void *context)
21 {
22 (void) context;
23 printf("Timestamp: %"PRIu32"\n", drizzle_binlog_event_timestamp(event));
24 printf("Type: %"PRIu8"\n", drizzle_binlog_event_type(event));
25 printf("Server-id: %"PRIu32"\n", drizzle_binlog_event_server_id(event));
26 printf("Next-pos: %"PRIu32"\n", drizzle_binlog_event_next_pos(event));
27 length= drizzle_binlog_event_length(event);
28 printf("Length: %"PRIu32"\n", length);
29 data= drizzle_binlog_event_data(event);
30 printf("Data: 0x");
31 for (i=0; i<length; i++)
32 printf("%02X ", data[i]);
33 printf("\n\n");
34 }
35
36
37
10 int main(int argc, char *argv[])38 int main(int argc, char *argv[])
11 {39 {
12 (void) argc;40 (void) argc;
13 (void) argv;41 (void) argv;
14 drizzle_st *con;42 drizzle_st *con;
15 drizzle_return_t ret;43 drizzle_return_t ret;
16 drizzle_result_st *result;44 drizzle_binlog_st *binlog;
1745
18 con = drizzle_create_tcp("localhost", 3306, "root", "", "", 0);46 con = drizzle_create("localhost", 3306, "root", "", "", 0);
19 if (con == NULL)47 if (con == NULL)
20 {48 {
21 printf("Drizzle connection object creation error\n");49 printf("Drizzle connection object creation error\n");
@@ -28,32 +56,15 @@
28 return EXIT_FAILURE;56 return EXIT_FAILURE;
29 }57 }
3058
31 result= drizzle_start_binlog(con, 0, "", 0, &ret);59 binlog= drizzle_binlog_init(con, binlog_event, binlog_error, NULL, true);
32 if (ret != DRIZZLE_RETURN_OK)60 ret= drizzle_binlog_start(binlog, 0, "", 0);
61 if (ret != DRIZZLE_RETURN_EOF)
33 {62 {
34 printf("Drizzle binlog start failure\n");63 printf("Drizzle binlog start failure\n");
35 return EXIT_FAILURE;64 return EXIT_FAILURE;
36 }65 }
3766
38 while (ret == DRIZZLE_RETURN_OK)67
39 {
40 uint32_t i, length;
41 const unsigned char *data;
42 ret= drizzle_binlog_get_event(result);
43 if (ret != DRIZZLE_RETURN_OK)
44 break;
45 printf("Timestamp: %"PRIu32"\n", drizzle_binlog_event_timestamp(result));
46 printf("Type: %"PRIu8"\n", drizzle_binlog_event_type(result));
47 printf("Server-id: %"PRIu32"\n", drizzle_binlog_event_server_id(result));
48 printf("Next-pos: %"PRIu32"\n", drizzle_binlog_event_next_pos(result));
49 length= drizzle_binlog_event_length(result);
50 printf("Length: %"PRIu32"\n", length);
51 data= drizzle_binlog_event_data(result);
52 printf("Data: 0x");
53 for (i=0; i<length; i++)
54 printf("%02X ", data[i]);
55 printf("\n\n");
56 }
5768
58 drizzle_quit(con);69 drizzle_quit(con);
59 return EXIT_SUCCESS;70 return EXIT_SUCCESS;
6071
=== modified file 'docs/examples/buffered.rst'
--- docs/examples/buffered.rst 2013-01-10 22:14:47 +0000
+++ docs/examples/buffered.rst 2013-02-07 16:43:36 +0000
@@ -36,7 +36,7 @@
36 drizzle_row_t row;36 drizzle_row_t row;
37 int num_fields;37 int num_fields;
3838
39 con = drizzle_create_tcp("localhost", 3306, "user", "pass", "test", 0);39 con = drizzle_create("localhost", 3306, "user", "pass", "test", 0);
40 if (con == NULL)40 if (con == NULL)
41 {41 {
42 printf("Drizzle connection object creation error\n");42 printf("Drizzle connection object creation error\n");
4343
=== modified file 'docs/examples/unbuffered.rst'
--- docs/examples/unbuffered.rst 2013-01-10 22:14:47 +0000
+++ docs/examples/unbuffered.rst 2013-02-07 16:43:36 +0000
@@ -38,7 +38,7 @@
38 drizzle_row_t row;38 drizzle_row_t row;
39 int num_fields;39 int num_fields;
4040
41 con = drizzle_create_tcp("localhost", 3306, "root", "", "libdrizzle", 0);41 con = drizzle_create("localhost", 3306, "root", "", "libdrizzle", 0);
42 if (con == NULL)42 if (con == NULL)
43 {43 {
44 printf("Drizzle connection object creation error\n");44 printf("Drizzle connection object creation error\n");

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: