Mercurial > hg > orthanc
diff Plugins/Include/OrthancCPlugin.h @ 1407:d371a66972a4
OrthancPluginGetExpectedDatabaseVersion
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 03 Jun 2015 10:19:13 +0200 |
parents | f497a72d9f71 |
children | 7b7d597a190c |
line wrap: on
line diff
--- a/Plugins/Include/OrthancCPlugin.h Tue Jun 02 17:48:13 2015 +0200 +++ b/Plugins/Include/OrthancCPlugin.h Wed Jun 03 10:19:13 2015 +0200 @@ -89,8 +89,8 @@ #endif #define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER 0 -#define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 8 -#define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 6 +#define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER 9 +#define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER 0 @@ -255,6 +255,7 @@ _OrthancPluginService_SetGlobalProperty = 9, _OrthancPluginService_GetCommandLineArgumentsCount = 10, _OrthancPluginService_GetCommandLineArgument = 11, + _OrthancPluginService_GetExpectedDatabaseVersion = 12, /* Registration of callbacks */ _OrthancPluginService_RegisterRestCallback = 1000, @@ -2085,6 +2086,36 @@ } + /** + * @brief Get the expected version of the database schema. + * + * Retrieve the expected version of the database schema. + * + * @param context The Orthanc plugin context, as received by OrthancPluginInitialize(). + * @return The version. + **/ + ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion( + OrthancPluginContext* context) + { + uint32_t count = 0; + + _OrthancPluginReturnSingleValue params; + memset(¶ms, 0, sizeof(params)); + params.resultUint32 = &count; + + if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, ¶ms)) + { + /* Error */ + return 0; + } + else + { + return count; + } + } + + + #ifdef __cplusplus } #endif