diff options
author | Andrey Hristov <andrey@php.net> | 2011-10-21 15:28:58 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2011-10-21 15:28:58 +0000 |
commit | 652490d43a6d5d2c16c8ceb8a93284fbe24d377a (patch) | |
tree | 337d5e9a2ca305289aaac8c9b5b8ca47f793f215 /ext/mysqlnd/mysqlnd_ps.c | |
parent | d81ea16ef14735b97f22702ca1a78c3674fd987e (diff) | |
download | php-git-652490d43a6d5d2c16c8ceb8a93284fbe24d377a.tar.gz |
shift code around to two new files - mysqlnd_driver.c
and mysqlnd_ext_plugin.c (mysqlnd extension plugin)
Diffstat (limited to 'ext/mysqlnd/mysqlnd_ps.c')
-rw-r--r-- | ext/mysqlnd/mysqlnd_ps.c | 41 |
1 files changed, 5 insertions, 36 deletions
diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index c63fe9ffa8..91c4a7c24d 100644 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@ -12,9 +12,9 @@ | obtain it through the world-wide-web, please send a note to | | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ - | Authors: Georg Richter <georg@mysql.com> | - | Andrey Hristov <andrey@mysql.com> | + | Authors: Andrey Hristov <andrey@mysql.com> | | Ulf Wendel <uwendel@mysql.com> | + | Georg Richter <georg@mysql.com> | +----------------------------------------------------------------------+ */ @@ -28,7 +28,7 @@ #include "mysqlnd_statistics.h" #include "mysqlnd_debug.h" #include "mysqlnd_block_alloc.h" - +#include "mysqlnd_ext_plugin.h" #define MYSQLND_SILENT @@ -36,8 +36,6 @@ const char * const mysqlnd_not_bound_as_blob = "Can't send long data for non-string/non-binary data types"; const char * const mysqlnd_stmt_not_prepared = "Statement not prepared"; -static struct st_mysqlnd_stmt_methods *mysqlnd_stmt_methods; - /* Exported by mysqlnd_ps_codec.c */ enum_func_status mysqlnd_stmt_execute_generate_request(MYSQLND_STMT * const s, zend_uchar ** request, size_t *request_len, zend_bool * free_buffer TSRMLS_DC); @@ -2375,7 +2373,7 @@ MYSQLND_STMT * _mysqlnd_stmt_init(MYSQLND * const conn TSRMLS_DC) if (!ret) { break; } - ret->m = mysqlnd_stmt_methods; + ret->m = mysqlnd_stmt_get_methods(); ret->persistent = conn->persistent; stmt = ret->data = mnd_pecalloc(1, sizeof(MYSQLND_STMT_DATA), conn->persistent); @@ -2417,44 +2415,15 @@ MYSQLND_STMT * _mysqlnd_stmt_init(MYSQLND * const conn TSRMLS_DC) /* }}} */ -/* {{{ _mysqlnd_plugin_get_plugin_stmt_data */ -PHPAPI void ** _mysqlnd_plugin_get_plugin_stmt_data(const MYSQLND_STMT * stmt, unsigned int plugin_id TSRMLS_DC) -{ - DBG_ENTER("_mysqlnd_plugin_get_plugin_stmt_data"); - DBG_INF_FMT("plugin_id=%u", plugin_id); - if (!stmt || plugin_id >= mysqlnd_plugin_count()) { - return NULL; - } - DBG_RETURN((void *)((char *)stmt + sizeof(MYSQLND_STMT) + plugin_id * sizeof(void *))); -} -/* }}} */ - - /* {{{ _mysqlnd_init_ps_subsystem */ void _mysqlnd_init_ps_subsystem() { - mysqlnd_stmt_methods = &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_stmt); + mysqlnd_stmt_set_methods(&MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_stmt)); _mysqlnd_init_ps_fetch_subsystem(); } /* }}} */ -/* {{{ mysqlnd_conn_get_methods */ -PHPAPI struct st_mysqlnd_stmt_methods * mysqlnd_stmt_get_methods() -{ - return mysqlnd_stmt_methods; -} -/* }}} */ - - -/* {{{ mysqlnd_conn_set_methods */ -PHPAPI void mysqlnd_stmt_set_methods(struct st_mysqlnd_stmt_methods *methods) -{ - mysqlnd_stmt_methods = methods; -} -/* }}} */ - - /* * Local variables: * tab-width: 4 |