Mercurial > hg > orthanc
comparison Plugins/OrthancCPlugin/OrthancCPlugin.h @ 1041:2c49b7dffcec
plugins have access to the HTTP headers
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 17 Jul 2014 14:14:15 +0200 |
parents | d06186cdc502 |
children | 8d1845feb277 |
comparison
equal
deleted
inserted
replaced
1040:d06186cdc502 | 1041:2c49b7dffcec |
---|---|
6 * Orthanc plugin must expose 4 public functions with the following | 6 * Orthanc plugin must expose 4 public functions with the following |
7 * signatures: | 7 * signatures: |
8 * | 8 * |
9 * -# <tt>int32_t OrthancPluginInitialize(const OrthancPluginContext* context)</tt>: | 9 * -# <tt>int32_t OrthancPluginInitialize(const OrthancPluginContext* context)</tt>: |
10 * This function is invoked by Orthanc when it loads the plugin on startup. | 10 * This function is invoked by Orthanc when it loads the plugin on startup. |
11 * The plugin must store the context pointer so that it can use the plugin | 11 * The plugin must: |
12 * services of Orthanc. It must also register all its callbacks using | 12 * - Check its compatibility with the Orthanc version using |
13 * ::OrthancPluginRegisterRestCallback(). | 13 * ::OrthancPluginCheckVersion(). |
14 * - Store the context pointer so that it can use the plugin | |
15 * services of Orthanc. | |
16 * - Register all its REST callbacks using ::OrthancPluginRegisterRestCallback(). | |
14 * -# <tt>void OrthancPluginFinalize()</tt>: | 17 * -# <tt>void OrthancPluginFinalize()</tt>: |
15 * This function is invoked by Orthanc during its shutdown. The plugin | 18 * This function is invoked by Orthanc during its shutdown. The plugin |
16 * must free all its memory. | 19 * must free all its memory. |
17 * -# <tt>const char* OrthancPluginGetName()</tt>: | 20 * -# <tt>const char* OrthancPluginGetName()</tt>: |
18 * The plugin must return a short string to identify itself. | 21 * The plugin must return a short string to identify itself. |
19 * -# <tt>const char* OrthancPluginGetVersion()</tt> | 22 * -# <tt>const char* OrthancPluginGetVersion()</tt>: |
20 * The plugin must return a string containing its version number. | 23 * The plugin must return a string containing its version number. |
21 * | 24 * |
22 * The name and the version of a plugin is only used to prevent it | 25 * The name and the version of a plugin is only used to prevent it |
23 * from being loaded twice. | 26 * from being loaded twice. |
24 * | 27 * |
200 | 203 |
201 /** | 204 /** |
202 * @brief For a PUT or POST request, the number of bytes of the body. | 205 * @brief For a PUT or POST request, the number of bytes of the body. |
203 **/ | 206 **/ |
204 uint32_t bodySize; | 207 uint32_t bodySize; |
208 | |
209 | |
210 /* -------------------------------------------------- | |
211 New in version 0.8.1 | |
212 -------------------------------------------------- */ | |
213 | |
214 /** | |
215 * @brief The number of HTTP headers. | |
216 **/ | |
217 uint32_t headersCount; | |
218 | |
219 /** | |
220 * @brief The keys of the HTTP headers (always converted to low-case). | |
221 **/ | |
222 const char* const* headersKeys; | |
223 | |
224 /** | |
225 * @brief The values of the HTTP headers. | |
226 **/ | |
227 const char* const* headersValues; | |
228 | |
205 } OrthancPluginHttpRequest; | 229 } OrthancPluginHttpRequest; |
230 | |
206 | 231 |
207 typedef enum | 232 typedef enum |
208 { | 233 { |
209 /* Generic services */ | 234 /* Generic services */ |
210 _OrthancPluginService_LogInfo = 1, | 235 _OrthancPluginService_LogInfo = 1, |
351 } | 376 } |
352 } | 377 } |
353 | 378 |
354 | 379 |
355 /** | 380 /** |
356 * @brief Check the version of Orthanc. | 381 * @brief Check the compatibility of the plugin wrt. the version of its hosting Orthanc. |
357 * | 382 * |
358 * This function checks whether the version of this C header is | 383 * This function checks whether the version of this C header is |
359 * compatible with the current version of Orthanc. The result of | 384 * compatible with the current version of Orthanc. The result of |
360 * this function should always be checked in the | 385 * this function should always be checked in the |
361 * OrthancPluginInitialize() entry point of the plugin. | 386 * OrthancPluginInitialize() entry point of the plugin. |