Busybox: Upgrade to 1.21.1 (stable). lsof active.
[tomato.git] / release / src / router / php / ext / mysqlnd / mysqlnd_ext_plugin.c
blob21be3fd37bb9e5706b90aa7bf4c06c4da42cd621
1 /*
2 +----------------------------------------------------------------------+
3 | PHP Version 5 |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2006-2013 The PHP Group |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
15 | Authors: Andrey Hristov <andrey@mysql.com> |
16 | Ulf Wendel <uwendel@mysql.com> |
17 | Georg Richter <georg@mysql.com> |
18 +----------------------------------------------------------------------+
21 /* $Id: mysqlnd.c 318221 2011-10-19 15:04:12Z andrey $ */
22 #include "php.h"
23 #include "mysqlnd.h"
24 #include "mysqlnd_priv.h"
25 #include "mysqlnd_result.h"
26 #include "mysqlnd_debug.h"
28 static struct st_mysqlnd_conn_methods * mysqlnd_conn_methods;
29 static struct st_mysqlnd_conn_data_methods * mysqlnd_conn_data_methods;
30 static struct st_mysqlnd_stmt_methods * mysqlnd_stmt_methods;
32 /* {{{ _mysqlnd_plugin_get_plugin_connection_data */
33 PHPAPI void **
34 _mysqlnd_plugin_get_plugin_connection_data(const MYSQLND * conn, unsigned int plugin_id TSRMLS_DC)
36 DBG_ENTER("_mysqlnd_plugin_get_plugin_connection_data");
37 DBG_INF_FMT("plugin_id=%u", plugin_id);
38 if (!conn || plugin_id >= mysqlnd_plugin_count()) {
39 return NULL;
41 DBG_RETURN((void *)((char *)conn + sizeof(MYSQLND) + plugin_id * sizeof(void *)));
43 /* }}} */
46 /* {{{ _mysqlnd_plugin_get_plugin_connection_data_data */
47 PHPAPI void **
48 _mysqlnd_plugin_get_plugin_connection_data_data(const MYSQLND_CONN_DATA * conn, unsigned int plugin_id TSRMLS_DC)
50 DBG_ENTER("_mysqlnd_plugin_get_plugin_connection_data_data");
51 DBG_INF_FMT("plugin_id=%u", plugin_id);
52 if (!conn || plugin_id >= mysqlnd_plugin_count()) {
53 return NULL;
55 DBG_RETURN((void *)((char *)conn + sizeof(MYSQLND_CONN_DATA) + plugin_id * sizeof(void *)));
57 /* }}} */
60 /* {{{ _mysqlnd_plugin_get_plugin_result_data */
61 PHPAPI void ** _mysqlnd_plugin_get_plugin_result_data(const MYSQLND_RES * result, unsigned int plugin_id TSRMLS_DC)
63 DBG_ENTER("_mysqlnd_plugin_get_plugin_result_data");
64 DBG_INF_FMT("plugin_id=%u", plugin_id);
65 if (!result || plugin_id >= mysqlnd_plugin_count()) {
66 return NULL;
68 DBG_RETURN((void *)((char *)result + sizeof(MYSQLND_RES) + plugin_id * sizeof(void *)));
70 /* }}} */
73 /* {{{ _mysqlnd_plugin_get_plugin_protocol_data */
74 PHPAPI void **
75 _mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL * protocol, unsigned int plugin_id TSRMLS_DC)
77 DBG_ENTER("_mysqlnd_plugin_get_plugin_protocol_data");
78 DBG_INF_FMT("plugin_id=%u", plugin_id);
79 if (!protocol || plugin_id >= mysqlnd_plugin_count()) {
80 return NULL;
82 DBG_RETURN((void *)((char *)protocol + sizeof(MYSQLND_PROTOCOL) + plugin_id * sizeof(void *)));
84 /* }}} */
87 /* {{{ _mysqlnd_plugin_get_plugin_stmt_data */
88 PHPAPI void ** _mysqlnd_plugin_get_plugin_stmt_data(const MYSQLND_STMT * stmt, unsigned int plugin_id TSRMLS_DC)
90 DBG_ENTER("_mysqlnd_plugin_get_plugin_stmt_data");
91 DBG_INF_FMT("plugin_id=%u", plugin_id);
92 if (!stmt || plugin_id >= mysqlnd_plugin_count()) {
93 return NULL;
95 DBG_RETURN((void *)((char *)stmt + sizeof(MYSQLND_STMT) + plugin_id * sizeof(void *)));
97 /* }}} */
100 /* {{{ _mysqlnd_plugin_get_plugin_net_data */
101 PHPAPI void ** _mysqlnd_plugin_get_plugin_net_data(const MYSQLND_NET * net, unsigned int plugin_id TSRMLS_DC)
103 DBG_ENTER("_mysqlnd_plugin_get_plugin_net_data");
104 DBG_INF_FMT("plugin_id=%u", plugin_id);
105 if (!net || plugin_id >= mysqlnd_plugin_count()) {
106 return NULL;
108 DBG_RETURN((void *)((char *)net + sizeof(MYSQLND_NET) + plugin_id * sizeof(void *)));
110 /* }}} */
114 /* {{{ mysqlnd_conn_get_methods */
115 PHPAPI struct st_mysqlnd_conn_methods *
116 mysqlnd_conn_get_methods()
118 return mysqlnd_conn_methods;
120 /* }}} */
122 /* {{{ mysqlnd_conn_set_methods */
123 PHPAPI void mysqlnd_conn_set_methods(struct st_mysqlnd_conn_methods *methods)
125 mysqlnd_conn_methods = methods;
127 /* }}} */
130 /* {{{ mysqlnd_conn_get_methods */
131 PHPAPI struct st_mysqlnd_conn_data_methods *
132 mysqlnd_conn_data_get_methods()
134 return mysqlnd_conn_data_methods;
136 /* }}} */
138 /* {{{ mysqlnd_conn_set_methods */
139 PHPAPI void mysqlnd_conn_data_set_methods(struct st_mysqlnd_conn_data_methods * methods)
141 mysqlnd_conn_data_methods = methods;
143 /* }}} */
146 /* {{{ mysqlnd_result_get_methods */
147 PHPAPI struct st_mysqlnd_res_methods *
148 mysqlnd_result_get_methods()
150 return &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_res);
152 /* }}} */
155 /* {{{ mysqlnd_result_set_methods */
156 PHPAPI void
157 mysqlnd_result_set_methods(struct st_mysqlnd_res_methods * methods)
159 MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_res) = *methods;
161 /* }}} */
164 /* {{{ mysqlnd_stmt_get_methods */
165 PHPAPI struct st_mysqlnd_stmt_methods *
166 mysqlnd_stmt_get_methods()
168 return mysqlnd_stmt_methods;
170 /* }}} */
173 /* {{{ mysqlnd_stmt_set_methods */
174 PHPAPI void
175 mysqlnd_stmt_set_methods(struct st_mysqlnd_stmt_methods *methods)
177 mysqlnd_stmt_methods = methods;
179 /* }}} */
182 /* {{{ mysqlnd_protocol_get_methods */
183 PHPAPI struct st_mysqlnd_protocol_methods *
184 mysqlnd_protocol_get_methods()
186 return &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_protocol);
188 /* }}} */
191 /* {{{ mysqlnd_protocol_set_methods */
192 PHPAPI void
193 mysqlnd_protocol_set_methods(struct st_mysqlnd_protocol_methods * methods)
195 MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_protocol) = *methods;
197 /* }}} */
200 /* {{{ mysqlnd_net_get_methods */
201 PHPAPI struct st_mysqlnd_net_methods *
202 mysqlnd_net_get_methods()
204 return &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_net);
206 /* }}} */
209 /* {{{ mysqlnd_net_set_methods */
210 PHPAPI void
211 mysqlnd_net_set_methods(struct st_mysqlnd_net_methods * methods)
213 MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_net) = *methods;
215 /* }}} */
220 * Local variables:
221 * tab-width: 4
222 * c-basic-offset: 4
223 * End:
224 * vim600: noet sw=4 ts=4 fdm=marker
225 * vim<600: noet sw=4 ts=4