~drizzle-trunk/drizzle/development

1093.3.2 by Monty Taylor
Split drizzle::plugin::Manifest into its own file.
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
4
 *  Copyright (C) 2009 Sun Microsystems, Inc.
1093.3.2 by Monty Taylor
Split drizzle::plugin::Manifest into its own file.
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
 */
19
2234 by Brian Aker
Mass removal of ifdef/endif in favor of pragma once.
20
#pragma once
1093.3.2 by Monty Taylor
Split drizzle::plugin::Manifest into its own file.
21
1324.2.8 by Monty Taylor
Added some comment headers.
22
/**
23
 * @file Defines a Plugin Manifest
24
 *
1530.2.5 by Monty Taylor
Renamed classes that were in drizzled::plugin but which were not meant
25
 * A module::Manifest is the struct contained in every Plugin Library.
1324.2.8 by Monty Taylor
Added some comment headers.
26
 */
27
2173.2.1 by Monty Taylor
Fixes incorrect usage of include
28
#include <drizzled/module/context.h>
29
#include <drizzled/module/option_context.h>
1093.3.3 by Monty Taylor
Split out handle and library.
30
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
31
namespace drizzled
32
{
33
1228.1.5 by Monty Taylor
Merged in some naming things.
34
struct drizzle_show_var;
35
struct drizzle_sys_var;
1093.3.2 by Monty Taylor
Split drizzle::plugin::Manifest into its own file.
36
37
/* We use the following strings to define licenses for plugins */
38
enum plugin_license_type {
39
  PLUGIN_LICENSE_GPL,
40
  PLUGIN_LICENSE_BSD,
41
  PLUGIN_LICENSE_LGPL,
42
  PLUGIN_LICENSE_PROPRIETARY,
43
  PLUGIN_LICENSE_MAX=PLUGIN_LICENSE_LGPL
44
};
45
46
1530.2.5 by Monty Taylor
Renamed classes that were in drizzled::plugin but which were not meant
47
namespace module
1093.3.2 by Monty Taylor
Split drizzle::plugin::Manifest into its own file.
48
{
49
1530.2.6 by Monty Taylor
Moved plugin::Context to module::Context.
50
typedef int (*initialize_func_t)(::drizzled::module::Context &);
1625.1.4 by Monty Taylor
Add function pointer hook for plugins to register program_options.
51
typedef void (*options_func_t)(::drizzled::module::option_context &);
1093.3.2 by Monty Taylor
Split drizzle::plugin::Manifest into its own file.
52
53
/**
54
 * Plugin Manfiest
55
 *
56
 * One Manifest is required per plugin library which is to be dlopened
57
 *
58
 * This is a struct and not a class because it is staticly defined in the
59
 * plugin objects and needs to be a POD as it can, or else it won't compile.
60
 */
61
struct Manifest
62
{
1241.10.2 by Monty Taylor
Added support for embedding the drizzle version number in the plugin file.
63
  uint64_t drizzle_version;  /* Drizzle version the plugin was compiled for  */
1093.3.2 by Monty Taylor
Split drizzle::plugin::Manifest into its own file.
64
  const char *name;          /* plugin name (for SHOW PLUGINS)               */
65
  const char *version;       /* plugin version (for SHOW PLUGINS)            */
66
  const char *author;        /* plugin author (for SHOW PLUGINS)             */
67
  const char *descr;         /* general descriptive text (for SHOW PLUGINS ) */
68
  plugin_license_type license; /* plugin license (PLUGIN_LICENSE_XXX)          */
69
  initialize_func_t init;     /* function to invoke when plugin is loaded     */
2095.3.1 by Monty Taylor
Re-purpose the old plugin sysvar slot in the struct to be a depends list.
70
  const char *depends;
1625.1.4 by Monty Taylor
Add function pointer hook for plugins to register program_options.
71
  options_func_t init_options; /* register command line options              */
1093.3.2 by Monty Taylor
Split drizzle::plugin::Manifest into its own file.
72
};
73
1530.2.5 by Monty Taylor
Renamed classes that were in drizzled::plugin but which were not meant
74
} /* namespace module */
1093.3.2 by Monty Taylor
Split drizzle::plugin::Manifest into its own file.
75
} /* namespace drizzled */
76