MySQL offers plugin API, with which you can add different types of plugins to the server. The API is roughly the same for all plugin types: you implement an init() function, a deinit(); you declare status variables and global variables associated with your plugin, and of course you implement the particular implementation of plugin call.
I wish to discuss the creation and use of global variables for plugins.
Consider the following declaration of a global variable in audit_login:
[Read more...]static MYSQL_SYSVAR_BOOL(enabled, plugin_enabled, PLUGIN_VAR_NOCMDARG, "enable/disable the plugin's operation, namely writing to file", NULL, NULL, 1); static struct