mysqlnd_ext_plugin.h 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. /*
  2. +----------------------------------------------------------------------+
  3. | Copyright (c) The PHP Group |
  4. +----------------------------------------------------------------------+
  5. | This source file is subject to version 3.01 of the PHP license, |
  6. | that is bundled with this package in the file LICENSE, and is |
  7. | available through the world-wide-web at the following url: |
  8. | https://www.php.net/license/3_01.txt |
  9. | If you did not receive a copy of the PHP license and are unable to |
  10. | obtain it through the world-wide-web, please send a note to |
  11. | license@php.net so we can mail you a copy immediately. |
  12. +----------------------------------------------------------------------+
  13. | Authors: Andrey Hristov <andrey@php.net> |
  14. | Johannes Schlüter <johannes@php.net> |
  15. | Ulf Wendel <uw@php.net> |
  16. +----------------------------------------------------------------------+
  17. */
  18. #ifndef MYSQLND_EXT_PLUGIN_H
  19. #define MYSQLND_EXT_PLUGIN_H
  20. struct st_mysqlnd_plugin__plugin_area_getters
  21. {
  22. void ** (*get_connection_area)(const MYSQLND * conn, const unsigned int plugin_id);
  23. void ** (*get_connection_data_area)(const MYSQLND_CONN_DATA * conn, const unsigned int plugin_id);
  24. void ** (*get_result_area)(const MYSQLND_RES * result, const unsigned int plugin_id);
  25. void ** (*get_unbuffered_area)(const MYSQLND_RES_UNBUFFERED * result, const unsigned int plugin_id);
  26. void ** (*get_result_buffered_aread)(const MYSQLND_RES_BUFFERED * result, const unsigned int plugin_id);
  27. void ** (*get_stmt_area)(const MYSQLND_STMT * stmt, const unsigned int plugin_id);
  28. void ** (*get_protocol_decoder_area)(const MYSQLND_PROTOCOL_PAYLOAD_DECODER_FACTORY * factory, const unsigned int plugin_id);
  29. void ** (*get_pfc_area)(const MYSQLND_PFC * pfc, const unsigned int plugin_id);
  30. void ** (*get_vio_area)(const MYSQLND_VIO * vio, const unsigned int plugin_id);
  31. };
  32. PHPAPI extern struct st_mysqlnd_plugin__plugin_area_getters mysqlnd_plugin_area_getters;
  33. #define mysqlnd_plugin_get_plugin_connection_data(c, p_id) mysqlnd_plugin_area_getters.get_connection_area((c), (p_id))
  34. #define mysqlnd_plugin_get_plugin_connection_data_data(c, p_id) mysqlnd_plugin_area_getters.get_connection_data_area((c), (p_id))
  35. #define mysqlnd_plugin_get_plugin_result_data(res, p_id) mysqlnd_plugin_area_getters.get_result_area((res), (p_id))
  36. #define mysqlnd_plugin_get_plugin_result_unbuffered_data(res, p_id) mysqlnd_plugin_area_getters.get_unbuffered_area((res), (p_id))
  37. #define mysqlnd_plugin_get_plugin_result_buffered_data_c(res, p_id) mysqlnd_plugin_area_getters.get_result_buffered_aread((res), (p_id))
  38. #define mysqlnd_plugin_get_plugin_stmt_data(stmt, p_id) mysqlnd_plugin_area_getters.get_stmt_area((stmt), (p_id))
  39. #define mysqlnd_plugin_get_plugin_protocol_data(proto, p_id) mysqlnd_plugin_area_getters.get_protocol_decoder_area((proto), (p_id))
  40. #define mysqlnd_plugin_get_plugin_pfc_data(pfc, p_id) mysqlnd_plugin_area_getters.get_pfc_area((pfc), (p_id))
  41. #define mysqlnd_plugin_get_plugin_vio_data(vio, p_id) mysqlnd_plugin_area_getters.get_pfc_area((vio), (p_id))
  42. struct st_mysqlnd_plugin_methods_xetters
  43. {
  44. struct st_mnd_object_factory_xetters
  45. {
  46. MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) * (*get)(void);
  47. void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_object_factory) *methods);
  48. } object_factory;
  49. struct st_mnd_connection_xetters
  50. {
  51. MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn) * (*get)(void);
  52. void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn) *methods);
  53. } connection;
  54. struct st_mnd_connection_data_xetters
  55. {
  56. MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data) * (*get)(void);
  57. void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_conn_data) *methods);
  58. } connection_data;
  59. struct st_mnd_result_xetters
  60. {
  61. MYSQLND_CLASS_METHODS_TYPE(mysqlnd_res) * (*get)(void);
  62. void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_res) *methods);
  63. } result;
  64. struct st_mnd_unbuffered_result_xetters
  65. {
  66. MYSQLND_CLASS_METHODS_TYPE(mysqlnd_result_unbuffered) * (*get)(void);
  67. void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_result_unbuffered) *methods);
  68. } unbuffered_result;
  69. struct st_mnd_buffered_result_xetters
  70. {
  71. MYSQLND_CLASS_METHODS_TYPE(mysqlnd_result_buffered)* (*get)(void);
  72. void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_result_buffered) *methods);
  73. } buffered_result;
  74. struct st_mnd_stmt_xetters
  75. {
  76. MYSQLND_CLASS_METHODS_TYPE(mysqlnd_stmt) * (*get)(void);
  77. void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_stmt) * methods);
  78. } statement;
  79. struct st_mnd_protocol_xetters
  80. {
  81. MYSQLND_CLASS_METHODS_TYPE(mysqlnd_protocol_payload_decoder_factory)* (*get)(void);
  82. void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_protocol_payload_decoder_factory) *methods);
  83. } protocol;
  84. struct st_mnd_pfc_xetters
  85. {
  86. MYSQLND_CLASS_METHODS_TYPE(mysqlnd_protocol_packet_frame_codec) * (*get)(void);
  87. void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_protocol_packet_frame_codec) * methods);
  88. } pfc;
  89. struct st_mnd_vio_xetters
  90. {
  91. MYSQLND_CLASS_METHODS_TYPE(mysqlnd_vio) * (*get)(void);
  92. void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_vio) * methods);
  93. } vio;
  94. struct st_mnd_error_info_xetters
  95. {
  96. MYSQLND_CLASS_METHODS_TYPE(mysqlnd_error_info) * (*get)(void);
  97. void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_error_info) * methods);
  98. } error_info;
  99. struct st_mnd_command_xetters
  100. {
  101. MYSQLND_CLASS_METHODS_TYPE(mysqlnd_command) * (*get)(void);
  102. void (*set)(MYSQLND_CLASS_METHODS_TYPE(mysqlnd_command) * methods);
  103. } command;
  104. };
  105. PHPAPI extern struct st_mysqlnd_plugin_methods_xetters mysqlnd_plugin_methods_xetters;
  106. #define mysqlnd_object_factory_get_methods() mysqlnd_plugin_methods_xetters.object_factory.get()
  107. #define mysqlnd_object_factory_set_methods(m) mysqlnd_plugin_methods_xetters.object_factory.set((m))
  108. #define mysqlnd_conn_get_methods() mysqlnd_plugin_methods_xetters.connection.get()
  109. #define mysqlnd_conn_set_methods(m) mysqlnd_plugin_methods_xetters.connection.set((m))
  110. #define mysqlnd_conn_data_get_methods() mysqlnd_plugin_methods_xetters.connection_data.get()
  111. #define mysqlnd_conn_data_set_methods(m) mysqlnd_plugin_methods_xetters.connection_data.set((m))
  112. #define mysqlnd_result_get_methods() mysqlnd_plugin_methods_xetters.result.get()
  113. #define mysqlnd_result_set_methods(m) mysqlnd_plugin_methods_xetters.result.set((m))
  114. #define mysqlnd_result_unbuffered_get_methods() mysqlnd_plugin_methods_xetters.unbuffered_result.get()
  115. #define mysqlnd_result_unbuffered_set_methods(m) mysqlnd_plugin_methods_xetters.unbuffered_result.set((m))
  116. #define mysqlnd_result_buffered_get_methods() mysqlnd_plugin_methods_xetters.buffered_result.get()
  117. #define mysqlnd_result_buffered_set_methods(m) mysqlnd_plugin_methods_xetters.buffered_result.set((m))
  118. #define mysqlnd_stmt_get_methods() mysqlnd_plugin_methods_xetters.statement.get()
  119. #define mysqlnd_stmt_set_methods(m) mysqlnd_plugin_methods_xetters.statement.set((m))
  120. #define mysqlnd_protocol_get_methods() mysqlnd_plugin_methods_xetters.protocol.get()
  121. #define mysqlnd_protocol_set_methods(m) mysqlnd_plugin_methods_xetters.protocol.set((m))
  122. #define mysqlnd_pfc_get_methods() mysqlnd_plugin_methods_xetters.pfc.get()
  123. #define mysqlnd_pfc_set_methods(m) mysqlnd_plugin_methods_xetters.pfc.set((m))
  124. #define mysqlnd_vio_get_methods() mysqlnd_plugin_methods_xetters.vio.get()
  125. #define mysqlnd_vio_set_methods(m) mysqlnd_plugin_methods_xetters.vio.set((m))
  126. #define mysqlnd_command_get_methods() mysqlnd_plugin_methods_xetters.command.get()
  127. #define mysqlnd_command_set_methods(m) mysqlnd_plugin_methods_xetters.command.set((m))
  128. #define mysqlnd_error_info_get_methods() mysqlnd_plugin_methods_xetters.error_info.get()
  129. #define mysqlnd_error_info_set_methods(m) mysqlnd_plugin_methods_xetters.error_info.set((m))
  130. #endif /* MYSQLND_EXT_PLUGIN_H */