~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_plugin.h

  • Committer: Brian Aker
  • Date: 2008-11-04 15:39:09 UTC
  • mfrom: (575.1.2 devel)
  • Revision ID: brian@tangent.org-20081104153909-c72hn65udxs1ccal
Merge of Monty's work

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2005 MySQL AB
2
 
 
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.
6
 
 
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.
11
 
 
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 */
 
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
 
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
 
3
 *
 
4
 *  Copyright (C) 2008 Sun Microsystems
 
5
 *
 
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.
 
9
 *
 
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.
 
14
 *
 
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
 
18
 */
15
19
 
16
20
/** 
17
21
 * @TODO There is plugin.h and also sql_plugin.h.  Ostensibly,  
78
82
  LEX_STRING dl;
79
83
  void *handle;
80
84
  struct st_mysql_plugin *plugins;
81
 
  uint ref_count;            /* number of plugins loaded from the library */
 
85
  uint32_t ref_count;            /* number of plugins loaded from the library */
82
86
};
83
87
 
84
88
/* A handle of a plugin */
88
92
  LEX_STRING name;
89
93
  struct st_mysql_plugin *plugin;
90
94
  struct st_plugin_dl *plugin_dl;
91
 
  uint state;
92
 
  uint ref_count;               /* number of threads using the plugin */
 
95
  uint32_t state;
 
96
  uint32_t ref_count;               /* number of threads using the plugin */
93
97
  void *data;                   /* plugin type specific, e.g. handlerton */
94
98
  MEM_ROOT mem_root;            /* memory for dynamic plugin structures */
95
99
  sys_var *system_vars;         /* server variables for this plugin */
117
121
 
118
122
extern int plugin_init(int *argc, char **argv, int init_flags);
119
123
extern void plugin_shutdown(void);
120
 
extern void my_print_help_inc_plugins(struct my_option *options, uint size);
 
124
extern void my_print_help_inc_plugins(struct my_option *options, uint32_t size);
121
125
extern bool plugin_is_ready(const LEX_STRING *name, int type);
122
126
#define my_plugin_lock_by_name(A,B,C) plugin_lock_by_name(A,B,C CALLER_INFO)
123
127
#define my_plugin_lock_by_name_ci(A,B,C) plugin_lock_by_name(A,B,C ORIG_CALLER_INFO)
124
128
#define my_plugin_lock(A,B) plugin_lock(A,B CALLER_INFO)
125
129
#define my_plugin_lock_ci(A,B) plugin_lock(A,B ORIG_CALLER_INFO)
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,
 
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,
128
132
                                      int type CALLER_INFO_PROTO);
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,
 
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,
132
136
                                 const LEX_STRING *dl);
133
 
extern bool mysql_uninstall_plugin(THD *thd, const LEX_STRING *name);
 
137
extern bool mysql_uninstall_plugin(Session *session, const LEX_STRING *name);
134
138
extern bool plugin_register_builtin(struct st_mysql_plugin *plugin);
135
 
extern void plugin_thdvar_init(THD *thd);
136
 
extern void plugin_thdvar_cleanup(THD *thd);
 
139
extern void plugin_sessionvar_init(Session *session);
 
140
extern void plugin_sessionvar_cleanup(Session *session);
137
141
 
138
 
typedef bool (plugin_foreach_func)(THD *thd,
 
142
typedef bool (plugin_foreach_func)(Session *session,
139
143
                                   plugin_ref plugin,
140
144
                                   void *arg);
141
145
#define plugin_foreach(A,B,C,D) plugin_foreach_with_mask(A,B,C,PLUGIN_IS_READY,D)
142
 
extern bool plugin_foreach_with_mask(THD *thd, plugin_foreach_func *func,
143
 
                                     int type, uint state_mask, void *arg);
 
146
extern bool plugin_foreach_with_mask(Session *session, plugin_foreach_func *func,
 
147
                                     int type, uint32_t state_mask, void *arg);
144
148
#endif /* DRIZZLE_SERVER_PLUGIN_H */