summaryrefslogtreecommitdiff
path: root/ext/mysqlnd/mysqlnd_ext_plugin.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2014-03-05 16:22:23 +0200
committerAndrey Hristov <andrey@php.net>2014-03-05 16:22:23 +0200
commit6b804b96b8c454954d30ed8f0cf1a05d91801c4f (patch)
treee75808939815dd5766c886fed715a63a81b9f8d2 /ext/mysqlnd/mysqlnd_ext_plugin.c
parent1b922895fc4ea22b9f1e6679faf1a3d7b801a64e (diff)
downloadphp-git-6b804b96b8c454954d30ed8f0cf1a05d91801c4f.tar.gz
Refactor the result set data structures. Move more to the buffered and unbuffered
substructures. Add methods to these too. Preparing for pluggable interface for returning data to the engine (zvals, c-style, something else)
Diffstat (limited to 'ext/mysqlnd/mysqlnd_ext_plugin.c')
-rw-r--r--ext/mysqlnd/mysqlnd_ext_plugin.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/ext/mysqlnd/mysqlnd_ext_plugin.c b/ext/mysqlnd/mysqlnd_ext_plugin.c
index f40688b272..706111346f 100644
--- a/ext/mysqlnd/mysqlnd_ext_plugin.c
+++ b/ext/mysqlnd/mysqlnd_ext_plugin.c
@@ -70,6 +70,32 @@ PHPAPI void ** _mysqlnd_plugin_get_plugin_result_data(const MYSQLND_RES * result
/* }}} */
+/* {{{ _mysqlnd_plugin_get_plugin_result_unbuffered_data */
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_unbuffered_data(const MYSQLND_RES_UNBUFFERED * result, unsigned int plugin_id TSRMLS_DC)
+{
+ DBG_ENTER("_mysqlnd_plugin_get_plugin_result_data");
+ DBG_INF_FMT("plugin_id=%u", plugin_id);
+ if (!result || plugin_id >= mysqlnd_plugin_count()) {
+ return NULL;
+ }
+ DBG_RETURN((void *)((char *)result + sizeof(MYSQLND_RES_UNBUFFERED) + plugin_id * sizeof(void *)));
+}
+/* }}} */
+
+
+/* {{{ _mysqlnd_plugin_get_plugin_result_buffered_data */
+PHPAPI void ** _mysqlnd_plugin_get_plugin_result_buffered_data(const MYSQLND_RES_BUFFERED * result, unsigned int plugin_id TSRMLS_DC)
+{
+ DBG_ENTER("_mysqlnd_plugin_get_plugin_result_data");
+ DBG_INF_FMT("plugin_id=%u", plugin_id);
+ if (!result || plugin_id >= mysqlnd_plugin_count()) {
+ return NULL;
+ }
+ DBG_RETURN((void *)((char *)result + sizeof(MYSQLND_RES_BUFFERED) + plugin_id * sizeof(void *)));
+}
+/* }}} */
+
+
/* {{{ _mysqlnd_plugin_get_plugin_protocol_data */
PHPAPI void **
_mysqlnd_plugin_get_plugin_protocol_data(const MYSQLND_PROTOCOL * protocol, unsigned int plugin_id TSRMLS_DC)
@@ -161,6 +187,42 @@ mysqlnd_result_set_methods(struct st_mysqlnd_res_methods * methods)
/* }}} */
+/* {{{ mysqlnd_result_unbuffered_get_methods */
+PHPAPI struct st_mysqlnd_result_unbuffered_methods *
+mysqlnd_result_unbuffered_get_methods()
+{
+ return &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_result_unbuffered);
+}
+/* }}} */
+
+
+/* {{{ mysqlnd_result_unbuffered_set_methods */
+PHPAPI void
+mysqlnd_result_unbuffered_set_methods(struct st_mysqlnd_result_unbuffered_methods * methods)
+{
+ MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_result_unbuffered) = *methods;
+}
+/* }}} */
+
+
+/* {{{ mysqlnd_result_buffered_get_methods */
+PHPAPI struct st_mysqlnd_result_buffered_methods *
+mysqlnd_result_buffered_get_methods()
+{
+ return &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_result_buffered);
+}
+/* }}} */
+
+
+/* {{{ mysqlnd_result_buffered_set_methods */
+PHPAPI void
+mysqlnd_result_buffered_set_methods(struct st_mysqlnd_result_buffered_methods * methods)
+{
+ MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_result_buffered) = *methods;
+}
+/* }}} */
+
+
/* {{{ mysqlnd_stmt_get_methods */
PHPAPI struct st_mysqlnd_stmt_methods *
mysqlnd_stmt_get_methods()