~ubuntu-branches/ubuntu/wily/scim/wily-proposed

« back to all changes in this revision

Viewing changes to src/scim_module.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Rolf Leggewie
  • Date: 2010-08-11 18:28:44 UTC
  • mfrom: (3.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100811182844-rnn95k63cwehtm75
Tags: 1.4.9-5
* debian/copyright: add my copyright
* debian/control: update to standard 3.9.1, no further changes necessary

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#define Uses_STL_ALGORITHM
28
28
#include "scim_private.h"
29
29
#include "scim.h"
30
 
#include "ltdl.h"
 
30
extern "C" {
 
31
  #include <ltdl.h>
 
32
}
31
33
#include <dirent.h>
32
34
#include <sys/types.h>
33
35
#include <sys/stat.h>
40
42
 
41
43
struct Module::ModuleImpl
42
44
{
 
45
    lt_dladvise advise;
43
46
    lt_dlhandle handle;
44
47
    ModuleInitFunc init;
45
48
    ModuleExitFunc exit;
118
121
    : m_impl (new ModuleImpl)
119
122
{
120
123
    lt_dlinit ();
 
124
    lt_dladvise_init (&(m_impl->advise));
 
125
    lt_dladvise_ext (&(m_impl->advise));
 
126
    lt_dladvise_global (&(m_impl->advise));
121
127
}
122
128
 
123
129
Module::Module (const String &name, const String &type)
124
130
    : m_impl (new ModuleImpl)
125
131
{
126
 
    lt_dlinit ();
 
132
    Module();
 
133
 
127
134
    load (name, type);
128
135
}
129
136
 
130
137
Module::~Module ()
131
138
{
132
139
    unload ();
 
140
    lt_dladvise_destroy (&(m_impl->advise));
133
141
    lt_dlexit ();
134
142
    delete m_impl;
135
143
}
167
175
 
168
176
    for (it = paths.begin (); it != paths.end (); ++it) {
169
177
        module_path = *it + String (SCIM_PATH_DELIM_STRING) + name;
170
 
        new_handle = lt_dlopenext (module_path.c_str ());
 
178
        new_handle = lt_dlopenadvise (module_path.c_str (), m_impl->advise);
171
179
        if (new_handle)
172
180
            break;
173
181
    }
174
182
 
175
183
    if (!new_handle) {
176
 
        new_handle = lt_dlopenext (name.c_str ());
 
184
        new_handle = lt_dlopenadvise (name.c_str (), m_impl->advise);
177
185
    }
178
186
 
179
187
    if (!new_handle)