From e9bccffe295794a40af111eae98d589f9e218598 Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Fri, 30 Oct 2015 13:20:53 +0100 Subject: [PATCH] MNDR: - switch to macro generation of structure names for the methods --- ext/mysqlnd/mysqlnd.c | 63 ++++++++++++++++---------------- ext/mysqlnd/mysqlnd_ext_plugin.c | 57 ++++++++++++++++++++--------- ext/mysqlnd/mysqlnd_ext_plugin.h | 45 ++++++++++++++--------- ext/mysqlnd/mysqlnd_priv.h | 1 + ext/mysqlnd/mysqlnd_structs.h | 49 +++++++++++++------------ 5 files changed, 124 insertions(+), 91 deletions(-) diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c index 2b76eb6987..31a4e30a90 100644 --- a/ext/mysqlnd/mysqlnd.c +++ b/ext/mysqlnd/mysqlnd.c @@ -27,6 +27,7 @@ #include "mysqlnd_statistics.h" #include "mysqlnd_charset.h" #include "mysqlnd_debug.h" +#include "mysqlnd_ext_plugin.h" #include "zend_smart_str.h" @@ -156,7 +157,7 @@ enum_func_status mysqlnd_error_info_init(MYSQLND_ERROR_INFO * const info, zend_bool persistent) { DBG_ENTER("mysqlnd_error_info_init") - info->m = &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_error_info); + info->m = mysqlnd_error_info_get_methods(); info->m->reset(info); info->error_list = mnd_pecalloc(1, sizeof(zend_llist), persistent); @@ -420,7 +421,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_command_handle_response)( static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, set_server_option)(MYSQLND_CONN_DATA * const conn, enum_mysqlnd_server_option option) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, set_server_option); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), set_server_option); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::set_server_option"); if (PASS == conn->m->local_tx_start(conn, this_func)) { @@ -843,7 +844,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, connect)(MYSQLND_CONN_DATA * conn, unsigned int mysql_flags ) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, connect); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), connect); size_t host_len; zend_bool unix_socket = FALSE; zend_bool named_pipe = FALSE; @@ -1094,7 +1095,7 @@ MYSQLND_METHOD(mysqlnd_conn, connect)(MYSQLND * conn_handle, unsigned int mysql_flags ) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, connect); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), connect); enum_func_status ret = FAIL; MYSQLND_CONN_DATA * conn = conn_handle->data; @@ -1161,7 +1162,7 @@ PHPAPI MYSQLND * mysqlnd_connection_connect(MYSQLND * conn_handle, static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, query); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), query); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::query"); DBG_INF_FMT("conn=%p conn=%llu query=%s", conn, conn->thread_id, query); @@ -1187,7 +1188,7 @@ static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, send_query)(MYSQLND_CONN_DATA * conn, const char * query, unsigned int query_len, enum_mysqlnd_send_query_type type, zval *read_cb, zval *err_cb) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, send_query); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), send_query); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::send_query"); DBG_INF_FMT("conn=%llu query=%s", conn->thread_id, query); @@ -1216,7 +1217,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, send_query)(MYSQLND_CONN_DATA * conn, const ch static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn, enum_mysqlnd_reap_result_type type) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, reap_query); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), reap_query); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::reap_query"); DBG_INF_FMT("conn=%llu", conn->thread_id); @@ -1441,7 +1442,7 @@ mysqlnd_poll(MYSQLND **r_array, MYSQLND **e_array, MYSQLND ***dont_poll, long se MYSQLND_RES * MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const char *table, const char *achtung_wild) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, list_fields); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), list_fields); MYSQLND_RES * result = NULL; DBG_ENTER("mysqlnd_conn_data::list_fields"); DBG_INF_FMT("conn=%llu table=%s wild=%s", conn->thread_id, table? table:"",achtung_wild? achtung_wild:""); @@ -1500,7 +1501,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, list_fields)(MYSQLND_CONN_DATA * conn, const c MYSQLND_RES * MYSQLND_METHOD(mysqlnd_conn_data, list_method)(MYSQLND_CONN_DATA * conn, const char * query, const char *achtung_wild, char *par1) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, list_method); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), list_method); char * show_query = NULL; size_t show_query_len; MYSQLND_RES * result = NULL; @@ -1578,7 +1579,7 @@ static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, ssl_set)(MYSQLND_CONN_DATA * const conn, const char * key, const char * const cert, const char * const ca, const char * const capath, const char * const cipher) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, ssl_set); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), ssl_set); enum_func_status ret = FAIL; MYSQLND_NET * net = conn->net; DBG_ENTER("mysqlnd_conn_data::ssl_set"); @@ -1601,7 +1602,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, ssl_set)(MYSQLND_CONN_DATA * const conn, const static zend_ulong MYSQLND_METHOD(mysqlnd_conn_data, escape_string)(MYSQLND_CONN_DATA * const conn, char * newstr, const char * escapestr, size_t escapestr_len) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, escape_string); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), escape_string); zend_ulong ret = FAIL; DBG_ENTER("mysqlnd_conn_data::escape_string"); DBG_INF_FMT("conn=%llu", conn->thread_id); @@ -1624,7 +1625,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, escape_string)(MYSQLND_CONN_DATA * const conn, static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, dump_debug_info)(MYSQLND_CONN_DATA * const conn) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, server_dump_debug_information); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), server_dump_debug_information); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::dump_debug_info"); DBG_INF_FMT("conn=%llu", conn->thread_id); @@ -1647,7 +1648,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, dump_debug_info)(MYSQLND_CONN_DATA * const con static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, select_db)(MYSQLND_CONN_DATA * const conn, const char * const db, unsigned int db_len) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, select_db); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), select_db); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::select_db"); @@ -1689,7 +1690,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, select_db)(MYSQLND_CONN_DATA * const conn, con static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, ping)(MYSQLND_CONN_DATA * const conn) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, ping); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), ping); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::ping"); @@ -1719,7 +1720,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, ping)(MYSQLND_CONN_DATA * const conn) static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, statistic)(MYSQLND_CONN_DATA * conn, zend_string **message) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, get_server_statistics); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), get_server_statistics); enum_func_status ret = FAIL; MYSQLND_PACKET_STATS * stats_header; @@ -1762,7 +1763,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, statistic)(MYSQLND_CONN_DATA * conn, zend_stri static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, kill)(MYSQLND_CONN_DATA * conn, unsigned int pid) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, kill_connection); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), kill_connection); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::kill"); @@ -1798,7 +1799,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, kill)(MYSQLND_CONN_DATA * conn, unsigned int p static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, set_charset)(MYSQLND_CONN_DATA * const conn, const char * const csname) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, set_charset); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), set_charset); enum_func_status ret = FAIL; const MYSQLND_CHARSET * const charset = mysqlnd_find_charset_name(csname); @@ -1837,7 +1838,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_charset)(MYSQLND_CONN_DATA * const conn, c static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, refresh)(MYSQLND_CONN_DATA * const conn, uint8_t options) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, refresh_server); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), refresh_server); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::refresh"); DBG_INF_FMT("conn=%llu options=%lu", conn->thread_id, options); @@ -1859,7 +1860,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, refresh)(MYSQLND_CONN_DATA * const conn, uint8 static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, shutdown)(MYSQLND_CONN_DATA * const conn, uint8_t level) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, shutdown_server); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), shutdown_server); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::shutdown"); DBG_INF_FMT("conn=%llu level=%lu", conn->thread_id, level); @@ -2152,7 +2153,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, more_results)(const MYSQLND_CONN_DATA * const static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, next_result)(MYSQLND_CONN_DATA * const conn) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, next_result); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), next_result); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::next_result"); @@ -2260,7 +2261,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, change_user)(MYSQLND_CONN_DATA * const conn, size_t passwd_len ) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, change_user); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), change_user); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::change_user"); @@ -2308,7 +2309,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option)(MYSQLND_CONN_DATA * const c const char * const value ) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, set_client_option); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), set_client_option); enum_func_status ret = PASS; DBG_ENTER("mysqlnd_conn_data::set_client_option"); DBG_INF_FMT("conn=%llu option=%u", conn->thread_id, option); @@ -2479,7 +2480,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option_2d)(MYSQLND_CONN_DATA * cons const char * const value ) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, set_client_option_2d); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), set_client_option_2d); enum_func_status ret = PASS; DBG_ENTER("mysqlnd_conn_data::set_client_option_2d"); DBG_INF_FMT("conn=%llu option=%u", conn->thread_id, option); @@ -2522,7 +2523,7 @@ end: static MYSQLND_RES * MYSQLND_METHOD(mysqlnd_conn_data, use_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, use_result); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), use_result); MYSQLND_RES * result = NULL; DBG_ENTER("mysqlnd_conn_data::use_result"); @@ -2564,7 +2565,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, use_result)(MYSQLND_CONN_DATA * const conn, co static MYSQLND_RES * MYSQLND_METHOD(mysqlnd_conn_data, store_result)(MYSQLND_CONN_DATA * const conn, const unsigned int flags) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, store_result); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), store_result); MYSQLND_RES * result = NULL; DBG_ENTER("mysqlnd_conn_data::store_result"); @@ -2633,7 +2634,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, get_connection_stats)(const MYSQLND_CONN_DATA static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, set_autocommit)(MYSQLND_CONN_DATA * conn, unsigned int mode) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, set_autocommit); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), set_autocommit); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::set_autocommit"); @@ -2744,7 +2745,7 @@ mysqlnd_escape_string_for_tx_name_in_comment(const char * const name) static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * conn, const zend_bool commit, const unsigned int flags, const char * const name) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, tx_commit_or_rollback); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), tx_commit_or_rollback); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::tx_commit_or_rollback"); @@ -2788,7 +2789,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_commit_or_rollback)(MYSQLND_CONN_DATA * con static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsigned int mode, const char * const name) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, tx_begin); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), tx_begin); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::tx_begin"); @@ -2850,7 +2851,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_begin)(MYSQLND_CONN_DATA * conn, const unsi static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint)(MYSQLND_CONN_DATA * conn, const char * const name) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, tx_savepoint); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), tx_savepoint); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::tx_savepoint"); @@ -2882,7 +2883,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint)(MYSQLND_CONN_DATA * conn, const static enum_func_status MYSQLND_METHOD(mysqlnd_conn_data, tx_savepoint_release)(MYSQLND_CONN_DATA * conn, const char * const name) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_data_methods, tx_savepoint_release); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data), tx_savepoint_release); enum_func_status ret = FAIL; DBG_ENTER("mysqlnd_conn_data::tx_savepoint_release"); @@ -3094,7 +3095,7 @@ MYSQLND_METHOD_PRIVATE(mysqlnd_conn, dtor)(MYSQLND * conn) static enum_func_status MYSQLND_METHOD(mysqlnd_conn, close)(MYSQLND * conn_handle, enum_connection_close_type close_type) { - const size_t this_func = STRUCT_OFFSET(struct st_mysqlnd_conn_methods, close); + const size_t this_func = STRUCT_OFFSET(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn), close); MYSQLND_CONN_DATA * conn = conn_handle->data; enum_func_status ret = FAIL; diff --git a/ext/mysqlnd/mysqlnd_ext_plugin.c b/ext/mysqlnd/mysqlnd_ext_plugin.c index 52ca9055b8..8048a2a67e 100644 --- a/ext/mysqlnd/mysqlnd_ext_plugin.c +++ b/ext/mysqlnd/mysqlnd_ext_plugin.c @@ -169,7 +169,7 @@ struct st_mysqlnd_plugin__plugin_area_getters mysqlnd_plugin_area_getters = /* {{{ _mysqlnd_object_factory_get_methods */ -static struct st_mysqlnd_object_factory_methods * +static MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) * _mysqlnd_object_factory_get_methods() { return &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory); @@ -178,7 +178,7 @@ _mysqlnd_object_factory_get_methods() /* {{{ mysqlnd_conn_set_methods */ static void -_mysqlnd_object_factory_set_methods(struct st_mysqlnd_object_factory_methods *methods) +_mysqlnd_object_factory_set_methods(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *methods) { MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_object_factory) = *methods; } @@ -186,7 +186,7 @@ _mysqlnd_object_factory_set_methods(struct st_mysqlnd_object_factory_methods *me /* {{{ _mysqlnd_conn_get_methods */ -static struct st_mysqlnd_conn_methods * +static MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn) * _mysqlnd_conn_get_methods() { return mysqlnd_conn_methods; @@ -195,7 +195,7 @@ _mysqlnd_conn_get_methods() /* {{{ _mysqlnd_conn_set_methods */ static void -_mysqlnd_conn_set_methods(struct st_mysqlnd_conn_methods *methods) +_mysqlnd_conn_set_methods(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn) *methods) { mysqlnd_conn_methods = methods; } @@ -203,7 +203,7 @@ _mysqlnd_conn_set_methods(struct st_mysqlnd_conn_methods *methods) /* {{{ _mysqlnd_conn_data_get_methods */ -static struct st_mysqlnd_conn_data_methods * +static MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data) * _mysqlnd_conn_data_get_methods() { return mysqlnd_conn_data_methods; @@ -212,7 +212,7 @@ _mysqlnd_conn_data_get_methods() /* {{{ _mysqlnd_conn_data_set_methods */ static void -_mysqlnd_conn_data_set_methods(struct st_mysqlnd_conn_data_methods * methods) +_mysqlnd_conn_data_set_methods(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data) * methods) { mysqlnd_conn_data_methods = methods; } @@ -220,7 +220,7 @@ _mysqlnd_conn_data_set_methods(struct st_mysqlnd_conn_data_methods * methods) /* {{{ _mysqlnd_result_get_methods */ -static struct st_mysqlnd_res_methods * +static MYSQLND_CLASS_METHODS_TYPE(mysqlnd_res) * _mysqlnd_result_get_methods() { return &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_res); @@ -230,7 +230,7 @@ _mysqlnd_result_get_methods() /* {{{ _mysqlnd_result_set_methods */ static void -_mysqlnd_result_set_methods(struct st_mysqlnd_res_methods * methods) +_mysqlnd_result_set_methods(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_res) * methods) { MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_res) = *methods; } @@ -238,7 +238,7 @@ _mysqlnd_result_set_methods(struct st_mysqlnd_res_methods * methods) /* {{{ _mysqlnd_result_unbuffered_get_methods */ -static struct st_mysqlnd_result_unbuffered_methods * +static MYSQLND_CLASS_METHODS_TYPE(mysqlnd_result_unbuffered) * _mysqlnd_result_unbuffered_get_methods() { return &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_result_unbuffered); @@ -248,7 +248,7 @@ _mysqlnd_result_unbuffered_get_methods() /* {{{ _mysqlnd_result_unbuffered_set_methods */ static void -_mysqlnd_result_unbuffered_set_methods(struct st_mysqlnd_result_unbuffered_methods * methods) +_mysqlnd_result_unbuffered_set_methods(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_result_unbuffered) * methods) { MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_result_unbuffered) = *methods; } @@ -256,7 +256,7 @@ _mysqlnd_result_unbuffered_set_methods(struct st_mysqlnd_result_unbuffered_metho /* {{{ _mysqlnd_result_buffered_get_methods */ -static struct st_mysqlnd_result_buffered_methods * +static MYSQLND_CLASS_METHODS_TYPE(mysqlnd_result_buffered) * _mysqlnd_result_buffered_get_methods() { return &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_result_buffered); @@ -266,7 +266,7 @@ _mysqlnd_result_buffered_get_methods() /* {{{ _mysqlnd_result_buffered_set_methods */ static void -_mysqlnd_result_buffered_set_methods(struct st_mysqlnd_result_buffered_methods * methods) +_mysqlnd_result_buffered_set_methods(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_result_buffered) * methods) { MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_result_buffered) = *methods; } @@ -274,7 +274,7 @@ _mysqlnd_result_buffered_set_methods(struct st_mysqlnd_result_buffered_methods * /* {{{ _mysqlnd_stmt_get_methods */ -static struct st_mysqlnd_stmt_methods * +static MYSQLND_CLASS_METHODS_TYPE(mysqlnd_stmt) * _mysqlnd_stmt_get_methods() { return mysqlnd_stmt_methods; @@ -284,7 +284,7 @@ _mysqlnd_stmt_get_methods() /* {{{ _mysqlnd_stmt_set_methods */ static void -_mysqlnd_stmt_set_methods(struct st_mysqlnd_stmt_methods *methods) +_mysqlnd_stmt_set_methods(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_stmt) *methods) { mysqlnd_stmt_methods = methods; } @@ -292,7 +292,7 @@ _mysqlnd_stmt_set_methods(struct st_mysqlnd_stmt_methods *methods) /* {{{ _mysqlnd_protocol_payload_decoder_factory_get_methods */ -static struct st_mysqlnd_protocol_payload_decoder_factory_methods * +static MYSQLND_CLASS_METHODS_TYPE(mysqlnd_protocol_payload_decoder_factory) * _mysqlnd_protocol_payload_decoder_factory_get_methods() { return &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_protocol_payload_decoder_factory); @@ -302,7 +302,7 @@ _mysqlnd_protocol_payload_decoder_factory_get_methods() /* {{{ _mysqlnd_protocol_payload_decoder_factory_set_methods */ static void -_mysqlnd_protocol_payload_decoder_factory_set_methods(struct st_mysqlnd_protocol_payload_decoder_factory_methods * methods) +_mysqlnd_protocol_payload_decoder_factory_set_methods(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_protocol_payload_decoder_factory) * methods) { MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_protocol_payload_decoder_factory) = *methods; } @@ -310,7 +310,7 @@ _mysqlnd_protocol_payload_decoder_factory_set_methods(struct st_mysqlnd_protocol /* {{{ _mysqlnd_net_get_methods */ -static struct st_mysqlnd_net_methods * +static MYSQLND_CLASS_METHODS_TYPE(mysqlnd_net) * _mysqlnd_net_get_methods() { return &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_net); @@ -320,7 +320,7 @@ _mysqlnd_net_get_methods() /* {{{ _mysqlnd_net_set_methods */ static void -_mysqlnd_net_set_methods(struct st_mysqlnd_net_methods * methods) +_mysqlnd_net_set_methods(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_net) * methods) { MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_net) = *methods; } @@ -345,6 +345,23 @@ _mysqlnd_command_factory_set(func_mysqlnd__command_factory factory) /* }}} */ +/* {{{ _mysqlnd_error_info_get_methods */ +static MYSQLND_CLASS_METHODS_TYPE(mysqlnd_error_info) * +_mysqlnd_error_info_get_methods() +{ + return &MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_error_info); +} +/* }}} */ + + +/* {{{ _mysqlnd_error_info_set_methods */ +static void +_mysqlnd_error_info_set_methods(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_error_info) *methods) +{ + MYSQLND_CLASS_METHOD_TABLE_NAME(mysqlnd_error_info) = *methods; +} +/* }}} */ + struct st_mysqlnd_plugin_methods_xetters mysqlnd_plugin_methods_xetters = { @@ -384,6 +401,10 @@ struct st_mysqlnd_plugin_methods_xetters mysqlnd_plugin_methods_xetters = _mysqlnd_net_get_methods, _mysqlnd_net_set_methods, }, + { + _mysqlnd_error_info_get_methods, + _mysqlnd_error_info_set_methods, + }, { _mysqlnd_command_factory_get, _mysqlnd_command_factory_set, diff --git a/ext/mysqlnd/mysqlnd_ext_plugin.h b/ext/mysqlnd/mysqlnd_ext_plugin.h index b136e5e58f..f994ba018a 100644 --- a/ext/mysqlnd/mysqlnd_ext_plugin.h +++ b/ext/mysqlnd/mysqlnd_ext_plugin.h @@ -51,58 +51,64 @@ struct st_mysqlnd_plugin_methods_xetters { struct st_mnd_object_factory_xetters { - struct st_mysqlnd_object_factory_methods * (*get)(); - void (*set)(struct st_mysqlnd_object_factory_methods * methods); + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) * (*get)(); + void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *methods); } object_factory; struct st_mnd_connection_xetters { - struct st_mysqlnd_conn_methods * (*get)(); - void (*set)(struct st_mysqlnd_conn_methods * methods); + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn) * (*get)(); + void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn) *methods); } connection; struct st_mnd_connection_data_xetters { - struct st_mysqlnd_conn_data_methods * (*get)(); - void (*set)(struct st_mysqlnd_conn_data_methods * methods); + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data) * (*get)(); + void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data) *methods); } connection_data; struct st_mnd_result_xetters { - struct st_mysqlnd_res_methods * (*get)(); - void (*set)(struct st_mysqlnd_res_methods * methods); + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_res) * (*get)(); + void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_res) *methods); } result; struct st_mnd_unbuffered_result_xetters { - struct st_mysqlnd_result_unbuffered_methods * (*get)(); - void (*set)(struct st_mysqlnd_result_unbuffered_methods * methods); + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_result_unbuffered) * (*get)(); + void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_result_unbuffered) *methods); } unbuffered_result; struct st_mnd_buffered_result_xetters { - struct st_mysqlnd_result_buffered_methods * (*get)(); - void (*set)(struct st_mysqlnd_result_buffered_methods * methods); + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_result_buffered)* (*get)(); + void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_result_buffered) *methods); } buffered_result; struct st_mnd_stmt_xetters { - struct st_mysqlnd_stmt_methods * (*get)(); - void (*set)(struct st_mysqlnd_stmt_methods * methods); + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_stmt) * (*get)(); + void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_stmt) * methods); } statement; struct st_mnd_protocol_xetters { - struct st_mysqlnd_protocol_payload_decoder_factory_methods * (*get)(); - void (*set)(struct st_mysqlnd_protocol_payload_decoder_factory_methods * methods); + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_protocol_payload_decoder_factory)* (*get)(); + void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_protocol_payload_decoder_factory) *methods); } protocol; struct st_mnd_io_xetters { - struct st_mysqlnd_net_methods * (*get)(); - void (*set)(struct st_mysqlnd_net_methods * methods); + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_net) * (*get)(); + void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_net) * methods); } io; + struct st_mnd_error_info_xetters + { + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_error_info) * (*get)(); + void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_error_info) * methods); + } error_info; + struct st_mnd_command_factory_xetters { func_mysqlnd__command_factory (*get)(); @@ -144,6 +150,9 @@ extern struct st_mysqlnd_plugin_methods_xetters mysqlnd_plugin_methods_xetters; #define mysqlnd_command_factory_get() mysqlnd_plugin_methods_xetters.command_factory.get() #define mysqlnd_command_factory_set(m) mysqlnd_plugin_methods_xetters.command_factory.set((m)) +#define mysqlnd_error_info_get_methods() mysqlnd_plugin_methods_xetters.error_info.get() +#define mysqlnd_error_info_set_methods(m) mysqlnd_plugin_methods_xetters.error_info.set((m)) + #endif /* MYSQLND_EXT_PLUGIN_H */ /* diff --git a/ext/mysqlnd/mysqlnd_priv.h b/ext/mysqlnd/mysqlnd_priv.h index 778481c255..42a139ef0b 100644 --- a/ext/mysqlnd/mysqlnd_priv.h +++ b/ext/mysqlnd/mysqlnd_priv.h @@ -145,6 +145,7 @@ PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_result_buffered); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_protocol_payload_decoder_factory); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_net); PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_upsert_status); +PHPAPI extern MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(mysqlnd_error_info); enum_func_status mysqlnd_handle_local_infile(MYSQLND_CONN_DATA * conn, const char * filename, zend_bool * is_warning); diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index 3eb1d77e03..7154fdb256 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -28,6 +28,7 @@ #define MYSQLND_TYPEDEFED_METHODS #define MYSQLND_CLASS_METHOD_TABLE_NAME(class) mysqlnd_##class##_methods +#define MYSQLND_CLASS_METHODS_TYPE(class) struct st_##class##_methods #define MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(class) struct st_##class##_methods #define MYSQLND_CLASS_METHOD_TABLE_NAME_FORWARD(class) MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(class) MYSQLND_CLASS_METHOD_TABLE_NAME(class) @@ -103,7 +104,7 @@ typedef struct st_mysqlnd_upsert_status MYSQLND_UPSERT_STATUS; typedef void (*func_mysqlnd_upsert_status__reset)(MYSQLND_UPSERT_STATUS * const upsert_status); typedef void (*func_mysqlnd_upsert_status__set_affected_rows_to_error)(MYSQLND_UPSERT_STATUS * const upsert_status); -MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_upsert_status) +MYSQLND_CLASS_METHODS_TYPE(mysqlnd_upsert_status) { func_mysqlnd_upsert_status__reset reset; func_mysqlnd_upsert_status__set_affected_rows_to_error set_affected_rows_to_error; @@ -126,7 +127,7 @@ typedef void (*func_mysqlnd_error_info__reset)(MYSQLND_ERROR_INFO * const info); typedef void (*func_mysqlnd_error_info__set_client_error)(MYSQLND_ERROR_INFO * const info, const unsigned int err_no, const char * const sqlstate, const char * const error); -MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_error_info) +MYSQLND_CLASS_METHODS_TYPE(mysqlnd_error_info) { func_mysqlnd_error_info__reset reset; func_mysqlnd_error_info__set_client_error set_client_error; @@ -139,7 +140,7 @@ struct st_mysqlnd_error_info unsigned int error_no; zend_llist * error_list; - MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_error_info) *m; + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_error_info) *m; }; @@ -330,7 +331,7 @@ typedef func_mysqlnd_net__open_stream (*func_mysqlnd_net__get_open_stream)(MYSQL typedef void (*func_mysqlnd_net__post_connect_set_opt)(MYSQLND_NET * const net, const char * const scheme, const size_t scheme_len, MYSQLND_STATS * const conn_stats, MYSQLND_ERROR_INFO * const error_info); typedef enum_func_status (*func_mysqlnd_net__read_compressed_packet_from_stream_and_fill_read_buffer)(MYSQLND_NET * net, size_t net_payload_size, MYSQLND_STATS * conn_stats, MYSQLND_ERROR_INFO * error_info); -MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_net) +MYSQLND_CLASS_METHODS_TYPE(mysqlnd_net) { func_mysqlnd_net__init init; func_mysqlnd_net__dtor dtor; @@ -401,7 +402,7 @@ typedef struct st_mysqlnd_packet_chg_user_resp*(*func_mysqlnd_protocol_payload_d typedef struct st_mysqlnd_packet_sha256_pk_request *(*func_mysqlnd_protocol_payload_decoder_factory__get_sha256_pk_request_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent); typedef struct st_mysqlnd_packet_sha256_pk_request_response *(*func_mysqlnd_protocol_payload_decoder_factory__get_sha256_pk_request_response_packet)(MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * const factory, zend_bool persistent); -MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_protocol_payload_decoder_factory) +MYSQLND_CLASS_METHODS_TYPE(mysqlnd_protocol_payload_decoder_factory) { func_mysqlnd_protocol_payload_decoder_factory__get_mysqlnd_conn_data get_mysqlnd_conn_data; func_mysqlnd_protocol_payload_decoder_factory__get_greet_packet get_greet_packet; @@ -426,7 +427,7 @@ MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_protocol_payload_decoder_factory) }; -MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_object_factory); +MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory); typedef MYSQLND * (*func_mysqlnd_object_factory__get_connection)(struct st_mysqlnd_object_factory_methods * factory, zend_bool persistent); typedef MYSQLND * (*func_mysqlnd_object_factory__clone_connection_object)(MYSQLND * conn); @@ -435,7 +436,7 @@ typedef MYSQLND_NET * (*func_mysqlnd_object_factory__get_io_channel)(zend_bool p typedef MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * (*func_mysqlnd_object_factory__get_protocol_payload_decoder_factory)(MYSQLND_CONN_DATA * conn, zend_bool persistent); -MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_object_factory) +MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) { func_mysqlnd_object_factory__get_connection get_connection; func_mysqlnd_object_factory__clone_connection_object clone_connection_object; @@ -537,7 +538,7 @@ typedef unsigned int (*func_mysqlnd_conn_data__negotiate_client_api_capabilitie typedef unsigned int (*func_mysqlnd_conn_data__get_client_api_capabilities)(const MYSQLND_CONN_DATA * const conn); -MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_conn_data) +MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data) { func_mysqlnd_conn_data__connect connect; func_mysqlnd_conn_data__escape_string escape_string; @@ -637,7 +638,7 @@ typedef MYSQLND * (*func_mysqlnd_conn__clone_object)(MYSQLND * const conn); typedef void (*func_mysqlnd_conn__dtor)(MYSQLND * conn); typedef enum_func_status (*func_mysqlnd_conn__close)(MYSQLND * conn, enum_connection_close_type close_type); -MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_conn) +MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn) { func_mysqlnd_data__connect connect; func_mysqlnd_conn__clone_object clone_object; @@ -681,7 +682,7 @@ typedef void (*func_mysqlnd_res__unbuffered_free_last_data)(MYSQLND_RES *resu typedef MYSQLND_RES_METADATA * (*func_mysqlnd_res__result_meta_init)(unsigned int field_count, zend_bool persistent); -MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_res) +MYSQLND_CLASS_METHODS_TYPE(mysqlnd_res) { mysqlnd_fetch_row_func fetch_row; @@ -723,7 +724,7 @@ typedef zend_ulong * (*func_mysqlnd_result_unbuffered__fetch_lengths)(MYSQLND_R typedef void (*func_mysqlnd_result_unbuffered__free_last_data)(MYSQLND_RES_UNBUFFERED * result, MYSQLND_STATS * const global_stats); typedef void (*func_mysqlnd_result_unbuffered__free_result)(MYSQLND_RES_UNBUFFERED * const result, MYSQLND_STATS * const global_stats); -MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_result_unbuffered) +MYSQLND_CLASS_METHODS_TYPE(mysqlnd_result_unbuffered) { mysqlnd_fetch_row_func fetch_row; func_mysqlnd_res__row_decoder row_decoder; @@ -740,7 +741,7 @@ typedef zend_ulong * (*func_mysqlnd_result_buffered__fetch_lengths)(MYSQLND_RES typedef enum_func_status (*func_mysqlnd_result_buffered__data_seek)(MYSQLND_RES_BUFFERED * const result, const uint64_t row); typedef void (*func_mysqlnd_result_buffered__free_result)(MYSQLND_RES_BUFFERED * const result); -MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_result_buffered) +MYSQLND_CLASS_METHODS_TYPE(mysqlnd_result_buffered) { mysqlnd_fetch_row_func fetch_row; func_mysqlnd_res__row_decoder row_decoder; @@ -761,7 +762,7 @@ typedef enum_func_status (*func_mysqlnd_res_meta__read_metadata)(MYSQLND_RES_ME typedef MYSQLND_RES_METADATA * (*func_mysqlnd_res_meta__clone_metadata)(const MYSQLND_RES_METADATA * const meta, zend_bool persistent); typedef void (*func_mysqlnd_res_meta__free_metadata)(MYSQLND_RES_METADATA * meta); -MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_res_meta) +MYSQLND_CLASS_METHODS_TYPE(mysqlnd_res_meta) { func_mysqlnd_res_meta__fetch_field fetch_field; func_mysqlnd_res_meta__fetch_field_direct fetch_field_direct; @@ -818,7 +819,7 @@ typedef void (*func_mysqlnd_stmt__free_stmt_content)(MYSQLND_STMT * const s) typedef enum_func_status (*func_mysqlnd_stmt__flush)(MYSQLND_STMT * const stmt); typedef void (*func_mysqlnd_stmt__free_stmt_result)(MYSQLND_STMT * const s); -MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_stmt) +MYSQLND_CLASS_METHODS_TYPE(mysqlnd_stmt) { func_mysqlnd_stmt__prepare prepare; func_mysqlnd_stmt__send_execute send_execute; @@ -894,7 +895,7 @@ struct st_mysqlnd_net_data zend_bool persistent; - MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_net) m; + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_net) m; }; @@ -923,7 +924,7 @@ struct st_mysqlnd_protocol_payload_decoder_factory { MYSQLND_CONN_DATA * conn; zend_bool persistent; - MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_protocol_payload_decoder_factory) m; + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_protocol_payload_decoder_factory) m; }; @@ -1013,10 +1014,10 @@ struct st_mysqlnd_connection_data zend_bool in_async_read_cb; zend_bool in_async_err_cb; - MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_object_factory) object_factory; + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) object_factory; func_mysqlnd__command_factory command_factory; - MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_conn_data) * m; + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data) * m; /* persistent connection */ zend_bool persistent; @@ -1027,7 +1028,7 @@ struct st_mysqlnd_connection { MYSQLND_CONN_DATA * data; zend_bool persistent; - MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_conn) * m; + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn) * m; }; @@ -1043,7 +1044,7 @@ struct st_mysqlnd_result_metadata MYSQLND_FIELD *fields; struct mysqlnd_field_hash_key *zend_hash_keys; - MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_res_meta) * m; + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_res_meta) * m; size_t bit_fields_total_len; /* trailing \0 not counted */ /* We need this to make fast allocs in rowp_read */ @@ -1073,7 +1074,7 @@ struct st_mysqlnd_result_metadata unsigned int field_count; \ zend_bool ps; \ zend_bool persistent; \ - MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_result_buffered) m; \ + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_result_buffered) m; \ enum mysqlnd_buffered_type type; \ void * unused1; \ void * unused2; \ @@ -1106,7 +1107,7 @@ struct st_mysqlnd_buffered_result_c struct st_mysqlnd_unbuffered_result { - MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_result_unbuffered) m; + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_result_unbuffered) m; uint64_t row_count; /* For unbuffered (both normal and PS) */ @@ -1147,7 +1148,7 @@ struct st_mysqlnd_res MYSQLND_RES_UNBUFFERED *unbuf; zend_bool persistent; - MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_res) m; + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_res) m; }; @@ -1206,7 +1207,7 @@ struct st_mysqlnd_stmt_data struct st_mysqlnd_stmt { MYSQLND_STMT_DATA * data; - MYSQLND_CLASS_METHOD_TABLE_NAME_DECL(mysqlnd_stmt) * m; + MYSQLND_CLASS_METHODS_TYPE(mysqlnd_stmt) * m; zend_bool persistent; }; -- 2.40.0