~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbms/src/plugin_ms.cc

  • Committer: Brian Aker
  • Date: 2009-10-15 00:22:33 UTC
  • mto: (1183.1.11 merge)
  • mto: This revision was merged to the branch mainline in revision 1198.
  • Revision ID: brian@gaz-20091015002233-fa4ao2mbc67wls91
First pass of information engine. OMG, ponies... is it so much easier to
deal with creating and engine.

The list table iterator though... its ass, needs to go. We should also
abstract out share. Very few engines need a custom one. Just say'in

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2010 PrimeBase Technologies GmbH, Germany
2
 
 *
3
 
 * PrimeBase Media Stream for MySQL
4
 
 *
5
 
 * This program is free software; you can redistribute it and/or modify
6
 
 * it under the terms of the GNU General Public License as published by
7
 
 * the Free Software Foundation; either version 2 of the License, or
8
 
 * (at your option) any later version.
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
 
 * Barry Leslie
20
 
 *
21
 
 * 2010-05-31
22
 
 *
23
 
 * PBMS daemon plugin interface.
24
 
 *
25
 
 */
26
 
#ifdef DRIZZLED
27
 
#include "config.h"
28
 
#include <drizzled/common.h>
29
 
#include <drizzled/plugin.h>
30
 
#include <drizzled/session.h>
31
 
#include <boost/program_options.hpp>
32
 
#include <drizzled/module/option_map.h>
33
 
using namespace drizzled;
34
 
using namespace drizzled::plugin;
35
 
namespace po= boost::program_options;
36
 
 
37
 
#include "cslib/CSConfig.h"
38
 
#else
39
 
#include "cslib/CSConfig.h"
40
 
#include "mysql_priv.h"
41
 
#include <mysql/plugin.h>
42
 
#include <my_dir.h>
43
 
#endif 
44
 
 
45
 
#include <stdlib.h>
46
 
#include <time.h>
47
 
#include <inttypes.h>
48
 
 
49
 
 
50
 
#include "defs_ms.h"
51
 
#include "pbmslib.h"
52
 
 
53
 
/////////////////////////
54
 
// Plugin Definition:
55
 
/////////////////////////
56
 
#ifdef DRIZZLED
57
 
#include "events_ms.h"
58
 
static PBMSEvents *pbms_events= NULL;
59
 
 
60
 
extern int pbms_init_func(module::Context &registry);
61
 
 
62
 
static void init_options(module::option_context &context)
63
 
{
64
 
        PBMSParameters::initOptions(context);
65
 
}
66
 
 
67
 
static int my_init(module::Context &context)
68
 
{
69
 
        int rtc;
70
 
 
71
 
        PBMSParameters::startUp(context);
72
 
        rtc = pbms_init_func(context);
73
 
        if (rtc == 0) {
74
 
                pbms_events = new PBMSEvents();
75
 
                context.add(pbms_events);
76
 
        }
77
 
 
78
 
        return rtc;
79
 
}
80
 
 
81
 
DRIZZLE_DECLARE_PLUGIN
82
 
{
83
 
        DRIZZLE_VERSION_ID,
84
 
        "PBMS",
85
 
        "1.0",
86
 
        "Barry Leslie, PrimeBase Technologies GmbH",
87
 
        "The Media Stream daemon for Drizzle",
88
 
        PLUGIN_LICENSE_GPL,
89
 
        my_init, /* Plugin Init */
90
 
        NULL,          /* system variables                */
91
 
        init_options                                            /* config options                  */
92
 
}
93
 
DRIZZLE_DECLARE_PLUGIN_END;
94
 
 
95
 
#else
96
 
 
97
 
extern int pbms_init_func(void *p);
98
 
extern int pbms_done_func(void *);
99
 
extern struct st_mysql_sys_var* pbms_system_variables[];
100
 
 
101
 
struct st_mysql_storage_engine pbms_engine_handler = {
102
 
        MYSQL_HANDLERTON_INTERFACE_VERSION
103
 
};
104
 
 
105
 
mysql_declare_plugin(pbms)
106
 
{
107
 
        MYSQL_STORAGE_ENGINE_PLUGIN,
108
 
        &pbms_engine_handler,
109
 
        "PBMS",
110
 
        "Barry Leslie, PrimeBase Technologies GmbH",
111
 
        "The Media Stream daemon for MySQL",
112
 
        PLUGIN_LICENSE_GPL,
113
 
        pbms_init_func, /* Plugin Init */
114
 
        pbms_done_func, /* Plugin Deinit */
115
 
        0x0001 /* 0.1 */,
116
 
        NULL,                                                                                   /* status variables                                                             */
117
 
#if MYSQL_VERSION_ID >= 50118
118
 
        pbms_system_variables,                                                  /* system variables                                                             */
119
 
#else
120
 
        NULL,
121
 
#endif
122
 
        NULL                                                                                    /* config options                                                               */
123
 
}
124
 
mysql_declare_plugin_end;
125
 
#endif //DRIZZLED
126
 
 
127
 
 
128
 
// vim:noexpandtab:sts=8:sw=8:tabstop=8:smarttab: