~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin.h

  • Committer: Brian Aker
  • Date: 2009-04-13 16:22:40 UTC
  • mfrom: (971.1.78 mordred)
  • Revision ID: brian@gaz-20090413162240-ugi3gvhofmcuglzl
Merge Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
  Plugin API. Common for all plugin types.
31
31
*/
32
32
 
33
 
/*
34
 
  The allowable types of plugins
35
 
*/
36
 
enum drizzle_plugin_type {
37
 
  DRIZZLE_DAEMON_PLUGIN,                /* Daemon / Raw */
38
 
  DRIZZLE_STORAGE_ENGINE_PLUGIN,        /* Storage Engine */
39
 
  DRIZZLE_INFORMATION_SCHEMA_PLUGIN,    /* Information Schema */
40
 
  DRIZZLE_UDF_PLUGIN,                   /* User-Defined Function */
41
 
  DRIZZLE_UDA_PLUGIN,                   /* User-Defined Aggregate Function */
42
 
  DRIZZLE_AUDIT_PLUGIN,                 /* Audit */
43
 
  DRIZZLE_LOGGER_PLUGIN,                /* Query Logging */
44
 
  DRIZZLE_ERRMSG_PLUGIN,                /* Error Messages */
45
 
  DRIZZLE_AUTH_PLUGIN,                  /* Authorization */
46
 
  DRIZZLE_QCACHE_PLUGIN,                /* Query Cache */
47
 
  DRIZZLE_SCHEDULING_PLUGIN,            /* Thread and Session Scheduling */
48
 
  DRIZZLE_REPLICATOR_PLUGIN,            /* Database Replication */
49
 
  DRIZZLE_PROTOCOL_PLUGIN,              /* Protocol Handlers */
50
 
  DRIZZLE_PLUGIN_MAX=DRIZZLE_PROTOCOL_PLUGIN
51
 
};
52
 
 
53
 
/* The number of plugin types */
54
 
const uint32_t DRIZZLE_MAX_PLUGIN_TYPE_NUM=DRIZZLE_PLUGIN_MAX+1;
55
33
 
56
34
/* We use the following strings to define licenses for plugins */
57
35
enum plugin_license_type {
70
48
/*
71
49
  Macros for beginning and ending plugin declarations. Between
72
50
  drizzle_declare_plugin and drizzle_declare_plugin_end there should
73
 
  be a st_mysql_plugin struct for each plugin to be declared.
 
51
  be a drizzled_plugin_manifest struct for each plugin to be declared.
74
52
*/
75
53
 
76
54
 
77
55
#ifndef DRIZZLE_DYNAMIC_PLUGIN
78
56
#define __DRIZZLE_DECLARE_PLUGIN(NAME, DECLS) \
79
 
struct st_mysql_plugin DECLS[]= {
 
57
struct drizzled_plugin_manifest DECLS[]= {
80
58
#else
81
59
#define __DRIZZLE_DECLARE_PLUGIN(NAME, DECLS) \
82
 
struct st_mysql_plugin _mysql_plugin_declarations_[]= {
 
60
struct drizzled_plugin_manifest _mysql_plugin_declarations_[]= {
83
61
#endif
84
62
 
85
63
#define drizzle_declare_plugin(NAME) \
86
64
__DRIZZLE_DECLARE_PLUGIN(NAME, \
87
65
                 builtin_ ## NAME ## _plugin)
88
66
 
89
 
#define drizzle_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0}}
 
67
#define drizzle_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0}}
 
68
 
 
69
/*
 
70
  the following flags are valid for plugin_init()
 
71
*/
 
72
#define PLUGIN_INIT_SKIP_DYNAMIC_LOADING 1
 
73
#define PLUGIN_INIT_SKIP_PLUGIN_TABLE    2
 
74
#define PLUGIN_INIT_SKIP_INITIALIZATION  4
 
75
 
 
76
#define INITIAL_LEX_PLUGIN_LIST_SIZE    16
90
77
 
91
78
/*
92
79
  declarations for SHOW STATUS support in plugins
95
82
{
96
83
  SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG,
97
84
  SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
98
 
  SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE, SHOW_SIZE
 
85
  SHOW_ARRAY, SHOW_FUNC, SHOW_KEY_CACHE_LONG, SHOW_KEY_CACHE_LONGLONG,
 
86
  SHOW_LONG_STATUS, SHOW_DOUBLE_STATUS, SHOW_HAVE, 
 
87
  SHOW_MY_BOOL, SHOW_HA_ROWS, SHOW_SYS, SHOW_INT_NOFLUSH,
 
88
  SHOW_LONGLONG_STATUS, SHOW_DOUBLE, SHOW_SIZE
99
89
};
100
90
 
101
91
struct st_mysql_show_var {
104
94
  enum enum_mysql_show_type type;
105
95
};
106
96
 
 
97
typedef enum enum_mysql_show_type SHOW_TYPE;
 
98
typedef struct st_mysql_show_var SHOW_VAR;
 
99
 
107
100
 
108
101
#define SHOW_VAR_FUNC_BUFF_SIZE 1024
109
102
typedef int (*mysql_show_var_func)(Session *, struct st_mysql_show_var *, char *);
365
358
  (*(DRIZZLE_SYSVAR_NAME(name).resolve(session, DRIZZLE_SYSVAR_NAME(name).offset)))
366
359
 
367
360
 
368
 
/*
369
 
  Plugin description structure.
370
 
*/
371
 
 
372
 
struct st_mysql_plugin
373
 
{
374
 
  uint32_t type;        /* the plugin type (a DRIZZLE_XXX_PLUGIN value)   */
375
 
  const char *name;     /* plugin name (for SHOW PLUGINS)               */
376
 
  const char *version;  /* plugin version (for SHOW PLUGINS)            */
377
 
  const char *author;   /* plugin author (for SHOW PLUGINS)             */
378
 
  const char *descr;    /* general descriptive text (for SHOW PLUGINS ) */
379
 
  int license;          /* the plugin license (PLUGIN_LICENSE_XXX)      */
380
 
  int (*init)(void *);  /* the function to invoke when plugin is loaded */
381
 
  int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
382
 
  struct st_mysql_show_var *status_vars;
383
 
  struct st_mysql_sys_var **system_vars;
384
 
  void *reserved1;   /* reserved for dependency checking             */
385
 
};
386
 
 
387
361
struct StorageEngine;
388
362
 
389
363