~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_plugin.h

  • Committer: Brian Aker
  • Date: 2009-07-21 00:55:33 UTC
  • mfrom: (1093.1.21 captain)
  • Revision ID: brian@gaz-20090721005533-ran2v2otw7tbmiym
Merge Jay

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
#ifndef DRIZZLE_SERVER_PLUGIN_H
37
37
#define DRIZZLE_SERVER_PLUGIN_H
38
38
 
39
 
#include <drizzled/lex_string.h>
40
 
#include <mysys/my_alloc.h>
41
 
#include <drizzled/plugin_registry.h>
42
39
#include <drizzled/plugin.h>
 
40
#include <drizzled/plugin/manifest.h>
 
41
#include <drizzled/plugin/library.h>
 
42
#include <drizzled/plugin/handle.h>
43
43
 
 
44
class Session;
44
45
class sys_var;
45
 
class Session;
46
 
 
47
 
 
48
 
/* A handle for the dynamic library containing a plugin or plugins. */
49
 
struct drizzled_plugin_manifest;
50
 
 
51
 
struct st_plugin_dl
52
 
{
53
 
  LEX_STRING dl;
54
 
  void *handle;
55
 
  struct drizzled_plugin_manifest *plugins;
56
 
};
57
 
 
58
 
/* A handle of a plugin */
59
 
 
60
 
struct st_plugin_int
61
 
{
62
 
  LEX_STRING name;
63
 
  struct drizzled_plugin_manifest *plugin;
64
 
  struct st_plugin_dl *plugin_dl;
65
 
  bool isInited;
66
 
  MEM_ROOT mem_root;            /* memory for dynamic plugin structures */
67
 
  sys_var *system_vars;         /* server variables for this plugin */
68
 
};
69
 
 
70
 
 
71
 
#define plugin_decl(pi) ((pi)->plugin)
72
 
#define plugin_data(pi,cast) (static_cast<cast>((pi)->data))
73
 
#define plugin_name(pi) (&((pi)->name))
74
 
#define plugin_equals(p1,p2) ((p1) && (p2) && (p1) == (p2))
75
 
 
76
 
 
77
 
typedef int (*plugin_type_init)(PluginRegistry &);
78
 
 
79
 
/*
80
 
  Plugin description structure.
81
 
*/
82
 
 
83
 
struct drizzled_plugin_manifest
84
 
{
85
 
  const char *name;          /* plugin name (for SHOW PLUGINS)               */
86
 
  const char *version;       /* plugin version (for SHOW PLUGINS)            */
87
 
  const char *author;        /* plugin author (for SHOW PLUGINS)             */
88
 
  const char *descr;         /* general descriptive text (for SHOW PLUGINS ) */
89
 
  int license;               /* plugin license (PLUGIN_LICENSE_XXX)          */
90
 
  plugin_type_init init;     /* function to invoke when plugin is loaded     */
91
 
  plugin_type_init deinit;   /* function to invoke when plugin is unloaded   */
92
 
  struct st_mysql_show_var *status_vars;
93
 
  struct st_mysql_sys_var **system_vars;
94
 
  void *reserved1;           /* reserved for dependency checking             */
95
 
};
 
46
typedef struct st_mysql_lex_string LEX_STRING;
 
47
struct my_option;
96
48
 
97
49
extern char *opt_plugin_load;
98
50
extern char *opt_plugin_dir_ptr;
100
52
 
101
53
extern int plugin_init(int *argc, char **argv, int init_flags);
102
54
extern void plugin_shutdown(void);
103
 
extern void my_print_help_inc_plugins(struct my_option *options, uint32_t size);
 
55
extern void my_print_help_inc_plugins(my_option *options);
104
56
extern bool plugin_is_ready(const LEX_STRING *name, int type);
105
57
extern bool mysql_install_plugin(Session *session, const LEX_STRING *name,
106
58
                                 const LEX_STRING *dl);
107
59
extern bool mysql_uninstall_plugin(Session *session, const LEX_STRING *name);
108
 
extern bool plugin_register_builtin(struct drizzled_plugin_manifest *plugin);
 
60
extern bool plugin_register_builtin(drizzled::plugin::Manifest *plugin);
109
61
extern void plugin_sessionvar_init(Session *session);
110
62
extern void plugin_sessionvar_cleanup(Session *session);
111
63
extern sys_var *intern_find_sys_var(const char *str, uint32_t, bool no_error);