Mercurial > hg > orthanc-python
changeset 142:6288b8132659
replaced "int" by "int32_t" in the SDK to prevent any ABI issue
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 21 Sep 2023 18:18:51 +0200 |
parents | 3867cb23991d |
children | d63c58d650ff |
files | Resources/Orthanc/Sdk-1.10.0/orthanc/OrthancCPlugin.h Resources/OrthancCPlugin-1.10.0.patch Sources/Autogenerated/CodeModel.json Sources/Autogenerated/sdk_GlobalFunctions.impl.h Sources/Autogenerated/sdk_OrthancPluginJob.methods.h |
diffstat | 5 files changed, 113 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/Resources/Orthanc/Sdk-1.10.0/orthanc/OrthancCPlugin.h Fri Sep 15 13:09:27 2023 +0200 +++ b/Resources/Orthanc/Sdk-1.10.0/orthanc/OrthancCPlugin.h Thu Sep 21 18:18:51 2023 +0200 @@ -1829,15 +1829,16 @@ * @see OrthancPluginCheckVersion * @ingroup Callbacks **/ - ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersionAdvanced( + ORTHANC_PLUGIN_INLINE int32_t OrthancPluginCheckVersionAdvanced( OrthancPluginContext* context, - int expectedMajor, - int expectedMinor, - int expectedRevision) - { - int major, minor, revision; - - if (sizeof(int32_t) != sizeof(OrthancPluginErrorCode) || + int32_t expectedMajor, + int32_t expectedMinor, + int32_t expectedRevision) + { + int32_t major, minor, revision; + + if (sizeof(int) != sizeof(int32_t) || /* Ensure binary compatibility with Orthanc SDK <= 1.12.1 */ + sizeof(int32_t) != sizeof(OrthancPluginErrorCode) || sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) || sizeof(int32_t) != sizeof(_OrthancPluginService) || sizeof(int32_t) != sizeof(_OrthancPluginProperty) || @@ -1935,7 +1936,7 @@ * @see OrthancPluginCheckVersionAdvanced * @ingroup Callbacks **/ - ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion( + ORTHANC_PLUGIN_INLINE int32_t OrthancPluginCheckVersion( OrthancPluginContext* context) { return OrthancPluginCheckVersionAdvanced( @@ -3077,7 +3078,7 @@ * @return 1 if the metadata is present, 0 if it is absent, -1 in case of error. * @ingroup DicomInstance **/ - ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata( + ORTHANC_PLUGIN_INLINE int32_t OrthancPluginHasInstanceMetadata( OrthancPluginContext* context, const OrthancPluginDicomInstance* instance, const char* metadata) @@ -6760,7 +6761,7 @@ { char** resultId; OrthancPluginJob *job; - int priority; + int32_t priority; } _OrthancPluginSubmitJob; /** @@ -6779,7 +6780,7 @@ ORTHANC_PLUGIN_INLINE char *OrthancPluginSubmitJob( OrthancPluginContext *context, OrthancPluginJob *job, - int priority) + int32_t priority) { char* resultId = NULL;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/OrthancCPlugin-1.10.0.patch Thu Sep 21 18:18:51 2023 +0200 @@ -0,0 +1,77 @@ +--- OrthancCPlugin.h.orig 2023-09-21 18:02:41.830746493 +0200 ++++ OrthancCPlugin.h 2023-09-21 18:04:07.977591228 +0200 +@@ -1829,15 +1829,16 @@ + * @see OrthancPluginCheckVersion + * @ingroup Callbacks + **/ +- ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersionAdvanced( ++ ORTHANC_PLUGIN_INLINE int32_t OrthancPluginCheckVersionAdvanced( + OrthancPluginContext* context, +- int expectedMajor, +- int expectedMinor, +- int expectedRevision) ++ int32_t expectedMajor, ++ int32_t expectedMinor, ++ int32_t expectedRevision) + { +- int major, minor, revision; ++ int32_t major, minor, revision; + +- if (sizeof(int32_t) != sizeof(OrthancPluginErrorCode) || ++ if (sizeof(int) != sizeof(int32_t) || /* Ensure binary compatibility with Orthanc SDK <= 1.12.1 */ ++ sizeof(int32_t) != sizeof(OrthancPluginErrorCode) || + sizeof(int32_t) != sizeof(OrthancPluginHttpMethod) || + sizeof(int32_t) != sizeof(_OrthancPluginService) || + sizeof(int32_t) != sizeof(_OrthancPluginProperty) || +@@ -1935,7 +1936,7 @@ + * @see OrthancPluginCheckVersionAdvanced + * @ingroup Callbacks + **/ +- ORTHANC_PLUGIN_INLINE int OrthancPluginCheckVersion( ++ ORTHANC_PLUGIN_INLINE int32_t OrthancPluginCheckVersion( + OrthancPluginContext* context) + { + return OrthancPluginCheckVersionAdvanced( +@@ -3077,7 +3078,7 @@ + * @return 1 if the metadata is present, 0 if it is absent, -1 in case of error. + * @ingroup DicomInstance + **/ +- ORTHANC_PLUGIN_INLINE int OrthancPluginHasInstanceMetadata( ++ ORTHANC_PLUGIN_INLINE int32_t OrthancPluginHasInstanceMetadata( + OrthancPluginContext* context, + const OrthancPluginDicomInstance* instance, + const char* metadata) +@@ -3856,13 +3857,13 @@ + OrthancPluginContext* context, + OrthancPluginRestOutput* output, + uint16_t status, +- const char* body, ++ const void* body, + uint32_t bodySize) + { + _OrthancPluginSendHttpStatus params; + params.output = output; + params.status = status; +- params.body = body; ++ params.body = reinterpret_cast<const char*>(body); + params.bodySize = bodySize; + context->InvokeService(context, _OrthancPluginService_SendHttpStatus, ¶ms); + } +@@ -6760,7 +6761,7 @@ + { + char** resultId; + OrthancPluginJob *job; +- int priority; ++ int32_t priority; + } _OrthancPluginSubmitJob; + + /** +@@ -6779,7 +6780,7 @@ + ORTHANC_PLUGIN_INLINE char *OrthancPluginSubmitJob( + OrthancPluginContext *context, + OrthancPluginJob *job, +- int priority) ++ int32_t priority) + { + char* resultId = NULL; +
--- a/Sources/Autogenerated/CodeModel.json Fri Sep 15 13:09:27 2023 +0200 +++ b/Sources/Autogenerated/CodeModel.json Thu Sep 21 18:18:51 2023 +0200 @@ -65,7 +65,7 @@ "count_args": 1, "has_args": true, "return_long": true, - "return_sdk_type": "int", + "return_sdk_type": "int32_t", "self": ", self->object_", "short_name": "HasInstanceMetadata", "tuple_format": "\"s\", &arg0" @@ -541,10 +541,10 @@ "initialization": " = 0", "name": "arg0", "orthanc_cast": "arg0", - "python_format": "i", - "python_type": "int", + "python_format": "l", + "python_type": "long int", "sdk_name": "priority", - "sdk_type": "int" + "sdk_type": "int32_t" } ], "c_function": "OrthancPluginSubmitJob", @@ -555,7 +555,7 @@ "return_sdk_type": "char *", "self": ", self->object_", "short_name": "SubmitJob", - "tuple_format": "\"i\", &arg0" + "tuple_format": "\"l\", &arg0" } ], "short_name": "Job" @@ -2379,28 +2379,28 @@ "initialization": " = 0", "name": "arg0", "orthanc_cast": "arg0", - "python_format": "i", - "python_type": "int", + "python_format": "l", + "python_type": "long int", "sdk_name": "expectedMajor", - "sdk_type": "int" + "sdk_type": "int32_t" }, { "initialization": " = 0", "name": "arg1", "orthanc_cast": "arg1", - "python_format": "i", - "python_type": "int", + "python_format": "l", + "python_type": "long int", "sdk_name": "expectedMinor", - "sdk_type": "int" + "sdk_type": "int32_t" }, { "initialization": " = 0", "name": "arg2", "orthanc_cast": "arg2", - "python_format": "i", - "python_type": "int", + "python_format": "l", + "python_type": "long int", "sdk_name": "expectedRevision", - "sdk_type": "int" + "sdk_type": "int32_t" } ], "c_function": "OrthancPluginCheckVersionAdvanced", @@ -2408,15 +2408,15 @@ "count_args": 3, "has_args": true, "return_long": true, - "return_sdk_type": "int", + "return_sdk_type": "int32_t", "short_name": "CheckVersionAdvanced", - "tuple_format": "\"iii\", &arg0, &arg1, &arg2" + "tuple_format": "\"lll\", &arg0, &arg1, &arg2" }, { "args": [], "c_function": "OrthancPluginCheckVersion", "return_long": true, - "return_sdk_type": "int", + "return_sdk_type": "int32_t", "short_name": "CheckVersion", "tuple_format": "\"\", " },
--- a/Sources/Autogenerated/sdk_GlobalFunctions.impl.h Fri Sep 15 13:09:27 2023 +0200 +++ b/Sources/Autogenerated/sdk_GlobalFunctions.impl.h Thu Sep 21 18:18:51 2023 +0200 @@ -22,11 +22,11 @@ { PythonLock::LogCall("Calling Python global function: OrthancPluginCheckVersionAdvanced()"); - int arg0 = 0; - int arg1 = 0; - int arg2 = 0; + long int arg0 = 0; + long int arg1 = 0; + long int arg2 = 0; - if (!PyArg_ParseTuple(args, "iii", &arg0, &arg1, &arg2)) + if (!PyArg_ParseTuple(args, "lll", &arg0, &arg1, &arg2)) { PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (3 arguments expected)"); return NULL;
--- a/Sources/Autogenerated/sdk_OrthancPluginJob.methods.h Fri Sep 15 13:09:27 2023 +0200 +++ b/Sources/Autogenerated/sdk_OrthancPluginJob.methods.h Thu Sep 21 18:18:51 2023 +0200 @@ -10,9 +10,9 @@ return NULL; } - int arg0 = 0; + long int arg0 = 0; - if (!PyArg_ParseTuple(args, "i", &arg0)) + if (!PyArg_ParseTuple(args, "l", &arg0)) { PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); return NULL;