comparison Plugins/Samples/ServeFolders/Plugin.cpp @ 1322:f497a72d9f71

fixes to the sample plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 13 Feb 2015 13:28:01 +0100
parents
children 5a92665dee23
comparison
equal deleted inserted replaced
1321:0f9e0e808e0f 1322:f497a72d9f71
1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 *
6 * Permission is hereby granted, free of charge, to any person
7 * obtaining a copy of this software and associated documentation
8 * files (the "Software"), to deal in the Software without
9 * restriction, including without limitation the rights to use, copy,
10 * modify, merge, publish, distribute, sublicense, and/or sell copies
11 * of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be
15 * included in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
21 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
22 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 * SOFTWARE.
25 **/
26
27
28 #include <OrthancCPlugin.h>
29
30 #include <string.h>
31 #include <stdio.h>
32
33 static OrthancPluginContext* context_ = NULL;
34
35
36 static int32_t Callback(OrthancPluginRestOutput* output,
37 const char* url,
38 const OrthancPluginHttpRequest* request)
39 {
40 }
41
42
43
44 extern "C"
45 {
46 ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context)
47 {
48 context_ = context;
49
50 /* Check the version of the Orthanc core */
51 if (OrthancPluginCheckVersion(context_) == 0)
52 {
53 char info[1024];
54 sprintf(info, "Your version of Orthanc (%s) must be above %d.%d.%d to run this plugin",
55 context_->orthancVersion,
56 ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER,
57 ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER,
58 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER);
59 OrthancPluginLogError(context, info);
60 return -1;
61 }
62
63 OrthancPluginSetDescription(context_, "Serve additional folders with the HTTP server of Orthanc.");
64
65 return 0;
66 }
67
68
69 ORTHANC_PLUGINS_API void OrthancPluginFinalize()
70 {
71 }
72
73
74 ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
75 {
76 return "serve-folders";
77 }
78
79
80 ORTHANC_PLUGINS_API const char* OrthancPluginGetVersion()
81 {
82 return "1.0";
83 }
84 }