diff options
author | unknown <serg@janus.mylan> | 2006-09-06 10:22:59 +0200 |
---|---|---|
committer | unknown <serg@janus.mylan> | 2006-09-06 10:22:59 +0200 |
commit | 71681467ca582a459c624832e367f2b91ee3e05c (patch) | |
tree | 61c39455efe9b4edb6a92e0b160e31005116d580 /sql/sql_plugin.h | |
parent | 6e5c98ea76590dc6e7e4d93c363f8ed336346040 (diff) | |
download | mariadb-git-71681467ca582a459c624832e367f2b91ee3e05c.tar.gz |
converting plugin states to bitmask to simplify testing.
state_mask argument to plugin_foreach()
sql/sql_show.cc:
state_mask argument to plugin_foreach()
Diffstat (limited to 'sql/sql_plugin.h')
-rw-r--r-- | sql/sql_plugin.h | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/sql/sql_plugin.h b/sql/sql_plugin.h index ed7ba36ac84..fa3440f7f68 100644 --- a/sql/sql_plugin.h +++ b/sql/sql_plugin.h @@ -31,13 +31,17 @@ typedef struct st_mysql_show_var SHOW_VAR; #define MYSQL_ANY_PLUGIN -1 -enum enum_plugin_state -{ - PLUGIN_IS_FREED= 0, - PLUGIN_IS_DELETED, - PLUGIN_IS_UNINITIALIZED, - PLUGIN_IS_READY -}; +/* + different values of st_plugin_int::state + though they look like a bitmap, plugin may only + be in one of those eigenstates, not in a superposition of them :) + It's a bitmap, because it makes it easier to test + "whether the state is one of those..." +*/ +#define PLUGIN_IS_FREED 1 +#define PLUGIN_IS_DELETED 2 +#define PLUGIN_IS_UNINITIALIZED 4 +#define PLUGIN_IS_READY 8 /* A handle for the dynamic library containing a plugin or plugins. */ @@ -57,7 +61,7 @@ struct st_plugin_int LEX_STRING name; struct st_mysql_plugin *plugin; struct st_plugin_dl *plugin_dl; - enum enum_plugin_state state; + uint state; uint ref_count; /* number of threads using the plugin */ void *data; /* plugin type specific, e.g. handlerton */ }; @@ -78,6 +82,7 @@ extern my_bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name); typedef my_bool (plugin_foreach_func)(THD *thd, st_plugin_int *plugin, void *arg); -extern my_bool plugin_foreach(THD *thd, plugin_foreach_func *func, - int type, void *arg); +#define plugin_foreach(A,B,C,D) plugin_foreach_with_mask(A,B,C,PLUGIN_IS_READY,D) +extern my_bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func, + int type, uint state_mask, void *arg); #endif |