~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Brian Aker
  • Date: 2010-11-06 15:43:10 UTC
  • mfrom: (1908.1.1 merge)
  • Revision ID: brian@tangent.org-20101106154310-g1jpjzwbc53pfc4f
Filesort encapsulation, plus modification to copy contructor

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
#include <drizzled/common.h>
29
29
#include <drizzled/plugin.h>
30
30
#include <drizzled/session.h>
31
 
#include <boost/program_options.hpp>
32
 
#include <drizzled/module/option_map.h>
33
31
using namespace drizzled;
34
32
using namespace drizzled::plugin;
35
 
namespace po= boost::program_options;
36
33
 
37
34
#include "cslib/CSConfig.h"
38
35
#else
48
45
 
49
46
 
50
47
#include "defs_ms.h"
51
 
#include "pbmslib.h"
 
48
 
52
49
 
53
50
/////////////////////////
54
51
// Plugin Definition:
61
58
extern int pbms_init_func(module::Context &registry);
62
59
extern struct drizzled::drizzle_sys_var* pbms_system_variables[];
63
60
 
64
 
extern uint32_t pbms_port_number;
65
 
 
66
 
static void init_options(drizzled::module::option_context &context)
67
 
{
68
 
  context("port",
69
 
          po::value<uint32_t>(&pbms_port_number)->default_value(DEFAULT_PBMS_PORT),
70
 
          N_("Port number to use for connection or 0 for default PBMS port "));
71
 
}
72
 
 
73
 
 
74
 
static int my_init(module::Context &context)
 
61
static int my_init(module::Context &registry)
75
62
{
76
63
        int rtc;
77
 
        const module::option_map &vm= context.getOptions();
78
 
 
79
 
        if (vm.count("port"))
80
 
        {
81
 
          if (pbms_port_number > 65535)
82
 
          {
83
 
            errmsg_printf(ERRMSG_LVL_ERROR, _("Invalid port number\n"));
84
 
            return(-1);
85
 
          }
86
 
        }
87
 
 
 
64
        
88
65
        PBMSParameters::startUp();
89
 
        rtc = pbms_init_func(context);
 
66
        rtc = pbms_init_func(registry);
90
67
        if (rtc == 0) {
91
68
                pbms_events = new PBMSEvents();
92
 
                context.add(pbms_events);
 
69
                registry.add(pbms_events);
93
70
        }
94
 
 
 
71
        
95
72
        return rtc;
96
73
}
97
74
 
105
82
        PLUGIN_LICENSE_GPL,
106
83
        my_init, /* Plugin Init */
107
84
        pbms_system_variables,          /* system variables                */
108
 
        init_options                                            /* config options                  */
 
85
        NULL                                            /* config options                  */
109
86
}
110
87
DRIZZLE_DECLARE_PLUGIN_END;
111
88