~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_plugin.h

  • Committer: Monty Taylor
  • Date: 2008-09-15 17:24:04 UTC
  • Revision ID: monty@inaugust.com-20080915172404-ygh6hiyu0q7qpa9x
Removed strndup calls.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
 
 */
 
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 */
19
15
 
20
16
/** 
21
17
 * @TODO There is plugin.h and also sql_plugin.h.  Ostensibly,  
82
78
  LEX_STRING dl;
83
79
  void *handle;
84
80
  struct st_mysql_plugin *plugins;
85
 
  uint32_t ref_count;            /* number of plugins loaded from the library */
 
81
  uint ref_count;            /* number of plugins loaded from the library */
86
82
};
87
83
 
88
84
/* A handle of a plugin */
92
88
  LEX_STRING name;
93
89
  struct st_mysql_plugin *plugin;
94
90
  struct st_plugin_dl *plugin_dl;
95
 
  uint32_t state;
96
 
  uint32_t ref_count;               /* number of threads using the plugin */
 
91
  uint state;
 
92
  uint ref_count;               /* number of threads using the plugin */
97
93
  void *data;                   /* plugin type specific, e.g. handlerton */
98
94
  MEM_ROOT mem_root;            /* memory for dynamic plugin structures */
99
95
  sys_var *system_vars;         /* server variables for this plugin */
121
117
 
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);
141
137
 
142
 
typedef bool (plugin_foreach_func)(Session *session,
 
138
typedef bool (plugin_foreach_func)(THD *thd,
143
139
                                   plugin_ref plugin,
144
140
                                   void *arg);
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 */