Mercurial > hg > orthanc
annotate Plugins/Samples/StorageArea/Plugin.cpp @ 2756:e00128fc021e Orthanc-0.8.4
close old branch
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 17 Jul 2018 09:41:06 +0200 |
parents | 208dc67b9bab |
children | 6e7e5ed91c2d |
rev | line source |
---|---|
1136
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Orthanc - A Lightweight, RESTful DICOM Store |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2014 Medical Physics Department, CHU of Liege, |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Belgium |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 * |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * Permission is hereby granted, free of charge, to any person |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * obtaining a copy of this software and associated documentation |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * files (the "Software"), to deal in the Software without |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * restriction, including without limitation the rights to use, copy, |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * modify, merge, publish, distribute, sublicense, and/or sell copies |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * of the Software, and to permit persons to whom the Software is |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * furnished to do so, subject to the following conditions: |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * The above copyright notice and this permission notice shall be |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * included in all copies or substantial portions of the Software. |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 * SOFTWARE. |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 **/ |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 #include <OrthancCPlugin.h> |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 #include <string.h> |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 #include <stdio.h> |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 #include <string> |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 static OrthancPluginContext* context = NULL; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 static std::string GetPath(const char* uuid) |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 return "plugin_" + std::string(uuid); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 } |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 static int32_t StorageCreate(const char* uuid, |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 const void* content, |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 int64_t size, |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 OrthancPluginContentType type) |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 std::string path = GetPath(uuid); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 FILE* fp = fopen(path.c_str(), "wb"); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 if (!fp) |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 return -1; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 } |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 bool ok = fwrite(content, size, 1, fp) == 1; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 fclose(fp); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 return ok ? 0 : -1; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 } |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 static int32_t StorageRead(void** content, |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 int64_t* size, |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 const char* uuid, |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 OrthancPluginContentType type) |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 std::string path = GetPath(uuid); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 FILE* fp = fopen(path.c_str(), "rb"); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 if (!fp) |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 return -1; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 } |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 if (fseek(fp, 0, SEEK_END) < 0) |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 fclose(fp); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 return -1; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 } |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 *size = ftell(fp); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 if (fseek(fp, 0, SEEK_SET) < 0) |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 fclose(fp); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 return -1; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 } |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 bool ok = true; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 if (*size == 0) |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 *content = NULL; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 } |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 else |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 *content = malloc(*size); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 if (content == NULL || |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 fread(*content, *size, 1, fp) != 1) |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 ok = false; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 } |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 } |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 fclose(fp); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
107 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
108 return ok ? 0 : -1; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
109 } |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
111 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
112 static int32_t StorageRemove(const char* uuid, |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
113 OrthancPluginContentType type) |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
115 std::string path = GetPath(uuid); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 return remove(path.c_str()); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
117 } |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 extern "C" |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* c) |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 char info[1024]; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
126 context = c; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 OrthancPluginLogWarning(context, "Storage plugin is initializing"); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
129 /* Check the version of the Orthanc core */ |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
130 if (OrthancPluginCheckVersion(c) == 0) |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
131 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 sprintf(info, "Your version of Orthanc (%s) must be above %d.%d.%d to run this plugin", |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 c->orthancVersion, |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER, |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER, |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
137 OrthancPluginLogError(context, info); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
138 return -1; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
139 } |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
141 OrthancPluginRegisterStorageArea(context, StorageCreate, StorageRead, StorageRemove); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
142 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
143 return 0; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
144 } |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
145 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
146 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
147 ORTHANC_PLUGINS_API void OrthancPluginFinalize() |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
148 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
149 OrthancPluginLogWarning(context, "Storage plugin is finalizing"); |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
150 } |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
152 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
153 ORTHANC_PLUGINS_API const char* OrthancPluginGetName() |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
154 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
155 return "storage"; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
156 } |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
157 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
158 |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
159 ORTHANC_PLUGINS_API const char* OrthancPluginGetVersion() |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
160 { |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
161 return "1.0"; |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
162 } |
208dc67b9bab
sample custom storage plugin
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
163 } |