Mercurial > hg > orthanc
annotate Plugins/Engine/PluginsManager.cpp @ 893:f57802f8b4dc plugins
plugins for windows
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 16 Jun 2014 16:14:56 +0200 |
parents | d2a393061eb6 |
children | 690aeb4cb899 |
rev | line source |
---|---|
887 | 1 /** |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, | |
4 * Belgium | |
5 * | |
6 * This program is free software: you can redistribute it and/or | |
7 * modify it under the terms of the GNU General Public License as | |
8 * published by the Free Software Foundation, either version 3 of the | |
9 * License, or (at your option) any later version. | |
10 * | |
11 * In addition, as a special exception, the copyright holders of this | |
12 * program give permission to link the code of its release with the | |
13 * OpenSSL project's "OpenSSL" library (or with modified versions of it | |
14 * that use the same license as the "OpenSSL" library), and distribute | |
15 * the linked executables. You must obey the GNU General Public License | |
16 * in all respects for all of the code used other than "OpenSSL". If you | |
17 * modify file(s) with this exception, you may extend this exception to | |
18 * your version of the file(s), but you are not obligated to do so. If | |
19 * you do not wish to do so, delete this exception statement from your | |
20 * version. If you delete this exception statement from all source files | |
21 * in the program, then also delete it here. | |
22 * | |
23 * This program is distributed in the hope that it will be useful, but | |
24 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
26 * General Public License for more details. | |
27 * | |
28 * You should have received a copy of the GNU General Public License | |
29 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
30 **/ | |
31 | |
32 | |
33 #include "PluginsManager.h" | |
34 | |
35 #include <glog/logging.h> | |
36 #include <cassert> | |
37 #include <memory> | |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
38 #include <boost/filesystem.hpp> |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
39 |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
40 #ifdef WIN32 |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
41 #define PLUGIN_EXTENSION ".dll" |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
42 #elif defined(__linux) |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
43 #define PLUGIN_EXTENSION ".so" |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
44 #else |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
45 #error Support your platform here |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
46 #endif |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
47 |
887 | 48 |
49 namespace Orthanc | |
50 { | |
51 static void CallInitialize(SharedLibrary& plugin, | |
52 const OrthancPluginContext& context) | |
53 { | |
54 typedef int32_t (*Initialize) (const OrthancPluginContext*); | |
55 | |
893
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
56 #if defined(_WIN32) |
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
57 Initialize initialize = (Initialize) plugin.GetFunction("OrthancPluginInitialize"); |
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
58 #else |
887 | 59 /** |
60 * gcc would complain about "ISO C++ forbids casting between | |
61 * pointer-to-function and pointer-to-object" without the trick | |
62 * below, that is known as "the POSIX.1-2003 (Technical Corrigendum | |
63 * 1) workaround". See the man page of "dlsym()". | |
64 * http://www.trilithium.com/johan/2004/12/problem-with-dlsym/ | |
65 * http://stackoverflow.com/a/14543811/881731 | |
66 **/ | |
67 | |
68 Initialize initialize; | |
69 *(void **) (&initialize) = plugin.GetFunction("OrthancPluginInitialize"); | |
893
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
70 #endif |
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
71 |
887 | 72 assert(initialize != NULL); |
73 int32_t error = initialize(&context); | |
74 | |
75 if (error != 0) | |
76 { | |
77 LOG(ERROR) << "Error while initializing plugin " << plugin.GetPath() | |
78 << " (code " << error << ")"; | |
79 throw OrthancException(ErrorCode_SharedLibrary); | |
80 } | |
81 } | |
82 | |
83 | |
84 static void CallFinalize(SharedLibrary& plugin) | |
85 { | |
86 typedef void (*Finalize) (); | |
87 | |
893
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
88 #if defined(_WIN32) |
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
89 Finalize finalize = (Finalize) plugin.GetFunction("OrthancPluginFinalize"); |
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
90 #else |
887 | 91 Finalize finalize; |
92 *(void **) (&finalize) = plugin.GetFunction("OrthancPluginFinalize"); | |
893
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
93 #endif |
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
94 |
887 | 95 assert(finalize != NULL); |
96 finalize(); | |
97 } | |
98 | |
99 | |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
100 static const char* CallGetName(SharedLibrary& plugin) |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
101 { |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
102 typedef const char* (*GetName) (); |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
103 |
893
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
104 #if defined(_WIN32) |
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
105 GetName getName = (GetName) plugin.GetFunction("OrthancPluginGetName"); |
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
106 #else |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
107 GetName getName; |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
108 *(void **) (&getName) = plugin.GetFunction("OrthancPluginGetName"); |
893
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
109 #endif |
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
110 |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
111 assert(getName != NULL); |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
112 return getName(); |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
113 } |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
114 |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
115 |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
116 static const char* CallGetVersion(SharedLibrary& plugin) |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
117 { |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
118 typedef const char* (*GetVersion) (); |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
119 |
893
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
120 #if defined(_WIN32) |
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
121 GetVersion getVersion = (GetVersion) plugin.GetFunction("OrthancPluginGetVersion"); |
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
122 #else |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
123 GetVersion getVersion; |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
124 *(void **) (&getVersion) = plugin.GetFunction("OrthancPluginGetVersion"); |
893
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
125 #endif |
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
126 |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
127 assert(getVersion != NULL); |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
128 return getVersion(); |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
129 } |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
130 |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
131 |
887 | 132 static void LogError(const char* str) |
133 { | |
134 LOG(ERROR) << str; | |
135 } | |
136 | |
137 static void LogWarning(const char* str) | |
138 { | |
139 LOG(WARNING) << str; | |
140 } | |
141 | |
142 static void LogInfo(const char* str) | |
143 { | |
144 LOG(INFO) << str; | |
145 } | |
146 | |
147 static int32_t InvokeService(const char* serviceName, | |
148 const void* serviceParameters) | |
149 { | |
150 // TODO | |
151 return 0; | |
152 } | |
153 | |
154 PluginsManager::PluginsManager() | |
155 { | |
156 context_.orthancVersion = ORTHANC_VERSION; | |
157 context_.InvokeService = InvokeService; | |
158 context_.LogError = LogError; | |
159 context_.LogWarning = LogWarning; | |
160 context_.LogInfo = LogInfo; | |
161 } | |
162 | |
163 PluginsManager::~PluginsManager() | |
164 { | |
165 for (Plugins::iterator it = plugins_.begin(); it != plugins_.end(); it++) | |
166 { | |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
167 if (it->second != NULL) |
887 | 168 { |
893
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
169 LOG(WARNING) << "Unregistering plugin '" << CallGetName(*it->second) |
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
170 << "' (version " << CallGetVersion(*it->second) << ")"; |
f57802f8b4dc
plugins for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
889
diff
changeset
|
171 |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
172 CallFinalize(*(it->second)); |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
173 delete it->second; |
887 | 174 } |
175 } | |
176 } | |
177 | |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
178 |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
179 static bool IsOrthancPlugin(SharedLibrary& library) |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
180 { |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
181 return (library.HasFunction("OrthancPluginInitialize") && |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
182 library.HasFunction("OrthancPluginFinalize") && |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
183 library.HasFunction("OrthancPluginGetName") && |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
184 library.HasFunction("OrthancPluginGetVersion")); |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
185 } |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
186 |
887 | 187 |
188 void PluginsManager::RegisterPlugin(const std::string& path) | |
189 { | |
190 std::auto_ptr<SharedLibrary> plugin(new SharedLibrary(path)); | |
191 | |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
192 if (!IsOrthancPlugin(*plugin)) |
887 | 193 { |
194 LOG(ERROR) << "Plugin " << plugin->GetPath() | |
195 << " does not declare the proper entry functions"; | |
196 throw OrthancException(ErrorCode_SharedLibrary); | |
197 } | |
198 | |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
199 std::string name(CallGetName(*plugin)); |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
200 if (plugins_.find(name) != plugins_.end()) |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
201 { |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
202 LOG(ERROR) << "Plugin '" << name << "' already registered"; |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
203 throw OrthancException(ErrorCode_SharedLibrary); |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
204 } |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
205 |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
206 LOG(WARNING) << "Registering plugin '" << name |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
207 << "' (version " << CallGetVersion(*plugin) << ")"; |
887 | 208 |
209 CallInitialize(*plugin, context_); | |
210 | |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
211 plugins_[name] = plugin.release(); |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
212 } |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
213 |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
214 |
889 | 215 void PluginsManager::ScanFolderForPlugins(const std::string& folder, |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
216 bool isRecursive) |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
217 { |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
218 using namespace boost::filesystem; |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
219 |
889 | 220 if (!exists(folder)) |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
221 { |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
222 return; |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
223 } |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
224 |
889 | 225 LOG(INFO) << "Scanning folder " << folder << " for plugins"; |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
226 |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
227 directory_iterator end_it; // default construction yields past-the-end |
889 | 228 for (directory_iterator it(folder); |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
229 it != end_it; |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
230 ++it) |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
231 { |
889 | 232 std::string path = it->path().string(); |
233 | |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
234 if (is_directory(it->status())) |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
235 { |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
236 if (isRecursive) |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
237 { |
889 | 238 ScanFolderForPlugins(path, true); |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
239 } |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
240 } |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
241 else |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
242 { |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
243 if (boost::filesystem::extension(it->path()) == PLUGIN_EXTENSION) |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
244 { |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
245 LOG(INFO) << "Found a shared library: " << it->path(); |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
246 |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
247 try |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
248 { |
889 | 249 SharedLibrary plugin(path); |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
250 if (IsOrthancPlugin(plugin)) |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
251 { |
889 | 252 RegisterPlugin(path); |
888
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
253 } |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
254 } |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
255 catch (OrthancException&) |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
256 { |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
257 } |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
258 } |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
259 } |
d44b845c1c89
recursive scan for plugins
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
887
diff
changeset
|
260 } |
887 | 261 } |
262 | |
263 } |