1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1
/* Copyright (C) 2005 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
21
17
* @TODO There is plugin.h and also sql_plugin.h. Ostensibly,
122
118
extern int plugin_init(int *argc, char **argv, int init_flags);
123
119
extern void plugin_shutdown(void);
124
extern void my_print_help_inc_plugins(struct my_option *options, uint32_t size);
120
extern void my_print_help_inc_plugins(struct my_option *options, uint size);
125
121
extern bool plugin_is_ready(const LEX_STRING *name, int type);
126
122
#define my_plugin_lock_by_name(A,B,C) plugin_lock_by_name(A,B,C CALLER_INFO)
127
123
#define my_plugin_lock_by_name_ci(A,B,C) plugin_lock_by_name(A,B,C ORIG_CALLER_INFO)
128
124
#define my_plugin_lock(A,B) plugin_lock(A,B CALLER_INFO)
129
125
#define my_plugin_lock_ci(A,B) plugin_lock(A,B ORIG_CALLER_INFO)
130
extern plugin_ref plugin_lock(Session *session, plugin_ref *ptr CALLER_INFO_PROTO);
131
extern plugin_ref plugin_lock_by_name(Session *session, const LEX_STRING *name,
126
extern plugin_ref plugin_lock(THD *thd, plugin_ref *ptr CALLER_INFO_PROTO);
127
extern plugin_ref plugin_lock_by_name(THD *thd, const LEX_STRING *name,
132
128
int type CALLER_INFO_PROTO);
133
extern void plugin_unlock(Session *session, plugin_ref plugin);
134
extern void plugin_unlock_list(Session *session, plugin_ref *list, uint32_t count);
135
extern bool mysql_install_plugin(Session *session, const LEX_STRING *name,
129
extern void plugin_unlock(THD *thd, plugin_ref plugin);
130
extern void plugin_unlock_list(THD *thd, plugin_ref *list, uint count);
131
extern bool mysql_install_plugin(THD *thd, const LEX_STRING *name,
136
132
const LEX_STRING *dl);
137
extern bool mysql_uninstall_plugin(Session *session, const LEX_STRING *name);
133
extern bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name);
138
134
extern bool plugin_register_builtin(struct st_mysql_plugin *plugin);
139
extern void plugin_sessionvar_init(Session *session);
140
extern void plugin_sessionvar_cleanup(Session *session);
135
extern void plugin_thdvar_init(THD *thd);
136
extern void plugin_thdvar_cleanup(THD *thd);
142
typedef bool (plugin_foreach_func)(Session *session,
138
typedef bool (plugin_foreach_func)(THD *thd,
143
139
plugin_ref plugin,
145
141
#define plugin_foreach(A,B,C,D) plugin_foreach_with_mask(A,B,C,PLUGIN_IS_READY,D)
146
extern bool plugin_foreach_with_mask(Session *session, plugin_foreach_func *func,
147
int type, uint32_t state_mask, void *arg);
142
extern bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
143
int type, uint state_mask, void *arg);
148
144
#endif /* DRIZZLE_SERVER_PLUGIN_H */