123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214 |
- #ifndef MYSQL_CLIENT_PLUGIN_INCLUDED
- #define MYSQL_CLIENT_PLUGIN_INCLUDED
- #ifndef MYSQL_ABI_CHECK
- #include <stdarg.h>
- #include <stdlib.h>
- #endif
- #undef MYSQL_PLUGIN_EXPORT
- #if defined(_MSC_VER)
- #if defined(MYSQL_DYNAMIC_PLUGIN)
- #ifdef __cplusplus
- #define MYSQL_PLUGIN_EXPORT extern "C" __declspec(dllexport)
- #else
- #define MYSQL_PLUGIN_EXPORT __declspec(dllexport)
- #endif
- #else /* MYSQL_DYNAMIC_PLUGIN */
- #ifdef __cplusplus
- #define MYSQL_PLUGIN_EXPORT extern "C"
- #else
- #define MYSQL_PLUGIN_EXPORT
- #endif
- #endif /*MYSQL_DYNAMIC_PLUGIN */
- #else /*_MSC_VER */
- #define MYSQL_PLUGIN_EXPORT
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define MYSQL_CLIENT_reserved1 0
- #define MYSQL_CLIENT_reserved2 1
- #define MYSQL_CLIENT_AUTHENTICATION_PLUGIN 2
- #define MYSQL_CLIENT_TRACE_PLUGIN 3
- #define MYSQL_CLIENT_AUTHENTICATION_PLUGIN_INTERFACE_VERSION 0x0100
- #define MYSQL_CLIENT_TRACE_PLUGIN_INTERFACE_VERSION 0x0100
- #define MYSQL_CLIENT_MAX_PLUGINS 4
- #define mysql_declare_client_plugin(X) \
- MYSQL_PLUGIN_EXPORT struct st_mysql_client_plugin_ ## X \
- _mysql_client_plugin_declaration_ = { \
- MYSQL_CLIENT_ ## X ## _PLUGIN, \
- MYSQL_CLIENT_ ## X ## _PLUGIN_INTERFACE_VERSION,
- #define mysql_end_client_plugin }
- #define MYSQL_CLIENT_PLUGIN_HEADER \
- int type; \
- unsigned int interface_version; \
- const char *name; \
- const char *author; \
- const char *desc; \
- unsigned int version[3]; \
- const char *license; \
- void *mysql_api; \
- int (*init)(char *, size_t, int, va_list); \
- int (*deinit)(void); \
- int (*options)(const char *option, const void *);
- struct st_mysql_client_plugin
- {
- MYSQL_CLIENT_PLUGIN_HEADER
- };
- struct st_mysql;
- #include "plugin_auth_common.h"
- struct st_mysql_client_plugin_AUTHENTICATION
- {
- MYSQL_CLIENT_PLUGIN_HEADER
- int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, struct st_mysql *mysql);
- };
- struct st_mysql_client_plugin *
- mysql_load_plugin(struct st_mysql *mysql, const char *name, int type,
- int argc, ...);
- struct st_mysql_client_plugin *
- mysql_load_plugin_v(struct st_mysql *mysql, const char *name, int type,
- int argc, va_list args);
- struct st_mysql_client_plugin *
- mysql_client_find_plugin(struct st_mysql *mysql, const char *name, int type);
- struct st_mysql_client_plugin *
- mysql_client_register_plugin(struct st_mysql *mysql,
- struct st_mysql_client_plugin *plugin);
- int mysql_plugin_options(struct st_mysql_client_plugin *plugin,
- const char *option, const void *value);
- #ifdef __cplusplus
- }
- #endif
- #endif
|