Mercurial > hg > orthanc
comparison Plugins/Samples/Basic/Plugin.c @ 1039:5a5a4890ffca
check version in plugins
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 17 Jul 2014 12:46:00 +0200 |
parents | 3e43de893d88 |
children | d06186cdc502 |
comparison
equal
deleted
inserted
replaced
1038:a53dc58edc5a | 1039:5a5a4890ffca |
---|---|
132 const char* pathLocator = "\"Path\" : \""; | 132 const char* pathLocator = "\"Path\" : \""; |
133 OrthancPluginMemoryBuffer tmp; | 133 OrthancPluginMemoryBuffer tmp; |
134 char info[1024]; | 134 char info[1024]; |
135 char *id, *eos; | 135 char *id, *eos; |
136 | 136 |
137 char error[256]; | |
138 if (OrthancPluginCheckVersion(c) == 0) | |
139 { | |
140 sprintf(error, "Your version of Orthanc (%s) must be above %d.%d.%d to run this plugin", | |
141 c->orthancVersion, | |
142 ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER, | |
143 ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER, | |
144 ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER); | |
145 OrthancPluginLogError(context, error); | |
146 return -1; | |
147 } | |
148 | |
137 context = c; | 149 context = c; |
138 OrthancPluginLogWarning(context, "Sample plugin is initializing"); | 150 OrthancPluginLogWarning(context, "Sample plugin is initializing"); |
139 | 151 |
140 sprintf(info, "The version of Orthanc is '%s'", context->orthancVersion); | 152 sprintf(info, "The version of Orthanc is '%s'", context->orthancVersion); |
141 OrthancPluginLogInfo(context, info); | 153 OrthancPluginLogInfo(context, info); |