00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*- 00002 * vim:expandtab:shiftwidth=2:tabstop=2:smarttab: 00003 * 00004 * Copyright (C) 2009 Sun Microsystems, Inc. 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; version 2 of the License. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00018 */ 00019 00020 #pragma once 00021 00028 #include <drizzled/module/context.h> 00029 #include <drizzled/module/option_context.h> 00030 00031 namespace drizzled 00032 { 00033 00034 struct drizzle_show_var; 00035 struct drizzle_sys_var; 00036 00037 /* We use the following strings to define licenses for plugins */ 00038 enum plugin_license_type { 00039 PLUGIN_LICENSE_GPL, 00040 PLUGIN_LICENSE_BSD, 00041 PLUGIN_LICENSE_LGPL, 00042 PLUGIN_LICENSE_PROPRIETARY, 00043 PLUGIN_LICENSE_MAX=PLUGIN_LICENSE_LGPL 00044 }; 00045 00046 00047 namespace module 00048 { 00049 00050 typedef int (*initialize_func_t)(::drizzled::module::Context &); 00051 typedef void (*options_func_t)(::drizzled::module::option_context &); 00052 00061 struct Manifest 00062 { 00063 uint64_t drizzle_version; /* Drizzle version the plugin was compiled for */ 00064 const char *name; /* plugin name (for SHOW PLUGINS) */ 00065 const char *version; /* plugin version (for SHOW PLUGINS) */ 00066 const char *author; /* plugin author (for SHOW PLUGINS) */ 00067 const char *descr; /* general descriptive text (for SHOW PLUGINS ) */ 00068 plugin_license_type license; /* plugin license (PLUGIN_LICENSE_XXX) */ 00069 initialize_func_t init; /* function to invoke when plugin is loaded */ 00070 const char *depends; 00071 options_func_t init_options; /* register command line options */ 00072 }; 00073 00074 } /* namespace module */ 00075 } /* namespace drizzled */ 00076