~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/module/library.cc

doc modifications

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
 
 *  Copyright (C) 2009 Sun Microsystems, Inc.
 
4
 *  Copyright (C) 2009 Sun Microsystems
5
5
 *
6
6
 *  This program is free software; you can redistribute it and/or modify
7
7
 *  it under the terms of the GNU General Public License as published by
17
17
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
 */
19
19
 
20
 
#include <config.h>
 
20
#include "config.h"
21
21
 
22
22
#include <dlfcn.h>
23
23
 
26
26
 
27
27
#include <boost/filesystem.hpp>
28
28
 
29
 
#include <drizzled/plugin.h>
30
 
#include <drizzled/definitions.h>
31
 
#include <drizzled/error.h>
32
 
#include <drizzled/errmsg_print.h>
33
 
#include <drizzled/module/library.h>
 
29
#include "drizzled/plugin.h"
 
30
#include "drizzled/definitions.h"
 
31
#include "drizzled/error.h"
 
32
#include "drizzled/errmsg_print.h"
 
33
#include "drizzled/module/library.h"
34
34
 
35
35
using namespace std;
36
36
namespace fs=boost::filesystem;
78
78
  size_t found= plugin_name.find(FN_LIBCHAR);
79
79
  if (found != string::npos)
80
80
  {
81
 
    errmsg_printf(error::ERROR, "%s",ER(ER_PLUGIN_NO_PATHS));
 
81
    errmsg_printf(ERRMSG_LVL_ERROR, "%s",ER(ER_PLUGIN_NO_PATHS));
82
82
    return NULL;
83
83
  }
84
84
 
92
92
    if (dl_handle == NULL)
93
93
    {
94
94
      const char *errmsg= dlerror();
95
 
      errmsg_printf(error::ERROR, ER(ER_CANT_OPEN_LIBRARY),
 
95
      errmsg_printf(ERRMSG_LVL_ERROR, ER(ER_CANT_OPEN_LIBRARY),
96
96
                    dlpath.c_str(), errno, errmsg);
97
97
      (void)dlerror();
98
98
 
114
114
        if (*errmsg == ':') errmsg++;
115
115
        if (*errmsg == ' ') errmsg++;
116
116
      }
117
 
      errmsg_printf(error::ERROR, ER(ER_CANT_OPEN_LIBRARY),
 
117
      errmsg_printf(ERRMSG_LVL_ERROR, ER(ER_CANT_OPEN_LIBRARY),
118
118
                    dlpath.c_str(), errno, errmsg);
119
119
 
120
120
      // This, in theory, should cause dlerror() to deallocate the error
134
134
  if (sym == NULL)
135
135
  {
136
136
    const char* errmsg= dlerror();
137
 
    errmsg_printf(error::ERROR, errmsg);
138
 
    errmsg_printf(error::ERROR, ER(ER_CANT_FIND_DL_ENTRY),
 
137
    errmsg_printf(ERRMSG_LVL_ERROR, errmsg);
 
138
    errmsg_printf(ERRMSG_LVL_ERROR, ER(ER_CANT_FIND_DL_ENTRY),
139
139
                  plugin_decl_sym.c_str(), dlpath.c_str());
140
140
    (void)dlerror();
141
141
    dlclose(dl_handle);
145
145
  const Manifest *module_manifest= static_cast<module::Manifest *>(sym); 
146
146
  if (module_manifest->drizzle_version != DRIZZLE_VERSION_ID)
147
147
  {
148
 
    errmsg_printf(error::ERROR,
 
148
    errmsg_printf(ERRMSG_LVL_ERROR,
149
149
                  _("Plugin module %s was compiled for version %" PRIu64 ", "
150
150
                    "which does not match the current running version of "
151
151
                    "Drizzle: %" PRIu64"."),