changeset 0:3ecef5782f2c

initial commit
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Oct 2023 17:59:44 +0200
parents
children f3f1be77853f
files CodeGeneration/ClassDocumentation.json CodeGeneration/ClassDocumentation.json.license CodeGeneration/CodeGeneration.py CodeGeneration/CodeModel.json CodeGeneration/CodeModel.json.license CodeGeneration/CppNativeSDK.mustache CodeGeneration/JavaClass.mustache CodeGeneration/JavaEnumeration.mustache CodeGeneration/JavaFunctions.mustache CodeGeneration/JavaNativeSDK.mustache CodeGeneration/ParseOrthancSDK.py JavaSDK/CMakeLists.txt JavaSDK/be/uclouvain/orthanc/Callbacks.java JavaSDK/be/uclouvain/orthanc/ChangeType.java JavaSDK/be/uclouvain/orthanc/CompressionType.java JavaSDK/be/uclouvain/orthanc/ConstraintType.java JavaSDK/be/uclouvain/orthanc/ContentType.java JavaSDK/be/uclouvain/orthanc/CreateDicomFlags.java JavaSDK/be/uclouvain/orthanc/DicomInstance.java JavaSDK/be/uclouvain/orthanc/DicomToJsonFlags.java JavaSDK/be/uclouvain/orthanc/DicomToJsonFormat.java JavaSDK/be/uclouvain/orthanc/DicomWebBinaryMode.java JavaSDK/be/uclouvain/orthanc/DicomWebNode.java JavaSDK/be/uclouvain/orthanc/ErrorCode.java JavaSDK/be/uclouvain/orthanc/FindAnswers.java JavaSDK/be/uclouvain/orthanc/FindMatcher.java JavaSDK/be/uclouvain/orthanc/FindQuery.java JavaSDK/be/uclouvain/orthanc/Functions.java JavaSDK/be/uclouvain/orthanc/HttpMethod.java JavaSDK/be/uclouvain/orthanc/IdentifierConstraint.java JavaSDK/be/uclouvain/orthanc/Image.java JavaSDK/be/uclouvain/orthanc/ImageFormat.java JavaSDK/be/uclouvain/orthanc/InstanceOrigin.java JavaSDK/be/uclouvain/orthanc/Job.java JavaSDK/be/uclouvain/orthanc/JobStepStatus.java JavaSDK/be/uclouvain/orthanc/JobStopReason.java JavaSDK/be/uclouvain/orthanc/MetricsType.java JavaSDK/be/uclouvain/orthanc/NativeSDK.java JavaSDK/be/uclouvain/orthanc/OrthancException.java JavaSDK/be/uclouvain/orthanc/Peers.java JavaSDK/be/uclouvain/orthanc/PixelFormat.java JavaSDK/be/uclouvain/orthanc/ReceivedInstanceAction.java JavaSDK/be/uclouvain/orthanc/ResourceType.java JavaSDK/be/uclouvain/orthanc/RestOutput.java JavaSDK/be/uclouvain/orthanc/ServerChunkedRequestReader.java JavaSDK/be/uclouvain/orthanc/StorageArea.java JavaSDK/be/uclouvain/orthanc/StorageCommitmentFailureReason.java JavaSDK/be/uclouvain/orthanc/ValueRepresentation.java JavaSDK/be/uclouvain/orthanc/WorklistAnswers.java JavaSDK/be/uclouvain/orthanc/WorklistQuery.java LICENSES/CC0-1.0.txt LICENSES/Classpath-exception-2.0.txt LICENSES/GPL-2.0-only.txt LICENSES/GPL-3.0-or-later.txt LICENSES/LGPL-3.0-or-later.txt NEWS Plugin/CMakeLists.txt Plugin/Mutex.cpp Plugin/Mutex.h Plugin/NativeSDK.cpp Plugin/NonCopyable.h Plugin/Plugin.cpp README Resources/Orthanc/CMake/AutoGeneratedCode.cmake Resources/Orthanc/CMake/Compiler.cmake Resources/Orthanc/CMake/DownloadPackage.cmake Resources/Orthanc/CMake/JsonCppConfiguration.cmake Resources/Orthanc/CMake/WindowsResources.py Resources/Orthanc/CMake/WindowsResources.rc Resources/Orthanc/Plugins/ExportedSymbolsPlugins.list Resources/Orthanc/Plugins/OrthancPluginsExports.cmake Resources/Orthanc/Plugins/VersionScriptPlugins.map Resources/Orthanc/Sdk-1.10.0/orthanc/OrthancCPlugin.h Resources/Orthanc/Toolchains/LinuxStandardBaseToolchain.cmake Resources/Orthanc/Toolchains/MinGW-W64-Toolchain32.cmake Resources/Orthanc/Toolchains/MinGW-W64-Toolchain64.cmake Resources/OrthancCPlugin-1.10.0.patch Resources/SyncOrthancFolder.py Resources/jdk8u382-b05-win32/LICENSE Resources/jdk8u382-b05-win32/NOTES.txt Resources/jdk8u382-b05-win32/include/jni.h Resources/jdk8u382-b05-win32/include/win32/jni_md.h Resources/jdk8u382-b05-win32/lib/jvm.lib Resources/jdk8u382-b05-win64/LICENSE Resources/jdk8u382-b05-win64/NOTES.txt Resources/jdk8u382-b05-win64/include/jni.h Resources/jdk8u382-b05-win64/include/win32/jni_md.h Resources/jdk8u382-b05-win64/lib/jvm.lib
diffstat 88 files changed, 33002 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CodeGeneration/ClassDocumentation.json	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,15 @@
+{
+  "OrthancPluginDicomInstance" : "DICOM instance managed by the Orthanc core",
+  "OrthancPluginDicomWebNode" : "Node visited by DICOMweb conversion",
+  "OrthancPluginFindAnswers" : "Answers to a DICOM C-FIND query",
+  "OrthancPluginFindMatcher" : "Matcher for DICOM C-FIND query",
+  "OrthancPluginFindQuery" : "DICOM C-FIND query",
+  "OrthancPluginImage" : "2D image managed by the Orthanc core",
+  "OrthancPluginJob" : "Orthanc job",
+  "OrthancPluginPeers" : "Orthanc peer",
+  "OrthancPluginRestOutput" : "Output for a call to the REST API of Orthanc",
+  "OrthancPluginServerChunkedRequestReader" : "Read for a chunked HTTP request",
+  "OrthancPluginStorageArea" : "Storage area plugin",
+  "OrthancPluginWorklistAnswers" : "Answers to a DICOM C-FIND worklist query",
+  "OrthancPluginWorklistQuery" : "DICOM C-FIND worklist query"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CodeGeneration/ClassDocumentation.json.license	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,2 @@
+# SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+# SPDX-License-Identifier: GPL-3.0-or-later
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CodeGeneration/CodeGeneration.py	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,475 @@
+#!/usr/bin/env python3
+
+# SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# Java plugin for Orthanc
+# Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+import argparse
+import json
+import os
+import pystache
+
+
+SOURCE = os.path.abspath(os.path.dirname(__file__))
+
+parser = argparse.ArgumentParser(description = 'Generate Java wrapper from code model.')
+parser.add_argument('--source',
+                    default = os.path.join(SOURCE, 'CodeModel.json'),
+                    help = 'location of the JSON code model')
+
+args = parser.parse_args()
+
+
+
+TARGET = os.path.join(SOURCE, '..', 'JavaSDK', 'be', 'uclouvain', 'orthanc')
+
+with open(args.source, 'r') as f:
+    model = json.loads(f.read())
+
+with open(os.path.join(SOURCE, 'ClassDocumentation.json'), 'r') as f:
+    classDocumentation = json.loads(f.read())
+
+    
+renderer = pystache.Renderer(
+    escape = lambda u: u,  # No escaping
+)
+
+
+def ToUpperCase(name):
+    s = ''
+    for i in range(len(name)):
+        if name[i].isupper():
+            if len(s) == 0:
+                s += name[i]
+            elif name[i - 1].islower():
+                s += '_' + name[i]
+            elif (i + 1 < len(name) and
+                  name[i - 1].islower() and
+                  name[i + 1].isupper()):
+                s += '_' + name[i]
+            else:
+                s += name[i]
+        else:
+            s += name[i].upper()
+    return s
+
+
+def RemoveOrthancPluginPrefix(s, isCamelCase):
+    PREFIX = 'OrthancPlugin'
+    if s.startswith(PREFIX):
+        t = s[len(PREFIX):]
+        if isCamelCase:
+            t = t[0].lower() + t[1:]
+        return t
+    else:
+        raise Exception('Incorrect prefix: %s' % s)
+
+
+def ConvertReturnType(f):
+    result = None
+
+    if f['return_sdk_type'] == 'void':
+        result = {
+            'c_type' : 'void',
+            'is_void' : True,
+            'java_signature' : 'V',
+            'java_type' : 'void',
+            }
+    elif f['return_sdk_type'] in [ 'int', 'int32_t', 'uint32_t' ]:
+        result = {
+            'c_type' : 'jint',
+            'default_value' : '0',
+            'is_number' : True,
+            'java_signature' : 'I',
+            'java_type' : 'int',
+            }
+    elif f['return_sdk_type'] in [ 'int64_t' ]:
+        result = {
+            'c_type' : 'jlong',
+            'default_value' : '0',
+            'is_number' : True,
+            'java_signature' : 'J',
+            'java_type' : 'long',
+            }
+    elif f['return_sdk_type'] == 'OrthancPluginMemoryBuffer *':
+        result = {
+            'c_type' : 'jbyteArray',
+            'default_value' : 'NULL',
+            'is_bytes' : True,
+            'java_signature' : '[B',
+            'java_type' : 'byte[]',
+            }
+    elif f['return_sdk_type'] == 'enumeration':
+        if f['return_sdk_enumeration'] == 'OrthancPluginErrorCode':
+            result = {
+                'c_type' : 'void',
+                'is_exception' : True,
+                'java_signature' : 'V',
+                'java_type' : 'void',
+            }
+        else:
+            result = {
+                'c_type' : 'jint',
+                'default_value' : '0',
+                'is_enumeration' : True,
+                'java_wrapper_type' : RemoveOrthancPluginPrefix(f['return_sdk_enumeration'], False),
+                'java_signature' : 'I',
+                'java_type' : 'int',
+            }
+    elif f['return_sdk_type'] == 'object':
+        result = {
+            'c_type' : 'jlong',
+            'class_name' : f['return_sdk_class'],
+            'default_value' : '0',
+            'is_object' : True,
+            'java_wrapper_type' : RemoveOrthancPluginPrefix(f['return_sdk_class'], False),
+            'java_signature' : 'J',
+            'java_type' : 'long',
+            }
+    elif f['return_sdk_type'] == 'char *':
+        result = {
+            'c_type' : 'jstring',
+            'default_value' : 'NULL',
+            'is_dynamic_string' : True,
+            'java_signature' : 'Ljava/lang/String;',
+            'java_type' : 'String',
+            }
+    elif f['return_sdk_type'] == 'const char *':
+        result = {
+            'c_type' : 'jstring',
+            'default_value' : 'NULL',
+            'is_static_string' : True,
+            'java_signature' : 'Ljava/lang/String;',
+            'java_type' : 'String',
+            }
+    else:
+        raise Exception('Unsupported return type: %s' % json.dumps(f, indent=4))
+
+    if not 'java_wrapper_type' in result:
+        result['java_wrapper_type'] = result['java_type']
+
+    return result
+
+def ConvertArgument(arg):
+    result = None
+
+    if arg['sdk_type'] in [ 'int', 'int32_t', 'uint32_t' ]:
+        result = {
+            'c_type' : 'jint',
+            'java_signature' : 'I',
+            'java_type' : 'int',
+        }
+    elif arg['sdk_type'] == 'uint8_t':
+        result = {
+            'c_type' : 'jbyte',
+            'java_signature' : 'B',
+            'java_type' : 'byte',
+        }
+    elif arg['sdk_type'] == 'uint16_t':
+        result = {
+            'c_type' : 'jshort',
+            'java_signature' : 'S',
+            'java_type' : 'short',
+        }
+    elif arg['sdk_type'] == 'uint64_t':
+        result = {
+            'c_type' : 'jlong',
+            'java_signature' : 'J',
+            'java_type' : 'long',
+        }
+    elif arg['sdk_type'] == 'float':
+        result = {
+            'c_type' : 'jfloat',
+            'java_signature' : 'F',
+            'java_type' : 'float',
+        }
+    elif arg['sdk_type'] == 'const char *':
+        result = {
+            'c_accessor' : 'c_%s.GetValue()' % arg['name'],
+            'c_type' : 'jstring',
+            'convert_string' : True,
+            'java_signature' : 'Ljava/lang/String;',
+            'java_type' : 'String',
+        }
+    elif arg['sdk_type'] == 'const_void_pointer_with_size':
+        result = {
+            'c_accessor' : 'c_%s.GetData(), c_%s.GetSize()' % (arg['name'], arg['name']),
+            'c_type' : 'jbyteArray',
+            'convert_bytes' : True,
+            'java_signature' : '[B',
+            'java_type' : 'byte[]',
+        }
+    elif arg['sdk_type'] == 'enumeration':
+        result = {
+            'c_accessor' : 'static_cast<%s>(%s)' % (arg['sdk_enumeration'], arg['name']),
+            'c_type' : 'jint',
+            'java_wrapper_accessor' : '%s.getValue()' % arg['sdk_name'],
+            'java_wrapper_type' : RemoveOrthancPluginPrefix(arg['sdk_enumeration'], False),
+            'java_signature' : 'I',
+            'java_type' : 'int',
+            }
+    elif arg['sdk_type'] == 'const void *':
+        result = {
+            'c_accessor' : 'c_%s.GetData()' % arg['name'],
+            'c_type' : 'jbyteArray',
+            'convert_bytes' : True,
+            'java_signature' : '[B',
+            'java_type' : 'byte[]',
+        }
+    elif arg['sdk_type'] in [ 'object', 'const_object' ]:
+        result = {
+            'c_accessor' : 'reinterpret_cast<%s*>(static_cast<intptr_t>(%s))' % (arg['sdk_class'], arg['name']),
+            'c_type' : 'jlong',
+            'java_signature' : 'J',
+            'java_type' : 'long',
+            'java_wrapper_accessor' : '%s.getSelf()' % arg['sdk_name'],
+            'java_wrapper_type' : RemoveOrthancPluginPrefix(arg['sdk_class'], False),
+        }
+    else:
+        raise Exception('Unsupported argument type: %s' % json.dumps(arg, indent=4))
+
+    result['name'] = arg['name']
+    result['sdk_name'] = arg['sdk_name']
+
+    if not 'java_wrapper_type' in result:
+        result['java_wrapper_type'] = result['java_type']
+
+    if not 'java_wrapper_accessor' in result:
+        result['java_wrapper_accessor'] = arg['sdk_name']
+
+    if not 'c_accessor' in result:
+        result['c_accessor'] = arg['name']
+
+    return result
+
+
+def FixLinesWidth(source):
+    target = []
+
+    for line in source:
+        for word in line.split(' '):
+            if len(target) == 0:
+                target.append(word)
+            elif len(target[-1]) == 0:
+                target[-1] = word
+            elif len(target[-1] + ' ' + word) <= 80:
+                target[-1] = target[-1] + ' ' + word
+            else:
+                target.append(word)
+        target.append('')
+
+    while len(target) > 0:
+        if target[-1] == '':
+            target = target[:-1]
+        else:
+            break
+
+    return target
+
+
+def EncodeFunctionDocumentation(f):
+    documentation = f['documentation']
+    
+    paragraphs = [ ]
+    if 'summary' in documentation:
+        paragraphs.append(documentation['summary'])
+        paragraphs.append('')
+
+    if 'description' in documentation:
+        for line in documentation['description']:
+            paragraphs.append(line)
+            paragraphs.append('')
+
+    if 'args' in documentation:
+        for arg in f['args']:
+            name = arg['sdk_name']
+            if name in documentation['args']:
+                doc = documentation['args'][name]
+                paragraphs.append('@param %s %s' % (name, doc))
+
+    if 'return' in documentation:
+        if (f['return_sdk_type'] == 'enumeration' and
+            f['return_sdk_enumeration'] == 'OrthancPluginErrorCode'):
+            pass
+        elif f['return_sdk_type'] == 'object':
+            paragraphs.append('@return The newly constructed object.')
+        elif f['return_sdk_type'] in [ 'char *', 'const char *' ]:
+            paragraphs.append('@return The resulting string.')
+        elif f['return_sdk_type'] == 'OrthancPluginMemoryBuffer *':
+            paragraphs.append('@return The resulting memory buffer.')
+        else:
+            paragraphs.append('@return ' + documentation['return'])
+
+    lines = FixLinesWidth(paragraphs)
+
+    return list(map(lambda x: { 'line' : x }, lines))
+
+
+def EncodeFunction(className, f):
+    args = []
+    for a in f['args']:
+        args.append(ConvertArgument(a))
+
+    if len(args) > 0:
+        args[-1]['last'] = True
+
+    returnType = ConvertReturnType(f)
+    signature = '(%s%s)%s' % ('J' if className != None else '',
+                              ''.join(map(lambda x: x['java_signature'], args)),
+                              returnType['java_signature'])
+
+    result = {
+        'args' : args,
+        'c_function' : f['c_function'],
+        'class_name' : className,
+        'has_args' : len(args) > 0,
+        'java_signature' : signature,
+        'return' : returnType,
+        'java_name' : RemoveOrthancPluginPrefix(f['c_function'], True),
+    }
+
+    if 'documentation' in f:
+        result['has_documentation'] = True
+        result['documentation'] = EncodeFunctionDocumentation(f)
+
+    if (returnType.get('is_number') == True or
+        returnType.get('is_bytes') == True or
+        returnType.get('is_dynamic_string') == True or
+        returnType.get('is_static_string') == True):
+        result['java_return_start'] = 'return '
+
+    elif returnType.get('is_enumeration') == True:
+        result['java_return_start'] = 'return %s.getInstance(' % returnType['java_wrapper_type']
+        result['java_return_end'] = ')'
+
+    elif returnType.get('is_object') == True:
+        result['java_return_start'] = 'return new %s(' % returnType['java_wrapper_type']
+        result['java_return_end'] = ')'
+
+    return result
+
+
+nativeFunctions = []
+
+for f in model['global_functions']:
+    nativeFunctions.append(EncodeFunction(None, f))
+
+
+for c in model['classes']:
+    if 'destructor' in c:
+        nativeFunctions.append(EncodeFunction(c['name'], {
+            'args' : [],
+            'c_function' : c['destructor'],
+            'return_sdk_type' : 'void',
+        }))
+
+    for m in c['methods']:
+        nativeFunctions.append(EncodeFunction(c['name'], m))
+        
+
+with open(os.path.join(SOURCE, 'JavaNativeSDK.mustache'), 'r') as f:
+    template = f.read()
+
+    with open(os.path.join(TARGET, 'NativeSDK.java'), 'w') as g:
+        g.write(renderer.render(template, {
+            'functions' : nativeFunctions
+        }))
+
+
+with open(os.path.join(SOURCE, 'JavaFunctions.mustache'), 'r') as f:
+    template = f.read()
+
+    with open(os.path.join(TARGET, 'Functions.java'), 'w') as g:
+        g.write(renderer.render(template, {
+            'functions' : filter(lambda x: (x['class_name'] == None and
+                                            x['return'].get('is_object') != True), nativeFunctions),
+        }))
+
+
+with open(os.path.join(SOURCE, 'CppNativeSDK.mustache'), 'r') as f:
+    template = f.read()
+
+    with open(os.path.join(SOURCE, '..', 'Plugin', 'NativeSDK.cpp'), 'w') as g:
+        s = renderer.render(template, {
+            'functions' : nativeFunctions
+        })
+
+        s = s.splitlines()
+        s = filter(lambda l: not l.isspace() or len(l) == 0, s)
+        
+        g.write('\n'.join(s))
+
+        
+
+for enum in model['enumerations']:
+    if not enum['name'].startswith('OrthancPlugin'):
+        raise Exception()
+
+    enum['short_name'] = enum['name'][len('OrthancPlugin'):]
+
+    for i in range(len(enum['values'])):
+        enum['values'][i]['key'] = ToUpperCase(enum['values'][i]['key'])
+
+        if 'documentation' in enum['values'][i]:
+            enum['values'][i]['has_documentation'] = True
+            enum['values'][i]['documentation'] = list(map(lambda x: { 'line' : x }, FixLinesWidth([ enum['values'][i]['documentation'] ])))
+
+    enum['values'][-1]['last'] = True
+
+    if 'documentation' in enum:
+        enum['has_documentation'] = True
+        enum['documentation'] = list(map(lambda x: { 'line' : x }, FixLinesWidth([ enum['documentation'] ])))
+
+    with open(os.path.join(SOURCE, 'JavaEnumeration.mustache'), 'r') as f:
+        template = f.read()
+        
+        with open(os.path.join(TARGET, '%s.java' % enum['short_name']), 'w') as g:
+            g.write(renderer.render(template, enum))
+
+
+
+for cls in model['classes']:
+    shortName = RemoveOrthancPluginPrefix(cls['name'], False)
+
+    with open(os.path.join(SOURCE, 'JavaClass.mustache'), 'r') as f:
+        template = f.read()
+
+        methods = []
+        for m in cls['methods']:
+            methods.append(EncodeFunction(shortName, m))
+
+        constructors = []
+        for f in nativeFunctions:
+            if (f['class_name'] == None and
+                f['return'].get('is_object') == True and
+                f['return']['class_name'] == cls['name']):
+                constructors.append(f)
+
+        with open(os.path.join(TARGET, '%s.java' % shortName), 'w') as g:
+            if not cls['name'] in classDocumentation:
+                raise Exception('No global documentation for class: %s' % cls['name'])
+
+            g.write(renderer.render(template, {
+                'destructor' : cls.get('destructor'),
+                'class_name' : shortName,
+                'methods' : methods,
+                'constructors' : constructors,
+                'has_documentation' : True,
+                'documentation' : classDocumentation[cls['name']],
+            }))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CodeGeneration/CodeModel.json	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,4317 @@
+{
+    "classes": [
+        {
+            "destructor": "OrthancPluginFreeDicomInstance",
+            "methods": [
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginGetInstanceRemoteAet",
+                    "const": true,
+                    "documentation": {
+                        "args": {},
+                        "description": [
+                            "This function returns the Application Entity Title (AET) of the DICOM modality from which a DICOM instance originates."
+                        ],
+                        "return": "The AET if success, NULL if error.",
+                        "summary": "Get the AET of a DICOM instance."
+                    },
+                    "return_sdk_type": "const char *"
+                },
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginGetInstanceSize",
+                    "const": true,
+                    "documentation": {
+                        "args": {},
+                        "description": [
+                            "This function returns the number of bytes of the given DICOM instance."
+                        ],
+                        "return": "The size of the file, -1 in case of error.",
+                        "summary": "Get the size of a DICOM file."
+                    },
+                    "return_sdk_type": "int64_t"
+                },
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginGetInstanceJson",
+                    "const": true,
+                    "documentation": {
+                        "args": {},
+                        "description": [
+                            "This function returns a pointer to a newly created string containing a JSON file. This JSON file encodes the tag hierarchy of the given DICOM instance."
+                        ],
+                        "return": "The NULL value in case of error, or a string containing the JSON file. This string must be freed by OrthancPluginFreeString().",
+                        "summary": "Get the DICOM tag hierarchy as a JSON file."
+                    },
+                    "return_sdk_type": "char *"
+                },
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginGetInstanceSimplifiedJson",
+                    "const": true,
+                    "documentation": {
+                        "args": {},
+                        "description": [
+                            "This function returns a pointer to a newly created string containing a JSON file. This JSON file encodes the tag hierarchy of the given DICOM instance. In contrast with ::OrthancPluginGetInstanceJson(), the returned JSON file is in its simplified version."
+                        ],
+                        "return": "The NULL value in case of error, or a string containing the JSON file. This string must be freed by OrthancPluginFreeString().",
+                        "summary": "Get the DICOM tag hierarchy as a JSON file (with simplification)."
+                    },
+                    "return_sdk_type": "char *"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "metadata",
+                            "sdk_type": "const char *"
+                        }
+                    ],
+                    "c_function": "OrthancPluginHasInstanceMetadata",
+                    "const": true,
+                    "documentation": {
+                        "args": {
+                            "metadata": "The metadata of interest."
+                        },
+                        "description": [
+                            "This function checks whether the DICOM instance of interest is associated with some metadata. As of Orthanc 0.8.1, in the callbacks registered by ::OrthancPluginRegisterOnStoredInstanceCallback(), the only possibly available metadata are \"ReceptionDate\", \"RemoteAET\" and \"IndexInSeries\"."
+                        ],
+                        "return": "1 if the metadata is present, 0 if it is absent, -1 in case of error.",
+                        "summary": "Check whether a DICOM instance is associated with some metadata."
+                    },
+                    "return_sdk_type": "int32_t"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "metadata",
+                            "sdk_type": "const char *"
+                        }
+                    ],
+                    "c_function": "OrthancPluginGetInstanceMetadata",
+                    "const": true,
+                    "documentation": {
+                        "args": {
+                            "metadata": "The metadata of interest."
+                        },
+                        "description": [
+                            "This functions returns the value of some metadata that is associated with the DICOM instance of interest. Before calling this function, the existence of the metadata must have been checked with ::OrthancPluginHasInstanceMetadata()."
+                        ],
+                        "return": "The metadata value if success, NULL if error. Please note that the returned string belongs to the instance object and must NOT be deallocated. Please make a copy of the string if you wish to access it later.",
+                        "summary": "Get the value of some metadata associated with a given DICOM instance."
+                    },
+                    "return_sdk_type": "const char *"
+                },
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginGetInstanceOrigin",
+                    "const": true,
+                    "documentation": {
+                        "args": {},
+                        "description": [
+                            "This function returns the origin of a DICOM instance that has been received by Orthanc."
+                        ],
+                        "return": "The origin of the instance.",
+                        "summary": "Get the origin of a DICOM file."
+                    },
+                    "return_sdk_enumeration": "OrthancPluginInstanceOrigin",
+                    "return_sdk_type": "enumeration"
+                },
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginGetInstanceTransferSyntaxUid",
+                    "const": true,
+                    "documentation": {
+                        "args": {},
+                        "description": [
+                            "This function returns a pointer to a newly created string that contains the transfer syntax UID of the DICOM instance. The empty string might be returned if this information is unknown."
+                        ],
+                        "return": "The NULL value in case of error, or a string containing the transfer syntax UID. This string must be freed by OrthancPluginFreeString().",
+                        "summary": "Get the transfer syntax of a DICOM file."
+                    },
+                    "return_sdk_type": "char *"
+                },
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginHasInstancePixelData",
+                    "const": true,
+                    "documentation": {
+                        "args": {},
+                        "description": [
+                            "This function returns a Boolean value indicating whether the DICOM instance contains the pixel data (7FE0,0010) tag."
+                        ],
+                        "return": "\"1\" if the DICOM instance contains pixel data, or \"0\" if the tag is missing, or \"-1\" in the case of an error.",
+                        "summary": "Check whether the DICOM file has pixel data."
+                    },
+                    "return_sdk_type": "int32_t"
+                },
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginGetInstanceFramesCount",
+                    "const": true,
+                    "documentation": {
+                        "args": {},
+                        "description": [
+                            "This function returns the number of frames that are part of a DICOM image managed by the Orthanc core."
+                        ],
+                        "return": "The number of frames (will be zero in the case of an error).",
+                        "summary": "Get the number of frames in a DICOM instance."
+                    },
+                    "return_sdk_type": "uint32_t"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "frameIndex",
+                            "sdk_type": "uint32_t"
+                        }
+                    ],
+                    "c_function": "OrthancPluginGetInstanceRawFrame",
+                    "const": true,
+                    "documentation": {
+                        "args": {
+                            "frameIndex": "The index of the frame of interest.",
+                            "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer()."
+                        },
+                        "description": [
+                            "This function returns a memory buffer containing the raw content of a frame in a DICOM instance that is managed by the Orthanc core. This is notably useful for compressed transfer syntaxes, as it gives access to the embedded files (such as JPEG, JPEG-LS or JPEG2k). The Orthanc core transparently reassembles the fragments to extract the raw frame."
+                        ],
+                        "return": "0 if success, or the error code if failure.",
+                        "summary": "Get the raw content of a frame in a DICOM instance."
+                    },
+                    "return_sdk_type": "OrthancPluginMemoryBuffer *"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "frameIndex",
+                            "sdk_type": "uint32_t"
+                        }
+                    ],
+                    "c_function": "OrthancPluginGetInstanceDecodedFrame",
+                    "const": true,
+                    "documentation": {
+                        "args": {
+                            "frameIndex": "The index of the frame of interest."
+                        },
+                        "description": [
+                            "This function decodes one frame of a DICOM image that is managed by the Orthanc core."
+                        ],
+                        "return": "The uncompressed image. It must be freed with OrthancPluginFreeImage().",
+                        "summary": "Decode one frame from a DICOM instance."
+                    },
+                    "return_sdk_class": "OrthancPluginImage",
+                    "return_sdk_type": "object"
+                },
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginSerializeDicomInstance",
+                    "const": true,
+                    "documentation": {
+                        "args": {
+                            "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer()."
+                        },
+                        "description": [
+                            "This function returns a memory buffer containing the serialization of a DICOM instance that is managed by the Orthanc core."
+                        ],
+                        "return": "0 if success, or the error code if failure.",
+                        "summary": "Writes a DICOM instance to a memory buffer."
+                    },
+                    "return_sdk_type": "OrthancPluginMemoryBuffer *"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_enumeration": "OrthancPluginDicomToJsonFormat",
+                            "sdk_name": "format",
+                            "sdk_type": "enumeration"
+                        },
+                        {
+                            "name": "arg1",
+                            "sdk_enumeration": "OrthancPluginDicomToJsonFlags",
+                            "sdk_name": "flags",
+                            "sdk_type": "enumeration"
+                        },
+                        {
+                            "name": "arg2",
+                            "sdk_name": "maxStringLength",
+                            "sdk_type": "uint32_t"
+                        }
+                    ],
+                    "c_function": "OrthancPluginGetInstanceAdvancedJson",
+                    "const": true,
+                    "documentation": {
+                        "args": {
+                            "flags": "Flags governing the output.",
+                            "format": "The output format.",
+                            "maxStringLength": "The maximum length of a field. Too long fields will be output as \"null\". The 0 value means no maximum length."
+                        },
+                        "description": [
+                            "This function takes as DICOM instance managed by the Orthanc core, and outputs a JSON string representing the tags of this DICOM file."
+                        ],
+                        "return": "The NULL value if the case of an error, or the JSON string. This string must be freed by OrthancPluginFreeString().",
+                        "summary": "Format a DICOM memory buffer as a JSON string."
+                    },
+                    "return_sdk_type": "char *"
+                }
+            ],
+            "name": "OrthancPluginDicomInstance"
+        },
+        {
+            "methods": [],
+            "name": "OrthancPluginDicomWebNode"
+        },
+        {
+            "methods": [
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "dicom",
+                            "sdk_type": "const_void_pointer_with_size"
+                        }
+                    ],
+                    "c_function": "OrthancPluginFindAddAnswer",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "dicom": "The answer to be added, encoded as a DICOM file.",
+                            "size": "The size of the DICOM file."
+                        },
+                        "description": [
+                            "This function adds one answer (encoded as a DICOM file) to the set of answers corresponding to some C-Find SCP request that is not related to modality worklists."
+                        ],
+                        "return": "0 if success, other value if error.",
+                        "summary": "Add one answer to some C-Find request."
+                    },
+                    "return_sdk_enumeration": "OrthancPluginErrorCode",
+                    "return_sdk_type": "enumeration"
+                },
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginFindMarkIncomplete",
+                    "const": false,
+                    "documentation": {
+                        "args": {},
+                        "description": [
+                            "This function marks as incomplete the set of answers corresponding to some C-Find SCP request that is not related to modality worklists. This must be used if canceling the handling of a request when too many answers are to be returned."
+                        ],
+                        "return": "0 if success, other value if error.",
+                        "summary": "Mark the set of C-Find answers as incomplete."
+                    },
+                    "return_sdk_enumeration": "OrthancPluginErrorCode",
+                    "return_sdk_type": "enumeration"
+                }
+            ],
+            "name": "OrthancPluginFindAnswers"
+        },
+        {
+            "destructor": "OrthancPluginFreeFindMatcher",
+            "methods": [
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "dicom",
+                            "sdk_type": "const_void_pointer_with_size"
+                        }
+                    ],
+                    "c_function": "OrthancPluginFindMatcherIsMatch",
+                    "const": true,
+                    "documentation": {
+                        "args": {
+                            "dicom": "The DICOM instance to be matched.",
+                            "size": "The size of the DICOM instance."
+                        },
+                        "description": [
+                            "This function checks whether one DICOM instance matches C-Find matcher that was previously allocated using OrthancPluginCreateFindMatcher()."
+                        ],
+                        "return": "1 if the DICOM instance matches the query, 0 otherwise.",
+                        "summary": "Test whether a DICOM instance matches a C-Find query."
+                    },
+                    "return_sdk_type": "int32_t"
+                }
+            ],
+            "name": "OrthancPluginFindMatcher"
+        },
+        {
+            "methods": [
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginGetFindQuerySize",
+                    "const": true,
+                    "documentation": {
+                        "args": {},
+                        "description": [
+                            "This function returns the number of tags that are contained in the given C-Find query."
+                        ],
+                        "return": "The number of tags.",
+                        "summary": "Get the number of tags in a C-Find query."
+                    },
+                    "return_sdk_type": "uint32_t"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "index",
+                            "sdk_type": "uint32_t"
+                        }
+                    ],
+                    "c_function": "OrthancPluginGetFindQueryTagName",
+                    "const": true,
+                    "documentation": {
+                        "args": {
+                            "index": "The index of the tag of interest."
+                        },
+                        "description": [
+                            "This function returns the symbolic name of one DICOM tag in the given C-Find query."
+                        ],
+                        "return": "0 if success, other value if error.",
+                        "summary": "Get the symbolic name of one tag in a C-Find query."
+                    },
+                    "return_sdk_type": "char *"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "index",
+                            "sdk_type": "uint32_t"
+                        }
+                    ],
+                    "c_function": "OrthancPluginGetFindQueryValue",
+                    "const": true,
+                    "documentation": {
+                        "args": {
+                            "index": "The index of the tag of interest."
+                        },
+                        "description": [
+                            "This function returns the value associated with one tag in the given C-Find query."
+                        ],
+                        "return": "0 if success, other value if error.",
+                        "summary": "Get the value associated with one tag in a C-Find query."
+                    },
+                    "return_sdk_type": "char *"
+                }
+            ],
+            "name": "OrthancPluginFindQuery"
+        },
+        {
+            "destructor": "OrthancPluginFreeImage",
+            "methods": [
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginGetImagePixelFormat",
+                    "const": true,
+                    "documentation": {
+                        "args": {},
+                        "description": [
+                            "This function returns the type of memory layout for the pixels of the given image."
+                        ],
+                        "return": "The pixel format.",
+                        "summary": "Return the pixel format of an image."
+                    },
+                    "return_sdk_enumeration": "OrthancPluginPixelFormat",
+                    "return_sdk_type": "enumeration"
+                },
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginGetImageWidth",
+                    "const": true,
+                    "documentation": {
+                        "args": {},
+                        "description": [
+                            "This function returns the width of the given image."
+                        ],
+                        "return": "The width.",
+                        "summary": "Return the width of an image."
+                    },
+                    "return_sdk_type": "uint32_t"
+                },
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginGetImageHeight",
+                    "const": true,
+                    "documentation": {
+                        "args": {},
+                        "description": [
+                            "This function returns the height of the given image."
+                        ],
+                        "return": "The height.",
+                        "summary": "Return the height of an image."
+                    },
+                    "return_sdk_type": "uint32_t"
+                },
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginGetImagePitch",
+                    "const": true,
+                    "documentation": {
+                        "args": {},
+                        "description": [
+                            "This function returns the pitch of the given image. The pitch is defined as the number of bytes between 2 successive lines of the image in the memory buffer."
+                        ],
+                        "return": "The pitch.",
+                        "summary": "Return the pitch of an image."
+                    },
+                    "return_sdk_type": "uint32_t"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_enumeration": "OrthancPluginPixelFormat",
+                            "sdk_name": "targetFormat",
+                            "sdk_type": "enumeration"
+                        }
+                    ],
+                    "c_function": "OrthancPluginConvertPixelFormat",
+                    "const": true,
+                    "documentation": {
+                        "args": {
+                            "targetFormat": "The target pixel format."
+                        },
+                        "description": [
+                            "This function creates a new image, changing the memory layout of the pixels."
+                        ],
+                        "return": "The resulting image. It must be freed with OrthancPluginFreeImage().",
+                        "summary": "Change the pixel format of an image."
+                    },
+                    "return_sdk_class": "OrthancPluginImage",
+                    "return_sdk_type": "object"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "fontIndex",
+                            "sdk_type": "uint32_t"
+                        },
+                        {
+                            "name": "arg1",
+                            "sdk_name": "utf8Text",
+                            "sdk_type": "const char *"
+                        },
+                        {
+                            "name": "arg2",
+                            "sdk_name": "x",
+                            "sdk_type": "int32_t"
+                        },
+                        {
+                            "name": "arg3",
+                            "sdk_name": "y",
+                            "sdk_type": "int32_t"
+                        },
+                        {
+                            "name": "arg4",
+                            "sdk_name": "r",
+                            "sdk_type": "uint8_t"
+                        },
+                        {
+                            "name": "arg5",
+                            "sdk_name": "g",
+                            "sdk_type": "uint8_t"
+                        },
+                        {
+                            "name": "arg6",
+                            "sdk_name": "b",
+                            "sdk_type": "uint8_t"
+                        }
+                    ],
+                    "c_function": "OrthancPluginDrawText",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "b": "The value of the blue color channel of the text.",
+                            "fontIndex": "The index of the font. This value must be less than OrthancPluginGetFontsCount().",
+                            "g": "The value of the green color channel of the text.",
+                            "r": "The value of the red color channel of the text.",
+                            "utf8Text": "The text to be drawn, encoded as an UTF-8 zero-terminated string.",
+                            "x": "The X position of the text over the image.",
+                            "y": "The Y position of the text over the image."
+                        },
+                        "description": [
+                            "This function draws some text on some image."
+                        ],
+                        "return": "0 if success, other value if error.",
+                        "summary": "Draw text on an image."
+                    },
+                    "return_sdk_enumeration": "OrthancPluginErrorCode",
+                    "return_sdk_type": "enumeration"
+                }
+            ],
+            "name": "OrthancPluginImage"
+        },
+        {
+            "destructor": "OrthancPluginFreeJob",
+            "methods": [
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "priority",
+                            "sdk_type": "int32_t"
+                        }
+                    ],
+                    "c_function": "OrthancPluginSubmitJob",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "priority": "The priority of the job."
+                        },
+                        "description": [
+                            "This function adds the given job to the pending jobs of Orthanc. Orthanc will take take of freeing it by invoking the finalization callback provided to OrthancPluginCreateJob()."
+                        ],
+                        "return": "ID of the newly-submitted job. This string must be freed by OrthancPluginFreeString().",
+                        "summary": "Submit a new job to the jobs engine of Orthanc."
+                    },
+                    "return_sdk_type": "char *"
+                }
+            ],
+            "name": "OrthancPluginJob"
+        },
+        {
+            "destructor": "OrthancPluginFreePeers",
+            "methods": [
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginGetPeersCount",
+                    "const": true,
+                    "documentation": {
+                        "args": {},
+                        "description": [
+                            "This function returns the number of Orthanc peers.",
+                            "This function is thread-safe: Several threads sharing the same OrthancPluginPeers object can simultaneously call this function."
+                        ],
+                        "return": "The number of peers.",
+                        "summary": "Get the number of Orthanc peers."
+                    },
+                    "return_sdk_type": "uint32_t"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "peerIndex",
+                            "sdk_type": "uint32_t"
+                        }
+                    ],
+                    "c_function": "OrthancPluginGetPeerName",
+                    "const": true,
+                    "documentation": {
+                        "args": {
+                            "peerIndex": "The index of the peer of interest. This value must be lower than OrthancPluginGetPeersCount()."
+                        },
+                        "description": [
+                            "This function returns the symbolic name of the Orthanc peer, which corresponds to the key of the \"OrthancPeers\" configuration option of Orthanc.",
+                            "This function is thread-safe: Several threads sharing the same OrthancPluginPeers object can simultaneously call this function."
+                        ],
+                        "return": "The symbolic name, or NULL in the case of an error.",
+                        "summary": "Get the symbolic name of an Orthanc peer."
+                    },
+                    "return_sdk_type": "const char *"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "peerIndex",
+                            "sdk_type": "uint32_t"
+                        }
+                    ],
+                    "c_function": "OrthancPluginGetPeerUrl",
+                    "const": true,
+                    "documentation": {
+                        "args": {
+                            "peerIndex": "The index of the peer of interest. This value must be lower than OrthancPluginGetPeersCount()."
+                        },
+                        "description": [
+                            "This function returns the base URL to the REST API of some Orthanc peer.",
+                            "This function is thread-safe: Several threads sharing the same OrthancPluginPeers object can simultaneously call this function."
+                        ],
+                        "return": "The URL, or NULL in the case of an error.",
+                        "summary": "Get the base URL of an Orthanc peer."
+                    },
+                    "return_sdk_type": "const char *"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "peerIndex",
+                            "sdk_type": "uint32_t"
+                        },
+                        {
+                            "name": "arg1",
+                            "sdk_name": "userProperty",
+                            "sdk_type": "const char *"
+                        }
+                    ],
+                    "c_function": "OrthancPluginGetPeerUserProperty",
+                    "const": true,
+                    "documentation": {
+                        "args": {
+                            "peerIndex": "The index of the peer of interest. This value must be lower than OrthancPluginGetPeersCount().",
+                            "userProperty": "The user property of interest."
+                        },
+                        "description": [
+                            "This function returns some user-defined property of some Orthanc peer. An user-defined property is a property that is associated with the peer in the Orthanc configuration file, but that is not recognized by the Orthanc core.",
+                            "This function is thread-safe: Several threads sharing the same OrthancPluginPeers object can simultaneously call this function."
+                        ],
+                        "return": "The value of the user property, or NULL if it is not defined.",
+                        "summary": "Get some user-defined property of an Orthanc peer."
+                    },
+                    "return_sdk_type": "const char *"
+                }
+            ],
+            "name": "OrthancPluginPeers"
+        },
+        {
+            "methods": [
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "answer",
+                            "sdk_type": "const_void_pointer_with_size"
+                        },
+                        {
+                            "name": "arg2",
+                            "sdk_name": "mimeType",
+                            "sdk_type": "const char *"
+                        }
+                    ],
+                    "c_function": "OrthancPluginAnswerBuffer",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "answer": "Pointer to the memory buffer containing the answer.",
+                            "answerSize": "Number of bytes of the answer.",
+                            "mimeType": "The MIME type of the answer."
+                        },
+                        "description": [
+                            "This function answers to a REST request with the content of a memory buffer."
+                        ],
+                        "summary": "Answer to a REST request."
+                    },
+                    "return_sdk_type": "void"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_enumeration": "OrthancPluginPixelFormat",
+                            "sdk_name": "format",
+                            "sdk_type": "enumeration"
+                        },
+                        {
+                            "name": "arg1",
+                            "sdk_name": "width",
+                            "sdk_type": "uint32_t"
+                        },
+                        {
+                            "name": "arg2",
+                            "sdk_name": "height",
+                            "sdk_type": "uint32_t"
+                        },
+                        {
+                            "name": "arg3",
+                            "sdk_name": "pitch",
+                            "sdk_type": "uint32_t"
+                        },
+                        {
+                            "name": "arg4",
+                            "sdk_name": "buffer",
+                            "sdk_type": "const void *"
+                        }
+                    ],
+                    "c_function": "OrthancPluginCompressAndAnswerPngImage",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "buffer": "The memory buffer containing the uncompressed image.",
+                            "format": "The memory layout of the uncompressed image.",
+                            "height": "The height of the image.",
+                            "pitch": "The pitch of the image (i.e. the number of bytes between 2 successive lines of the image in the memory buffer).",
+                            "width": "The width of the image."
+                        },
+                        "description": [
+                            "This function answers to a REST request with a PNG image. The parameters of this function describe a memory buffer that contains an uncompressed image. The image will be automatically compressed as a PNG image by the core system of Orthanc."
+                        ],
+                        "summary": "Answer to a REST request with a PNG image."
+                    },
+                    "return_sdk_type": "void"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "redirection",
+                            "sdk_type": "const char *"
+                        }
+                    ],
+                    "c_function": "OrthancPluginRedirect",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "redirection": "Where to redirect."
+                        },
+                        "description": [
+                            "This function answers to a REST request by redirecting the user to another URI using HTTP status 301."
+                        ],
+                        "summary": "Redirect a REST request."
+                    },
+                    "return_sdk_type": "void"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "status",
+                            "sdk_type": "uint16_t"
+                        }
+                    ],
+                    "c_function": "OrthancPluginSendHttpStatusCode",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "status": "The HTTP status code to be sent."
+                        },
+                        "description": [
+                            "This function answers to a REST request by sending a HTTP status code (such as \"400 - Bad Request\"). Note that: - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer(). - Redirections (status 301) must use ::OrthancPluginRedirect(). - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized(). - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed()."
+                        ],
+                        "summary": "Send a HTTP status code."
+                    },
+                    "return_sdk_type": "void"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "realm",
+                            "sdk_type": "const char *"
+                        }
+                    ],
+                    "c_function": "OrthancPluginSendUnauthorized",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "realm": "The realm for the authorization process."
+                        },
+                        "description": [
+                            "This function answers to a REST request by signaling that it is not authorized."
+                        ],
+                        "summary": "Signal that a REST request is not authorized."
+                    },
+                    "return_sdk_type": "void"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "allowedMethods",
+                            "sdk_type": "const char *"
+                        }
+                    ],
+                    "c_function": "OrthancPluginSendMethodNotAllowed",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "allowedMethods": "The allowed methods for this URI (e.g. \"GET,POST\" after a PUT or a POST request)."
+                        },
+                        "description": [
+                            "This function answers to a REST request by signaling that the queried URI does not support this method."
+                        ],
+                        "summary": "Signal that this URI does not support this HTTP method."
+                    },
+                    "return_sdk_type": "void"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "cookie",
+                            "sdk_type": "const char *"
+                        },
+                        {
+                            "name": "arg1",
+                            "sdk_name": "value",
+                            "sdk_type": "const char *"
+                        }
+                    ],
+                    "c_function": "OrthancPluginSetCookie",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "cookie": "The cookie to be set.",
+                            "value": "The value of the cookie."
+                        },
+                        "description": [
+                            "This function sets a cookie in the HTTP client."
+                        ],
+                        "summary": "Set a cookie."
+                    },
+                    "return_sdk_type": "void"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "key",
+                            "sdk_type": "const char *"
+                        },
+                        {
+                            "name": "arg1",
+                            "sdk_name": "value",
+                            "sdk_type": "const char *"
+                        }
+                    ],
+                    "c_function": "OrthancPluginSetHttpHeader",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "key": "The HTTP header to be set.",
+                            "value": "The value of the HTTP header."
+                        },
+                        "description": [
+                            "This function sets a HTTP header in the HTTP answer."
+                        ],
+                        "summary": "Set some HTTP header."
+                    },
+                    "return_sdk_type": "void"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "subType",
+                            "sdk_type": "const char *"
+                        },
+                        {
+                            "name": "arg1",
+                            "sdk_name": "contentType",
+                            "sdk_type": "const char *"
+                        }
+                    ],
+                    "c_function": "OrthancPluginStartMultipartAnswer",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "contentType": "The MIME type of the items in the multipart answer.",
+                            "subType": "The sub-type of the multipart answer (\"mixed\" or \"related\")."
+                        },
+                        "description": [
+                            "Initiates a HTTP multipart answer, as the result of a REST request."
+                        ],
+                        "return": "0 if success, or the error code if failure.",
+                        "summary": "Start an HTTP multipart answer."
+                    },
+                    "return_sdk_enumeration": "OrthancPluginErrorCode",
+                    "return_sdk_type": "enumeration"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "answer",
+                            "sdk_type": "const_void_pointer_with_size"
+                        }
+                    ],
+                    "c_function": "OrthancPluginSendMultipartItem",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "answer": "Pointer to the memory buffer containing the item.",
+                            "answerSize": "Number of bytes of the item."
+                        },
+                        "description": [
+                            "This function sends an item as a part of some HTTP multipart answer that was initiated by OrthancPluginStartMultipartAnswer()."
+                        ],
+                        "return": "0 if success, or the error code if failure (this notably happens if the connection is closed by the client).",
+                        "summary": "Send an item as a part of some HTTP multipart answer."
+                    },
+                    "return_sdk_enumeration": "OrthancPluginErrorCode",
+                    "return_sdk_type": "enumeration"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "status",
+                            "sdk_type": "uint16_t"
+                        },
+                        {
+                            "name": "arg1",
+                            "sdk_name": "body",
+                            "sdk_type": "const_void_pointer_with_size"
+                        }
+                    ],
+                    "c_function": "OrthancPluginSendHttpStatus",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "body": "The body of the answer.",
+                            "bodySize": "The size of the body.",
+                            "status": "The HTTP status code to be sent."
+                        },
+                        "description": [
+                            "This function answers to a HTTP request by sending a HTTP status code (such as \"400 - Bad Request\"), together with a body describing the error. The body will only be returned if the configuration option \"HttpDescribeErrors\" of Orthanc is set to \"true\".",
+                            "Note that: - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer(). - Redirections (status 301) must use ::OrthancPluginRedirect(). - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized(). - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed()."
+                        ],
+                        "summary": "Send a HTTP status, with a custom body."
+                    },
+                    "return_sdk_type": "void"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_enumeration": "OrthancPluginPixelFormat",
+                            "sdk_name": "format",
+                            "sdk_type": "enumeration"
+                        },
+                        {
+                            "name": "arg1",
+                            "sdk_name": "width",
+                            "sdk_type": "uint32_t"
+                        },
+                        {
+                            "name": "arg2",
+                            "sdk_name": "height",
+                            "sdk_type": "uint32_t"
+                        },
+                        {
+                            "name": "arg3",
+                            "sdk_name": "pitch",
+                            "sdk_type": "uint32_t"
+                        },
+                        {
+                            "name": "arg4",
+                            "sdk_name": "buffer",
+                            "sdk_type": "const void *"
+                        },
+                        {
+                            "name": "arg5",
+                            "sdk_name": "quality",
+                            "sdk_type": "uint8_t"
+                        }
+                    ],
+                    "c_function": "OrthancPluginCompressAndAnswerJpegImage",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "buffer": "The memory buffer containing the uncompressed image.",
+                            "format": "The memory layout of the uncompressed image.",
+                            "height": "The height of the image.",
+                            "pitch": "The pitch of the image (i.e. the number of bytes between 2 successive lines of the image in the memory buffer).",
+                            "quality": "The quality of the JPEG encoding, between 1 (worst quality, best compression) and 100 (best quality, worst compression).",
+                            "width": "The width of the image."
+                        },
+                        "description": [
+                            "This function answers to a REST request with a JPEG image. The parameters of this function describe a memory buffer that contains an uncompressed image. The image will be automatically compressed as a JPEG image by the core system of Orthanc."
+                        ],
+                        "summary": "Answer to a REST request with a JPEG image."
+                    },
+                    "return_sdk_type": "void"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "details",
+                            "sdk_type": "const char *"
+                        },
+                        {
+                            "name": "arg1",
+                            "sdk_name": "log",
+                            "sdk_type": "uint8_t"
+                        }
+                    ],
+                    "c_function": "OrthancPluginSetHttpErrorDetails",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "details": "The details of the error message.",
+                            "log": "Whether to also write the detailed error to the Orthanc logs."
+                        },
+                        "description": [
+                            "This function sets the detailed description associated with an HTTP error. This description will be displayed in the \"Details\" field of the JSON body of the HTTP answer. It is only taken into consideration if the REST callback returns an error code that is different from \"OrthancPluginErrorCode_Success\", and if the \"HttpDescribeErrors\" configuration option of Orthanc is set to \"true\"."
+                        ],
+                        "summary": "Provide a detailed description for an HTTP error."
+                    },
+                    "return_sdk_type": "void"
+                }
+            ],
+            "name": "OrthancPluginRestOutput"
+        },
+        {
+            "methods": [],
+            "name": "OrthancPluginServerChunkedRequestReader"
+        },
+        {
+            "methods": [
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "uuid",
+                            "sdk_type": "const char *"
+                        },
+                        {
+                            "name": "arg1",
+                            "sdk_name": "content",
+                            "sdk_type": "const void *"
+                        },
+                        {
+                            "name": "arg2",
+                            "sdk_name": "size",
+                            "sdk_type": "uint64_t"
+                        },
+                        {
+                            "name": "arg3",
+                            "sdk_enumeration": "OrthancPluginContentType",
+                            "sdk_name": "type",
+                            "sdk_type": "enumeration"
+                        }
+                    ],
+                    "c_function": "OrthancPluginStorageAreaCreate",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "content": "The content to store in the newly created file.",
+                            "size": "The size of the content.",
+                            "type": "The type of the file content.",
+                            "uuid": "The identifier of the file to be created."
+                        },
+                        "description": [
+                            "This function creates a new file inside the storage area that is currently used by Orthanc."
+                        ],
+                        "return": "0 if success, other value if error.",
+                        "summary": "Create a file inside the storage area."
+                    },
+                    "return_sdk_enumeration": "OrthancPluginErrorCode",
+                    "return_sdk_type": "enumeration"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "uuid",
+                            "sdk_type": "const char *"
+                        },
+                        {
+                            "name": "arg1",
+                            "sdk_enumeration": "OrthancPluginContentType",
+                            "sdk_name": "type",
+                            "sdk_type": "enumeration"
+                        }
+                    ],
+                    "c_function": "OrthancPluginStorageAreaRead",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().",
+                            "type": "The type of the file content.",
+                            "uuid": "The identifier of the file to be read."
+                        },
+                        "description": [
+                            "This function reads the content of a given file from the storage area that is currently used by Orthanc."
+                        ],
+                        "return": "0 if success, other value if error.",
+                        "summary": "Read a file from the storage area."
+                    },
+                    "return_sdk_type": "OrthancPluginMemoryBuffer *"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "uuid",
+                            "sdk_type": "const char *"
+                        },
+                        {
+                            "name": "arg1",
+                            "sdk_enumeration": "OrthancPluginContentType",
+                            "sdk_name": "type",
+                            "sdk_type": "enumeration"
+                        }
+                    ],
+                    "c_function": "OrthancPluginStorageAreaRemove",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "type": "The type of the file content.",
+                            "uuid": "The identifier of the file to be removed."
+                        },
+                        "description": [
+                            "This function removes a given file from the storage area that is currently used by Orthanc."
+                        ],
+                        "return": "0 if success, other value if error.",
+                        "summary": "Remove a file from the storage area."
+                    },
+                    "return_sdk_enumeration": "OrthancPluginErrorCode",
+                    "return_sdk_type": "enumeration"
+                },
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_enumeration": "OrthancPluginResourceType",
+                            "sdk_name": "level",
+                            "sdk_type": "enumeration"
+                        }
+                    ],
+                    "c_function": "OrthancPluginReconstructMainDicomTags",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "level": "The type of the resources of interest."
+                        },
+                        "description": [
+                            "This function requests the Orthanc core to reconstruct the main DICOM tags of all the resources of the given type. This function can only be used as a part of the upgrade of a custom database back-end. A database transaction will be automatically setup."
+                        ],
+                        "return": "0 if success, other value if error.",
+                        "summary": "Reconstruct the main DICOM tags."
+                    },
+                    "return_sdk_enumeration": "OrthancPluginErrorCode",
+                    "return_sdk_type": "enumeration"
+                }
+            ],
+            "name": "OrthancPluginStorageArea"
+        },
+        {
+            "methods": [
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_class": "OrthancPluginWorklistQuery",
+                            "sdk_name": "query",
+                            "sdk_type": "const_object"
+                        },
+                        {
+                            "name": "arg1",
+                            "sdk_name": "dicom",
+                            "sdk_type": "const_void_pointer_with_size"
+                        }
+                    ],
+                    "c_function": "OrthancPluginWorklistAddAnswer",
+                    "const": false,
+                    "documentation": {
+                        "args": {
+                            "dicom": "The worklist to answer, encoded as a DICOM file.",
+                            "query": "The worklist query, as received by the callback.",
+                            "size": "The size of the DICOM file."
+                        },
+                        "description": [
+                            "This function adds one worklist (encoded as a DICOM file) to the set of answers corresponding to some C-Find SCP request against modality worklists."
+                        ],
+                        "return": "0 if success, other value if error.",
+                        "summary": "Add one answer to some modality worklist request."
+                    },
+                    "return_sdk_enumeration": "OrthancPluginErrorCode",
+                    "return_sdk_type": "enumeration"
+                },
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginWorklistMarkIncomplete",
+                    "const": false,
+                    "documentation": {
+                        "args": {},
+                        "description": [
+                            "This function marks as incomplete the set of answers corresponding to some C-Find SCP request against modality worklists. This must be used if canceling the handling of a request when too many answers are to be returned."
+                        ],
+                        "return": "0 if success, other value if error.",
+                        "summary": "Mark the set of worklist answers as incomplete."
+                    },
+                    "return_sdk_enumeration": "OrthancPluginErrorCode",
+                    "return_sdk_type": "enumeration"
+                }
+            ],
+            "name": "OrthancPluginWorklistAnswers"
+        },
+        {
+            "methods": [
+                {
+                    "args": [
+                        {
+                            "name": "arg0",
+                            "sdk_name": "dicom",
+                            "sdk_type": "const_void_pointer_with_size"
+                        }
+                    ],
+                    "c_function": "OrthancPluginWorklistIsMatch",
+                    "const": true,
+                    "documentation": {
+                        "args": {
+                            "dicom": "The worklist to answer, encoded as a DICOM file.",
+                            "size": "The size of the DICOM file."
+                        },
+                        "description": [
+                            "This function checks whether one worklist (encoded as a DICOM file) matches the C-Find SCP query against modality worklists. This function must be called before adding the worklist as an answer through OrthancPluginWorklistAddAnswer()."
+                        ],
+                        "return": "1 if the worklist matches the query, 0 otherwise.",
+                        "summary": "Test whether a worklist matches the query."
+                    },
+                    "return_sdk_type": "int32_t"
+                },
+                {
+                    "args": [],
+                    "c_function": "OrthancPluginWorklistGetDicomQuery",
+                    "const": true,
+                    "documentation": {
+                        "args": {
+                            "target": "Memory buffer where to store the DICOM file. It must be freed with OrthancPluginFreeMemoryBuffer()."
+                        },
+                        "description": [
+                            "This function retrieves the DICOM file that underlies a C-Find SCP query against modality worklists."
+                        ],
+                        "return": "0 if success, other value if error.",
+                        "summary": "Retrieve the worklist query as a DICOM file."
+                    },
+                    "return_sdk_type": "OrthancPluginMemoryBuffer *"
+                }
+            ],
+            "name": "OrthancPluginWorklistQuery"
+        }
+    ],
+    "enumerations": [
+        {
+            "documentation": "The supported types of changes that can be signaled to the change callback.",
+            "name": "OrthancPluginChangeType",
+            "values": [
+                {
+                    "documentation": "Series is now complete",
+                    "key": "CompletedSeries",
+                    "value": 0
+                },
+                {
+                    "documentation": "Deleted resource",
+                    "key": "Deleted",
+                    "value": 1
+                },
+                {
+                    "documentation": "A new instance was added to this resource",
+                    "key": "NewChildInstance",
+                    "value": 2
+                },
+                {
+                    "documentation": "New instance received",
+                    "key": "NewInstance",
+                    "value": 3
+                },
+                {
+                    "documentation": "New patient created",
+                    "key": "NewPatient",
+                    "value": 4
+                },
+                {
+                    "documentation": "New series created",
+                    "key": "NewSeries",
+                    "value": 5
+                },
+                {
+                    "documentation": "New study created",
+                    "key": "NewStudy",
+                    "value": 6
+                },
+                {
+                    "documentation": "Timeout: No new instance in this patient",
+                    "key": "StablePatient",
+                    "value": 7
+                },
+                {
+                    "documentation": "Timeout: No new instance in this series",
+                    "key": "StableSeries",
+                    "value": 8
+                },
+                {
+                    "documentation": "Timeout: No new instance in this study",
+                    "key": "StableStudy",
+                    "value": 9
+                },
+                {
+                    "documentation": "Orthanc has started",
+                    "key": "OrthancStarted",
+                    "value": 10
+                },
+                {
+                    "documentation": "Orthanc is stopping",
+                    "key": "OrthancStopped",
+                    "value": 11
+                },
+                {
+                    "documentation": "Some user-defined attachment has changed for this resource",
+                    "key": "UpdatedAttachment",
+                    "value": 12
+                },
+                {
+                    "documentation": "Some user-defined metadata has changed for this resource",
+                    "key": "UpdatedMetadata",
+                    "value": 13
+                },
+                {
+                    "documentation": "The list of Orthanc peers has changed",
+                    "key": "UpdatedPeers",
+                    "value": 14
+                },
+                {
+                    "documentation": "The list of DICOM modalities has changed",
+                    "key": "UpdatedModalities",
+                    "value": 15
+                },
+                {
+                    "documentation": "New Job submitted",
+                    "key": "JobSubmitted",
+                    "value": 16
+                },
+                {
+                    "documentation": "A Job has completed successfully",
+                    "key": "JobSuccess",
+                    "value": 17
+                },
+                {
+                    "documentation": "A Job has failed",
+                    "key": "JobFailure",
+                    "value": 18
+                }
+            ]
+        },
+        {
+            "documentation": "The compression algorithms that are supported by the Orthanc core.",
+            "name": "OrthancPluginCompressionType",
+            "values": [
+                {
+                    "documentation": "Standard zlib compression",
+                    "key": "Zlib",
+                    "value": 0
+                },
+                {
+                    "documentation": "zlib, prefixed with uncompressed size (uint64_t)",
+                    "key": "ZlibWithSize",
+                    "value": 1
+                },
+                {
+                    "documentation": "Standard gzip compression",
+                    "key": "Gzip",
+                    "value": 2
+                },
+                {
+                    "documentation": "gzip, prefixed with uncompressed size (uint64_t)",
+                    "key": "GzipWithSize",
+                    "value": 3
+                }
+            ]
+        },
+        {
+            "documentation": "The constraints on the tags (main DICOM tags and identifier tags) that must be supported by the database plugins.",
+            "name": "OrthancPluginConstraintType",
+            "values": [
+                {
+                    "documentation": "Equal",
+                    "key": "Equal",
+                    "value": 1
+                },
+                {
+                    "documentation": "Less or equal",
+                    "key": "SmallerOrEqual",
+                    "value": 2
+                },
+                {
+                    "documentation": "More or equal",
+                    "key": "GreaterOrEqual",
+                    "value": 3
+                },
+                {
+                    "documentation": "Wildcard matching",
+                    "key": "Wildcard",
+                    "value": 4
+                },
+                {
+                    "documentation": "List of values",
+                    "key": "List",
+                    "value": 5
+                }
+            ]
+        },
+        {
+            "documentation": "The content types that are supported by Orthanc plugins.",
+            "name": "OrthancPluginContentType",
+            "values": [
+                {
+                    "documentation": "Unknown content type",
+                    "key": "Unknown",
+                    "value": 0
+                },
+                {
+                    "documentation": "DICOM",
+                    "key": "Dicom",
+                    "value": 1
+                },
+                {
+                    "documentation": "JSON summary of a DICOM file",
+                    "key": "DicomAsJson",
+                    "value": 2
+                },
+                {
+                    "documentation": "DICOM Header till pixel data",
+                    "key": "DicomUntilPixelData",
+                    "value": 3
+                }
+            ]
+        },
+        {
+            "documentation": "Flags to the creation of a DICOM file.",
+            "name": "OrthancPluginCreateDicomFlags",
+            "values": [
+                {
+                    "documentation": "Default mode",
+                    "key": "None",
+                    "value": 0
+                },
+                {
+                    "documentation": "Decode fields encoded using data URI scheme",
+                    "key": "DecodeDataUriScheme",
+                    "value": 1
+                },
+                {
+                    "documentation": "Automatically generate DICOM identifiers",
+                    "key": "GenerateIdentifiers",
+                    "value": 2
+                }
+            ]
+        },
+        {
+            "documentation": "Flags to customize a DICOM-to-JSON conversion. By default, binary tags are formatted using Data URI scheme.",
+            "name": "OrthancPluginDicomToJsonFlags",
+            "values": [
+                {
+                    "documentation": "Default formatting",
+                    "key": "None",
+                    "value": 0
+                },
+                {
+                    "documentation": "Include the binary tags",
+                    "key": "IncludeBinary",
+                    "value": 1
+                },
+                {
+                    "documentation": "Include the private tags",
+                    "key": "IncludePrivateTags",
+                    "value": 2
+                },
+                {
+                    "documentation": "Include the tags unknown by the dictionary",
+                    "key": "IncludeUnknownTags",
+                    "value": 4
+                },
+                {
+                    "documentation": "Include the pixel data",
+                    "key": "IncludePixelData",
+                    "value": 8
+                },
+                {
+                    "documentation": "Output binary tags as-is, dropping non-ASCII",
+                    "key": "ConvertBinaryToAscii",
+                    "value": 16
+                },
+                {
+                    "documentation": "Signal binary tags as null values",
+                    "key": "ConvertBinaryToNull",
+                    "value": 32
+                },
+                {
+                    "documentation": "Stop processing after pixel data (new in 1.9.1)",
+                    "key": "StopAfterPixelData",
+                    "value": 64
+                },
+                {
+                    "documentation": "Skip tags whose element is zero (new in 1.9.1)",
+                    "key": "SkipGroupLengths",
+                    "value": 128
+                }
+            ]
+        },
+        {
+            "documentation": "The possible output formats for a DICOM-to-JSON conversion.",
+            "name": "OrthancPluginDicomToJsonFormat",
+            "values": [
+                {
+                    "documentation": "Full output, with most details",
+                    "key": "Full",
+                    "value": 1
+                },
+                {
+                    "documentation": "Tags output as hexadecimal numbers",
+                    "key": "Short",
+                    "value": 2
+                },
+                {
+                    "documentation": "Human-readable JSON",
+                    "key": "Human",
+                    "value": 3
+                }
+            ]
+        },
+        {
+            "documentation": "The available modes to export a binary DICOM tag into a DICOMweb JSON or XML document.",
+            "name": "OrthancPluginDicomWebBinaryMode",
+            "values": [
+                {
+                    "documentation": "Don't include binary tags",
+                    "key": "Ignore",
+                    "value": 0
+                },
+                {
+                    "documentation": "Inline encoding using Base64",
+                    "key": "InlineBinary",
+                    "value": 1
+                },
+                {
+                    "documentation": "Use a bulk data URI field",
+                    "key": "BulkDataUri",
+                    "value": 2
+                }
+            ]
+        },
+        {
+            "documentation": "The various error codes that can be returned by the Orthanc core.",
+            "name": "OrthancPluginErrorCode",
+            "values": [
+                {
+                    "documentation": "Internal error",
+                    "key": "InternalError",
+                    "value": -1
+                },
+                {
+                    "documentation": "Success",
+                    "key": "Success",
+                    "value": 0
+                },
+                {
+                    "documentation": "Error encountered within the plugin engine",
+                    "key": "Plugin",
+                    "value": 1
+                },
+                {
+                    "documentation": "Not implemented yet",
+                    "key": "NotImplemented",
+                    "value": 2
+                },
+                {
+                    "documentation": "Parameter out of range",
+                    "key": "ParameterOutOfRange",
+                    "value": 3
+                },
+                {
+                    "documentation": "The server hosting Orthanc is running out of memory",
+                    "key": "NotEnoughMemory",
+                    "value": 4
+                },
+                {
+                    "documentation": "Bad type for a parameter",
+                    "key": "BadParameterType",
+                    "value": 5
+                },
+                {
+                    "documentation": "Bad sequence of calls",
+                    "key": "BadSequenceOfCalls",
+                    "value": 6
+                },
+                {
+                    "documentation": "Accessing an inexistent item",
+                    "key": "InexistentItem",
+                    "value": 7
+                },
+                {
+                    "documentation": "Bad request",
+                    "key": "BadRequest",
+                    "value": 8
+                },
+                {
+                    "documentation": "Error in the network protocol",
+                    "key": "NetworkProtocol",
+                    "value": 9
+                },
+                {
+                    "documentation": "Error while calling a system command",
+                    "key": "SystemCommand",
+                    "value": 10
+                },
+                {
+                    "documentation": "Error with the database engine",
+                    "key": "Database",
+                    "value": 11
+                },
+                {
+                    "documentation": "Badly formatted URI",
+                    "key": "UriSyntax",
+                    "value": 12
+                },
+                {
+                    "documentation": "Inexistent file",
+                    "key": "InexistentFile",
+                    "value": 13
+                },
+                {
+                    "documentation": "Cannot write to file",
+                    "key": "CannotWriteFile",
+                    "value": 14
+                },
+                {
+                    "documentation": "Bad file format",
+                    "key": "BadFileFormat",
+                    "value": 15
+                },
+                {
+                    "documentation": "Timeout",
+                    "key": "Timeout",
+                    "value": 16
+                },
+                {
+                    "documentation": "Unknown resource",
+                    "key": "UnknownResource",
+                    "value": 17
+                },
+                {
+                    "documentation": "Incompatible version of the database",
+                    "key": "IncompatibleDatabaseVersion",
+                    "value": 18
+                },
+                {
+                    "documentation": "The file storage is full",
+                    "key": "FullStorage",
+                    "value": 19
+                },
+                {
+                    "documentation": "Corrupted file (e.g. inconsistent MD5 hash)",
+                    "key": "CorruptedFile",
+                    "value": 20
+                },
+                {
+                    "documentation": "Inexistent tag",
+                    "key": "InexistentTag",
+                    "value": 21
+                },
+                {
+                    "documentation": "Cannot modify a read-only data structure",
+                    "key": "ReadOnly",
+                    "value": 22
+                },
+                {
+                    "documentation": "Incompatible format of the images",
+                    "key": "IncompatibleImageFormat",
+                    "value": 23
+                },
+                {
+                    "documentation": "Incompatible size of the images",
+                    "key": "IncompatibleImageSize",
+                    "value": 24
+                },
+                {
+                    "documentation": "Error while using a shared library (plugin)",
+                    "key": "SharedLibrary",
+                    "value": 25
+                },
+                {
+                    "documentation": "Plugin invoking an unknown service",
+                    "key": "UnknownPluginService",
+                    "value": 26
+                },
+                {
+                    "documentation": "Unknown DICOM tag",
+                    "key": "UnknownDicomTag",
+                    "value": 27
+                },
+                {
+                    "documentation": "Cannot parse a JSON document",
+                    "key": "BadJson",
+                    "value": 28
+                },
+                {
+                    "documentation": "Bad credentials were provided to an HTTP request",
+                    "key": "Unauthorized",
+                    "value": 29
+                },
+                {
+                    "documentation": "Badly formatted font file",
+                    "key": "BadFont",
+                    "value": 30
+                },
+                {
+                    "documentation": "The plugin implementing a custom database back-end does not fulfill the proper interface",
+                    "key": "DatabasePlugin",
+                    "value": 31
+                },
+                {
+                    "documentation": "Error in the plugin implementing a custom storage area",
+                    "key": "StorageAreaPlugin",
+                    "value": 32
+                },
+                {
+                    "documentation": "The request is empty",
+                    "key": "EmptyRequest",
+                    "value": 33
+                },
+                {
+                    "documentation": "Cannot send a response which is acceptable according to the Accept HTTP header",
+                    "key": "NotAcceptable",
+                    "value": 34
+                },
+                {
+                    "documentation": "Cannot handle a NULL pointer",
+                    "key": "NullPointer",
+                    "value": 35
+                },
+                {
+                    "documentation": "The database is currently not available (probably a transient situation)",
+                    "key": "DatabaseUnavailable",
+                    "value": 36
+                },
+                {
+                    "documentation": "This job was canceled",
+                    "key": "CanceledJob",
+                    "value": 37
+                },
+                {
+                    "documentation": "Geometry error encountered in Stone",
+                    "key": "BadGeometry",
+                    "value": 38
+                },
+                {
+                    "documentation": "Cannot initialize SSL encryption, check out your certificates",
+                    "key": "SslInitialization",
+                    "value": 39
+                },
+                {
+                    "documentation": "Calling a function that has been removed from the Orthanc Framework",
+                    "key": "DiscontinuedAbi",
+                    "value": 40
+                },
+                {
+                    "documentation": "Incorrect range request",
+                    "key": "BadRange",
+                    "value": 41
+                },
+                {
+                    "documentation": "Database could not serialize access due to concurrent update, the transaction should be retried",
+                    "key": "DatabaseCannotSerialize",
+                    "value": 42
+                },
+                {
+                    "documentation": "A bad revision number was provided, which might indicate conflict between multiple writers",
+                    "key": "Revision",
+                    "value": 43
+                },
+                {
+                    "documentation": "SQLite: The database is not opened",
+                    "key": "SQLiteNotOpened",
+                    "value": 1000
+                },
+                {
+                    "documentation": "SQLite: Connection is already open",
+                    "key": "SQLiteAlreadyOpened",
+                    "value": 1001
+                },
+                {
+                    "documentation": "SQLite: Unable to open the database",
+                    "key": "SQLiteCannotOpen",
+                    "value": 1002
+                },
+                {
+                    "documentation": "SQLite: This cached statement is already being referred to",
+                    "key": "SQLiteStatementAlreadyUsed",
+                    "value": 1003
+                },
+                {
+                    "documentation": "SQLite: Cannot execute a command",
+                    "key": "SQLiteExecute",
+                    "value": 1004
+                },
+                {
+                    "documentation": "SQLite: Rolling back a nonexistent transaction (have you called Begin()?)",
+                    "key": "SQLiteRollbackWithoutTransaction",
+                    "value": 1005
+                },
+                {
+                    "documentation": "SQLite: Committing a nonexistent transaction",
+                    "key": "SQLiteCommitWithoutTransaction",
+                    "value": 1006
+                },
+                {
+                    "documentation": "SQLite: Unable to register a function",
+                    "key": "SQLiteRegisterFunction",
+                    "value": 1007
+                },
+                {
+                    "documentation": "SQLite: Unable to flush the database",
+                    "key": "SQLiteFlush",
+                    "value": 1008
+                },
+                {
+                    "documentation": "SQLite: Cannot run a cached statement",
+                    "key": "SQLiteCannotRun",
+                    "value": 1009
+                },
+                {
+                    "documentation": "SQLite: Cannot step over a cached statement",
+                    "key": "SQLiteCannotStep",
+                    "value": 1010
+                },
+                {
+                    "documentation": "SQLite: Bing a value while out of range (serious error)",
+                    "key": "SQLiteBindOutOfRange",
+                    "value": 1011
+                },
+                {
+                    "documentation": "SQLite: Cannot prepare a cached statement",
+                    "key": "SQLitePrepareStatement",
+                    "value": 1012
+                },
+                {
+                    "documentation": "SQLite: Beginning the same transaction twice",
+                    "key": "SQLiteTransactionAlreadyStarted",
+                    "value": 1013
+                },
+                {
+                    "documentation": "SQLite: Failure when committing the transaction",
+                    "key": "SQLiteTransactionCommit",
+                    "value": 1014
+                },
+                {
+                    "documentation": "SQLite: Cannot start a transaction",
+                    "key": "SQLiteTransactionBegin",
+                    "value": 1015
+                },
+                {
+                    "documentation": "The directory to be created is already occupied by a regular file",
+                    "key": "DirectoryOverFile",
+                    "value": 2000
+                },
+                {
+                    "documentation": "Unable to create a subdirectory or a file in the file storage",
+                    "key": "FileStorageCannotWrite",
+                    "value": 2001
+                },
+                {
+                    "documentation": "The specified path does not point to a directory",
+                    "key": "DirectoryExpected",
+                    "value": 2002
+                },
+                {
+                    "documentation": "The TCP port of the HTTP server is privileged or already in use",
+                    "key": "HttpPortInUse",
+                    "value": 2003
+                },
+                {
+                    "documentation": "The TCP port of the DICOM server is privileged or already in use",
+                    "key": "DicomPortInUse",
+                    "value": 2004
+                },
+                {
+                    "documentation": "This HTTP status is not allowed in a REST API",
+                    "key": "BadHttpStatusInRest",
+                    "value": 2005
+                },
+                {
+                    "documentation": "The specified path does not point to a regular file",
+                    "key": "RegularFileExpected",
+                    "value": 2006
+                },
+                {
+                    "documentation": "Unable to get the path to the executable",
+                    "key": "PathToExecutable",
+                    "value": 2007
+                },
+                {
+                    "documentation": "Cannot create a directory",
+                    "key": "MakeDirectory",
+                    "value": 2008
+                },
+                {
+                    "documentation": "An application entity title (AET) cannot be empty or be longer than 16 characters",
+                    "key": "BadApplicationEntityTitle",
+                    "value": 2009
+                },
+                {
+                    "documentation": "No request handler factory for DICOM C-FIND SCP",
+                    "key": "NoCFindHandler",
+                    "value": 2010
+                },
+                {
+                    "documentation": "No request handler factory for DICOM C-MOVE SCP",
+                    "key": "NoCMoveHandler",
+                    "value": 2011
+                },
+                {
+                    "documentation": "No request handler factory for DICOM C-STORE SCP",
+                    "key": "NoCStoreHandler",
+                    "value": 2012
+                },
+                {
+                    "documentation": "No application entity filter",
+                    "key": "NoApplicationEntityFilter",
+                    "value": 2013
+                },
+                {
+                    "documentation": "DicomUserConnection: Unable to find the SOP class and instance",
+                    "key": "NoSopClassOrInstance",
+                    "value": 2014
+                },
+                {
+                    "documentation": "DicomUserConnection: No acceptable presentation context for modality",
+                    "key": "NoPresentationContext",
+                    "value": 2015
+                },
+                {
+                    "documentation": "DicomUserConnection: The C-FIND command is not supported by the remote SCP",
+                    "key": "DicomFindUnavailable",
+                    "value": 2016
+                },
+                {
+                    "documentation": "DicomUserConnection: The C-MOVE command is not supported by the remote SCP",
+                    "key": "DicomMoveUnavailable",
+                    "value": 2017
+                },
+                {
+                    "documentation": "Cannot store an instance",
+                    "key": "CannotStoreInstance",
+                    "value": 2018
+                },
+                {
+                    "documentation": "Only string values are supported when creating DICOM instances",
+                    "key": "CreateDicomNotString",
+                    "value": 2019
+                },
+                {
+                    "documentation": "Trying to override a value inherited from a parent module",
+                    "key": "CreateDicomOverrideTag",
+                    "value": 2020
+                },
+                {
+                    "documentation": "Use \\\"Content\\\" to inject an image into a new DICOM instance",
+                    "key": "CreateDicomUseContent",
+                    "value": 2021
+                },
+                {
+                    "documentation": "No payload is present for one instance in the series",
+                    "key": "CreateDicomNoPayload",
+                    "value": 2022
+                },
+                {
+                    "documentation": "The payload of the DICOM instance must be specified according to Data URI scheme",
+                    "key": "CreateDicomUseDataUriScheme",
+                    "value": 2023
+                },
+                {
+                    "documentation": "Trying to attach a new DICOM instance to an inexistent resource",
+                    "key": "CreateDicomBadParent",
+                    "value": 2024
+                },
+                {
+                    "documentation": "Trying to attach a new DICOM instance to an instance (must be a series, study or patient)",
+                    "key": "CreateDicomParentIsInstance",
+                    "value": 2025
+                },
+                {
+                    "documentation": "Unable to get the encoding of the parent resource",
+                    "key": "CreateDicomParentEncoding",
+                    "value": 2026
+                },
+                {
+                    "documentation": "Unknown modality",
+                    "key": "UnknownModality",
+                    "value": 2027
+                },
+                {
+                    "documentation": "Bad ordering of filters in a job",
+                    "key": "BadJobOrdering",
+                    "value": 2028
+                },
+                {
+                    "documentation": "Cannot convert the given JSON object to a Lua table",
+                    "key": "JsonToLuaTable",
+                    "value": 2029
+                },
+                {
+                    "documentation": "Cannot create the Lua context",
+                    "key": "CannotCreateLua",
+                    "value": 2030
+                },
+                {
+                    "documentation": "Cannot execute a Lua command",
+                    "key": "CannotExecuteLua",
+                    "value": 2031
+                },
+                {
+                    "documentation": "Arguments cannot be pushed after the Lua function is executed",
+                    "key": "LuaAlreadyExecuted",
+                    "value": 2032
+                },
+                {
+                    "documentation": "The Lua function does not give the expected number of outputs",
+                    "key": "LuaBadOutput",
+                    "value": 2033
+                },
+                {
+                    "documentation": "The Lua function is not a predicate (only true/false outputs allowed)",
+                    "key": "NotLuaPredicate",
+                    "value": 2034
+                },
+                {
+                    "documentation": "The Lua function does not return a string",
+                    "key": "LuaReturnsNoString",
+                    "value": 2035
+                },
+                {
+                    "documentation": "Another plugin has already registered a custom storage area",
+                    "key": "StorageAreaAlreadyRegistered",
+                    "value": 2036
+                },
+                {
+                    "documentation": "Another plugin has already registered a custom database back-end",
+                    "key": "DatabaseBackendAlreadyRegistered",
+                    "value": 2037
+                },
+                {
+                    "documentation": "Plugin trying to call the database during its initialization",
+                    "key": "DatabaseNotInitialized",
+                    "value": 2038
+                },
+                {
+                    "documentation": "Orthanc has been built without SSL support",
+                    "key": "SslDisabled",
+                    "value": 2039
+                },
+                {
+                    "documentation": "Unable to order the slices of the series",
+                    "key": "CannotOrderSlices",
+                    "value": 2040
+                },
+                {
+                    "documentation": "No request handler factory for DICOM C-Find Modality SCP",
+                    "key": "NoWorklistHandler",
+                    "value": 2041
+                },
+                {
+                    "documentation": "Cannot override the value of a tag that already exists",
+                    "key": "AlreadyExistingTag",
+                    "value": 2042
+                },
+                {
+                    "documentation": "No request handler factory for DICOM N-ACTION SCP (storage commitment)",
+                    "key": "NoStorageCommitmentHandler",
+                    "value": 2043
+                },
+                {
+                    "documentation": "No request handler factory for DICOM C-GET SCP",
+                    "key": "NoCGetHandler",
+                    "value": 2044
+                },
+                {
+                    "documentation": "Unsupported media type",
+                    "key": "UnsupportedMediaType",
+                    "value": 3000
+                }
+            ]
+        },
+        {
+            "documentation": "The various HTTP methods for a REST call.",
+            "name": "OrthancPluginHttpMethod",
+            "values": [
+                {
+                    "documentation": "GET request",
+                    "key": "Get",
+                    "value": 1
+                },
+                {
+                    "documentation": "POST request",
+                    "key": "Post",
+                    "value": 2
+                },
+                {
+                    "documentation": "PUT request",
+                    "key": "Put",
+                    "value": 3
+                },
+                {
+                    "documentation": "DELETE request",
+                    "key": "Delete",
+                    "value": 4
+                }
+            ]
+        },
+        {
+            "documentation": "The constraints on the DICOM identifiers that must be supported by the database plugins.",
+            "name": "OrthancPluginIdentifierConstraint",
+            "values": [
+                {
+                    "documentation": "Equal",
+                    "key": "Equal",
+                    "value": 1
+                },
+                {
+                    "documentation": "Less or equal",
+                    "key": "SmallerOrEqual",
+                    "value": 2
+                },
+                {
+                    "documentation": "More or equal",
+                    "key": "GreaterOrEqual",
+                    "value": 3
+                },
+                {
+                    "documentation": "Case-sensitive wildcard matching (with * and ?)",
+                    "key": "Wildcard",
+                    "value": 4
+                }
+            ]
+        },
+        {
+            "documentation": "The image formats that are supported by the Orthanc core.",
+            "name": "OrthancPluginImageFormat",
+            "values": [
+                {
+                    "documentation": "Image compressed using PNG",
+                    "key": "Png",
+                    "value": 0
+                },
+                {
+                    "documentation": "Image compressed using JPEG",
+                    "key": "Jpeg",
+                    "value": 1
+                },
+                {
+                    "documentation": "Image compressed using DICOM",
+                    "key": "Dicom",
+                    "value": 2
+                }
+            ]
+        },
+        {
+            "documentation": "The origin of a DICOM instance that has been received by Orthanc.",
+            "name": "OrthancPluginInstanceOrigin",
+            "values": [
+                {
+                    "documentation": "Unknown origin",
+                    "key": "Unknown",
+                    "value": 1
+                },
+                {
+                    "documentation": "Instance received through DICOM protocol",
+                    "key": "DicomProtocol",
+                    "value": 2
+                },
+                {
+                    "documentation": "Instance received through REST API of Orthanc",
+                    "key": "RestApi",
+                    "value": 3
+                },
+                {
+                    "documentation": "Instance added to Orthanc by a plugin",
+                    "key": "Plugin",
+                    "value": 4
+                },
+                {
+                    "documentation": "Instance added to Orthanc by a Lua script",
+                    "key": "Lua",
+                    "value": 5
+                },
+                {
+                    "documentation": "Instance received through WebDAV (new in 1.8.0)",
+                    "key": "WebDav",
+                    "value": 6
+                }
+            ]
+        },
+        {
+            "documentation": "The possible status for one single step of a job.",
+            "name": "OrthancPluginJobStepStatus",
+            "values": [
+                {
+                    "documentation": "The job has successfully executed all its steps",
+                    "key": "Success",
+                    "value": 1
+                },
+                {
+                    "documentation": "The job has failed while executing this step",
+                    "key": "Failure",
+                    "value": 2
+                },
+                {
+                    "documentation": "The job has still data to process after this step",
+                    "key": "Continue",
+                    "value": 3
+                }
+            ]
+        },
+        {
+            "documentation": "Explains why the job should stop and release the resources it has allocated. This is especially important to disambiguate between the \"paused\" condition and the \"final\" conditions (success, failure, or canceled).",
+            "name": "OrthancPluginJobStopReason",
+            "values": [
+                {
+                    "documentation": "The job has succeeded",
+                    "key": "Success",
+                    "value": 1
+                },
+                {
+                    "documentation": "The job was paused, and will be resumed later",
+                    "key": "Paused",
+                    "value": 2
+                },
+                {
+                    "documentation": "The job has failed, and might be resubmitted later",
+                    "key": "Failure",
+                    "value": 3
+                },
+                {
+                    "documentation": "The job was canceled, and might be resubmitted later",
+                    "key": "Canceled",
+                    "value": 4
+                }
+            ]
+        },
+        {
+            "documentation": "The available types of metrics.",
+            "name": "OrthancPluginMetricsType",
+            "values": [
+                {
+                    "documentation": "Default metrics",
+                    "key": "Default",
+                    "value": 0
+                },
+                {
+                    "documentation": "This metrics represents a time duration. Orthanc will keep the maximum value of the metrics over a sliding window of ten seconds, which is useful if the metrics is sampled frequently.",
+                    "key": "Timer",
+                    "value": 1
+                }
+            ]
+        },
+        {
+            "documentation": "The memory layout of the pixels of an image.",
+            "name": "OrthancPluginPixelFormat",
+            "values": [
+                {
+                    "documentation": "Graylevel 8bpp image. The image is graylevel. Each pixel is unsigned and stored in one byte.",
+                    "key": "Grayscale8",
+                    "value": 1
+                },
+                {
+                    "documentation": "Graylevel, unsigned 16bpp image. The image is graylevel. Each pixel is unsigned and stored in two bytes.",
+                    "key": "Grayscale16",
+                    "value": 2
+                },
+                {
+                    "documentation": "Graylevel, signed 16bpp image. The image is graylevel. Each pixel is signed and stored in two bytes.",
+                    "key": "SignedGrayscale16",
+                    "value": 3
+                },
+                {
+                    "documentation": "Color image in RGB24 format. This format describes a color image. The pixels are stored in 3 consecutive bytes. The memory layout is RGB.",
+                    "key": "RGB24",
+                    "value": 4
+                },
+                {
+                    "documentation": "Color image in RGBA32 format. This format describes a color image. The pixels are stored in 4 consecutive bytes. The memory layout is RGBA.",
+                    "key": "RGBA32",
+                    "value": 5
+                },
+                {
+                    "documentation": "Unknown pixel format",
+                    "key": "Unknown",
+                    "value": 6
+                },
+                {
+                    "documentation": "Color image in RGB48 format. This format describes a color image. The pixels are stored in 6 consecutive bytes. The memory layout is RRGGBB.",
+                    "key": "RGB48",
+                    "value": 7
+                },
+                {
+                    "documentation": "Graylevel, unsigned 32bpp image. The image is graylevel. Each pixel is unsigned and stored in four bytes.",
+                    "key": "Grayscale32",
+                    "value": 8
+                },
+                {
+                    "documentation": "Graylevel, floating-point 32bpp image. The image is graylevel. Each pixel is floating-point and stored in four bytes.",
+                    "key": "Float32",
+                    "value": 9
+                },
+                {
+                    "documentation": "Color image in BGRA32 format. This format describes a color image. The pixels are stored in 4 consecutive bytes. The memory layout is BGRA.",
+                    "key": "BGRA32",
+                    "value": 10
+                },
+                {
+                    "documentation": "Graylevel, unsigned 64bpp image. The image is graylevel. Each pixel is unsigned and stored in eight bytes.",
+                    "key": "Grayscale64",
+                    "value": 11
+                }
+            ]
+        },
+        {
+            "documentation": "The action to be taken after ReceivedInstanceCallback is triggered",
+            "name": "OrthancPluginReceivedInstanceAction",
+            "values": [
+                {
+                    "documentation": "Keep the instance as is",
+                    "key": "KeepAsIs",
+                    "value": 1
+                },
+                {
+                    "documentation": "Modify the instance",
+                    "key": "Modify",
+                    "value": 2
+                },
+                {
+                    "documentation": "Discard the instance",
+                    "key": "Discard",
+                    "value": 3
+                }
+            ]
+        },
+        {
+            "documentation": "The supported types of DICOM resources.",
+            "name": "OrthancPluginResourceType",
+            "values": [
+                {
+                    "documentation": "Patient",
+                    "key": "Patient",
+                    "value": 0
+                },
+                {
+                    "documentation": "Study",
+                    "key": "Study",
+                    "value": 1
+                },
+                {
+                    "documentation": "Series",
+                    "key": "Series",
+                    "value": 2
+                },
+                {
+                    "documentation": "Instance",
+                    "key": "Instance",
+                    "value": 3
+                },
+                {
+                    "documentation": "Unavailable resource type",
+                    "key": "None",
+                    "value": 4
+                }
+            ]
+        },
+        {
+            "documentation": "The available values for the Failure Reason (0008,1197) during storage commitment. http://dicom.nema.org/medical/dicom/2019e/output/chtml/part03/sect_C.14.html#sect_C.14.1.1",
+            "name": "OrthancPluginStorageCommitmentFailureReason",
+            "values": [
+                {
+                    "documentation": "Success: The DICOM instance is properly stored in the SCP",
+                    "key": "Success",
+                    "value": 0
+                },
+                {
+                    "documentation": "0110H: A general failure in processing the operation was encountered",
+                    "key": "ProcessingFailure",
+                    "value": 1
+                },
+                {
+                    "documentation": "0112H: One or more of the elements in the Referenced SOP Instance Sequence was not available",
+                    "key": "NoSuchObjectInstance",
+                    "value": 2
+                },
+                {
+                    "documentation": "0213H: The SCP does not currently have enough resources to store the requested SOP Instance(s)",
+                    "key": "ResourceLimitation",
+                    "value": 3
+                },
+                {
+                    "documentation": "0122H: Storage Commitment has been requested for a SOP Instance with a SOP Class that is not supported by the SCP",
+                    "key": "ReferencedSOPClassNotSupported",
+                    "value": 4
+                },
+                {
+                    "documentation": "0119H: The SOP Class of an element in the Referenced SOP Instance Sequence did not correspond to the SOP class registered for this SOP Instance at the SCP",
+                    "key": "ClassInstanceConflict",
+                    "value": 5
+                },
+                {
+                    "documentation": "0131H: The Transaction UID of the Storage Commitment Request is already in use",
+                    "key": "DuplicateTransactionUID",
+                    "value": 6
+                }
+            ]
+        },
+        {
+            "documentation": "The value representations present in the DICOM standard (version 2013).",
+            "name": "OrthancPluginValueRepresentation",
+            "values": [
+                {
+                    "documentation": "Application Entity",
+                    "key": "AE",
+                    "value": 1
+                },
+                {
+                    "documentation": "Age String",
+                    "key": "AS",
+                    "value": 2
+                },
+                {
+                    "documentation": "Attribute Tag",
+                    "key": "AT",
+                    "value": 3
+                },
+                {
+                    "documentation": "Code String",
+                    "key": "CS",
+                    "value": 4
+                },
+                {
+                    "documentation": "Date",
+                    "key": "DA",
+                    "value": 5
+                },
+                {
+                    "documentation": "Decimal String",
+                    "key": "DS",
+                    "value": 6
+                },
+                {
+                    "documentation": "Date Time",
+                    "key": "DT",
+                    "value": 7
+                },
+                {
+                    "documentation": "Floating Point Double",
+                    "key": "FD",
+                    "value": 8
+                },
+                {
+                    "documentation": "Floating Point Single",
+                    "key": "FL",
+                    "value": 9
+                },
+                {
+                    "documentation": "Integer String",
+                    "key": "IS",
+                    "value": 10
+                },
+                {
+                    "documentation": "Long String",
+                    "key": "LO",
+                    "value": 11
+                },
+                {
+                    "documentation": "Long Text",
+                    "key": "LT",
+                    "value": 12
+                },
+                {
+                    "documentation": "Other Byte String",
+                    "key": "OB",
+                    "value": 13
+                },
+                {
+                    "documentation": "Other Float String",
+                    "key": "OF",
+                    "value": 14
+                },
+                {
+                    "documentation": "Other Word String",
+                    "key": "OW",
+                    "value": 15
+                },
+                {
+                    "documentation": "Person Name",
+                    "key": "PN",
+                    "value": 16
+                },
+                {
+                    "documentation": "Short String",
+                    "key": "SH",
+                    "value": 17
+                },
+                {
+                    "documentation": "Signed Long",
+                    "key": "SL",
+                    "value": 18
+                },
+                {
+                    "documentation": "Sequence of Items",
+                    "key": "SQ",
+                    "value": 19
+                },
+                {
+                    "documentation": "Signed Short",
+                    "key": "SS",
+                    "value": 20
+                },
+                {
+                    "documentation": "Short Text",
+                    "key": "ST",
+                    "value": 21
+                },
+                {
+                    "documentation": "Time",
+                    "key": "TM",
+                    "value": 22
+                },
+                {
+                    "documentation": "Unique Identifier (UID)",
+                    "key": "UI",
+                    "value": 23
+                },
+                {
+                    "documentation": "Unsigned Long",
+                    "key": "UL",
+                    "value": 24
+                },
+                {
+                    "documentation": "Unknown",
+                    "key": "UN",
+                    "value": 25
+                },
+                {
+                    "documentation": "Unsigned Short",
+                    "key": "US",
+                    "value": 26
+                },
+                {
+                    "documentation": "Unlimited Text",
+                    "key": "UT",
+                    "value": 27
+                }
+            ]
+        }
+    ],
+    "global_functions": [
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "expectedMajor",
+                    "sdk_type": "int32_t"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "expectedMinor",
+                    "sdk_type": "int32_t"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_name": "expectedRevision",
+                    "sdk_type": "int32_t"
+                }
+            ],
+            "c_function": "OrthancPluginCheckVersionAdvanced",
+            "documentation": {
+                "args": {
+                    "expectedMajor": "Expected major version.",
+                    "expectedMinor": "Expected minor version.",
+                    "expectedRevision": "Expected revision."
+                },
+                "description": [
+                    "This function checks whether the version of the Orthanc server running this plugin, is above the given version. Contrarily to OrthancPluginCheckVersion(), it is up to the developer of the plugin to make sure that all the Orthanc SDK services called by the plugin are actually implemented in the given version of Orthanc."
+                ],
+                "return": "1 if and only if the versions are compatible. If the result is 0, the initialization of the plugin should fail.",
+                "summary": "Check that the version of the hosting Orthanc is above a given version."
+            },
+            "return_sdk_type": "int32_t"
+        },
+        {
+            "args": [],
+            "c_function": "OrthancPluginCheckVersion",
+            "documentation": {
+                "args": {},
+                "description": [
+                    "This function checks whether the version of the Orthanc server running this plugin, is above the version of the current Orthanc SDK header. This guarantees that the plugin is compatible with the hosting Orthanc (i.e. it will not call unavailable services). The result of this function should always be checked in the OrthancPluginInitialize() entry point of the plugin."
+                ],
+                "return": "1 if and only if the versions are compatible. If the result is 0, the initialization of the plugin should fail.",
+                "summary": "Check the compatibility of the plugin wrt. the version of its hosting Orthanc."
+            },
+            "return_sdk_type": "int32_t"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "message",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginLogError",
+            "documentation": {
+                "args": {
+                    "message": "The message to be logged."
+                },
+                "description": [
+                    "Log an error message using the Orthanc logging system."
+                ],
+                "summary": "Log an error."
+            },
+            "return_sdk_type": "void"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "message",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginLogWarning",
+            "documentation": {
+                "args": {
+                    "message": "The message to be logged."
+                },
+                "description": [
+                    "Log a warning message using the Orthanc logging system."
+                ],
+                "summary": "Log a warning."
+            },
+            "return_sdk_type": "void"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "message",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginLogInfo",
+            "documentation": {
+                "args": {
+                    "message": "The message to be logged."
+                },
+                "description": [
+                    "Log an information message using the Orthanc logging system."
+                ],
+                "summary": "Log an information."
+            },
+            "return_sdk_type": "void"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "instanceId",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginGetDicomForInstance",
+            "documentation": {
+                "args": {
+                    "instanceId": "The Orthanc identifier of the DICOM instance of interest.",
+                    "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer()."
+                },
+                "description": [
+                    "Retrieve a DICOM instance using its Orthanc identifier. The DICOM file is stored into a newly allocated memory buffer."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Retrieve a DICOM instance using its Orthanc identifier."
+            },
+            "return_sdk_type": "OrthancPluginMemoryBuffer *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "uri",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginRestApiGet",
+            "documentation": {
+                "args": {
+                    "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().",
+                    "uri": "The URI in the built-in Orthanc API."
+                },
+                "description": [
+                    "Make a GET call to the built-in Orthanc REST API. The result to the query is stored into a newly allocated memory buffer.",
+                    "Remark: If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Make a GET call to the built-in Orthanc REST API."
+            },
+            "return_sdk_type": "OrthancPluginMemoryBuffer *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "uri",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginRestApiGetAfterPlugins",
+            "documentation": {
+                "args": {
+                    "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().",
+                    "uri": "The URI in the built-in Orthanc API."
+                },
+                "description": [
+                    "Make a GET call to the Orthanc REST API, after all the plugins are applied. In other words, if some plugin overrides or adds the called URI to the built-in Orthanc REST API, this call will return the result provided by this plugin. The result to the query is stored into a newly allocated memory buffer.",
+                    "Remark: If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Make a GET call to the REST API, as tainted by the plugins."
+            },
+            "return_sdk_type": "OrthancPluginMemoryBuffer *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "uri",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "body",
+                    "sdk_type": "const_void_pointer_with_size"
+                }
+            ],
+            "c_function": "OrthancPluginRestApiPost",
+            "documentation": {
+                "args": {
+                    "body": "The body of the POST request.",
+                    "bodySize": "The size of the body.",
+                    "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().",
+                    "uri": "The URI in the built-in Orthanc API."
+                },
+                "description": [
+                    "Make a POST call to the built-in Orthanc REST API. The result to the query is stored into a newly allocated memory buffer.",
+                    "Remark: If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Make a POST call to the built-in Orthanc REST API."
+            },
+            "return_sdk_type": "OrthancPluginMemoryBuffer *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "uri",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "body",
+                    "sdk_type": "const_void_pointer_with_size"
+                }
+            ],
+            "c_function": "OrthancPluginRestApiPostAfterPlugins",
+            "documentation": {
+                "args": {
+                    "body": "The body of the POST request.",
+                    "bodySize": "The size of the body.",
+                    "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().",
+                    "uri": "The URI in the built-in Orthanc API."
+                },
+                "description": [
+                    "Make a POST call to the Orthanc REST API, after all the plugins are applied. In other words, if some plugin overrides or adds the called URI to the built-in Orthanc REST API, this call will return the result provided by this plugin. The result to the query is stored into a newly allocated memory buffer.",
+                    "Remark: If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Make a POST call to the REST API, as tainted by the plugins."
+            },
+            "return_sdk_type": "OrthancPluginMemoryBuffer *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "uri",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginRestApiDelete",
+            "documentation": {
+                "args": {
+                    "uri": "The URI to delete in the built-in Orthanc API."
+                },
+                "description": [
+                    "Make a DELETE call to the built-in Orthanc REST API.",
+                    "Remark: If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Make a DELETE call to the built-in Orthanc REST API."
+            },
+            "return_sdk_enumeration": "OrthancPluginErrorCode",
+            "return_sdk_type": "enumeration"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "uri",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginRestApiDeleteAfterPlugins",
+            "documentation": {
+                "args": {
+                    "uri": "The URI to delete in the built-in Orthanc API."
+                },
+                "description": [
+                    "Make a DELETE call to the Orthanc REST API, after all the plugins are applied. In other words, if some plugin overrides or adds the called URI to the built-in Orthanc REST API, this call will return the result provided by this plugin.",
+                    "Remark: If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Make a DELETE call to the REST API, as tainted by the plugins."
+            },
+            "return_sdk_enumeration": "OrthancPluginErrorCode",
+            "return_sdk_type": "enumeration"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "uri",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "body",
+                    "sdk_type": "const_void_pointer_with_size"
+                }
+            ],
+            "c_function": "OrthancPluginRestApiPut",
+            "documentation": {
+                "args": {
+                    "body": "The body of the PUT request.",
+                    "bodySize": "The size of the body.",
+                    "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().",
+                    "uri": "The URI in the built-in Orthanc API."
+                },
+                "description": [
+                    "Make a PUT call to the built-in Orthanc REST API. The result to the query is stored into a newly allocated memory buffer.",
+                    "Remark: If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Make a PUT call to the built-in Orthanc REST API."
+            },
+            "return_sdk_type": "OrthancPluginMemoryBuffer *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "uri",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "body",
+                    "sdk_type": "const_void_pointer_with_size"
+                }
+            ],
+            "c_function": "OrthancPluginRestApiPutAfterPlugins",
+            "documentation": {
+                "args": {
+                    "body": "The body of the PUT request.",
+                    "bodySize": "The size of the body.",
+                    "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().",
+                    "uri": "The URI in the built-in Orthanc API."
+                },
+                "description": [
+                    "Make a PUT call to the Orthanc REST API, after all the plugins are applied. In other words, if some plugin overrides or adds the called URI to the built-in Orthanc REST API, this call will return the result provided by this plugin. The result to the query is stored into a newly allocated memory buffer.",
+                    "Remark: If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Make a PUT call to the REST API, as tainted by the plugins."
+            },
+            "return_sdk_type": "OrthancPluginMemoryBuffer *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "patientID",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginLookupPatient",
+            "documentation": {
+                "args": {
+                    "patientID": "The Patient ID of interest."
+                },
+                "description": [
+                    "Look for a patient stored in Orthanc, using its Patient ID tag (0x0010, 0x0020). This function uses the database index to run as fast as possible (it does not loop over all the stored patients)."
+                ],
+                "return": "The NULL value if the patient is non-existent, or a string containing the Orthanc ID of the patient. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Look for a patient."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "studyUID",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginLookupStudy",
+            "documentation": {
+                "args": {
+                    "studyUID": "The Study Instance UID of interest."
+                },
+                "description": [
+                    "Look for a study stored in Orthanc, using its Study Instance UID tag (0x0020, 0x000d). This function uses the database index to run as fast as possible (it does not loop over all the stored studies)."
+                ],
+                "return": "The NULL value if the study is non-existent, or a string containing the Orthanc ID of the study. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Look for a study."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "accessionNumber",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginLookupStudyWithAccessionNumber",
+            "documentation": {
+                "args": {
+                    "accessionNumber": "The Accession Number of interest."
+                },
+                "description": [
+                    "Look for a study stored in Orthanc, using its Accession Number tag (0x0008, 0x0050). This function uses the database index to run as fast as possible (it does not loop over all the stored studies)."
+                ],
+                "return": "The NULL value if the study is non-existent, or a string containing the Orthanc ID of the study. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Look for a study, using the accession number."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "seriesUID",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginLookupSeries",
+            "documentation": {
+                "args": {
+                    "seriesUID": "The Series Instance UID of interest."
+                },
+                "description": [
+                    "Look for a series stored in Orthanc, using its Series Instance UID tag (0x0020, 0x000e). This function uses the database index to run as fast as possible (it does not loop over all the stored series)."
+                ],
+                "return": "The NULL value if the series is non-existent, or a string containing the Orthanc ID of the series. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Look for a series."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "sopInstanceUID",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginLookupInstance",
+            "documentation": {
+                "args": {
+                    "sopInstanceUID": "The SOP Instance UID of interest."
+                },
+                "description": [
+                    "Look for an instance stored in Orthanc, using its SOP Instance UID tag (0x0008, 0x0018). This function uses the database index to run as fast as possible (it does not loop over all the stored instances)."
+                ],
+                "return": "The NULL value if the instance is non-existent, or a string containing the Orthanc ID of the instance. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Look for an instance."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [],
+            "c_function": "OrthancPluginGetOrthancPath",
+            "documentation": {
+                "args": {},
+                "description": [
+                    "This function returns the path to the Orthanc executable."
+                ],
+                "return": "NULL in the case of an error, or a newly allocated string containing the path. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Return the path to the Orthanc executable."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [],
+            "c_function": "OrthancPluginGetOrthancDirectory",
+            "documentation": {
+                "args": {},
+                "description": [
+                    "This function returns the path to the directory containing the Orthanc executable."
+                ],
+                "return": "NULL in the case of an error, or a newly allocated string containing the path. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Return the directory containing the Orthanc."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [],
+            "c_function": "OrthancPluginGetConfigurationPath",
+            "documentation": {
+                "args": {},
+                "description": [
+                    "This function returns the path to the configuration file(s) that was specified when starting Orthanc. Since version 0.9.1, this path can refer to a folder that stores a set of configuration files. This function is deprecated in favor of OrthancPluginGetConfiguration()."
+                ],
+                "return": "NULL in the case of an error, or a newly allocated string containing the path. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Return the path to the configuration file(s)."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "uri",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginSetRootUri",
+            "documentation": {
+                "args": {
+                    "uri": "The root URI for this plugin."
+                },
+                "description": [
+                    "For plugins that come with a Web interface, this function declares the entry path where to find this interface. This information is notably used in the \"Plugins\" page of Orthanc Explorer."
+                ],
+                "summary": "Set the URI where the plugin provides its Web interface."
+            },
+            "return_sdk_type": "void"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "description",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginSetDescription",
+            "documentation": {
+                "args": {
+                    "description": "The description."
+                },
+                "description": [
+                    "Set a description for this plugin. It is displayed in the \"Plugins\" page of Orthanc Explorer."
+                ],
+                "summary": "Set a description for this plugin."
+            },
+            "return_sdk_type": "void"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "javascript",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginExtendOrthancExplorer",
+            "documentation": {
+                "args": {
+                    "javascript": "The custom JavaScript code."
+                },
+                "description": [
+                    "Add JavaScript code to customize the default behavior of Orthanc Explorer. This can for instance be used to add new buttons."
+                ],
+                "summary": "Extend the JavaScript code of Orthanc Explorer."
+            },
+            "return_sdk_type": "void"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "property",
+                    "sdk_type": "int32_t"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "defaultValue",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginGetGlobalProperty",
+            "documentation": {
+                "args": {
+                    "defaultValue": "The value to return, if the global property is unset.",
+                    "property": "The global property of interest."
+                },
+                "description": [
+                    "Get the value of a global property that is stored in the Orthanc database. Global properties whose index is below 1024 are reserved by Orthanc."
+                ],
+                "return": "The value of the global property, or NULL in the case of an error. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Get the value of a global property."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "property",
+                    "sdk_type": "int32_t"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "value",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginSetGlobalProperty",
+            "documentation": {
+                "args": {
+                    "property": "The global property of interest.",
+                    "value": "The value to be set in the global property."
+                },
+                "description": [
+                    "Set the value of a global property into the Orthanc database. Setting a global property can be used by plugins to save their internal parameters. Plugins are only allowed to set properties whose index are above or equal to 1024 (properties below 1024 are read-only and reserved by Orthanc)."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Set the value of a global property."
+            },
+            "return_sdk_enumeration": "OrthancPluginErrorCode",
+            "return_sdk_type": "enumeration"
+        },
+        {
+            "args": [],
+            "c_function": "OrthancPluginGetCommandLineArgumentsCount",
+            "documentation": {
+                "args": {},
+                "description": [
+                    "Retrieve the number of command-line arguments that were used to launch Orthanc."
+                ],
+                "return": "The number of arguments.",
+                "summary": "Get the number of command-line arguments."
+            },
+            "return_sdk_type": "uint32_t"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "argument",
+                    "sdk_type": "uint32_t"
+                }
+            ],
+            "c_function": "OrthancPluginGetCommandLineArgument",
+            "documentation": {
+                "args": {
+                    "argument": "The index of the argument."
+                },
+                "description": [
+                    "Get the value of one of the command-line arguments that were used to launch Orthanc. The number of available arguments can be retrieved by OrthancPluginGetCommandLineArgumentsCount()."
+                ],
+                "return": "The value of the argument, or NULL in the case of an error. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Get the value of a command-line argument."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [],
+            "c_function": "OrthancPluginGetExpectedDatabaseVersion",
+            "documentation": {
+                "args": {},
+                "description": [
+                    "Retrieve the expected version of the database schema."
+                ],
+                "return": "The version.",
+                "summary": "Get the expected version of the database schema."
+            },
+            "return_sdk_type": "uint32_t"
+        },
+        {
+            "args": [],
+            "c_function": "OrthancPluginGetConfiguration",
+            "documentation": {
+                "args": {},
+                "description": [
+                    "This function returns the content of the configuration that is used by Orthanc, formatted as a JSON string."
+                ],
+                "return": "NULL in the case of an error, or a newly allocated string containing the configuration. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Return the content of the configuration file(s)."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "source",
+                    "sdk_type": "const_void_pointer_with_size"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_enumeration": "OrthancPluginCompressionType",
+                    "sdk_name": "compression",
+                    "sdk_type": "enumeration"
+                },
+                {
+                    "name": "arg3",
+                    "sdk_name": "uncompress",
+                    "sdk_type": "uint8_t"
+                }
+            ],
+            "c_function": "OrthancPluginBufferCompression",
+            "documentation": {
+                "args": {
+                    "compression": "The compression algorithm.",
+                    "size": "The size in bytes of the source buffer.",
+                    "source": "The source buffer.",
+                    "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().",
+                    "uncompress": "If set to \"0\", the buffer must be compressed. If set to \"1\", the buffer must be uncompressed."
+                },
+                "description": [
+                    "This function compresses or decompresses a buffer, using the version of the zlib library that is used by the Orthanc core."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Compress or decompress a buffer."
+            },
+            "return_sdk_type": "OrthancPluginMemoryBuffer *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "path",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginReadFile",
+            "documentation": {
+                "args": {
+                    "path": "The path of the file to be read.",
+                    "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer()."
+                },
+                "description": [
+                    "Read the content of a file on the filesystem, and returns it into a newly allocated memory buffer."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Read a file."
+            },
+            "return_sdk_type": "OrthancPluginMemoryBuffer *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "path",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "data",
+                    "sdk_type": "const_void_pointer_with_size"
+                }
+            ],
+            "c_function": "OrthancPluginWriteFile",
+            "documentation": {
+                "args": {
+                    "data": "The content of the memory buffer.",
+                    "path": "The path of the file to be written.",
+                    "size": "The size of the memory buffer."
+                },
+                "description": [
+                    "Write the content of a memory buffer to the filesystem."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Write a file."
+            },
+            "return_sdk_enumeration": "OrthancPluginErrorCode",
+            "return_sdk_type": "enumeration"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_enumeration": "OrthancPluginErrorCode",
+                    "sdk_name": "error",
+                    "sdk_type": "enumeration"
+                }
+            ],
+            "c_function": "OrthancPluginGetErrorDescription",
+            "documentation": {
+                "args": {
+                    "error": "The error code of interest."
+                },
+                "description": [
+                    "This function returns the description of a given error code."
+                ],
+                "return": "The error description. This is a statically-allocated string, do not free it.",
+                "summary": "Get the description of a given error code."
+            },
+            "return_sdk_type": "const char *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "data",
+                    "sdk_type": "const_void_pointer_with_size"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_enumeration": "OrthancPluginImageFormat",
+                    "sdk_name": "format",
+                    "sdk_type": "enumeration"
+                }
+            ],
+            "c_function": "OrthancPluginUncompressImage",
+            "documentation": {
+                "args": {
+                    "data": "Pointer to a memory buffer containing the compressed image.",
+                    "format": "The file format of the compressed image.",
+                    "size": "Size of the memory buffer containing the compressed image."
+                },
+                "description": [
+                    "This function decodes a compressed image from a memory buffer."
+                ],
+                "return": "The uncompressed image. It must be freed with OrthancPluginFreeImage().",
+                "summary": "Decode a compressed image."
+            },
+            "return_sdk_class": "OrthancPluginImage",
+            "return_sdk_type": "object"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_enumeration": "OrthancPluginPixelFormat",
+                    "sdk_name": "format",
+                    "sdk_type": "enumeration"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "width",
+                    "sdk_type": "uint32_t"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_name": "height",
+                    "sdk_type": "uint32_t"
+                },
+                {
+                    "name": "arg3",
+                    "sdk_name": "pitch",
+                    "sdk_type": "uint32_t"
+                },
+                {
+                    "name": "arg4",
+                    "sdk_name": "buffer",
+                    "sdk_type": "const void *"
+                }
+            ],
+            "c_function": "OrthancPluginCompressPngImage",
+            "documentation": {
+                "args": {
+                    "buffer": "The memory buffer containing the uncompressed image.",
+                    "format": "The memory layout of the uncompressed image.",
+                    "height": "The height of the image.",
+                    "pitch": "The pitch of the image (i.e. the number of bytes between 2 successive lines of the image in the memory buffer).",
+                    "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().",
+                    "width": "The width of the image."
+                },
+                "description": [
+                    "This function compresses the given memory buffer containing an image using the PNG specification, and stores the result of the compression into a newly allocated memory buffer."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Encode a PNG image."
+            },
+            "return_sdk_type": "OrthancPluginMemoryBuffer *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_enumeration": "OrthancPluginPixelFormat",
+                    "sdk_name": "format",
+                    "sdk_type": "enumeration"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "width",
+                    "sdk_type": "uint32_t"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_name": "height",
+                    "sdk_type": "uint32_t"
+                },
+                {
+                    "name": "arg3",
+                    "sdk_name": "pitch",
+                    "sdk_type": "uint32_t"
+                },
+                {
+                    "name": "arg4",
+                    "sdk_name": "buffer",
+                    "sdk_type": "const void *"
+                },
+                {
+                    "name": "arg5",
+                    "sdk_name": "quality",
+                    "sdk_type": "uint8_t"
+                }
+            ],
+            "c_function": "OrthancPluginCompressJpegImage",
+            "documentation": {
+                "args": {
+                    "buffer": "The memory buffer containing the uncompressed image.",
+                    "format": "The memory layout of the uncompressed image.",
+                    "height": "The height of the image.",
+                    "pitch": "The pitch of the image (i.e. the number of bytes between 2 successive lines of the image in the memory buffer).",
+                    "quality": "The quality of the JPEG encoding, between 1 (worst quality, best compression) and 100 (best quality, worst compression).",
+                    "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().",
+                    "width": "The width of the image."
+                },
+                "description": [
+                    "This function compresses the given memory buffer containing an image using the JPEG specification, and stores the result of the compression into a newly allocated memory buffer."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Encode a JPEG image."
+            },
+            "return_sdk_type": "OrthancPluginMemoryBuffer *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "url",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "username",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_name": "password",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginHttpGet",
+            "documentation": {
+                "args": {
+                    "password": "The password (can be \"NULL\" if no password protection).",
+                    "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().",
+                    "url": "The URL of interest.",
+                    "username": "The username (can be \"NULL\" if no password protection)."
+                },
+                "description": [
+                    "Make a HTTP GET call to the given URL. The result to the query is stored into a newly allocated memory buffer. Favor OrthancPluginRestApiGet() if calling the built-in REST API of the Orthanc instance that hosts this plugin."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Issue a HTTP GET call."
+            },
+            "return_sdk_type": "OrthancPluginMemoryBuffer *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "url",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "body",
+                    "sdk_type": "const_void_pointer_with_size"
+                },
+                {
+                    "name": "arg3",
+                    "sdk_name": "username",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg4",
+                    "sdk_name": "password",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginHttpPost",
+            "documentation": {
+                "args": {
+                    "body": "The content of the body of the request.",
+                    "bodySize": "The size of the body of the request.",
+                    "password": "The password (can be \"NULL\" if no password protection).",
+                    "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().",
+                    "url": "The URL of interest.",
+                    "username": "The username (can be \"NULL\" if no password protection)."
+                },
+                "description": [
+                    "Make a HTTP POST call to the given URL. The result to the query is stored into a newly allocated memory buffer. Favor OrthancPluginRestApiPost() if calling the built-in REST API of the Orthanc instance that hosts this plugin."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Issue a HTTP POST call."
+            },
+            "return_sdk_type": "OrthancPluginMemoryBuffer *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "url",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "body",
+                    "sdk_type": "const_void_pointer_with_size"
+                },
+                {
+                    "name": "arg3",
+                    "sdk_name": "username",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg4",
+                    "sdk_name": "password",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginHttpPut",
+            "documentation": {
+                "args": {
+                    "body": "The content of the body of the request.",
+                    "bodySize": "The size of the body of the request.",
+                    "password": "The password (can be \"NULL\" if no password protection).",
+                    "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().",
+                    "url": "The URL of interest.",
+                    "username": "The username (can be \"NULL\" if no password protection)."
+                },
+                "description": [
+                    "Make a HTTP PUT call to the given URL. The result to the query is stored into a newly allocated memory buffer. Favor OrthancPluginRestApiPut() if calling the built-in REST API of the Orthanc instance that hosts this plugin."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Issue a HTTP PUT call."
+            },
+            "return_sdk_type": "OrthancPluginMemoryBuffer *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "url",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "username",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_name": "password",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginHttpDelete",
+            "documentation": {
+                "args": {
+                    "password": "The password (can be \"NULL\" if no password protection).",
+                    "url": "The URL of interest.",
+                    "username": "The username (can be \"NULL\" if no password protection)."
+                },
+                "description": [
+                    "Make a HTTP DELETE call to the given URL. Favor OrthancPluginRestApiDelete() if calling the built-in REST API of the Orthanc instance that hosts this plugin."
+                ],
+                "return": "0 if success, or the error code if failure.",
+                "summary": "Issue a HTTP DELETE call."
+            },
+            "return_sdk_enumeration": "OrthancPluginErrorCode",
+            "return_sdk_type": "enumeration"
+        },
+        {
+            "args": [],
+            "c_function": "OrthancPluginGetFontsCount",
+            "documentation": {
+                "args": {},
+                "description": [
+                    "This function returns the number of fonts that are built in the Orthanc core. These fonts can be used to draw texts on images through OrthancPluginDrawText()."
+                ],
+                "return": "The number of fonts.",
+                "summary": "Return the number of available fonts."
+            },
+            "return_sdk_type": "uint32_t"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "fontIndex",
+                    "sdk_type": "uint32_t"
+                }
+            ],
+            "c_function": "OrthancPluginGetFontName",
+            "documentation": {
+                "args": {
+                    "fontIndex": "The index of the font. This value must be less than OrthancPluginGetFontsCount()."
+                },
+                "description": [
+                    "This function returns the name of a font that is built in the Orthanc core."
+                ],
+                "return": "The font name. This is a statically-allocated string, do not free it.",
+                "summary": "Return the name of a font."
+            },
+            "return_sdk_type": "const char *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "fontIndex",
+                    "sdk_type": "uint32_t"
+                }
+            ],
+            "c_function": "OrthancPluginGetFontSize",
+            "documentation": {
+                "args": {
+                    "fontIndex": "The index of the font. This value must be less than OrthancPluginGetFontsCount()."
+                },
+                "description": [
+                    "This function returns the size of a font that is built in the Orthanc core."
+                ],
+                "return": "The font size.",
+                "summary": "Return the size of a font."
+            },
+            "return_sdk_type": "uint32_t"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "code",
+                    "sdk_type": "int32_t"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "httpStatus",
+                    "sdk_type": "uint16_t"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_name": "message",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginRegisterErrorCode",
+            "documentation": {
+                "args": {
+                    "code": "The error code that is internal to this plugin.",
+                    "httpStatus": "The HTTP status corresponding to this error.",
+                    "message": "The description of the error."
+                },
+                "description": [
+                    "This function declares a custom error code that can be generated by this plugin. This declaration is used to enrich the body of the HTTP answer in the case of an error, and to set the proper HTTP status code."
+                ],
+                "return": "The error code that has been assigned inside the Orthanc core.",
+                "summary": "Declare a custom error code for this plugin."
+            },
+            "return_sdk_enumeration": "OrthancPluginErrorCode",
+            "return_sdk_type": "enumeration"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "group",
+                    "sdk_type": "uint16_t"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "element",
+                    "sdk_type": "uint16_t"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_enumeration": "OrthancPluginValueRepresentation",
+                    "sdk_name": "vr",
+                    "sdk_type": "enumeration"
+                },
+                {
+                    "name": "arg3",
+                    "sdk_name": "name",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg4",
+                    "sdk_name": "minMultiplicity",
+                    "sdk_type": "uint32_t"
+                },
+                {
+                    "name": "arg5",
+                    "sdk_name": "maxMultiplicity",
+                    "sdk_type": "uint32_t"
+                }
+            ],
+            "c_function": "OrthancPluginRegisterDictionaryTag",
+            "documentation": {
+                "args": {
+                    "element": "The element of the tag.",
+                    "group": "The group of the tag.",
+                    "maxMultiplicity": "The maximum multiplicity of the tag. A value of 0 means an arbitrary multiplicity (\"\"n\"\").",
+                    "minMultiplicity": "The minimum multiplicity of the tag (must be above 0).",
+                    "name": "The nickname of the tag.",
+                    "vr": "The value representation of the tag."
+                },
+                "description": [
+                    "This function declares a new public tag in the dictionary of DICOM tags that are known to Orthanc. This function should be used in the OrthancPluginInitialize() callback."
+                ],
+                "return": "0 if success, other value if error.",
+                "summary": "Register a new tag into the DICOM dictionary."
+            },
+            "return_sdk_enumeration": "OrthancPluginErrorCode",
+            "return_sdk_type": "enumeration"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "group",
+                    "sdk_type": "uint16_t"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "element",
+                    "sdk_type": "uint16_t"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_enumeration": "OrthancPluginValueRepresentation",
+                    "sdk_name": "vr",
+                    "sdk_type": "enumeration"
+                },
+                {
+                    "name": "arg3",
+                    "sdk_name": "name",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg4",
+                    "sdk_name": "minMultiplicity",
+                    "sdk_type": "uint32_t"
+                },
+                {
+                    "name": "arg5",
+                    "sdk_name": "maxMultiplicity",
+                    "sdk_type": "uint32_t"
+                },
+                {
+                    "name": "arg6",
+                    "sdk_name": "privateCreator",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginRegisterPrivateDictionaryTag",
+            "documentation": {
+                "args": {
+                    "element": "The element of the tag.",
+                    "group": "The group of the tag.",
+                    "maxMultiplicity": "The maximum multiplicity of the tag. A value of 0 means an arbitrary multiplicity (\"\"n\"\").",
+                    "minMultiplicity": "The minimum multiplicity of the tag (must be above 0).",
+                    "name": "The nickname of the tag.",
+                    "privateCreator": "The private creator of this private tag.",
+                    "vr": "The value representation of the tag."
+                },
+                "description": [
+                    "This function declares a new private tag in the dictionary of DICOM tags that are known to Orthanc. This function should be used in the OrthancPluginInitialize() callback."
+                ],
+                "return": "0 if success, other value if error.",
+                "summary": "Register a new private tag into the DICOM dictionary."
+            },
+            "return_sdk_enumeration": "OrthancPluginErrorCode",
+            "return_sdk_type": "enumeration"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "buffer",
+                    "sdk_type": "const_void_pointer_with_size"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_enumeration": "OrthancPluginDicomToJsonFormat",
+                    "sdk_name": "format",
+                    "sdk_type": "enumeration"
+                },
+                {
+                    "name": "arg3",
+                    "sdk_enumeration": "OrthancPluginDicomToJsonFlags",
+                    "sdk_name": "flags",
+                    "sdk_type": "enumeration"
+                },
+                {
+                    "name": "arg4",
+                    "sdk_name": "maxStringLength",
+                    "sdk_type": "uint32_t"
+                }
+            ],
+            "c_function": "OrthancPluginDicomBufferToJson",
+            "documentation": {
+                "args": {
+                    "buffer": "The memory buffer containing the DICOM file.",
+                    "flags": "Flags governing the output.",
+                    "format": "The output format.",
+                    "maxStringLength": "The maximum length of a field. Too long fields will be output as \"null\". The 0 value means no maximum length.",
+                    "size": "The size of the memory buffer."
+                },
+                "description": [
+                    "This function takes as input a memory buffer containing a DICOM file, and outputs a JSON string representing the tags of this DICOM file."
+                ],
+                "return": "The NULL value if the case of an error, or the JSON string. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Format a DICOM memory buffer as a JSON string."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "instanceId",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_enumeration": "OrthancPluginDicomToJsonFormat",
+                    "sdk_name": "format",
+                    "sdk_type": "enumeration"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_enumeration": "OrthancPluginDicomToJsonFlags",
+                    "sdk_name": "flags",
+                    "sdk_type": "enumeration"
+                },
+                {
+                    "name": "arg3",
+                    "sdk_name": "maxStringLength",
+                    "sdk_type": "uint32_t"
+                }
+            ],
+            "c_function": "OrthancPluginDicomInstanceToJson",
+            "documentation": {
+                "args": {
+                    "flags": "Flags governing the output.",
+                    "format": "The output format.",
+                    "instanceId": "The Orthanc identifier of the instance.",
+                    "maxStringLength": "The maximum length of a field. Too long fields will be output as \"null\". The 0 value means no maximum length."
+                },
+                "description": [
+                    "This function formats a DICOM instance that is stored in Orthanc, and outputs a JSON string representing the tags of this DICOM instance."
+                ],
+                "return": "The NULL value if the case of an error, or the JSON string. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Format a DICOM instance as a JSON string."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "json",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_class": "OrthancPluginImage",
+                    "sdk_name": "pixelData",
+                    "sdk_type": "const_object"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_enumeration": "OrthancPluginCreateDicomFlags",
+                    "sdk_name": "flags",
+                    "sdk_type": "enumeration"
+                }
+            ],
+            "c_function": "OrthancPluginCreateDicom",
+            "documentation": {
+                "args": {
+                    "flags": "Flags governing the output.",
+                    "json": "The input JSON file.",
+                    "pixelData": "The image. Can be NULL, if the pixel data is encoded inside the JSON with the data URI scheme.",
+                    "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer()."
+                },
+                "description": [
+                    "This function takes as input a string containing a JSON file describing the content of a DICOM instance. As an output, it writes the corresponding DICOM instance to a newly allocated memory buffer. Additionally, an image to be encoded within the DICOM instance can also be provided.",
+                    "Private tags will be associated with the private creator whose value is specified in the \"DefaultPrivateCreator\" configuration option of Orthanc. The function OrthancPluginCreateDicom2() can be used if another private creator must be used to create this instance."
+                ],
+                "return": "0 if success, other value if error.",
+                "summary": "Create a DICOM instance from a JSON string and an image."
+            },
+            "return_sdk_type": "OrthancPluginMemoryBuffer *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_enumeration": "OrthancPluginPixelFormat",
+                    "sdk_name": "format",
+                    "sdk_type": "enumeration"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "width",
+                    "sdk_type": "uint32_t"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_name": "height",
+                    "sdk_type": "uint32_t"
+                }
+            ],
+            "c_function": "OrthancPluginCreateImage",
+            "documentation": {
+                "args": {
+                    "format": "The format of the pixels.",
+                    "height": "The height of the image.",
+                    "width": "The width of the image."
+                },
+                "description": [
+                    "This function creates an image of given size and format."
+                ],
+                "return": "The newly allocated image. It must be freed with OrthancPluginFreeImage().",
+                "summary": "Create an image."
+            },
+            "return_sdk_class": "OrthancPluginImage",
+            "return_sdk_type": "object"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "buffer",
+                    "sdk_type": "const_void_pointer_with_size"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_name": "frameIndex",
+                    "sdk_type": "uint32_t"
+                }
+            ],
+            "c_function": "OrthancPluginDecodeDicomImage",
+            "documentation": {
+                "args": {
+                    "buffer": "Pointer to a memory buffer containing the DICOM image.",
+                    "bufferSize": "Size of the memory buffer containing the DICOM image.",
+                    "frameIndex": "The index of the frame of interest in a multi-frame image."
+                },
+                "description": [
+                    "This function decodes one frame of a DICOM image that is stored in a memory buffer. This function will give the same result as OrthancPluginUncompressImage() for single-frame DICOM images."
+                ],
+                "return": "The uncompressed image. It must be freed with OrthancPluginFreeImage().",
+                "summary": "Decode one frame from a DICOM instance."
+            },
+            "return_sdk_class": "OrthancPluginImage",
+            "return_sdk_type": "object"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "buffer",
+                    "sdk_type": "const_void_pointer_with_size"
+                }
+            ],
+            "c_function": "OrthancPluginComputeMd5",
+            "documentation": {
+                "args": {
+                    "buffer": "The source memory buffer.",
+                    "size": "The size in bytes of the source buffer."
+                },
+                "description": [
+                    "This functions computes the MD5 cryptographic hash of the given memory buffer."
+                ],
+                "return": "The NULL value in case of error, or a string containing the cryptographic hash. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Compute an MD5 hash."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "buffer",
+                    "sdk_type": "const_void_pointer_with_size"
+                }
+            ],
+            "c_function": "OrthancPluginComputeSha1",
+            "documentation": {
+                "args": {
+                    "buffer": "The source memory buffer.",
+                    "size": "The size in bytes of the source buffer."
+                },
+                "description": [
+                    "This functions computes the SHA-1 cryptographic hash of the given memory buffer."
+                ],
+                "return": "The NULL value in case of error, or a string containing the cryptographic hash. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Compute a SHA-1 hash."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [],
+            "c_function": "OrthancPluginGenerateUuid",
+            "documentation": {
+                "args": {},
+                "description": [
+                    "Generate a random GUID/UUID (globally unique identifier)."
+                ],
+                "return": "NULL in the case of an error, or a newly allocated string containing the UUID. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Generate an UUID."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "query",
+                    "sdk_type": "const_void_pointer_with_size"
+                }
+            ],
+            "c_function": "OrthancPluginCreateFindMatcher",
+            "documentation": {
+                "args": {
+                    "query": "The C-Find DICOM query.",
+                    "size": "The size of the DICOM query."
+                },
+                "description": [
+                    "This function creates a \"matcher\" object that can be used to check whether a DICOM instance matches a C-Find query. The C-Find query must be expressed as a DICOM buffer."
+                ],
+                "return": "The newly allocated matcher. It must be freed with OrthancPluginFreeFindMatcher().",
+                "summary": "Create a C-Find matcher."
+            },
+            "return_sdk_class": "OrthancPluginFindMatcher",
+            "return_sdk_type": "object"
+        },
+        {
+            "args": [],
+            "c_function": "OrthancPluginGetPeers",
+            "documentation": {
+                "args": {},
+                "description": [
+                    "This function returns the parameters of the Orthanc peers that are known to the Orthanc server hosting the plugin."
+                ],
+                "return": "NULL if error, or a newly allocated opaque data structure containing the peers. This structure must be freed with OrthancPluginFreePeers().",
+                "summary": "Return the list of available Orthanc peers."
+            },
+            "return_sdk_class": "OrthancPluginPeers",
+            "return_sdk_type": "object"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "path",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginAutodetectMimeType",
+            "documentation": {
+                "args": {
+                    "path": "Path to the file."
+                },
+                "description": [
+                    "This function returns the MIME type of a file by inspecting its extension."
+                ],
+                "return": "The MIME type. This is a statically-allocated string, do not free it.",
+                "summary": "Detect the MIME type of a file."
+            },
+            "return_sdk_type": "const char *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "name",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "value",
+                    "sdk_type": "float"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_enumeration": "OrthancPluginMetricsType",
+                    "sdk_name": "type",
+                    "sdk_type": "enumeration"
+                }
+            ],
+            "c_function": "OrthancPluginSetMetricsValue",
+            "documentation": {
+                "args": {
+                    "name": "The name of the metrics to be set.",
+                    "type": "The type of the metrics. This parameter is only taken into consideration the first time this metrics is set.",
+                    "value": "The value of the metrics."
+                },
+                "description": [
+                    "This function sets the value of a metrics to monitor the behavior of the plugin through tools such as Prometheus. The values of all the metrics are stored within the Orthanc context."
+                ],
+                "summary": "Set the value of a metrics."
+            },
+            "return_sdk_type": "void"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "group",
+                    "sdk_type": "uint16_t"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_name": "element",
+                    "sdk_type": "uint16_t"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_name": "privateCreator",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginGetTagName",
+            "documentation": {
+                "args": {
+                    "element": "The element of the tag.",
+                    "group": "The group of the tag.",
+                    "privateCreator": "For private tags, the name of the private creator (can be NULL)."
+                },
+                "description": [
+                    "This function makes a lookup to the dictionary of DICOM tags that are known to Orthanc, and returns the symbolic name of a DICOM tag."
+                ],
+                "return": "NULL in the case of an error, or a newly allocated string containing the path. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Returns the symbolic name of a DICOM tag."
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "buffer",
+                    "sdk_type": "const_void_pointer_with_size"
+                }
+            ],
+            "c_function": "OrthancPluginCreateDicomInstance",
+            "documentation": {
+                "args": {
+                    "buffer": "The memory buffer containing the DICOM instance.",
+                    "size": "The size of the memory buffer."
+                },
+                "description": [
+                    "This function parses a memory buffer that contains a DICOM file. The function returns a new pointer to a data structure that is managed by the Orthanc core."
+                ],
+                "return": "The newly allocated DICOM instance. It must be freed with OrthancPluginFreeDicomInstance().",
+                "summary": "Parse a DICOM instance."
+            },
+            "return_sdk_class": "OrthancPluginDicomInstance",
+            "return_sdk_type": "object"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "buffer",
+                    "sdk_type": "const_void_pointer_with_size"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_name": "transferSyntax",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginTranscodeDicomInstance",
+            "documentation": {
+                "args": {
+                    "buffer": "The memory buffer containing the DICOM instance.",
+                    "size": "The size of the memory buffer.",
+                    "transferSyntax": "The transfer syntax UID for the transcoding."
+                },
+                "description": [
+                    "This function parses a memory buffer that contains a DICOM file, then transcodes it to the given transfer syntax. The function returns a new pointer to a data structure that is managed by the Orthanc core."
+                ],
+                "return": "The newly allocated DICOM instance. It must be freed with OrthancPluginFreeDicomInstance().",
+                "summary": "Parse and transcode a DICOM instance."
+            },
+            "return_sdk_class": "OrthancPluginDicomInstance",
+            "return_sdk_type": "object"
+        },
+        {
+            "args": [],
+            "c_function": "OrthancPluginGenerateRestApiAuthorizationToken",
+            "documentation": {
+                "args": {},
+                "description": [
+                    "This function generates a token that can be set in the HTTP header \"Authorization\" so as to grant full access to the REST API of Orthanc using an external HTTP client. Using this function avoids the need of adding a separate user in the \"RegisteredUsers\" configuration of Orthanc, which eases deployments.",
+                    "This feature is notably useful in multiprocess scenarios, where a subprocess created by a plugin has no access to the \"OrthancPluginContext\", and thus cannot call \"OrthancPluginRestApi[Get|Post|Put|Delete]()\".",
+                    "This situation is frequently encountered in Python plugins, where the \"multiprocessing\" package can be used to bypass the Global Interpreter Lock (GIL) and thus to improve performance and concurrency."
+                ],
+                "return": "The authorization token, or NULL value in the case of an error. This string must be freed by OrthancPluginFreeString().",
+                "summary": "Generate a token to grant full access to the REST API of Orthanc"
+            },
+            "return_sdk_type": "char *"
+        },
+        {
+            "args": [
+                {
+                    "name": "arg0",
+                    "sdk_name": "json",
+                    "sdk_type": "const char *"
+                },
+                {
+                    "name": "arg1",
+                    "sdk_class": "OrthancPluginImage",
+                    "sdk_name": "pixelData",
+                    "sdk_type": "const_object"
+                },
+                {
+                    "name": "arg2",
+                    "sdk_enumeration": "OrthancPluginCreateDicomFlags",
+                    "sdk_name": "flags",
+                    "sdk_type": "enumeration"
+                },
+                {
+                    "name": "arg3",
+                    "sdk_name": "privateCreator",
+                    "sdk_type": "const char *"
+                }
+            ],
+            "c_function": "OrthancPluginCreateDicom2",
+            "documentation": {
+                "args": {
+                    "flags": "Flags governing the output.",
+                    "json": "The input JSON file.",
+                    "pixelData": "The image. Can be NULL, if the pixel data is encoded inside the JSON with the data URI scheme.",
+                    "privateCreator": "The private creator to be used for the private DICOM tags. Check out the global configuration option \"Dictionary\" of Orthanc.",
+                    "target": "The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer()."
+                },
+                "description": [
+                    "This function takes as input a string containing a JSON file describing the content of a DICOM instance. As an output, it writes the corresponding DICOM instance to a newly allocated memory buffer. Additionally, an image to be encoded within the DICOM instance can also be provided.",
+                    "Contrarily to the function OrthancPluginCreateDicom(), this function can be explicitly provided with a private creator."
+                ],
+                "return": "0 if success, other value if error.",
+                "summary": "Create a DICOM instance from a JSON string and an image, with a private creator."
+            },
+            "return_sdk_type": "OrthancPluginMemoryBuffer *"
+        }
+    ]
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CodeGeneration/CodeModel.json.license	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,2 @@
+# SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+# SPDX-License-Identifier: GPL-3.0-or-later
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CodeGeneration/CppNativeSDK.mustache	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,175 @@
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
+{{#functions}}
+
+JNIEXPORT {{return.c_type}} JNI_{{c_function}}(JNIEnv* env, jobject sdkObject{{#class_name}}, jlong self{{/class_name}}{{#args}}, {{c_type}} {{name}}{{/args}})
+{
+  try
+  {
+{{#args}}
+{{#convert_string}}
+    JavaString c_{{name}}(env, {{name}});
+{{/convert_string}}
+{{#convert_bytes}}
+    JavaBytes c_{{name}}(env, {{name}});
+{{/convert_bytes}}
+{{/args}}
+  
+{{#return.is_void}}
+    {{c_function}}(context_
+      {{#class_name}}, reinterpret_cast<{{class_name}}*>(static_cast<intptr_t>(self)){{/class_name}}
+      {{#args}}, {{c_accessor}}{{/args}});
+{{/return.is_void}}
+  
+{{#return.is_exception}}
+    OrthancPluginErrorCode code = {{c_function}}(context_
+      {{#class_name}}, reinterpret_cast<{{class_name}}*>(static_cast<intptr_t>(self)){{/class_name}}
+      {{#args}}, {{c_accessor}}{{/args}});
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+{{/return.is_exception}}
+  
+{{#return.is_number}}
+    return {{c_function}}(context_
+      {{#class_name}}, reinterpret_cast<{{class_name}}*>(static_cast<intptr_t>(self)){{/class_name}}
+      {{#args}}, {{c_accessor}}{{/args}});
+{{/return.is_number}}
+  
+{{#return.is_static_string}}
+    const char* s = {{c_function}}(context_
+      {{#class_name}}, reinterpret_cast<{{class_name}}*>(static_cast<intptr_t>(self)){{/class_name}}
+      {{#args}}, {{c_accessor}}{{/args}});
+    if (s == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      return env->NewStringUTF(s);
+    }
+{{/return.is_static_string}}
+  
+{{#return.is_dynamic_string}}
+    OrthancString s({{c_function}}(context_
+      {{#class_name}}, reinterpret_cast<{{class_name}}*>(static_cast<intptr_t>(self)){{/class_name}}
+      {{#args}}, {{c_accessor}}{{/args}}));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+{{/return.is_dynamic_string}}
+  
+{{#return.is_bytes}}
+    OrthancBytes b;
+    OrthancPluginErrorCode code = {{c_function}}(context_, b.GetMemoryBuffer()
+      {{#class_name}}, reinterpret_cast<{{class_name}}*>(static_cast<intptr_t>(self)){{/class_name}}
+      {{#args}}, {{c_accessor}}{{/args}});
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+{{/return.is_bytes}}
+  
+{{#return.is_object}}
+    {{return.class_name}}* answer = {{c_function}}(context_
+      {{#class_name}}, reinterpret_cast<{{class_name}}*>(static_cast<intptr_t>(self)){{/class_name}}
+      {{#args}}, {{c_accessor}}{{/args}});
+    if (answer == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return 0;
+    }
+    else
+    {
+      return reinterpret_cast<intptr_t>(answer);
+    }
+{{/return.is_object}}
+  
+{{#return.is_enumeration}}
+    return {{c_function}}(context_
+      {{#class_name}}, reinterpret_cast<{{class_name}}*>(static_cast<intptr_t>(self)){{/class_name}}
+      {{#args}}, {{c_accessor}}{{/args}});
+{{/return.is_enumeration}}
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    {{#return.default_value}}return {{return.default_value}};{{/return.default_value}}
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    {{#return.default_value}}return {{return.default_value}};{{/return.default_value}}
+  }
+}
+
+{{/functions}}
+
+static void JNI_LoadNatives(std::vector<JNINativeMethod>& methods)
+{
+  methods.clear();
+{{#functions}}
+
+{{#java_signature}}
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("{{c_function}}"),
+    const_cast<char*>("{{java_signature}}"),
+    (void*) JNI_{{c_function}}
+  });
+{{/java_signature}}
+{{/functions}}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CodeGeneration/JavaClass.mustache	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,105 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+{{#has_documentation}}
+/**
+ * {{documentation}}
+ **/
+{{/has_documentation}}
+public class {{class_name}} {
+    private long self;
+
+    /**
+     * Construct a Java object wrapping a C object that is managed by Orthanc.
+     * @param self Pointer to the C object.
+     **/
+    protected {{class_name}}(long self) {
+        if (self == 0) {
+            throw new IllegalArgumentException("Null pointer");
+        } else {
+            this.self = self;
+        }
+    }
+
+    /**
+     * Return the C object that is associated with this Java wrapper.
+     * @return Pointer to the C object.
+     **/
+    protected long getSelf() {
+        return self;
+    }
+
+    {{#destructor}}
+    @Override
+    protected void finalize() throws Throwable {
+        dispose();
+        super.finalize();
+    }
+
+    /**
+     * Manually deallocate the C object that is associated with this Java wrapper.
+     *
+     * This method can be used to immediately deallocate the C object,
+     * instead of waiting for the garbage collector to dispose the Java wrapper.
+     **/
+    public void dispose() {
+        if (self != 0) {
+            NativeSDK.{{destructor}}(self);
+            self = 0;
+        }
+    }
+    {{/destructor}}
+
+    {{#constructors}}
+    {{#has_documentation}}
+    /**
+    {{#documentation}}
+     * {{line}}
+    {{/documentation}}
+     **/
+    {{/has_documentation}}
+    public static {{return.java_wrapper_type}} {{java_name}}({{#args}}
+        {{java_wrapper_type}} {{sdk_name}}{{^last}},{{/last}}{{/args}}) {
+        return new {{return.java_wrapper_type}}(NativeSDK.{{c_function}}({{#args}}{{java_wrapper_accessor}}{{^last}}, {{/last}}{{/args}}){{java_return_end}};
+    }
+
+    {{/constructors}}
+
+    {{#methods}}
+    {{#has_documentation}}
+    /**
+    {{#documentation}}
+     * {{line}}
+    {{/documentation}}
+     **/
+    {{/has_documentation}}
+    public {{return.java_wrapper_type}} {{java_name}}({{#args}}
+        {{java_wrapper_type}} {{sdk_name}}{{^last}},{{/last}}{{/args}}) {
+        {{java_return_start}}NativeSDK.{{c_function}}(self{{#has_args}}, {{/has_args}}{{#args}}{{java_wrapper_accessor}}{{^last}}, {{/last}}{{/args}}){{java_return_end}};
+    }
+
+    {{/methods}}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CodeGeneration/JavaEnumeration.mustache	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,74 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+{{#has_documentation}}
+/**
+{{#documentation}}
+ * {{line}}
+{{/documentation}}
+ **/
+{{/has_documentation}}
+public enum {{short_name}} {
+    {{#values}}
+    {{#has_documentation}}
+    /**
+    {{#documentation}}
+     * {{line}}
+    {{/documentation}}
+     **/
+    {{/has_documentation}}
+    {{key}}({{value}}){{^last}},{{/last}}{{#last}};{{/last}}
+    {{/values}}
+
+    private int value;
+
+    private {{short_name}}(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static {{short_name}} getInstance(int value) {
+        {{#values}}
+        if (value == {{value}}) {
+            return {{key}};
+        }
+        {{/values}}
+
+        throw new IllegalArgumentException("Value out of range for enumeration {{short_name}}: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CodeGeneration/JavaFunctions.mustache	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,48 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * Wrapper around the global functions provided by the Orthanc SDK.
+ **/
+public class Functions {
+
+    {{#functions}}
+    {{^is_object}}
+    {{#has_documentation}}
+    /**
+    {{#documentation}}
+     * {{line}}
+    {{/documentation}}
+     **/
+    {{/has_documentation}}
+    public static {{return.java_wrapper_type}} {{java_name}}({{#args}}
+        {{java_wrapper_type}} {{sdk_name}}{{^last}},{{/last}}{{/args}}) {
+        {{java_return_start}}NativeSDK.{{c_function}}({{#args}}{{java_wrapper_accessor}}{{^last}}, {{/last}}{{/args}}){{java_return_end}};
+    }
+
+    {{/is_object}}
+    {{/functions}}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CodeGeneration/JavaNativeSDK.mustache	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,31 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
+class NativeSDK {
+    {{#functions}}
+    public static native {{return.java_type}} {{c_function}}({{#class_name}}long self{{#has_args}},{{/has_args}} {{/class_name}}{{#args}}{{java_type}} {{name}}{{^last}}, {{/last}}{{/args}});
+    {{/functions}}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CodeGeneration/ParseOrthancSDK.py	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,555 @@
+#!/usr/bin/env python3
+
+# SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# Java plugin for Orthanc
+# Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+import argparse
+import clang.cindex
+import json
+import os
+import pprint
+import pystache
+import re
+import sys
+
+
+ROOT = os.path.dirname(os.path.realpath(sys.argv[0]))
+
+
+parser = argparse.ArgumentParser(description = 'Parse the Orthanc SDK.')
+parser.add_argument('--libclang',
+                    default = 'libclang-6.0.so.1',
+                    help = 'manually provides the path to the libclang shared library')
+parser.add_argument('--source',
+                    default = os.path.join(ROOT, '../Resources/Orthanc/Sdk-1.10.0/orthanc/OrthancCPlugin.h'),
+                    help = 'input path to the Orthanc SDK header')
+parser.add_argument('--target',
+                    default = os.path.join(ROOT, 'CodeModel.json'),
+                    help = 'target path to store the JSON code model')
+
+args = parser.parse_args()
+
+if len(args.libclang) != 0:
+    clang.cindex.Config.set_library_file(args.libclang)
+
+index = clang.cindex.Index.create()
+
+tu = index.parse(args.source, [ ])
+
+TARGET = os.path.realpath(args.target)
+
+
+
+SPECIAL_FUNCTIONS = [
+    'OrthancPluginCreateMemoryBuffer',
+    'OrthancPluginCreateMemoryBuffer64',
+    'OrthancPluginFreeMemoryBuffer',
+    'OrthancPluginFreeMemoryBuffer64',
+    'OrthancPluginFreeString',
+    ]
+
+
+
+# First, discover the classes and enumerations
+classes = {}
+enumerations = {}
+
+def ParseDocumentationLines(comment):
+    s = re.sub('^[ ]*/', '', comment)
+    s = re.sub('/[ ]*$', '', s)
+    s = re.sub('<tt>', '"', s)
+    s = re.sub('</tt>', '"', s)
+    return list(map(lambda x: re.sub('[ ]*\*+', '', x).strip(), s.splitlines()))
+
+def ParseEnumerationDocumentation(comment):
+    result = ''
+    for line in ParseDocumentationLines(comment):
+        if len(line) > 0 and not line.startswith('@'):
+            if len(result) == 0:
+                result = line
+            else:
+                result = result + ' ' + line
+    return result
+
+def ParseEnumValueDocumentation(comment):
+    m = re.match(r'/\*!<\s*(.*?)\s*\*/$', comment, re.MULTILINE)
+    if m != None:
+        return m.group(1)
+    else:
+        result = ''
+        for line in ParseDocumentationLines(comment):
+            if len(line) > 0:
+                if len(result) == 0:
+                    result = line
+                else:
+                    result = result + ' ' + line
+        return result.replace('@brief ', '')
+
+for node in tu.cursor.get_children():
+    # Only consider the Orthanc SDK
+    path = node.location.file.name
+    if os.path.split(path) [-1] != 'OrthancCPlugin.h':
+        continue
+
+    if node.kind == clang.cindex.CursorKind.ENUM_DECL:
+        if node.type.spelling.startswith('OrthancPlugin'):
+            name = node.type.spelling
+
+            if name in enumerations:
+                raise Exception('Enumeration declared twice: %s' % name)
+
+            if node.raw_comment == None:
+                raise Exception('Enumeration without documentation: %s' % name)
+
+            values = []
+            for item in node.get_children():
+                if (item.kind == clang.cindex.CursorKind.ENUM_CONSTANT_DECL and
+                    item.spelling.startswith(name + '_')):
+
+                    if item.raw_comment == None:
+                        raise Exception('Enumeration value without documentation: %s' % item.spelling)
+
+                    key = item.spelling[len(name + '_'):]
+                    values.append({
+                        'key' : key,
+                        'value' : item.enum_value,
+                        'documentation' : ParseEnumValueDocumentation(item.raw_comment),
+                    })
+
+                elif (item.kind == clang.cindex.CursorKind.ENUM_CONSTANT_DECL and
+                      item.spelling == '_%s_INTERNAL' % name):
+                    pass
+
+                else:
+                    raise Exception('Ignoring unknown enumeration item: %s' % item.spelling)
+
+            enumerations[name] = {
+                'values' : values,
+                'documentation' : ParseEnumerationDocumentation(node.raw_comment),
+            }
+
+        elif node.spelling == '':  # Unnamed enumeration (presumbaly "_OrthancPluginService")
+            pass
+
+        else:
+            raise Exception('Ignoring unknown enumeration: %s' % node.spelling)
+
+    elif node.kind == clang.cindex.CursorKind.STRUCT_DECL:
+        if (node.spelling.startswith('_OrthancPlugin') and
+            node.spelling.endswith('_t') and
+            node.spelling != '_OrthancPluginContext_t'):
+
+            name = node.spelling[len('_') : -len('_t')]
+            classes[name] = {
+                'name' : name,
+                'methods' : [ ],
+            }
+
+        elif node.spelling in [ '',  # This is an internal structure to call Orthanc SDK
+                                '_OrthancPluginContext_t' ]:
+            pass
+
+        else:
+            raise Exception('Ignoring unknown structure: %s' % node.spelling)
+
+
+# Secondly, loop over the C functions and categorize them either as
+# method, or as global functions
+
+
+def RemovePrefix(prefix, s):
+    if not s.startswith(prefix):
+        raise Exception('String "%s" does not start with prefix "%s"' % (s, prefix))
+    else:
+        return s[len(prefix):]
+
+
+def IsClassType(t):
+    return (t.kind == clang.cindex.TypeKind.POINTER and
+            not t.get_pointee().is_const_qualified() and
+            t.get_pointee().spelling in classes)
+
+
+def IsConstClassType(t):
+    return (t.kind == clang.cindex.TypeKind.POINTER and
+            t.get_pointee().is_const_qualified() and
+            t.get_pointee().spelling.startswith('const ') and
+            t.get_pointee().spelling[len('const '):] in classes)
+
+
+def EncodeArguments(target, args):
+    assert(type(target) is dict)
+    result = []
+
+    i = 0
+    while i < len(args):
+        arg = {
+            'name' : 'arg%d' % i,
+            'sdk_name' : args[i].spelling,
+            'sdk_type' : args[i].type.spelling,
+            }
+
+        if (i + 1 < len(args) and
+            args[i].type.spelling == 'const void *' and
+            args[i + 1].type.spelling == 'uint32_t'):
+
+            arg['sdk_type'] = 'const_void_pointer_with_size'
+
+            # Skip the size argument
+            i += 1
+
+        elif arg['sdk_type'] in [ 'float',
+                                  'int32_t',
+                                  'uint8_t',
+                                  'uint16_t',
+                                  'uint32_t',
+                                  'uint64_t',
+                                  'const char *',
+                                  'const void *' ]:
+            pass
+
+        elif arg['sdk_type'] in enumerations:
+            arg['sdk_type'] = 'enumeration'
+            arg['sdk_enumeration'] = args[i].type.spelling
+
+        elif IsClassType(args[i].type):
+            arg['sdk_type'] = 'object'
+            arg['sdk_class'] = args[i].type.get_pointee().spelling
+
+        elif IsConstClassType(args[i].type):
+            arg['sdk_type'] = 'const_object'
+            arg['sdk_class'] = RemovePrefix('const ', args[i].type.get_pointee().spelling)
+
+        else:
+            print('[WARNING] Unsupported argument type in a method (%s), cannot wrap: %s' % (
+                args[i].type.spelling, node.spelling))
+            return False
+
+        result.append(arg)
+        i += 1
+
+    target['args'] = result
+    return True
+
+
+def EncodeResultType(target, returnBufferType, t):
+    assert(type(target) is dict)
+    assert('args' in target)
+
+    target['return_sdk_type'] = t.spelling
+
+    if returnBufferType != None:
+        target['return_sdk_type'] = returnBufferType
+        return True
+
+    elif target['return_sdk_type'] in [ 'void',
+                                        'int32_t',
+                                        'uint32_t',
+                                        'int64_t',
+                                        'char *',
+                                        'const char *' ]:
+        return True
+
+    elif target['return_sdk_type'] in enumerations:
+        target['return_sdk_type'] = 'enumeration'
+        target['return_sdk_enumeration'] = t.spelling
+        return True
+
+    elif IsClassType(t):
+        target['return_sdk_type'] = 'object'
+        target['return_sdk_class'] = t.get_pointee().spelling
+        return True
+
+    else:
+        return False
+
+
+def ParseFunctionDocumentation(comment):
+    lines = ParseDocumentationLines(comment)
+
+    sections = []
+    currentType = None
+    currentSection = None
+
+    for i in range(len(lines)):
+        if lines[i].find('@') > 0:
+            raise Exception('Character "@" not occurring at the beggining of a documentation paragraph')
+
+        if (len(lines[i]) == 0 and
+            currentType == None):
+            continue
+
+        m = re.match(r'^@([a-z]+)\s*', lines[i])
+
+        if m == None:
+            if currentType == None:
+                print(comment)
+                raise Exception('Documentation does not begin with a "@"')
+
+            assert(currentSection != None)
+            currentSection.append(lines[i])
+        else:
+            if currentType != None:
+                sections.append({
+                    'type' : currentType,
+                    'lines' : currentSection,
+                    })
+
+            currentType = m.group(1)
+            currentSection = [ lines[i][m.span() [1] : ] ]
+
+    if currentType == None:
+        raise Exception('Empty documentation')
+
+    sections.append({
+        'type' : currentType,
+        'lines' : currentSection,
+    })
+
+    for i in range(len(sections)):
+        paragraphs = []
+        lines = sections[i]['lines']
+        currentParagraph = ''
+        for j in range(len(lines)):
+            if len(lines[j]) == 0:
+                if currentParagraph != '':
+                    paragraphs.append(currentParagraph)
+                currentParagraph = ''
+            else:
+                if currentParagraph == '':
+                    currentParagraph = lines[j]
+                else:
+                    currentParagraph = '%s %s' % (currentParagraph, lines[j])
+        if currentParagraph != '':
+            paragraphs.append(currentParagraph)
+
+        sections[i]['paragraphs'] = paragraphs
+
+    documentation = {
+        'args' : {}
+    }
+
+    for i in range(len(sections)):
+        t = sections[i]['type']
+        paragraphs = sections[i]['paragraphs']
+
+        if t == 'brief':
+            if len(paragraphs) < 1:
+                raise Exception('Bad @brief')
+
+            documentation['summary'] = paragraphs[0]
+            documentation['description'] = paragraphs[1:]
+
+        elif t in [ 'return', 'result' ]:
+            if len(paragraphs) != 1:
+                raise Exception('Bad @return')
+
+            documentation['return'] = paragraphs[0]
+
+        elif t == 'param':
+            if len(paragraphs) != 1:
+                raise Exception('Bad @param')
+
+            m = re.match(r'^([a-zA-Z0-9]+)\s+(.+)', paragraphs[0])
+            if m == None:
+                raise Exception('Bad @param')
+
+            key = m.group(1)
+            value = m.group(2)
+            if (len(key) == 0 or
+                len(value) == 0):
+                raise Exception('Bad @param')
+
+            if key in documentation['args']:
+                raise Exception('Twice the same parameter: %s' % key)
+
+            documentation['args'][key] = value
+
+        elif t == 'warning':
+            if not 'description' in documentation:
+                raise Exception('@warning before @summary')
+
+            if len(paragraphs) == 0:
+                raise Exception('Bad @warning')
+
+            for j in range(len(paragraphs)):
+                if j == 0:
+                    documentation['description'].append('Warning: %s' % paragraphs[j])
+                else:
+                    documentation['description'].append(paragraphs[j])
+
+        elif t == 'note':
+            if not 'description' in documentation:
+                raise Exception('@note before @summary')
+
+            if len(paragraphs) == 0:
+                raise Exception('Bad @note')
+
+            for j in range(len(paragraphs)):
+                if j == 0:
+                    documentation['description'].append('Remark: %s' % paragraphs[j])
+                else:
+                    documentation['description'].append(paragraphs[j])
+
+        elif t in [
+                'deprecated',
+                'ingroup',
+                'see',
+        ]:
+            pass
+
+        else:
+            raise Exception('Unsupported documentation token: @%s' % t)
+
+    return documentation
+
+
+globalFunctions = []
+countWrappedFunctions = 0
+countAllFunctions = 0
+
+for node in tu.cursor.get_children():
+    # Only consider the Orthanc SDK
+    path = node.location.file.name
+    if os.path.split(path) [-1] != 'OrthancCPlugin.h':
+        continue
+
+    if (node.kind == clang.cindex.CursorKind.FUNCTION_DECL and
+        node.spelling.startswith('OrthancPlugin') and
+        not node.spelling in SPECIAL_FUNCTIONS):
+        args = list(filter(lambda x: x.kind == clang.cindex.CursorKind.PARM_DECL,
+                           node.get_children()))
+
+        # Check that the first argument is the Orthanc context
+        if (len(args) == 0 or
+            args[0].type.kind != clang.cindex.TypeKind.POINTER or
+            args[0].type.get_pointee().spelling != 'OrthancPluginContext'):
+            print('[INFO] Not in the Orthanc SDK: %s()' % node.spelling)
+            continue
+
+        countAllFunctions += 1
+
+        contextName = args[0].spelling
+        args = args[1:]  # Skip the Orthanc context
+
+        if (len(args) >= 1 and
+            args[0].type.spelling in [ 'OrthancPluginMemoryBuffer *',
+                                       'OrthancPluginMemoryBuffer64 *' ]):
+            # The method/function returns a byte array
+            returnBufferType = args[0].type.spelling
+            args = args[1:]
+        else:
+            returnBufferType = None
+
+        if (len(args) >= 1 and
+            (IsClassType(args[0].type) or
+             IsConstClassType(args[0].type))):
+
+            # This is a class method
+            cls = args[0].type.get_pointee().spelling
+            if IsConstClassType(args[0].type):
+                cls = RemovePrefix('const ', cls)
+
+            # Special case of destructors
+            if (len(args) == 1 and
+                not args[0].type.get_pointee().is_const_qualified() and
+                node.spelling.startswith('OrthancPluginFree')):
+                classes[cls]['destructor'] = node.spelling
+                countWrappedFunctions += 1
+
+            else:
+                if node.raw_comment == None:
+                    raise Exception('Method without documentation: %s' % node.spelling)
+
+                doc = ParseFunctionDocumentation(node.raw_comment)
+                del doc['args'][contextName]      # Remove OrthancPluginContext from documentation
+                del doc['args'][args[0].spelling] # Remove self from documentation
+
+                method = {
+                    'c_function' : node.spelling,
+                    'const' : args[0].type.get_pointee().is_const_qualified(),
+                    'documentation' : doc,
+                    }
+
+                if not EncodeArguments(method, args[1:]):
+                    pass
+                elif EncodeResultType(method, returnBufferType, node.result_type):
+                    classes[cls]['methods'].append(method)
+                    countWrappedFunctions += 1
+                else:
+                    print('[WARNING] Unsupported return type in a method (%s), cannot wrap: %s' % (
+                        node.result_type.spelling, node.spelling))
+
+        else:
+            # This is a global function
+            if node.raw_comment == None:
+                raise Exception('Global function without documentation: %s' % node.spelling)
+
+            doc = ParseFunctionDocumentation(node.raw_comment)
+            del doc['args'][contextName]  # Remove OrthancPluginContext from documentation
+
+            f = {
+                'c_function' : node.spelling,
+                'documentation' : doc,
+            }
+
+            if not EncodeArguments(f, args):
+                pass
+            elif EncodeResultType(f, returnBufferType, node.result_type):
+                globalFunctions.append(f)
+                countWrappedFunctions += 1
+            else:
+                print('[WARNING] Unsupported return type in a global function (%s), cannot wrap: %s' % (
+                    node.result_type.spelling, node.spelling))
+
+
+
+# Thirdly, export the code model
+
+def FlattenEnumerations():
+    result = []
+    for (name, content) in enumerations.items():
+        result.append({
+            'name' : name,
+            'values' : content['values'],
+            'documentation' : content['documentation'],
+            })
+    return result
+
+def FlattenDictionary(source):
+    result = []
+    for (name, value) in source.items():
+        result.append(value)
+    return result
+
+codeModel = {
+    'classes' : sorted(FlattenDictionary(classes), key = lambda x: x['name']),
+    'enumerations' : sorted(FlattenEnumerations(), key = lambda x: x['name']),
+    'global_functions' : globalFunctions,  # Global functions are ordered in the same order as in the C header
+    }
+
+
+with open(TARGET, 'w') as f:
+    f.write(json.dumps(codeModel, sort_keys = True, indent = 4))
+
+print('\nTotal functions in the SDK: %d' % countAllFunctions)
+print('Total wrapped functions: %d' % countWrappedFunctions)
+print('Coverage: %.0f%%' % (float(countWrappedFunctions) /
+                            float(countAllFunctions) * 100.0))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/CMakeLists.txt	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,47 @@
+# SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# Java plugin for Orthanc
+# Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+cmake_minimum_required(VERSION 3.0)
+
+project(OrthancJavaSDK)
+
+find_package(Java REQUIRED)
+include(UseJava)
+
+set(CMAKE_JAVA_COMPILE_FLAGS "-source" "1.8" "-target" "1.8" "-Xdoclint:all/protected")
+
+file(GLOB JAVA_SOURCES
+  ${CMAKE_SOURCE_DIR}/be/uclouvain/orthanc/*.java
+  )
+
+set(JAVADOC_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/Documentation")
+file(MAKE_DIRECTORY ${JAVADOC_OUTPUT_DIR})
+
+add_jar(OrthancJavaSDK
+  ${JAVA_SOURCES}
+  DEPENDS CreateJavadocDirectory
+  )
+
+add_custom_command(TARGET OrthancJavaSDK
+  POST_BUILD
+  COMMAND ${Java_JAVADOC_EXECUTABLE} -Xdoclint:all ${JAVA_SOURCES}
+  WORKING_DIRECTORY ${JAVADOC_OUTPUT_DIR}
+  COMMENT "Generating SDK documentation with javadoc" VERBATIM
+  )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/Callbacks.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,53 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+import java.util.Map;
+
+/**
+ * Wrapper around the callbacks provided by the Orthanc SDK.
+ **/
+public class Callbacks {
+    public interface OnChange {
+        public void call(ChangeType changeType,
+                         ResourceType resourceType,
+                         String resourceId);
+    }
+
+    public interface OnRestRequest {
+        public void call(RestOutput output,
+                         HttpMethod method,
+                         String uri,
+                         String[] regularExpressionGroups,
+                         Map<String, String> headers,
+                         Map<String, String> getParameters,
+                         byte[] body);
+    }
+
+    public static native void register(OnChange callback);
+
+    public static native void register(String pathRegularExpression,
+                                       OnRestRequest callback);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/ChangeType.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,188 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The supported types of changes that can be signaled to the change callback.
+ **/
+public enum ChangeType {
+    /**
+     * Series is now complete
+     **/
+    COMPLETED_SERIES(0),
+    /**
+     * Deleted resource
+     **/
+    DELETED(1),
+    /**
+     * A new instance was added to this resource
+     **/
+    NEW_CHILD_INSTANCE(2),
+    /**
+     * New instance received
+     **/
+    NEW_INSTANCE(3),
+    /**
+     * New patient created
+     **/
+    NEW_PATIENT(4),
+    /**
+     * New series created
+     **/
+    NEW_SERIES(5),
+    /**
+     * New study created
+     **/
+    NEW_STUDY(6),
+    /**
+     * Timeout: No new instance in this patient
+     **/
+    STABLE_PATIENT(7),
+    /**
+     * Timeout: No new instance in this series
+     **/
+    STABLE_SERIES(8),
+    /**
+     * Timeout: No new instance in this study
+     **/
+    STABLE_STUDY(9),
+    /**
+     * Orthanc has started
+     **/
+    ORTHANC_STARTED(10),
+    /**
+     * Orthanc is stopping
+     **/
+    ORTHANC_STOPPED(11),
+    /**
+     * Some user-defined attachment has changed for this resource
+     **/
+    UPDATED_ATTACHMENT(12),
+    /**
+     * Some user-defined metadata has changed for this resource
+     **/
+    UPDATED_METADATA(13),
+    /**
+     * The list of Orthanc peers has changed
+     **/
+    UPDATED_PEERS(14),
+    /**
+     * The list of DICOM modalities has changed
+     **/
+    UPDATED_MODALITIES(15),
+    /**
+     * New Job submitted
+     **/
+    JOB_SUBMITTED(16),
+    /**
+     * A Job has completed successfully
+     **/
+    JOB_SUCCESS(17),
+    /**
+     * A Job has failed
+     **/
+    JOB_FAILURE(18);
+
+    private int value;
+
+    private ChangeType(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static ChangeType getInstance(int value) {
+        if (value == 0) {
+            return COMPLETED_SERIES;
+        }
+        if (value == 1) {
+            return DELETED;
+        }
+        if (value == 2) {
+            return NEW_CHILD_INSTANCE;
+        }
+        if (value == 3) {
+            return NEW_INSTANCE;
+        }
+        if (value == 4) {
+            return NEW_PATIENT;
+        }
+        if (value == 5) {
+            return NEW_SERIES;
+        }
+        if (value == 6) {
+            return NEW_STUDY;
+        }
+        if (value == 7) {
+            return STABLE_PATIENT;
+        }
+        if (value == 8) {
+            return STABLE_SERIES;
+        }
+        if (value == 9) {
+            return STABLE_STUDY;
+        }
+        if (value == 10) {
+            return ORTHANC_STARTED;
+        }
+        if (value == 11) {
+            return ORTHANC_STOPPED;
+        }
+        if (value == 12) {
+            return UPDATED_ATTACHMENT;
+        }
+        if (value == 13) {
+            return UPDATED_METADATA;
+        }
+        if (value == 14) {
+            return UPDATED_PEERS;
+        }
+        if (value == 15) {
+            return UPDATED_MODALITIES;
+        }
+        if (value == 16) {
+            return JOB_SUBMITTED;
+        }
+        if (value == 17) {
+            return JOB_SUCCESS;
+        }
+        if (value == 18) {
+            return JOB_FAILURE;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration ChangeType: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/CompressionType.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,83 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The compression algorithms that are supported by the Orthanc core.
+ **/
+public enum CompressionType {
+    /**
+     * Standard zlib compression
+     **/
+    ZLIB(0),
+    /**
+     * zlib, prefixed with uncompressed size (uint64_t)
+     **/
+    ZLIB_WITH_SIZE(1),
+    /**
+     * Standard gzip compression
+     **/
+    GZIP(2),
+    /**
+     * gzip, prefixed with uncompressed size (uint64_t)
+     **/
+    GZIP_WITH_SIZE(3);
+
+    private int value;
+
+    private CompressionType(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static CompressionType getInstance(int value) {
+        if (value == 0) {
+            return ZLIB;
+        }
+        if (value == 1) {
+            return ZLIB_WITH_SIZE;
+        }
+        if (value == 2) {
+            return GZIP;
+        }
+        if (value == 3) {
+            return GZIP_WITH_SIZE;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration CompressionType: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/ConstraintType.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,91 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The constraints on the tags (main DICOM tags and identifier tags) that must be
+ * supported by the database plugins.
+ **/
+public enum ConstraintType {
+    /**
+     * Equal
+     **/
+    EQUAL(1),
+    /**
+     * Less or equal
+     **/
+    SMALLER_OR_EQUAL(2),
+    /**
+     * More or equal
+     **/
+    GREATER_OR_EQUAL(3),
+    /**
+     * Wildcard matching
+     **/
+    WILDCARD(4),
+    /**
+     * List of values
+     **/
+    LIST(5);
+
+    private int value;
+
+    private ConstraintType(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static ConstraintType getInstance(int value) {
+        if (value == 1) {
+            return EQUAL;
+        }
+        if (value == 2) {
+            return SMALLER_OR_EQUAL;
+        }
+        if (value == 3) {
+            return GREATER_OR_EQUAL;
+        }
+        if (value == 4) {
+            return WILDCARD;
+        }
+        if (value == 5) {
+            return LIST;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration ConstraintType: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/ContentType.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,83 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The content types that are supported by Orthanc plugins.
+ **/
+public enum ContentType {
+    /**
+     * Unknown content type
+     **/
+    UNKNOWN(0),
+    /**
+     * DICOM
+     **/
+    DICOM(1),
+    /**
+     * JSON summary of a DICOM file
+     **/
+    DICOM_AS_JSON(2),
+    /**
+     * DICOM Header till pixel data
+     **/
+    DICOM_UNTIL_PIXEL_DATA(3);
+
+    private int value;
+
+    private ContentType(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static ContentType getInstance(int value) {
+        if (value == 0) {
+            return UNKNOWN;
+        }
+        if (value == 1) {
+            return DICOM;
+        }
+        if (value == 2) {
+            return DICOM_AS_JSON;
+        }
+        if (value == 3) {
+            return DICOM_UNTIL_PIXEL_DATA;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration ContentType: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/CreateDicomFlags.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,76 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * Flags to the creation of a DICOM file.
+ **/
+public enum CreateDicomFlags {
+    /**
+     * Default mode
+     **/
+    NONE(0),
+    /**
+     * Decode fields encoded using data URI scheme
+     **/
+    DECODE_DATA_URI_SCHEME(1),
+    /**
+     * Automatically generate DICOM identifiers
+     **/
+    GENERATE_IDENTIFIERS(2);
+
+    private int value;
+
+    private CreateDicomFlags(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static CreateDicomFlags getInstance(int value) {
+        if (value == 0) {
+            return NONE;
+        }
+        if (value == 1) {
+            return DECODE_DATA_URI_SCHEME;
+        }
+        if (value == 2) {
+            return GENERATE_IDENTIFIERS;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration CreateDicomFlags: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/DicomInstance.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,296 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * DICOM instance managed by the Orthanc core
+ **/
+public class DicomInstance {
+    private long self;
+
+    /**
+     * Construct a Java object wrapping a C object that is managed by Orthanc.
+     * @param self Pointer to the C object.
+     **/
+    protected DicomInstance(long self) {
+        if (self == 0) {
+            throw new IllegalArgumentException("Null pointer");
+        } else {
+            this.self = self;
+        }
+    }
+
+    /**
+     * Return the C object that is associated with this Java wrapper.
+     * @return Pointer to the C object.
+     **/
+    protected long getSelf() {
+        return self;
+    }
+
+    @Override
+    protected void finalize() throws Throwable {
+        dispose();
+        super.finalize();
+    }
+
+    /**
+     * Manually deallocate the C object that is associated with this Java wrapper.
+     *
+     * This method can be used to immediately deallocate the C object,
+     * instead of waiting for the garbage collector to dispose the Java wrapper.
+     **/
+    public void dispose() {
+        if (self != 0) {
+            NativeSDK.OrthancPluginFreeDicomInstance(self);
+            self = 0;
+        }
+    }
+
+    /**
+     * Parse a DICOM instance.
+     * 
+     * This function parses a memory buffer that contains a DICOM file. The function
+     * returns a new pointer to a data structure that is managed by the Orthanc core.
+     * 
+     * @param buffer The memory buffer containing the DICOM instance.
+     * @return The newly constructed object.
+     **/
+    public static DicomInstance createDicomInstance(
+        byte[] buffer) {
+        return new DicomInstance(NativeSDK.OrthancPluginCreateDicomInstance(buffer));
+    }
+
+    /**
+     * Parse and transcode a DICOM instance.
+     * 
+     * This function parses a memory buffer that contains a DICOM file, then transcodes
+     * it to the given transfer syntax. The function returns a new pointer to a data
+     * structure that is managed by the Orthanc core.
+     * 
+     * @param buffer The memory buffer containing the DICOM instance.
+     * @param transferSyntax The transfer syntax UID for the transcoding.
+     * @return The newly constructed object.
+     **/
+    public static DicomInstance transcodeDicomInstance(
+        byte[] buffer,
+        String transferSyntax) {
+        return new DicomInstance(NativeSDK.OrthancPluginTranscodeDicomInstance(buffer, transferSyntax));
+    }
+
+
+    /**
+     * Get the AET of a DICOM instance.
+     * 
+     * This function returns the Application Entity Title (AET) of the DICOM modality
+     * from which a DICOM instance originates.
+     * 
+     * @return The resulting string.
+     **/
+    public String getInstanceRemoteAet() {
+        return NativeSDK.OrthancPluginGetInstanceRemoteAet(self);
+    }
+
+    /**
+     * Get the size of a DICOM file.
+     * 
+     * This function returns the number of bytes of the given DICOM instance.
+     * 
+     * @return The size of the file, -1 in case of error.
+     **/
+    public long getInstanceSize() {
+        return NativeSDK.OrthancPluginGetInstanceSize(self);
+    }
+
+    /**
+     * Get the DICOM tag hierarchy as a JSON file.
+     * 
+     * This function returns a pointer to a newly created string containing a JSON
+     * file. This JSON file encodes the tag hierarchy of the given DICOM instance.
+     * 
+     * @return The resulting string.
+     **/
+    public String getInstanceJson() {
+        return NativeSDK.OrthancPluginGetInstanceJson(self);
+    }
+
+    /**
+     * Get the DICOM tag hierarchy as a JSON file (with simplification).
+     * 
+     * This function returns a pointer to a newly created string containing a JSON
+     * file. This JSON file encodes the tag hierarchy of the given DICOM instance. In
+     * contrast with ::OrthancPluginGetInstanceJson(), the returned JSON file is in its
+     * simplified version.
+     * 
+     * @return The resulting string.
+     **/
+    public String getInstanceSimplifiedJson() {
+        return NativeSDK.OrthancPluginGetInstanceSimplifiedJson(self);
+    }
+
+    /**
+     * Check whether a DICOM instance is associated with some metadata.
+     * 
+     * This function checks whether the DICOM instance of interest is associated with
+     * some metadata. As of Orthanc 0.8.1, in the callbacks registered by
+     * ::OrthancPluginRegisterOnStoredInstanceCallback(), the only possibly available
+     * metadata are "ReceptionDate", "RemoteAET" and "IndexInSeries".
+     * 
+     * @param metadata The metadata of interest.
+     * @return 1 if the metadata is present, 0 if it is absent, -1 in case of error.
+     **/
+    public int hasInstanceMetadata(
+        String metadata) {
+        return NativeSDK.OrthancPluginHasInstanceMetadata(self, metadata);
+    }
+
+    /**
+     * Get the value of some metadata associated with a given DICOM instance.
+     * 
+     * This functions returns the value of some metadata that is associated with the
+     * DICOM instance of interest. Before calling this function, the existence of the
+     * metadata must have been checked with ::OrthancPluginHasInstanceMetadata().
+     * 
+     * @param metadata The metadata of interest.
+     * @return The resulting string.
+     **/
+    public String getInstanceMetadata(
+        String metadata) {
+        return NativeSDK.OrthancPluginGetInstanceMetadata(self, metadata);
+    }
+
+    /**
+     * Get the origin of a DICOM file.
+     * 
+     * This function returns the origin of a DICOM instance that has been received by
+     * Orthanc.
+     * 
+     * @return The origin of the instance.
+     **/
+    public InstanceOrigin getInstanceOrigin() {
+        return InstanceOrigin.getInstance(NativeSDK.OrthancPluginGetInstanceOrigin(self));
+    }
+
+    /**
+     * Get the transfer syntax of a DICOM file.
+     * 
+     * This function returns a pointer to a newly created string that contains the
+     * transfer syntax UID of the DICOM instance. The empty string might be returned if
+     * this information is unknown.
+     * 
+     * @return The resulting string.
+     **/
+    public String getInstanceTransferSyntaxUid() {
+        return NativeSDK.OrthancPluginGetInstanceTransferSyntaxUid(self);
+    }
+
+    /**
+     * Check whether the DICOM file has pixel data.
+     * 
+     * This function returns a Boolean value indicating whether the DICOM instance
+     * contains the pixel data (7FE0,0010) tag.
+     * 
+     * @return "1" if the DICOM instance contains pixel data, or "0" if the tag is
+     * missing, or "-1" in the case of an error.
+     **/
+    public int hasInstancePixelData() {
+        return NativeSDK.OrthancPluginHasInstancePixelData(self);
+    }
+
+    /**
+     * Get the number of frames in a DICOM instance.
+     * 
+     * This function returns the number of frames that are part of a DICOM image
+     * managed by the Orthanc core.
+     * 
+     * @return The number of frames (will be zero in the case of an error).
+     **/
+    public int getInstanceFramesCount() {
+        return NativeSDK.OrthancPluginGetInstanceFramesCount(self);
+    }
+
+    /**
+     * Get the raw content of a frame in a DICOM instance.
+     * 
+     * This function returns a memory buffer containing the raw content of a frame in a
+     * DICOM instance that is managed by the Orthanc core. This is notably useful for
+     * compressed transfer syntaxes, as it gives access to the embedded files (such as
+     * JPEG, JPEG-LS or JPEG2k). The Orthanc core transparently reassembles the
+     * fragments to extract the raw frame.
+     * 
+     * @param frameIndex The index of the frame of interest.
+     * @return The resulting memory buffer.
+     **/
+    public byte[] getInstanceRawFrame(
+        int frameIndex) {
+        return NativeSDK.OrthancPluginGetInstanceRawFrame(self, frameIndex);
+    }
+
+    /**
+     * Decode one frame from a DICOM instance.
+     * 
+     * This function decodes one frame of a DICOM image that is managed by the Orthanc
+     * core.
+     * 
+     * @param frameIndex The index of the frame of interest.
+     * @return The newly constructed object.
+     **/
+    public Image getInstanceDecodedFrame(
+        int frameIndex) {
+        return new Image(NativeSDK.OrthancPluginGetInstanceDecodedFrame(self, frameIndex));
+    }
+
+    /**
+     * Writes a DICOM instance to a memory buffer.
+     * 
+     * This function returns a memory buffer containing the serialization of a DICOM
+     * instance that is managed by the Orthanc core.
+     * 
+     * @return The resulting memory buffer.
+     **/
+    public byte[] serializeDicomInstance() {
+        return NativeSDK.OrthancPluginSerializeDicomInstance(self);
+    }
+
+    /**
+     * Format a DICOM memory buffer as a JSON string.
+     * 
+     * This function takes as DICOM instance managed by the Orthanc core, and outputs a
+     * JSON string representing the tags of this DICOM file.
+     * 
+     * @param format The output format.
+     * @param flags Flags governing the output.
+     * @param maxStringLength The maximum length of a field. Too long fields will be
+     * output as "null". The 0 value means no maximum length.
+     * @return The resulting string.
+     **/
+    public String getInstanceAdvancedJson(
+        DicomToJsonFormat format,
+        DicomToJsonFlags flags,
+        int maxStringLength) {
+        return NativeSDK.OrthancPluginGetInstanceAdvancedJson(self, format.getValue(), flags.getValue(), maxStringLength);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/DicomToJsonFlags.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,119 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * Flags to customize a DICOM-to-JSON conversion. By default, binary tags are
+ * formatted using Data URI scheme.
+ **/
+public enum DicomToJsonFlags {
+    /**
+     * Default formatting
+     **/
+    NONE(0),
+    /**
+     * Include the binary tags
+     **/
+    INCLUDE_BINARY(1),
+    /**
+     * Include the private tags
+     **/
+    INCLUDE_PRIVATE_TAGS(2),
+    /**
+     * Include the tags unknown by the dictionary
+     **/
+    INCLUDE_UNKNOWN_TAGS(4),
+    /**
+     * Include the pixel data
+     **/
+    INCLUDE_PIXEL_DATA(8),
+    /**
+     * Output binary tags as-is, dropping non-ASCII
+     **/
+    CONVERT_BINARY_TO_ASCII(16),
+    /**
+     * Signal binary tags as null values
+     **/
+    CONVERT_BINARY_TO_NULL(32),
+    /**
+     * Stop processing after pixel data (new in 1.9.1)
+     **/
+    STOP_AFTER_PIXEL_DATA(64),
+    /**
+     * Skip tags whose element is zero (new in 1.9.1)
+     **/
+    SKIP_GROUP_LENGTHS(128);
+
+    private int value;
+
+    private DicomToJsonFlags(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static DicomToJsonFlags getInstance(int value) {
+        if (value == 0) {
+            return NONE;
+        }
+        if (value == 1) {
+            return INCLUDE_BINARY;
+        }
+        if (value == 2) {
+            return INCLUDE_PRIVATE_TAGS;
+        }
+        if (value == 4) {
+            return INCLUDE_UNKNOWN_TAGS;
+        }
+        if (value == 8) {
+            return INCLUDE_PIXEL_DATA;
+        }
+        if (value == 16) {
+            return CONVERT_BINARY_TO_ASCII;
+        }
+        if (value == 32) {
+            return CONVERT_BINARY_TO_NULL;
+        }
+        if (value == 64) {
+            return STOP_AFTER_PIXEL_DATA;
+        }
+        if (value == 128) {
+            return SKIP_GROUP_LENGTHS;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration DicomToJsonFlags: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/DicomToJsonFormat.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,76 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The possible output formats for a DICOM-to-JSON conversion.
+ **/
+public enum DicomToJsonFormat {
+    /**
+     * Full output, with most details
+     **/
+    FULL(1),
+    /**
+     * Tags output as hexadecimal numbers
+     **/
+    SHORT(2),
+    /**
+     * Human-readable JSON
+     **/
+    HUMAN(3);
+
+    private int value;
+
+    private DicomToJsonFormat(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static DicomToJsonFormat getInstance(int value) {
+        if (value == 1) {
+            return FULL;
+        }
+        if (value == 2) {
+            return SHORT;
+        }
+        if (value == 3) {
+            return HUMAN;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration DicomToJsonFormat: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/DicomWebBinaryMode.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,77 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The available modes to export a binary DICOM tag into a DICOMweb JSON or XML
+ * document.
+ **/
+public enum DicomWebBinaryMode {
+    /**
+     * Don't include binary tags
+     **/
+    IGNORE(0),
+    /**
+     * Inline encoding using Base64
+     **/
+    INLINE_BINARY(1),
+    /**
+     * Use a bulk data URI field
+     **/
+    BULK_DATA_URI(2);
+
+    private int value;
+
+    private DicomWebBinaryMode(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static DicomWebBinaryMode getInstance(int value) {
+        if (value == 0) {
+            return IGNORE;
+        }
+        if (value == 1) {
+            return INLINE_BINARY;
+        }
+        if (value == 2) {
+            return BULK_DATA_URI;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration DicomWebBinaryMode: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/DicomWebNode.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,55 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * Node visited by DICOMweb conversion
+ **/
+public class DicomWebNode {
+    private long self;
+
+    /**
+     * Construct a Java object wrapping a C object that is managed by Orthanc.
+     * @param self Pointer to the C object.
+     **/
+    protected DicomWebNode(long self) {
+        if (self == 0) {
+            throw new IllegalArgumentException("Null pointer");
+        } else {
+            this.self = self;
+        }
+    }
+
+    /**
+     * Return the C object that is associated with this Java wrapper.
+     * @return Pointer to the C object.
+     **/
+    protected long getSelf() {
+        return self;
+    }
+
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/ErrorCode.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,809 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The various error codes that can be returned by the Orthanc core.
+ **/
+public enum ErrorCode {
+    /**
+     * Internal error
+     **/
+    INTERNAL_ERROR(-1),
+    /**
+     * Success
+     **/
+    SUCCESS(0),
+    /**
+     * Error encountered within the plugin engine
+     **/
+    PLUGIN(1),
+    /**
+     * Not implemented yet
+     **/
+    NOT_IMPLEMENTED(2),
+    /**
+     * Parameter out of range
+     **/
+    PARAMETER_OUT_OF_RANGE(3),
+    /**
+     * The server hosting Orthanc is running out of memory
+     **/
+    NOT_ENOUGH_MEMORY(4),
+    /**
+     * Bad type for a parameter
+     **/
+    BAD_PARAMETER_TYPE(5),
+    /**
+     * Bad sequence of calls
+     **/
+    BAD_SEQUENCE_OF_CALLS(6),
+    /**
+     * Accessing an inexistent item
+     **/
+    INEXISTENT_ITEM(7),
+    /**
+     * Bad request
+     **/
+    BAD_REQUEST(8),
+    /**
+     * Error in the network protocol
+     **/
+    NETWORK_PROTOCOL(9),
+    /**
+     * Error while calling a system command
+     **/
+    SYSTEM_COMMAND(10),
+    /**
+     * Error with the database engine
+     **/
+    DATABASE(11),
+    /**
+     * Badly formatted URI
+     **/
+    URI_SYNTAX(12),
+    /**
+     * Inexistent file
+     **/
+    INEXISTENT_FILE(13),
+    /**
+     * Cannot write to file
+     **/
+    CANNOT_WRITE_FILE(14),
+    /**
+     * Bad file format
+     **/
+    BAD_FILE_FORMAT(15),
+    /**
+     * Timeout
+     **/
+    TIMEOUT(16),
+    /**
+     * Unknown resource
+     **/
+    UNKNOWN_RESOURCE(17),
+    /**
+     * Incompatible version of the database
+     **/
+    INCOMPATIBLE_DATABASE_VERSION(18),
+    /**
+     * The file storage is full
+     **/
+    FULL_STORAGE(19),
+    /**
+     * Corrupted file (e.g. inconsistent MD5 hash)
+     **/
+    CORRUPTED_FILE(20),
+    /**
+     * Inexistent tag
+     **/
+    INEXISTENT_TAG(21),
+    /**
+     * Cannot modify a read-only data structure
+     **/
+    READ_ONLY(22),
+    /**
+     * Incompatible format of the images
+     **/
+    INCOMPATIBLE_IMAGE_FORMAT(23),
+    /**
+     * Incompatible size of the images
+     **/
+    INCOMPATIBLE_IMAGE_SIZE(24),
+    /**
+     * Error while using a shared library (plugin)
+     **/
+    SHARED_LIBRARY(25),
+    /**
+     * Plugin invoking an unknown service
+     **/
+    UNKNOWN_PLUGIN_SERVICE(26),
+    /**
+     * Unknown DICOM tag
+     **/
+    UNKNOWN_DICOM_TAG(27),
+    /**
+     * Cannot parse a JSON document
+     **/
+    BAD_JSON(28),
+    /**
+     * Bad credentials were provided to an HTTP request
+     **/
+    UNAUTHORIZED(29),
+    /**
+     * Badly formatted font file
+     **/
+    BAD_FONT(30),
+    /**
+     * The plugin implementing a custom database back-end does not fulfill the proper
+     * interface
+     **/
+    DATABASE_PLUGIN(31),
+    /**
+     * Error in the plugin implementing a custom storage area
+     **/
+    STORAGE_AREA_PLUGIN(32),
+    /**
+     * The request is empty
+     **/
+    EMPTY_REQUEST(33),
+    /**
+     * Cannot send a response which is acceptable according to the Accept HTTP header
+     **/
+    NOT_ACCEPTABLE(34),
+    /**
+     * Cannot handle a NULL pointer
+     **/
+    NULL_POINTER(35),
+    /**
+     * The database is currently not available (probably a transient situation)
+     **/
+    DATABASE_UNAVAILABLE(36),
+    /**
+     * This job was canceled
+     **/
+    CANCELED_JOB(37),
+    /**
+     * Geometry error encountered in Stone
+     **/
+    BAD_GEOMETRY(38),
+    /**
+     * Cannot initialize SSL encryption, check out your certificates
+     **/
+    SSL_INITIALIZATION(39),
+    /**
+     * Calling a function that has been removed from the Orthanc Framework
+     **/
+    DISCONTINUED_ABI(40),
+    /**
+     * Incorrect range request
+     **/
+    BAD_RANGE(41),
+    /**
+     * Database could not serialize access due to concurrent update, the transaction
+     * should be retried
+     **/
+    DATABASE_CANNOT_SERIALIZE(42),
+    /**
+     * A bad revision number was provided, which might indicate conflict between
+     * multiple writers
+     **/
+    REVISION(43),
+    /**
+     * SQLite: The database is not opened
+     **/
+    SQLITE_NOT_OPENED(1000),
+    /**
+     * SQLite: Connection is already open
+     **/
+    SQLITE_ALREADY_OPENED(1001),
+    /**
+     * SQLite: Unable to open the database
+     **/
+    SQLITE_CANNOT_OPEN(1002),
+    /**
+     * SQLite: This cached statement is already being referred to
+     **/
+    SQLITE_STATEMENT_ALREADY_USED(1003),
+    /**
+     * SQLite: Cannot execute a command
+     **/
+    SQLITE_EXECUTE(1004),
+    /**
+     * SQLite: Rolling back a nonexistent transaction (have you called Begin()?)
+     **/
+    SQLITE_ROLLBACK_WITHOUT_TRANSACTION(1005),
+    /**
+     * SQLite: Committing a nonexistent transaction
+     **/
+    SQLITE_COMMIT_WITHOUT_TRANSACTION(1006),
+    /**
+     * SQLite: Unable to register a function
+     **/
+    SQLITE_REGISTER_FUNCTION(1007),
+    /**
+     * SQLite: Unable to flush the database
+     **/
+    SQLITE_FLUSH(1008),
+    /**
+     * SQLite: Cannot run a cached statement
+     **/
+    SQLITE_CANNOT_RUN(1009),
+    /**
+     * SQLite: Cannot step over a cached statement
+     **/
+    SQLITE_CANNOT_STEP(1010),
+    /**
+     * SQLite: Bing a value while out of range (serious error)
+     **/
+    SQLITE_BIND_OUT_OF_RANGE(1011),
+    /**
+     * SQLite: Cannot prepare a cached statement
+     **/
+    SQLITE_PREPARE_STATEMENT(1012),
+    /**
+     * SQLite: Beginning the same transaction twice
+     **/
+    SQLITE_TRANSACTION_ALREADY_STARTED(1013),
+    /**
+     * SQLite: Failure when committing the transaction
+     **/
+    SQLITE_TRANSACTION_COMMIT(1014),
+    /**
+     * SQLite: Cannot start a transaction
+     **/
+    SQLITE_TRANSACTION_BEGIN(1015),
+    /**
+     * The directory to be created is already occupied by a regular file
+     **/
+    DIRECTORY_OVER_FILE(2000),
+    /**
+     * Unable to create a subdirectory or a file in the file storage
+     **/
+    FILE_STORAGE_CANNOT_WRITE(2001),
+    /**
+     * The specified path does not point to a directory
+     **/
+    DIRECTORY_EXPECTED(2002),
+    /**
+     * The TCP port of the HTTP server is privileged or already in use
+     **/
+    HTTP_PORT_IN_USE(2003),
+    /**
+     * The TCP port of the DICOM server is privileged or already in use
+     **/
+    DICOM_PORT_IN_USE(2004),
+    /**
+     * This HTTP status is not allowed in a REST API
+     **/
+    BAD_HTTP_STATUS_IN_REST(2005),
+    /**
+     * The specified path does not point to a regular file
+     **/
+    REGULAR_FILE_EXPECTED(2006),
+    /**
+     * Unable to get the path to the executable
+     **/
+    PATH_TO_EXECUTABLE(2007),
+    /**
+     * Cannot create a directory
+     **/
+    MAKE_DIRECTORY(2008),
+    /**
+     * An application entity title (AET) cannot be empty or be longer than 16
+     * characters
+     **/
+    BAD_APPLICATION_ENTITY_TITLE(2009),
+    /**
+     * No request handler factory for DICOM C-FIND SCP
+     **/
+    NO_CFIND_HANDLER(2010),
+    /**
+     * No request handler factory for DICOM C-MOVE SCP
+     **/
+    NO_CMOVE_HANDLER(2011),
+    /**
+     * No request handler factory for DICOM C-STORE SCP
+     **/
+    NO_CSTORE_HANDLER(2012),
+    /**
+     * No application entity filter
+     **/
+    NO_APPLICATION_ENTITY_FILTER(2013),
+    /**
+     * DicomUserConnection: Unable to find the SOP class and instance
+     **/
+    NO_SOP_CLASS_OR_INSTANCE(2014),
+    /**
+     * DicomUserConnection: No acceptable presentation context for modality
+     **/
+    NO_PRESENTATION_CONTEXT(2015),
+    /**
+     * DicomUserConnection: The C-FIND command is not supported by the remote SCP
+     **/
+    DICOM_FIND_UNAVAILABLE(2016),
+    /**
+     * DicomUserConnection: The C-MOVE command is not supported by the remote SCP
+     **/
+    DICOM_MOVE_UNAVAILABLE(2017),
+    /**
+     * Cannot store an instance
+     **/
+    CANNOT_STORE_INSTANCE(2018),
+    /**
+     * Only string values are supported when creating DICOM instances
+     **/
+    CREATE_DICOM_NOT_STRING(2019),
+    /**
+     * Trying to override a value inherited from a parent module
+     **/
+    CREATE_DICOM_OVERRIDE_TAG(2020),
+    /**
+     * Use \"Content\" to inject an image into a new DICOM instance
+     **/
+    CREATE_DICOM_USE_CONTENT(2021),
+    /**
+     * No payload is present for one instance in the series
+     **/
+    CREATE_DICOM_NO_PAYLOAD(2022),
+    /**
+     * The payload of the DICOM instance must be specified according to Data URI scheme
+     **/
+    CREATE_DICOM_USE_DATA_URI_SCHEME(2023),
+    /**
+     * Trying to attach a new DICOM instance to an inexistent resource
+     **/
+    CREATE_DICOM_BAD_PARENT(2024),
+    /**
+     * Trying to attach a new DICOM instance to an instance (must be a series, study or
+     * patient)
+     **/
+    CREATE_DICOM_PARENT_IS_INSTANCE(2025),
+    /**
+     * Unable to get the encoding of the parent resource
+     **/
+    CREATE_DICOM_PARENT_ENCODING(2026),
+    /**
+     * Unknown modality
+     **/
+    UNKNOWN_MODALITY(2027),
+    /**
+     * Bad ordering of filters in a job
+     **/
+    BAD_JOB_ORDERING(2028),
+    /**
+     * Cannot convert the given JSON object to a Lua table
+     **/
+    JSON_TO_LUA_TABLE(2029),
+    /**
+     * Cannot create the Lua context
+     **/
+    CANNOT_CREATE_LUA(2030),
+    /**
+     * Cannot execute a Lua command
+     **/
+    CANNOT_EXECUTE_LUA(2031),
+    /**
+     * Arguments cannot be pushed after the Lua function is executed
+     **/
+    LUA_ALREADY_EXECUTED(2032),
+    /**
+     * The Lua function does not give the expected number of outputs
+     **/
+    LUA_BAD_OUTPUT(2033),
+    /**
+     * The Lua function is not a predicate (only true/false outputs allowed)
+     **/
+    NOT_LUA_PREDICATE(2034),
+    /**
+     * The Lua function does not return a string
+     **/
+    LUA_RETURNS_NO_STRING(2035),
+    /**
+     * Another plugin has already registered a custom storage area
+     **/
+    STORAGE_AREA_ALREADY_REGISTERED(2036),
+    /**
+     * Another plugin has already registered a custom database back-end
+     **/
+    DATABASE_BACKEND_ALREADY_REGISTERED(2037),
+    /**
+     * Plugin trying to call the database during its initialization
+     **/
+    DATABASE_NOT_INITIALIZED(2038),
+    /**
+     * Orthanc has been built without SSL support
+     **/
+    SSL_DISABLED(2039),
+    /**
+     * Unable to order the slices of the series
+     **/
+    CANNOT_ORDER_SLICES(2040),
+    /**
+     * No request handler factory for DICOM C-Find Modality SCP
+     **/
+    NO_WORKLIST_HANDLER(2041),
+    /**
+     * Cannot override the value of a tag that already exists
+     **/
+    ALREADY_EXISTING_TAG(2042),
+    /**
+     * No request handler factory for DICOM N-ACTION SCP (storage commitment)
+     **/
+    NO_STORAGE_COMMITMENT_HANDLER(2043),
+    /**
+     * No request handler factory for DICOM C-GET SCP
+     **/
+    NO_CGET_HANDLER(2044),
+    /**
+     * Unsupported media type
+     **/
+    UNSUPPORTED_MEDIA_TYPE(3000);
+
+    private int value;
+
+    private ErrorCode(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static ErrorCode getInstance(int value) {
+        if (value == -1) {
+            return INTERNAL_ERROR;
+        }
+        if (value == 0) {
+            return SUCCESS;
+        }
+        if (value == 1) {
+            return PLUGIN;
+        }
+        if (value == 2) {
+            return NOT_IMPLEMENTED;
+        }
+        if (value == 3) {
+            return PARAMETER_OUT_OF_RANGE;
+        }
+        if (value == 4) {
+            return NOT_ENOUGH_MEMORY;
+        }
+        if (value == 5) {
+            return BAD_PARAMETER_TYPE;
+        }
+        if (value == 6) {
+            return BAD_SEQUENCE_OF_CALLS;
+        }
+        if (value == 7) {
+            return INEXISTENT_ITEM;
+        }
+        if (value == 8) {
+            return BAD_REQUEST;
+        }
+        if (value == 9) {
+            return NETWORK_PROTOCOL;
+        }
+        if (value == 10) {
+            return SYSTEM_COMMAND;
+        }
+        if (value == 11) {
+            return DATABASE;
+        }
+        if (value == 12) {
+            return URI_SYNTAX;
+        }
+        if (value == 13) {
+            return INEXISTENT_FILE;
+        }
+        if (value == 14) {
+            return CANNOT_WRITE_FILE;
+        }
+        if (value == 15) {
+            return BAD_FILE_FORMAT;
+        }
+        if (value == 16) {
+            return TIMEOUT;
+        }
+        if (value == 17) {
+            return UNKNOWN_RESOURCE;
+        }
+        if (value == 18) {
+            return INCOMPATIBLE_DATABASE_VERSION;
+        }
+        if (value == 19) {
+            return FULL_STORAGE;
+        }
+        if (value == 20) {
+            return CORRUPTED_FILE;
+        }
+        if (value == 21) {
+            return INEXISTENT_TAG;
+        }
+        if (value == 22) {
+            return READ_ONLY;
+        }
+        if (value == 23) {
+            return INCOMPATIBLE_IMAGE_FORMAT;
+        }
+        if (value == 24) {
+            return INCOMPATIBLE_IMAGE_SIZE;
+        }
+        if (value == 25) {
+            return SHARED_LIBRARY;
+        }
+        if (value == 26) {
+            return UNKNOWN_PLUGIN_SERVICE;
+        }
+        if (value == 27) {
+            return UNKNOWN_DICOM_TAG;
+        }
+        if (value == 28) {
+            return BAD_JSON;
+        }
+        if (value == 29) {
+            return UNAUTHORIZED;
+        }
+        if (value == 30) {
+            return BAD_FONT;
+        }
+        if (value == 31) {
+            return DATABASE_PLUGIN;
+        }
+        if (value == 32) {
+            return STORAGE_AREA_PLUGIN;
+        }
+        if (value == 33) {
+            return EMPTY_REQUEST;
+        }
+        if (value == 34) {
+            return NOT_ACCEPTABLE;
+        }
+        if (value == 35) {
+            return NULL_POINTER;
+        }
+        if (value == 36) {
+            return DATABASE_UNAVAILABLE;
+        }
+        if (value == 37) {
+            return CANCELED_JOB;
+        }
+        if (value == 38) {
+            return BAD_GEOMETRY;
+        }
+        if (value == 39) {
+            return SSL_INITIALIZATION;
+        }
+        if (value == 40) {
+            return DISCONTINUED_ABI;
+        }
+        if (value == 41) {
+            return BAD_RANGE;
+        }
+        if (value == 42) {
+            return DATABASE_CANNOT_SERIALIZE;
+        }
+        if (value == 43) {
+            return REVISION;
+        }
+        if (value == 1000) {
+            return SQLITE_NOT_OPENED;
+        }
+        if (value == 1001) {
+            return SQLITE_ALREADY_OPENED;
+        }
+        if (value == 1002) {
+            return SQLITE_CANNOT_OPEN;
+        }
+        if (value == 1003) {
+            return SQLITE_STATEMENT_ALREADY_USED;
+        }
+        if (value == 1004) {
+            return SQLITE_EXECUTE;
+        }
+        if (value == 1005) {
+            return SQLITE_ROLLBACK_WITHOUT_TRANSACTION;
+        }
+        if (value == 1006) {
+            return SQLITE_COMMIT_WITHOUT_TRANSACTION;
+        }
+        if (value == 1007) {
+            return SQLITE_REGISTER_FUNCTION;
+        }
+        if (value == 1008) {
+            return SQLITE_FLUSH;
+        }
+        if (value == 1009) {
+            return SQLITE_CANNOT_RUN;
+        }
+        if (value == 1010) {
+            return SQLITE_CANNOT_STEP;
+        }
+        if (value == 1011) {
+            return SQLITE_BIND_OUT_OF_RANGE;
+        }
+        if (value == 1012) {
+            return SQLITE_PREPARE_STATEMENT;
+        }
+        if (value == 1013) {
+            return SQLITE_TRANSACTION_ALREADY_STARTED;
+        }
+        if (value == 1014) {
+            return SQLITE_TRANSACTION_COMMIT;
+        }
+        if (value == 1015) {
+            return SQLITE_TRANSACTION_BEGIN;
+        }
+        if (value == 2000) {
+            return DIRECTORY_OVER_FILE;
+        }
+        if (value == 2001) {
+            return FILE_STORAGE_CANNOT_WRITE;
+        }
+        if (value == 2002) {
+            return DIRECTORY_EXPECTED;
+        }
+        if (value == 2003) {
+            return HTTP_PORT_IN_USE;
+        }
+        if (value == 2004) {
+            return DICOM_PORT_IN_USE;
+        }
+        if (value == 2005) {
+            return BAD_HTTP_STATUS_IN_REST;
+        }
+        if (value == 2006) {
+            return REGULAR_FILE_EXPECTED;
+        }
+        if (value == 2007) {
+            return PATH_TO_EXECUTABLE;
+        }
+        if (value == 2008) {
+            return MAKE_DIRECTORY;
+        }
+        if (value == 2009) {
+            return BAD_APPLICATION_ENTITY_TITLE;
+        }
+        if (value == 2010) {
+            return NO_CFIND_HANDLER;
+        }
+        if (value == 2011) {
+            return NO_CMOVE_HANDLER;
+        }
+        if (value == 2012) {
+            return NO_CSTORE_HANDLER;
+        }
+        if (value == 2013) {
+            return NO_APPLICATION_ENTITY_FILTER;
+        }
+        if (value == 2014) {
+            return NO_SOP_CLASS_OR_INSTANCE;
+        }
+        if (value == 2015) {
+            return NO_PRESENTATION_CONTEXT;
+        }
+        if (value == 2016) {
+            return DICOM_FIND_UNAVAILABLE;
+        }
+        if (value == 2017) {
+            return DICOM_MOVE_UNAVAILABLE;
+        }
+        if (value == 2018) {
+            return CANNOT_STORE_INSTANCE;
+        }
+        if (value == 2019) {
+            return CREATE_DICOM_NOT_STRING;
+        }
+        if (value == 2020) {
+            return CREATE_DICOM_OVERRIDE_TAG;
+        }
+        if (value == 2021) {
+            return CREATE_DICOM_USE_CONTENT;
+        }
+        if (value == 2022) {
+            return CREATE_DICOM_NO_PAYLOAD;
+        }
+        if (value == 2023) {
+            return CREATE_DICOM_USE_DATA_URI_SCHEME;
+        }
+        if (value == 2024) {
+            return CREATE_DICOM_BAD_PARENT;
+        }
+        if (value == 2025) {
+            return CREATE_DICOM_PARENT_IS_INSTANCE;
+        }
+        if (value == 2026) {
+            return CREATE_DICOM_PARENT_ENCODING;
+        }
+        if (value == 2027) {
+            return UNKNOWN_MODALITY;
+        }
+        if (value == 2028) {
+            return BAD_JOB_ORDERING;
+        }
+        if (value == 2029) {
+            return JSON_TO_LUA_TABLE;
+        }
+        if (value == 2030) {
+            return CANNOT_CREATE_LUA;
+        }
+        if (value == 2031) {
+            return CANNOT_EXECUTE_LUA;
+        }
+        if (value == 2032) {
+            return LUA_ALREADY_EXECUTED;
+        }
+        if (value == 2033) {
+            return LUA_BAD_OUTPUT;
+        }
+        if (value == 2034) {
+            return NOT_LUA_PREDICATE;
+        }
+        if (value == 2035) {
+            return LUA_RETURNS_NO_STRING;
+        }
+        if (value == 2036) {
+            return STORAGE_AREA_ALREADY_REGISTERED;
+        }
+        if (value == 2037) {
+            return DATABASE_BACKEND_ALREADY_REGISTERED;
+        }
+        if (value == 2038) {
+            return DATABASE_NOT_INITIALIZED;
+        }
+        if (value == 2039) {
+            return SSL_DISABLED;
+        }
+        if (value == 2040) {
+            return CANNOT_ORDER_SLICES;
+        }
+        if (value == 2041) {
+            return NO_WORKLIST_HANDLER;
+        }
+        if (value == 2042) {
+            return ALREADY_EXISTING_TAG;
+        }
+        if (value == 2043) {
+            return NO_STORAGE_COMMITMENT_HANDLER;
+        }
+        if (value == 2044) {
+            return NO_CGET_HANDLER;
+        }
+        if (value == 3000) {
+            return UNSUPPORTED_MEDIA_TYPE;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration ErrorCode: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/FindAnswers.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,80 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * Answers to a DICOM C-FIND query
+ **/
+public class FindAnswers {
+    private long self;
+
+    /**
+     * Construct a Java object wrapping a C object that is managed by Orthanc.
+     * @param self Pointer to the C object.
+     **/
+    protected FindAnswers(long self) {
+        if (self == 0) {
+            throw new IllegalArgumentException("Null pointer");
+        } else {
+            this.self = self;
+        }
+    }
+
+    /**
+     * Return the C object that is associated with this Java wrapper.
+     * @return Pointer to the C object.
+     **/
+    protected long getSelf() {
+        return self;
+    }
+
+
+
+    /**
+     * Add one answer to some C-Find request.
+     * 
+     * This function adds one answer (encoded as a DICOM file) to the set of answers
+     * corresponding to some C-Find SCP request that is not related to modality
+     * worklists.
+     * 
+     * @param dicom The answer to be added, encoded as a DICOM file.
+     **/
+    public void findAddAnswer(
+        byte[] dicom) {
+        NativeSDK.OrthancPluginFindAddAnswer(self, dicom);
+    }
+
+    /**
+     * Mark the set of C-Find answers as incomplete.
+     * 
+     * This function marks as incomplete the set of answers corresponding to some
+     * C-Find SCP request that is not related to modality worklists. This must be used
+     * if canceling the handling of a request when too many answers are to be returned.
+     **/
+    public void findMarkIncomplete() {
+        NativeSDK.OrthancPluginFindMarkIncomplete(self);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/FindMatcher.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,102 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * Matcher for DICOM C-FIND query
+ **/
+public class FindMatcher {
+    private long self;
+
+    /**
+     * Construct a Java object wrapping a C object that is managed by Orthanc.
+     * @param self Pointer to the C object.
+     **/
+    protected FindMatcher(long self) {
+        if (self == 0) {
+            throw new IllegalArgumentException("Null pointer");
+        } else {
+            this.self = self;
+        }
+    }
+
+    /**
+     * Return the C object that is associated with this Java wrapper.
+     * @return Pointer to the C object.
+     **/
+    protected long getSelf() {
+        return self;
+    }
+
+    @Override
+    protected void finalize() throws Throwable {
+        dispose();
+        super.finalize();
+    }
+
+    /**
+     * Manually deallocate the C object that is associated with this Java wrapper.
+     *
+     * This method can be used to immediately deallocate the C object,
+     * instead of waiting for the garbage collector to dispose the Java wrapper.
+     **/
+    public void dispose() {
+        if (self != 0) {
+            NativeSDK.OrthancPluginFreeFindMatcher(self);
+            self = 0;
+        }
+    }
+
+    /**
+     * Create a C-Find matcher.
+     * 
+     * This function creates a "matcher" object that can be used to check whether a
+     * DICOM instance matches a C-Find query. The C-Find query must be expressed as a
+     * DICOM buffer.
+     * 
+     * @param query The C-Find DICOM query.
+     * @return The newly constructed object.
+     **/
+    public static FindMatcher createFindMatcher(
+        byte[] query) {
+        return new FindMatcher(NativeSDK.OrthancPluginCreateFindMatcher(query));
+    }
+
+
+    /**
+     * Test whether a DICOM instance matches a C-Find query.
+     * 
+     * This function checks whether one DICOM instance matches C-Find matcher that was
+     * previously allocated using OrthancPluginCreateFindMatcher().
+     * 
+     * @param dicom The DICOM instance to be matched.
+     * @return 1 if the DICOM instance matches the query, 0 otherwise.
+     **/
+    public int findMatcherIsMatch(
+        byte[] dicom) {
+        return NativeSDK.OrthancPluginFindMatcherIsMatch(self, dicom);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/FindQuery.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,95 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * DICOM C-FIND query
+ **/
+public class FindQuery {
+    private long self;
+
+    /**
+     * Construct a Java object wrapping a C object that is managed by Orthanc.
+     * @param self Pointer to the C object.
+     **/
+    protected FindQuery(long self) {
+        if (self == 0) {
+            throw new IllegalArgumentException("Null pointer");
+        } else {
+            this.self = self;
+        }
+    }
+
+    /**
+     * Return the C object that is associated with this Java wrapper.
+     * @return Pointer to the C object.
+     **/
+    protected long getSelf() {
+        return self;
+    }
+
+
+
+    /**
+     * Get the number of tags in a C-Find query.
+     * 
+     * This function returns the number of tags that are contained in the given C-Find
+     * query.
+     * 
+     * @return The number of tags.
+     **/
+    public int getFindQuerySize() {
+        return NativeSDK.OrthancPluginGetFindQuerySize(self);
+    }
+
+    /**
+     * Get the symbolic name of one tag in a C-Find query.
+     * 
+     * This function returns the symbolic name of one DICOM tag in the given C-Find
+     * query.
+     * 
+     * @param index The index of the tag of interest.
+     * @return The resulting string.
+     **/
+    public String getFindQueryTagName(
+        int index) {
+        return NativeSDK.OrthancPluginGetFindQueryTagName(self, index);
+    }
+
+    /**
+     * Get the value associated with one tag in a C-Find query.
+     * 
+     * This function returns the value associated with one tag in the given C-Find
+     * query.
+     * 
+     * @param index The index of the tag of interest.
+     * @return The resulting string.
+     **/
+    public String getFindQueryValue(
+        int index) {
+        return NativeSDK.OrthancPluginGetFindQueryValue(self, index);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/Functions.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,1006 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * Wrapper around the global functions provided by the Orthanc SDK.
+ **/
+public class Functions {
+
+    /**
+     * Check that the version of the hosting Orthanc is above a given version.
+     * 
+     * This function checks whether the version of the Orthanc server running this
+     * plugin, is above the given version. Contrarily to OrthancPluginCheckVersion(),
+     * it is up to the developer of the plugin to make sure that all the Orthanc SDK
+     * services called by the plugin are actually implemented in the given version of
+     * Orthanc.
+     * 
+     * @param expectedMajor Expected major version.
+     * @param expectedMinor Expected minor version.
+     * @param expectedRevision Expected revision.
+     * @return 1 if and only if the versions are compatible. If the result is 0, the
+     * initialization of the plugin should fail.
+     **/
+    public static int checkVersionAdvanced(
+        int expectedMajor,
+        int expectedMinor,
+        int expectedRevision) {
+        return NativeSDK.OrthancPluginCheckVersionAdvanced(expectedMajor, expectedMinor, expectedRevision);
+    }
+
+    /**
+     * Check the compatibility of the plugin wrt. the version of its hosting Orthanc.
+     * 
+     * This function checks whether the version of the Orthanc server running this
+     * plugin, is above the version of the current Orthanc SDK header. This guarantees
+     * that the plugin is compatible with the hosting Orthanc (i.e. it will not call
+     * unavailable services). The result of this function should always be checked in
+     * the OrthancPluginInitialize() entry point of the plugin.
+     * 
+     * @return 1 if and only if the versions are compatible. If the result is 0, the
+     * initialization of the plugin should fail.
+     **/
+    public static int checkVersion() {
+        return NativeSDK.OrthancPluginCheckVersion();
+    }
+
+    /**
+     * Log an error.
+     * 
+     * Log an error message using the Orthanc logging system.
+     * 
+     * @param message The message to be logged.
+     **/
+    public static void logError(
+        String message) {
+        NativeSDK.OrthancPluginLogError(message);
+    }
+
+    /**
+     * Log a warning.
+     * 
+     * Log a warning message using the Orthanc logging system.
+     * 
+     * @param message The message to be logged.
+     **/
+    public static void logWarning(
+        String message) {
+        NativeSDK.OrthancPluginLogWarning(message);
+    }
+
+    /**
+     * Log an information.
+     * 
+     * Log an information message using the Orthanc logging system.
+     * 
+     * @param message The message to be logged.
+     **/
+    public static void logInfo(
+        String message) {
+        NativeSDK.OrthancPluginLogInfo(message);
+    }
+
+    /**
+     * Retrieve a DICOM instance using its Orthanc identifier.
+     * 
+     * Retrieve a DICOM instance using its Orthanc identifier. The DICOM file is stored
+     * into a newly allocated memory buffer.
+     * 
+     * @param instanceId The Orthanc identifier of the DICOM instance of interest.
+     * @return The resulting memory buffer.
+     **/
+    public static byte[] getDicomForInstance(
+        String instanceId) {
+        return NativeSDK.OrthancPluginGetDicomForInstance(instanceId);
+    }
+
+    /**
+     * Make a GET call to the built-in Orthanc REST API.
+     * 
+     * Make a GET call to the built-in Orthanc REST API. The result to the query is
+     * stored into a newly allocated memory buffer.
+     * 
+     * Remark: If the resource is not existing (error 404), the error code will be
+     * OrthancPluginErrorCode_UnknownResource.
+     * 
+     * @param uri The URI in the built-in Orthanc API.
+     * @return The resulting memory buffer.
+     **/
+    public static byte[] restApiGet(
+        String uri) {
+        return NativeSDK.OrthancPluginRestApiGet(uri);
+    }
+
+    /**
+     * Make a GET call to the REST API, as tainted by the plugins.
+     * 
+     * Make a GET call to the Orthanc REST API, after all the plugins are applied. In
+     * other words, if some plugin overrides or adds the called URI to the built-in
+     * Orthanc REST API, this call will return the result provided by this plugin. The
+     * result to the query is stored into a newly allocated memory buffer.
+     * 
+     * Remark: If the resource is not existing (error 404), the error code will be
+     * OrthancPluginErrorCode_UnknownResource.
+     * 
+     * @param uri The URI in the built-in Orthanc API.
+     * @return The resulting memory buffer.
+     **/
+    public static byte[] restApiGetAfterPlugins(
+        String uri) {
+        return NativeSDK.OrthancPluginRestApiGetAfterPlugins(uri);
+    }
+
+    /**
+     * Make a POST call to the built-in Orthanc REST API.
+     * 
+     * Make a POST call to the built-in Orthanc REST API. The result to the query is
+     * stored into a newly allocated memory buffer.
+     * 
+     * Remark: If the resource is not existing (error 404), the error code will be
+     * OrthancPluginErrorCode_UnknownResource.
+     * 
+     * @param uri The URI in the built-in Orthanc API.
+     * @param body The body of the POST request.
+     * @return The resulting memory buffer.
+     **/
+    public static byte[] restApiPost(
+        String uri,
+        byte[] body) {
+        return NativeSDK.OrthancPluginRestApiPost(uri, body);
+    }
+
+    /**
+     * Make a POST call to the REST API, as tainted by the plugins.
+     * 
+     * Make a POST call to the Orthanc REST API, after all the plugins are applied. In
+     * other words, if some plugin overrides or adds the called URI to the built-in
+     * Orthanc REST API, this call will return the result provided by this plugin. The
+     * result to the query is stored into a newly allocated memory buffer.
+     * 
+     * Remark: If the resource is not existing (error 404), the error code will be
+     * OrthancPluginErrorCode_UnknownResource.
+     * 
+     * @param uri The URI in the built-in Orthanc API.
+     * @param body The body of the POST request.
+     * @return The resulting memory buffer.
+     **/
+    public static byte[] restApiPostAfterPlugins(
+        String uri,
+        byte[] body) {
+        return NativeSDK.OrthancPluginRestApiPostAfterPlugins(uri, body);
+    }
+
+    /**
+     * Make a DELETE call to the built-in Orthanc REST API.
+     * 
+     * Make a DELETE call to the built-in Orthanc REST API.
+     * 
+     * Remark: If the resource is not existing (error 404), the error code will be
+     * OrthancPluginErrorCode_UnknownResource.
+     * 
+     * @param uri The URI to delete in the built-in Orthanc API.
+     **/
+    public static void restApiDelete(
+        String uri) {
+        NativeSDK.OrthancPluginRestApiDelete(uri);
+    }
+
+    /**
+     * Make a DELETE call to the REST API, as tainted by the plugins.
+     * 
+     * Make a DELETE call to the Orthanc REST API, after all the plugins are applied.
+     * In other words, if some plugin overrides or adds the called URI to the built-in
+     * Orthanc REST API, this call will return the result provided by this plugin.
+     * 
+     * Remark: If the resource is not existing (error 404), the error code will be
+     * OrthancPluginErrorCode_UnknownResource.
+     * 
+     * @param uri The URI to delete in the built-in Orthanc API.
+     **/
+    public static void restApiDeleteAfterPlugins(
+        String uri) {
+        NativeSDK.OrthancPluginRestApiDeleteAfterPlugins(uri);
+    }
+
+    /**
+     * Make a PUT call to the built-in Orthanc REST API.
+     * 
+     * Make a PUT call to the built-in Orthanc REST API. The result to the query is
+     * stored into a newly allocated memory buffer.
+     * 
+     * Remark: If the resource is not existing (error 404), the error code will be
+     * OrthancPluginErrorCode_UnknownResource.
+     * 
+     * @param uri The URI in the built-in Orthanc API.
+     * @param body The body of the PUT request.
+     * @return The resulting memory buffer.
+     **/
+    public static byte[] restApiPut(
+        String uri,
+        byte[] body) {
+        return NativeSDK.OrthancPluginRestApiPut(uri, body);
+    }
+
+    /**
+     * Make a PUT call to the REST API, as tainted by the plugins.
+     * 
+     * Make a PUT call to the Orthanc REST API, after all the plugins are applied. In
+     * other words, if some plugin overrides or adds the called URI to the built-in
+     * Orthanc REST API, this call will return the result provided by this plugin. The
+     * result to the query is stored into a newly allocated memory buffer.
+     * 
+     * Remark: If the resource is not existing (error 404), the error code will be
+     * OrthancPluginErrorCode_UnknownResource.
+     * 
+     * @param uri The URI in the built-in Orthanc API.
+     * @param body The body of the PUT request.
+     * @return The resulting memory buffer.
+     **/
+    public static byte[] restApiPutAfterPlugins(
+        String uri,
+        byte[] body) {
+        return NativeSDK.OrthancPluginRestApiPutAfterPlugins(uri, body);
+    }
+
+    /**
+     * Look for a patient.
+     * 
+     * Look for a patient stored in Orthanc, using its Patient ID tag (0x0010, 0x0020).
+     * This function uses the database index to run as fast as possible (it does not
+     * loop over all the stored patients).
+     * 
+     * @param patientID The Patient ID of interest.
+     * @return The resulting string.
+     **/
+    public static String lookupPatient(
+        String patientID) {
+        return NativeSDK.OrthancPluginLookupPatient(patientID);
+    }
+
+    /**
+     * Look for a study.
+     * 
+     * Look for a study stored in Orthanc, using its Study Instance UID tag (0x0020,
+     * 0x000d). This function uses the database index to run as fast as possible (it
+     * does not loop over all the stored studies).
+     * 
+     * @param studyUID The Study Instance UID of interest.
+     * @return The resulting string.
+     **/
+    public static String lookupStudy(
+        String studyUID) {
+        return NativeSDK.OrthancPluginLookupStudy(studyUID);
+    }
+
+    /**
+     * Look for a study, using the accession number.
+     * 
+     * Look for a study stored in Orthanc, using its Accession Number tag (0x0008,
+     * 0x0050). This function uses the database index to run as fast as possible (it
+     * does not loop over all the stored studies).
+     * 
+     * @param accessionNumber The Accession Number of interest.
+     * @return The resulting string.
+     **/
+    public static String lookupStudyWithAccessionNumber(
+        String accessionNumber) {
+        return NativeSDK.OrthancPluginLookupStudyWithAccessionNumber(accessionNumber);
+    }
+
+    /**
+     * Look for a series.
+     * 
+     * Look for a series stored in Orthanc, using its Series Instance UID tag (0x0020,
+     * 0x000e). This function uses the database index to run as fast as possible (it
+     * does not loop over all the stored series).
+     * 
+     * @param seriesUID The Series Instance UID of interest.
+     * @return The resulting string.
+     **/
+    public static String lookupSeries(
+        String seriesUID) {
+        return NativeSDK.OrthancPluginLookupSeries(seriesUID);
+    }
+
+    /**
+     * Look for an instance.
+     * 
+     * Look for an instance stored in Orthanc, using its SOP Instance UID tag (0x0008,
+     * 0x0018). This function uses the database index to run as fast as possible (it
+     * does not loop over all the stored instances).
+     * 
+     * @param sopInstanceUID The SOP Instance UID of interest.
+     * @return The resulting string.
+     **/
+    public static String lookupInstance(
+        String sopInstanceUID) {
+        return NativeSDK.OrthancPluginLookupInstance(sopInstanceUID);
+    }
+
+    /**
+     * Return the path to the Orthanc executable.
+     * 
+     * This function returns the path to the Orthanc executable.
+     * 
+     * @return The resulting string.
+     **/
+    public static String getOrthancPath() {
+        return NativeSDK.OrthancPluginGetOrthancPath();
+    }
+
+    /**
+     * Return the directory containing the Orthanc.
+     * 
+     * This function returns the path to the directory containing the Orthanc
+     * executable.
+     * 
+     * @return The resulting string.
+     **/
+    public static String getOrthancDirectory() {
+        return NativeSDK.OrthancPluginGetOrthancDirectory();
+    }
+
+    /**
+     * Return the path to the configuration file(s).
+     * 
+     * This function returns the path to the configuration file(s) that was specified
+     * when starting Orthanc. Since version 0.9.1, this path can refer to a folder that
+     * stores a set of configuration files. This function is deprecated in favor of
+     * OrthancPluginGetConfiguration().
+     * 
+     * @return The resulting string.
+     **/
+    public static String getConfigurationPath() {
+        return NativeSDK.OrthancPluginGetConfigurationPath();
+    }
+
+    /**
+     * Set the URI where the plugin provides its Web interface.
+     * 
+     * For plugins that come with a Web interface, this function declares the entry
+     * path where to find this interface. This information is notably used in the
+     * "Plugins" page of Orthanc Explorer.
+     * 
+     * @param uri The root URI for this plugin.
+     **/
+    public static void setRootUri(
+        String uri) {
+        NativeSDK.OrthancPluginSetRootUri(uri);
+    }
+
+    /**
+     * Set a description for this plugin.
+     * 
+     * Set a description for this plugin. It is displayed in the "Plugins" page of
+     * Orthanc Explorer.
+     * 
+     * @param description The description.
+     **/
+    public static void setDescription(
+        String description) {
+        NativeSDK.OrthancPluginSetDescription(description);
+    }
+
+    /**
+     * Extend the JavaScript code of Orthanc Explorer.
+     * 
+     * Add JavaScript code to customize the default behavior of Orthanc Explorer. This
+     * can for instance be used to add new buttons.
+     * 
+     * @param javascript The custom JavaScript code.
+     **/
+    public static void extendOrthancExplorer(
+        String javascript) {
+        NativeSDK.OrthancPluginExtendOrthancExplorer(javascript);
+    }
+
+    /**
+     * Get the value of a global property.
+     * 
+     * Get the value of a global property that is stored in the Orthanc database.
+     * Global properties whose index is below 1024 are reserved by Orthanc.
+     * 
+     * @param property The global property of interest.
+     * @param defaultValue The value to return, if the global property is unset.
+     * @return The resulting string.
+     **/
+    public static String getGlobalProperty(
+        int property,
+        String defaultValue) {
+        return NativeSDK.OrthancPluginGetGlobalProperty(property, defaultValue);
+    }
+
+    /**
+     * Set the value of a global property.
+     * 
+     * Set the value of a global property into the Orthanc database. Setting a global
+     * property can be used by plugins to save their internal parameters. Plugins are
+     * only allowed to set properties whose index are above or equal to 1024
+     * (properties below 1024 are read-only and reserved by Orthanc).
+     * 
+     * @param property The global property of interest.
+     * @param value The value to be set in the global property.
+     **/
+    public static void setGlobalProperty(
+        int property,
+        String value) {
+        NativeSDK.OrthancPluginSetGlobalProperty(property, value);
+    }
+
+    /**
+     * Get the number of command-line arguments.
+     * 
+     * Retrieve the number of command-line arguments that were used to launch Orthanc.
+     * 
+     * @return The number of arguments.
+     **/
+    public static int getCommandLineArgumentsCount() {
+        return NativeSDK.OrthancPluginGetCommandLineArgumentsCount();
+    }
+
+    /**
+     * Get the value of a command-line argument.
+     * 
+     * Get the value of one of the command-line arguments that were used to launch
+     * Orthanc. The number of available arguments can be retrieved by
+     * OrthancPluginGetCommandLineArgumentsCount().
+     * 
+     * @param argument The index of the argument.
+     * @return The resulting string.
+     **/
+    public static String getCommandLineArgument(
+        int argument) {
+        return NativeSDK.OrthancPluginGetCommandLineArgument(argument);
+    }
+
+    /**
+     * Get the expected version of the database schema.
+     * 
+     * Retrieve the expected version of the database schema.
+     * 
+     * @return The version.
+     **/
+    public static int getExpectedDatabaseVersion() {
+        return NativeSDK.OrthancPluginGetExpectedDatabaseVersion();
+    }
+
+    /**
+     * Return the content of the configuration file(s).
+     * 
+     * This function returns the content of the configuration that is used by Orthanc,
+     * formatted as a JSON string.
+     * 
+     * @return The resulting string.
+     **/
+    public static String getConfiguration() {
+        return NativeSDK.OrthancPluginGetConfiguration();
+    }
+
+    /**
+     * Compress or decompress a buffer.
+     * 
+     * This function compresses or decompresses a buffer, using the version of the zlib
+     * library that is used by the Orthanc core.
+     * 
+     * @param source The source buffer.
+     * @param compression The compression algorithm.
+     * @param uncompress If set to "0", the buffer must be compressed. If set to "1",
+     * the buffer must be uncompressed.
+     * @return The resulting memory buffer.
+     **/
+    public static byte[] bufferCompression(
+        byte[] source,
+        CompressionType compression,
+        byte uncompress) {
+        return NativeSDK.OrthancPluginBufferCompression(source, compression.getValue(), uncompress);
+    }
+
+    /**
+     * Read a file.
+     * 
+     * Read the content of a file on the filesystem, and returns it into a newly
+     * allocated memory buffer.
+     * 
+     * @param path The path of the file to be read.
+     * @return The resulting memory buffer.
+     **/
+    public static byte[] readFile(
+        String path) {
+        return NativeSDK.OrthancPluginReadFile(path);
+    }
+
+    /**
+     * Write a file.
+     * 
+     * Write the content of a memory buffer to the filesystem.
+     * 
+     * @param path The path of the file to be written.
+     * @param data The content of the memory buffer.
+     **/
+    public static void writeFile(
+        String path,
+        byte[] data) {
+        NativeSDK.OrthancPluginWriteFile(path, data);
+    }
+
+    /**
+     * Get the description of a given error code.
+     * 
+     * This function returns the description of a given error code.
+     * 
+     * @param error The error code of interest.
+     * @return The resulting string.
+     **/
+    public static String getErrorDescription(
+        ErrorCode error) {
+        return NativeSDK.OrthancPluginGetErrorDescription(error.getValue());
+    }
+
+    /**
+     * Encode a PNG image.
+     * 
+     * This function compresses the given memory buffer containing an image using the
+     * PNG specification, and stores the result of the compression into a newly
+     * allocated memory buffer.
+     * 
+     * @param format The memory layout of the uncompressed image.
+     * @param width The width of the image.
+     * @param height The height of the image.
+     * @param pitch The pitch of the image (i.e. the number of bytes between 2
+     * successive lines of the image in the memory buffer).
+     * @param buffer The memory buffer containing the uncompressed image.
+     * @return The resulting memory buffer.
+     **/
+    public static byte[] compressPngImage(
+        PixelFormat format,
+        int width,
+        int height,
+        int pitch,
+        byte[] buffer) {
+        return NativeSDK.OrthancPluginCompressPngImage(format.getValue(), width, height, pitch, buffer);
+    }
+
+    /**
+     * Encode a JPEG image.
+     * 
+     * This function compresses the given memory buffer containing an image using the
+     * JPEG specification, and stores the result of the compression into a newly
+     * allocated memory buffer.
+     * 
+     * @param format The memory layout of the uncompressed image.
+     * @param width The width of the image.
+     * @param height The height of the image.
+     * @param pitch The pitch of the image (i.e. the number of bytes between 2
+     * successive lines of the image in the memory buffer).
+     * @param buffer The memory buffer containing the uncompressed image.
+     * @param quality The quality of the JPEG encoding, between 1 (worst quality, best
+     * compression) and 100 (best quality, worst compression).
+     * @return The resulting memory buffer.
+     **/
+    public static byte[] compressJpegImage(
+        PixelFormat format,
+        int width,
+        int height,
+        int pitch,
+        byte[] buffer,
+        byte quality) {
+        return NativeSDK.OrthancPluginCompressJpegImage(format.getValue(), width, height, pitch, buffer, quality);
+    }
+
+    /**
+     * Issue a HTTP GET call.
+     * 
+     * Make a HTTP GET call to the given URL. The result to the query is stored into a
+     * newly allocated memory buffer. Favor OrthancPluginRestApiGet() if calling the
+     * built-in REST API of the Orthanc instance that hosts this plugin.
+     * 
+     * @param url The URL of interest.
+     * @param username The username (can be "NULL" if no password protection).
+     * @param password The password (can be "NULL" if no password protection).
+     * @return The resulting memory buffer.
+     **/
+    public static byte[] httpGet(
+        String url,
+        String username,
+        String password) {
+        return NativeSDK.OrthancPluginHttpGet(url, username, password);
+    }
+
+    /**
+     * Issue a HTTP POST call.
+     * 
+     * Make a HTTP POST call to the given URL. The result to the query is stored into a
+     * newly allocated memory buffer. Favor OrthancPluginRestApiPost() if calling the
+     * built-in REST API of the Orthanc instance that hosts this plugin.
+     * 
+     * @param url The URL of interest.
+     * @param body The content of the body of the request.
+     * @param username The username (can be "NULL" if no password protection).
+     * @param password The password (can be "NULL" if no password protection).
+     * @return The resulting memory buffer.
+     **/
+    public static byte[] httpPost(
+        String url,
+        byte[] body,
+        String username,
+        String password) {
+        return NativeSDK.OrthancPluginHttpPost(url, body, username, password);
+    }
+
+    /**
+     * Issue a HTTP PUT call.
+     * 
+     * Make a HTTP PUT call to the given URL. The result to the query is stored into a
+     * newly allocated memory buffer. Favor OrthancPluginRestApiPut() if calling the
+     * built-in REST API of the Orthanc instance that hosts this plugin.
+     * 
+     * @param url The URL of interest.
+     * @param body The content of the body of the request.
+     * @param username The username (can be "NULL" if no password protection).
+     * @param password The password (can be "NULL" if no password protection).
+     * @return The resulting memory buffer.
+     **/
+    public static byte[] httpPut(
+        String url,
+        byte[] body,
+        String username,
+        String password) {
+        return NativeSDK.OrthancPluginHttpPut(url, body, username, password);
+    }
+
+    /**
+     * Issue a HTTP DELETE call.
+     * 
+     * Make a HTTP DELETE call to the given URL. Favor OrthancPluginRestApiDelete() if
+     * calling the built-in REST API of the Orthanc instance that hosts this plugin.
+     * 
+     * @param url The URL of interest.
+     * @param username The username (can be "NULL" if no password protection).
+     * @param password The password (can be "NULL" if no password protection).
+     **/
+    public static void httpDelete(
+        String url,
+        String username,
+        String password) {
+        NativeSDK.OrthancPluginHttpDelete(url, username, password);
+    }
+
+    /**
+     * Return the number of available fonts.
+     * 
+     * This function returns the number of fonts that are built in the Orthanc core.
+     * These fonts can be used to draw texts on images through OrthancPluginDrawText().
+     * 
+     * @return The number of fonts.
+     **/
+    public static int getFontsCount() {
+        return NativeSDK.OrthancPluginGetFontsCount();
+    }
+
+    /**
+     * Return the name of a font.
+     * 
+     * This function returns the name of a font that is built in the Orthanc core.
+     * 
+     * @param fontIndex The index of the font. This value must be less than
+     * OrthancPluginGetFontsCount().
+     * @return The resulting string.
+     **/
+    public static String getFontName(
+        int fontIndex) {
+        return NativeSDK.OrthancPluginGetFontName(fontIndex);
+    }
+
+    /**
+     * Return the size of a font.
+     * 
+     * This function returns the size of a font that is built in the Orthanc core.
+     * 
+     * @param fontIndex The index of the font. This value must be less than
+     * OrthancPluginGetFontsCount().
+     * @return The font size.
+     **/
+    public static int getFontSize(
+        int fontIndex) {
+        return NativeSDK.OrthancPluginGetFontSize(fontIndex);
+    }
+
+    /**
+     * Declare a custom error code for this plugin.
+     * 
+     * This function declares a custom error code that can be generated by this plugin.
+     * This declaration is used to enrich the body of the HTTP answer in the case of an
+     * error, and to set the proper HTTP status code.
+     * 
+     * @param code The error code that is internal to this plugin.
+     * @param httpStatus The HTTP status corresponding to this error.
+     * @param message The description of the error.
+     **/
+    public static void registerErrorCode(
+        int code,
+        short httpStatus,
+        String message) {
+        NativeSDK.OrthancPluginRegisterErrorCode(code, httpStatus, message);
+    }
+
+    /**
+     * Register a new tag into the DICOM dictionary.
+     * 
+     * This function declares a new public tag in the dictionary of DICOM tags that are
+     * known to Orthanc. This function should be used in the OrthancPluginInitialize()
+     * callback.
+     * 
+     * @param group The group of the tag.
+     * @param element The element of the tag.
+     * @param vr The value representation of the tag.
+     * @param name The nickname of the tag.
+     * @param minMultiplicity The minimum multiplicity of the tag (must be above 0).
+     * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means
+     * an arbitrary multiplicity (""n"").
+     **/
+    public static void registerDictionaryTag(
+        short group,
+        short element,
+        ValueRepresentation vr,
+        String name,
+        int minMultiplicity,
+        int maxMultiplicity) {
+        NativeSDK.OrthancPluginRegisterDictionaryTag(group, element, vr.getValue(), name, minMultiplicity, maxMultiplicity);
+    }
+
+    /**
+     * Register a new private tag into the DICOM dictionary.
+     * 
+     * This function declares a new private tag in the dictionary of DICOM tags that
+     * are known to Orthanc. This function should be used in the
+     * OrthancPluginInitialize() callback.
+     * 
+     * @param group The group of the tag.
+     * @param element The element of the tag.
+     * @param vr The value representation of the tag.
+     * @param name The nickname of the tag.
+     * @param minMultiplicity The minimum multiplicity of the tag (must be above 0).
+     * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means
+     * an arbitrary multiplicity (""n"").
+     * @param privateCreator The private creator of this private tag.
+     **/
+    public static void registerPrivateDictionaryTag(
+        short group,
+        short element,
+        ValueRepresentation vr,
+        String name,
+        int minMultiplicity,
+        int maxMultiplicity,
+        String privateCreator) {
+        NativeSDK.OrthancPluginRegisterPrivateDictionaryTag(group, element, vr.getValue(), name, minMultiplicity, maxMultiplicity, privateCreator);
+    }
+
+    /**
+     * Format a DICOM memory buffer as a JSON string.
+     * 
+     * This function takes as input a memory buffer containing a DICOM file, and
+     * outputs a JSON string representing the tags of this DICOM file.
+     * 
+     * @param buffer The memory buffer containing the DICOM file.
+     * @param format The output format.
+     * @param flags Flags governing the output.
+     * @param maxStringLength The maximum length of a field. Too long fields will be
+     * output as "null". The 0 value means no maximum length.
+     * @return The resulting string.
+     **/
+    public static String dicomBufferToJson(
+        byte[] buffer,
+        DicomToJsonFormat format,
+        DicomToJsonFlags flags,
+        int maxStringLength) {
+        return NativeSDK.OrthancPluginDicomBufferToJson(buffer, format.getValue(), flags.getValue(), maxStringLength);
+    }
+
+    /**
+     * Format a DICOM instance as a JSON string.
+     * 
+     * This function formats a DICOM instance that is stored in Orthanc, and outputs a
+     * JSON string representing the tags of this DICOM instance.
+     * 
+     * @param instanceId The Orthanc identifier of the instance.
+     * @param format The output format.
+     * @param flags Flags governing the output.
+     * @param maxStringLength The maximum length of a field. Too long fields will be
+     * output as "null". The 0 value means no maximum length.
+     * @return The resulting string.
+     **/
+    public static String dicomInstanceToJson(
+        String instanceId,
+        DicomToJsonFormat format,
+        DicomToJsonFlags flags,
+        int maxStringLength) {
+        return NativeSDK.OrthancPluginDicomInstanceToJson(instanceId, format.getValue(), flags.getValue(), maxStringLength);
+    }
+
+    /**
+     * Create a DICOM instance from a JSON string and an image.
+     * 
+     * This function takes as input a string containing a JSON file describing the
+     * content of a DICOM instance. As an output, it writes the corresponding DICOM
+     * instance to a newly allocated memory buffer. Additionally, an image to be
+     * encoded within the DICOM instance can also be provided.
+     * 
+     * Private tags will be associated with the private creator whose value is
+     * specified in the "DefaultPrivateCreator" configuration option of Orthanc. The
+     * function OrthancPluginCreateDicom2() can be used if another private creator must
+     * be used to create this instance.
+     * 
+     * @param json The input JSON file.
+     * @param pixelData The image. Can be NULL, if the pixel data is encoded inside the
+     * JSON with the data URI scheme.
+     * @param flags Flags governing the output.
+     * @return The resulting memory buffer.
+     **/
+    public static byte[] createDicom(
+        String json,
+        Image pixelData,
+        CreateDicomFlags flags) {
+        return NativeSDK.OrthancPluginCreateDicom(json, pixelData.getSelf(), flags.getValue());
+    }
+
+    /**
+     * Compute an MD5 hash.
+     * 
+     * This functions computes the MD5 cryptographic hash of the given memory buffer.
+     * 
+     * @param buffer The source memory buffer.
+     * @return The resulting string.
+     **/
+    public static String computeMd5(
+        byte[] buffer) {
+        return NativeSDK.OrthancPluginComputeMd5(buffer);
+    }
+
+    /**
+     * Compute a SHA-1 hash.
+     * 
+     * This functions computes the SHA-1 cryptographic hash of the given memory buffer.
+     * 
+     * @param buffer The source memory buffer.
+     * @return The resulting string.
+     **/
+    public static String computeSha1(
+        byte[] buffer) {
+        return NativeSDK.OrthancPluginComputeSha1(buffer);
+    }
+
+    /**
+     * Generate an UUID.
+     * 
+     * Generate a random GUID/UUID (globally unique identifier).
+     * 
+     * @return The resulting string.
+     **/
+    public static String generateUuid() {
+        return NativeSDK.OrthancPluginGenerateUuid();
+    }
+
+    /**
+     * Detect the MIME type of a file.
+     * 
+     * This function returns the MIME type of a file by inspecting its extension.
+     * 
+     * @param path Path to the file.
+     * @return The resulting string.
+     **/
+    public static String autodetectMimeType(
+        String path) {
+        return NativeSDK.OrthancPluginAutodetectMimeType(path);
+    }
+
+    /**
+     * Set the value of a metrics.
+     * 
+     * This function sets the value of a metrics to monitor the behavior of the plugin
+     * through tools such as Prometheus. The values of all the metrics are stored
+     * within the Orthanc context.
+     * 
+     * @param name The name of the metrics to be set.
+     * @param value The value of the metrics.
+     * @param type The type of the metrics. This parameter is only taken into
+     * consideration the first time this metrics is set.
+     **/
+    public static void setMetricsValue(
+        String name,
+        float value,
+        MetricsType type) {
+        NativeSDK.OrthancPluginSetMetricsValue(name, value, type.getValue());
+    }
+
+    /**
+     * Returns the symbolic name of a DICOM tag.
+     * 
+     * This function makes a lookup to the dictionary of DICOM tags that are known to
+     * Orthanc, and returns the symbolic name of a DICOM tag.
+     * 
+     * @param group The group of the tag.
+     * @param element The element of the tag.
+     * @param privateCreator For private tags, the name of the private creator (can be
+     * NULL).
+     * @return The resulting string.
+     **/
+    public static String getTagName(
+        short group,
+        short element,
+        String privateCreator) {
+        return NativeSDK.OrthancPluginGetTagName(group, element, privateCreator);
+    }
+
+    /**
+     * Generate a token to grant full access to the REST API of Orthanc
+     * 
+     * This function generates a token that can be set in the HTTP header
+     * "Authorization" so as to grant full access to the REST API of Orthanc using an
+     * external HTTP client. Using this function avoids the need of adding a separate
+     * user in the "RegisteredUsers" configuration of Orthanc, which eases deployments.
+     * 
+     * This feature is notably useful in multiprocess scenarios, where a subprocess
+     * created by a plugin has no access to the "OrthancPluginContext", and thus cannot
+     * call "OrthancPluginRestApi[Get|Post|Put|Delete]()".
+     * 
+     * This situation is frequently encountered in Python plugins, where the
+     * "multiprocessing" package can be used to bypass the Global Interpreter Lock
+     * (GIL) and thus to improve performance and concurrency.
+     * 
+     * @return The resulting string.
+     **/
+    public static String generateRestApiAuthorizationToken() {
+        return NativeSDK.OrthancPluginGenerateRestApiAuthorizationToken();
+    }
+
+    /**
+     * Create a DICOM instance from a JSON string and an image, with a private creator.
+     * 
+     * This function takes as input a string containing a JSON file describing the
+     * content of a DICOM instance. As an output, it writes the corresponding DICOM
+     * instance to a newly allocated memory buffer. Additionally, an image to be
+     * encoded within the DICOM instance can also be provided.
+     * 
+     * Contrarily to the function OrthancPluginCreateDicom(), this function can be
+     * explicitly provided with a private creator.
+     * 
+     * @param json The input JSON file.
+     * @param pixelData The image. Can be NULL, if the pixel data is encoded inside the
+     * JSON with the data URI scheme.
+     * @param flags Flags governing the output.
+     * @param privateCreator The private creator to be used for the private DICOM tags.
+     * Check out the global configuration option "Dictionary" of Orthanc.
+     * @return The resulting memory buffer.
+     **/
+    public static byte[] createDicom2(
+        String json,
+        Image pixelData,
+        CreateDicomFlags flags,
+        String privateCreator) {
+        return NativeSDK.OrthancPluginCreateDicom2(json, pixelData.getSelf(), flags.getValue(), privateCreator);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/HttpMethod.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,83 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The various HTTP methods for a REST call.
+ **/
+public enum HttpMethod {
+    /**
+     * GET request
+     **/
+    GET(1),
+    /**
+     * POST request
+     **/
+    POST(2),
+    /**
+     * PUT request
+     **/
+    PUT(3),
+    /**
+     * DELETE request
+     **/
+    DELETE(4);
+
+    private int value;
+
+    private HttpMethod(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static HttpMethod getInstance(int value) {
+        if (value == 1) {
+            return GET;
+        }
+        if (value == 2) {
+            return POST;
+        }
+        if (value == 3) {
+            return PUT;
+        }
+        if (value == 4) {
+            return DELETE;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration HttpMethod: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/IdentifierConstraint.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,84 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The constraints on the DICOM identifiers that must be supported by the database
+ * plugins.
+ **/
+public enum IdentifierConstraint {
+    /**
+     * Equal
+     **/
+    EQUAL(1),
+    /**
+     * Less or equal
+     **/
+    SMALLER_OR_EQUAL(2),
+    /**
+     * More or equal
+     **/
+    GREATER_OR_EQUAL(3),
+    /**
+     * Case-sensitive wildcard matching (with * and ?)
+     **/
+    WILDCARD(4);
+
+    private int value;
+
+    private IdentifierConstraint(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static IdentifierConstraint getInstance(int value) {
+        if (value == 1) {
+            return EQUAL;
+        }
+        if (value == 2) {
+            return SMALLER_OR_EQUAL;
+        }
+        if (value == 3) {
+            return GREATER_OR_EQUAL;
+        }
+        if (value == 4) {
+            return WILDCARD;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration IdentifierConstraint: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/Image.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,207 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * 2D image managed by the Orthanc core
+ **/
+public class Image {
+    private long self;
+
+    /**
+     * Construct a Java object wrapping a C object that is managed by Orthanc.
+     * @param self Pointer to the C object.
+     **/
+    protected Image(long self) {
+        if (self == 0) {
+            throw new IllegalArgumentException("Null pointer");
+        } else {
+            this.self = self;
+        }
+    }
+
+    /**
+     * Return the C object that is associated with this Java wrapper.
+     * @return Pointer to the C object.
+     **/
+    protected long getSelf() {
+        return self;
+    }
+
+    @Override
+    protected void finalize() throws Throwable {
+        dispose();
+        super.finalize();
+    }
+
+    /**
+     * Manually deallocate the C object that is associated with this Java wrapper.
+     *
+     * This method can be used to immediately deallocate the C object,
+     * instead of waiting for the garbage collector to dispose the Java wrapper.
+     **/
+    public void dispose() {
+        if (self != 0) {
+            NativeSDK.OrthancPluginFreeImage(self);
+            self = 0;
+        }
+    }
+
+    /**
+     * Decode a compressed image.
+     * 
+     * This function decodes a compressed image from a memory buffer.
+     * 
+     * @param data Pointer to a memory buffer containing the compressed image.
+     * @param format The file format of the compressed image.
+     * @return The newly constructed object.
+     **/
+    public static Image uncompressImage(
+        byte[] data,
+        ImageFormat format) {
+        return new Image(NativeSDK.OrthancPluginUncompressImage(data, format.getValue()));
+    }
+
+    /**
+     * Create an image.
+     * 
+     * This function creates an image of given size and format.
+     * 
+     * @param format The format of the pixels.
+     * @param width The width of the image.
+     * @param height The height of the image.
+     * @return The newly constructed object.
+     **/
+    public static Image createImage(
+        PixelFormat format,
+        int width,
+        int height) {
+        return new Image(NativeSDK.OrthancPluginCreateImage(format.getValue(), width, height));
+    }
+
+    /**
+     * Decode one frame from a DICOM instance.
+     * 
+     * This function decodes one frame of a DICOM image that is stored in a memory
+     * buffer. This function will give the same result as
+     * OrthancPluginUncompressImage() for single-frame DICOM images.
+     * 
+     * @param buffer Pointer to a memory buffer containing the DICOM image.
+     * @param frameIndex The index of the frame of interest in a multi-frame image.
+     * @return The newly constructed object.
+     **/
+    public static Image decodeDicomImage(
+        byte[] buffer,
+        int frameIndex) {
+        return new Image(NativeSDK.OrthancPluginDecodeDicomImage(buffer, frameIndex));
+    }
+
+
+    /**
+     * Return the pixel format of an image.
+     * 
+     * This function returns the type of memory layout for the pixels of the given
+     * image.
+     * 
+     * @return The pixel format.
+     **/
+    public PixelFormat getImagePixelFormat() {
+        return PixelFormat.getInstance(NativeSDK.OrthancPluginGetImagePixelFormat(self));
+    }
+
+    /**
+     * Return the width of an image.
+     * 
+     * This function returns the width of the given image.
+     * 
+     * @return The width.
+     **/
+    public int getImageWidth() {
+        return NativeSDK.OrthancPluginGetImageWidth(self);
+    }
+
+    /**
+     * Return the height of an image.
+     * 
+     * This function returns the height of the given image.
+     * 
+     * @return The height.
+     **/
+    public int getImageHeight() {
+        return NativeSDK.OrthancPluginGetImageHeight(self);
+    }
+
+    /**
+     * Return the pitch of an image.
+     * 
+     * This function returns the pitch of the given image. The pitch is defined as the
+     * number of bytes between 2 successive lines of the image in the memory buffer.
+     * 
+     * @return The pitch.
+     **/
+    public int getImagePitch() {
+        return NativeSDK.OrthancPluginGetImagePitch(self);
+    }
+
+    /**
+     * Change the pixel format of an image.
+     * 
+     * This function creates a new image, changing the memory layout of the pixels.
+     * 
+     * @param targetFormat The target pixel format.
+     * @return The newly constructed object.
+     **/
+    public Image convertPixelFormat(
+        PixelFormat targetFormat) {
+        return new Image(NativeSDK.OrthancPluginConvertPixelFormat(self, targetFormat.getValue()));
+    }
+
+    /**
+     * Draw text on an image.
+     * 
+     * This function draws some text on some image.
+     * 
+     * @param fontIndex The index of the font. This value must be less than
+     * OrthancPluginGetFontsCount().
+     * @param utf8Text The text to be drawn, encoded as an UTF-8 zero-terminated
+     * string.
+     * @param x The X position of the text over the image.
+     * @param y The Y position of the text over the image.
+     * @param r The value of the red color channel of the text.
+     * @param g The value of the green color channel of the text.
+     * @param b The value of the blue color channel of the text.
+     **/
+    public void drawText(
+        int fontIndex,
+        String utf8Text,
+        int x,
+        int y,
+        byte r,
+        byte g,
+        byte b) {
+        NativeSDK.OrthancPluginDrawText(self, fontIndex, utf8Text, x, y, r, g, b);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/ImageFormat.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,76 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The image formats that are supported by the Orthanc core.
+ **/
+public enum ImageFormat {
+    /**
+     * Image compressed using PNG
+     **/
+    PNG(0),
+    /**
+     * Image compressed using JPEG
+     **/
+    JPEG(1),
+    /**
+     * Image compressed using DICOM
+     **/
+    DICOM(2);
+
+    private int value;
+
+    private ImageFormat(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static ImageFormat getInstance(int value) {
+        if (value == 0) {
+            return PNG;
+        }
+        if (value == 1) {
+            return JPEG;
+        }
+        if (value == 2) {
+            return DICOM;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration ImageFormat: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/InstanceOrigin.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,97 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The origin of a DICOM instance that has been received by Orthanc.
+ **/
+public enum InstanceOrigin {
+    /**
+     * Unknown origin
+     **/
+    UNKNOWN(1),
+    /**
+     * Instance received through DICOM protocol
+     **/
+    DICOM_PROTOCOL(2),
+    /**
+     * Instance received through REST API of Orthanc
+     **/
+    REST_API(3),
+    /**
+     * Instance added to Orthanc by a plugin
+     **/
+    PLUGIN(4),
+    /**
+     * Instance added to Orthanc by a Lua script
+     **/
+    LUA(5),
+    /**
+     * Instance received through WebDAV (new in 1.8.0)
+     **/
+    WEB_DAV(6);
+
+    private int value;
+
+    private InstanceOrigin(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static InstanceOrigin getInstance(int value) {
+        if (value == 1) {
+            return UNKNOWN;
+        }
+        if (value == 2) {
+            return DICOM_PROTOCOL;
+        }
+        if (value == 3) {
+            return REST_API;
+        }
+        if (value == 4) {
+            return PLUGIN;
+        }
+        if (value == 5) {
+            return LUA;
+        }
+        if (value == 6) {
+            return WEB_DAV;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration InstanceOrigin: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/Job.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,88 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * Orthanc job
+ **/
+public class Job {
+    private long self;
+
+    /**
+     * Construct a Java object wrapping a C object that is managed by Orthanc.
+     * @param self Pointer to the C object.
+     **/
+    protected Job(long self) {
+        if (self == 0) {
+            throw new IllegalArgumentException("Null pointer");
+        } else {
+            this.self = self;
+        }
+    }
+
+    /**
+     * Return the C object that is associated with this Java wrapper.
+     * @return Pointer to the C object.
+     **/
+    protected long getSelf() {
+        return self;
+    }
+
+    @Override
+    protected void finalize() throws Throwable {
+        dispose();
+        super.finalize();
+    }
+
+    /**
+     * Manually deallocate the C object that is associated with this Java wrapper.
+     *
+     * This method can be used to immediately deallocate the C object,
+     * instead of waiting for the garbage collector to dispose the Java wrapper.
+     **/
+    public void dispose() {
+        if (self != 0) {
+            NativeSDK.OrthancPluginFreeJob(self);
+            self = 0;
+        }
+    }
+
+
+    /**
+     * Submit a new job to the jobs engine of Orthanc.
+     * 
+     * This function adds the given job to the pending jobs of Orthanc. Orthanc will
+     * take take of freeing it by invoking the finalization callback provided to
+     * OrthancPluginCreateJob().
+     * 
+     * @param priority The priority of the job.
+     * @return The resulting string.
+     **/
+    public String submitJob(
+        int priority) {
+        return NativeSDK.OrthancPluginSubmitJob(self, priority);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/JobStepStatus.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,76 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The possible status for one single step of a job.
+ **/
+public enum JobStepStatus {
+    /**
+     * The job has successfully executed all its steps
+     **/
+    SUCCESS(1),
+    /**
+     * The job has failed while executing this step
+     **/
+    FAILURE(2),
+    /**
+     * The job has still data to process after this step
+     **/
+    CONTINUE(3);
+
+    private int value;
+
+    private JobStepStatus(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static JobStepStatus getInstance(int value) {
+        if (value == 1) {
+            return SUCCESS;
+        }
+        if (value == 2) {
+            return FAILURE;
+        }
+        if (value == 3) {
+            return CONTINUE;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration JobStepStatus: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/JobStopReason.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,85 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * Explains why the job should stop and release the resources it has allocated.
+ * This is especially important to disambiguate between the "paused" condition and
+ * the "final" conditions (success, failure, or canceled).
+ **/
+public enum JobStopReason {
+    /**
+     * The job has succeeded
+     **/
+    SUCCESS(1),
+    /**
+     * The job was paused, and will be resumed later
+     **/
+    PAUSED(2),
+    /**
+     * The job has failed, and might be resubmitted later
+     **/
+    FAILURE(3),
+    /**
+     * The job was canceled, and might be resubmitted later
+     **/
+    CANCELED(4);
+
+    private int value;
+
+    private JobStopReason(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static JobStopReason getInstance(int value) {
+        if (value == 1) {
+            return SUCCESS;
+        }
+        if (value == 2) {
+            return PAUSED;
+        }
+        if (value == 3) {
+            return FAILURE;
+        }
+        if (value == 4) {
+            return CANCELED;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration JobStopReason: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/MetricsType.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,71 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The available types of metrics.
+ **/
+public enum MetricsType {
+    /**
+     * Default metrics
+     **/
+    DEFAULT(0),
+    /**
+     * This metrics represents a time duration. Orthanc will keep the maximum value of
+     * the metrics over a sliding window of ten seconds, which is useful if the metrics
+     * is sampled frequently.
+     **/
+    TIMER(1);
+
+    private int value;
+
+    private MetricsType(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static MetricsType getInstance(int value) {
+        if (value == 0) {
+            return DEFAULT;
+        }
+        if (value == 1) {
+            return TIMER;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration MetricsType: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/NativeSDK.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,150 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
+class NativeSDK {
+    public static native int OrthancPluginCheckVersionAdvanced(int arg0, int arg1, int arg2);
+    public static native int OrthancPluginCheckVersion();
+    public static native void OrthancPluginLogError(String arg0);
+    public static native void OrthancPluginLogWarning(String arg0);
+    public static native void OrthancPluginLogInfo(String arg0);
+    public static native byte[] OrthancPluginGetDicomForInstance(String arg0);
+    public static native byte[] OrthancPluginRestApiGet(String arg0);
+    public static native byte[] OrthancPluginRestApiGetAfterPlugins(String arg0);
+    public static native byte[] OrthancPluginRestApiPost(String arg0, byte[] arg1);
+    public static native byte[] OrthancPluginRestApiPostAfterPlugins(String arg0, byte[] arg1);
+    public static native void OrthancPluginRestApiDelete(String arg0);
+    public static native void OrthancPluginRestApiDeleteAfterPlugins(String arg0);
+    public static native byte[] OrthancPluginRestApiPut(String arg0, byte[] arg1);
+    public static native byte[] OrthancPluginRestApiPutAfterPlugins(String arg0, byte[] arg1);
+    public static native String OrthancPluginLookupPatient(String arg0);
+    public static native String OrthancPluginLookupStudy(String arg0);
+    public static native String OrthancPluginLookupStudyWithAccessionNumber(String arg0);
+    public static native String OrthancPluginLookupSeries(String arg0);
+    public static native String OrthancPluginLookupInstance(String arg0);
+    public static native String OrthancPluginGetOrthancPath();
+    public static native String OrthancPluginGetOrthancDirectory();
+    public static native String OrthancPluginGetConfigurationPath();
+    public static native void OrthancPluginSetRootUri(String arg0);
+    public static native void OrthancPluginSetDescription(String arg0);
+    public static native void OrthancPluginExtendOrthancExplorer(String arg0);
+    public static native String OrthancPluginGetGlobalProperty(int arg0, String arg1);
+    public static native void OrthancPluginSetGlobalProperty(int arg0, String arg1);
+    public static native int OrthancPluginGetCommandLineArgumentsCount();
+    public static native String OrthancPluginGetCommandLineArgument(int arg0);
+    public static native int OrthancPluginGetExpectedDatabaseVersion();
+    public static native String OrthancPluginGetConfiguration();
+    public static native byte[] OrthancPluginBufferCompression(byte[] arg0, int arg2, byte arg3);
+    public static native byte[] OrthancPluginReadFile(String arg0);
+    public static native void OrthancPluginWriteFile(String arg0, byte[] arg1);
+    public static native String OrthancPluginGetErrorDescription(int arg0);
+    public static native long OrthancPluginUncompressImage(byte[] arg0, int arg2);
+    public static native byte[] OrthancPluginCompressPngImage(int arg0, int arg1, int arg2, int arg3, byte[] arg4);
+    public static native byte[] OrthancPluginCompressJpegImage(int arg0, int arg1, int arg2, int arg3, byte[] arg4, byte arg5);
+    public static native byte[] OrthancPluginHttpGet(String arg0, String arg1, String arg2);
+    public static native byte[] OrthancPluginHttpPost(String arg0, byte[] arg1, String arg3, String arg4);
+    public static native byte[] OrthancPluginHttpPut(String arg0, byte[] arg1, String arg3, String arg4);
+    public static native void OrthancPluginHttpDelete(String arg0, String arg1, String arg2);
+    public static native int OrthancPluginGetFontsCount();
+    public static native String OrthancPluginGetFontName(int arg0);
+    public static native int OrthancPluginGetFontSize(int arg0);
+    public static native void OrthancPluginRegisterErrorCode(int arg0, short arg1, String arg2);
+    public static native void OrthancPluginRegisterDictionaryTag(short arg0, short arg1, int arg2, String arg3, int arg4, int arg5);
+    public static native void OrthancPluginRegisterPrivateDictionaryTag(short arg0, short arg1, int arg2, String arg3, int arg4, int arg5, String arg6);
+    public static native String OrthancPluginDicomBufferToJson(byte[] arg0, int arg2, int arg3, int arg4);
+    public static native String OrthancPluginDicomInstanceToJson(String arg0, int arg1, int arg2, int arg3);
+    public static native byte[] OrthancPluginCreateDicom(String arg0, long arg1, int arg2);
+    public static native long OrthancPluginCreateImage(int arg0, int arg1, int arg2);
+    public static native long OrthancPluginDecodeDicomImage(byte[] arg0, int arg2);
+    public static native String OrthancPluginComputeMd5(byte[] arg0);
+    public static native String OrthancPluginComputeSha1(byte[] arg0);
+    public static native String OrthancPluginGenerateUuid();
+    public static native long OrthancPluginCreateFindMatcher(byte[] arg0);
+    public static native long OrthancPluginGetPeers();
+    public static native String OrthancPluginAutodetectMimeType(String arg0);
+    public static native void OrthancPluginSetMetricsValue(String arg0, float arg1, int arg2);
+    public static native String OrthancPluginGetTagName(short arg0, short arg1, String arg2);
+    public static native long OrthancPluginCreateDicomInstance(byte[] arg0);
+    public static native long OrthancPluginTranscodeDicomInstance(byte[] arg0, String arg2);
+    public static native String OrthancPluginGenerateRestApiAuthorizationToken();
+    public static native byte[] OrthancPluginCreateDicom2(String arg0, long arg1, int arg2, String arg3);
+    public static native void OrthancPluginFreeDicomInstance(long self );
+    public static native String OrthancPluginGetInstanceRemoteAet(long self );
+    public static native long OrthancPluginGetInstanceSize(long self );
+    public static native String OrthancPluginGetInstanceJson(long self );
+    public static native String OrthancPluginGetInstanceSimplifiedJson(long self );
+    public static native int OrthancPluginHasInstanceMetadata(long self, String arg0);
+    public static native String OrthancPluginGetInstanceMetadata(long self, String arg0);
+    public static native int OrthancPluginGetInstanceOrigin(long self );
+    public static native String OrthancPluginGetInstanceTransferSyntaxUid(long self );
+    public static native int OrthancPluginHasInstancePixelData(long self );
+    public static native int OrthancPluginGetInstanceFramesCount(long self );
+    public static native byte[] OrthancPluginGetInstanceRawFrame(long self, int arg0);
+    public static native long OrthancPluginGetInstanceDecodedFrame(long self, int arg0);
+    public static native byte[] OrthancPluginSerializeDicomInstance(long self );
+    public static native String OrthancPluginGetInstanceAdvancedJson(long self, int arg0, int arg1, int arg2);
+    public static native void OrthancPluginFindAddAnswer(long self, byte[] arg0);
+    public static native void OrthancPluginFindMarkIncomplete(long self );
+    public static native void OrthancPluginFreeFindMatcher(long self );
+    public static native int OrthancPluginFindMatcherIsMatch(long self, byte[] arg0);
+    public static native int OrthancPluginGetFindQuerySize(long self );
+    public static native String OrthancPluginGetFindQueryTagName(long self, int arg0);
+    public static native String OrthancPluginGetFindQueryValue(long self, int arg0);
+    public static native void OrthancPluginFreeImage(long self );
+    public static native int OrthancPluginGetImagePixelFormat(long self );
+    public static native int OrthancPluginGetImageWidth(long self );
+    public static native int OrthancPluginGetImageHeight(long self );
+    public static native int OrthancPluginGetImagePitch(long self );
+    public static native long OrthancPluginConvertPixelFormat(long self, int arg0);
+    public static native void OrthancPluginDrawText(long self, int arg0, String arg1, int arg2, int arg3, byte arg4, byte arg5, byte arg6);
+    public static native void OrthancPluginFreeJob(long self );
+    public static native String OrthancPluginSubmitJob(long self, int arg0);
+    public static native void OrthancPluginFreePeers(long self );
+    public static native int OrthancPluginGetPeersCount(long self );
+    public static native String OrthancPluginGetPeerName(long self, int arg0);
+    public static native String OrthancPluginGetPeerUrl(long self, int arg0);
+    public static native String OrthancPluginGetPeerUserProperty(long self, int arg0, String arg1);
+    public static native void OrthancPluginAnswerBuffer(long self, byte[] arg0, String arg2);
+    public static native void OrthancPluginCompressAndAnswerPngImage(long self, int arg0, int arg1, int arg2, int arg3, byte[] arg4);
+    public static native void OrthancPluginRedirect(long self, String arg0);
+    public static native void OrthancPluginSendHttpStatusCode(long self, short arg0);
+    public static native void OrthancPluginSendUnauthorized(long self, String arg0);
+    public static native void OrthancPluginSendMethodNotAllowed(long self, String arg0);
+    public static native void OrthancPluginSetCookie(long self, String arg0, String arg1);
+    public static native void OrthancPluginSetHttpHeader(long self, String arg0, String arg1);
+    public static native void OrthancPluginStartMultipartAnswer(long self, String arg0, String arg1);
+    public static native void OrthancPluginSendMultipartItem(long self, byte[] arg0);
+    public static native void OrthancPluginSendHttpStatus(long self, short arg0, byte[] arg1);
+    public static native void OrthancPluginCompressAndAnswerJpegImage(long self, int arg0, int arg1, int arg2, int arg3, byte[] arg4, byte arg5);
+    public static native void OrthancPluginSetHttpErrorDetails(long self, String arg0, byte arg1);
+    public static native void OrthancPluginStorageAreaCreate(long self, String arg0, byte[] arg1, long arg2, int arg3);
+    public static native byte[] OrthancPluginStorageAreaRead(long self, String arg0, int arg1);
+    public static native void OrthancPluginStorageAreaRemove(long self, String arg0, int arg1);
+    public static native void OrthancPluginReconstructMainDicomTags(long self, int arg0);
+    public static native void OrthancPluginWorklistAddAnswer(long self, long arg0, byte[] arg1);
+    public static native void OrthancPluginWorklistMarkIncomplete(long self );
+    public static native int OrthancPluginWorklistIsMatch(long self, byte[] arg0);
+    public static native byte[] OrthancPluginWorklistGetDicomQuery(long self );
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/OrthancException.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,38 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * Exception related to Orthanc.
+ **/
+public class OrthancException extends RuntimeException {
+    /**
+     * Construct an exception related to Orthanc.
+     * @param errorMessage The error message.
+     **/
+    public OrthancException(String errorMessage) {
+        super(errorMessage);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/Peers.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,155 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * Orthanc peer
+ **/
+public class Peers {
+    private long self;
+
+    /**
+     * Construct a Java object wrapping a C object that is managed by Orthanc.
+     * @param self Pointer to the C object.
+     **/
+    protected Peers(long self) {
+        if (self == 0) {
+            throw new IllegalArgumentException("Null pointer");
+        } else {
+            this.self = self;
+        }
+    }
+
+    /**
+     * Return the C object that is associated with this Java wrapper.
+     * @return Pointer to the C object.
+     **/
+    protected long getSelf() {
+        return self;
+    }
+
+    @Override
+    protected void finalize() throws Throwable {
+        dispose();
+        super.finalize();
+    }
+
+    /**
+     * Manually deallocate the C object that is associated with this Java wrapper.
+     *
+     * This method can be used to immediately deallocate the C object,
+     * instead of waiting for the garbage collector to dispose the Java wrapper.
+     **/
+    public void dispose() {
+        if (self != 0) {
+            NativeSDK.OrthancPluginFreePeers(self);
+            self = 0;
+        }
+    }
+
+    /**
+     * Return the list of available Orthanc peers.
+     * 
+     * This function returns the parameters of the Orthanc peers that are known to the
+     * Orthanc server hosting the plugin.
+     * 
+     * @return The newly constructed object.
+     **/
+    public static Peers getPeers() {
+        return new Peers(NativeSDK.OrthancPluginGetPeers());
+    }
+
+
+    /**
+     * Get the number of Orthanc peers.
+     * 
+     * This function returns the number of Orthanc peers.
+     * 
+     * This function is thread-safe: Several threads sharing the same
+     * OrthancPluginPeers object can simultaneously call this function.
+     * 
+     * @return The number of peers.
+     **/
+    public int getPeersCount() {
+        return NativeSDK.OrthancPluginGetPeersCount(self);
+    }
+
+    /**
+     * Get the symbolic name of an Orthanc peer.
+     * 
+     * This function returns the symbolic name of the Orthanc peer, which corresponds
+     * to the key of the "OrthancPeers" configuration option of Orthanc.
+     * 
+     * This function is thread-safe: Several threads sharing the same
+     * OrthancPluginPeers object can simultaneously call this function.
+     * 
+     * @param peerIndex The index of the peer of interest. This value must be lower
+     * than OrthancPluginGetPeersCount().
+     * @return The resulting string.
+     **/
+    public String getPeerName(
+        int peerIndex) {
+        return NativeSDK.OrthancPluginGetPeerName(self, peerIndex);
+    }
+
+    /**
+     * Get the base URL of an Orthanc peer.
+     * 
+     * This function returns the base URL to the REST API of some Orthanc peer.
+     * 
+     * This function is thread-safe: Several threads sharing the same
+     * OrthancPluginPeers object can simultaneously call this function.
+     * 
+     * @param peerIndex The index of the peer of interest. This value must be lower
+     * than OrthancPluginGetPeersCount().
+     * @return The resulting string.
+     **/
+    public String getPeerUrl(
+        int peerIndex) {
+        return NativeSDK.OrthancPluginGetPeerUrl(self, peerIndex);
+    }
+
+    /**
+     * Get some user-defined property of an Orthanc peer.
+     * 
+     * This function returns some user-defined property of some Orthanc peer. An
+     * user-defined property is a property that is associated with the peer in the
+     * Orthanc configuration file, but that is not recognized by the Orthanc core.
+     * 
+     * This function is thread-safe: Several threads sharing the same
+     * OrthancPluginPeers object can simultaneously call this function.
+     * 
+     * @param peerIndex The index of the peer of interest. This value must be lower
+     * than OrthancPluginGetPeersCount().
+     * @param userProperty The user property of interest.
+     * @return The resulting string.
+     **/
+    public String getPeerUserProperty(
+        int peerIndex,
+        String userProperty) {
+        return NativeSDK.OrthancPluginGetPeerUserProperty(self, peerIndex, userProperty);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/PixelFormat.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,142 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The memory layout of the pixels of an image.
+ **/
+public enum PixelFormat {
+    /**
+     * Graylevel 8bpp image. The image is graylevel. Each pixel is unsigned and stored
+     * in one byte.
+     **/
+    GRAYSCALE8(1),
+    /**
+     * Graylevel, unsigned 16bpp image. The image is graylevel. Each pixel is unsigned
+     * and stored in two bytes.
+     **/
+    GRAYSCALE16(2),
+    /**
+     * Graylevel, signed 16bpp image. The image is graylevel. Each pixel is signed and
+     * stored in two bytes.
+     **/
+    SIGNED_GRAYSCALE16(3),
+    /**
+     * Color image in RGB24 format. This format describes a color image. The pixels are
+     * stored in 3 consecutive bytes. The memory layout is RGB.
+     **/
+    RGB24(4),
+    /**
+     * Color image in RGBA32 format. This format describes a color image. The pixels
+     * are stored in 4 consecutive bytes. The memory layout is RGBA.
+     **/
+    RGBA32(5),
+    /**
+     * Unknown pixel format
+     **/
+    UNKNOWN(6),
+    /**
+     * Color image in RGB48 format. This format describes a color image. The pixels are
+     * stored in 6 consecutive bytes. The memory layout is RRGGBB.
+     **/
+    RGB48(7),
+    /**
+     * Graylevel, unsigned 32bpp image. The image is graylevel. Each pixel is unsigned
+     * and stored in four bytes.
+     **/
+    GRAYSCALE32(8),
+    /**
+     * Graylevel, floating-point 32bpp image. The image is graylevel. Each pixel is
+     * floating-point and stored in four bytes.
+     **/
+    FLOAT32(9),
+    /**
+     * Color image in BGRA32 format. This format describes a color image. The pixels
+     * are stored in 4 consecutive bytes. The memory layout is BGRA.
+     **/
+    BGRA32(10),
+    /**
+     * Graylevel, unsigned 64bpp image. The image is graylevel. Each pixel is unsigned
+     * and stored in eight bytes.
+     **/
+    GRAYSCALE64(11);
+
+    private int value;
+
+    private PixelFormat(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static PixelFormat getInstance(int value) {
+        if (value == 1) {
+            return GRAYSCALE8;
+        }
+        if (value == 2) {
+            return GRAYSCALE16;
+        }
+        if (value == 3) {
+            return SIGNED_GRAYSCALE16;
+        }
+        if (value == 4) {
+            return RGB24;
+        }
+        if (value == 5) {
+            return RGBA32;
+        }
+        if (value == 6) {
+            return UNKNOWN;
+        }
+        if (value == 7) {
+            return RGB48;
+        }
+        if (value == 8) {
+            return GRAYSCALE32;
+        }
+        if (value == 9) {
+            return FLOAT32;
+        }
+        if (value == 10) {
+            return BGRA32;
+        }
+        if (value == 11) {
+            return GRAYSCALE64;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration PixelFormat: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/ReceivedInstanceAction.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,76 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The action to be taken after ReceivedInstanceCallback is triggered
+ **/
+public enum ReceivedInstanceAction {
+    /**
+     * Keep the instance as is
+     **/
+    KEEP_AS_IS(1),
+    /**
+     * Modify the instance
+     **/
+    MODIFY(2),
+    /**
+     * Discard the instance
+     **/
+    DISCARD(3);
+
+    private int value;
+
+    private ReceivedInstanceAction(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static ReceivedInstanceAction getInstance(int value) {
+        if (value == 1) {
+            return KEEP_AS_IS;
+        }
+        if (value == 2) {
+            return MODIFY;
+        }
+        if (value == 3) {
+            return DISCARD;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration ReceivedInstanceAction: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/ResourceType.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,90 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The supported types of DICOM resources.
+ **/
+public enum ResourceType {
+    /**
+     * Patient
+     **/
+    PATIENT(0),
+    /**
+     * Study
+     **/
+    STUDY(1),
+    /**
+     * Series
+     **/
+    SERIES(2),
+    /**
+     * Instance
+     **/
+    INSTANCE(3),
+    /**
+     * Unavailable resource type
+     **/
+    NONE(4);
+
+    private int value;
+
+    private ResourceType(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static ResourceType getInstance(int value) {
+        if (value == 0) {
+            return PATIENT;
+        }
+        if (value == 1) {
+            return STUDY;
+        }
+        if (value == 2) {
+            return SERIES;
+        }
+        if (value == 3) {
+            return INSTANCE;
+        }
+        if (value == 4) {
+            return NONE;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration ResourceType: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/RestOutput.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,271 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * Output for a call to the REST API of Orthanc
+ **/
+public class RestOutput {
+    private long self;
+
+    /**
+     * Construct a Java object wrapping a C object that is managed by Orthanc.
+     * @param self Pointer to the C object.
+     **/
+    protected RestOutput(long self) {
+        if (self == 0) {
+            throw new IllegalArgumentException("Null pointer");
+        } else {
+            this.self = self;
+        }
+    }
+
+    /**
+     * Return the C object that is associated with this Java wrapper.
+     * @return Pointer to the C object.
+     **/
+    protected long getSelf() {
+        return self;
+    }
+
+
+
+    /**
+     * Answer to a REST request.
+     * 
+     * This function answers to a REST request with the content of a memory buffer.
+     * 
+     * @param answer Pointer to the memory buffer containing the answer.
+     * @param mimeType The MIME type of the answer.
+     **/
+    public void answerBuffer(
+        byte[] answer,
+        String mimeType) {
+        NativeSDK.OrthancPluginAnswerBuffer(self, answer, mimeType);
+    }
+
+    /**
+     * Answer to a REST request with a PNG image.
+     * 
+     * This function answers to a REST request with a PNG image. The parameters of this
+     * function describe a memory buffer that contains an uncompressed image. The image
+     * will be automatically compressed as a PNG image by the core system of Orthanc.
+     * 
+     * @param format The memory layout of the uncompressed image.
+     * @param width The width of the image.
+     * @param height The height of the image.
+     * @param pitch The pitch of the image (i.e. the number of bytes between 2
+     * successive lines of the image in the memory buffer).
+     * @param buffer The memory buffer containing the uncompressed image.
+     **/
+    public void compressAndAnswerPngImage(
+        PixelFormat format,
+        int width,
+        int height,
+        int pitch,
+        byte[] buffer) {
+        NativeSDK.OrthancPluginCompressAndAnswerPngImage(self, format.getValue(), width, height, pitch, buffer);
+    }
+
+    /**
+     * Redirect a REST request.
+     * 
+     * This function answers to a REST request by redirecting the user to another URI
+     * using HTTP status 301.
+     * 
+     * @param redirection Where to redirect.
+     **/
+    public void redirect(
+        String redirection) {
+        NativeSDK.OrthancPluginRedirect(self, redirection);
+    }
+
+    /**
+     * Send a HTTP status code.
+     * 
+     * This function answers to a REST request by sending a HTTP status code (such as
+     * "400 - Bad Request"). Note that: - Successful requests (status 200) must use
+     * ::OrthancPluginAnswerBuffer(). - Redirections (status 301) must use
+     * ::OrthancPluginRedirect(). - Unauthorized access (status 401) must use
+     * ::OrthancPluginSendUnauthorized(). - Methods not allowed (status 405) must use
+     * ::OrthancPluginSendMethodNotAllowed().
+     * 
+     * @param status The HTTP status code to be sent.
+     **/
+    public void sendHttpStatusCode(
+        short status) {
+        NativeSDK.OrthancPluginSendHttpStatusCode(self, status);
+    }
+
+    /**
+     * Signal that a REST request is not authorized.
+     * 
+     * This function answers to a REST request by signaling that it is not authorized.
+     * 
+     * @param realm The realm for the authorization process.
+     **/
+    public void sendUnauthorized(
+        String realm) {
+        NativeSDK.OrthancPluginSendUnauthorized(self, realm);
+    }
+
+    /**
+     * Signal that this URI does not support this HTTP method.
+     * 
+     * This function answers to a REST request by signaling that the queried URI does
+     * not support this method.
+     * 
+     * @param allowedMethods The allowed methods for this URI (e.g. "GET,POST" after a
+     * PUT or a POST request).
+     **/
+    public void sendMethodNotAllowed(
+        String allowedMethods) {
+        NativeSDK.OrthancPluginSendMethodNotAllowed(self, allowedMethods);
+    }
+
+    /**
+     * Set a cookie.
+     * 
+     * This function sets a cookie in the HTTP client.
+     * 
+     * @param cookie The cookie to be set.
+     * @param value The value of the cookie.
+     **/
+    public void setCookie(
+        String cookie,
+        String value) {
+        NativeSDK.OrthancPluginSetCookie(self, cookie, value);
+    }
+
+    /**
+     * Set some HTTP header.
+     * 
+     * This function sets a HTTP header in the HTTP answer.
+     * 
+     * @param key The HTTP header to be set.
+     * @param value The value of the HTTP header.
+     **/
+    public void setHttpHeader(
+        String key,
+        String value) {
+        NativeSDK.OrthancPluginSetHttpHeader(self, key, value);
+    }
+
+    /**
+     * Start an HTTP multipart answer.
+     * 
+     * Initiates a HTTP multipart answer, as the result of a REST request.
+     * 
+     * @param subType The sub-type of the multipart answer ("mixed" or "related").
+     * @param contentType The MIME type of the items in the multipart answer.
+     **/
+    public void startMultipartAnswer(
+        String subType,
+        String contentType) {
+        NativeSDK.OrthancPluginStartMultipartAnswer(self, subType, contentType);
+    }
+
+    /**
+     * Send an item as a part of some HTTP multipart answer.
+     * 
+     * This function sends an item as a part of some HTTP multipart answer that was
+     * initiated by OrthancPluginStartMultipartAnswer().
+     * 
+     * @param answer Pointer to the memory buffer containing the item.
+     **/
+    public void sendMultipartItem(
+        byte[] answer) {
+        NativeSDK.OrthancPluginSendMultipartItem(self, answer);
+    }
+
+    /**
+     * Send a HTTP status, with a custom body.
+     * 
+     * This function answers to a HTTP request by sending a HTTP status code (such as
+     * "400 - Bad Request"), together with a body describing the error. The body will
+     * only be returned if the configuration option "HttpDescribeErrors" of Orthanc is
+     * set to "true".
+     * 
+     * Note that: - Successful requests (status 200) must use
+     * ::OrthancPluginAnswerBuffer(). - Redirections (status 301) must use
+     * ::OrthancPluginRedirect(). - Unauthorized access (status 401) must use
+     * ::OrthancPluginSendUnauthorized(). - Methods not allowed (status 405) must use
+     * ::OrthancPluginSendMethodNotAllowed().
+     * 
+     * @param status The HTTP status code to be sent.
+     * @param body The body of the answer.
+     **/
+    public void sendHttpStatus(
+        short status,
+        byte[] body) {
+        NativeSDK.OrthancPluginSendHttpStatus(self, status, body);
+    }
+
+    /**
+     * Answer to a REST request with a JPEG image.
+     * 
+     * This function answers to a REST request with a JPEG image. The parameters of
+     * this function describe a memory buffer that contains an uncompressed image. The
+     * image will be automatically compressed as a JPEG image by the core system of
+     * Orthanc.
+     * 
+     * @param format The memory layout of the uncompressed image.
+     * @param width The width of the image.
+     * @param height The height of the image.
+     * @param pitch The pitch of the image (i.e. the number of bytes between 2
+     * successive lines of the image in the memory buffer).
+     * @param buffer The memory buffer containing the uncompressed image.
+     * @param quality The quality of the JPEG encoding, between 1 (worst quality, best
+     * compression) and 100 (best quality, worst compression).
+     **/
+    public void compressAndAnswerJpegImage(
+        PixelFormat format,
+        int width,
+        int height,
+        int pitch,
+        byte[] buffer,
+        byte quality) {
+        NativeSDK.OrthancPluginCompressAndAnswerJpegImage(self, format.getValue(), width, height, pitch, buffer, quality);
+    }
+
+    /**
+     * Provide a detailed description for an HTTP error.
+     * 
+     * This function sets the detailed description associated with an HTTP error. This
+     * description will be displayed in the "Details" field of the JSON body of the
+     * HTTP answer. It is only taken into consideration if the REST callback returns an
+     * error code that is different from "OrthancPluginErrorCode_Success", and if the
+     * "HttpDescribeErrors" configuration option of Orthanc is set to "true".
+     * 
+     * @param details The details of the error message.
+     * @param log Whether to also write the detailed error to the Orthanc logs.
+     **/
+    public void setHttpErrorDetails(
+        String details,
+        byte log) {
+        NativeSDK.OrthancPluginSetHttpErrorDetails(self, details, log);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/ServerChunkedRequestReader.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,55 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * Read for a chunked HTTP request
+ **/
+public class ServerChunkedRequestReader {
+    private long self;
+
+    /**
+     * Construct a Java object wrapping a C object that is managed by Orthanc.
+     * @param self Pointer to the C object.
+     **/
+    protected ServerChunkedRequestReader(long self) {
+        if (self == 0) {
+            throw new IllegalArgumentException("Null pointer");
+        } else {
+            this.self = self;
+        }
+    }
+
+    /**
+     * Return the C object that is associated with this Java wrapper.
+     * @return Pointer to the C object.
+     **/
+    protected long getSelf() {
+        return self;
+    }
+
+
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/StorageArea.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,120 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * Storage area plugin
+ **/
+public class StorageArea {
+    private long self;
+
+    /**
+     * Construct a Java object wrapping a C object that is managed by Orthanc.
+     * @param self Pointer to the C object.
+     **/
+    protected StorageArea(long self) {
+        if (self == 0) {
+            throw new IllegalArgumentException("Null pointer");
+        } else {
+            this.self = self;
+        }
+    }
+
+    /**
+     * Return the C object that is associated with this Java wrapper.
+     * @return Pointer to the C object.
+     **/
+    protected long getSelf() {
+        return self;
+    }
+
+
+
+    /**
+     * Create a file inside the storage area.
+     * 
+     * This function creates a new file inside the storage area that is currently used
+     * by Orthanc.
+     * 
+     * @param uuid The identifier of the file to be created.
+     * @param content The content to store in the newly created file.
+     * @param size The size of the content.
+     * @param type The type of the file content.
+     **/
+    public void storageAreaCreate(
+        String uuid,
+        byte[] content,
+        long size,
+        ContentType type) {
+        NativeSDK.OrthancPluginStorageAreaCreate(self, uuid, content, size, type.getValue());
+    }
+
+    /**
+     * Read a file from the storage area.
+     * 
+     * This function reads the content of a given file from the storage area that is
+     * currently used by Orthanc.
+     * 
+     * @param uuid The identifier of the file to be read.
+     * @param type The type of the file content.
+     * @return The resulting memory buffer.
+     **/
+    public byte[] storageAreaRead(
+        String uuid,
+        ContentType type) {
+        return NativeSDK.OrthancPluginStorageAreaRead(self, uuid, type.getValue());
+    }
+
+    /**
+     * Remove a file from the storage area.
+     * 
+     * This function removes a given file from the storage area that is currently used
+     * by Orthanc.
+     * 
+     * @param uuid The identifier of the file to be removed.
+     * @param type The type of the file content.
+     **/
+    public void storageAreaRemove(
+        String uuid,
+        ContentType type) {
+        NativeSDK.OrthancPluginStorageAreaRemove(self, uuid, type.getValue());
+    }
+
+    /**
+     * Reconstruct the main DICOM tags.
+     * 
+     * This function requests the Orthanc core to reconstruct the main DICOM tags of
+     * all the resources of the given type. This function can only be used as a part of
+     * the upgrade of a custom database back-end. A database transaction will be
+     * automatically setup.
+     * 
+     * @param level The type of the resources of interest.
+     **/
+    public void reconstructMainDicomTags(
+        ResourceType level) {
+        NativeSDK.OrthancPluginReconstructMainDicomTags(self, level.getValue());
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/StorageCommitmentFailureReason.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,110 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The available values for the Failure Reason (0008,1197) during storage
+ * commitment.
+ * http://dicom.nema.org/medical/dicom/2019e/output/chtml/part03/sect_C.14.html#sect_C.14.1.1
+ **/
+public enum StorageCommitmentFailureReason {
+    /**
+     * Success: The DICOM instance is properly stored in the SCP
+     **/
+    SUCCESS(0),
+    /**
+     * 0110H: A general failure in processing the operation was encountered
+     **/
+    PROCESSING_FAILURE(1),
+    /**
+     * 0112H: One or more of the elements in the Referenced SOP Instance Sequence was
+     * not available
+     **/
+    NO_SUCH_OBJECT_INSTANCE(2),
+    /**
+     * 0213H: The SCP does not currently have enough resources to store the requested
+     * SOP Instance(s)
+     **/
+    RESOURCE_LIMITATION(3),
+    /**
+     * 0122H: Storage Commitment has been requested for a SOP Instance with a SOP Class
+     * that is not supported by the SCP
+     **/
+    REFERENCED_SOPCLASS_NOT_SUPPORTED(4),
+    /**
+     * 0119H: The SOP Class of an element in the Referenced SOP Instance Sequence did
+     * not correspond to the SOP class registered for this SOP Instance at the SCP
+     **/
+    CLASS_INSTANCE_CONFLICT(5),
+    /**
+     * 0131H: The Transaction UID of the Storage Commitment Request is already in use
+     **/
+    DUPLICATE_TRANSACTION_UID(6);
+
+    private int value;
+
+    private StorageCommitmentFailureReason(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static StorageCommitmentFailureReason getInstance(int value) {
+        if (value == 0) {
+            return SUCCESS;
+        }
+        if (value == 1) {
+            return PROCESSING_FAILURE;
+        }
+        if (value == 2) {
+            return NO_SUCH_OBJECT_INSTANCE;
+        }
+        if (value == 3) {
+            return RESOURCE_LIMITATION;
+        }
+        if (value == 4) {
+            return REFERENCED_SOPCLASS_NOT_SUPPORTED;
+        }
+        if (value == 5) {
+            return CLASS_INSTANCE_CONFLICT;
+        }
+        if (value == 6) {
+            return DUPLICATE_TRANSACTION_UID;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration StorageCommitmentFailureReason: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/ValueRepresentation.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,244 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * The value representations present in the DICOM standard (version 2013).
+ **/
+public enum ValueRepresentation {
+    /**
+     * Application Entity
+     **/
+    AE(1),
+    /**
+     * Age String
+     **/
+    AS(2),
+    /**
+     * Attribute Tag
+     **/
+    AT(3),
+    /**
+     * Code String
+     **/
+    CS(4),
+    /**
+     * Date
+     **/
+    DA(5),
+    /**
+     * Decimal String
+     **/
+    DS(6),
+    /**
+     * Date Time
+     **/
+    DT(7),
+    /**
+     * Floating Point Double
+     **/
+    FD(8),
+    /**
+     * Floating Point Single
+     **/
+    FL(9),
+    /**
+     * Integer String
+     **/
+    IS(10),
+    /**
+     * Long String
+     **/
+    LO(11),
+    /**
+     * Long Text
+     **/
+    LT(12),
+    /**
+     * Other Byte String
+     **/
+    OB(13),
+    /**
+     * Other Float String
+     **/
+    OF(14),
+    /**
+     * Other Word String
+     **/
+    OW(15),
+    /**
+     * Person Name
+     **/
+    PN(16),
+    /**
+     * Short String
+     **/
+    SH(17),
+    /**
+     * Signed Long
+     **/
+    SL(18),
+    /**
+     * Sequence of Items
+     **/
+    SQ(19),
+    /**
+     * Signed Short
+     **/
+    SS(20),
+    /**
+     * Short Text
+     **/
+    ST(21),
+    /**
+     * Time
+     **/
+    TM(22),
+    /**
+     * Unique Identifier (UID)
+     **/
+    UI(23),
+    /**
+     * Unsigned Long
+     **/
+    UL(24),
+    /**
+     * Unknown
+     **/
+    UN(25),
+    /**
+     * Unsigned Short
+     **/
+    US(26),
+    /**
+     * Unlimited Text
+     **/
+    UT(27);
+
+    private int value;
+
+    private ValueRepresentation(int value) {
+        this.value = value;
+    }
+
+    /**
+     * Return the enumeration value that corresponds to an integer value of interest.
+     * @param value The integer value.
+     * @return The enumeration value.
+     **/
+    protected static ValueRepresentation getInstance(int value) {
+        if (value == 1) {
+            return AE;
+        }
+        if (value == 2) {
+            return AS;
+        }
+        if (value == 3) {
+            return AT;
+        }
+        if (value == 4) {
+            return CS;
+        }
+        if (value == 5) {
+            return DA;
+        }
+        if (value == 6) {
+            return DS;
+        }
+        if (value == 7) {
+            return DT;
+        }
+        if (value == 8) {
+            return FD;
+        }
+        if (value == 9) {
+            return FL;
+        }
+        if (value == 10) {
+            return IS;
+        }
+        if (value == 11) {
+            return LO;
+        }
+        if (value == 12) {
+            return LT;
+        }
+        if (value == 13) {
+            return OB;
+        }
+        if (value == 14) {
+            return OF;
+        }
+        if (value == 15) {
+            return OW;
+        }
+        if (value == 16) {
+            return PN;
+        }
+        if (value == 17) {
+            return SH;
+        }
+        if (value == 18) {
+            return SL;
+        }
+        if (value == 19) {
+            return SQ;
+        }
+        if (value == 20) {
+            return SS;
+        }
+        if (value == 21) {
+            return ST;
+        }
+        if (value == 22) {
+            return TM;
+        }
+        if (value == 23) {
+            return UI;
+        }
+        if (value == 24) {
+            return UL;
+        }
+        if (value == 25) {
+            return UN;
+        }
+        if (value == 26) {
+            return US;
+        }
+        if (value == 27) {
+            return UT;
+        }
+
+        throw new IllegalArgumentException("Value out of range for enumeration ValueRepresentation: " + value);
+    }
+
+    /**
+     * Get the integer value corresponding to this enumeration value.
+     * @return The integer value.
+     **/
+    public int getValue() {
+        return value;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/WorklistAnswers.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,81 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * Answers to a DICOM C-FIND worklist query
+ **/
+public class WorklistAnswers {
+    private long self;
+
+    /**
+     * Construct a Java object wrapping a C object that is managed by Orthanc.
+     * @param self Pointer to the C object.
+     **/
+    protected WorklistAnswers(long self) {
+        if (self == 0) {
+            throw new IllegalArgumentException("Null pointer");
+        } else {
+            this.self = self;
+        }
+    }
+
+    /**
+     * Return the C object that is associated with this Java wrapper.
+     * @return Pointer to the C object.
+     **/
+    protected long getSelf() {
+        return self;
+    }
+
+
+
+    /**
+     * Add one answer to some modality worklist request.
+     * 
+     * This function adds one worklist (encoded as a DICOM file) to the set of answers
+     * corresponding to some C-Find SCP request against modality worklists.
+     * 
+     * @param query The worklist query, as received by the callback.
+     * @param dicom The worklist to answer, encoded as a DICOM file.
+     **/
+    public void worklistAddAnswer(
+        WorklistQuery query,
+        byte[] dicom) {
+        NativeSDK.OrthancPluginWorklistAddAnswer(self, query.getSelf(), dicom);
+    }
+
+    /**
+     * Mark the set of worklist answers as incomplete.
+     * 
+     * This function marks as incomplete the set of answers corresponding to some
+     * C-Find SCP request against modality worklists. This must be used if canceling
+     * the handling of a request when too many answers are to be returned.
+     **/
+    public void worklistMarkIncomplete() {
+        NativeSDK.OrthancPluginWorklistMarkIncomplete(self);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/JavaSDK/be/uclouvain/orthanc/WorklistQuery.java	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,82 @@
+package be.uclouvain.orthanc;
+
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see http://www.gnu.org/licenses/.
+ **/
+
+
+/**
+ * DICOM C-FIND worklist query
+ **/
+public class WorklistQuery {
+    private long self;
+
+    /**
+     * Construct a Java object wrapping a C object that is managed by Orthanc.
+     * @param self Pointer to the C object.
+     **/
+    protected WorklistQuery(long self) {
+        if (self == 0) {
+            throw new IllegalArgumentException("Null pointer");
+        } else {
+            this.self = self;
+        }
+    }
+
+    /**
+     * Return the C object that is associated with this Java wrapper.
+     * @return Pointer to the C object.
+     **/
+    protected long getSelf() {
+        return self;
+    }
+
+
+
+    /**
+     * Test whether a worklist matches the query.
+     * 
+     * This function checks whether one worklist (encoded as a DICOM file) matches the
+     * C-Find SCP query against modality worklists. This function must be called before
+     * adding the worklist as an answer through OrthancPluginWorklistAddAnswer().
+     * 
+     * @param dicom The worklist to answer, encoded as a DICOM file.
+     * @return 1 if the worklist matches the query, 0 otherwise.
+     **/
+    public int worklistIsMatch(
+        byte[] dicom) {
+        return NativeSDK.OrthancPluginWorklistIsMatch(self, dicom);
+    }
+
+    /**
+     * Retrieve the worklist query as a DICOM file.
+     * 
+     * This function retrieves the DICOM file that underlies a C-Find SCP query against
+     * modality worklists.
+     * 
+     * @return The resulting memory buffer.
+     **/
+    public byte[] worklistGetDicomQuery() {
+        return NativeSDK.OrthancPluginWorklistGetDicomQuery(self);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LICENSES/CC0-1.0.txt	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,121 @@
+Creative Commons Legal Code
+
+CC0 1.0 Universal
+
+    CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
+    LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
+    ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
+    INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
+    REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
+    PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
+    THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
+    HEREUNDER.
+
+Statement of Purpose
+
+The laws of most jurisdictions throughout the world automatically confer
+exclusive Copyright and Related Rights (defined below) upon the creator
+and subsequent owner(s) (each and all, an "owner") of an original work of
+authorship and/or a database (each, a "Work").
+
+Certain owners wish to permanently relinquish those rights to a Work for
+the purpose of contributing to a commons of creative, cultural and
+scientific works ("Commons") that the public can reliably and without fear
+of later claims of infringement build upon, modify, incorporate in other
+works, reuse and redistribute as freely as possible in any form whatsoever
+and for any purposes, including without limitation commercial purposes.
+These owners may contribute to the Commons to promote the ideal of a free
+culture and the further production of creative, cultural and scientific
+works, or to gain reputation or greater distribution for their Work in
+part through the use and efforts of others.
+
+For these and/or other purposes and motivations, and without any
+expectation of additional consideration or compensation, the person
+associating CC0 with a Work (the "Affirmer"), to the extent that he or she
+is an owner of Copyright and Related Rights in the Work, voluntarily
+elects to apply CC0 to the Work and publicly distribute the Work under its
+terms, with knowledge of his or her Copyright and Related Rights in the
+Work and the meaning and intended legal effect of CC0 on those rights.
+
+1. Copyright and Related Rights. A Work made available under CC0 may be
+protected by copyright and related or neighboring rights ("Copyright and
+Related Rights"). Copyright and Related Rights include, but are not
+limited to, the following:
+
+  i. the right to reproduce, adapt, distribute, perform, display,
+     communicate, and translate a Work;
+ ii. moral rights retained by the original author(s) and/or performer(s);
+iii. publicity and privacy rights pertaining to a person's image or
+     likeness depicted in a Work;
+ iv. rights protecting against unfair competition in regards to a Work,
+     subject to the limitations in paragraph 4(a), below;
+  v. rights protecting the extraction, dissemination, use and reuse of data
+     in a Work;
+ vi. database rights (such as those arising under Directive 96/9/EC of the
+     European Parliament and of the Council of 11 March 1996 on the legal
+     protection of databases, and under any national implementation
+     thereof, including any amended or successor version of such
+     directive); and
+vii. other similar, equivalent or corresponding rights throughout the
+     world based on applicable law or treaty, and any national
+     implementations thereof.
+
+2. Waiver. To the greatest extent permitted by, but not in contravention
+of, applicable law, Affirmer hereby overtly, fully, permanently,
+irrevocably and unconditionally waives, abandons, and surrenders all of
+Affirmer's Copyright and Related Rights and associated claims and causes
+of action, whether now known or unknown (including existing as well as
+future claims and causes of action), in the Work (i) in all territories
+worldwide, (ii) for the maximum duration provided by applicable law or
+treaty (including future time extensions), (iii) in any current or future
+medium and for any number of copies, and (iv) for any purpose whatsoever,
+including without limitation commercial, advertising or promotional
+purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
+member of the public at large and to the detriment of Affirmer's heirs and
+successors, fully intending that such Waiver shall not be subject to
+revocation, rescission, cancellation, termination, or any other legal or
+equitable action to disrupt the quiet enjoyment of the Work by the public
+as contemplated by Affirmer's express Statement of Purpose.
+
+3. Public License Fallback. Should any part of the Waiver for any reason
+be judged legally invalid or ineffective under applicable law, then the
+Waiver shall be preserved to the maximum extent permitted taking into
+account Affirmer's express Statement of Purpose. In addition, to the
+extent the Waiver is so judged Affirmer hereby grants to each affected
+person a royalty-free, non transferable, non sublicensable, non exclusive,
+irrevocable and unconditional license to exercise Affirmer's Copyright and
+Related Rights in the Work (i) in all territories worldwide, (ii) for the
+maximum duration provided by applicable law or treaty (including future
+time extensions), (iii) in any current or future medium and for any number
+of copies, and (iv) for any purpose whatsoever, including without
+limitation commercial, advertising or promotional purposes (the
+"License"). The License shall be deemed effective as of the date CC0 was
+applied by Affirmer to the Work. Should any part of the License for any
+reason be judged legally invalid or ineffective under applicable law, such
+partial invalidity or ineffectiveness shall not invalidate the remainder
+of the License, and in such case Affirmer hereby affirms that he or she
+will not (i) exercise any of his or her remaining Copyright and Related
+Rights in the Work or (ii) assert any associated claims and causes of
+action with respect to the Work, in either case contrary to Affirmer's
+express Statement of Purpose.
+
+4. Limitations and Disclaimers.
+
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
+    surrendered, licensed or otherwise affected by this document.
+ b. Affirmer offers the Work as-is and makes no representations or
+    warranties of any kind concerning the Work, express, implied,
+    statutory or otherwise, including without limitation warranties of
+    title, merchantability, fitness for a particular purpose, non
+    infringement, or the absence of latent or other defects, accuracy, or
+    the present or absence of errors, whether or not discoverable, all to
+    the greatest extent permissible under applicable law.
+ c. Affirmer disclaims responsibility for clearing rights of other persons
+    that may apply to the Work or any use thereof, including without
+    limitation any person's Copyright and Related Rights in the Work.
+    Further, Affirmer disclaims responsibility for obtaining any necessary
+    consents, permissions or other rights required for any use of the
+    Work.
+ d. Affirmer understands and acknowledges that Creative Commons is not a
+    party to this document and has no duty or obligation with respect to
+    this CC0 or use of the Work.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LICENSES/Classpath-exception-2.0.txt	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,3 @@
+Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination.
+
+As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LICENSES/GPL-2.0-only.txt	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,117 @@
+GNU GENERAL PUBLIC LICENSE
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+     a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
+
+     b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
+
+     c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
+
+     a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+
+     b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
+
+     c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
+
+     one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author
+
+     This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
+
+     This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+     You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
+
+     Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
+
+     Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LICENSES/GPL-3.0-or-later.txt	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,232 @@
+GNU GENERAL PUBLIC LICENSE
+Version 3, 29 June 2007
+
+Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
+
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+Preamble
+
+The GNU General Public License is a free, copyleft license for software and other kinds of works.
+
+The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
+
+To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
+
+For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
+
+Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
+
+Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+TERMS AND CONDITIONS
+
+0. Definitions.
+
+“This License” refers to version 3 of the GNU General Public License.
+
+“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
+
+“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
+
+To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
+
+A “covered work” means either the unmodified Program or a work based on the Program.
+
+To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
+
+To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
+
+An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
+
+1. Source Code.
+The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
+
+A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
+
+The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
+
+The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
+
+The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
+
+The Corresponding Source for a work in source code form is that same work.
+
+2. Basic Permissions.
+All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
+
+You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
+
+Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
+
+3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
+
+When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
+
+4. Conveying Verbatim Copies.
+You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
+
+You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
+
+5. Conveying Modified Source Versions.
+You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
+
+     a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
+
+     b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
+
+     c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
+
+     d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
+
+A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
+
+6. Conveying Non-Source Forms.
+You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
+
+     a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
+
+     b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
+
+     c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
+
+     d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
+
+     e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
+
+A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
+
+A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
+
+“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
+
+If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
+
+The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
+
+Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
+
+7. Additional Terms.
+“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
+
+When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
+
+Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
+
+     a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
+
+     b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
+
+     c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
+
+     d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
+
+     e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
+
+     f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
+
+All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
+
+Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
+
+8. Termination.
+You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
+
+However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
+
+Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
+
+9. Acceptance Not Required for Having Copies.
+You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
+
+10. Automatic Licensing of Downstream Recipients.
+Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
+
+An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
+
+You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
+
+11. Patents.
+A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
+
+A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
+
+In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
+
+If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
+
+If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
+
+A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
+
+Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
+
+12. No Surrender of Others' Freedom.
+If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
+
+13. Use with the GNU Affero General Public License.
+Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
+
+14. Revised Versions of this License.
+The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
+
+If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
+
+Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
+
+15. Disclaimer of Warranty.
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. Limitation of Liability.
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+17. Interpretation of Sections 15 and 16.
+If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
+
+     <one line to give the program's name and a brief idea of what it does.>
+     Copyright (C) <year>  <name of author>
+
+     This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+
+     This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+
+     You should have received a copy of the GNU General Public License along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
+
+     <program>  Copyright (C) <year>  <name of author>
+     This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+     This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
+
+You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>.
+
+The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/philosophy/why-not-lgpl.html>.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LICENSES/LGPL-3.0-or-later.txt	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,304 @@
+GNU LESSER GENERAL PUBLIC LICENSE
+Version 3, 29 June 2007
+
+Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.
+
+0. Additional Definitions.
+
+As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License.
+
+"The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.
+
+An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.
+
+A "Combined Work" is a work produced by combining or linking an Application with the Library.  The particular version of the Library with which the Combined Work was made is also called the "Linked Version".
+
+The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.
+
+The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.
+
+1. Exception to Section 3 of the GNU GPL.
+You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.
+
+2. Conveying Modified Versions.
+If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:
+
+     a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or
+
+     b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.
+
+3. Object Code Incorporating Material from Library Header Files.
+The object code form of an Application may incorporate material from a header file that is part of the Library.  You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:
+
+     a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.
+
+     b) Accompany the object code with a copy of the GNU GPL and this license document.
+
+4. Combined Works.
+You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:
+
+     a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.
+
+     b) Accompany the Combined Work with a copy of the GNU GPL and this license document.
+
+     c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.
+
+     d) Do one of the following:
+
+           0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.
+
+          1) Use a suitable shared library mechanism for linking with the Library.  A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.
+
+     e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)
+
+5. Combined Libraries.
+You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:
+
+     a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.
+
+     b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
+
+6. Revised Versions of the GNU Lesser General Public License.
+The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation.
+
+If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.
+
+GNU GENERAL PUBLIC LICENSE
+Version 3, 29 June 2007
+
+Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
+
+Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+Preamble
+
+The GNU General Public License is a free, copyleft license for software and other kinds of works.
+
+The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
+
+To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
+
+For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
+
+Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
+
+For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
+
+Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
+
+Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
+
+The precise terms and conditions for copying, distribution and modification follow.
+
+TERMS AND CONDITIONS
+
+0. Definitions.
+
+“This License” refers to version 3 of the GNU General Public License.
+
+“Copyright” also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
+
+“The Program” refers to any copyrightable work licensed under this License. Each licensee is addressed as “you”. “Licensees” and “recipients” may be individuals or organizations.
+
+To “modify” a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a “modified version” of the earlier work or a work “based on” the earlier work.
+
+A “covered work” means either the unmodified Program or a work based on the Program.
+
+To “propagate” a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
+
+To “convey” a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
+
+An interactive user interface displays “Appropriate Legal Notices” to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
+
+1. Source Code.
+The “source code” for a work means the preferred form of the work for making modifications to it. “Object code” means any non-source form of a work.
+
+A “Standard Interface” means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
+
+The “System Libraries” of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A “Major Component”, in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
+
+The “Corresponding Source” for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
+
+The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
+
+The Corresponding Source for a work in source code form is that same work.
+
+2. Basic Permissions.
+All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
+
+You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
+
+Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
+
+3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
+
+When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
+
+4. Conveying Verbatim Copies.
+You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
+
+You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
+
+5. Conveying Modified Source Versions.
+You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
+
+     a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
+
+     b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to “keep intact all notices”.
+
+     c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
+
+     d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
+
+A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
+
+6. Conveying Non-Source Forms.
+You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
+
+     a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
+
+     b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
+
+     c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
+
+     d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
+
+     e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
+
+A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
+
+A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
+
+“Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
+
+If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
+
+The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
+
+Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
+
+7. Additional Terms.
+“Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
+
+When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
+
+Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
+
+     a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
+
+     b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
+
+     c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
+
+     d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
+
+     e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
+
+     f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
+
+All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
+
+Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
+
+8. Termination.
+You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
+
+However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
+
+Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
+
+9. Acceptance Not Required for Having Copies.
+You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
+
+10. Automatic Licensing of Downstream Recipients.
+Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
+
+An “entity transaction” is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
+
+You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
+
+11. Patents.
+A “contributor” is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's “contributor version”.
+
+A contributor's “essential patent claims” are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, “control” includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
+
+In the following three paragraphs, a “patent license” is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To “grant” such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
+
+If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. “Knowingly relying” means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
+
+If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
+
+A patent license is “discriminatory” if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
+
+Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
+
+12. No Surrender of Others' Freedom.
+If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
+
+13. Use with the GNU Affero General Public License.
+Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
+
+14. Revised Versions of this License.
+The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
+
+If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
+
+Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
+
+15. Disclaimer of Warranty.
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. Limitation of Liability.
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+17. Interpretation of Sections 15 and 16.
+If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
+
+     <one line to give the program's name and a brief idea of what it does.>
+     Copyright (C) <year>  <name of author>
+
+     This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+
+     This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+
+     You should have received a copy of the GNU General Public License along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:
+
+     <program>  Copyright (C) <year>  <name of author>
+     This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+     This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
+
+You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.
+
+The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/NEWS	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,4 @@
+Pending changes in the mainline
+===============================
+
+* Initial release
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Plugin/CMakeLists.txt	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,124 @@
+# SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# Java plugin for Orthanc
+# Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+cmake_minimum_required(VERSION 3.0)
+
+project(OrthancJavaPlugin)
+
+set(PLUGIN_VERSION "mainline")
+
+include(CheckIncludeFileCXX)
+include(FindPythonInterp)
+
+include(${CMAKE_SOURCE_DIR}/../Resources/Orthanc/CMake/AutoGeneratedCode.cmake)
+include(${CMAKE_SOURCE_DIR}/../Resources/Orthanc/CMake/Compiler.cmake)
+include(${CMAKE_SOURCE_DIR}/../Resources/Orthanc/CMake/DownloadPackage.cmake)
+
+include(${CMAKE_SOURCE_DIR}/../Resources/Orthanc/Plugins/OrthancPluginsExports.cmake)
+
+# Support of static compilation
+set(ALLOW_DOWNLOADS OFF CACHE BOOL "Allow CMake to download packages")
+set(STATIC_BUILD OFF CACHE BOOL "Static build of the third-party libraries (necessary for Windows)")
+set(USE_SYSTEM_JSONCPP ON CACHE BOOL "Use the system version of JsonCpp")
+set(USE_SYSTEM_JNI ON CACHE BOOL "Use the system version of JsonCpp")
+set(USE_LEGACY_JSONCPP OFF CACHE BOOL "Use the old branch 0.x.y of JsonCpp, that does not require a C++11 compiler (for LSB and old versions of Visual Studio)")
+
+include(${CMAKE_SOURCE_DIR}/../Resources/Orthanc/CMake/JsonCppConfiguration.cmake)
+
+
+include_directories(BEFORE
+  ${CMAKE_SOURCE_DIR}/../Resources/Orthanc/Sdk-1.10.0/
+  )
+
+if (CMAKE_SYSTEM_NAME STREQUAL "Windows" AND
+    (STATIC_BUILD OR NOT USE_SYSTEM_JNI))
+  if (CMAKE_SIZEOF_VOID_P EQUAL 8)
+    include_directories(
+      ${CMAKE_SOURCE_DIR}/../Resources/jdk8u382-b05-win64/include
+      ${CMAKE_SOURCE_DIR}/../Resources/jdk8u382-b05-win64/include/win32
+      )
+    link_libraries(
+      ${CMAKE_SOURCE_DIR}/../Resources/jdk8u382-b05-win64/lib/jvm.lib
+      )
+  elseif (CMAKE_SIZEOF_VOID_P EQUAL 4)
+    include_directories(
+      ${CMAKE_SOURCE_DIR}/../Resources/jdk8u382-b05-win32/include
+      ${CMAKE_SOURCE_DIR}/../Resources/jdk8u382-b05-win32/include/win32
+      )
+    link_libraries(
+      ${CMAKE_SOURCE_DIR}/../Resources/jdk8u382-b05-win32/lib/jvm.lib
+      )
+  else()
+    message(FATAL_ERROR "Unknown architecture")
+  endif()
+else()
+  if (NOT USE_SYSTEM_JNI)
+    message(FATAL_ERROR "Cannot statically link against JNI on this platform")
+  endif()
+  
+  include(FindJNI)
+  if (NOT JNI_FOUND)
+    message(FATAL_ERROR "Unable to find JNI")
+  endif()
+  
+  link_libraries(${JNI_LIBRARIES})
+  include_directories(${JNI_INCLUDE_DIRS})
+endif()
+
+if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
+  execute_process(
+    COMMAND 
+    ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../Resources/Orthanc/CMake/WindowsResources.py
+    ${PLUGIN_VERSION} OrthancJava OrthancJava.dll "Java plugin for Orthanc"
+    ERROR_VARIABLE Failure
+    OUTPUT_FILE ${AUTOGENERATED_DIR}/OrthancJava.rc
+    )
+  
+  if (Failure)
+    message(FATAL_ERROR "Error while computing the version information: ${Failure}")
+  endif()
+  
+  list(APPEND PLUGIN_RESOURCES ${AUTOGENERATED_DIR}/OrthancJava.rc)
+endif()
+
+
+add_definitions(
+  -DPLUGIN_VERSION="${PLUGIN_VERSION}"
+  )
+
+add_library(OrthancJava SHARED
+  Plugin.cpp
+  Mutex.cpp
+  ${JSONCPP_SOURCES}
+  ${PLUGIN_RESOURCES}
+  )
+
+set_target_properties(
+  OrthancJava PROPERTIES 
+  VERSION ${PLUGIN_VERSION} 
+  SOVERSION ${PLUGIN_VERSION}
+  SKIP_BUILD_RPATH ON
+  )
+
+install(
+  TARGETS OrthancJava
+  RUNTIME DESTINATION lib    # Destination for Windows
+  LIBRARY DESTINATION share/orthanc/plugins    # Destination for Linux
+  )
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Plugin/Mutex.cpp	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,105 @@
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
+#include "Mutex.h"
+
+#include <stdexcept>
+
+#if defined(_WIN32)
+
+#  include <windows.h>
+
+struct Mutex::PImpl
+{
+  CRITICAL_SECTION criticalSection_;
+};
+
+Mutex::Mutex()
+{
+  pimpl_ = new PImpl;
+  ::InitializeCriticalSection(&pimpl_->criticalSection_);
+}
+
+Mutex::~Mutex()
+{
+  ::DeleteCriticalSection(&pimpl_->criticalSection_);
+  delete pimpl_;
+}
+
+void Mutex::Lock()
+{
+  ::EnterCriticalSection(&pimpl_->criticalSection_);
+}
+
+void Mutex::Unlock()
+{
+  ::LeaveCriticalSection(&pimpl_->criticalSection_);
+}
+
+
+#elif defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
+
+#  include <pthread.h>
+
+struct Mutex::PImpl
+{
+  pthread_mutex_t mutex_;
+};
+
+Mutex::Mutex()
+{
+  pimpl_ = new PImpl;
+
+  if (pthread_mutex_init(&pimpl_->mutex_, NULL) != 0)
+  {
+    delete pimpl_;
+    throw std::runtime_error("Cannot create mutex");
+  }
+}
+
+Mutex::~Mutex()
+{
+  pthread_mutex_destroy(&pimpl_->mutex_);
+  delete pimpl_;
+}
+
+void Mutex::Lock()
+{
+  if (pthread_mutex_lock(&pimpl_->mutex_) != 0)
+  {
+    throw std::runtime_error("Cannot lock mutex");
+  }
+}
+
+void Mutex::Unlock()
+{
+  if (pthread_mutex_unlock(&pimpl_->mutex_) != 0)
+  {
+    throw std::runtime_error("Cannot unlock mutex");
+  }
+}
+
+#else
+#  error Support your plateform here
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Plugin/Mutex.h	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,61 @@
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
+#pragma once
+
+#include "NonCopyable.h"
+
+class Mutex : public NonCopyable
+{
+private:
+  struct PImpl;
+  PImpl *pimpl_;
+
+  void Lock();
+
+  void Unlock();
+
+public:
+  Mutex();
+
+  ~Mutex();
+
+  class Locker : public NonCopyable
+  {
+  private:
+    Mutex&  mutex_;
+
+  public:
+    Locker(Mutex& mutex) :
+      mutex_(mutex)
+    {
+      mutex_.Lock();
+    }
+
+    ~Locker()
+    {
+      mutex_.Unlock();
+    }
+  };
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Plugin/NativeSDK.cpp	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,4345 @@
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
+
+JNIEXPORT jint JNI_OrthancPluginCheckVersionAdvanced(JNIEnv* env, jobject sdkObject, jint arg0, jint arg1, jint arg2)
+{
+  try
+  {
+    return OrthancPluginCheckVersionAdvanced(context_
+      , arg0, arg1, arg2);
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginCheckVersion(JNIEnv* env, jobject sdkObject)
+{
+  try
+  {
+    return OrthancPluginCheckVersion(context_
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginLogError(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancPluginLogError(context_
+      , c_arg0.GetValue());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginLogWarning(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancPluginLogWarning(context_
+      , c_arg0.GetValue());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginLogInfo(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancPluginLogInfo(context_
+      , c_arg0.GetValue());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginGetDicomForInstance(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginGetDicomForInstance(context_, b.GetMemoryBuffer()
+      , c_arg0.GetValue());
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginRestApiGet(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginRestApiGet(context_, b.GetMemoryBuffer()
+      , c_arg0.GetValue());
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginRestApiGetAfterPlugins(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginRestApiGetAfterPlugins(context_, b.GetMemoryBuffer()
+      , c_arg0.GetValue());
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginRestApiPost(JNIEnv* env, jobject sdkObject, jstring arg0, jbyteArray arg1)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    JavaBytes c_arg1(env, arg1);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginRestApiPost(context_, b.GetMemoryBuffer()
+      , c_arg0.GetValue(), c_arg1.GetData(), c_arg1.GetSize());
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginRestApiPostAfterPlugins(JNIEnv* env, jobject sdkObject, jstring arg0, jbyteArray arg1)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    JavaBytes c_arg1(env, arg1);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginRestApiPostAfterPlugins(context_, b.GetMemoryBuffer()
+      , c_arg0.GetValue(), c_arg1.GetData(), c_arg1.GetSize());
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginRestApiDelete(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancPluginErrorCode code = OrthancPluginRestApiDelete(context_
+      , c_arg0.GetValue());
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginRestApiDeleteAfterPlugins(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancPluginErrorCode code = OrthancPluginRestApiDeleteAfterPlugins(context_
+      , c_arg0.GetValue());
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginRestApiPut(JNIEnv* env, jobject sdkObject, jstring arg0, jbyteArray arg1)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    JavaBytes c_arg1(env, arg1);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginRestApiPut(context_, b.GetMemoryBuffer()
+      , c_arg0.GetValue(), c_arg1.GetData(), c_arg1.GetSize());
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginRestApiPutAfterPlugins(JNIEnv* env, jobject sdkObject, jstring arg0, jbyteArray arg1)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    JavaBytes c_arg1(env, arg1);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginRestApiPutAfterPlugins(context_, b.GetMemoryBuffer()
+      , c_arg0.GetValue(), c_arg1.GetData(), c_arg1.GetSize());
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginLookupPatient(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancString s(OrthancPluginLookupPatient(context_
+      , c_arg0.GetValue()));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginLookupStudy(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancString s(OrthancPluginLookupStudy(context_
+      , c_arg0.GetValue()));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginLookupStudyWithAccessionNumber(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancString s(OrthancPluginLookupStudyWithAccessionNumber(context_
+      , c_arg0.GetValue()));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginLookupSeries(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancString s(OrthancPluginLookupSeries(context_
+      , c_arg0.GetValue()));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginLookupInstance(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancString s(OrthancPluginLookupInstance(context_
+      , c_arg0.GetValue()));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetOrthancPath(JNIEnv* env, jobject sdkObject)
+{
+  try
+  {
+    OrthancString s(OrthancPluginGetOrthancPath(context_
+      ));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetOrthancDirectory(JNIEnv* env, jobject sdkObject)
+{
+  try
+  {
+    OrthancString s(OrthancPluginGetOrthancDirectory(context_
+      ));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetConfigurationPath(JNIEnv* env, jobject sdkObject)
+{
+  try
+  {
+    OrthancString s(OrthancPluginGetConfigurationPath(context_
+      ));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginSetRootUri(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancPluginSetRootUri(context_
+      , c_arg0.GetValue());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginSetDescription(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancPluginSetDescription(context_
+      , c_arg0.GetValue());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginExtendOrthancExplorer(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancPluginExtendOrthancExplorer(context_
+      , c_arg0.GetValue());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetGlobalProperty(JNIEnv* env, jobject sdkObject, jint arg0, jstring arg1)
+{
+  try
+  {
+    JavaString c_arg1(env, arg1);
+    OrthancString s(OrthancPluginGetGlobalProperty(context_
+      , arg0, c_arg1.GetValue()));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginSetGlobalProperty(JNIEnv* env, jobject sdkObject, jint arg0, jstring arg1)
+{
+  try
+  {
+    JavaString c_arg1(env, arg1);
+    OrthancPluginErrorCode code = OrthancPluginSetGlobalProperty(context_
+      , arg0, c_arg1.GetValue());
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginGetCommandLineArgumentsCount(JNIEnv* env, jobject sdkObject)
+{
+  try
+  {
+    return OrthancPluginGetCommandLineArgumentsCount(context_
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetCommandLineArgument(JNIEnv* env, jobject sdkObject, jint arg0)
+{
+  try
+  {
+    OrthancString s(OrthancPluginGetCommandLineArgument(context_
+      , arg0));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginGetExpectedDatabaseVersion(JNIEnv* env, jobject sdkObject)
+{
+  try
+  {
+    return OrthancPluginGetExpectedDatabaseVersion(context_
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetConfiguration(JNIEnv* env, jobject sdkObject)
+{
+  try
+  {
+    OrthancString s(OrthancPluginGetConfiguration(context_
+      ));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginBufferCompression(JNIEnv* env, jobject sdkObject, jbyteArray arg0, jint arg2, jbyte arg3)
+{
+  try
+  {
+    JavaBytes c_arg0(env, arg0);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginBufferCompression(context_, b.GetMemoryBuffer()
+      , c_arg0.GetData(), c_arg0.GetSize(), static_cast<OrthancPluginCompressionType>(arg2), arg3);
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginReadFile(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginReadFile(context_, b.GetMemoryBuffer()
+      , c_arg0.GetValue());
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginWriteFile(JNIEnv* env, jobject sdkObject, jstring arg0, jbyteArray arg1)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    JavaBytes c_arg1(env, arg1);
+    OrthancPluginErrorCode code = OrthancPluginWriteFile(context_
+      , c_arg0.GetValue(), c_arg1.GetData(), c_arg1.GetSize());
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetErrorDescription(JNIEnv* env, jobject sdkObject, jint arg0)
+{
+  try
+  {
+    const char* s = OrthancPluginGetErrorDescription(context_
+      , static_cast<OrthancPluginErrorCode>(arg0));
+    if (s == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      return env->NewStringUTF(s);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jlong JNI_OrthancPluginUncompressImage(JNIEnv* env, jobject sdkObject, jbyteArray arg0, jint arg2)
+{
+  try
+  {
+    JavaBytes c_arg0(env, arg0);
+    OrthancPluginImage* answer = OrthancPluginUncompressImage(context_
+      , c_arg0.GetData(), c_arg0.GetSize(), static_cast<OrthancPluginImageFormat>(arg2));
+    if (answer == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return 0;
+    }
+    else
+    {
+      return reinterpret_cast<intptr_t>(answer);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginCompressPngImage(JNIEnv* env, jobject sdkObject, jint arg0, jint arg1, jint arg2, jint arg3, jbyteArray arg4)
+{
+  try
+  {
+    JavaBytes c_arg4(env, arg4);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginCompressPngImage(context_, b.GetMemoryBuffer()
+      , static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, c_arg4.GetData());
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginCompressJpegImage(JNIEnv* env, jobject sdkObject, jint arg0, jint arg1, jint arg2, jint arg3, jbyteArray arg4, jbyte arg5)
+{
+  try
+  {
+    JavaBytes c_arg4(env, arg4);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginCompressJpegImage(context_, b.GetMemoryBuffer()
+      , static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, c_arg4.GetData(), arg5);
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginHttpGet(JNIEnv* env, jobject sdkObject, jstring arg0, jstring arg1, jstring arg2)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    JavaString c_arg1(env, arg1);
+    JavaString c_arg2(env, arg2);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginHttpGet(context_, b.GetMemoryBuffer()
+      , c_arg0.GetValue(), c_arg1.GetValue(), c_arg2.GetValue());
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginHttpPost(JNIEnv* env, jobject sdkObject, jstring arg0, jbyteArray arg1, jstring arg3, jstring arg4)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    JavaBytes c_arg1(env, arg1);
+    JavaString c_arg3(env, arg3);
+    JavaString c_arg4(env, arg4);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginHttpPost(context_, b.GetMemoryBuffer()
+      , c_arg0.GetValue(), c_arg1.GetData(), c_arg1.GetSize(), c_arg3.GetValue(), c_arg4.GetValue());
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginHttpPut(JNIEnv* env, jobject sdkObject, jstring arg0, jbyteArray arg1, jstring arg3, jstring arg4)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    JavaBytes c_arg1(env, arg1);
+    JavaString c_arg3(env, arg3);
+    JavaString c_arg4(env, arg4);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginHttpPut(context_, b.GetMemoryBuffer()
+      , c_arg0.GetValue(), c_arg1.GetData(), c_arg1.GetSize(), c_arg3.GetValue(), c_arg4.GetValue());
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginHttpDelete(JNIEnv* env, jobject sdkObject, jstring arg0, jstring arg1, jstring arg2)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    JavaString c_arg1(env, arg1);
+    JavaString c_arg2(env, arg2);
+    OrthancPluginErrorCode code = OrthancPluginHttpDelete(context_
+      , c_arg0.GetValue(), c_arg1.GetValue(), c_arg2.GetValue());
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginGetFontsCount(JNIEnv* env, jobject sdkObject)
+{
+  try
+  {
+    return OrthancPluginGetFontsCount(context_
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetFontName(JNIEnv* env, jobject sdkObject, jint arg0)
+{
+  try
+  {
+    const char* s = OrthancPluginGetFontName(context_
+      , arg0);
+    if (s == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      return env->NewStringUTF(s);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginGetFontSize(JNIEnv* env, jobject sdkObject, jint arg0)
+{
+  try
+  {
+    return OrthancPluginGetFontSize(context_
+      , arg0);
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginRegisterErrorCode(JNIEnv* env, jobject sdkObject, jint arg0, jshort arg1, jstring arg2)
+{
+  try
+  {
+    JavaString c_arg2(env, arg2);
+    OrthancPluginErrorCode code = OrthancPluginRegisterErrorCode(context_
+      , arg0, arg1, c_arg2.GetValue());
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginRegisterDictionaryTag(JNIEnv* env, jobject sdkObject, jshort arg0, jshort arg1, jint arg2, jstring arg3, jint arg4, jint arg5)
+{
+  try
+  {
+    JavaString c_arg3(env, arg3);
+    OrthancPluginErrorCode code = OrthancPluginRegisterDictionaryTag(context_
+      , arg0, arg1, static_cast<OrthancPluginValueRepresentation>(arg2), c_arg3.GetValue(), arg4, arg5);
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginRegisterPrivateDictionaryTag(JNIEnv* env, jobject sdkObject, jshort arg0, jshort arg1, jint arg2, jstring arg3, jint arg4, jint arg5, jstring arg6)
+{
+  try
+  {
+    JavaString c_arg3(env, arg3);
+    JavaString c_arg6(env, arg6);
+    OrthancPluginErrorCode code = OrthancPluginRegisterPrivateDictionaryTag(context_
+      , arg0, arg1, static_cast<OrthancPluginValueRepresentation>(arg2), c_arg3.GetValue(), arg4, arg5, c_arg6.GetValue());
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginDicomBufferToJson(JNIEnv* env, jobject sdkObject, jbyteArray arg0, jint arg2, jint arg3, jint arg4)
+{
+  try
+  {
+    JavaBytes c_arg0(env, arg0);
+    OrthancString s(OrthancPluginDicomBufferToJson(context_
+      , c_arg0.GetData(), c_arg0.GetSize(), static_cast<OrthancPluginDicomToJsonFormat>(arg2), static_cast<OrthancPluginDicomToJsonFlags>(arg3), arg4));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginDicomInstanceToJson(JNIEnv* env, jobject sdkObject, jstring arg0, jint arg1, jint arg2, jint arg3)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancString s(OrthancPluginDicomInstanceToJson(context_
+      , c_arg0.GetValue(), static_cast<OrthancPluginDicomToJsonFormat>(arg1), static_cast<OrthancPluginDicomToJsonFlags>(arg2), arg3));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginCreateDicom(JNIEnv* env, jobject sdkObject, jstring arg0, jlong arg1, jint arg2)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginCreateDicom(context_, b.GetMemoryBuffer()
+      , c_arg0.GetValue(), reinterpret_cast<OrthancPluginImage*>(static_cast<intptr_t>(arg1)), static_cast<OrthancPluginCreateDicomFlags>(arg2));
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jlong JNI_OrthancPluginCreateImage(JNIEnv* env, jobject sdkObject, jint arg0, jint arg1, jint arg2)
+{
+  try
+  {
+    OrthancPluginImage* answer = OrthancPluginCreateImage(context_
+      , static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2);
+    if (answer == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return 0;
+    }
+    else
+    {
+      return reinterpret_cast<intptr_t>(answer);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jlong JNI_OrthancPluginDecodeDicomImage(JNIEnv* env, jobject sdkObject, jbyteArray arg0, jint arg2)
+{
+  try
+  {
+    JavaBytes c_arg0(env, arg0);
+    OrthancPluginImage* answer = OrthancPluginDecodeDicomImage(context_
+      , c_arg0.GetData(), c_arg0.GetSize(), arg2);
+    if (answer == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return 0;
+    }
+    else
+    {
+      return reinterpret_cast<intptr_t>(answer);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginComputeMd5(JNIEnv* env, jobject sdkObject, jbyteArray arg0)
+{
+  try
+  {
+    JavaBytes c_arg0(env, arg0);
+    OrthancString s(OrthancPluginComputeMd5(context_
+      , c_arg0.GetData(), c_arg0.GetSize()));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginComputeSha1(JNIEnv* env, jobject sdkObject, jbyteArray arg0)
+{
+  try
+  {
+    JavaBytes c_arg0(env, arg0);
+    OrthancString s(OrthancPluginComputeSha1(context_
+      , c_arg0.GetData(), c_arg0.GetSize()));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGenerateUuid(JNIEnv* env, jobject sdkObject)
+{
+  try
+  {
+    OrthancString s(OrthancPluginGenerateUuid(context_
+      ));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jlong JNI_OrthancPluginCreateFindMatcher(JNIEnv* env, jobject sdkObject, jbyteArray arg0)
+{
+  try
+  {
+    JavaBytes c_arg0(env, arg0);
+    OrthancPluginFindMatcher* answer = OrthancPluginCreateFindMatcher(context_
+      , c_arg0.GetData(), c_arg0.GetSize());
+    if (answer == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return 0;
+    }
+    else
+    {
+      return reinterpret_cast<intptr_t>(answer);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jlong JNI_OrthancPluginGetPeers(JNIEnv* env, jobject sdkObject)
+{
+  try
+  {
+    OrthancPluginPeers* answer = OrthancPluginGetPeers(context_
+      );
+    if (answer == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return 0;
+    }
+    else
+    {
+      return reinterpret_cast<intptr_t>(answer);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginAutodetectMimeType(JNIEnv* env, jobject sdkObject, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    const char* s = OrthancPluginAutodetectMimeType(context_
+      , c_arg0.GetValue());
+    if (s == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      return env->NewStringUTF(s);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginSetMetricsValue(JNIEnv* env, jobject sdkObject, jstring arg0, jfloat arg1, jint arg2)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancPluginSetMetricsValue(context_
+      , c_arg0.GetValue(), arg1, static_cast<OrthancPluginMetricsType>(arg2));
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetTagName(JNIEnv* env, jobject sdkObject, jshort arg0, jshort arg1, jstring arg2)
+{
+  try
+  {
+    JavaString c_arg2(env, arg2);
+    OrthancString s(OrthancPluginGetTagName(context_
+      , arg0, arg1, c_arg2.GetValue()));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jlong JNI_OrthancPluginCreateDicomInstance(JNIEnv* env, jobject sdkObject, jbyteArray arg0)
+{
+  try
+  {
+    JavaBytes c_arg0(env, arg0);
+    OrthancPluginDicomInstance* answer = OrthancPluginCreateDicomInstance(context_
+      , c_arg0.GetData(), c_arg0.GetSize());
+    if (answer == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return 0;
+    }
+    else
+    {
+      return reinterpret_cast<intptr_t>(answer);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jlong JNI_OrthancPluginTranscodeDicomInstance(JNIEnv* env, jobject sdkObject, jbyteArray arg0, jstring arg2)
+{
+  try
+  {
+    JavaBytes c_arg0(env, arg0);
+    JavaString c_arg2(env, arg2);
+    OrthancPluginDicomInstance* answer = OrthancPluginTranscodeDicomInstance(context_
+      , c_arg0.GetData(), c_arg0.GetSize(), c_arg2.GetValue());
+    if (answer == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return 0;
+    }
+    else
+    {
+      return reinterpret_cast<intptr_t>(answer);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGenerateRestApiAuthorizationToken(JNIEnv* env, jobject sdkObject)
+{
+  try
+  {
+    OrthancString s(OrthancPluginGenerateRestApiAuthorizationToken(context_
+      ));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginCreateDicom2(JNIEnv* env, jobject sdkObject, jstring arg0, jlong arg1, jint arg2, jstring arg3)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    JavaString c_arg3(env, arg3);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginCreateDicom2(context_, b.GetMemoryBuffer()
+      , c_arg0.GetValue(), reinterpret_cast<OrthancPluginImage*>(static_cast<intptr_t>(arg1)), static_cast<OrthancPluginCreateDicomFlags>(arg2), c_arg3.GetValue());
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginFreeDicomInstance(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    OrthancPluginFreeDicomInstance(context_
+      , reinterpret_cast<OrthancPluginDicomInstance*>(static_cast<intptr_t>(self))
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetInstanceRemoteAet(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    const char* s = OrthancPluginGetInstanceRemoteAet(context_
+      , reinterpret_cast<OrthancPluginDicomInstance*>(static_cast<intptr_t>(self))
+      );
+    if (s == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      return env->NewStringUTF(s);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jlong JNI_OrthancPluginGetInstanceSize(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    return OrthancPluginGetInstanceSize(context_
+      , reinterpret_cast<OrthancPluginDicomInstance*>(static_cast<intptr_t>(self))
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetInstanceJson(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    OrthancString s(OrthancPluginGetInstanceJson(context_
+      , reinterpret_cast<OrthancPluginDicomInstance*>(static_cast<intptr_t>(self))
+      ));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetInstanceSimplifiedJson(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    OrthancString s(OrthancPluginGetInstanceSimplifiedJson(context_
+      , reinterpret_cast<OrthancPluginDicomInstance*>(static_cast<intptr_t>(self))
+      ));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginHasInstanceMetadata(JNIEnv* env, jobject sdkObject, jlong self, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    return OrthancPluginHasInstanceMetadata(context_
+      , reinterpret_cast<OrthancPluginDicomInstance*>(static_cast<intptr_t>(self))
+      , c_arg0.GetValue());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetInstanceMetadata(JNIEnv* env, jobject sdkObject, jlong self, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    const char* s = OrthancPluginGetInstanceMetadata(context_
+      , reinterpret_cast<OrthancPluginDicomInstance*>(static_cast<intptr_t>(self))
+      , c_arg0.GetValue());
+    if (s == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      return env->NewStringUTF(s);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginGetInstanceOrigin(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    return OrthancPluginGetInstanceOrigin(context_
+      , reinterpret_cast<OrthancPluginDicomInstance*>(static_cast<intptr_t>(self))
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetInstanceTransferSyntaxUid(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    OrthancString s(OrthancPluginGetInstanceTransferSyntaxUid(context_
+      , reinterpret_cast<OrthancPluginDicomInstance*>(static_cast<intptr_t>(self))
+      ));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginHasInstancePixelData(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    return OrthancPluginHasInstancePixelData(context_
+      , reinterpret_cast<OrthancPluginDicomInstance*>(static_cast<intptr_t>(self))
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginGetInstanceFramesCount(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    return OrthancPluginGetInstanceFramesCount(context_
+      , reinterpret_cast<OrthancPluginDicomInstance*>(static_cast<intptr_t>(self))
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginGetInstanceRawFrame(JNIEnv* env, jobject sdkObject, jlong self, jint arg0)
+{
+  try
+  {
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginGetInstanceRawFrame(context_, b.GetMemoryBuffer()
+      , reinterpret_cast<OrthancPluginDicomInstance*>(static_cast<intptr_t>(self))
+      , arg0);
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jlong JNI_OrthancPluginGetInstanceDecodedFrame(JNIEnv* env, jobject sdkObject, jlong self, jint arg0)
+{
+  try
+  {
+    OrthancPluginImage* answer = OrthancPluginGetInstanceDecodedFrame(context_
+      , reinterpret_cast<OrthancPluginDicomInstance*>(static_cast<intptr_t>(self))
+      , arg0);
+    if (answer == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return 0;
+    }
+    else
+    {
+      return reinterpret_cast<intptr_t>(answer);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginSerializeDicomInstance(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginSerializeDicomInstance(context_, b.GetMemoryBuffer()
+      , reinterpret_cast<OrthancPluginDicomInstance*>(static_cast<intptr_t>(self))
+      );
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetInstanceAdvancedJson(JNIEnv* env, jobject sdkObject, jlong self, jint arg0, jint arg1, jint arg2)
+{
+  try
+  {
+    OrthancString s(OrthancPluginGetInstanceAdvancedJson(context_
+      , reinterpret_cast<OrthancPluginDicomInstance*>(static_cast<intptr_t>(self))
+      , static_cast<OrthancPluginDicomToJsonFormat>(arg0), static_cast<OrthancPluginDicomToJsonFlags>(arg1), arg2));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginFindAddAnswer(JNIEnv* env, jobject sdkObject, jlong self, jbyteArray arg0)
+{
+  try
+  {
+    JavaBytes c_arg0(env, arg0);
+    OrthancPluginErrorCode code = OrthancPluginFindAddAnswer(context_
+      , reinterpret_cast<OrthancPluginFindAnswers*>(static_cast<intptr_t>(self))
+      , c_arg0.GetData(), c_arg0.GetSize());
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginFindMarkIncomplete(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    OrthancPluginErrorCode code = OrthancPluginFindMarkIncomplete(context_
+      , reinterpret_cast<OrthancPluginFindAnswers*>(static_cast<intptr_t>(self))
+      );
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginFreeFindMatcher(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    OrthancPluginFreeFindMatcher(context_
+      , reinterpret_cast<OrthancPluginFindMatcher*>(static_cast<intptr_t>(self))
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginFindMatcherIsMatch(JNIEnv* env, jobject sdkObject, jlong self, jbyteArray arg0)
+{
+  try
+  {
+    JavaBytes c_arg0(env, arg0);
+    return OrthancPluginFindMatcherIsMatch(context_
+      , reinterpret_cast<OrthancPluginFindMatcher*>(static_cast<intptr_t>(self))
+      , c_arg0.GetData(), c_arg0.GetSize());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginGetFindQuerySize(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    return OrthancPluginGetFindQuerySize(context_
+      , reinterpret_cast<OrthancPluginFindQuery*>(static_cast<intptr_t>(self))
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetFindQueryTagName(JNIEnv* env, jobject sdkObject, jlong self, jint arg0)
+{
+  try
+  {
+    OrthancString s(OrthancPluginGetFindQueryTagName(context_
+      , reinterpret_cast<OrthancPluginFindQuery*>(static_cast<intptr_t>(self))
+      , arg0));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetFindQueryValue(JNIEnv* env, jobject sdkObject, jlong self, jint arg0)
+{
+  try
+  {
+    OrthancString s(OrthancPluginGetFindQueryValue(context_
+      , reinterpret_cast<OrthancPluginFindQuery*>(static_cast<intptr_t>(self))
+      , arg0));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginFreeImage(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    OrthancPluginFreeImage(context_
+      , reinterpret_cast<OrthancPluginImage*>(static_cast<intptr_t>(self))
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginGetImagePixelFormat(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    return OrthancPluginGetImagePixelFormat(context_
+      , reinterpret_cast<OrthancPluginImage*>(static_cast<intptr_t>(self))
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginGetImageWidth(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    return OrthancPluginGetImageWidth(context_
+      , reinterpret_cast<OrthancPluginImage*>(static_cast<intptr_t>(self))
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginGetImageHeight(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    return OrthancPluginGetImageHeight(context_
+      , reinterpret_cast<OrthancPluginImage*>(static_cast<intptr_t>(self))
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginGetImagePitch(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    return OrthancPluginGetImagePitch(context_
+      , reinterpret_cast<OrthancPluginImage*>(static_cast<intptr_t>(self))
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jlong JNI_OrthancPluginConvertPixelFormat(JNIEnv* env, jobject sdkObject, jlong self, jint arg0)
+{
+  try
+  {
+    OrthancPluginImage* answer = OrthancPluginConvertPixelFormat(context_
+      , reinterpret_cast<OrthancPluginImage*>(static_cast<intptr_t>(self))
+      , static_cast<OrthancPluginPixelFormat>(arg0));
+    if (answer == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return 0;
+    }
+    else
+    {
+      return reinterpret_cast<intptr_t>(answer);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginDrawText(JNIEnv* env, jobject sdkObject, jlong self, jint arg0, jstring arg1, jint arg2, jint arg3, jbyte arg4, jbyte arg5, jbyte arg6)
+{
+  try
+  {
+    JavaString c_arg1(env, arg1);
+    OrthancPluginErrorCode code = OrthancPluginDrawText(context_
+      , reinterpret_cast<OrthancPluginImage*>(static_cast<intptr_t>(self))
+      , arg0, c_arg1.GetValue(), arg2, arg3, arg4, arg5, arg6);
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginFreeJob(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    OrthancPluginFreeJob(context_
+      , reinterpret_cast<OrthancPluginJob*>(static_cast<intptr_t>(self))
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginSubmitJob(JNIEnv* env, jobject sdkObject, jlong self, jint arg0)
+{
+  try
+  {
+    OrthancString s(OrthancPluginSubmitJob(context_
+      , reinterpret_cast<OrthancPluginJob*>(static_cast<intptr_t>(self))
+      , arg0));
+    if (s.GetValue() == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      jstring t = env->NewStringUTF(s.GetValue());
+      if (t == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        return t;
+      }
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginFreePeers(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    OrthancPluginFreePeers(context_
+      , reinterpret_cast<OrthancPluginPeers*>(static_cast<intptr_t>(self))
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginGetPeersCount(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    return OrthancPluginGetPeersCount(context_
+      , reinterpret_cast<OrthancPluginPeers*>(static_cast<intptr_t>(self))
+      );
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetPeerName(JNIEnv* env, jobject sdkObject, jlong self, jint arg0)
+{
+  try
+  {
+    const char* s = OrthancPluginGetPeerName(context_
+      , reinterpret_cast<OrthancPluginPeers*>(static_cast<intptr_t>(self))
+      , arg0);
+    if (s == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      return env->NewStringUTF(s);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetPeerUrl(JNIEnv* env, jobject sdkObject, jlong self, jint arg0)
+{
+  try
+  {
+    const char* s = OrthancPluginGetPeerUrl(context_
+      , reinterpret_cast<OrthancPluginPeers*>(static_cast<intptr_t>(self))
+      , arg0);
+    if (s == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      return env->NewStringUTF(s);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT jstring JNI_OrthancPluginGetPeerUserProperty(JNIEnv* env, jobject sdkObject, jlong self, jint arg0, jstring arg1)
+{
+  try
+  {
+    JavaString c_arg1(env, arg1);
+    const char* s = OrthancPluginGetPeerUserProperty(context_
+      , reinterpret_cast<OrthancPluginPeers*>(static_cast<intptr_t>(self))
+      , arg0, c_arg1.GetValue());
+    if (s == NULL)
+    {
+      JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+      return NULL;
+    }
+    else
+    {
+      return env->NewStringUTF(s);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginAnswerBuffer(JNIEnv* env, jobject sdkObject, jlong self, jbyteArray arg0, jstring arg2)
+{
+  try
+  {
+    JavaBytes c_arg0(env, arg0);
+    JavaString c_arg2(env, arg2);
+    OrthancPluginAnswerBuffer(context_
+      , reinterpret_cast<OrthancPluginRestOutput*>(static_cast<intptr_t>(self))
+      , c_arg0.GetData(), c_arg0.GetSize(), c_arg2.GetValue());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginCompressAndAnswerPngImage(JNIEnv* env, jobject sdkObject, jlong self, jint arg0, jint arg1, jint arg2, jint arg3, jbyteArray arg4)
+{
+  try
+  {
+    JavaBytes c_arg4(env, arg4);
+    OrthancPluginCompressAndAnswerPngImage(context_
+      , reinterpret_cast<OrthancPluginRestOutput*>(static_cast<intptr_t>(self))
+      , static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, c_arg4.GetData());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginRedirect(JNIEnv* env, jobject sdkObject, jlong self, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancPluginRedirect(context_
+      , reinterpret_cast<OrthancPluginRestOutput*>(static_cast<intptr_t>(self))
+      , c_arg0.GetValue());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginSendHttpStatusCode(JNIEnv* env, jobject sdkObject, jlong self, jshort arg0)
+{
+  try
+  {
+    OrthancPluginSendHttpStatusCode(context_
+      , reinterpret_cast<OrthancPluginRestOutput*>(static_cast<intptr_t>(self))
+      , arg0);
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginSendUnauthorized(JNIEnv* env, jobject sdkObject, jlong self, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancPluginSendUnauthorized(context_
+      , reinterpret_cast<OrthancPluginRestOutput*>(static_cast<intptr_t>(self))
+      , c_arg0.GetValue());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginSendMethodNotAllowed(JNIEnv* env, jobject sdkObject, jlong self, jstring arg0)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancPluginSendMethodNotAllowed(context_
+      , reinterpret_cast<OrthancPluginRestOutput*>(static_cast<intptr_t>(self))
+      , c_arg0.GetValue());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginSetCookie(JNIEnv* env, jobject sdkObject, jlong self, jstring arg0, jstring arg1)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    JavaString c_arg1(env, arg1);
+    OrthancPluginSetCookie(context_
+      , reinterpret_cast<OrthancPluginRestOutput*>(static_cast<intptr_t>(self))
+      , c_arg0.GetValue(), c_arg1.GetValue());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginSetHttpHeader(JNIEnv* env, jobject sdkObject, jlong self, jstring arg0, jstring arg1)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    JavaString c_arg1(env, arg1);
+    OrthancPluginSetHttpHeader(context_
+      , reinterpret_cast<OrthancPluginRestOutput*>(static_cast<intptr_t>(self))
+      , c_arg0.GetValue(), c_arg1.GetValue());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginStartMultipartAnswer(JNIEnv* env, jobject sdkObject, jlong self, jstring arg0, jstring arg1)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    JavaString c_arg1(env, arg1);
+    OrthancPluginErrorCode code = OrthancPluginStartMultipartAnswer(context_
+      , reinterpret_cast<OrthancPluginRestOutput*>(static_cast<intptr_t>(self))
+      , c_arg0.GetValue(), c_arg1.GetValue());
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginSendMultipartItem(JNIEnv* env, jobject sdkObject, jlong self, jbyteArray arg0)
+{
+  try
+  {
+    JavaBytes c_arg0(env, arg0);
+    OrthancPluginErrorCode code = OrthancPluginSendMultipartItem(context_
+      , reinterpret_cast<OrthancPluginRestOutput*>(static_cast<intptr_t>(self))
+      , c_arg0.GetData(), c_arg0.GetSize());
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginSendHttpStatus(JNIEnv* env, jobject sdkObject, jlong self, jshort arg0, jbyteArray arg1)
+{
+  try
+  {
+    JavaBytes c_arg1(env, arg1);
+    OrthancPluginSendHttpStatus(context_
+      , reinterpret_cast<OrthancPluginRestOutput*>(static_cast<intptr_t>(self))
+      , arg0, c_arg1.GetData(), c_arg1.GetSize());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginCompressAndAnswerJpegImage(JNIEnv* env, jobject sdkObject, jlong self, jint arg0, jint arg1, jint arg2, jint arg3, jbyteArray arg4, jbyte arg5)
+{
+  try
+  {
+    JavaBytes c_arg4(env, arg4);
+    OrthancPluginCompressAndAnswerJpegImage(context_
+      , reinterpret_cast<OrthancPluginRestOutput*>(static_cast<intptr_t>(self))
+      , static_cast<OrthancPluginPixelFormat>(arg0), arg1, arg2, arg3, c_arg4.GetData(), arg5);
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginSetHttpErrorDetails(JNIEnv* env, jobject sdkObject, jlong self, jstring arg0, jbyte arg1)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancPluginSetHttpErrorDetails(context_
+      , reinterpret_cast<OrthancPluginRestOutput*>(static_cast<intptr_t>(self))
+      , c_arg0.GetValue(), arg1);
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginStorageAreaCreate(JNIEnv* env, jobject sdkObject, jlong self, jstring arg0, jbyteArray arg1, jlong arg2, jint arg3)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    JavaBytes c_arg1(env, arg1);
+    OrthancPluginErrorCode code = OrthancPluginStorageAreaCreate(context_
+      , reinterpret_cast<OrthancPluginStorageArea*>(static_cast<intptr_t>(self))
+      , c_arg0.GetValue(), c_arg1.GetData(), arg2, static_cast<OrthancPluginContentType>(arg3));
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginStorageAreaRead(JNIEnv* env, jobject sdkObject, jlong self, jstring arg0, jint arg1)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginStorageAreaRead(context_, b.GetMemoryBuffer()
+      , reinterpret_cast<OrthancPluginStorageArea*>(static_cast<intptr_t>(self))
+      , c_arg0.GetValue(), static_cast<OrthancPluginContentType>(arg1));
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginStorageAreaRemove(JNIEnv* env, jobject sdkObject, jlong self, jstring arg0, jint arg1)
+{
+  try
+  {
+    JavaString c_arg0(env, arg0);
+    OrthancPluginErrorCode code = OrthancPluginStorageAreaRemove(context_
+      , reinterpret_cast<OrthancPluginStorageArea*>(static_cast<intptr_t>(self))
+      , c_arg0.GetValue(), static_cast<OrthancPluginContentType>(arg1));
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginReconstructMainDicomTags(JNIEnv* env, jobject sdkObject, jlong self, jint arg0)
+{
+  try
+  {
+    OrthancPluginErrorCode code = OrthancPluginReconstructMainDicomTags(context_
+      , reinterpret_cast<OrthancPluginStorageArea*>(static_cast<intptr_t>(self))
+      , static_cast<OrthancPluginResourceType>(arg0));
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginWorklistAddAnswer(JNIEnv* env, jobject sdkObject, jlong self, jlong arg0, jbyteArray arg1)
+{
+  try
+  {
+    JavaBytes c_arg1(env, arg1);
+    OrthancPluginErrorCode code = OrthancPluginWorklistAddAnswer(context_
+      , reinterpret_cast<OrthancPluginWorklistAnswers*>(static_cast<intptr_t>(self))
+      , reinterpret_cast<OrthancPluginWorklistQuery*>(static_cast<intptr_t>(arg0)), c_arg1.GetData(), c_arg1.GetSize());
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void JNI_OrthancPluginWorklistMarkIncomplete(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    OrthancPluginErrorCode code = OrthancPluginWorklistMarkIncomplete(context_
+      , reinterpret_cast<OrthancPluginWorklistAnswers*>(static_cast<intptr_t>(self))
+      );
+    if (code != OrthancPluginErrorCode_Success)
+    {
+      JavaEnvironment::ThrowException(env, code);
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT jint JNI_OrthancPluginWorklistIsMatch(JNIEnv* env, jobject sdkObject, jlong self, jbyteArray arg0)
+{
+  try
+  {
+    JavaBytes c_arg0(env, arg0);
+    return OrthancPluginWorklistIsMatch(context_
+      , reinterpret_cast<OrthancPluginWorklistQuery*>(static_cast<intptr_t>(self))
+      , c_arg0.GetData(), c_arg0.GetSize());
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return 0;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return 0;
+  }
+}
+
+
+JNIEXPORT jbyteArray JNI_OrthancPluginWorklistGetDicomQuery(JNIEnv* env, jobject sdkObject, jlong self)
+{
+  try
+  {
+    OrthancBytes b;
+    OrthancPluginErrorCode code = OrthancPluginWorklistGetDicomQuery(context_, b.GetMemoryBuffer()
+      , reinterpret_cast<OrthancPluginWorklistQuery*>(static_cast<intptr_t>(self))
+      );
+    if (code == OrthancPluginErrorCode_Success)
+    {
+      jbyteArray answer = env->NewByteArray(b.GetSize());
+      if (answer == NULL)
+      {
+        JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_NotEnoughMemory);
+        return NULL;
+      }
+      else
+      {
+        env->SetByteArrayRegion(answer, 0, b.GetSize(), reinterpret_cast<const jbyte*>(b.GetData()));
+        return answer;
+      }
+    }
+    else
+    {
+      JavaEnvironment::ThrowException(env, code);
+      return NULL;
+    }
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+    return NULL;
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+    return NULL;
+  }
+}
+
+
+static void JNI_LoadNatives(std::vector<JNINativeMethod>& methods)
+{
+  methods.clear();
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginCheckVersionAdvanced"),
+    const_cast<char*>("(III)I"),
+    (void*) JNI_OrthancPluginCheckVersionAdvanced
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginCheckVersion"),
+    const_cast<char*>("()I"),
+    (void*) JNI_OrthancPluginCheckVersion
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginLogError"),
+    const_cast<char*>("(Ljava/lang/String;)V"),
+    (void*) JNI_OrthancPluginLogError
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginLogWarning"),
+    const_cast<char*>("(Ljava/lang/String;)V"),
+    (void*) JNI_OrthancPluginLogWarning
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginLogInfo"),
+    const_cast<char*>("(Ljava/lang/String;)V"),
+    (void*) JNI_OrthancPluginLogInfo
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetDicomForInstance"),
+    const_cast<char*>("(Ljava/lang/String;)[B"),
+    (void*) JNI_OrthancPluginGetDicomForInstance
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginRestApiGet"),
+    const_cast<char*>("(Ljava/lang/String;)[B"),
+    (void*) JNI_OrthancPluginRestApiGet
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginRestApiGetAfterPlugins"),
+    const_cast<char*>("(Ljava/lang/String;)[B"),
+    (void*) JNI_OrthancPluginRestApiGetAfterPlugins
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginRestApiPost"),
+    const_cast<char*>("(Ljava/lang/String;[B)[B"),
+    (void*) JNI_OrthancPluginRestApiPost
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginRestApiPostAfterPlugins"),
+    const_cast<char*>("(Ljava/lang/String;[B)[B"),
+    (void*) JNI_OrthancPluginRestApiPostAfterPlugins
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginRestApiDelete"),
+    const_cast<char*>("(Ljava/lang/String;)V"),
+    (void*) JNI_OrthancPluginRestApiDelete
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginRestApiDeleteAfterPlugins"),
+    const_cast<char*>("(Ljava/lang/String;)V"),
+    (void*) JNI_OrthancPluginRestApiDeleteAfterPlugins
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginRestApiPut"),
+    const_cast<char*>("(Ljava/lang/String;[B)[B"),
+    (void*) JNI_OrthancPluginRestApiPut
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginRestApiPutAfterPlugins"),
+    const_cast<char*>("(Ljava/lang/String;[B)[B"),
+    (void*) JNI_OrthancPluginRestApiPutAfterPlugins
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginLookupPatient"),
+    const_cast<char*>("(Ljava/lang/String;)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginLookupPatient
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginLookupStudy"),
+    const_cast<char*>("(Ljava/lang/String;)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginLookupStudy
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginLookupStudyWithAccessionNumber"),
+    const_cast<char*>("(Ljava/lang/String;)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginLookupStudyWithAccessionNumber
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginLookupSeries"),
+    const_cast<char*>("(Ljava/lang/String;)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginLookupSeries
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginLookupInstance"),
+    const_cast<char*>("(Ljava/lang/String;)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginLookupInstance
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetOrthancPath"),
+    const_cast<char*>("()Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetOrthancPath
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetOrthancDirectory"),
+    const_cast<char*>("()Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetOrthancDirectory
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetConfigurationPath"),
+    const_cast<char*>("()Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetConfigurationPath
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginSetRootUri"),
+    const_cast<char*>("(Ljava/lang/String;)V"),
+    (void*) JNI_OrthancPluginSetRootUri
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginSetDescription"),
+    const_cast<char*>("(Ljava/lang/String;)V"),
+    (void*) JNI_OrthancPluginSetDescription
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginExtendOrthancExplorer"),
+    const_cast<char*>("(Ljava/lang/String;)V"),
+    (void*) JNI_OrthancPluginExtendOrthancExplorer
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetGlobalProperty"),
+    const_cast<char*>("(ILjava/lang/String;)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetGlobalProperty
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginSetGlobalProperty"),
+    const_cast<char*>("(ILjava/lang/String;)V"),
+    (void*) JNI_OrthancPluginSetGlobalProperty
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetCommandLineArgumentsCount"),
+    const_cast<char*>("()I"),
+    (void*) JNI_OrthancPluginGetCommandLineArgumentsCount
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetCommandLineArgument"),
+    const_cast<char*>("(I)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetCommandLineArgument
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetExpectedDatabaseVersion"),
+    const_cast<char*>("()I"),
+    (void*) JNI_OrthancPluginGetExpectedDatabaseVersion
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetConfiguration"),
+    const_cast<char*>("()Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetConfiguration
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginBufferCompression"),
+    const_cast<char*>("([BIB)[B"),
+    (void*) JNI_OrthancPluginBufferCompression
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginReadFile"),
+    const_cast<char*>("(Ljava/lang/String;)[B"),
+    (void*) JNI_OrthancPluginReadFile
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginWriteFile"),
+    const_cast<char*>("(Ljava/lang/String;[B)V"),
+    (void*) JNI_OrthancPluginWriteFile
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetErrorDescription"),
+    const_cast<char*>("(I)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetErrorDescription
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginUncompressImage"),
+    const_cast<char*>("([BI)J"),
+    (void*) JNI_OrthancPluginUncompressImage
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginCompressPngImage"),
+    const_cast<char*>("(IIII[B)[B"),
+    (void*) JNI_OrthancPluginCompressPngImage
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginCompressJpegImage"),
+    const_cast<char*>("(IIII[BB)[B"),
+    (void*) JNI_OrthancPluginCompressJpegImage
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginHttpGet"),
+    const_cast<char*>("(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)[B"),
+    (void*) JNI_OrthancPluginHttpGet
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginHttpPost"),
+    const_cast<char*>("(Ljava/lang/String;[BLjava/lang/String;Ljava/lang/String;)[B"),
+    (void*) JNI_OrthancPluginHttpPost
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginHttpPut"),
+    const_cast<char*>("(Ljava/lang/String;[BLjava/lang/String;Ljava/lang/String;)[B"),
+    (void*) JNI_OrthancPluginHttpPut
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginHttpDelete"),
+    const_cast<char*>("(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V"),
+    (void*) JNI_OrthancPluginHttpDelete
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetFontsCount"),
+    const_cast<char*>("()I"),
+    (void*) JNI_OrthancPluginGetFontsCount
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetFontName"),
+    const_cast<char*>("(I)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetFontName
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetFontSize"),
+    const_cast<char*>("(I)I"),
+    (void*) JNI_OrthancPluginGetFontSize
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginRegisterErrorCode"),
+    const_cast<char*>("(ISLjava/lang/String;)V"),
+    (void*) JNI_OrthancPluginRegisterErrorCode
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginRegisterDictionaryTag"),
+    const_cast<char*>("(SSILjava/lang/String;II)V"),
+    (void*) JNI_OrthancPluginRegisterDictionaryTag
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginRegisterPrivateDictionaryTag"),
+    const_cast<char*>("(SSILjava/lang/String;IILjava/lang/String;)V"),
+    (void*) JNI_OrthancPluginRegisterPrivateDictionaryTag
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginDicomBufferToJson"),
+    const_cast<char*>("([BIII)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginDicomBufferToJson
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginDicomInstanceToJson"),
+    const_cast<char*>("(Ljava/lang/String;III)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginDicomInstanceToJson
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginCreateDicom"),
+    const_cast<char*>("(Ljava/lang/String;JI)[B"),
+    (void*) JNI_OrthancPluginCreateDicom
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginCreateImage"),
+    const_cast<char*>("(III)J"),
+    (void*) JNI_OrthancPluginCreateImage
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginDecodeDicomImage"),
+    const_cast<char*>("([BI)J"),
+    (void*) JNI_OrthancPluginDecodeDicomImage
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginComputeMd5"),
+    const_cast<char*>("([B)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginComputeMd5
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginComputeSha1"),
+    const_cast<char*>("([B)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginComputeSha1
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGenerateUuid"),
+    const_cast<char*>("()Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGenerateUuid
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginCreateFindMatcher"),
+    const_cast<char*>("([B)J"),
+    (void*) JNI_OrthancPluginCreateFindMatcher
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetPeers"),
+    const_cast<char*>("()J"),
+    (void*) JNI_OrthancPluginGetPeers
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginAutodetectMimeType"),
+    const_cast<char*>("(Ljava/lang/String;)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginAutodetectMimeType
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginSetMetricsValue"),
+    const_cast<char*>("(Ljava/lang/String;FI)V"),
+    (void*) JNI_OrthancPluginSetMetricsValue
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetTagName"),
+    const_cast<char*>("(SSLjava/lang/String;)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetTagName
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginCreateDicomInstance"),
+    const_cast<char*>("([B)J"),
+    (void*) JNI_OrthancPluginCreateDicomInstance
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginTranscodeDicomInstance"),
+    const_cast<char*>("([BLjava/lang/String;)J"),
+    (void*) JNI_OrthancPluginTranscodeDicomInstance
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGenerateRestApiAuthorizationToken"),
+    const_cast<char*>("()Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGenerateRestApiAuthorizationToken
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginCreateDicom2"),
+    const_cast<char*>("(Ljava/lang/String;JILjava/lang/String;)[B"),
+    (void*) JNI_OrthancPluginCreateDicom2
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginFreeDicomInstance"),
+    const_cast<char*>("(J)V"),
+    (void*) JNI_OrthancPluginFreeDicomInstance
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetInstanceRemoteAet"),
+    const_cast<char*>("(J)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetInstanceRemoteAet
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetInstanceSize"),
+    const_cast<char*>("(J)J"),
+    (void*) JNI_OrthancPluginGetInstanceSize
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetInstanceJson"),
+    const_cast<char*>("(J)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetInstanceJson
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetInstanceSimplifiedJson"),
+    const_cast<char*>("(J)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetInstanceSimplifiedJson
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginHasInstanceMetadata"),
+    const_cast<char*>("(JLjava/lang/String;)I"),
+    (void*) JNI_OrthancPluginHasInstanceMetadata
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetInstanceMetadata"),
+    const_cast<char*>("(JLjava/lang/String;)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetInstanceMetadata
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetInstanceOrigin"),
+    const_cast<char*>("(J)I"),
+    (void*) JNI_OrthancPluginGetInstanceOrigin
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetInstanceTransferSyntaxUid"),
+    const_cast<char*>("(J)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetInstanceTransferSyntaxUid
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginHasInstancePixelData"),
+    const_cast<char*>("(J)I"),
+    (void*) JNI_OrthancPluginHasInstancePixelData
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetInstanceFramesCount"),
+    const_cast<char*>("(J)I"),
+    (void*) JNI_OrthancPluginGetInstanceFramesCount
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetInstanceRawFrame"),
+    const_cast<char*>("(JI)[B"),
+    (void*) JNI_OrthancPluginGetInstanceRawFrame
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetInstanceDecodedFrame"),
+    const_cast<char*>("(JI)J"),
+    (void*) JNI_OrthancPluginGetInstanceDecodedFrame
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginSerializeDicomInstance"),
+    const_cast<char*>("(J)[B"),
+    (void*) JNI_OrthancPluginSerializeDicomInstance
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetInstanceAdvancedJson"),
+    const_cast<char*>("(JIII)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetInstanceAdvancedJson
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginFindAddAnswer"),
+    const_cast<char*>("(J[B)V"),
+    (void*) JNI_OrthancPluginFindAddAnswer
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginFindMarkIncomplete"),
+    const_cast<char*>("(J)V"),
+    (void*) JNI_OrthancPluginFindMarkIncomplete
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginFreeFindMatcher"),
+    const_cast<char*>("(J)V"),
+    (void*) JNI_OrthancPluginFreeFindMatcher
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginFindMatcherIsMatch"),
+    const_cast<char*>("(J[B)I"),
+    (void*) JNI_OrthancPluginFindMatcherIsMatch
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetFindQuerySize"),
+    const_cast<char*>("(J)I"),
+    (void*) JNI_OrthancPluginGetFindQuerySize
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetFindQueryTagName"),
+    const_cast<char*>("(JI)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetFindQueryTagName
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetFindQueryValue"),
+    const_cast<char*>("(JI)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetFindQueryValue
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginFreeImage"),
+    const_cast<char*>("(J)V"),
+    (void*) JNI_OrthancPluginFreeImage
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetImagePixelFormat"),
+    const_cast<char*>("(J)I"),
+    (void*) JNI_OrthancPluginGetImagePixelFormat
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetImageWidth"),
+    const_cast<char*>("(J)I"),
+    (void*) JNI_OrthancPluginGetImageWidth
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetImageHeight"),
+    const_cast<char*>("(J)I"),
+    (void*) JNI_OrthancPluginGetImageHeight
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetImagePitch"),
+    const_cast<char*>("(J)I"),
+    (void*) JNI_OrthancPluginGetImagePitch
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginConvertPixelFormat"),
+    const_cast<char*>("(JI)J"),
+    (void*) JNI_OrthancPluginConvertPixelFormat
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginDrawText"),
+    const_cast<char*>("(JILjava/lang/String;IIBBB)V"),
+    (void*) JNI_OrthancPluginDrawText
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginFreeJob"),
+    const_cast<char*>("(J)V"),
+    (void*) JNI_OrthancPluginFreeJob
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginSubmitJob"),
+    const_cast<char*>("(JI)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginSubmitJob
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginFreePeers"),
+    const_cast<char*>("(J)V"),
+    (void*) JNI_OrthancPluginFreePeers
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetPeersCount"),
+    const_cast<char*>("(J)I"),
+    (void*) JNI_OrthancPluginGetPeersCount
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetPeerName"),
+    const_cast<char*>("(JI)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetPeerName
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetPeerUrl"),
+    const_cast<char*>("(JI)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetPeerUrl
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginGetPeerUserProperty"),
+    const_cast<char*>("(JILjava/lang/String;)Ljava/lang/String;"),
+    (void*) JNI_OrthancPluginGetPeerUserProperty
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginAnswerBuffer"),
+    const_cast<char*>("(J[BLjava/lang/String;)V"),
+    (void*) JNI_OrthancPluginAnswerBuffer
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginCompressAndAnswerPngImage"),
+    const_cast<char*>("(JIIII[B)V"),
+    (void*) JNI_OrthancPluginCompressAndAnswerPngImage
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginRedirect"),
+    const_cast<char*>("(JLjava/lang/String;)V"),
+    (void*) JNI_OrthancPluginRedirect
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginSendHttpStatusCode"),
+    const_cast<char*>("(JS)V"),
+    (void*) JNI_OrthancPluginSendHttpStatusCode
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginSendUnauthorized"),
+    const_cast<char*>("(JLjava/lang/String;)V"),
+    (void*) JNI_OrthancPluginSendUnauthorized
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginSendMethodNotAllowed"),
+    const_cast<char*>("(JLjava/lang/String;)V"),
+    (void*) JNI_OrthancPluginSendMethodNotAllowed
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginSetCookie"),
+    const_cast<char*>("(JLjava/lang/String;Ljava/lang/String;)V"),
+    (void*) JNI_OrthancPluginSetCookie
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginSetHttpHeader"),
+    const_cast<char*>("(JLjava/lang/String;Ljava/lang/String;)V"),
+    (void*) JNI_OrthancPluginSetHttpHeader
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginStartMultipartAnswer"),
+    const_cast<char*>("(JLjava/lang/String;Ljava/lang/String;)V"),
+    (void*) JNI_OrthancPluginStartMultipartAnswer
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginSendMultipartItem"),
+    const_cast<char*>("(J[B)V"),
+    (void*) JNI_OrthancPluginSendMultipartItem
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginSendHttpStatus"),
+    const_cast<char*>("(JS[B)V"),
+    (void*) JNI_OrthancPluginSendHttpStatus
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginCompressAndAnswerJpegImage"),
+    const_cast<char*>("(JIIII[BB)V"),
+    (void*) JNI_OrthancPluginCompressAndAnswerJpegImage
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginSetHttpErrorDetails"),
+    const_cast<char*>("(JLjava/lang/String;B)V"),
+    (void*) JNI_OrthancPluginSetHttpErrorDetails
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginStorageAreaCreate"),
+    const_cast<char*>("(JLjava/lang/String;[BJI)V"),
+    (void*) JNI_OrthancPluginStorageAreaCreate
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginStorageAreaRead"),
+    const_cast<char*>("(JLjava/lang/String;I)[B"),
+    (void*) JNI_OrthancPluginStorageAreaRead
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginStorageAreaRemove"),
+    const_cast<char*>("(JLjava/lang/String;I)V"),
+    (void*) JNI_OrthancPluginStorageAreaRemove
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginReconstructMainDicomTags"),
+    const_cast<char*>("(JI)V"),
+    (void*) JNI_OrthancPluginReconstructMainDicomTags
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginWorklistAddAnswer"),
+    const_cast<char*>("(JJ[B)V"),
+    (void*) JNI_OrthancPluginWorklistAddAnswer
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginWorklistMarkIncomplete"),
+    const_cast<char*>("(J)V"),
+    (void*) JNI_OrthancPluginWorklistMarkIncomplete
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginWorklistIsMatch"),
+    const_cast<char*>("(J[B)I"),
+    (void*) JNI_OrthancPluginWorklistIsMatch
+  });
+
+  methods.push_back((JNINativeMethod) {
+    const_cast<char*>("OrthancPluginWorklistGetDicomQuery"),
+    const_cast<char*>("(J)[B"),
+    (void*) JNI_OrthancPluginWorklistGetDicomQuery
+  });
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Plugin/NonCopyable.h	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,36 @@
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
+#pragma once
+
+class NonCopyable
+{
+public:
+  NonCopyable(const NonCopyable &) = delete;
+  NonCopyable& operator= (const NonCopyable &) = delete;
+
+protected:
+  NonCopyable() = default;
+  ~NonCopyable() = default;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Plugin/Plugin.cpp	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,1066 @@
+/**
+ * SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+/**
+ * Java plugin for Orthanc
+ * Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
+#include <orthanc/OrthancCPlugin.h>
+
+#include <cassert>
+#include <iostream>
+#include <jni.h>
+#include <list>
+#include <map>
+#include <memory>
+#include <set>
+#include <stdexcept>
+#include <vector>
+
+#include <json/reader.h>
+
+#include "Mutex.h"
+
+static OrthancPluginContext* context_ = NULL;
+
+
+
+static const char* JAVA_EXCEPTION_CLASS = "be/uclouvain/orthanc/OrthancException";  
+
+class JavaVirtualMachine : public NonCopyable
+{
+private:
+  JavaVM *jvm_;
+
+public:
+  JavaVirtualMachine(const std::string& classPath)
+  {
+    std::string classPathOption = "-Djava.class.path=" + classPath;
+
+    std::vector<JavaVMOption> options;
+    options.resize(2);
+    options[0].optionString = const_cast<char*>(classPathOption.c_str());
+    options[0].extraInfo = NULL;
+    options[1].optionString = const_cast<char*>("-Xcheck:jni");
+    options[1].extraInfo = NULL;
+
+    JavaVMInitArgs vm_args;
+    vm_args.version  = JNI_VERSION_1_6;
+    vm_args.nOptions = options.size();
+    vm_args.options  = (options.empty() ? NULL : &options[0]);
+    vm_args.ignoreUnrecognized = false;
+
+    JNIEnv* env = NULL;
+    jint res = JNI_CreateJavaVM(&jvm_, (void **) &env, &vm_args);
+    if (res != JNI_OK ||
+        jvm_ == NULL ||
+        env == NULL)
+    {
+      throw std::runtime_error("Cannot create the JVM");
+    }
+  }
+
+  ~JavaVirtualMachine()
+  {
+    jvm_->DestroyJavaVM();
+  }
+
+  JavaVM& GetValue()
+  {
+    assert(jvm_ != NULL);
+    return *jvm_;
+  }
+};
+
+
+class JavaEnvironment : public NonCopyable
+{
+private:
+  JavaVM *jvm_;
+  JNIEnv *env_;
+
+public:
+  JavaEnvironment(JNIEnv* env) :
+    jvm_(NULL),
+    env_(env)
+  {
+    if (env_ == NULL)
+    {
+      throw std::runtime_error("Null pointer");
+    }
+  }
+  
+  JavaEnvironment(JavaVirtualMachine& jvm) :
+    jvm_(&jvm.GetValue())
+  {
+    jint status = jvm_->GetEnv((void **) &env_, JNI_VERSION_1_6);
+
+    switch (status)
+    {
+      case JNI_OK:
+        break;
+
+      case JNI_EDETACHED:
+      {
+        jint code = jvm_->AttachCurrentThread((void **) &env_, NULL);
+        if (code != JNI_OK)
+        {
+          throw std::runtime_error("Cannot attach thread");
+        }
+        break;
+      }
+
+      case JNI_EVERSION:
+        throw std::runtime_error("JNI version not supported");
+
+      default:
+        throw std::runtime_error("Not implemented");
+    }
+
+    if (env_ == NULL)
+    {
+      throw std::runtime_error("Error inside JNI");
+    }
+  }
+
+  ~JavaEnvironment()
+  {
+    if (jvm_ != NULL)
+    {
+      jvm_->DetachCurrentThread();
+    }
+  }
+
+  void CheckException()
+  {
+    if (env_->ExceptionCheck() == JNI_TRUE)
+    {
+      env_->ExceptionClear();
+      throw std::runtime_error("An exception has occurred in Java");
+    }
+  }
+
+  JNIEnv& GetValue()
+  {
+    assert(env_ != NULL);
+    return *env_;
+  }
+
+  void RunGarbageCollector()
+  {
+    assert(env_ != NULL);
+
+    jclass system = FindClass("java/lang/System");
+
+    jmethodID runFinalization = env_->GetStaticMethodID(system, "gc", "()V");
+    if (runFinalization != NULL)
+    {
+      env_->CallStaticVoidMethod(system, runFinalization);
+      CheckException();
+    }
+    else
+    {
+      throw std::runtime_error("Cannot run garbage collector");
+    }
+  }
+
+  jclass FindClass(const std::string& fqn)
+  {
+    jclass c = GetValue().FindClass(fqn.c_str());
+
+    if (c == NULL)
+    {
+      throw std::runtime_error("Unable to find class: " + fqn);
+    }
+    else
+    {
+      return c;
+    }
+  }
+
+  jclass GetObjectClass(jobject obj)
+  {
+    jclass c = GetValue().GetObjectClass(obj);
+
+    if (c == NULL)
+    {
+      throw std::runtime_error("Unable to get class of object");
+    }
+    else
+    {
+      return c;
+    }
+  }
+
+  jmethodID GetMethodID(jclass c,
+                        const std::string& method,
+                        const std::string& signature)
+  {
+    jmethodID m = GetValue().GetMethodID(c, method.c_str(), signature.c_str());
+
+    if (m == NULL)
+    {
+      throw std::runtime_error("Unable to locate method in class");
+    }
+    else
+    {
+      return m;
+    }
+  }
+
+  jobject ConstructJavaWrapper(const std::string& fqn,
+                               void* nativeObject)
+  {
+    jclass cls = FindClass(fqn);
+    jmethodID constructor = GetMethodID(cls, "<init>", "(J)V");
+    jobject obj = env_->NewObject(cls, constructor, reinterpret_cast<intptr_t>(nativeObject));
+    
+    if (obj == NULL)
+    {
+      throw std::runtime_error("Cannot create Java wrapper around C/C++ object: " + fqn);
+    }
+    else
+    {
+      return obj;
+    }
+  }
+
+  jbyteArray ConstructByteArray(const size_t size,
+                                const void* data)
+  {
+    assert(env_ != NULL);
+    jbyteArray obj = env_->NewByteArray(size);
+    if (obj == NULL)
+    {
+      throw std::runtime_error("Cannot create a byte array");
+    }
+    else
+    {
+      if (size > 0)
+      {
+        env_->SetByteArrayRegion(obj, 0, size, reinterpret_cast<const jbyte*>(data));
+      }
+
+      return obj;
+    }
+  }
+
+  jbyteArray ConstructByteArray(const std::string& data)
+  {
+    return ConstructByteArray(data.size(), data.c_str());
+  }
+
+  void RegisterNatives(const std::string& fqn,
+                       const std::vector<JNINativeMethod>& methods)
+  {
+    if (!methods.empty())
+    {
+      if (env_->RegisterNatives(FindClass(fqn), &methods[0], methods.size()) < 0)
+      {
+        throw std::runtime_error("Unable to register the native methods");
+      }
+    }
+  }
+
+  void ThrowException(const std::string& fqn,
+                      const std::string& message)
+  {
+    if (GetValue().ThrowNew(FindClass(fqn), message.c_str()) != 0)
+    {
+      std::string message = "Cannot throw exception " + fqn;
+      OrthancPluginLogError(context_, message.c_str());
+    }
+  }
+
+  void ThrowException(const std::string& message)
+  {
+    ThrowException(JAVA_EXCEPTION_CLASS, message);
+  }
+
+  void ThrowException(OrthancPluginErrorCode code)
+  {
+    ThrowException(JAVA_EXCEPTION_CLASS, OrthancPluginGetErrorDescription(context_, code));
+  }
+
+  jobject ConstructEnumValue(const std::string& fqn,
+                             int value)
+  {
+    assert(env_ != NULL);
+    jclass cls = FindClass(fqn);
+
+    std::string signature = "(I)L" + fqn + ";";
+    jmethodID constructor = env_->GetStaticMethodID(cls, "getInstance", signature.c_str());
+    if (constructor != NULL)
+    {
+      jobject obj = env_->CallStaticObjectMethod(cls, constructor, static_cast<jint>(value));
+      CheckException();
+      return obj;
+    }
+    else
+    {
+      char buf[16];
+      sprintf(buf, "%d", value);
+      throw std::runtime_error("Cannot create enumeration value: " + fqn + " " + buf);
+    }
+  }
+
+  
+  static void ThrowException(JNIEnv* env,
+                             const std::string& fqn,
+                             const std::string& message)
+  {
+    JavaEnvironment e(env);
+    e.ThrowException(fqn, message);
+  }
+  
+  static void ThrowException(JNIEnv* env,
+                             const std::string& message)
+  {
+    JavaEnvironment e(env);
+    e.ThrowException(message);
+  }
+
+  static void ThrowException(JNIEnv* env,
+                             OrthancPluginErrorCode code)
+  {
+    JavaEnvironment e(env);
+    e.ThrowException(code);
+  }
+};
+
+
+static std::unique_ptr<JavaVirtualMachine> java_;
+
+
+
+class JavaString : public NonCopyable
+{
+private:
+  JNIEnv*      env_;
+  jstring      javaStr_;
+  const char*  cStr_;
+  jboolean     isCopy_;
+  
+public:
+  JavaString(JNIEnv* env,
+             jstring javaStr) :
+    env_(env),
+    javaStr_(javaStr)
+  {
+    if (env == NULL ||
+        javaStr == NULL)
+    {
+      throw std::runtime_error("Null pointer");
+    }
+
+    cStr_ = env_->GetStringUTFChars(javaStr_, &isCopy_);
+    if (cStr_ == NULL)
+    {
+      throw std::runtime_error("Cannot read string");
+    }
+  }
+
+  ~JavaString()
+  {
+    /**
+     * "The ReleaseString-Chars call is necessary whether
+     * GetStringChars has set isCopy to JNI_TRUE or JNI_FALSE."
+     * https://stackoverflow.com/a/5863081
+     **/
+    env_->ReleaseStringUTFChars(javaStr_, cStr_);
+  }
+
+  const char* GetValue() const
+  {
+    return cStr_;
+  }
+};
+
+
+class JavaBytes : public NonCopyable
+{
+private:
+  JNIEnv*      env_;
+  jbyteArray   bytes_;
+  jbyte*       data_;
+  jsize        size_;
+  jboolean     isCopy_;
+  
+public:
+  JavaBytes(JNIEnv* env,
+            jbyteArray bytes) :
+    env_(env),
+    bytes_(bytes)
+  {
+    if (env == NULL ||
+        bytes == NULL)
+    {
+      throw std::runtime_error("Null pointer");
+    }
+
+    size_ = env->GetArrayLength(bytes);
+
+    if (size_ == 0)
+    {
+      data_ = NULL;
+    }
+    else
+    {
+      data_ = env->GetByteArrayElements(bytes_, &isCopy_);
+      if (data_ == NULL)
+      {
+        throw std::runtime_error("Cannot read array of bytes");
+      }
+    }
+  }
+
+  ~JavaBytes()
+  {
+    if (size_ > 0)
+    {
+      env_->ReleaseByteArrayElements(bytes_, data_, 0);
+    }
+  }
+
+  const void* GetData() const
+  {
+    return data_;
+  }
+
+  size_t GetSize() const
+  {
+    return size_;
+  }
+};
+
+
+class OrthancString : public NonCopyable
+{
+private:
+  char*  str_;
+
+public:
+  OrthancString(char* str) :
+    str_(str)
+  {
+  }
+
+  ~OrthancString()
+  {
+    if (str_ != NULL)
+    {
+      OrthancPluginFreeString(context_, str_);
+    }
+  }
+
+  const char* GetValue() const
+  {
+    return str_;
+  }
+};
+
+
+class OrthancBytes : public NonCopyable
+{
+private:
+  OrthancPluginMemoryBuffer  buffer_;
+
+public:
+  OrthancBytes()
+  {
+    buffer_.data = NULL;
+    buffer_.size = 0;
+  }
+
+  ~OrthancBytes()
+  {
+    OrthancPluginFreeMemoryBuffer(context_, &buffer_);
+  }
+
+  OrthancPluginMemoryBuffer* GetMemoryBuffer()
+  {
+    return &buffer_;
+  }
+
+  const void* GetData() const
+  {
+    return buffer_.data;
+  }
+
+  size_t GetSize() const
+  {
+    return buffer_.size;
+  }
+};
+
+
+class JavaGlobalReference : public NonCopyable
+{
+private:
+  JavaVirtualMachine&  jvm_;
+  jobject obj_;
+
+public:
+  JavaGlobalReference(JavaVirtualMachine& jvm,
+                      jobject obj) :
+    jvm_(jvm),
+    obj_(NULL)
+  {
+    if (obj == NULL)
+    {
+      throw std::runtime_error("Null pointer");
+    }
+
+    JavaEnvironment env(jvm);
+
+    obj_ = env.GetValue().NewGlobalRef(obj);
+    if (obj_ == NULL)
+    {
+      throw std::runtime_error("Cannot create global reference");
+    }
+  }
+
+  ~JavaGlobalReference()
+  {
+    assert(obj_ != NULL);
+
+    try
+    {
+      JavaEnvironment env(jvm_);
+      env.GetValue().DeleteGlobalRef(obj_);
+    }
+    catch (std::runtime_error& e)
+    {
+      OrthancPluginLogError(context_, e.what());
+    }
+  }
+
+  jobject GetValue()
+  {
+    assert(obj_ != NULL);
+    return obj_;
+  }
+};
+
+
+class LocalJavaObject : public NonCopyable
+{
+private:
+  JNIEnv*  env_;
+  jobject  obj_;
+
+public:
+  LocalJavaObject(JavaEnvironment& env,
+                  jobject obj,
+                  bool objCanBeNull = false) :
+    env_(&env.GetValue()),
+    obj_(obj)
+  {
+    if (!objCanBeNull && obj == NULL)
+    {
+      throw std::runtime_error("Null pointer");
+    }
+  }
+
+  ~LocalJavaObject()
+  {
+    env_->DeleteLocalRef(obj_);
+  }
+
+  jobject GetValue()
+  {
+    return obj_;
+  }
+
+  static LocalJavaObject* CreateArrayOfStrings(JavaEnvironment& env,
+                                               const std::vector<std::string>& items)
+  {
+    LocalJavaObject emptyString(env, env.GetValue().NewStringUTF(""));
+
+    jobjectArray obj = env.GetValue().NewObjectArray(
+      items.size(), env.GetValue().FindClass("java/lang/String"),
+      emptyString.GetValue());
+
+    if (obj == NULL)
+    {
+      throw std::runtime_error("Cannot create an array of Java strings");
+    }
+    else
+    {
+      std::unique_ptr<LocalJavaObject> result(new LocalJavaObject(env, obj));
+
+      for (size_t i = 0; i < items.size(); i++)
+      {
+        LocalJavaObject item(env, env.GetValue().NewStringUTF(items[i].c_str()));
+        env.GetValue().SetObjectArrayElement(obj, i, item.GetValue());
+      }
+
+      return result.release();
+    }
+  }
+
+  static LocalJavaObject* CreateDictionary(JavaEnvironment& env,
+                                           const std::map<std::string, std::string>& items)
+  {
+    // NB: In JNI, there are no generics. All the templated arguments
+    // are taken as instances of the "Object" base class.
+
+    jclass cls = env.FindClass("java/util/HashMap");
+    jmethodID constructor = env.GetMethodID(cls, "<init>", "()V");
+    jmethodID setter = env.GetMethodID(cls, "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
+    jobject obj = env.GetValue().NewObject(cls, constructor);
+
+    if (obj == NULL)
+    {
+      throw std::runtime_error("Cannot create a Java dictionary");
+    }
+    else
+    {
+      std::unique_ptr<LocalJavaObject> result(new LocalJavaObject(env, obj));
+
+      for (std::map<std::string, std::string>::const_iterator it = items.begin(); it != items.end(); ++it)
+      {
+        LocalJavaObject key(env, env.GetValue().NewStringUTF(it->first.c_str()));
+        LocalJavaObject value(env, env.GetValue().NewStringUTF(it->second.c_str()));
+        LocalJavaObject previousValue(env, env.GetValue().CallObjectMethod(obj, setter, key.GetValue(), value.GetValue()), true);
+        env.CheckException();
+      }
+
+      return result.release();
+    }
+  }
+};
+
+
+
+#include "NativeSDK.cpp"
+
+
+
+#define MAX_REST_CALLBACKS  10
+
+class CallbacksConfiguration : public NonCopyable
+{
+private:
+  Mutex                              mutex_;
+  std::list<JavaGlobalReference*>    onChangeCallbacks_;
+  std::vector<JavaGlobalReference*>  onRestRequestCallbacks_;
+
+  static void DestructCallbacks(std::list<JavaGlobalReference*>& lst)
+  {
+    for (std::list<JavaGlobalReference*>::iterator it = lst.begin(); it != lst.end(); ++it)
+    {
+      assert(*it != NULL);
+      delete *it;
+    }
+  }
+
+  static void DestructCallbacks(std::vector<JavaGlobalReference*>& v)
+  {
+    for (size_t i = 0; i < v.size(); i++)
+    {
+      assert(v[i] != NULL);
+      delete v[i];
+    }
+  }
+
+  void CopyCallbacks(std::list<jobject>& target,
+                     const std::list<JavaGlobalReference*>& lst)
+  {
+    Mutex::Locker locker(mutex_);
+    target.clear();
+
+    for (std::list<JavaGlobalReference*>::const_iterator it = lst.begin(); it != lst.end(); ++it)
+    {
+      assert(*it != NULL);
+      target.push_back((*it)->GetValue());
+    }
+  }
+
+  void AddCallback(std::list<JavaGlobalReference*>& lst,
+                   JavaVirtualMachine& jvm,
+                   jobject callback)
+  {
+    if (callback == NULL)
+    {
+      throw std::runtime_error("Null pointer");
+    }
+    else
+    {
+      Mutex::Locker locker(mutex_);
+      lst.push_back(new JavaGlobalReference(jvm, callback));
+    }
+  }
+
+public:
+  CallbacksConfiguration()
+  {
+    onRestRequestCallbacks_.reserve(MAX_REST_CALLBACKS);
+  }
+
+  ~CallbacksConfiguration()
+  {
+    DestructCallbacks(onChangeCallbacks_);
+    DestructCallbacks(onRestRequestCallbacks_);
+  }
+
+  void AddOnChangeCallback(JavaVirtualMachine& jvm,
+                           jobject callback)
+  {
+    AddCallback(onChangeCallbacks_, jvm, callback);
+  }
+
+  void GetOnChangeCallbacks(std::list<jobject>& target)
+  {
+    CopyCallbacks(target, onChangeCallbacks_);
+  }
+
+  size_t AddOnRestRequestCallback(JavaVirtualMachine& jvm,
+                                  jobject callback)
+  {
+    if (callback == NULL)
+    {
+      throw std::runtime_error("Null pointer");
+    }
+    else
+    {
+      Mutex::Locker locker(mutex_);
+      
+      if (onRestRequestCallbacks_.size() >= MAX_REST_CALLBACKS)
+      {
+        char buf[16];
+        sprintf(buf, "%d", MAX_REST_CALLBACKS);
+        throw std::runtime_error("The Java plugin for Orthanc has been compiled for a maximum of " +
+                                 std::string(buf) + " REST callbacks");
+      }
+      else
+      {
+        size_t result = onRestRequestCallbacks_.size();
+        onRestRequestCallbacks_.push_back(new JavaGlobalReference(jvm, callback));
+        return result;
+      }
+    }
+  }
+
+  jobject GetOnRestCallback(size_t i)
+  {
+    Mutex::Locker locker(mutex_);
+
+    if (i >= onRestRequestCallbacks_.size())
+    {
+      throw std::runtime_error("Unknown REST callback");
+    }
+    else
+    {
+      assert(onRestRequestCallbacks_[i] != NULL);
+      return onRestRequestCallbacks_[i]->GetValue();
+    }
+  }    
+};
+
+static std::unique_ptr<CallbacksConfiguration> callbacksConfiguration_;
+
+
+
+
+template<size_t Index>
+class RestCallbacksPool
+{
+private:
+  RestCallbacksPool<Index - 1>  next_;
+
+  static OrthancPluginErrorCode Callback(OrthancPluginRestOutput* output,
+                                         const char* uri,
+                                         const OrthancPluginHttpRequest* request)
+  {
+    try
+    {
+      jobject callback = callbacksConfiguration_->GetOnRestCallback(MAX_REST_CALLBACKS - Index);
+      if (callback == NULL)
+      {
+        throw std::runtime_error("Missing callback");
+      }
+
+      std::vector<std::string> groups;
+      groups.resize(request->groupsCount);
+      for (uint32_t i = 0; i < request->groupsCount; i++)
+      {
+        groups[i].assign(request->groups[i]);
+      }
+
+      std::map<std::string, std::string> headers;
+      for (uint32_t i = 0; i < request->headersCount; i++)
+      {
+        headers[request->headersKeys[i]] = request->headersValues[i];
+      }
+
+      std::map<std::string, std::string> getParameters;
+      for (uint32_t i = 0; i < request->getCount; i++)
+      {
+        getParameters[request->getKeys[i]] = request->getValues[i];
+      }
+
+      JavaEnvironment env(*java_);
+
+      LocalJavaObject joutput(env, env.ConstructJavaWrapper("be/uclouvain/orthanc/RestOutput", output));
+      LocalJavaObject jmethod(env, env.ConstructEnumValue("be/uclouvain/orthanc/HttpMethod", request->method));
+      LocalJavaObject juri(env, env.GetValue().NewStringUTF(uri == NULL ? "" : uri));
+      std::unique_ptr<LocalJavaObject> jgroups(LocalJavaObject::CreateArrayOfStrings(env, groups));
+      std::unique_ptr<LocalJavaObject> jheaders(LocalJavaObject::CreateDictionary(env, headers));
+      std::unique_ptr<LocalJavaObject> jgetParameters(LocalJavaObject::CreateDictionary(env, getParameters));
+      LocalJavaObject jbody(env, env.ConstructByteArray(request->bodySize, request->body));
+
+      jmethodID call = env.GetMethodID(
+        env.GetObjectClass(callback), "call",
+        "(Lbe/uclouvain/orthanc/RestOutput;Lbe/uclouvain/orthanc/HttpMethod;Ljava/lang/String;"
+        "[Ljava/lang/String;Ljava/util/Map;Ljava/util/Map;[B)V");
+
+      env.GetValue().CallVoidMethod(callback, call, joutput.GetValue(), jmethod.GetValue(), juri.GetValue(),
+                                    jgroups->GetValue(), jheaders->GetValue(), jgetParameters->GetValue(), jbody.GetValue());
+      env.CheckException();
+
+      return OrthancPluginErrorCode_Success;
+    }
+    catch (std::runtime_error& e)
+    {
+      OrthancPluginLogError(context_, e.what());
+      return OrthancPluginErrorCode_Plugin;
+    }
+    catch (...)
+    {
+      OrthancPluginLogError(context_, "Caught native exception");
+      return OrthancPluginErrorCode_Plugin;
+    }
+  }
+
+public:
+  OrthancPluginRestCallback GetCallback(size_t i)
+  {
+    if (i == 0)
+    {
+      return Callback;
+    }
+    else
+    {
+      return next_.GetCallback(i - 1);
+    }
+  }
+};
+
+template<>
+class RestCallbacksPool<0>
+{
+public:
+  OrthancPluginRestCallback& GetCallback(size_t i)
+  {
+    throw std::runtime_error("Out of tuple");
+  }
+};
+
+
+static RestCallbacksPool<MAX_REST_CALLBACKS>  restCallbacksPool_;
+
+
+
+OrthancPluginErrorCode OnChangeCallback(OrthancPluginChangeType changeType,
+                                        OrthancPluginResourceType resourceType,
+                                        const char* resourceId)
+{
+  try
+  {
+    std::list<jobject> callbacks;
+    callbacksConfiguration_->GetOnChangeCallbacks(callbacks);
+
+    if (!callbacks.empty())
+    {
+      JavaEnvironment env(*java_);
+
+      LocalJavaObject c(env, env.ConstructEnumValue("be/uclouvain/orthanc/ChangeType", changeType));
+      LocalJavaObject r(env, env.ConstructEnumValue("be/uclouvain/orthanc/ResourceType", resourceType));
+      LocalJavaObject s(env, env.GetValue().NewStringUTF(resourceId == NULL ? "" : resourceId));
+
+      for (std::list<jobject>::const_iterator
+             callback = callbacks.begin(); callback != callbacks.end(); ++callback)
+      {
+        assert(*callback != NULL);
+
+        jmethodID call = env.GetMethodID(
+          env.GetObjectClass(*callback), "call",
+          "(Lbe/uclouvain/orthanc/ChangeType;Lbe/uclouvain/orthanc/ResourceType;Ljava/lang/String;)V");
+
+        env.GetValue().CallVoidMethod(*callback, call, c.GetValue(), r.GetValue(), s.GetValue());
+        env.CheckException();
+      }
+    }
+
+    return OrthancPluginErrorCode_Success;
+  }
+  catch (std::runtime_error& e)
+  {
+    OrthancPluginLogError(context_, e.what());
+    return OrthancPluginErrorCode_Plugin;
+  }
+  catch (...)
+  {
+    OrthancPluginLogError(context_, "Caught native exception");
+    return OrthancPluginErrorCode_Plugin;
+  }
+}
+
+
+JNIEXPORT void RegisterOnChangeCallback(JNIEnv* env, jobject sdkObject, jobject callback)
+{
+  try
+  {
+    callbacksConfiguration_->AddOnChangeCallback(*java_, callback);
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+JNIEXPORT void RegisterOnRestRequestCallback(JNIEnv* env, jobject sdkObject, jstring regex, jobject callback)
+{
+  try
+  {
+    JavaString cregex(env, regex);
+    size_t index = callbacksConfiguration_->AddOnRestRequestCallback(*java_, callback);
+    OrthancPluginRegisterRestCallbackNoLock(context_, cregex.GetValue(), restCallbacksPool_.GetCallback(index));
+  }
+  catch (std::runtime_error& e)
+  {
+    JavaEnvironment::ThrowException(env, e.what());
+  }
+  catch (...)
+  {
+    JavaEnvironment::ThrowException(env, OrthancPluginErrorCode_Plugin);
+  }
+}
+
+
+extern "C"
+{
+  ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context)
+  {
+    context_ = context;
+
+    /* Check the version of the Orthanc core */
+    if (OrthancPluginCheckVersion(context) == 0)
+    {
+      char info[1024];
+      sprintf(info, "Your version of Orthanc (%s) must be above %d.%d.%d to run this plugin",
+              context->orthancVersion,
+              ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER,
+              ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER,
+              ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER);
+      OrthancPluginLogError(context, info);
+      return -1;
+    }
+
+    try
+    {
+      {
+        // Sanity check to ensure that the compiler has created different callback functions
+        std::set<intptr_t> c;
+        for (unsigned int i = 0; i < MAX_REST_CALLBACKS; i++)
+        {
+          c.insert(reinterpret_cast<intptr_t>(restCallbacksPool_.GetCallback(i)));
+        }
+
+        if (c.size() != MAX_REST_CALLBACKS)
+        {
+          throw std::runtime_error("The Java plugin has not been properly compiled");
+        }
+      }
+
+      java_.reset(new JavaVirtualMachine("TODO"));
+
+      callbacksConfiguration_.reset(new CallbacksConfiguration);
+      OrthancPluginRegisterOnChangeCallback(context_, OnChangeCallback);
+
+      JavaEnvironment env(*java_);
+      
+      {
+        std::vector<JNINativeMethod> methods;
+        JNI_LoadNatives(methods);
+        env.RegisterNatives("be/uclouvain/orthanc/NativeSDK", methods);
+      }
+
+      {
+        std::vector<JNINativeMethod> methods;
+        methods.push_back((JNINativeMethod) {
+            const_cast<char*>("register"),
+              const_cast<char*>("(Lbe/uclouvain/orthanc/Callbacks$OnChange;)V"),
+              (void*) RegisterOnChangeCallback });
+        methods.push_back((JNINativeMethod) {
+            const_cast<char*>("register"),
+              const_cast<char*>("(Ljava/lang/String;Lbe/uclouvain/orthanc/Callbacks$OnRestRequest;)V"),
+              (void*) RegisterOnRestRequestCallback });
+        env.RegisterNatives("be/uclouvain/orthanc/Callbacks", methods);
+      }
+    }
+    catch (std::runtime_error& e)
+    {
+      OrthancPluginLogError(context, e.what());
+      return -1;
+    }
+    
+    return 0;
+  }
+
+
+  ORTHANC_PLUGINS_API void OrthancPluginFinalize()
+  {
+    if (java_.get() != NULL)
+    {
+      callbacksConfiguration_.reset(NULL);
+      
+      try
+      {
+        JavaEnvironment env(*java_);
+        env.RunGarbageCollector();
+      }
+      catch (std::runtime_error& e)
+      {
+        OrthancPluginLogError(context_, e.what());
+      }
+
+      java_.reset(NULL);
+    }
+  }
+
+
+  ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
+  {
+    return "java";
+  }
+
+
+  ORTHANC_PLUGINS_API const char* OrthancPluginGetVersion()
+  {
+    return PLUGIN_VERSION;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,49 @@
+Java plugin for Orthanc
+=======================
+
+
+General information
+-------------------
+
+This repository contains the source code of an Orthanc plugin to
+develop Java plugins.
+
+
+Installation and usage
+----------------------
+
+Build and usage instructions are available in the Orthanc Book:
+http://book.orthanc-server.com/plugins/java.html
+
+
+Licensing
+---------
+
+This project is REUSE compliant for its licensing, as established by
+Free Software Foundation Europe (FSFE):
+https://reuse.software/
+
+
+Citation
+--------
+
+We kindly ask scientific works and clinical studies that make use of
+Orthanc to cite Orthanc in their associated publications. Similarly,
+we ask open-source and closed-source products that make use of Orthanc
+to warn us about this use. You can cite our work using the following
+BibTeX entry:
+
+@Article{Jodogne2018,
+  author="Jodogne, S{\'e}bastien",
+  title="The {O}rthanc Ecosystem for Medical Imaging",
+  journal="Journal of Digital Imaging",
+  year="2018",
+  month="Jun",
+  day="01",
+  volume="31",
+  number="3",
+  pages="341--352",
+  issn="1618-727X",
+  doi="10.1007/s10278-018-0082-y",
+  url="https://doi.org/10.1007/s10278-018-0082-y"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Orthanc/CMake/AutoGeneratedCode.cmake	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,79 @@
+# Orthanc - A Lightweight, RESTful DICOM Store
+# Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+# Department, University Hospital of Liege, Belgium
+# Copyright (C) 2017-2023 Osimis S.A., Belgium
+# Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/>.
+
+
+set(EMBED_RESOURCES_PYTHON "${CMAKE_CURRENT_LIST_DIR}/../EmbedResources.py"
+  CACHE INTERNAL "Path to the EmbedResources.py script from Orthanc")
+set(AUTOGENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/AUTOGENERATED")
+set(AUTOGENERATED_SOURCES)
+
+file(MAKE_DIRECTORY ${AUTOGENERATED_DIR})
+include_directories(${AUTOGENERATED_DIR})
+
+macro(EmbedResources)
+  # Convert a semicolon separated list to a whitespace separated string
+  set(SCRIPT_OPTIONS)
+  set(SCRIPT_ARGUMENTS)
+  set(DEPENDENCIES)
+  set(IS_PATH_NAME false)
+
+  set(TARGET_BASE "${AUTOGENERATED_DIR}/EmbeddedResources")
+
+  # Loop over the arguments of the function
+  foreach(arg ${ARGN})
+    # Extract the first character of the argument
+    string(SUBSTRING "${arg}" 0 1 FIRST_CHAR)
+    if (${FIRST_CHAR} STREQUAL "-")
+      # If the argument starts with a dash "-", this is an option to
+      # EmbedResources.py
+      if (${arg} MATCHES "--target=.*")
+        # Does the argument starts with "--target="?
+        string(SUBSTRING "${arg}" 9 -1 TARGET)  # 9 is the length of "--target="
+        set(TARGET_BASE "${AUTOGENERATED_DIR}/${TARGET}")
+      else()
+        list(APPEND SCRIPT_OPTIONS ${arg})
+      endif()
+    else()
+      if (${IS_PATH_NAME})
+        list(APPEND SCRIPT_ARGUMENTS "${arg}")
+        list(APPEND DEPENDENCIES "${arg}")
+        set(IS_PATH_NAME false)
+      else()
+        list(APPEND SCRIPT_ARGUMENTS "${arg}")
+        set(IS_PATH_NAME true)
+      endif()
+    endif()
+  endforeach()
+
+  add_custom_command(
+    OUTPUT
+    "${TARGET_BASE}.h"
+    "${TARGET_BASE}.cpp"
+    COMMAND ${PYTHON_EXECUTABLE} ${EMBED_RESOURCES_PYTHON}
+            ${SCRIPT_OPTIONS} "${TARGET_BASE}" ${SCRIPT_ARGUMENTS}
+    DEPENDS
+    ${EMBED_RESOURCES_PYTHON}
+    ${DEPENDENCIES}
+    )
+
+  list(APPEND AUTOGENERATED_SOURCES
+    "${TARGET_BASE}.cpp"
+    ) 
+endmacro()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Orthanc/CMake/Compiler.cmake	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,286 @@
+# Orthanc - A Lightweight, RESTful DICOM Store
+# Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+# Department, University Hospital of Liege, Belgium
+# Copyright (C) 2017-2023 Osimis S.A., Belgium
+# Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/>.
+
+
+# This file sets all the compiler-related flags
+
+
+# Save the current compiler flags to the cache every time cmake configures the project
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "compiler flags" FORCE)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING "compiler flags" FORCE)
+
+
+include(CheckLibraryExists)
+
+if ((CMAKE_CROSSCOMPILING AND NOT
+      "${CMAKE_SYSTEM_VERSION}" STREQUAL "CrossToolNg") OR    
+    "${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
+  # Cross-compilation necessarily implies standalone and static build
+  SET(STATIC_BUILD ON)
+  SET(STANDALONE_BUILD ON)
+endif()
+
+
+if ("${CMAKE_SYSTEM_VERSION}" STREQUAL "LinuxStandardBase")
+  # Cache the environment variables "LSB_CC" and "LSB_CXX" for further
+  # use by "ExternalProject" in CMake
+  SET(CMAKE_LSB_CC $ENV{LSB_CC} CACHE STRING "")
+  SET(CMAKE_LSB_CXX $ENV{LSB_CXX} CACHE STRING "")
+endif()
+
+
+if (CMAKE_COMPILER_IS_GNUCXX)
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-long-long")
+
+  # --std=c99 makes libcurl not to compile
+  # -pedantic gives a lot of warnings on OpenSSL 
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -Wno-variadic-macros")
+
+  if (CMAKE_CROSSCOMPILING)
+    # http://stackoverflow.com/a/3543845/881731
+    set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -O coff -I<CMAKE_CURRENT_SOURCE_DIR> <SOURCE> <OBJECT>")
+  endif()
+
+elseif (MSVC)
+  # Use static runtime under Visual Studio
+  # http://www.cmake.org/Wiki/CMake_FAQ#Dynamic_Replace
+  # http://stackoverflow.com/a/6510446
+  foreach(flag_var
+    CMAKE_C_FLAGS_DEBUG
+    CMAKE_CXX_FLAGS_DEBUG
+    CMAKE_C_FLAGS_RELEASE 
+    CMAKE_CXX_FLAGS_RELEASE
+    CMAKE_C_FLAGS_MINSIZEREL 
+    CMAKE_CXX_FLAGS_MINSIZEREL 
+    CMAKE_C_FLAGS_RELWITHDEBINFO 
+    CMAKE_CXX_FLAGS_RELWITHDEBINFO) 
+    string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
+    string(REGEX REPLACE "/MDd" "/MTd" ${flag_var} "${${flag_var}}")
+  endforeach(flag_var)
+
+  # Add /Zm256 compiler option to Visual Studio to fix PCH errors
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm256")
+
+  # New in Orthanc 1.5.5
+  if (MSVC_MULTIPLE_PROCESSES)
+    # "If you omit the processMax argument in the /MP option, the
+    # compiler obtains the number of effective processors from the
+    # operating system, and then creates one process per effective
+    # processor"
+    # https://blog.kitware.com/cmake-building-with-all-your-cores/
+    # https://docs.microsoft.com/en-us/cpp/build/reference/mp-build-with-multiple-processes
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
+  endif()
+    
+  add_definitions(
+    -D_CRT_SECURE_NO_WARNINGS=1
+    -D_CRT_SECURE_NO_DEPRECATE=1
+    )
+
+  if (MSVC_VERSION LESS 1600)
+    # Starting with Visual Studio >= 2010 (i.e. macro _MSC_VER >=
+    # 1600), Microsoft ships a standard-compliant <stdint.h>
+    # header. For earlier versions of Visual Studio, give access to a
+    # compatibility header.
+    # http://stackoverflow.com/a/70630/881731
+    # https://en.wikibooks.org/wiki/C_Programming/C_Reference/stdint.h#External_links
+    include_directories(${CMAKE_CURRENT_LIST_DIR}/../../Resources/ThirdParty/VisualStudio)
+  endif()
+
+  link_libraries(netapi32)
+endif()
+
+
+if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR
+    ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
+  # In FreeBSD/OpenBSD, the "/usr/local/" folder contains the ports and need to be imported
+  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/usr/local/include")
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/usr/local/include")
+  SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/usr/local/lib")
+  SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -L/usr/local/lib")
+endif()
+
+
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
+    ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR
+    ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR
+    ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
+
+  if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD" AND
+      NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
+    # The "--no-undefined" linker flag makes the shared libraries
+    # (plugins ModalityWorklists and ServeFolders) fail to compile on
+    # OpenBSD, and make the PostgreSQL plugin complain about missing
+    # "environ" global variable in FreeBSD
+    set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
+  endif()
+
+  # Remove the "-rdynamic" option
+  # http://www.mail-archive.com/cmake@cmake.org/msg08837.html
+  set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
+  link_libraries(pthread)
+
+  if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
+    link_libraries(rt)
+  endif()
+
+  if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" AND
+      NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
+    link_libraries(dl)
+  endif()
+
+  if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" AND
+      NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
+    # The "--as-needed" linker flag is not available on FreeBSD and OpenBSD
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed")
+    set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--as-needed")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed")
+  endif()
+
+  if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" AND
+      NOT ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
+    # FreeBSD/OpenBSD have just one single interface for file
+    # handling, which is 64bit clean, so there is no need to define macro
+    # for LFS (Large File Support).
+    # https://ohse.de/uwe/articles/lfs.html
+    add_definitions(
+      -D_LARGEFILE64_SOURCE=1 
+      -D_FILE_OFFSET_BITS=64
+      )
+  endif()
+
+elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
+  if (MSVC)
+    message("MSVC compiler version = " ${MSVC_VERSION} "\n")
+    # Starting Visual Studio 2013 (version 1800), it is not possible
+    # to target Windows XP anymore
+    if (MSVC_VERSION LESS 1800)
+      add_definitions(
+        -DWINVER=0x0501
+        -D_WIN32_WINNT=0x0501
+        )
+    endif()
+  else()
+    add_definitions(
+      -DWINVER=0x0501
+      -D_WIN32_WINNT=0x0501
+      )
+  endif()
+
+  add_definitions(
+    -D_CRT_SECURE_NO_WARNINGS=1
+    )
+  link_libraries(rpcrt4 ws2_32 iphlpapi)  # "iphlpapi" is for "SystemToolbox::GetMacAddresses()"
+
+  if (CMAKE_COMPILER_IS_GNUCXX)
+    # Some additional C/C++ compiler flags for MinGW
+    SET(MINGW_NO_WARNINGS "-Wno-unused-function -Wno-unused-variable")
+    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MINGW_NO_WARNINGS} -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast")
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MINGW_NO_WARNINGS}")
+
+    if (DYNAMIC_MINGW_STDLIB)
+    else()
+      # This is a patch for MinGW64
+      SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--allow-multiple-definition -static-libgcc -static-libstdc++")
+      SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--allow-multiple-definition -static-libgcc -static-libstdc++")
+    endif()
+
+    CHECK_LIBRARY_EXISTS(winpthread pthread_create "" HAVE_WIN_PTHREAD)
+    if (HAVE_WIN_PTHREAD)
+      if (DYNAMIC_MINGW_STDLIB)
+      else()
+        # This line is necessary to compile with recent versions of MinGW,
+        # otherwise "libwinpthread-1.dll" is not statically linked.
+        SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic")
+      endif()
+      add_definitions(-DHAVE_WIN_PTHREAD=1)
+    else()
+      add_definitions(-DHAVE_WIN_PTHREAD=0)
+    endif()
+  endif()
+
+elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+  add_definitions(
+    -D_XOPEN_SOURCE=1
+    )
+  link_libraries(iconv)
+
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
+  message("Building using Emscripten (for WebAssembly or asm.js targets)")
+  include(${CMAKE_CURRENT_LIST_DIR}/EmscriptenParameters.cmake)
+  
+elseif (CMAKE_SYSTEM_NAME STREQUAL "Android")
+
+else()
+  message("Unknown target platform: ${CMAKE_SYSTEM_NAME}")
+  message(FATAL_ERROR "Support your platform here")
+endif()
+
+
+if (DEFINED ENABLE_PROFILING AND ENABLE_PROFILING)
+  if (CMAKE_COMPILER_IS_GNUCXX OR
+      CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg")
+    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pg")
+    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg")
+    set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -pg")
+    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg")
+  else()
+    message(FATAL_ERROR "Don't know how to enable profiling on your configuration")
+  endif()
+endif()
+
+
+if (CMAKE_COMPILER_IS_GNUCXX)
+  # "When creating a static library using binutils (ar) and there
+  # exist a duplicate object name (e.g. a/Foo.cpp.o, b/Foo.cpp.o), the
+  # resulting static library can end up having only one of the
+  # duplicate objects. [...] This bug only happens if there are many
+  # objects." The trick consists in replacing the "r" argument
+  # ("replace") provided to "ar" (as used in CMake < 3.1) by the "q"
+  # argument ("quick append"). This is because of the fact that CMake
+  # will invoke "ar" several times with several batches of ".o"
+  # objects, and using "r" would overwrite symbols defined in
+  # preceding batches. https://cmake.org/Bug/view.php?id=14874
+  set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> <LINK_FLAGS> q <TARGET> <OBJECTS>")
+endif()
+
+
+# This function defines macro "__ORTHANC_FILE__" as a replacement to
+# macro "__FILE__", as the latter leaks the full path of the source
+# files in the binaries
+# https://stackoverflow.com/questions/8487986/file-macro-shows-full-path
+# https://twitter.com/wget42/status/1676877802375634944?s=20
+function(DefineSourceBasenameForTarget targetname)
+  # Microsoft Visual Studio is extremely slow if using
+  # "set_property()", we only enable this feature for gcc and clang
+  if (CMAKE_COMPILER_IS_GNUCXX OR
+      CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+    get_target_property(source_files "${targetname}" SOURCES)
+    foreach(sourcefile ${source_files})
+      get_filename_component(basename "${sourcefile}" NAME)
+      set_property(
+        SOURCE "${sourcefile}" APPEND
+        PROPERTY COMPILE_DEFINITIONS "__ORTHANC_FILE__=\"${basename}\"")
+    endforeach()
+  endif()
+endfunction()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Orthanc/CMake/DownloadPackage.cmake	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,286 @@
+# Orthanc - A Lightweight, RESTful DICOM Store
+# Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+# Department, University Hospital of Liege, Belgium
+# Copyright (C) 2017-2023 Osimis S.A., Belgium
+# Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/>.
+
+
+macro(GetUrlFilename TargetVariable Url)
+  string(REGEX REPLACE "^.*/" "" ${TargetVariable} "${Url}")
+endmacro()
+
+
+macro(GetUrlExtension TargetVariable Url)
+  #string(REGEX REPLACE "^.*/[^.]*\\." "" TMP "${Url}")
+  string(REGEX REPLACE "^.*\\." "" TMP "${Url}")
+  string(TOLOWER "${TMP}" "${TargetVariable}")
+endmacro()
+
+
+
+##
+## Setup the patch command-line tool
+##
+
+if (NOT ORTHANC_DISABLE_PATCH)
+  if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
+    set(PATCH_EXECUTABLE ${CMAKE_CURRENT_LIST_DIR}/../ThirdParty/patch/patch.exe)
+    if (NOT EXISTS ${PATCH_EXECUTABLE})
+      message(FATAL_ERROR "Unable to find the patch.exe tool that is shipped with Orthanc")
+    endif()
+
+  else ()
+    find_program(PATCH_EXECUTABLE patch)
+    if (${PATCH_EXECUTABLE} MATCHES "PATCH_EXECUTABLE-NOTFOUND")
+      message(FATAL_ERROR "Please install the 'patch' standard command-line tool")
+    endif()
+  endif()
+endif()
+
+
+
+##
+## Check the existence of the required decompression tools
+##
+
+if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
+  find_program(ZIP_EXECUTABLE 7z 
+    PATHS 
+    "$ENV{ProgramFiles}/7-Zip"
+    "$ENV{ProgramW6432}/7-Zip"
+    )
+
+  if (${ZIP_EXECUTABLE} MATCHES "ZIP_EXECUTABLE-NOTFOUND")
+    message(FATAL_ERROR "Please install the '7-zip' software (http://www.7-zip.org/)")
+  endif()
+
+else()
+  find_program(UNZIP_EXECUTABLE unzip)
+  if (${UNZIP_EXECUTABLE} MATCHES "UNZIP_EXECUTABLE-NOTFOUND")
+    message(FATAL_ERROR "Please install the 'unzip' package")
+  endif()
+
+  find_program(TAR_EXECUTABLE tar)
+  if (${TAR_EXECUTABLE} MATCHES "TAR_EXECUTABLE-NOTFOUND")
+    message(FATAL_ERROR "Please install the 'tar' package")
+  endif()
+
+  find_program(GUNZIP_EXECUTABLE gunzip)
+  if (${GUNZIP_EXECUTABLE} MATCHES "GUNZIP_EXECUTABLE-NOTFOUND")
+    message(FATAL_ERROR "Please install the 'gzip' package")
+  endif()
+endif()
+
+
+macro(DownloadFile MD5 Url)
+  GetUrlFilename(TMP_FILENAME "${Url}")
+
+  set(TMP_PATH "${CMAKE_SOURCE_DIR}/ThirdPartyDownloads/${TMP_FILENAME}")
+  if (NOT EXISTS "${TMP_PATH}")
+    message("Downloading ${Url}")
+
+    # This fixes issue 6: "I think cmake shouldn't download the
+    # packages which are not in the system, it should stop and let
+    # user know."
+    # https://code.google.com/p/orthanc/issues/detail?id=6
+    if (NOT STATIC_BUILD AND NOT ALLOW_DOWNLOADS)
+      message(FATAL_ERROR "CMake is not allowed to download from Internet. Please set the ALLOW_DOWNLOADS option to ON")
+    endif()
+
+    foreach (retry RANGE 1 5)   # Retries 5 times
+      if ("${MD5}" STREQUAL "no-check")
+        message(WARNING "Not checking the MD5 of: ${Url}")
+        file(DOWNLOAD "${Url}" "${TMP_PATH}"
+          SHOW_PROGRESS TIMEOUT 30 INACTIVITY_TIMEOUT 10
+          STATUS Failure)
+      else()
+        file(DOWNLOAD "${Url}" "${TMP_PATH}"
+          SHOW_PROGRESS TIMEOUT 30 INACTIVITY_TIMEOUT 10
+          EXPECTED_MD5 "${MD5}" STATUS Failure)
+      endif()
+
+      list(GET Failure 0 Status)
+      if (Status EQUAL 0)
+        break()  # Successful download
+      endif()
+    endforeach()
+
+    if (NOT Status EQUAL 0)
+      file(REMOVE ${TMP_PATH})
+      message(FATAL_ERROR "Cannot download file: ${Url}")
+    endif()
+    
+  else()
+    message("Using local copy of ${Url}")
+
+    if ("${MD5}" STREQUAL "no-check")
+      message(WARNING "Not checking the MD5 of: ${Url}")
+    else()
+      file(MD5 ${TMP_PATH} ActualMD5)
+      if (NOT "${ActualMD5}" STREQUAL "${MD5}")
+        message(FATAL_ERROR "The MD5 hash of a previously download file is invalid: ${TMP_PATH}")
+      endif()
+    endif()
+  endif()
+endmacro()
+
+
+macro(DownloadPackage MD5 Url TargetDirectory)
+  if (NOT IS_DIRECTORY "${TargetDirectory}")
+    DownloadFile("${MD5}" "${Url}")
+    
+    GetUrlExtension(TMP_EXTENSION "${Url}")
+    #message(${TMP_EXTENSION})
+    message("Uncompressing ${TMP_FILENAME}")
+
+    if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
+      # How to silently extract files using 7-zip
+      # http://superuser.com/questions/331148/7zip-command-line-extract-silently-quietly
+
+      if (("${TMP_EXTENSION}" STREQUAL "gz") OR 
+          ("${TMP_EXTENSION}" STREQUAL "tgz") OR
+          ("${TMP_EXTENSION}" STREQUAL "xz"))
+        execute_process(
+          COMMAND ${ZIP_EXECUTABLE} e -y ${TMP_PATH}
+          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+          RESULT_VARIABLE Failure
+          OUTPUT_QUIET
+          )
+
+        if (Failure)
+          message(FATAL_ERROR "Error while running the uncompression tool")
+        endif()
+
+        if ("${TMP_EXTENSION}" STREQUAL "tgz")
+          string(REGEX REPLACE ".tgz$" ".tar" TMP_FILENAME2 "${TMP_FILENAME}")
+        elseif ("${TMP_EXTENSION}" STREQUAL "gz")
+          string(REGEX REPLACE ".gz$" "" TMP_FILENAME2 "${TMP_FILENAME}")
+        elseif ("${TMP_EXTENSION}" STREQUAL "xz")
+          string(REGEX REPLACE ".xz" "" TMP_FILENAME2 "${TMP_FILENAME}")
+        endif()
+
+        execute_process(
+          COMMAND ${ZIP_EXECUTABLE} x -y ${TMP_FILENAME2}
+          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+          RESULT_VARIABLE Failure
+          OUTPUT_QUIET
+          )
+      elseif ("${TMP_EXTENSION}" STREQUAL "zip")
+        execute_process(
+          COMMAND ${ZIP_EXECUTABLE} x -y ${TMP_PATH}
+          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+          RESULT_VARIABLE Failure
+          OUTPUT_QUIET
+          )
+      else()
+        message(FATAL_ERROR "Unsupported package extension: ${TMP_EXTENSION}")
+      endif()
+
+    else()
+      if ("${TMP_EXTENSION}" STREQUAL "zip")
+        execute_process(
+          COMMAND sh -c "${UNZIP_EXECUTABLE} -q ${TMP_PATH}"
+          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+          RESULT_VARIABLE Failure
+        )
+      elseif (("${TMP_EXTENSION}" STREQUAL "gz") OR ("${TMP_EXTENSION}" STREQUAL "tgz"))
+        #message("tar xvfz ${TMP_PATH}")
+        execute_process(
+          COMMAND sh -c "${TAR_EXECUTABLE} xfz ${TMP_PATH}"
+          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+          RESULT_VARIABLE Failure
+          )
+      elseif ("${TMP_EXTENSION}" STREQUAL "bz2")
+        execute_process(
+          COMMAND sh -c "${TAR_EXECUTABLE} xfj ${TMP_PATH}"
+          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+          RESULT_VARIABLE Failure
+          )
+      elseif ("${TMP_EXTENSION}" STREQUAL "xz")
+        execute_process(
+          COMMAND sh -c "${TAR_EXECUTABLE} xf ${TMP_PATH}"
+          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+          RESULT_VARIABLE Failure
+          )
+      else()
+        message(FATAL_ERROR "Unsupported package extension: ${TMP_EXTENSION}")
+      endif()
+    endif()
+   
+    if (Failure)
+      message(FATAL_ERROR "Error while running the uncompression tool")
+    endif()
+
+    if (NOT IS_DIRECTORY "${TargetDirectory}")
+      message(FATAL_ERROR "The package was not uncompressed at the proper location. Check the CMake instructions.")
+    endif()
+  endif()
+endmacro()
+
+
+
+macro(DownloadCompressedFile MD5 Url TargetFile)
+  if (NOT EXISTS "${TargetFile}")
+    DownloadFile("${MD5}" "${Url}")
+    
+    GetUrlExtension(TMP_EXTENSION "${Url}")
+    #message(${TMP_EXTENSION})
+    message("Uncompressing ${TMP_FILENAME}")
+
+    if ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")
+      # How to silently extract files using 7-zip
+      # http://superuser.com/questions/331148/7zip-command-line-extract-silently-quietly
+
+      if ("${TMP_EXTENSION}" STREQUAL "gz")
+        execute_process(
+          # "-so" writes uncompressed file to stdout
+          COMMAND ${ZIP_EXECUTABLE} e -so -y ${TMP_PATH}
+          OUTPUT_FILE "${TargetFile}"
+          WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+          RESULT_VARIABLE Failure
+          OUTPUT_QUIET
+          )
+
+        if (Failure)
+          message(FATAL_ERROR "Error while running the uncompression tool")
+        endif()
+
+      else()
+        message(FATAL_ERROR "Unsupported file extension: ${TMP_EXTENSION}")
+      endif()
+
+    else()
+      if ("${TMP_EXTENSION}" STREQUAL "gz")
+        execute_process(
+          COMMAND sh -c "${GUNZIP_EXECUTABLE} -c ${TMP_PATH}"
+          OUTPUT_FILE "${TargetFile}"
+          RESULT_VARIABLE Failure
+          )
+      else()
+        message(FATAL_ERROR "Unsupported file extension: ${TMP_EXTENSION}")
+      endif()
+    endif()
+   
+    if (Failure)
+      message(FATAL_ERROR "Error while running the uncompression tool")
+    endif()
+
+    if (NOT EXISTS "${TargetFile}")
+      message(FATAL_ERROR "The file was not uncompressed at the proper location. Check the CMake instructions.")
+    endif()
+  endif()
+endmacro()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Orthanc/CMake/JsonCppConfiguration.cmake	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,107 @@
+# Orthanc - A Lightweight, RESTful DICOM Store
+# Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+# Department, University Hospital of Liege, Belgium
+# Copyright (C) 2017-2023 Osimis S.A., Belgium
+# Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/>.
+
+
+set(JSONCPP_CXX11 OFF)
+
+if (STATIC_BUILD OR NOT USE_SYSTEM_JSONCPP)
+  if (USE_LEGACY_JSONCPP)
+    set(JSONCPP_SOURCES_DIR ${CMAKE_BINARY_DIR}/jsoncpp-0.10.7)
+    set(JSONCPP_URL "https://orthanc.uclouvain.be/third-party-downloads/jsoncpp-0.10.7.tar.gz")
+    set(JSONCPP_MD5 "3a8072ca6a1fa9cbaf7715ae625f134f")
+    add_definitions(-DORTHANC_LEGACY_JSONCPP=1)
+  else()
+    set(JSONCPP_SOURCES_DIR ${CMAKE_BINARY_DIR}/jsoncpp-1.9.4)
+    set(JSONCPP_URL "https://orthanc.uclouvain.be/third-party-downloads/jsoncpp-1.9.4.tar.gz")
+    set(JSONCPP_MD5 "4757b26ec89798c5247fa638edfdc446")
+    add_definitions(-DORTHANC_LEGACY_JSONCPP=0)
+    set(JSONCPP_CXX11 ON)
+  endif()
+
+  DownloadPackage(${JSONCPP_MD5} ${JSONCPP_URL} "${JSONCPP_SOURCES_DIR}")
+
+  set(JSONCPP_SOURCES
+    ${JSONCPP_SOURCES_DIR}/src/lib_json/json_reader.cpp
+    ${JSONCPP_SOURCES_DIR}/src/lib_json/json_value.cpp
+    ${JSONCPP_SOURCES_DIR}/src/lib_json/json_writer.cpp
+    )
+
+  include_directories(
+    ${JSONCPP_SOURCES_DIR}/include
+    )
+
+  if (NOT ENABLE_LOCALE)
+    add_definitions(-DJSONCPP_NO_LOCALE_SUPPORT=1)
+  endif()
+    
+  source_group(ThirdParty\\JsonCpp REGULAR_EXPRESSION ${JSONCPP_SOURCES_DIR}/.*)
+
+else()
+  find_path(JSONCPP_INCLUDE_DIR json/reader.h
+    /usr/include/jsoncpp
+    /usr/local/include/jsoncpp
+    )
+
+  message("JsonCpp include dir: ${JSONCPP_INCLUDE_DIR}")
+  include_directories(${JSONCPP_INCLUDE_DIR})
+  link_libraries(jsoncpp)
+
+  CHECK_INCLUDE_FILE_CXX(${JSONCPP_INCLUDE_DIR}/json/reader.h HAVE_JSONCPP_H)
+  if (NOT HAVE_JSONCPP_H)
+    message(FATAL_ERROR "Please install the libjsoncpp-dev package")
+  endif()
+
+  # Detect if the version of JsonCpp is >= 1.0.0
+  if (EXISTS ${JSONCPP_INCLUDE_DIR}/json/version.h)
+    file(STRINGS
+      "${JSONCPP_INCLUDE_DIR}/json/version.h" 
+      JSONCPP_VERSION_MAJOR1 REGEX
+      ".*define JSONCPP_VERSION_MAJOR.*")
+
+    if (NOT JSONCPP_VERSION_MAJOR1)
+      message(FATAL_ERROR "Unable to extract the major version of JsonCpp")
+    endif()
+    
+    string(REGEX REPLACE
+      ".*JSONCPP_VERSION_MAJOR.*([0-9]+)$" "\\1" 
+      JSONCPP_VERSION_MAJOR ${JSONCPP_VERSION_MAJOR1})
+    message("JsonCpp major version: ${JSONCPP_VERSION_MAJOR}")
+
+    if (JSONCPP_VERSION_MAJOR GREATER 0)
+      set(JSONCPP_CXX11 ON)
+    endif()
+  else()
+    message("Unable to detect the major version of JsonCpp, assuming < 1.0.0")
+  endif()
+endif()
+
+
+if (JSONCPP_CXX11)
+  # Osimis has encountered problems when this macro is left at its
+  # default value (1000), so we increase this limit
+  # https://gitlab.kitware.com/third-party/jsoncpp/commit/56df2068470241f9043b676bfae415ed62a0c172
+  add_definitions(-DJSONCPP_DEPRECATED_STACK_LIMIT=5000)
+
+  if (APPLE AND
+      "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+    # Explicitly adding "-std=c++11" is needed on XCode
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+  endif()
+endif()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Orthanc/CMake/WindowsResources.py	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,80 @@
+#!/usr/bin/python
+
+# Orthanc - A Lightweight, RESTful DICOM Store
+# Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+# Department, University Hospital of Liege, Belgium
+# Copyright (C) 2017-2023 Osimis S.A., Belgium
+# Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/>.
+
+
+import os
+import sys
+import datetime
+
+if len(sys.argv) != 5:
+    sys.stderr.write('Usage: %s <Version> <ProductName> <Filename> <Description>\n\n' % sys.argv[0])
+    sys.stderr.write('Example: %s 0.9.1 Orthanc Orthanc.exe "Lightweight, RESTful DICOM server for medical imaging"\n' % sys.argv[0])
+    sys.exit(-1)
+
+SOURCE = os.path.join(os.path.dirname(__file__), 'WindowsResources.rc')
+
+VERSION = sys.argv[1]
+PRODUCT = sys.argv[2]
+FILENAME = sys.argv[3]
+DESCRIPTION = sys.argv[4]
+
+if VERSION == 'mainline':
+    VERSION = '999.999.999'
+    RELEASE = 'This is a mainline build, not an official release'
+else:
+    RELEASE = 'Release %s' % VERSION
+
+v = VERSION.split('.')
+if len(v) != 2 and len(v) != 3:
+    sys.stderr.write('Bad version number: %s\n' % VERSION)
+    sys.exit(-1)
+
+if len(v) == 2:
+    v.append('0')
+
+extension = os.path.splitext(FILENAME)[1]
+if extension.lower() == '.dll':
+    BLOCK = '040904E4'
+    TYPE = 'VFT_DLL'
+elif extension.lower() == '.exe':
+    #BLOCK = '040904B0'   # LANG_ENGLISH/SUBLANG_ENGLISH_US,
+    BLOCK = '040904E4'   # Lang=US English, CharSet=Windows Multilingual
+    TYPE = 'VFT_APP'
+else:
+    sys.stderr.write('Unsupported extension (.EXE or .DLL only): %s\n' % extension)
+    sys.exit(-1)
+
+
+with open(SOURCE, 'r') as source:
+    content = source.read()
+    content = content.replace('${VERSION_MAJOR}', v[0])
+    content = content.replace('${VERSION_MINOR}', v[1])
+    content = content.replace('${VERSION_PATCH}', v[2])
+    content = content.replace('${RELEASE}', RELEASE)
+    content = content.replace('${DESCRIPTION}', DESCRIPTION)
+    content = content.replace('${PRODUCT}', PRODUCT)   
+    content = content.replace('${FILENAME}', FILENAME)   
+    content = content.replace('${YEAR}', str(datetime.datetime.now().year))
+    content = content.replace('${BLOCK}', BLOCK)
+    content = content.replace('${TYPE}', TYPE)
+
+    sys.stdout.write(content)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Orthanc/CMake/WindowsResources.rc	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,30 @@
+#include <winver.h>
+
+VS_VERSION_INFO VERSIONINFO
+   FILEVERSION ${VERSION_MAJOR},${VERSION_MINOR},0,${VERSION_PATCH}
+   PRODUCTVERSION ${VERSION_MAJOR},${VERSION_MINOR},0,0
+   FILEOS VOS_NT_WINDOWS32
+   FILETYPE ${TYPE}
+   BEGIN
+      BLOCK "StringFileInfo"
+      BEGIN
+         BLOCK "${BLOCK}"
+         BEGIN
+            VALUE "Comments", "${RELEASE}"
+            VALUE "CompanyName", "The Orthanc project"
+            VALUE "FileDescription", "${DESCRIPTION}"
+            VALUE "FileVersion", "${VERSION_MAJOR}.${VERSION_MINOR}.0.${VERSION_PATCH}"
+            VALUE "InternalName", "${PRODUCT}"
+            VALUE "LegalCopyright", "(c) 2012-${YEAR}, Sebastien Jodogne, University Hospital of Liege, Osimis S.A., and ICTEAM UCLouvain"
+            VALUE "LegalTrademarks", "Licensing information is available at http://www.orthanc-server.com/"
+            VALUE "OriginalFilename", "${FILENAME}"
+            VALUE "ProductName", "${PRODUCT}"
+            VALUE "ProductVersion", "${VERSION_MAJOR}.${VERSION_MINOR}"
+         END
+      END
+
+      BLOCK "VarFileInfo"
+      BEGIN
+        VALUE "Translation", 0x409, 1252  // U.S. English
+      END
+   END
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Orthanc/Plugins/ExportedSymbolsPlugins.list	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,7 @@
+# This is the list of the symbols that must be exported by Orthanc
+# plugins, if targeting OS X
+
+_OrthancPluginInitialize
+_OrthancPluginFinalize
+_OrthancPluginGetName
+_OrthancPluginGetVersion
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,32 @@
+# Orthanc - A Lightweight, RESTful DICOM Store
+# Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+# Department, University Hospital of Liege, Belgium
+# Copyright (C) 2017-2023 Osimis S.A., Belgium
+# Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+# 
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+# In Orthanc <= 1.7.1, the instructions below were part of
+# "Compiler.cmake", and were protected by the (now unused) option
+# "ENABLE_PLUGINS_VERSION_SCRIPT" in CMake
+
+if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR
+    ${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD" OR
+    ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR
+    ${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${CMAKE_CURRENT_LIST_DIR}/VersionScriptPlugins.map")
+elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+  set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -exported_symbols_list ${CMAKE_CURRENT_LIST_DIR}/ExportedSymbolsPlugins.list")
+endif()
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Orthanc/Plugins/VersionScriptPlugins.map	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,12 @@
+# This is a version-script for Orthanc plugins
+
+{
+global:
+  OrthancPluginInitialize;
+  OrthancPluginFinalize;
+  OrthancPluginGetName;
+  OrthancPluginGetVersion;
+
+local:
+  *;
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Orthanc/Sdk-1.10.0/orthanc/OrthancCPlugin.h	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,8752 @@
+/**
+ * \mainpage
+ *
+ * This C/C++ SDK allows external developers to create plugins that
+ * can be loaded into Orthanc to extend its functionality. Each
+ * Orthanc plugin must expose 4 public functions with the following
+ * signatures:
+ * 
+ * -# <tt>int32_t OrthancPluginInitialize(const OrthancPluginContext* context)</tt>:
+ *    This function is invoked by Orthanc when it loads the plugin on startup.
+ *    The plugin must:
+ *    - Check its compatibility with the Orthanc version using
+ *      ::OrthancPluginCheckVersion().
+ *    - Store the context pointer so that it can use the plugin 
+ *      services of Orthanc.
+ *    - Register all its REST callbacks using ::OrthancPluginRegisterRestCallback().
+ *    - Possibly register its callback for received DICOM instances using ::OrthancPluginRegisterOnStoredInstanceCallback().
+ *    - Possibly register its callback for changes to the DICOM store using ::OrthancPluginRegisterOnChangeCallback().
+ *    - Possibly register a custom storage area using ::OrthancPluginRegisterStorageArea2().
+ *    - Possibly register a custom database back-end area using OrthancPluginRegisterDatabaseBackendV3().
+ *    - Possibly register a handler for C-Find SCP using OrthancPluginRegisterFindCallback().
+ *    - Possibly register a handler for C-Find SCP against DICOM worklists using OrthancPluginRegisterWorklistCallback().
+ *    - Possibly register a handler for C-Move SCP using OrthancPluginRegisterMoveCallback().
+ *    - Possibly register a custom decoder for DICOM images using OrthancPluginRegisterDecodeImageCallback().
+ *    - Possibly register a callback to filter incoming HTTP requests using OrthancPluginRegisterIncomingHttpRequestFilter2().
+ *    - Possibly register a callback to unserialize jobs using OrthancPluginRegisterJobsUnserializer().
+ *    - Possibly register a callback to refresh its metrics using OrthancPluginRegisterRefreshMetricsCallback().
+ *    - Possibly register a callback to answer chunked HTTP transfers using ::OrthancPluginRegisterChunkedRestCallback().
+ *    - Possibly register a callback for Storage Commitment SCP using ::OrthancPluginRegisterStorageCommitmentScpCallback().
+ *    - Possibly register a callback to keep/discard/modify incoming DICOM instances using OrthancPluginRegisterReceivedInstanceCallback().
+ *    - Possibly register a custom transcoder for DICOM images using OrthancPluginRegisterTranscoderCallback().
+ *    - Possibly register a callback to discard instances received through DICOM C-STORE using OrthancPluginRegisterIncomingCStoreInstanceFilter().
+ * -# <tt>void OrthancPluginFinalize()</tt>:
+ *    This function is invoked by Orthanc during its shutdown. The plugin
+ *    must free all its memory.
+ * -# <tt>const char* OrthancPluginGetName()</tt>:
+ *    The plugin must return a short string to identify itself.
+ * -# <tt>const char* OrthancPluginGetVersion()</tt>:
+ *    The plugin must return a string containing its version number.
+ *
+ * The name and the version of a plugin is only used to prevent it
+ * from being loaded twice. Note that, in C++, it is mandatory to
+ * declare these functions within an <tt>extern "C"</tt> section.
+ * 
+ * To ensure multi-threading safety, the various REST callbacks are
+ * guaranteed to be executed in mutual exclusion since Orthanc
+ * 0.8.5. If this feature is undesired (notably when developing
+ * high-performance plugins handling simultaneous requests), use
+ * ::OrthancPluginRegisterRestCallbackNoLock().
+ **/
+
+
+
+/**
+ * @defgroup Images Images and compression
+ * @brief Functions to deal with images and compressed buffers.
+ *
+ * @defgroup REST REST
+ * @brief Functions to answer REST requests in a callback.
+ *
+ * @defgroup Callbacks Callbacks
+ * @brief Functions to register and manage callbacks by the plugins.
+ *
+ * @defgroup DicomCallbacks DicomCallbacks
+ * @brief Functions to register and manage DICOM callbacks (worklists, C-FIND, C-MOVE, storage commitment).
+ *
+ * @defgroup Orthanc Orthanc
+ * @brief Functions to access the content of the Orthanc server.
+ *
+ * @defgroup DicomInstance DicomInstance
+ * @brief Functions to access DICOM images that are managed by the Orthanc core.
+ **/
+
+
+
+/**
+ * @defgroup Toolbox Toolbox
+ * @brief Generic functions to help with the creation of plugins.
+ **/
+
+
+
+/**
+ * Orthanc - A Lightweight, RESTful DICOM Store
+ * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+ * Department, University Hospital of Liege, Belgium
+ * Copyright (C) 2017-2022 Osimis S.A., Belgium
+ * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
+
+#pragma once
+
+
+#include <stdio.h>
+#include <string.h>
+
+#ifdef WIN32
+#  define ORTHANC_PLUGINS_API __declspec(dllexport)
+#elif __GNUC__ >= 4
+#  define ORTHANC_PLUGINS_API __attribute__ ((visibility ("default")))
+#else
+#  define ORTHANC_PLUGINS_API
+#endif
+
+#define ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER     1
+#define ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER     10
+#define ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER  0
+
+
+#if !defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE)
+#define ORTHANC_PLUGINS_VERSION_IS_ABOVE(major, minor, revision)        \
+  (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER > major ||                      \
+   (ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER == major &&                    \
+    (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER > minor ||                    \
+     (ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER == minor &&                  \
+      ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER >= revision))))
+#endif
+
+
+
+/********************************************************************
+ ** Check that function inlining is properly supported. The use of
+ ** inlining is required, to avoid the duplication of object code
+ ** between two compilation modules that would use the Orthanc Plugin
+ ** API.
+ ********************************************************************/
+
+/* If the auto-detection of the "inline" keyword below does not work
+   automatically and that your compiler is known to properly support
+   inlining, uncomment the following #define and adapt the definition
+   of "static inline". */
+
+/* #define ORTHANC_PLUGIN_INLINE static inline */
+
+#ifndef ORTHANC_PLUGIN_INLINE
+#  if __STDC_VERSION__ >= 199901L
+/*   This is C99 or above: http://predef.sourceforge.net/prestd.html */
+#    define ORTHANC_PLUGIN_INLINE static inline
+#  elif defined(__cplusplus)
+/*   This is C++ */
+#    define ORTHANC_PLUGIN_INLINE static inline
+#  elif defined(__GNUC__)
+/*   This is GCC running in C89 mode */
+#    define ORTHANC_PLUGIN_INLINE static __inline
+#  elif defined(_MSC_VER)
+/*   This is Visual Studio running in C89 mode */
+#    define ORTHANC_PLUGIN_INLINE static __inline
+#  else
+#    error Your compiler is not known to support the "inline" keyword
+#  endif
+#endif
+
+
+
+/********************************************************************
+ ** Inclusion of standard libraries.
+ ********************************************************************/
+
+/**
+ * For Microsoft Visual Studio, a compatibility "stdint.h" can be
+ * downloaded at the following URL:
+ * https://hg.orthanc-server.com/orthanc/raw-file/tip/Resources/ThirdParty/VisualStudio/stdint.h
+ **/
+#include <stdint.h>
+
+#include <stdlib.h>
+
+
+
+/********************************************************************
+ ** Definition of the Orthanc Plugin API.
+ ********************************************************************/
+
+/** @{ */
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+  /**
+   * The various error codes that can be returned by the Orthanc core.
+   **/
+  typedef enum
+  {
+    OrthancPluginErrorCode_InternalError = -1    /*!< Internal error */,
+    OrthancPluginErrorCode_Success = 0    /*!< Success */,
+    OrthancPluginErrorCode_Plugin = 1    /*!< Error encountered within the plugin engine */,
+    OrthancPluginErrorCode_NotImplemented = 2    /*!< Not implemented yet */,
+    OrthancPluginErrorCode_ParameterOutOfRange = 3    /*!< Parameter out of range */,
+    OrthancPluginErrorCode_NotEnoughMemory = 4    /*!< The server hosting Orthanc is running out of memory */,
+    OrthancPluginErrorCode_BadParameterType = 5    /*!< Bad type for a parameter */,
+    OrthancPluginErrorCode_BadSequenceOfCalls = 6    /*!< Bad sequence of calls */,
+    OrthancPluginErrorCode_InexistentItem = 7    /*!< Accessing an inexistent item */,
+    OrthancPluginErrorCode_BadRequest = 8    /*!< Bad request */,
+    OrthancPluginErrorCode_NetworkProtocol = 9    /*!< Error in the network protocol */,
+    OrthancPluginErrorCode_SystemCommand = 10    /*!< Error while calling a system command */,
+    OrthancPluginErrorCode_Database = 11    /*!< Error with the database engine */,
+    OrthancPluginErrorCode_UriSyntax = 12    /*!< Badly formatted URI */,
+    OrthancPluginErrorCode_InexistentFile = 13    /*!< Inexistent file */,
+    OrthancPluginErrorCode_CannotWriteFile = 14    /*!< Cannot write to file */,
+    OrthancPluginErrorCode_BadFileFormat = 15    /*!< Bad file format */,
+    OrthancPluginErrorCode_Timeout = 16    /*!< Timeout */,
+    OrthancPluginErrorCode_UnknownResource = 17    /*!< Unknown resource */,
+    OrthancPluginErrorCode_IncompatibleDatabaseVersion = 18    /*!< Incompatible version of the database */,
+    OrthancPluginErrorCode_FullStorage = 19    /*!< The file storage is full */,
+    OrthancPluginErrorCode_CorruptedFile = 20    /*!< Corrupted file (e.g. inconsistent MD5 hash) */,
+    OrthancPluginErrorCode_InexistentTag = 21    /*!< Inexistent tag */,
+    OrthancPluginErrorCode_ReadOnly = 22    /*!< Cannot modify a read-only data structure */,
+    OrthancPluginErrorCode_IncompatibleImageFormat = 23    /*!< Incompatible format of the images */,
+    OrthancPluginErrorCode_IncompatibleImageSize = 24    /*!< Incompatible size of the images */,
+    OrthancPluginErrorCode_SharedLibrary = 25    /*!< Error while using a shared library (plugin) */,
+    OrthancPluginErrorCode_UnknownPluginService = 26    /*!< Plugin invoking an unknown service */,
+    OrthancPluginErrorCode_UnknownDicomTag = 27    /*!< Unknown DICOM tag */,
+    OrthancPluginErrorCode_BadJson = 28    /*!< Cannot parse a JSON document */,
+    OrthancPluginErrorCode_Unauthorized = 29    /*!< Bad credentials were provided to an HTTP request */,
+    OrthancPluginErrorCode_BadFont = 30    /*!< Badly formatted font file */,
+    OrthancPluginErrorCode_DatabasePlugin = 31    /*!< The plugin implementing a custom database back-end does not fulfill the proper interface */,
+    OrthancPluginErrorCode_StorageAreaPlugin = 32    /*!< Error in the plugin implementing a custom storage area */,
+    OrthancPluginErrorCode_EmptyRequest = 33    /*!< The request is empty */,
+    OrthancPluginErrorCode_NotAcceptable = 34    /*!< Cannot send a response which is acceptable according to the Accept HTTP header */,
+    OrthancPluginErrorCode_NullPointer = 35    /*!< Cannot handle a NULL pointer */,
+    OrthancPluginErrorCode_DatabaseUnavailable = 36    /*!< The database is currently not available (probably a transient situation) */,
+    OrthancPluginErrorCode_CanceledJob = 37    /*!< This job was canceled */,
+    OrthancPluginErrorCode_BadGeometry = 38    /*!< Geometry error encountered in Stone */,
+    OrthancPluginErrorCode_SslInitialization = 39    /*!< Cannot initialize SSL encryption, check out your certificates */,
+    OrthancPluginErrorCode_DiscontinuedAbi = 40    /*!< Calling a function that has been removed from the Orthanc Framework */,
+    OrthancPluginErrorCode_BadRange = 41    /*!< Incorrect range request */,
+    OrthancPluginErrorCode_DatabaseCannotSerialize = 42    /*!< Database could not serialize access due to concurrent update, the transaction should be retried */,
+    OrthancPluginErrorCode_Revision = 43    /*!< A bad revision number was provided, which might indicate conflict between multiple writers */,
+    OrthancPluginErrorCode_SQLiteNotOpened = 1000    /*!< SQLite: The database is not opened */,
+    OrthancPluginErrorCode_SQLiteAlreadyOpened = 1001    /*!< SQLite: Connection is already open */,
+    OrthancPluginErrorCode_SQLiteCannotOpen = 1002    /*!< SQLite: Unable to open the database */,
+    OrthancPluginErrorCode_SQLiteStatementAlreadyUsed = 1003    /*!< SQLite: This cached statement is already being referred to */,
+    OrthancPluginErrorCode_SQLiteExecute = 1004    /*!< SQLite: Cannot execute a command */,
+    OrthancPluginErrorCode_SQLiteRollbackWithoutTransaction = 1005    /*!< SQLite: Rolling back a nonexistent transaction (have you called Begin()?) */,
+    OrthancPluginErrorCode_SQLiteCommitWithoutTransaction = 1006    /*!< SQLite: Committing a nonexistent transaction */,
+    OrthancPluginErrorCode_SQLiteRegisterFunction = 1007    /*!< SQLite: Unable to register a function */,
+    OrthancPluginErrorCode_SQLiteFlush = 1008    /*!< SQLite: Unable to flush the database */,
+    OrthancPluginErrorCode_SQLiteCannotRun = 1009    /*!< SQLite: Cannot run a cached statement */,
+    OrthancPluginErrorCode_SQLiteCannotStep = 1010    /*!< SQLite: Cannot step over a cached statement */,
+    OrthancPluginErrorCode_SQLiteBindOutOfRange = 1011    /*!< SQLite: Bing a value while out of range (serious error) */,
+    OrthancPluginErrorCode_SQLitePrepareStatement = 1012    /*!< SQLite: Cannot prepare a cached statement */,
+    OrthancPluginErrorCode_SQLiteTransactionAlreadyStarted = 1013    /*!< SQLite: Beginning the same transaction twice */,
+    OrthancPluginErrorCode_SQLiteTransactionCommit = 1014    /*!< SQLite: Failure when committing the transaction */,
+    OrthancPluginErrorCode_SQLiteTransactionBegin = 1015    /*!< SQLite: Cannot start a transaction */,
+    OrthancPluginErrorCode_DirectoryOverFile = 2000    /*!< The directory to be created is already occupied by a regular file */,
+    OrthancPluginErrorCode_FileStorageCannotWrite = 2001    /*!< Unable to create a subdirectory or a file in the file storage */,
+    OrthancPluginErrorCode_DirectoryExpected = 2002    /*!< The specified path does not point to a directory */,
+    OrthancPluginErrorCode_HttpPortInUse = 2003    /*!< The TCP port of the HTTP server is privileged or already in use */,
+    OrthancPluginErrorCode_DicomPortInUse = 2004    /*!< The TCP port of the DICOM server is privileged or already in use */,
+    OrthancPluginErrorCode_BadHttpStatusInRest = 2005    /*!< This HTTP status is not allowed in a REST API */,
+    OrthancPluginErrorCode_RegularFileExpected = 2006    /*!< The specified path does not point to a regular file */,
+    OrthancPluginErrorCode_PathToExecutable = 2007    /*!< Unable to get the path to the executable */,
+    OrthancPluginErrorCode_MakeDirectory = 2008    /*!< Cannot create a directory */,
+    OrthancPluginErrorCode_BadApplicationEntityTitle = 2009    /*!< An application entity title (AET) cannot be empty or be longer than 16 characters */,
+    OrthancPluginErrorCode_NoCFindHandler = 2010    /*!< No request handler factory for DICOM C-FIND SCP */,
+    OrthancPluginErrorCode_NoCMoveHandler = 2011    /*!< No request handler factory for DICOM C-MOVE SCP */,
+    OrthancPluginErrorCode_NoCStoreHandler = 2012    /*!< No request handler factory for DICOM C-STORE SCP */,
+    OrthancPluginErrorCode_NoApplicationEntityFilter = 2013    /*!< No application entity filter */,
+    OrthancPluginErrorCode_NoSopClassOrInstance = 2014    /*!< DicomUserConnection: Unable to find the SOP class and instance */,
+    OrthancPluginErrorCode_NoPresentationContext = 2015    /*!< DicomUserConnection: No acceptable presentation context for modality */,
+    OrthancPluginErrorCode_DicomFindUnavailable = 2016    /*!< DicomUserConnection: The C-FIND command is not supported by the remote SCP */,
+    OrthancPluginErrorCode_DicomMoveUnavailable = 2017    /*!< DicomUserConnection: The C-MOVE command is not supported by the remote SCP */,
+    OrthancPluginErrorCode_CannotStoreInstance = 2018    /*!< Cannot store an instance */,
+    OrthancPluginErrorCode_CreateDicomNotString = 2019    /*!< Only string values are supported when creating DICOM instances */,
+    OrthancPluginErrorCode_CreateDicomOverrideTag = 2020    /*!< Trying to override a value inherited from a parent module */,
+    OrthancPluginErrorCode_CreateDicomUseContent = 2021    /*!< Use \"Content\" to inject an image into a new DICOM instance */,
+    OrthancPluginErrorCode_CreateDicomNoPayload = 2022    /*!< No payload is present for one instance in the series */,
+    OrthancPluginErrorCode_CreateDicomUseDataUriScheme = 2023    /*!< The payload of the DICOM instance must be specified according to Data URI scheme */,
+    OrthancPluginErrorCode_CreateDicomBadParent = 2024    /*!< Trying to attach a new DICOM instance to an inexistent resource */,
+    OrthancPluginErrorCode_CreateDicomParentIsInstance = 2025    /*!< Trying to attach a new DICOM instance to an instance (must be a series, study or patient) */,
+    OrthancPluginErrorCode_CreateDicomParentEncoding = 2026    /*!< Unable to get the encoding of the parent resource */,
+    OrthancPluginErrorCode_UnknownModality = 2027    /*!< Unknown modality */,
+    OrthancPluginErrorCode_BadJobOrdering = 2028    /*!< Bad ordering of filters in a job */,
+    OrthancPluginErrorCode_JsonToLuaTable = 2029    /*!< Cannot convert the given JSON object to a Lua table */,
+    OrthancPluginErrorCode_CannotCreateLua = 2030    /*!< Cannot create the Lua context */,
+    OrthancPluginErrorCode_CannotExecuteLua = 2031    /*!< Cannot execute a Lua command */,
+    OrthancPluginErrorCode_LuaAlreadyExecuted = 2032    /*!< Arguments cannot be pushed after the Lua function is executed */,
+    OrthancPluginErrorCode_LuaBadOutput = 2033    /*!< The Lua function does not give the expected number of outputs */,
+    OrthancPluginErrorCode_NotLuaPredicate = 2034    /*!< The Lua function is not a predicate (only true/false outputs allowed) */,
+    OrthancPluginErrorCode_LuaReturnsNoString = 2035    /*!< The Lua function does not return a string */,
+    OrthancPluginErrorCode_StorageAreaAlreadyRegistered = 2036    /*!< Another plugin has already registered a custom storage area */,
+    OrthancPluginErrorCode_DatabaseBackendAlreadyRegistered = 2037    /*!< Another plugin has already registered a custom database back-end */,
+    OrthancPluginErrorCode_DatabaseNotInitialized = 2038    /*!< Plugin trying to call the database during its initialization */,
+    OrthancPluginErrorCode_SslDisabled = 2039    /*!< Orthanc has been built without SSL support */,
+    OrthancPluginErrorCode_CannotOrderSlices = 2040    /*!< Unable to order the slices of the series */,
+    OrthancPluginErrorCode_NoWorklistHandler = 2041    /*!< No request handler factory for DICOM C-Find Modality SCP */,
+    OrthancPluginErrorCode_AlreadyExistingTag = 2042    /*!< Cannot override the value of a tag that already exists */,
+    OrthancPluginErrorCode_NoStorageCommitmentHandler = 2043    /*!< No request handler factory for DICOM N-ACTION SCP (storage commitment) */,
+    OrthancPluginErrorCode_NoCGetHandler = 2044    /*!< No request handler factory for DICOM C-GET SCP */,
+    OrthancPluginErrorCode_UnsupportedMediaType = 3000    /*!< Unsupported media type */,
+
+    _OrthancPluginErrorCode_INTERNAL = 0x7fffffff
+  } OrthancPluginErrorCode;
+
+
+  /**
+   * Forward declaration of one of the mandatory functions for Orthanc
+   * plugins.
+   **/
+  ORTHANC_PLUGINS_API const char* OrthancPluginGetName();
+
+
+  /**
+   * The various HTTP methods for a REST call.
+   **/
+  typedef enum
+  {
+    OrthancPluginHttpMethod_Get = 1,    /*!< GET request */
+    OrthancPluginHttpMethod_Post = 2,   /*!< POST request */
+    OrthancPluginHttpMethod_Put = 3,    /*!< PUT request */
+    OrthancPluginHttpMethod_Delete = 4, /*!< DELETE request */
+
+    _OrthancPluginHttpMethod_INTERNAL = 0x7fffffff
+  } OrthancPluginHttpMethod;
+
+
+  /**
+   * @brief The parameters of a REST request.
+   * @ingroup Callbacks
+   **/
+  typedef struct
+  {
+    /**
+     * @brief The HTTP method.
+     **/
+    OrthancPluginHttpMethod method;
+
+    /**
+     * @brief The number of groups of the regular expression.
+     **/
+    uint32_t                groupsCount;
+
+    /**
+     * @brief The matched values for the groups of the regular expression.
+     **/
+    const char* const*      groups;
+
+    /**
+     * @brief For a GET request, the number of GET parameters.
+     **/
+    uint32_t                getCount;
+
+    /**
+     * @brief For a GET request, the keys of the GET parameters.
+     **/
+    const char* const*      getKeys;
+
+    /**
+     * @brief For a GET request, the values of the GET parameters.
+     **/
+    const char* const*      getValues;
+
+    /**
+     * @brief For a PUT or POST request, the content of the body.
+     **/
+    const void*             body;
+
+    /**
+     * @brief For a PUT or POST request, the number of bytes of the body.
+     **/
+    uint32_t                bodySize;
+
+
+    /* --------------------------------------------------
+       New in version 0.8.1
+       -------------------------------------------------- */
+
+    /**
+     * @brief The number of HTTP headers.
+     **/
+    uint32_t                headersCount;
+
+    /**
+     * @brief The keys of the HTTP headers (always converted to low-case).
+     **/
+    const char* const*      headersKeys;
+
+    /**
+     * @brief The values of the HTTP headers.
+     **/
+    const char* const*      headersValues;
+
+  } OrthancPluginHttpRequest;
+
+
+  typedef enum 
+  {
+    /* Generic services */
+    _OrthancPluginService_LogInfo = 1,
+    _OrthancPluginService_LogWarning = 2,
+    _OrthancPluginService_LogError = 3,
+    _OrthancPluginService_GetOrthancPath = 4,
+    _OrthancPluginService_GetOrthancDirectory = 5,
+    _OrthancPluginService_GetConfigurationPath = 6,
+    _OrthancPluginService_SetPluginProperty = 7,
+    _OrthancPluginService_GetGlobalProperty = 8,
+    _OrthancPluginService_SetGlobalProperty = 9,
+    _OrthancPluginService_GetCommandLineArgumentsCount = 10,
+    _OrthancPluginService_GetCommandLineArgument = 11,
+    _OrthancPluginService_GetExpectedDatabaseVersion = 12,
+    _OrthancPluginService_GetConfiguration = 13,
+    _OrthancPluginService_BufferCompression = 14,
+    _OrthancPluginService_ReadFile = 15,
+    _OrthancPluginService_WriteFile = 16,
+    _OrthancPluginService_GetErrorDescription = 17,
+    _OrthancPluginService_CallHttpClient = 18,
+    _OrthancPluginService_RegisterErrorCode = 19,
+    _OrthancPluginService_RegisterDictionaryTag = 20,
+    _OrthancPluginService_DicomBufferToJson = 21,
+    _OrthancPluginService_DicomInstanceToJson = 22,
+    _OrthancPluginService_CreateDicom = 23,
+    _OrthancPluginService_ComputeMd5 = 24,
+    _OrthancPluginService_ComputeSha1 = 25,
+    _OrthancPluginService_LookupDictionary = 26,
+    _OrthancPluginService_CallHttpClient2 = 27,
+    _OrthancPluginService_GenerateUuid = 28,
+    _OrthancPluginService_RegisterPrivateDictionaryTag = 29,
+    _OrthancPluginService_AutodetectMimeType = 30,
+    _OrthancPluginService_SetMetricsValue = 31,
+    _OrthancPluginService_EncodeDicomWebJson = 32,
+    _OrthancPluginService_EncodeDicomWebXml = 33,
+    _OrthancPluginService_ChunkedHttpClient = 34,    /* New in Orthanc 1.5.7 */
+    _OrthancPluginService_GetTagName = 35,           /* New in Orthanc 1.5.7 */
+    _OrthancPluginService_EncodeDicomWebJson2 = 36,  /* New in Orthanc 1.7.0 */
+    _OrthancPluginService_EncodeDicomWebXml2 = 37,   /* New in Orthanc 1.7.0 */
+    _OrthancPluginService_CreateMemoryBuffer = 38,   /* New in Orthanc 1.7.0 */
+    _OrthancPluginService_GenerateRestApiAuthorizationToken = 39,   /* New in Orthanc 1.8.1 */
+    _OrthancPluginService_CreateMemoryBuffer64 = 40, /* New in Orthanc 1.9.0 */
+    _OrthancPluginService_CreateDicom2 = 41,         /* New in Orthanc 1.9.0 */
+    
+    /* Registration of callbacks */
+    _OrthancPluginService_RegisterRestCallback = 1000,
+    _OrthancPluginService_RegisterOnStoredInstanceCallback = 1001,
+    _OrthancPluginService_RegisterStorageArea = 1002,
+    _OrthancPluginService_RegisterOnChangeCallback = 1003,
+    _OrthancPluginService_RegisterRestCallbackNoLock = 1004,
+    _OrthancPluginService_RegisterWorklistCallback = 1005,
+    _OrthancPluginService_RegisterDecodeImageCallback = 1006,
+    _OrthancPluginService_RegisterIncomingHttpRequestFilter = 1007,
+    _OrthancPluginService_RegisterFindCallback = 1008,
+    _OrthancPluginService_RegisterMoveCallback = 1009,
+    _OrthancPluginService_RegisterIncomingHttpRequestFilter2 = 1010,
+    _OrthancPluginService_RegisterRefreshMetricsCallback = 1011,
+    _OrthancPluginService_RegisterChunkedRestCallback = 1012,  /* New in Orthanc 1.5.7 */
+    _OrthancPluginService_RegisterStorageCommitmentScpCallback = 1013,
+    _OrthancPluginService_RegisterIncomingDicomInstanceFilter = 1014,
+    _OrthancPluginService_RegisterTranscoderCallback = 1015,   /* New in Orthanc 1.7.0 */
+    _OrthancPluginService_RegisterStorageArea2 = 1016,         /* New in Orthanc 1.9.0 */
+    _OrthancPluginService_RegisterIncomingCStoreInstanceFilter = 1017,  /* New in Orthanc 1.10.0 */
+    _OrthancPluginService_RegisterReceivedInstanceCallback = 1018,  /* New in Orthanc 1.10.0 */
+
+    /* Sending answers to REST calls */
+    _OrthancPluginService_AnswerBuffer = 2000,
+    _OrthancPluginService_CompressAndAnswerPngImage = 2001,  /* Unused as of Orthanc 0.9.4 */
+    _OrthancPluginService_Redirect = 2002,
+    _OrthancPluginService_SendHttpStatusCode = 2003,
+    _OrthancPluginService_SendUnauthorized = 2004,
+    _OrthancPluginService_SendMethodNotAllowed = 2005,
+    _OrthancPluginService_SetCookie = 2006,
+    _OrthancPluginService_SetHttpHeader = 2007,
+    _OrthancPluginService_StartMultipartAnswer = 2008,
+    _OrthancPluginService_SendMultipartItem = 2009,
+    _OrthancPluginService_SendHttpStatus = 2010,
+    _OrthancPluginService_CompressAndAnswerImage = 2011,
+    _OrthancPluginService_SendMultipartItem2 = 2012,
+    _OrthancPluginService_SetHttpErrorDetails = 2013,
+
+    /* Access to the Orthanc database and API */
+    _OrthancPluginService_GetDicomForInstance = 3000,
+    _OrthancPluginService_RestApiGet = 3001,
+    _OrthancPluginService_RestApiPost = 3002,
+    _OrthancPluginService_RestApiDelete = 3003,
+    _OrthancPluginService_RestApiPut = 3004,
+    _OrthancPluginService_LookupPatient = 3005,
+    _OrthancPluginService_LookupStudy = 3006,
+    _OrthancPluginService_LookupSeries = 3007,
+    _OrthancPluginService_LookupInstance = 3008,
+    _OrthancPluginService_LookupStudyWithAccessionNumber = 3009,
+    _OrthancPluginService_RestApiGetAfterPlugins = 3010,
+    _OrthancPluginService_RestApiPostAfterPlugins = 3011,
+    _OrthancPluginService_RestApiDeleteAfterPlugins = 3012,
+    _OrthancPluginService_RestApiPutAfterPlugins = 3013,
+    _OrthancPluginService_ReconstructMainDicomTags = 3014,
+    _OrthancPluginService_RestApiGet2 = 3015,
+    _OrthancPluginService_CallRestApi = 3016,              /* New in Orthanc 1.9.2 */
+
+    /* Access to DICOM instances */
+    _OrthancPluginService_GetInstanceRemoteAet = 4000,
+    _OrthancPluginService_GetInstanceSize = 4001,
+    _OrthancPluginService_GetInstanceData = 4002,
+    _OrthancPluginService_GetInstanceJson = 4003,
+    _OrthancPluginService_GetInstanceSimplifiedJson = 4004,
+    _OrthancPluginService_HasInstanceMetadata = 4005,
+    _OrthancPluginService_GetInstanceMetadata = 4006,
+    _OrthancPluginService_GetInstanceOrigin = 4007,
+    _OrthancPluginService_GetInstanceTransferSyntaxUid = 4008,
+    _OrthancPluginService_HasInstancePixelData = 4009,
+    _OrthancPluginService_CreateDicomInstance = 4010,      /* New in Orthanc 1.7.0 */
+    _OrthancPluginService_FreeDicomInstance = 4011,        /* New in Orthanc 1.7.0 */
+    _OrthancPluginService_GetInstanceFramesCount = 4012,   /* New in Orthanc 1.7.0 */
+    _OrthancPluginService_GetInstanceRawFrame = 4013,      /* New in Orthanc 1.7.0 */
+    _OrthancPluginService_GetInstanceDecodedFrame = 4014,  /* New in Orthanc 1.7.0 */
+    _OrthancPluginService_TranscodeDicomInstance = 4015,   /* New in Orthanc 1.7.0 */
+    _OrthancPluginService_SerializeDicomInstance = 4016,   /* New in Orthanc 1.7.0 */
+    _OrthancPluginService_GetInstanceAdvancedJson = 4017,  /* New in Orthanc 1.7.0 */
+    _OrthancPluginService_GetInstanceDicomWebJson = 4018,  /* New in Orthanc 1.7.0 */
+    _OrthancPluginService_GetInstanceDicomWebXml = 4019,   /* New in Orthanc 1.7.0 */
+    
+    /* Services for plugins implementing a database back-end */
+    _OrthancPluginService_RegisterDatabaseBackend = 5000,    /* New in Orthanc 0.8.6 */
+    _OrthancPluginService_DatabaseAnswer = 5001,
+    _OrthancPluginService_RegisterDatabaseBackendV2 = 5002,  /* New in Orthanc 0.9.4 */
+    _OrthancPluginService_StorageAreaCreate = 5003,
+    _OrthancPluginService_StorageAreaRead = 5004,
+    _OrthancPluginService_StorageAreaRemove = 5005,
+    _OrthancPluginService_RegisterDatabaseBackendV3 = 5006,  /* New in Orthanc 1.9.2 */
+
+    /* Primitives for handling images */
+    _OrthancPluginService_GetImagePixelFormat = 6000,
+    _OrthancPluginService_GetImageWidth = 6001,
+    _OrthancPluginService_GetImageHeight = 6002,
+    _OrthancPluginService_GetImagePitch = 6003,
+    _OrthancPluginService_GetImageBuffer = 6004,
+    _OrthancPluginService_UncompressImage = 6005,
+    _OrthancPluginService_FreeImage = 6006,
+    _OrthancPluginService_CompressImage = 6007,
+    _OrthancPluginService_ConvertPixelFormat = 6008,
+    _OrthancPluginService_GetFontsCount = 6009,
+    _OrthancPluginService_GetFontInfo = 6010,
+    _OrthancPluginService_DrawText = 6011,
+    _OrthancPluginService_CreateImage = 6012,
+    _OrthancPluginService_CreateImageAccessor = 6013,
+    _OrthancPluginService_DecodeDicomImage = 6014,
+
+    /* Primitives for handling C-Find, C-Move and worklists */
+    _OrthancPluginService_WorklistAddAnswer = 7000,
+    _OrthancPluginService_WorklistMarkIncomplete = 7001,
+    _OrthancPluginService_WorklistIsMatch = 7002,
+    _OrthancPluginService_WorklistGetDicomQuery = 7003,
+    _OrthancPluginService_FindAddAnswer = 7004,
+    _OrthancPluginService_FindMarkIncomplete = 7005,
+    _OrthancPluginService_GetFindQuerySize = 7006,
+    _OrthancPluginService_GetFindQueryTag = 7007,
+    _OrthancPluginService_GetFindQueryTagName = 7008,
+    _OrthancPluginService_GetFindQueryValue = 7009,
+    _OrthancPluginService_CreateFindMatcher = 7010,
+    _OrthancPluginService_FreeFindMatcher = 7011,
+    _OrthancPluginService_FindMatcherIsMatch = 7012,
+
+    /* Primitives for accessing Orthanc Peers (new in 1.4.2) */
+    _OrthancPluginService_GetPeers = 8000,
+    _OrthancPluginService_FreePeers = 8001,
+    _OrthancPluginService_GetPeersCount = 8003,
+    _OrthancPluginService_GetPeerName = 8004,
+    _OrthancPluginService_GetPeerUrl = 8005,
+    _OrthancPluginService_CallPeerApi = 8006,
+    _OrthancPluginService_GetPeerUserProperty = 8007,
+
+    /* Primitives for handling jobs (new in 1.4.2) */
+    _OrthancPluginService_CreateJob = 9000,
+    _OrthancPluginService_FreeJob = 9001,
+    _OrthancPluginService_SubmitJob = 9002,
+    _OrthancPluginService_RegisterJobsUnserializer = 9003,
+    
+    _OrthancPluginService_INTERNAL = 0x7fffffff
+  } _OrthancPluginService;
+
+
+  typedef enum
+  {
+    _OrthancPluginProperty_Description = 1,
+    _OrthancPluginProperty_RootUri = 2,
+    _OrthancPluginProperty_OrthancExplorer = 3,
+
+    _OrthancPluginProperty_INTERNAL = 0x7fffffff
+  } _OrthancPluginProperty;
+
+
+
+  /**
+   * The memory layout of the pixels of an image.
+   * @ingroup Images
+   **/
+  typedef enum
+  {
+    /**
+     * @brief Graylevel 8bpp image.
+     *
+     * The image is graylevel. Each pixel is unsigned and stored in
+     * one byte.
+     **/
+    OrthancPluginPixelFormat_Grayscale8 = 1,
+
+    /**
+     * @brief Graylevel, unsigned 16bpp image.
+     *
+     * The image is graylevel. Each pixel is unsigned and stored in
+     * two bytes.
+     **/
+    OrthancPluginPixelFormat_Grayscale16 = 2,
+
+    /**
+     * @brief Graylevel, signed 16bpp image.
+     *
+     * The image is graylevel. Each pixel is signed and stored in two
+     * bytes.
+     **/
+    OrthancPluginPixelFormat_SignedGrayscale16 = 3,
+
+    /**
+     * @brief Color image in RGB24 format.
+     *
+     * This format describes a color image. The pixels are stored in 3
+     * consecutive bytes. The memory layout is RGB.
+     **/
+    OrthancPluginPixelFormat_RGB24 = 4,
+
+    /**
+     * @brief Color image in RGBA32 format.
+     *
+     * This format describes a color image. The pixels are stored in 4
+     * consecutive bytes. The memory layout is RGBA.
+     **/
+    OrthancPluginPixelFormat_RGBA32 = 5,
+
+    OrthancPluginPixelFormat_Unknown = 6,   /*!< Unknown pixel format */
+
+    /**
+     * @brief Color image in RGB48 format.
+     *
+     * This format describes a color image. The pixels are stored in 6
+     * consecutive bytes. The memory layout is RRGGBB.
+     **/
+    OrthancPluginPixelFormat_RGB48 = 7,
+
+    /**
+     * @brief Graylevel, unsigned 32bpp image.
+     *
+     * The image is graylevel. Each pixel is unsigned and stored in
+     * four bytes.
+     **/
+    OrthancPluginPixelFormat_Grayscale32 = 8,
+
+    /**
+     * @brief Graylevel, floating-point 32bpp image.
+     *
+     * The image is graylevel. Each pixel is floating-point and stored
+     * in four bytes.
+     **/
+    OrthancPluginPixelFormat_Float32 = 9,
+
+    /**
+     * @brief Color image in BGRA32 format.
+     *
+     * This format describes a color image. The pixels are stored in 4
+     * consecutive bytes. The memory layout is BGRA.
+     **/
+    OrthancPluginPixelFormat_BGRA32 = 10,
+
+    /**
+     * @brief Graylevel, unsigned 64bpp image.
+     *
+     * The image is graylevel. Each pixel is unsigned and stored in
+     * eight bytes.
+     **/
+    OrthancPluginPixelFormat_Grayscale64 = 11,
+
+    _OrthancPluginPixelFormat_INTERNAL = 0x7fffffff
+  } OrthancPluginPixelFormat;
+
+
+
+  /**
+   * The content types that are supported by Orthanc plugins.
+   **/
+  typedef enum
+  {
+    OrthancPluginContentType_Unknown = 0,             /*!< Unknown content type */
+    OrthancPluginContentType_Dicom = 1,               /*!< DICOM */
+    OrthancPluginContentType_DicomAsJson = 2,         /*!< JSON summary of a DICOM file */
+    OrthancPluginContentType_DicomUntilPixelData = 3, /*!< DICOM Header till pixel data */
+
+    _OrthancPluginContentType_INTERNAL = 0x7fffffff
+  } OrthancPluginContentType;
+
+
+
+  /**
+   * The supported types of DICOM resources.
+   **/
+  typedef enum
+  {
+    OrthancPluginResourceType_Patient = 0,     /*!< Patient */
+    OrthancPluginResourceType_Study = 1,       /*!< Study */
+    OrthancPluginResourceType_Series = 2,      /*!< Series */
+    OrthancPluginResourceType_Instance = 3,    /*!< Instance */
+    OrthancPluginResourceType_None = 4,        /*!< Unavailable resource type */
+
+    _OrthancPluginResourceType_INTERNAL = 0x7fffffff
+  } OrthancPluginResourceType;
+
+
+
+  /**
+   * The supported types of changes that can be signaled to the change callback.
+   * @ingroup Callbacks
+   **/
+  typedef enum
+  {
+    OrthancPluginChangeType_CompletedSeries = 0,    /*!< Series is now complete */
+    OrthancPluginChangeType_Deleted = 1,            /*!< Deleted resource */
+    OrthancPluginChangeType_NewChildInstance = 2,   /*!< A new instance was added to this resource */
+    OrthancPluginChangeType_NewInstance = 3,        /*!< New instance received */
+    OrthancPluginChangeType_NewPatient = 4,         /*!< New patient created */
+    OrthancPluginChangeType_NewSeries = 5,          /*!< New series created */
+    OrthancPluginChangeType_NewStudy = 6,           /*!< New study created */
+    OrthancPluginChangeType_StablePatient = 7,      /*!< Timeout: No new instance in this patient */
+    OrthancPluginChangeType_StableSeries = 8,       /*!< Timeout: No new instance in this series */
+    OrthancPluginChangeType_StableStudy = 9,        /*!< Timeout: No new instance in this study */
+    OrthancPluginChangeType_OrthancStarted = 10,    /*!< Orthanc has started */
+    OrthancPluginChangeType_OrthancStopped = 11,    /*!< Orthanc is stopping */
+    OrthancPluginChangeType_UpdatedAttachment = 12, /*!< Some user-defined attachment has changed for this resource */
+    OrthancPluginChangeType_UpdatedMetadata = 13,   /*!< Some user-defined metadata has changed for this resource */
+    OrthancPluginChangeType_UpdatedPeers = 14,      /*!< The list of Orthanc peers has changed */
+    OrthancPluginChangeType_UpdatedModalities = 15, /*!< The list of DICOM modalities has changed */
+    OrthancPluginChangeType_JobSubmitted = 16,      /*!< New Job submitted */
+    OrthancPluginChangeType_JobSuccess = 17,        /*!< A Job has completed successfully */
+    OrthancPluginChangeType_JobFailure = 18,        /*!< A Job has failed */
+
+    _OrthancPluginChangeType_INTERNAL = 0x7fffffff
+  } OrthancPluginChangeType;
+
+
+  /**
+   * The compression algorithms that are supported by the Orthanc core.
+   * @ingroup Images
+   **/
+  typedef enum
+  {
+    OrthancPluginCompressionType_Zlib = 0,          /*!< Standard zlib compression */
+    OrthancPluginCompressionType_ZlibWithSize = 1,  /*!< zlib, prefixed with uncompressed size (uint64_t) */
+    OrthancPluginCompressionType_Gzip = 2,          /*!< Standard gzip compression */
+    OrthancPluginCompressionType_GzipWithSize = 3,  /*!< gzip, prefixed with uncompressed size (uint64_t) */
+
+    _OrthancPluginCompressionType_INTERNAL = 0x7fffffff
+  } OrthancPluginCompressionType;
+
+
+  /**
+   * The image formats that are supported by the Orthanc core.
+   * @ingroup Images
+   **/
+  typedef enum
+  {
+    OrthancPluginImageFormat_Png = 0,    /*!< Image compressed using PNG */
+    OrthancPluginImageFormat_Jpeg = 1,   /*!< Image compressed using JPEG */
+    OrthancPluginImageFormat_Dicom = 2,  /*!< Image compressed using DICOM */
+
+    _OrthancPluginImageFormat_INTERNAL = 0x7fffffff
+  } OrthancPluginImageFormat;
+
+
+  /**
+   * The value representations present in the DICOM standard (version 2013).
+   * @ingroup Toolbox
+   **/
+  typedef enum
+  {
+    OrthancPluginValueRepresentation_AE = 1,   /*!< Application Entity */
+    OrthancPluginValueRepresentation_AS = 2,   /*!< Age String */
+    OrthancPluginValueRepresentation_AT = 3,   /*!< Attribute Tag */
+    OrthancPluginValueRepresentation_CS = 4,   /*!< Code String */
+    OrthancPluginValueRepresentation_DA = 5,   /*!< Date */
+    OrthancPluginValueRepresentation_DS = 6,   /*!< Decimal String */
+    OrthancPluginValueRepresentation_DT = 7,   /*!< Date Time */
+    OrthancPluginValueRepresentation_FD = 8,   /*!< Floating Point Double */
+    OrthancPluginValueRepresentation_FL = 9,   /*!< Floating Point Single */
+    OrthancPluginValueRepresentation_IS = 10,  /*!< Integer String */
+    OrthancPluginValueRepresentation_LO = 11,  /*!< Long String */
+    OrthancPluginValueRepresentation_LT = 12,  /*!< Long Text */
+    OrthancPluginValueRepresentation_OB = 13,  /*!< Other Byte String */
+    OrthancPluginValueRepresentation_OF = 14,  /*!< Other Float String */
+    OrthancPluginValueRepresentation_OW = 15,  /*!< Other Word String */
+    OrthancPluginValueRepresentation_PN = 16,  /*!< Person Name */
+    OrthancPluginValueRepresentation_SH = 17,  /*!< Short String */
+    OrthancPluginValueRepresentation_SL = 18,  /*!< Signed Long */
+    OrthancPluginValueRepresentation_SQ = 19,  /*!< Sequence of Items */
+    OrthancPluginValueRepresentation_SS = 20,  /*!< Signed Short */
+    OrthancPluginValueRepresentation_ST = 21,  /*!< Short Text */
+    OrthancPluginValueRepresentation_TM = 22,  /*!< Time */
+    OrthancPluginValueRepresentation_UI = 23,  /*!< Unique Identifier (UID) */
+    OrthancPluginValueRepresentation_UL = 24,  /*!< Unsigned Long */
+    OrthancPluginValueRepresentation_UN = 25,  /*!< Unknown */
+    OrthancPluginValueRepresentation_US = 26,  /*!< Unsigned Short */
+    OrthancPluginValueRepresentation_UT = 27,  /*!< Unlimited Text */
+
+    _OrthancPluginValueRepresentation_INTERNAL = 0x7fffffff
+  } OrthancPluginValueRepresentation;
+
+
+  /**
+   * The possible output formats for a DICOM-to-JSON conversion.
+   * @ingroup Toolbox
+   * @see OrthancPluginDicomToJson()
+   **/
+  typedef enum
+  {
+    OrthancPluginDicomToJsonFormat_Full = 1,    /*!< Full output, with most details */
+    OrthancPluginDicomToJsonFormat_Short = 2,   /*!< Tags output as hexadecimal numbers */
+    OrthancPluginDicomToJsonFormat_Human = 3,   /*!< Human-readable JSON */
+
+    _OrthancPluginDicomToJsonFormat_INTERNAL = 0x7fffffff
+  } OrthancPluginDicomToJsonFormat;
+
+
+  /**
+   * Flags to customize a DICOM-to-JSON conversion. By default, binary
+   * tags are formatted using Data URI scheme.
+   * @ingroup Toolbox
+   **/
+  typedef enum
+  {
+    OrthancPluginDicomToJsonFlags_None                  = 0,         /*!< Default formatting */
+    OrthancPluginDicomToJsonFlags_IncludeBinary         = (1 << 0),  /*!< Include the binary tags */
+    OrthancPluginDicomToJsonFlags_IncludePrivateTags    = (1 << 1),  /*!< Include the private tags */
+    OrthancPluginDicomToJsonFlags_IncludeUnknownTags    = (1 << 2),  /*!< Include the tags unknown by the dictionary */
+    OrthancPluginDicomToJsonFlags_IncludePixelData      = (1 << 3),  /*!< Include the pixel data */
+    OrthancPluginDicomToJsonFlags_ConvertBinaryToAscii  = (1 << 4),  /*!< Output binary tags as-is, dropping non-ASCII */
+    OrthancPluginDicomToJsonFlags_ConvertBinaryToNull   = (1 << 5),  /*!< Signal binary tags as null values */
+    OrthancPluginDicomToJsonFlags_StopAfterPixelData    = (1 << 6),  /*!< Stop processing after pixel data (new in 1.9.1) */
+    OrthancPluginDicomToJsonFlags_SkipGroupLengths      = (1 << 7),  /*!< Skip tags whose element is zero (new in 1.9.1) */
+
+    _OrthancPluginDicomToJsonFlags_INTERNAL = 0x7fffffff
+  } OrthancPluginDicomToJsonFlags;
+
+
+  /**
+   * Flags to the creation of a DICOM file.
+   * @ingroup Toolbox
+   * @see OrthancPluginCreateDicom()
+   **/
+  typedef enum
+  {
+    OrthancPluginCreateDicomFlags_None                  = 0,         /*!< Default mode */
+    OrthancPluginCreateDicomFlags_DecodeDataUriScheme   = (1 << 0),  /*!< Decode fields encoded using data URI scheme */
+    OrthancPluginCreateDicomFlags_GenerateIdentifiers   = (1 << 1),  /*!< Automatically generate DICOM identifiers */
+
+    _OrthancPluginCreateDicomFlags_INTERNAL = 0x7fffffff
+  } OrthancPluginCreateDicomFlags;
+
+
+  /**
+   * The constraints on the DICOM identifiers that must be supported
+   * by the database plugins.
+   * @deprecated Plugins using OrthancPluginConstraintType will be faster
+   **/
+  typedef enum
+  {
+    OrthancPluginIdentifierConstraint_Equal = 1,           /*!< Equal */
+    OrthancPluginIdentifierConstraint_SmallerOrEqual = 2,  /*!< Less or equal */
+    OrthancPluginIdentifierConstraint_GreaterOrEqual = 3,  /*!< More or equal */
+    OrthancPluginIdentifierConstraint_Wildcard = 4,        /*!< Case-sensitive wildcard matching (with * and ?) */
+
+    _OrthancPluginIdentifierConstraint_INTERNAL = 0x7fffffff
+  } OrthancPluginIdentifierConstraint;
+
+
+  /**
+   * The constraints on the tags (main DICOM tags and identifier tags)
+   * that must be supported by the database plugins.
+   **/
+  typedef enum
+  {
+    OrthancPluginConstraintType_Equal = 1,           /*!< Equal */
+    OrthancPluginConstraintType_SmallerOrEqual = 2,  /*!< Less or equal */
+    OrthancPluginConstraintType_GreaterOrEqual = 3,  /*!< More or equal */
+    OrthancPluginConstraintType_Wildcard = 4,        /*!< Wildcard matching */
+    OrthancPluginConstraintType_List = 5,            /*!< List of values */
+
+    _OrthancPluginConstraintType_INTERNAL = 0x7fffffff
+  } OrthancPluginConstraintType;
+
+
+  /**
+   * The origin of a DICOM instance that has been received by Orthanc.
+   **/
+  typedef enum
+  {
+    OrthancPluginInstanceOrigin_Unknown = 1,        /*!< Unknown origin */
+    OrthancPluginInstanceOrigin_DicomProtocol = 2,  /*!< Instance received through DICOM protocol */
+    OrthancPluginInstanceOrigin_RestApi = 3,        /*!< Instance received through REST API of Orthanc */
+    OrthancPluginInstanceOrigin_Plugin = 4,         /*!< Instance added to Orthanc by a plugin */
+    OrthancPluginInstanceOrigin_Lua = 5,            /*!< Instance added to Orthanc by a Lua script */
+    OrthancPluginInstanceOrigin_WebDav = 6,         /*!< Instance received through WebDAV (new in 1.8.0) */
+
+    _OrthancPluginInstanceOrigin_INTERNAL = 0x7fffffff
+  } OrthancPluginInstanceOrigin;
+
+
+  /**
+   * The possible status for one single step of a job.
+   **/
+  typedef enum
+  {
+    OrthancPluginJobStepStatus_Success = 1,   /*!< The job has successfully executed all its steps */
+    OrthancPluginJobStepStatus_Failure = 2,   /*!< The job has failed while executing this step */
+    OrthancPluginJobStepStatus_Continue = 3   /*!< The job has still data to process after this step */
+  } OrthancPluginJobStepStatus;
+
+
+  /**
+   * Explains why the job should stop and release the resources it has
+   * allocated. This is especially important to disambiguate between
+   * the "paused" condition and the "final" conditions (success,
+   * failure, or canceled).
+   **/
+  typedef enum
+  {
+    OrthancPluginJobStopReason_Success = 1,  /*!< The job has succeeded */
+    OrthancPluginJobStopReason_Paused = 2,   /*!< The job was paused, and will be resumed later */
+    OrthancPluginJobStopReason_Failure = 3,  /*!< The job has failed, and might be resubmitted later */
+    OrthancPluginJobStopReason_Canceled = 4  /*!< The job was canceled, and might be resubmitted later */
+  } OrthancPluginJobStopReason;
+
+
+  /**
+   * The available types of metrics.
+   **/
+  typedef enum
+  {
+    OrthancPluginMetricsType_Default = 0,   /*!< Default metrics */
+
+    /**
+     * This metrics represents a time duration. Orthanc will keep the
+     * maximum value of the metrics over a sliding window of ten
+     * seconds, which is useful if the metrics is sampled frequently.
+     **/
+    OrthancPluginMetricsType_Timer = 1
+  } OrthancPluginMetricsType;
+  
+
+  /**
+   * The available modes to export a binary DICOM tag into a DICOMweb
+   * JSON or XML document.
+   **/
+  typedef enum
+  {
+    OrthancPluginDicomWebBinaryMode_Ignore = 0,        /*!< Don't include binary tags */
+    OrthancPluginDicomWebBinaryMode_InlineBinary = 1,  /*!< Inline encoding using Base64 */
+    OrthancPluginDicomWebBinaryMode_BulkDataUri = 2    /*!< Use a bulk data URI field */
+  } OrthancPluginDicomWebBinaryMode;
+
+
+  /**
+   * The available values for the Failure Reason (0008,1197) during
+   * storage commitment.
+   * http://dicom.nema.org/medical/dicom/2019e/output/chtml/part03/sect_C.14.html#sect_C.14.1.1
+   **/
+  typedef enum
+  {
+    /**
+     * Success: The DICOM instance is properly stored in the SCP
+     **/
+    OrthancPluginStorageCommitmentFailureReason_Success = 0,
+
+    /**
+     * 0110H: A general failure in processing the operation was encountered
+     **/
+    OrthancPluginStorageCommitmentFailureReason_ProcessingFailure = 1,
+
+    /**
+     * 0112H: One or more of the elements in the Referenced SOP
+     * Instance Sequence was not available
+     **/
+    OrthancPluginStorageCommitmentFailureReason_NoSuchObjectInstance = 2,
+
+    /**
+     * 0213H: The SCP does not currently have enough resources to
+     * store the requested SOP Instance(s)
+     **/
+    OrthancPluginStorageCommitmentFailureReason_ResourceLimitation = 3,
+
+    /**
+     * 0122H: Storage Commitment has been requested for a SOP Instance
+     * with a SOP Class that is not supported by the SCP
+     **/
+    OrthancPluginStorageCommitmentFailureReason_ReferencedSOPClassNotSupported = 4,
+
+    /**
+     * 0119H: The SOP Class of an element in the Referenced SOP
+     * Instance Sequence did not correspond to the SOP class
+     * registered for this SOP Instance at the SCP
+     **/
+    OrthancPluginStorageCommitmentFailureReason_ClassInstanceConflict = 5,
+
+    /**
+     * 0131H: The Transaction UID of the Storage Commitment Request is
+     * already in use
+     **/
+    OrthancPluginStorageCommitmentFailureReason_DuplicateTransactionUID = 6
+  } OrthancPluginStorageCommitmentFailureReason;
+
+
+  /**
+   * The action to be taken after ReceivedInstanceCallback is triggered
+   **/
+  typedef enum
+  {
+    OrthancPluginReceivedInstanceAction_KeepAsIs = 1, /*!< Keep the instance as is */
+    OrthancPluginReceivedInstanceAction_Modify = 2,   /*!< Modify the instance */
+    OrthancPluginReceivedInstanceAction_Discard = 3,  /*!< Discard the instance */
+
+    _OrthancPluginReceivedInstanceAction_INTERNAL = 0x7fffffff
+  } OrthancPluginReceivedInstanceAction;
+
+
+  /**
+   * @brief A 32-bit memory buffer allocated by the core system of Orthanc.
+   *
+   * A memory buffer allocated by the core system of Orthanc. When the
+   * content of the buffer is not useful anymore, it must be free by a
+   * call to ::OrthancPluginFreeMemoryBuffer().
+   **/
+  typedef struct
+  {
+    /**
+     * @brief The content of the buffer.
+     **/
+    void*      data;
+
+    /**
+     * @brief The number of bytes in the buffer.
+     **/
+    uint32_t   size;
+  } OrthancPluginMemoryBuffer;
+
+
+
+  /**
+   * @brief A 64-bit memory buffer allocated by the core system of Orthanc.
+   *
+   * A memory buffer allocated by the core system of Orthanc. When the
+   * content of the buffer is not useful anymore, it must be free by a
+   * call to ::OrthancPluginFreeMemoryBuffer64().
+   **/
+  typedef struct
+  {
+    /**
+     * @brief The content of the buffer.
+     **/
+    void*      data;
+
+    /**
+     * @brief The number of bytes in the buffer.
+     **/
+    uint64_t   size;
+  } OrthancPluginMemoryBuffer64;
+
+
+
+
+  /**
+   * @brief Opaque structure that represents the HTTP connection to the client application.
+   * @ingroup Callback
+   **/
+  typedef struct _OrthancPluginRestOutput_t OrthancPluginRestOutput;
+
+
+
+  /**
+   * @brief Opaque structure that represents a DICOM instance that is managed by the Orthanc core.
+   * @ingroup DicomInstance
+   **/
+  typedef struct _OrthancPluginDicomInstance_t OrthancPluginDicomInstance;
+
+
+
+  /**
+   * @brief Opaque structure that represents an image that is uncompressed in memory.
+   * @ingroup Images
+   **/
+  typedef struct _OrthancPluginImage_t OrthancPluginImage;
+
+
+
+  /**
+   * @brief Opaque structure that represents the storage area that is actually used by Orthanc.
+   * @ingroup Images
+   **/
+  typedef struct _OrthancPluginStorageArea_t OrthancPluginStorageArea;
+
+
+
+  /**
+   * @brief Opaque structure to an object that represents a C-Find query for worklists.
+   * @ingroup DicomCallbacks
+   **/
+  typedef struct _OrthancPluginWorklistQuery_t OrthancPluginWorklistQuery;
+
+
+
+  /**
+   * @brief Opaque structure to an object that represents the answers to a C-Find query for worklists.
+   * @ingroup DicomCallbacks
+   **/
+  typedef struct _OrthancPluginWorklistAnswers_t OrthancPluginWorklistAnswers;
+
+
+
+  /**
+   * @brief Opaque structure to an object that represents a C-Find query.
+   * @ingroup DicomCallbacks
+   **/
+  typedef struct _OrthancPluginFindQuery_t OrthancPluginFindQuery;
+
+
+
+  /**
+   * @brief Opaque structure to an object that represents the answers to a C-Find query for worklists.
+   * @ingroup DicomCallbacks
+   **/
+  typedef struct _OrthancPluginFindAnswers_t OrthancPluginFindAnswers;
+
+
+
+  /**
+   * @brief Opaque structure to an object that can be used to check whether a DICOM instance matches a C-Find query.
+   * @ingroup Toolbox
+   **/
+  typedef struct _OrthancPluginFindMatcher_t OrthancPluginFindMatcher;
+
+
+  
+  /**
+   * @brief Opaque structure to the set of remote Orthanc Peers that are known to the local Orthanc server.
+   * @ingroup Toolbox
+   **/
+  typedef struct _OrthancPluginPeers_t OrthancPluginPeers;
+
+
+
+  /**
+   * @brief Opaque structure to a job to be executed by Orthanc.
+   * @ingroup Toolbox
+   **/
+  typedef struct _OrthancPluginJob_t OrthancPluginJob;  
+
+
+
+  /**
+   * @brief Opaque structure that represents a node in a JSON or XML
+   * document used in DICOMweb.
+   * @ingroup Toolbox
+   **/
+  typedef struct _OrthancPluginDicomWebNode_t OrthancPluginDicomWebNode;
+
+  
+
+  /**
+   * @brief Signature of a callback function that answers to a REST request.
+   * @ingroup Callbacks
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginRestCallback) (
+    OrthancPluginRestOutput* output,
+    const char* url,
+    const OrthancPluginHttpRequest* request);
+
+
+
+  /**
+   * @brief Signature of a callback function that is triggered when Orthanc stores a new DICOM instance.
+   * @ingroup Callbacks
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginOnStoredInstanceCallback) (
+    const OrthancPluginDicomInstance* instance,
+    const char* instanceId);
+
+
+
+  /**
+   * @brief Signature of a callback function that is triggered when a change happens to some DICOM resource.
+   * @ingroup Callbacks
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginOnChangeCallback) (
+    OrthancPluginChangeType changeType,
+    OrthancPluginResourceType resourceType,
+    const char* resourceId);
+
+
+
+  /**
+   * @brief Signature of a callback function to decode a DICOM instance as an image.
+   * @ingroup Callbacks
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginDecodeImageCallback) (
+    OrthancPluginImage** target,
+    const void* dicom,
+    const uint32_t size,
+    uint32_t frameIndex);
+
+
+
+  /**
+   * @brief Signature of a function to free dynamic memory.
+   * @ingroup Callbacks
+   **/
+  typedef void (*OrthancPluginFree) (void* buffer);
+
+
+
+  /**
+   * @brief Signature of a function to set the content of a node
+   * encoding a binary DICOM tag, into a JSON or XML document
+   * generated for DICOMweb.
+   * @ingroup Callbacks
+   **/
+  typedef void (*OrthancPluginDicomWebSetBinaryNode) (
+    OrthancPluginDicomWebNode*       node,
+    OrthancPluginDicomWebBinaryMode  mode,
+    const char*                      bulkDataUri);
+    
+
+
+  /**
+   * @brief Callback for writing to the storage area.
+   *
+   * Signature of a callback function that is triggered when Orthanc writes a file to the storage area.
+   *
+   * @param uuid The UUID of the file.
+   * @param content The content of the file.
+   * @param size The size of the file.
+   * @param type The content type corresponding to this file. 
+   * @return 0 if success, other value if error.
+   * @ingroup Callbacks
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginStorageCreate) (
+    const char* uuid,
+    const void* content,
+    int64_t size,
+    OrthancPluginContentType type);
+
+
+
+  /**
+   * @brief Callback for reading from the storage area.
+   *
+   * Signature of a callback function that is triggered when Orthanc reads a file from the storage area.
+   *
+   * @param content The content of the file (output).
+   * @param size The size of the file (output).
+   * @param uuid The UUID of the file of interest.
+   * @param type The content type corresponding to this file. 
+   * @return 0 if success, other value if error.
+   * @ingroup Callbacks
+   * @deprecated New plugins should use OrthancPluginStorageRead2
+   * 
+   * @warning The "content" buffer *must* have been allocated using
+   * the "malloc()" function of your C standard library (i.e. nor
+   * "new[]", neither a pointer to a buffer). The "free()" function of
+   * your C standard library will automatically be invoked on the
+   * "content" pointer.
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginStorageRead) (
+    void** content,
+    int64_t* size,
+    const char* uuid,
+    OrthancPluginContentType type);
+
+
+
+  /**
+   * @brief Callback for reading a whole file from the storage area.
+   *
+   * Signature of a callback function that is triggered when Orthanc
+   * reads a whole file from the storage area.
+   *
+   * @param target Memory buffer where to store the content of the file. It must be allocated by the
+   * plugin using OrthancPluginCreateMemoryBuffer64(). The core of Orthanc will free it.
+   * @param uuid The UUID of the file of interest.
+   * @param type The content type corresponding to this file. 
+   * @ingroup Callbacks
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginStorageReadWhole) (
+    OrthancPluginMemoryBuffer64* target,
+    const char* uuid,
+    OrthancPluginContentType type);
+
+
+
+  /**
+   * @brief Callback for reading a range of a file from the storage area.
+   *
+   * Signature of a callback function that is triggered when Orthanc
+   * reads a portion of a file from the storage area. Orthanc
+   * indicates the start position and the length of the range.
+   *
+   * @param target Memory buffer where to store the content of the range.
+   * The memory buffer is allocated and freed by Orthanc. The length of the range
+   * of interest corresponds to the size of this buffer.
+   * @param uuid The UUID of the file of interest.
+   * @param type The content type corresponding to this file. 
+   * @param rangeStart Start position of the requested range in the file.
+   * @return 0 if success, other value if error.
+   * @ingroup Callbacks
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginStorageReadRange) (
+    OrthancPluginMemoryBuffer64* target,
+    const char* uuid,
+    OrthancPluginContentType type,
+    uint64_t rangeStart);
+
+
+
+  /**
+   * @brief Callback for removing a file from the storage area.
+   *
+   * Signature of a callback function that is triggered when Orthanc deletes a file from the storage area.
+   *
+   * @param uuid The UUID of the file to be removed.
+   * @param type The content type corresponding to this file. 
+   * @return 0 if success, other value if error.
+   * @ingroup Callbacks
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginStorageRemove) (
+    const char* uuid,
+    OrthancPluginContentType type);
+
+
+
+  /**
+   * @brief Callback to handle the C-Find SCP requests for worklists.
+   *
+   * Signature of a callback function that is triggered when Orthanc
+   * receives a C-Find SCP request against modality worklists.
+   *
+   * @param answers The target structure where answers must be stored.
+   * @param query The worklist query.
+   * @param issuerAet The Application Entity Title (AET) of the modality from which the request originates.
+   * @param calledAet The Application Entity Title (AET) of the modality that is called by the request.
+   * @return 0 if success, other value if error.
+   * @ingroup DicomCallbacks
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginWorklistCallback) (
+    OrthancPluginWorklistAnswers*     answers,
+    const OrthancPluginWorklistQuery* query,
+    const char*                       issuerAet,
+    const char*                       calledAet);
+
+
+
+  /**
+   * @brief Callback to filter incoming HTTP requests received by Orthanc.
+   *
+   * Signature of a callback function that is triggered whenever
+   * Orthanc receives an HTTP/REST request, and that answers whether
+   * this request should be allowed. If the callback returns "0"
+   * ("false"), the server answers with HTTP status code 403
+   * (Forbidden).
+   *
+   * Pay attention to the fact that this function may be invoked
+   * concurrently by different threads of the Web server of
+   * Orthanc. You must implement proper locking if applicable.
+   *
+   * @param method The HTTP method used by the request.
+   * @param uri The URI of interest.
+   * @param ip The IP address of the HTTP client.
+   * @param headersCount The number of HTTP headers.
+   * @param headersKeys The keys of the HTTP headers (always converted to low-case).
+   * @param headersValues The values of the HTTP headers.
+   * @return 0 if forbidden access, 1 if allowed access, -1 if error.
+   * @ingroup Callback
+   * @deprecated Please instead use OrthancPluginIncomingHttpRequestFilter2()
+   **/
+  typedef int32_t (*OrthancPluginIncomingHttpRequestFilter) (
+    OrthancPluginHttpMethod  method,
+    const char*              uri,
+    const char*              ip,
+    uint32_t                 headersCount,
+    const char* const*       headersKeys,
+    const char* const*       headersValues);
+
+
+
+  /**
+   * @brief Callback to filter incoming HTTP requests received by Orthanc.
+   *
+   * Signature of a callback function that is triggered whenever
+   * Orthanc receives an HTTP/REST request, and that answers whether
+   * this request should be allowed. If the callback returns "0"
+   * ("false"), the server answers with HTTP status code 403
+   * (Forbidden).
+   *
+   * Pay attention to the fact that this function may be invoked
+   * concurrently by different threads of the Web server of
+   * Orthanc. You must implement proper locking if applicable.
+   *
+   * @param method The HTTP method used by the request.
+   * @param uri The URI of interest.
+   * @param ip The IP address of the HTTP client.
+   * @param headersCount The number of HTTP headers.
+   * @param headersKeys The keys of the HTTP headers (always converted to low-case).
+   * @param headersValues The values of the HTTP headers.
+   * @param getArgumentsCount The number of GET arguments (only for the GET HTTP method).
+   * @param getArgumentsKeys The keys of the GET arguments (only for the GET HTTP method).
+   * @param getArgumentsValues The values of the GET arguments (only for the GET HTTP method).
+   * @return 0 if forbidden access, 1 if allowed access, -1 if error.
+   * @ingroup Callback
+   **/
+  typedef int32_t (*OrthancPluginIncomingHttpRequestFilter2) (
+    OrthancPluginHttpMethod  method,
+    const char*              uri,
+    const char*              ip,
+    uint32_t                 headersCount,
+    const char* const*       headersKeys,
+    const char* const*       headersValues,
+    uint32_t                 getArgumentsCount,
+    const char* const*       getArgumentsKeys,
+    const char* const*       getArgumentsValues);
+
+
+
+  /**
+   * @brief Callback to handle incoming C-Find SCP requests.
+   *
+   * Signature of a callback function that is triggered whenever
+   * Orthanc receives a C-Find SCP request not concerning modality
+   * worklists.
+   *
+   * @param answers The target structure where answers must be stored.
+   * @param query The worklist query.
+   * @param issuerAet The Application Entity Title (AET) of the modality from which the request originates.
+   * @param calledAet The Application Entity Title (AET) of the modality that is called by the request.
+   * @return 0 if success, other value if error.
+   * @ingroup DicomCallbacks
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginFindCallback) (
+    OrthancPluginFindAnswers*     answers,
+    const OrthancPluginFindQuery* query,
+    const char*                   issuerAet,
+    const char*                   calledAet);
+
+
+
+  /**
+   * @brief Callback to handle incoming C-Move SCP requests.
+   *
+   * Signature of a callback function that is triggered whenever
+   * Orthanc receives a C-Move SCP request. The callback receives the
+   * type of the resource of interest (study, series, instance...)
+   * together with the DICOM tags containing its identifiers. In turn,
+   * the plugin must create a driver object that will be responsible
+   * for driving the successive move suboperations.
+   *
+   * @param resourceType The type of the resource of interest. Note
+   * that this might be set to ResourceType_None if the
+   * QueryRetrieveLevel (0008,0052) tag was not provided by the
+   * issuer (i.e. the originator modality).
+   * @param patientId Content of the PatientID (0x0010, 0x0020) tag of the resource of interest. Might be NULL.
+   * @param accessionNumber Content of the AccessionNumber (0x0008, 0x0050) tag. Might be NULL.
+   * @param studyInstanceUid Content of the StudyInstanceUID (0x0020, 0x000d) tag. Might be NULL.
+   * @param seriesInstanceUid Content of the SeriesInstanceUID (0x0020, 0x000e) tag. Might be NULL.
+   * @param sopInstanceUid Content of the SOPInstanceUID (0x0008, 0x0018) tag. Might be NULL.
+   * @param originatorAet The Application Entity Title (AET) of the
+   * modality from which the request originates.
+   * @param sourceAet The Application Entity Title (AET) of the
+   * modality that should send its DICOM files to another modality.
+   * @param targetAet The Application Entity Title (AET) of the
+   * modality that should receive the DICOM files.
+   * @param originatorId The Message ID issued by the originator modality,
+   * as found in tag (0000,0110) of the DICOM query emitted by the issuer.
+   *
+   * @return The NULL value if the plugin cannot deal with this query,
+   * or a pointer to the driver object that is responsible for
+   * handling the successive move suboperations.
+   * 
+   * @note If targetAet equals sourceAet, this is actually a query/retrieve operation.
+   * @ingroup DicomCallbacks
+   **/
+  typedef void* (*OrthancPluginMoveCallback) (
+    OrthancPluginResourceType  resourceType,
+    const char*                patientId,
+    const char*                accessionNumber,
+    const char*                studyInstanceUid,
+    const char*                seriesInstanceUid,
+    const char*                sopInstanceUid,
+    const char*                originatorAet,
+    const char*                sourceAet,
+    const char*                targetAet,
+    uint16_t                   originatorId);
+    
+
+  /**
+   * @brief Callback to read the size of a C-Move driver.
+   * 
+   * Signature of a callback function that returns the number of
+   * C-Move suboperations that are to be achieved by the given C-Move
+   * driver. This driver is the return value of a previous call to the
+   * OrthancPluginMoveCallback() callback.
+   *
+   * @param moveDriver The C-Move driver of interest.
+   * @return The number of suboperations. 
+   * @ingroup DicomCallbacks
+   **/
+  typedef uint32_t (*OrthancPluginGetMoveSize) (void* moveDriver);
+
+
+  /**
+   * @brief Callback to apply one C-Move suboperation.
+   * 
+   * Signature of a callback function that applies the next C-Move
+   * suboperation that os to be achieved by the given C-Move
+   * driver. This driver is the return value of a previous call to the
+   * OrthancPluginMoveCallback() callback.
+   *
+   * @param moveDriver The C-Move driver of interest.
+   * @return 0 if success, or the error code if failure.
+   * @ingroup DicomCallbacks
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginApplyMove) (void* moveDriver);
+
+
+  /**
+   * @brief Callback to free one C-Move driver.
+   * 
+   * Signature of a callback function that releases the resources
+   * allocated by the given C-Move driver. This driver is the return
+   * value of a previous call to the OrthancPluginMoveCallback()
+   * callback.
+   *
+   * @param moveDriver The C-Move driver of interest.
+   * @ingroup DicomCallbacks
+   **/
+  typedef void (*OrthancPluginFreeMove) (void* moveDriver);
+
+
+  /**
+   * @brief Callback to finalize one custom job.
+   * 
+   * Signature of a callback function that releases all the resources
+   * allocated by the given job. This job is the argument provided to
+   * OrthancPluginCreateJob().
+   *
+   * @param job The job of interest.
+   * @ingroup Toolbox
+   **/  
+  typedef void (*OrthancPluginJobFinalize) (void* job);
+
+
+  /**
+   * @brief Callback to check the progress of one custom job.
+   * 
+   * Signature of a callback function that returns the progress of the
+   * job.
+   *
+   * @param job The job of interest.
+   * @return The progress, as a floating-point number ranging from 0 to 1.
+   * @ingroup Toolbox
+   **/  
+  typedef float (*OrthancPluginJobGetProgress) (void* job);
+
+  
+  /**
+   * @brief Callback to retrieve the content of one custom job.
+   * 
+   * Signature of a callback function that returns human-readable
+   * statistics about the job. This statistics must be formatted as a
+   * JSON object. This information is notably displayed in the "Jobs"
+   * tab of "Orthanc Explorer".
+   *
+   * @param job The job of interest.
+   * @return The statistics, as a JSON object encoded as a string.
+   * @ingroup Toolbox
+   **/  
+  typedef const char* (*OrthancPluginJobGetContent) (void* job);
+
+
+  /**
+   * @brief Callback to serialize one custom job.
+   * 
+   * Signature of a callback function that returns a serialized
+   * version of the job, formatted as a JSON object. This
+   * serialization is stored in the Orthanc database, and is used to
+   * reload the job on the restart of Orthanc. The "unserialization"
+   * callback (with OrthancPluginJobsUnserializer signature) will
+   * receive this serialized object.
+   *
+   * @param job The job of interest.
+   * @return The serialized job, as a JSON object encoded as a string.
+   * @see OrthancPluginRegisterJobsUnserializer()
+   * @ingroup Toolbox
+   **/  
+  typedef const char* (*OrthancPluginJobGetSerialized) (void* job);
+
+
+  /**
+   * @brief Callback to execute one step of a custom job.
+   * 
+   * Signature of a callback function that executes one step in the
+   * job. The jobs engine of Orthanc will make successive calls to
+   * this method, as long as it returns
+   * OrthancPluginJobStepStatus_Continue.
+   *
+   * @param job The job of interest.
+   * @return The status of execution.
+   * @ingroup Toolbox
+   **/  
+  typedef OrthancPluginJobStepStatus (*OrthancPluginJobStep) (void* job);
+
+
+  /**
+   * @brief Callback executed once one custom job leaves the "running" state.
+   * 
+   * Signature of a callback function that is invoked once a job
+   * leaves the "running" state. This can happen if the previous call
+   * to OrthancPluginJobStep has failed/succeeded, if the host Orthanc
+   * server is being stopped, or if the user manually tags the job as
+   * paused/canceled. This callback allows the plugin to free
+   * resources allocated for running this custom job (e.g. to stop
+   * threads, or to remove temporary files).
+   * 
+   * Note that handling pauses might involves a specific treatment
+   * (such a stopping threads, but keeping temporary files on the
+   * disk). This "paused" situation can be checked by looking at the
+   * "reason" parameter.
+   *
+   * @param job The job of interest.
+   * @param reason The reason for leaving the "running" state. 
+   * @return 0 if success, or the error code if failure.
+   * @ingroup Toolbox
+   **/    
+  typedef OrthancPluginErrorCode (*OrthancPluginJobStop) (void* job, 
+                                                          OrthancPluginJobStopReason reason);
+
+
+  /**
+   * @brief Callback executed once one stopped custom job is started again.
+   * 
+   * Signature of a callback function that is invoked once a job
+   * leaves the "failure/canceled" state, to be started again. This
+   * function will typically reset the progress to zero. Note that
+   * before being actually executed, the job would first be tagged as
+   * "pending" in the Orthanc jobs engine.
+   *
+   * @param job The job of interest.
+   * @return 0 if success, or the error code if failure.
+   * @ingroup Toolbox
+   **/    
+  typedef OrthancPluginErrorCode (*OrthancPluginJobReset) (void* job);
+
+
+  /**
+   * @brief Callback executed to unserialize a custom job.
+   * 
+   * Signature of a callback function that unserializes a job that was
+   * saved in the Orthanc database.
+   *
+   * @param jobType The type of the job, as provided to OrthancPluginCreateJob().
+   * @param serialized The serialization of the job, as provided by OrthancPluginJobGetSerialized.
+   * @return The unserialized job (as created by OrthancPluginCreateJob()), or NULL
+   * if this unserializer cannot handle this job type.
+   * @see OrthancPluginRegisterJobsUnserializer()
+   * @ingroup Callbacks
+   **/    
+  typedef OrthancPluginJob* (*OrthancPluginJobsUnserializer) (const char* jobType,
+                                                              const char* serialized);
+  
+
+
+  /**
+   * @brief Callback executed to update the metrics of the plugin.
+   * 
+   * Signature of a callback function that is called by Orthanc
+   * whenever a monitoring tool (such as Prometheus) asks the current
+   * values of the metrics. This callback gives the plugin a chance to
+   * update its metrics, by calling OrthancPluginSetMetricsValue().
+   * This is typically useful for metrics that are expensive to
+   * acquire.
+   * 
+   * @see OrthancPluginRegisterRefreshMetrics()
+   * @ingroup Callbacks
+   **/
+  typedef void (*OrthancPluginRefreshMetricsCallback) ();
+
+  
+
+  /**
+   * @brief Callback executed to encode a binary tag in DICOMweb.
+   * 
+   * Signature of a callback function that is called by Orthanc
+   * whenever a DICOM tag that contains a binary value must be written
+   * to a JSON or XML node, while a DICOMweb document is being
+   * generated. The value representation (VR) of the DICOM tag can be
+   * OB, OD, OF, OL, OW, or UN.
+   * 
+   * @see OrthancPluginEncodeDicomWebJson() and OrthancPluginEncodeDicomWebXml()
+   * @param node The node being generated, as provided by Orthanc.
+   * @param setter The setter to be used to encode the content of the node. If
+   * the setter is not called, the binary tag is not written to the output document.
+   * @param levelDepth The depth of the node in the DICOM hierarchy of sequences.
+   * This parameter gives the number of elements in the "levelTagGroup", 
+   * "levelTagElement", and "levelIndex" arrays.
+   * @param levelTagGroup The group of the parent DICOM tags in the hierarchy.
+   * @param levelTagElement The element of the parent DICOM tags in the hierarchy.
+   * @param levelIndex The index of the node in the parent sequences of the hierarchy.
+   * @param tagGroup The group of the DICOM tag of interest.
+   * @param tagElement The element of the DICOM tag of interest.
+   * @param vr The value representation of the binary DICOM node.
+   * @ingroup Callbacks
+   **/
+  typedef void (*OrthancPluginDicomWebBinaryCallback) (
+    OrthancPluginDicomWebNode*          node,
+    OrthancPluginDicomWebSetBinaryNode  setter,
+    uint32_t                            levelDepth,
+    const uint16_t*                     levelTagGroup,
+    const uint16_t*                     levelTagElement,
+    const uint32_t*                     levelIndex,
+    uint16_t                            tagGroup,
+    uint16_t                            tagElement,
+    OrthancPluginValueRepresentation    vr);
+
+
+
+  /**
+   * @brief Callback executed to encode a binary tag in DICOMweb.
+   * 
+   * Signature of a callback function that is called by Orthanc
+   * whenever a DICOM tag that contains a binary value must be written
+   * to a JSON or XML node, while a DICOMweb document is being
+   * generated. The value representation (VR) of the DICOM tag can be
+   * OB, OD, OF, OL, OW, or UN.
+   * 
+   * @see OrthancPluginEncodeDicomWebJson() and OrthancPluginEncodeDicomWebXml()
+   * @param node The node being generated, as provided by Orthanc.
+   * @param setter The setter to be used to encode the content of the node. If
+   * the setter is not called, the binary tag is not written to the output document.
+   * @param levelDepth The depth of the node in the DICOM hierarchy of sequences.
+   * This parameter gives the number of elements in the "levelTagGroup", 
+   * "levelTagElement", and "levelIndex" arrays.
+   * @param levelTagGroup The group of the parent DICOM tags in the hierarchy.
+   * @param levelTagElement The element of the parent DICOM tags in the hierarchy.
+   * @param levelIndex The index of the node in the parent sequences of the hierarchy.
+   * @param tagGroup The group of the DICOM tag of interest.
+   * @param tagElement The element of the DICOM tag of interest.
+   * @param vr The value representation of the binary DICOM node.
+   * @param payload The user payload.
+   * @ingroup Callbacks
+   **/
+  typedef void (*OrthancPluginDicomWebBinaryCallback2) (
+    OrthancPluginDicomWebNode*          node,
+    OrthancPluginDicomWebSetBinaryNode  setter,
+    uint32_t                            levelDepth,
+    const uint16_t*                     levelTagGroup,
+    const uint16_t*                     levelTagElement,
+    const uint32_t*                     levelIndex,
+    uint16_t                            tagGroup,
+    uint16_t                            tagElement,
+    OrthancPluginValueRepresentation    vr,
+    void*                               payload);
+
+
+
+  /**
+   * @brief Data structure that contains information about the Orthanc core.
+   **/
+  typedef struct _OrthancPluginContext_t
+  {
+    void*                     pluginsManager;
+    const char*               orthancVersion;
+    OrthancPluginFree         Free;
+    OrthancPluginErrorCode  (*InvokeService) (struct _OrthancPluginContext_t* context,
+                                              _OrthancPluginService service,
+                                              const void* params);
+  } OrthancPluginContext;
+
+
+  
+  /**
+   * @brief An entry in the dictionary of DICOM tags.
+   **/
+  typedef struct
+  {
+    uint16_t                          group;            /*!< The group of the tag */
+    uint16_t                          element;          /*!< The element of the tag */
+    OrthancPluginValueRepresentation  vr;               /*!< The value representation of the tag */
+    uint32_t                          minMultiplicity;  /*!< The minimum multiplicity of the tag */
+    uint32_t                          maxMultiplicity;  /*!< The maximum multiplicity of the tag (0 means arbitrary) */
+  } OrthancPluginDictionaryEntry;
+
+
+
+  /**
+   * @brief Free a string.
+   * 
+   * Free a string that was allocated by the core system of Orthanc.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param str The string to be freed.
+   **/
+  ORTHANC_PLUGIN_INLINE void  OrthancPluginFreeString(
+    OrthancPluginContext* context, 
+    char* str)
+  {
+    if (str != NULL)
+    {
+      context->Free(str);
+    }
+  }
+
+
+  /**
+   * @brief Check that the version of the hosting Orthanc is above a given version.
+   * 
+   * This function checks whether the version of the Orthanc server
+   * running this plugin, is above the given version. Contrarily to
+   * OrthancPluginCheckVersion(), it is up to the developer of the
+   * plugin to make sure that all the Orthanc SDK services called by
+   * the plugin are actually implemented in the given version of
+   * Orthanc.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param expectedMajor Expected major version.
+   * @param expectedMinor Expected minor version.
+   * @param expectedRevision Expected revision.
+   * @return 1 if and only if the versions are compatible. If the
+   * result is 0, the initialization of the plugin should fail.
+   * @see OrthancPluginCheckVersion
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE int32_t  OrthancPluginCheckVersionAdvanced(
+    OrthancPluginContext* context,
+    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) ||
+        sizeof(int32_t) != sizeof(OrthancPluginPixelFormat) ||
+        sizeof(int32_t) != sizeof(OrthancPluginContentType) ||
+        sizeof(int32_t) != sizeof(OrthancPluginResourceType) ||
+        sizeof(int32_t) != sizeof(OrthancPluginChangeType) ||
+        sizeof(int32_t) != sizeof(OrthancPluginCompressionType) ||
+        sizeof(int32_t) != sizeof(OrthancPluginImageFormat) ||
+        sizeof(int32_t) != sizeof(OrthancPluginValueRepresentation) ||
+        sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFormat) ||
+        sizeof(int32_t) != sizeof(OrthancPluginDicomToJsonFlags) ||
+        sizeof(int32_t) != sizeof(OrthancPluginCreateDicomFlags) ||
+        sizeof(int32_t) != sizeof(OrthancPluginIdentifierConstraint) ||
+        sizeof(int32_t) != sizeof(OrthancPluginInstanceOrigin) ||
+        sizeof(int32_t) != sizeof(OrthancPluginJobStepStatus) ||
+        sizeof(int32_t) != sizeof(OrthancPluginConstraintType) ||
+        sizeof(int32_t) != sizeof(OrthancPluginMetricsType) ||
+        sizeof(int32_t) != sizeof(OrthancPluginDicomWebBinaryMode) ||
+        sizeof(int32_t) != sizeof(OrthancPluginStorageCommitmentFailureReason) ||
+        sizeof(int32_t) != sizeof(OrthancPluginReceivedInstanceAction))
+    {
+      /* Mismatch in the size of the enumerations */
+      return 0;
+    }
+
+    /* Assume compatibility with the mainline */
+    if (!strcmp(context->orthancVersion, "mainline"))
+    {
+      return 1;
+    }
+
+    /* Parse the version of the Orthanc core */
+    if ( 
+#ifdef _MSC_VER
+      sscanf_s
+#else
+      sscanf
+#endif
+      (context->orthancVersion, "%4d.%4d.%4d", &major, &minor, &revision) != 3)
+    {
+      return 0;
+    }
+
+    /* Check the major number of the version */
+
+    if (major > expectedMajor)
+    {
+      return 1;
+    }
+
+    if (major < expectedMajor)
+    {
+      return 0;
+    }
+
+    /* Check the minor number of the version */
+
+    if (minor > expectedMinor)
+    {
+      return 1;
+    }
+
+    if (minor < expectedMinor)
+    {
+      return 0;
+    }
+
+    /* Check the revision number of the version */
+
+    if (revision >= expectedRevision)
+    {
+      return 1;
+    }
+    else
+    {
+      return 0;
+    }
+  }
+
+
+  /**
+   * @brief Check the compatibility of the plugin wrt. the version of its hosting Orthanc.
+   * 
+   * This function checks whether the version of the Orthanc server
+   * running this plugin, is above the version of the current Orthanc
+   * SDK header. This guarantees that the plugin is compatible with
+   * the hosting Orthanc (i.e. it will not call unavailable services).
+   * The result of this function should always be checked in the
+   * OrthancPluginInitialize() entry point of the plugin.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @return 1 if and only if the versions are compatible. If the
+   * result is 0, the initialization of the plugin should fail.
+   * @see OrthancPluginCheckVersionAdvanced
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE int32_t  OrthancPluginCheckVersion(
+    OrthancPluginContext* context)
+  {
+    return OrthancPluginCheckVersionAdvanced(
+      context,
+      ORTHANC_PLUGINS_MINIMAL_MAJOR_NUMBER,
+      ORTHANC_PLUGINS_MINIMAL_MINOR_NUMBER,
+      ORTHANC_PLUGINS_MINIMAL_REVISION_NUMBER);
+  }
+
+
+  /**
+   * @brief Free a memory buffer.
+   * 
+   * Free a memory buffer that was allocated by the core system of Orthanc.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param buffer The memory buffer to release.
+   **/
+  ORTHANC_PLUGIN_INLINE void  OrthancPluginFreeMemoryBuffer(
+    OrthancPluginContext* context, 
+    OrthancPluginMemoryBuffer* buffer)
+  {
+    context->Free(buffer->data);
+  }
+
+
+  /**
+   * @brief Free a memory buffer.
+   * 
+   * Free a memory buffer that was allocated by the core system of Orthanc.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param buffer The memory buffer to release.
+   **/
+  ORTHANC_PLUGIN_INLINE void  OrthancPluginFreeMemoryBuffer64(
+    OrthancPluginContext* context, 
+    OrthancPluginMemoryBuffer64* buffer)
+  {
+    context->Free(buffer->data);
+  }
+
+
+  /**
+   * @brief Log an error.
+   *
+   * Log an error message using the Orthanc logging system.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param message The message to be logged.
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginLogError(
+    OrthancPluginContext* context,
+    const char* message)
+  {
+    context->InvokeService(context, _OrthancPluginService_LogError, message);
+  }
+
+
+  /**
+   * @brief Log a warning.
+   *
+   * Log a warning message using the Orthanc logging system.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param message The message to be logged.
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginLogWarning(
+    OrthancPluginContext* context,
+    const char* message)
+  {
+    context->InvokeService(context, _OrthancPluginService_LogWarning, message);
+  }
+
+
+  /**
+   * @brief Log an information.
+   *
+   * Log an information message using the Orthanc logging system.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param message The message to be logged.
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginLogInfo(
+    OrthancPluginContext* context,
+    const char* message)
+  {
+    context->InvokeService(context, _OrthancPluginService_LogInfo, message);
+  }
+
+
+
+  typedef struct
+  {
+    const char* pathRegularExpression;
+    OrthancPluginRestCallback callback;
+  } _OrthancPluginRestCallback;
+
+  /**
+   * @brief Register a REST callback.
+   *
+   * This function registers a REST callback against a regular
+   * expression for a URI. This function must be called during the
+   * initialization of the plugin, i.e. inside the
+   * OrthancPluginInitialize() public function.
+   *
+   * Each REST callback is guaranteed to run in mutual exclusion.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param pathRegularExpression Regular expression for the URI. May contain groups. 
+   * @param callback The callback function to handle the REST call.
+   * @see OrthancPluginRegisterRestCallbackNoLock()
+   *
+   * @note
+   * The regular expression is case sensitive and must follow the
+   * [Perl syntax](https://www.boost.org/doc/libs/1_67_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html).
+   *
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallback(
+    OrthancPluginContext*     context,
+    const char*               pathRegularExpression,
+    OrthancPluginRestCallback callback)
+  {
+    _OrthancPluginRestCallback params;
+    params.pathRegularExpression = pathRegularExpression;
+    params.callback = callback;
+    context->InvokeService(context, _OrthancPluginService_RegisterRestCallback, &params);
+  }
+
+
+
+  /**
+   * @brief Register a REST callback, without locking.
+   *
+   * This function registers a REST callback against a regular
+   * expression for a URI. This function must be called during the
+   * initialization of the plugin, i.e. inside the
+   * OrthancPluginInitialize() public function.
+   *
+   * Contrarily to OrthancPluginRegisterRestCallback(), the callback
+   * will NOT be invoked in mutual exclusion. This can be useful for
+   * high-performance plugins that must handle concurrent requests
+   * (Orthanc uses a pool of threads, one thread being assigned to
+   * each incoming HTTP request). Of course, if using this function,
+   * it is up to the plugin to implement the required locking
+   * mechanisms.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param pathRegularExpression Regular expression for the URI. May contain groups.
+   * @param callback The callback function to handle the REST call.
+   * @see OrthancPluginRegisterRestCallback()
+   *
+   * @note
+   * The regular expression is case sensitive and must follow the
+   * [Perl syntax](https://www.boost.org/doc/libs/1_67_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html).
+   *
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRestCallbackNoLock(
+    OrthancPluginContext*     context,
+    const char*               pathRegularExpression,
+    OrthancPluginRestCallback callback)
+  {
+    _OrthancPluginRestCallback params;
+    params.pathRegularExpression = pathRegularExpression;
+    params.callback = callback;
+    context->InvokeService(context, _OrthancPluginService_RegisterRestCallbackNoLock, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginOnStoredInstanceCallback callback;
+  } _OrthancPluginOnStoredInstanceCallback;
+
+  /**
+   * @brief Register a callback for received instances.
+   *
+   * This function registers a callback function that is called
+   * whenever a new DICOM instance is stored into the Orthanc core.
+   *
+   * @warning Your callback function will be called synchronously with
+   * the core of Orthanc. This implies that deadlocks might emerge if
+   * you call other core primitives of Orthanc in your callback (such
+   * deadlocks are particularly visible in the presence of other plugins
+   * or Lua scripts). It is thus strongly advised to avoid any call to
+   * the REST API of Orthanc in the callback. If you have to call
+   * other primitives of Orthanc, you should make these calls in a
+   * separate thread, passing the pending events to be processed
+   * through a message queue.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param callback The callback function.
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnStoredInstanceCallback(
+    OrthancPluginContext*                  context,
+    OrthancPluginOnStoredInstanceCallback  callback)
+  {
+    _OrthancPluginOnStoredInstanceCallback params;
+    params.callback = callback;
+
+    context->InvokeService(context, _OrthancPluginService_RegisterOnStoredInstanceCallback, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginRestOutput* output;
+    const void*              answer;
+    uint32_t                 answerSize;
+    const char*              mimeType;
+  } _OrthancPluginAnswerBuffer;
+
+  /**
+   * @brief Answer to a REST request.
+   *
+   * This function answers to a REST request with the content of a memory buffer.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param output The HTTP connection to the client application.
+   * @param answer Pointer to the memory buffer containing the answer.
+   * @param answerSize Number of bytes of the answer.
+   * @param mimeType The MIME type of the answer.
+   * @ingroup REST
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginAnswerBuffer(
+    OrthancPluginContext*    context,
+    OrthancPluginRestOutput* output,
+    const void*              answer,
+    uint32_t                 answerSize,
+    const char*              mimeType)
+  {
+    _OrthancPluginAnswerBuffer params;
+    params.output = output;
+    params.answer = answer;
+    params.answerSize = answerSize;
+    params.mimeType = mimeType;
+    context->InvokeService(context, _OrthancPluginService_AnswerBuffer, &params);
+  }
+
+
+  typedef struct
+  {
+    OrthancPluginRestOutput*  output;
+    OrthancPluginPixelFormat  format;
+    uint32_t                  width;
+    uint32_t                  height;
+    uint32_t                  pitch;
+    const void*               buffer;
+  } _OrthancPluginCompressAndAnswerPngImage;
+
+  typedef struct
+  {
+    OrthancPluginRestOutput*  output;
+    OrthancPluginImageFormat  imageFormat;
+    OrthancPluginPixelFormat  pixelFormat;
+    uint32_t                  width;
+    uint32_t                  height;
+    uint32_t                  pitch;
+    const void*               buffer;
+    uint8_t                   quality;
+  } _OrthancPluginCompressAndAnswerImage;
+
+
+  /**
+   * @brief Answer to a REST request with a PNG image.
+   *
+   * This function answers to a REST request with a PNG image. The
+   * parameters of this function describe a memory buffer that
+   * contains an uncompressed image. The image will be automatically compressed
+   * as a PNG image by the core system of Orthanc.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param output The HTTP connection to the client application.
+   * @param format The memory layout of the uncompressed image.
+   * @param width The width of the image.
+   * @param height The height of the image.
+   * @param pitch The pitch of the image (i.e. the number of bytes
+   * between 2 successive lines of the image in the memory buffer).
+   * @param buffer The memory buffer containing the uncompressed image.
+   * @ingroup REST
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerPngImage(
+    OrthancPluginContext*     context,
+    OrthancPluginRestOutput*  output,
+    OrthancPluginPixelFormat  format,
+    uint32_t                  width,
+    uint32_t                  height,
+    uint32_t                  pitch,
+    const void*               buffer)
+  {
+    _OrthancPluginCompressAndAnswerImage params;
+    params.output = output;
+    params.imageFormat = OrthancPluginImageFormat_Png;
+    params.pixelFormat = format;
+    params.width = width;
+    params.height = height;
+    params.pitch = pitch;
+    params.buffer = buffer;
+    params.quality = 0;  /* No quality for PNG */
+    context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginMemoryBuffer*  target;
+    const char*                 instanceId;
+  } _OrthancPluginGetDicomForInstance;
+
+  /**
+   * @brief Retrieve a DICOM instance using its Orthanc identifier.
+   * 
+   * Retrieve a DICOM instance using its Orthanc identifier. The DICOM
+   * file is stored into a newly allocated memory buffer.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param instanceId The Orthanc identifier of the DICOM instance of interest.
+   * @return 0 if success, or the error code if failure.
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginGetDicomForInstance(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  target,
+    const char*                 instanceId)
+  {
+    _OrthancPluginGetDicomForInstance params;
+    params.target = target;
+    params.instanceId = instanceId;
+    return context->InvokeService(context, _OrthancPluginService_GetDicomForInstance, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginMemoryBuffer*  target;
+    const char*                 uri;
+  } _OrthancPluginRestApiGet;
+
+  /**
+   * @brief Make a GET call to the built-in Orthanc REST API.
+   * 
+   * Make a GET call to the built-in Orthanc REST API. The result to
+   * the query is stored into a newly allocated memory buffer.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param uri The URI in the built-in Orthanc API.
+   * @return 0 if success, or the error code if failure.
+   * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
+   * @see OrthancPluginRestApiGetAfterPlugins
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginRestApiGet(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  target,
+    const char*                 uri)
+  {
+    _OrthancPluginRestApiGet params;
+    params.target = target;
+    params.uri = uri;
+    return context->InvokeService(context, _OrthancPluginService_RestApiGet, &params);
+  }
+
+
+
+  /**
+   * @brief Make a GET call to the REST API, as tainted by the plugins.
+   * 
+   * Make a GET call to the Orthanc REST API, after all the plugins
+   * are applied. In other words, if some plugin overrides or adds the
+   * called URI to the built-in Orthanc REST API, this call will
+   * return the result provided by this plugin. The result to the
+   * query is stored into a newly allocated memory buffer.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param uri The URI in the built-in Orthanc API.
+   * @return 0 if success, or the error code if failure.
+   * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
+   * @see OrthancPluginRestApiGet
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginRestApiGetAfterPlugins(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  target,
+    const char*                 uri)
+  {
+    _OrthancPluginRestApiGet params;
+    params.target = target;
+    params.uri = uri;
+    return context->InvokeService(context, _OrthancPluginService_RestApiGetAfterPlugins, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginMemoryBuffer*  target;
+    const char*                 uri;
+    const void*                 body;
+    uint32_t                    bodySize;
+  } _OrthancPluginRestApiPostPut;
+
+  /**
+   * @brief Make a POST call to the built-in Orthanc REST API.
+   * 
+   * Make a POST call to the built-in Orthanc REST API. The result to
+   * the query is stored into a newly allocated memory buffer.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param uri The URI in the built-in Orthanc API.
+   * @param body The body of the POST request.
+   * @param bodySize The size of the body.
+   * @return 0 if success, or the error code if failure.
+   * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
+   * @see OrthancPluginRestApiPostAfterPlugins
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginRestApiPost(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  target,
+    const char*                 uri,
+    const void*                 body,
+    uint32_t                    bodySize)
+  {
+    _OrthancPluginRestApiPostPut params;
+    params.target = target;
+    params.uri = uri;
+    params.body = body;
+    params.bodySize = bodySize;
+    return context->InvokeService(context, _OrthancPluginService_RestApiPost, &params);
+  }
+
+
+  /**
+   * @brief Make a POST call to the REST API, as tainted by the plugins.
+   * 
+   * Make a POST call to the Orthanc REST API, after all the plugins
+   * are applied. In other words, if some plugin overrides or adds the
+   * called URI to the built-in Orthanc REST API, this call will
+   * return the result provided by this plugin. The result to the
+   * query is stored into a newly allocated memory buffer.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param uri The URI in the built-in Orthanc API.
+   * @param body The body of the POST request.
+   * @param bodySize The size of the body.
+   * @return 0 if success, or the error code if failure.
+   * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
+   * @see OrthancPluginRestApiPost
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginRestApiPostAfterPlugins(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  target,
+    const char*                 uri,
+    const void*                 body,
+    uint32_t                    bodySize)
+  {
+    _OrthancPluginRestApiPostPut params;
+    params.target = target;
+    params.uri = uri;
+    params.body = body;
+    params.bodySize = bodySize;
+    return context->InvokeService(context, _OrthancPluginService_RestApiPostAfterPlugins, &params);
+  }
+
+
+
+  /**
+   * @brief Make a DELETE call to the built-in Orthanc REST API.
+   * 
+   * Make a DELETE call to the built-in Orthanc REST API.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param uri The URI to delete in the built-in Orthanc API.
+   * @return 0 if success, or the error code if failure.
+   * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
+   * @see OrthancPluginRestApiDeleteAfterPlugins
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginRestApiDelete(
+    OrthancPluginContext*       context,
+    const char*                 uri)
+  {
+    return context->InvokeService(context, _OrthancPluginService_RestApiDelete, uri);
+  }
+
+
+  /**
+   * @brief Make a DELETE call to the REST API, as tainted by the plugins.
+   * 
+   * Make a DELETE call to the Orthanc REST API, after all the plugins
+   * are applied. In other words, if some plugin overrides or adds the
+   * called URI to the built-in Orthanc REST API, this call will
+   * return the result provided by this plugin. 
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param uri The URI to delete in the built-in Orthanc API.
+   * @return 0 if success, or the error code if failure.
+   * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
+   * @see OrthancPluginRestApiDelete
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginRestApiDeleteAfterPlugins(
+    OrthancPluginContext*       context,
+    const char*                 uri)
+  {
+    return context->InvokeService(context, _OrthancPluginService_RestApiDeleteAfterPlugins, uri);
+  }
+
+
+
+  /**
+   * @brief Make a PUT call to the built-in Orthanc REST API.
+   * 
+   * Make a PUT call to the built-in Orthanc REST API. The result to
+   * the query is stored into a newly allocated memory buffer.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param uri The URI in the built-in Orthanc API.
+   * @param body The body of the PUT request.
+   * @param bodySize The size of the body.
+   * @return 0 if success, or the error code if failure.
+   * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
+   * @see OrthancPluginRestApiPutAfterPlugins
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginRestApiPut(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  target,
+    const char*                 uri,
+    const void*                 body,
+    uint32_t                    bodySize)
+  {
+    _OrthancPluginRestApiPostPut params;
+    params.target = target;
+    params.uri = uri;
+    params.body = body;
+    params.bodySize = bodySize;
+    return context->InvokeService(context, _OrthancPluginService_RestApiPut, &params);
+  }
+
+
+
+  /**
+   * @brief Make a PUT call to the REST API, as tainted by the plugins.
+   * 
+   * Make a PUT call to the Orthanc REST API, after all the plugins
+   * are applied. In other words, if some plugin overrides or adds the
+   * called URI to the built-in Orthanc REST API, this call will
+   * return the result provided by this plugin. The result to the
+   * query is stored into a newly allocated memory buffer.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param uri The URI in the built-in Orthanc API.
+   * @param body The body of the PUT request.
+   * @param bodySize The size of the body.
+   * @return 0 if success, or the error code if failure.
+   * @note If the resource is not existing (error 404), the error code will be OrthancPluginErrorCode_UnknownResource.
+   * @see OrthancPluginRestApiPut
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginRestApiPutAfterPlugins(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  target,
+    const char*                 uri,
+    const void*                 body,
+    uint32_t                    bodySize)
+  {
+    _OrthancPluginRestApiPostPut params;
+    params.target = target;
+    params.uri = uri;
+    params.body = body;
+    params.bodySize = bodySize;
+    return context->InvokeService(context, _OrthancPluginService_RestApiPutAfterPlugins, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginRestOutput* output;
+    const char*              argument;
+  } _OrthancPluginOutputPlusArgument;
+
+  /**
+   * @brief Redirect a REST request.
+   *
+   * This function answers to a REST request by redirecting the user
+   * to another URI using HTTP status 301.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param output The HTTP connection to the client application.
+   * @param redirection Where to redirect.
+   * @ingroup REST
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginRedirect(
+    OrthancPluginContext*    context,
+    OrthancPluginRestOutput* output,
+    const char*              redirection)
+  {
+    _OrthancPluginOutputPlusArgument params;
+    params.output = output;
+    params.argument = redirection;
+    context->InvokeService(context, _OrthancPluginService_Redirect, &params);
+  }
+
+
+
+  typedef struct
+  {
+    char**       result;
+    const char*  argument;
+  } _OrthancPluginRetrieveDynamicString;
+
+  /**
+   * @brief Look for a patient.
+   *
+   * Look for a patient stored in Orthanc, using its Patient ID tag (0x0010, 0x0020).
+   * This function uses the database index to run as fast as possible (it does not loop
+   * over all the stored patients).
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param patientID The Patient ID of interest.
+   * @return The NULL value if the patient is non-existent, or a string containing the 
+   * Orthanc ID of the patient. This string must be freed by OrthancPluginFreeString().
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupPatient(
+    OrthancPluginContext*  context,
+    const char*            patientID)
+  {
+    char* result;
+
+    _OrthancPluginRetrieveDynamicString params;
+    params.result = &result;
+    params.argument = patientID;
+
+    if (context->InvokeService(context, _OrthancPluginService_LookupPatient, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Look for a study.
+   *
+   * Look for a study stored in Orthanc, using its Study Instance UID tag (0x0020, 0x000d).
+   * This function uses the database index to run as fast as possible (it does not loop
+   * over all the stored studies).
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param studyUID The Study Instance UID of interest.
+   * @return The NULL value if the study is non-existent, or a string containing the 
+   * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString().
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudy(
+    OrthancPluginContext*  context,
+    const char*            studyUID)
+  {
+    char* result;
+
+    _OrthancPluginRetrieveDynamicString params;
+    params.result = &result;
+    params.argument = studyUID;
+
+    if (context->InvokeService(context, _OrthancPluginService_LookupStudy, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Look for a study, using the accession number.
+   *
+   * Look for a study stored in Orthanc, using its Accession Number tag (0x0008, 0x0050).
+   * This function uses the database index to run as fast as possible (it does not loop
+   * over all the stored studies).
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param accessionNumber The Accession Number of interest.
+   * @return The NULL value if the study is non-existent, or a string containing the 
+   * Orthanc ID of the study. This string must be freed by OrthancPluginFreeString().
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupStudyWithAccessionNumber(
+    OrthancPluginContext*  context,
+    const char*            accessionNumber)
+  {
+    char* result;
+
+    _OrthancPluginRetrieveDynamicString params;
+    params.result = &result;
+    params.argument = accessionNumber;
+
+    if (context->InvokeService(context, _OrthancPluginService_LookupStudyWithAccessionNumber, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Look for a series.
+   *
+   * Look for a series stored in Orthanc, using its Series Instance UID tag (0x0020, 0x000e).
+   * This function uses the database index to run as fast as possible (it does not loop
+   * over all the stored series).
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param seriesUID The Series Instance UID of interest.
+   * @return The NULL value if the series is non-existent, or a string containing the 
+   * Orthanc ID of the series. This string must be freed by OrthancPluginFreeString().
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupSeries(
+    OrthancPluginContext*  context,
+    const char*            seriesUID)
+  {
+    char* result;
+
+    _OrthancPluginRetrieveDynamicString params;
+    params.result = &result;
+    params.argument = seriesUID;
+
+    if (context->InvokeService(context, _OrthancPluginService_LookupSeries, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Look for an instance.
+   *
+   * Look for an instance stored in Orthanc, using its SOP Instance UID tag (0x0008, 0x0018).
+   * This function uses the database index to run as fast as possible (it does not loop
+   * over all the stored instances).
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param sopInstanceUID The SOP Instance UID of interest.
+   * @return The NULL value if the instance is non-existent, or a string containing the 
+   * Orthanc ID of the instance. This string must be freed by OrthancPluginFreeString().
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginLookupInstance(
+    OrthancPluginContext*  context,
+    const char*            sopInstanceUID)
+  {
+    char* result;
+
+    _OrthancPluginRetrieveDynamicString params;
+    params.result = &result;
+    params.argument = sopInstanceUID;
+
+    if (context->InvokeService(context, _OrthancPluginService_LookupInstance, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginRestOutput* output;
+    uint16_t                 status;
+  } _OrthancPluginSendHttpStatusCode;
+
+  /**
+   * @brief Send a HTTP status code.
+   *
+   * This function answers to a REST request by sending a HTTP status
+   * code (such as "400 - Bad Request"). Note that:
+   * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer().
+   * - Redirections (status 301) must use ::OrthancPluginRedirect().
+   * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized().
+   * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed().
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param output The HTTP connection to the client application.
+   * @param status The HTTP status code to be sent.
+   * @ingroup REST
+   * @see OrthancPluginSendHttpStatus()
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatusCode(
+    OrthancPluginContext*    context,
+    OrthancPluginRestOutput* output,
+    uint16_t                 status)
+  {
+    _OrthancPluginSendHttpStatusCode params;
+    params.output = output;
+    params.status = status;
+    context->InvokeService(context, _OrthancPluginService_SendHttpStatusCode, &params);
+  }
+
+
+  /**
+   * @brief Signal that a REST request is not authorized.
+   *
+   * This function answers to a REST request by signaling that it is
+   * not authorized.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param output The HTTP connection to the client application.
+   * @param realm The realm for the authorization process.
+   * @ingroup REST
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginSendUnauthorized(
+    OrthancPluginContext*    context,
+    OrthancPluginRestOutput* output,
+    const char*              realm)
+  {
+    _OrthancPluginOutputPlusArgument params;
+    params.output = output;
+    params.argument = realm;
+    context->InvokeService(context, _OrthancPluginService_SendUnauthorized, &params);
+  }
+
+
+  /**
+   * @brief Signal that this URI does not support this HTTP method.
+   *
+   * This function answers to a REST request by signaling that the
+   * queried URI does not support this method.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param output The HTTP connection to the client application.
+   * @param allowedMethods The allowed methods for this URI (e.g. "GET,POST" after a PUT or a POST request).
+   * @ingroup REST
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginSendMethodNotAllowed(
+    OrthancPluginContext*    context,
+    OrthancPluginRestOutput* output,
+    const char*              allowedMethods)
+  {
+    _OrthancPluginOutputPlusArgument params;
+    params.output = output;
+    params.argument = allowedMethods;
+    context->InvokeService(context, _OrthancPluginService_SendMethodNotAllowed, &params);
+  }
+
+
+  typedef struct
+  {
+    OrthancPluginRestOutput* output;
+    const char*              key;
+    const char*              value;
+  } _OrthancPluginSetHttpHeader;
+
+  /**
+   * @brief Set a cookie.
+   *
+   * This function sets a cookie in the HTTP client.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param output The HTTP connection to the client application.
+   * @param cookie The cookie to be set.
+   * @param value The value of the cookie.
+   * @ingroup REST
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginSetCookie(
+    OrthancPluginContext*    context,
+    OrthancPluginRestOutput* output,
+    const char*              cookie,
+    const char*              value)
+  {
+    _OrthancPluginSetHttpHeader params;
+    params.output = output;
+    params.key = cookie;
+    params.value = value;
+    context->InvokeService(context, _OrthancPluginService_SetCookie, &params);
+  }
+
+
+  /**
+   * @brief Set some HTTP header.
+   *
+   * This function sets a HTTP header in the HTTP answer.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param output The HTTP connection to the client application.
+   * @param key The HTTP header to be set.
+   * @param value The value of the HTTP header.
+   * @ingroup REST
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpHeader(
+    OrthancPluginContext*    context,
+    OrthancPluginRestOutput* output,
+    const char*              key,
+    const char*              value)
+  {
+    _OrthancPluginSetHttpHeader params;
+    params.output = output;
+    params.key = key;
+    params.value = value;
+    context->InvokeService(context, _OrthancPluginService_SetHttpHeader, &params);
+  }
+
+
+  typedef struct
+  {
+    char**                             resultStringToFree;
+    const char**                       resultString;
+    int64_t*                           resultInt64;
+    const char*                        key;
+    const OrthancPluginDicomInstance*  instance;
+    OrthancPluginInstanceOrigin*       resultOrigin;   /* New in Orthanc 0.9.5 SDK */
+  } _OrthancPluginAccessDicomInstance;
+
+
+  /**
+   * @brief Get the AET of a DICOM instance.
+   *
+   * This function returns the Application Entity Title (AET) of the
+   * DICOM modality from which a DICOM instance originates.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param instance The instance of interest.
+   * @return The AET if success, NULL if error.
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceRemoteAet(
+    OrthancPluginContext*              context,
+    const OrthancPluginDicomInstance*  instance)
+  {
+    const char* result;
+
+    _OrthancPluginAccessDicomInstance params;
+    memset(&params, 0, sizeof(params));
+    params.resultString = &result;
+    params.instance = instance;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetInstanceRemoteAet, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Get the size of a DICOM file.
+   *
+   * This function returns the number of bytes of the given DICOM instance.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param instance The instance of interest.
+   * @return The size of the file, -1 in case of error.
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE int64_t OrthancPluginGetInstanceSize(
+    OrthancPluginContext*             context,
+    const OrthancPluginDicomInstance* instance)
+  {
+    int64_t size;
+
+    _OrthancPluginAccessDicomInstance params;
+    memset(&params, 0, sizeof(params));
+    params.resultInt64 = &size;
+    params.instance = instance;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetInstanceSize, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return -1;
+    }
+    else
+    {
+      return size;
+    }
+  }
+
+
+  /**
+   * @brief Get the data of a DICOM file.
+   *
+   * This function returns a pointer to the content of the given DICOM instance.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param instance The instance of interest.
+   * @return The pointer to the DICOM data, NULL in case of error.
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE const void* OrthancPluginGetInstanceData(
+    OrthancPluginContext*              context,
+    const OrthancPluginDicomInstance*  instance)
+  {
+    const char* result;
+
+    _OrthancPluginAccessDicomInstance params;
+    memset(&params, 0, sizeof(params));
+    params.resultString = &result;
+    params.instance = instance;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetInstanceData, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Get the DICOM tag hierarchy as a JSON file.
+   *
+   * This function returns a pointer to a newly created string
+   * containing a JSON file. This JSON file encodes the tag hierarchy
+   * of the given DICOM instance.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param instance The instance of interest.
+   * @return The NULL value in case of error, or a string containing the JSON file.
+   * This string must be freed by OrthancPluginFreeString().
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceJson(
+    OrthancPluginContext*              context,
+    const OrthancPluginDicomInstance*  instance)
+  {
+    char* result;
+
+    _OrthancPluginAccessDicomInstance params;
+    memset(&params, 0, sizeof(params));
+    params.resultStringToFree = &result;
+    params.instance = instance;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetInstanceJson, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Get the DICOM tag hierarchy as a JSON file (with simplification).
+   *
+   * This function returns a pointer to a newly created string
+   * containing a JSON file. This JSON file encodes the tag hierarchy
+   * of the given DICOM instance. In contrast with
+   * ::OrthancPluginGetInstanceJson(), the returned JSON file is in
+   * its simplified version.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param instance The instance of interest.
+   * @return The NULL value in case of error, or a string containing the JSON file.
+   * This string must be freed by OrthancPluginFreeString().
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceSimplifiedJson(
+    OrthancPluginContext*              context,
+    const OrthancPluginDicomInstance*  instance)
+  {
+    char* result;
+
+    _OrthancPluginAccessDicomInstance params;
+    memset(&params, 0, sizeof(params));
+    params.resultStringToFree = &result;
+    params.instance = instance;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetInstanceSimplifiedJson, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Check whether a DICOM instance is associated with some metadata.
+   *
+   * This function checks whether the DICOM instance of interest is
+   * associated with some metadata. As of Orthanc 0.8.1, in the
+   * callbacks registered by
+   * ::OrthancPluginRegisterOnStoredInstanceCallback(), the only
+   * possibly available metadata are "ReceptionDate", "RemoteAET" and
+   * "IndexInSeries".
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param instance The instance of interest.
+   * @param metadata The metadata of interest.
+   * @return 1 if the metadata is present, 0 if it is absent, -1 in case of error.
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE int32_t  OrthancPluginHasInstanceMetadata(
+    OrthancPluginContext*              context,
+    const OrthancPluginDicomInstance*  instance,
+    const char*                        metadata)
+  {
+    int64_t result;
+
+    _OrthancPluginAccessDicomInstance params;
+    memset(&params, 0, sizeof(params));
+    params.resultInt64 = &result;
+    params.instance = instance;
+    params.key = metadata;
+
+    if (context->InvokeService(context, _OrthancPluginService_HasInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return -1;
+    }
+    else
+    {
+      return (result != 0);
+    }
+  }
+
+
+  /**
+   * @brief Get the value of some metadata associated with a given DICOM instance.
+   *
+   * This functions returns the value of some metadata that is associated with the DICOM instance of interest.
+   * Before calling this function, the existence of the metadata must have been checked with
+   * ::OrthancPluginHasInstanceMetadata().
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param instance The instance of interest.
+   * @param metadata The metadata of interest.
+   * @return The metadata value if success, NULL if error. Please note that the 
+   *         returned string belongs to the instance object and must NOT be 
+   *         deallocated. Please make a copy of the string if you wish to access 
+   *         it later.
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetInstanceMetadata(
+    OrthancPluginContext*              context,
+    const OrthancPluginDicomInstance*  instance,
+    const char*                        metadata)
+  {
+    const char* result;
+
+    _OrthancPluginAccessDicomInstance params;
+    memset(&params, 0, sizeof(params));
+    params.resultString = &result;
+    params.instance = instance;
+    params.key = metadata;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetInstanceMetadata, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginStorageCreate  create;
+    OrthancPluginStorageRead    read;
+    OrthancPluginStorageRemove  remove;
+    OrthancPluginFree           free;
+  } _OrthancPluginRegisterStorageArea;
+
+  /**
+   * @brief Register a custom storage area.
+   *
+   * This function registers a custom storage area, to replace the
+   * built-in way Orthanc stores its files on the filesystem. This
+   * function must be called during the initialization of the plugin,
+   * i.e. inside the OrthancPluginInitialize() public function.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param create The callback function to store a file on the custom storage area.
+   * @param read The callback function to read a file from the custom storage area.
+   * @param remove The callback function to remove a file from the custom storage area.
+   * @ingroup Callbacks
+   * @deprecated Please use OrthancPluginRegisterStorageArea2()
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea(
+    OrthancPluginContext*       context,
+    OrthancPluginStorageCreate  create,
+    OrthancPluginStorageRead    read,
+    OrthancPluginStorageRemove  remove)
+  {
+    _OrthancPluginRegisterStorageArea params;
+    params.create = create;
+    params.read = read;
+    params.remove = remove;
+
+#ifdef  __cplusplus
+    params.free = ::free;
+#else
+    params.free = free;
+#endif
+
+    context->InvokeService(context, _OrthancPluginService_RegisterStorageArea, &params);
+  }
+
+
+
+  /**
+   * @brief Return the path to the Orthanc executable.
+   *
+   * This function returns the path to the Orthanc executable.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @return NULL in the case of an error, or a newly allocated string
+   * containing the path. This string must be freed by
+   * OrthancPluginFreeString().
+   **/
+  ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancPath(OrthancPluginContext* context)
+  {
+    char* result;
+
+    _OrthancPluginRetrieveDynamicString params;
+    params.result = &result;
+    params.argument = NULL;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetOrthancPath, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Return the directory containing the Orthanc.
+   *
+   * This function returns the path to the directory containing the Orthanc executable.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @return NULL in the case of an error, or a newly allocated string
+   * containing the path. This string must be freed by
+   * OrthancPluginFreeString().
+   **/
+  ORTHANC_PLUGIN_INLINE char *OrthancPluginGetOrthancDirectory(OrthancPluginContext* context)
+  {
+    char* result;
+
+    _OrthancPluginRetrieveDynamicString params;
+    params.result = &result;
+    params.argument = NULL;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetOrthancDirectory, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Return the path to the configuration file(s).
+   *
+   * This function returns the path to the configuration file(s) that
+   * was specified when starting Orthanc. Since version 0.9.1, this
+   * path can refer to a folder that stores a set of configuration
+   * files. This function is deprecated in favor of
+   * OrthancPluginGetConfiguration().
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @return NULL in the case of an error, or a newly allocated string
+   * containing the path. This string must be freed by
+   * OrthancPluginFreeString().
+   * @see OrthancPluginGetConfiguration()
+   **/
+  ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfigurationPath(OrthancPluginContext* context)
+  {
+    char* result;
+
+    _OrthancPluginRetrieveDynamicString params;
+    params.result = &result;
+    params.argument = NULL;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetConfigurationPath, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginOnChangeCallback callback;
+  } _OrthancPluginOnChangeCallback;
+
+  /**
+   * @brief Register a callback to monitor changes.
+   *
+   * This function registers a callback function that is called
+   * whenever a change happens to some DICOM resource.
+   *
+   * @warning Your callback function will be called synchronously with
+   * the core of Orthanc. This implies that deadlocks might emerge if
+   * you call other core primitives of Orthanc in your callback (such
+   * deadlocks are particularly visible in the presence of other plugins
+   * or Lua scripts). It is thus strongly advised to avoid any call to
+   * the REST API of Orthanc in the callback. If you have to call
+   * other primitives of Orthanc, you should make these calls in a
+   * separate thread, passing the pending events to be processed
+   * through a message queue.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param callback The callback function.
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterOnChangeCallback(
+    OrthancPluginContext*          context,
+    OrthancPluginOnChangeCallback  callback)
+  {
+    _OrthancPluginOnChangeCallback params;
+    params.callback = callback;
+
+    context->InvokeService(context, _OrthancPluginService_RegisterOnChangeCallback, &params);
+  }
+
+
+
+  typedef struct
+  {
+    const char* plugin;
+    _OrthancPluginProperty property;
+    const char* value;
+  } _OrthancPluginSetPluginProperty;
+
+
+  /**
+   * @brief Set the URI where the plugin provides its Web interface.
+   *
+   * For plugins that come with a Web interface, this function
+   * declares the entry path where to find this interface. This
+   * information is notably used in the "Plugins" page of Orthanc
+   * Explorer.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param uri The root URI for this plugin.
+   **/ 
+  ORTHANC_PLUGIN_INLINE void OrthancPluginSetRootUri(
+    OrthancPluginContext*  context,
+    const char*            uri)
+  {
+    _OrthancPluginSetPluginProperty params;
+    params.plugin = OrthancPluginGetName();
+    params.property = _OrthancPluginProperty_RootUri;
+    params.value = uri;
+
+    context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
+  }
+
+
+  /**
+   * @brief Set a description for this plugin.
+   *
+   * Set a description for this plugin. It is displayed in the
+   * "Plugins" page of Orthanc Explorer.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param description The description.
+   **/ 
+  ORTHANC_PLUGIN_INLINE void OrthancPluginSetDescription(
+    OrthancPluginContext*  context,
+    const char*            description)
+  {
+    _OrthancPluginSetPluginProperty params;
+    params.plugin = OrthancPluginGetName();
+    params.property = _OrthancPluginProperty_Description;
+    params.value = description;
+
+    context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
+  }
+
+
+  /**
+   * @brief Extend the JavaScript code of Orthanc Explorer.
+   *
+   * Add JavaScript code to customize the default behavior of Orthanc
+   * Explorer. This can for instance be used to add new buttons.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param javascript The custom JavaScript code.
+   **/ 
+  ORTHANC_PLUGIN_INLINE void OrthancPluginExtendOrthancExplorer(
+    OrthancPluginContext*  context,
+    const char*            javascript)
+  {
+    _OrthancPluginSetPluginProperty params;
+    params.plugin = OrthancPluginGetName();
+    params.property = _OrthancPluginProperty_OrthancExplorer;
+    params.value = javascript;
+
+    context->InvokeService(context, _OrthancPluginService_SetPluginProperty, &params);
+  }
+
+
+  typedef struct
+  {
+    char**       result;
+    int32_t      property;
+    const char*  value;
+  } _OrthancPluginGlobalProperty;
+
+
+  /**
+   * @brief Get the value of a global property.
+   *
+   * Get the value of a global property that is stored in the Orthanc database. Global
+   * properties whose index is below 1024 are reserved by Orthanc.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param property The global property of interest.
+   * @param defaultValue The value to return, if the global property is unset.
+   * @return The value of the global property, or NULL in the case of an error. This
+   * string must be freed by OrthancPluginFreeString().
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetGlobalProperty(
+    OrthancPluginContext*  context,
+    int32_t                property,
+    const char*            defaultValue)
+  {
+    char* result;
+
+    _OrthancPluginGlobalProperty params;
+    params.result = &result;
+    params.property = property;
+    params.value = defaultValue;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetGlobalProperty, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Set the value of a global property.
+   *
+   * Set the value of a global property into the Orthanc
+   * database. Setting a global property can be used by plugins to
+   * save their internal parameters. Plugins are only allowed to set
+   * properties whose index are above or equal to 1024 (properties
+   * below 1024 are read-only and reserved by Orthanc).
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param property The global property of interest.
+   * @param value The value to be set in the global property.
+   * @return 0 if success, or the error code if failure.
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSetGlobalProperty(
+    OrthancPluginContext*  context,
+    int32_t                property,
+    const char*            value)
+  {
+    _OrthancPluginGlobalProperty params;
+    params.result = NULL;
+    params.property = property;
+    params.value = value;
+
+    return context->InvokeService(context, _OrthancPluginService_SetGlobalProperty, &params);
+  }
+
+
+
+  typedef struct
+  {
+    int32_t   *resultInt32;
+    uint32_t  *resultUint32;
+    int64_t   *resultInt64;
+    uint64_t  *resultUint64;
+  } _OrthancPluginReturnSingleValue;
+
+  /**
+   * @brief Get the number of command-line arguments.
+   *
+   * Retrieve the number of command-line arguments that were used to launch Orthanc.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @return The number of arguments.
+   **/
+  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetCommandLineArgumentsCount(
+    OrthancPluginContext*  context)
+  {
+    uint32_t count = 0;
+
+    _OrthancPluginReturnSingleValue params;
+    memset(&params, 0, sizeof(params));
+    params.resultUint32 = &count;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgumentsCount, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return 0;
+    }
+    else
+    {
+      return count;
+    }
+  }
+
+
+
+  /**
+   * @brief Get the value of a command-line argument.
+   *
+   * Get the value of one of the command-line arguments that were used
+   * to launch Orthanc. The number of available arguments can be
+   * retrieved by OrthancPluginGetCommandLineArgumentsCount().
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param argument The index of the argument.
+   * @return The value of the argument, or NULL in the case of an error. This
+   * string must be freed by OrthancPluginFreeString().
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetCommandLineArgument(
+    OrthancPluginContext*  context,
+    uint32_t               argument)
+  {
+    char* result;
+
+    _OrthancPluginGlobalProperty params;
+    params.result = &result;
+    params.property = (int32_t) argument;
+    params.value = NULL;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetCommandLineArgument, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @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.
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetExpectedDatabaseVersion(
+    OrthancPluginContext*  context)
+  {
+    uint32_t count = 0;
+
+    _OrthancPluginReturnSingleValue params;
+    memset(&params, 0, sizeof(params));
+    params.resultUint32 = &count;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetExpectedDatabaseVersion, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return 0;
+    }
+    else
+    {
+      return count;
+    }
+  }
+
+
+
+  /**
+   * @brief Return the content of the configuration file(s).
+   *
+   * This function returns the content of the configuration that is
+   * used by Orthanc, formatted as a JSON string.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @return NULL in the case of an error, or a newly allocated string
+   * containing the configuration. This string must be freed by
+   * OrthancPluginFreeString().
+   **/
+  ORTHANC_PLUGIN_INLINE char *OrthancPluginGetConfiguration(OrthancPluginContext* context)
+  {
+    char* result;
+
+    _OrthancPluginRetrieveDynamicString params;
+    params.result = &result;
+    params.argument = NULL;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetConfiguration, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginRestOutput* output;
+    const char*              subType;
+    const char*              contentType;
+  } _OrthancPluginStartMultipartAnswer;
+
+  /**
+   * @brief Start an HTTP multipart answer.
+   *
+   * Initiates a HTTP multipart answer, as the result of a REST request.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param output The HTTP connection to the client application.
+   * @param subType The sub-type of the multipart answer ("mixed" or "related").
+   * @param contentType The MIME type of the items in the multipart answer.
+   * @return 0 if success, or the error code if failure.
+   * @see OrthancPluginSendMultipartItem(), OrthancPluginSendMultipartItem2()
+   * @ingroup REST
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginStartMultipartAnswer(
+    OrthancPluginContext*    context,
+    OrthancPluginRestOutput* output,
+    const char*              subType,
+    const char*              contentType)
+  {
+    _OrthancPluginStartMultipartAnswer params;
+    params.output = output;
+    params.subType = subType;
+    params.contentType = contentType;
+    return context->InvokeService(context, _OrthancPluginService_StartMultipartAnswer, &params);
+  }
+
+
+  /**
+   * @brief Send an item as a part of some HTTP multipart answer.
+   *
+   * This function sends an item as a part of some HTTP multipart
+   * answer that was initiated by OrthancPluginStartMultipartAnswer().
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param output The HTTP connection to the client application.
+   * @param answer Pointer to the memory buffer containing the item.
+   * @param answerSize Number of bytes of the item.
+   * @return 0 if success, or the error code if failure (this notably happens
+   * if the connection is closed by the client).
+   * @see OrthancPluginSendMultipartItem2()
+   * @ingroup REST
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem(
+    OrthancPluginContext*    context,
+    OrthancPluginRestOutput* output,
+    const void*              answer,
+    uint32_t                 answerSize)
+  {
+    _OrthancPluginAnswerBuffer params;
+    params.output = output;
+    params.answer = answer;
+    params.answerSize = answerSize;
+    params.mimeType = NULL;
+    return context->InvokeService(context, _OrthancPluginService_SendMultipartItem, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginMemoryBuffer*    target;
+    const void*                   source;
+    uint32_t                      size;
+    OrthancPluginCompressionType  compression;
+    uint8_t                       uncompress;
+  } _OrthancPluginBufferCompression;
+
+
+  /**
+   * @brief Compress or decompress a buffer.
+   *
+   * This function compresses or decompresses a buffer, using the
+   * version of the zlib library that is used by the Orthanc core.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param source The source buffer.
+   * @param size The size in bytes of the source buffer.
+   * @param compression The compression algorithm.
+   * @param uncompress If set to "0", the buffer must be compressed. 
+   * If set to "1", the buffer must be uncompressed.
+   * @return 0 if success, or the error code if failure.
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginBufferCompression(
+    OrthancPluginContext*         context,
+    OrthancPluginMemoryBuffer*    target,
+    const void*                   source,
+    uint32_t                      size,
+    OrthancPluginCompressionType  compression,
+    uint8_t                       uncompress)
+  {
+    _OrthancPluginBufferCompression params;
+    params.target = target;
+    params.source = source;
+    params.size = size;
+    params.compression = compression;
+    params.uncompress = uncompress;
+
+    return context->InvokeService(context, _OrthancPluginService_BufferCompression, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginMemoryBuffer*  target;
+    const char*                 path;
+  } _OrthancPluginReadFile;
+
+  /**
+   * @brief Read a file.
+   * 
+   * Read the content of a file on the filesystem, and returns it into
+   * a newly allocated memory buffer.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param path The path of the file to be read.
+   * @return 0 if success, or the error code if failure.
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginReadFile(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  target,
+    const char*                 path)
+  {
+    _OrthancPluginReadFile params;
+    params.target = target;
+    params.path = path;
+    return context->InvokeService(context, _OrthancPluginService_ReadFile, &params);
+  }
+
+
+
+  typedef struct
+  {
+    const char*  path;
+    const void*  data;
+    uint32_t     size;
+  } _OrthancPluginWriteFile;
+
+  /**
+   * @brief Write a file.
+   * 
+   * Write the content of a memory buffer to the filesystem.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param path The path of the file to be written.
+   * @param data The content of the memory buffer.
+   * @param size The size of the memory buffer.
+   * @return 0 if success, or the error code if failure.
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginWriteFile(
+    OrthancPluginContext*  context,
+    const char*            path,
+    const void*            data,
+    uint32_t               size)
+  {
+    _OrthancPluginWriteFile params;
+    params.path = path;
+    params.data = data;
+    params.size = size;
+    return context->InvokeService(context, _OrthancPluginService_WriteFile, &params);
+  }
+
+
+
+  typedef struct
+  {
+    const char**            target;
+    OrthancPluginErrorCode  error;
+  } _OrthancPluginGetErrorDescription;
+
+  /**
+   * @brief Get the description of a given error code.
+   *
+   * This function returns the description of a given error code.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param error The error code of interest.
+   * @return The error description. This is a statically-allocated
+   * string, do not free it.
+   **/
+  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetErrorDescription(
+    OrthancPluginContext*    context,
+    OrthancPluginErrorCode   error)
+  {
+    const char* result = NULL;
+
+    _OrthancPluginGetErrorDescription params;
+    params.target = &result;
+    params.error = error;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetErrorDescription, &params) != OrthancPluginErrorCode_Success ||
+        result == NULL)
+    {
+      return "Unknown error code";
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginRestOutput* output;
+    uint16_t                 status;
+    const char*              body;
+    uint32_t                 bodySize;
+  } _OrthancPluginSendHttpStatus;
+
+  /**
+   * @brief Send a HTTP status, with a custom body.
+   *
+   * This function answers to a HTTP request by sending a HTTP status
+   * code (such as "400 - Bad Request"), together with a body
+   * describing the error. The body will only be returned if the
+   * configuration option "HttpDescribeErrors" of Orthanc is set to "true".
+   * 
+   * Note that:
+   * - Successful requests (status 200) must use ::OrthancPluginAnswerBuffer().
+   * - Redirections (status 301) must use ::OrthancPluginRedirect().
+   * - Unauthorized access (status 401) must use ::OrthancPluginSendUnauthorized().
+   * - Methods not allowed (status 405) must use ::OrthancPluginSendMethodNotAllowed().
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param output The HTTP connection to the client application.
+   * @param status The HTTP status code to be sent.
+   * @param body The body of the answer.
+   * @param bodySize The size of the body.
+   * @see OrthancPluginSendHttpStatusCode()
+   * @ingroup REST
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginSendHttpStatus(
+    OrthancPluginContext*    context,
+    OrthancPluginRestOutput* output,
+    uint16_t                 status,
+    const void*              body,
+    uint32_t                 bodySize)
+  {
+    _OrthancPluginSendHttpStatus params;
+    params.output = output;
+    params.status = status;
+    params.body = reinterpret_cast<const char*>(body);
+    params.bodySize = bodySize;
+    context->InvokeService(context, _OrthancPluginService_SendHttpStatus, &params);
+  }
+
+
+
+  typedef struct
+  {
+    const OrthancPluginImage*  image;
+    uint32_t*                  resultUint32;
+    OrthancPluginPixelFormat*  resultPixelFormat;
+    void**                     resultBuffer;
+  } _OrthancPluginGetImageInfo;
+
+
+  /**
+   * @brief Return the pixel format of an image.
+   *
+   * This function returns the type of memory layout for the pixels of the given image.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param image The image of interest.
+   * @return The pixel format.
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginPixelFormat  OrthancPluginGetImagePixelFormat(
+    OrthancPluginContext*      context,
+    const OrthancPluginImage*  image)
+  {
+    OrthancPluginPixelFormat target;
+    
+    _OrthancPluginGetImageInfo params;
+    memset(&params, 0, sizeof(params));
+    params.image = image;
+    params.resultPixelFormat = &target;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetImagePixelFormat, &params) != OrthancPluginErrorCode_Success)
+    {
+      return OrthancPluginPixelFormat_Unknown;
+    }
+    else
+    {
+      return (OrthancPluginPixelFormat) target;
+    }
+  }
+
+
+
+  /**
+   * @brief Return the width of an image.
+   *
+   * This function returns the width of the given image.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param image The image of interest.
+   * @return The width.
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE uint32_t  OrthancPluginGetImageWidth(
+    OrthancPluginContext*      context,
+    const OrthancPluginImage*  image)
+  {
+    uint32_t width;
+    
+    _OrthancPluginGetImageInfo params;
+    memset(&params, 0, sizeof(params));
+    params.image = image;
+    params.resultUint32 = &width;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetImageWidth, &params) != OrthancPluginErrorCode_Success)
+    {
+      return 0;
+    }
+    else
+    {
+      return width;
+    }
+  }
+
+
+
+  /**
+   * @brief Return the height of an image.
+   *
+   * This function returns the height of the given image.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param image The image of interest.
+   * @return The height.
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE uint32_t  OrthancPluginGetImageHeight(
+    OrthancPluginContext*      context,
+    const OrthancPluginImage*  image)
+  {
+    uint32_t height;
+    
+    _OrthancPluginGetImageInfo params;
+    memset(&params, 0, sizeof(params));
+    params.image = image;
+    params.resultUint32 = &height;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetImageHeight, &params) != OrthancPluginErrorCode_Success)
+    {
+      return 0;
+    }
+    else
+    {
+      return height;
+    }
+  }
+
+
+
+  /**
+   * @brief Return the pitch of an image.
+   *
+   * This function returns the pitch of the given image. The pitch is
+   * defined as the number of bytes between 2 successive lines of the
+   * image in the memory buffer.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param image The image of interest.
+   * @return The pitch.
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE uint32_t  OrthancPluginGetImagePitch(
+    OrthancPluginContext*      context,
+    const OrthancPluginImage*  image)
+  {
+    uint32_t pitch;
+    
+    _OrthancPluginGetImageInfo params;
+    memset(&params, 0, sizeof(params));
+    params.image = image;
+    params.resultUint32 = &pitch;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetImagePitch, &params) != OrthancPluginErrorCode_Success)
+    {
+      return 0;
+    }
+    else
+    {
+      return pitch;
+    }
+  }
+
+
+
+  /**
+   * @brief Return a pointer to the content of an image.
+   *
+   * This function returns a pointer to the memory buffer that
+   * contains the pixels of the image.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param image The image of interest.
+   * @return The pointer.
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE void*  OrthancPluginGetImageBuffer(
+    OrthancPluginContext*      context,
+    const OrthancPluginImage*  image)
+  {
+    void* target = NULL;
+
+    _OrthancPluginGetImageInfo params;
+    memset(&params, 0, sizeof(params));
+    params.resultBuffer = &target;
+    params.image = image;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetImageBuffer, &params) != OrthancPluginErrorCode_Success)
+    {
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+
+  typedef struct
+  {
+    OrthancPluginImage**       target;
+    const void*                data;
+    uint32_t                   size;
+    OrthancPluginImageFormat   format;
+  } _OrthancPluginUncompressImage;
+
+
+  /**
+   * @brief Decode a compressed image.
+   *
+   * This function decodes a compressed image from a memory buffer.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param data Pointer to a memory buffer containing the compressed image.
+   * @param size Size of the memory buffer containing the compressed image.
+   * @param format The file format of the compressed image.
+   * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginUncompressImage(
+    OrthancPluginContext*      context,
+    const void*                data,
+    uint32_t                   size,
+    OrthancPluginImageFormat   format)
+  {
+    OrthancPluginImage* target = NULL;
+
+    _OrthancPluginUncompressImage params;
+    memset(&params, 0, sizeof(params));
+    params.target = &target;
+    params.data = data;
+    params.size = size;
+    params.format = format;
+
+    if (context->InvokeService(context, _OrthancPluginService_UncompressImage, &params) != OrthancPluginErrorCode_Success)
+    {
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+
+
+
+  typedef struct
+  {
+    OrthancPluginImage*   image;
+  } _OrthancPluginFreeImage;
+
+  /**
+   * @brief Free an image.
+   *
+   * This function frees an image that was decoded with OrthancPluginUncompressImage().
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param image The image.
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE void  OrthancPluginFreeImage(
+    OrthancPluginContext* context, 
+    OrthancPluginImage*   image)
+  {
+    _OrthancPluginFreeImage params;
+    params.image = image;
+
+    context->InvokeService(context, _OrthancPluginService_FreeImage, &params);
+  }
+
+
+
+
+  typedef struct
+  {
+    OrthancPluginMemoryBuffer* target;
+    OrthancPluginImageFormat   imageFormat;
+    OrthancPluginPixelFormat   pixelFormat;
+    uint32_t                   width;
+    uint32_t                   height;
+    uint32_t                   pitch;
+    const void*                buffer;
+    uint8_t                    quality;
+  } _OrthancPluginCompressImage;
+
+
+  /**
+   * @brief Encode a PNG image.
+   *
+   * This function compresses the given memory buffer containing an
+   * image using the PNG specification, and stores the result of the
+   * compression into a newly allocated memory buffer.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param format The memory layout of the uncompressed image.
+   * @param width The width of the image.
+   * @param height The height of the image.
+   * @param pitch The pitch of the image (i.e. the number of bytes
+   * between 2 successive lines of the image in the memory buffer).
+   * @param buffer The memory buffer containing the uncompressed image.
+   * @return 0 if success, or the error code if failure.
+   * @see OrthancPluginCompressAndAnswerPngImage()
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressPngImage(
+    OrthancPluginContext*         context,
+    OrthancPluginMemoryBuffer*    target,
+    OrthancPluginPixelFormat      format,
+    uint32_t                      width,
+    uint32_t                      height,
+    uint32_t                      pitch,
+    const void*                   buffer)
+  {
+    _OrthancPluginCompressImage params;
+    memset(&params, 0, sizeof(params));
+    params.target = target;
+    params.imageFormat = OrthancPluginImageFormat_Png;
+    params.pixelFormat = format;
+    params.width = width;
+    params.height = height;
+    params.pitch = pitch;
+    params.buffer = buffer;
+    params.quality = 0;  /* Unused for PNG */
+
+    return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
+  }
+
+
+  /**
+   * @brief Encode a JPEG image.
+   *
+   * This function compresses the given memory buffer containing an
+   * image using the JPEG specification, and stores the result of the
+   * compression into a newly allocated memory buffer.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param format The memory layout of the uncompressed image.
+   * @param width The width of the image.
+   * @param height The height of the image.
+   * @param pitch The pitch of the image (i.e. the number of bytes
+   * between 2 successive lines of the image in the memory buffer).
+   * @param buffer The memory buffer containing the uncompressed image.
+   * @param quality The quality of the JPEG encoding, between 1 (worst
+   * quality, best compression) and 100 (best quality, worst
+   * compression).
+   * @return 0 if success, or the error code if failure.
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCompressJpegImage(
+    OrthancPluginContext*         context,
+    OrthancPluginMemoryBuffer*    target,
+    OrthancPluginPixelFormat      format,
+    uint32_t                      width,
+    uint32_t                      height,
+    uint32_t                      pitch,
+    const void*                   buffer,
+    uint8_t                       quality)
+  {
+    _OrthancPluginCompressImage params;
+    memset(&params, 0, sizeof(params));
+    params.target = target;
+    params.imageFormat = OrthancPluginImageFormat_Jpeg;
+    params.pixelFormat = format;
+    params.width = width;
+    params.height = height;
+    params.pitch = pitch;
+    params.buffer = buffer;
+    params.quality = quality;
+
+    return context->InvokeService(context, _OrthancPluginService_CompressImage, &params);
+  }
+
+
+
+  /**
+   * @brief Answer to a REST request with a JPEG image.
+   *
+   * This function answers to a REST request with a JPEG image. The
+   * parameters of this function describe a memory buffer that
+   * contains an uncompressed image. The image will be automatically compressed
+   * as a JPEG image by the core system of Orthanc.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param output The HTTP connection to the client application.
+   * @param format The memory layout of the uncompressed image.
+   * @param width The width of the image.
+   * @param height The height of the image.
+   * @param pitch The pitch of the image (i.e. the number of bytes
+   * between 2 successive lines of the image in the memory buffer).
+   * @param buffer The memory buffer containing the uncompressed image.
+   * @param quality The quality of the JPEG encoding, between 1 (worst
+   * quality, best compression) and 100 (best quality, worst
+   * compression).
+   * @ingroup REST
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginCompressAndAnswerJpegImage(
+    OrthancPluginContext*     context,
+    OrthancPluginRestOutput*  output,
+    OrthancPluginPixelFormat  format,
+    uint32_t                  width,
+    uint32_t                  height,
+    uint32_t                  pitch,
+    const void*               buffer,
+    uint8_t                   quality)
+  {
+    _OrthancPluginCompressAndAnswerImage params;
+    params.output = output;
+    params.imageFormat = OrthancPluginImageFormat_Jpeg;
+    params.pixelFormat = format;
+    params.width = width;
+    params.height = height;
+    params.pitch = pitch;
+    params.buffer = buffer;
+    params.quality = quality;
+    context->InvokeService(context, _OrthancPluginService_CompressAndAnswerImage, &params);
+  }
+
+
+
+
+  typedef struct
+  {
+    OrthancPluginMemoryBuffer*  target;
+    OrthancPluginHttpMethod     method;
+    const char*                 url;
+    const char*                 username;
+    const char*                 password;
+    const void*                 body;
+    uint32_t                    bodySize;
+  } _OrthancPluginCallHttpClient;
+
+
+  /**
+   * @brief Issue a HTTP GET call.
+   * 
+   * Make a HTTP GET call to the given URL. The result to the query is
+   * stored into a newly allocated memory buffer. Favor
+   * OrthancPluginRestApiGet() if calling the built-in REST API of the
+   * Orthanc instance that hosts this plugin.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param url The URL of interest.
+   * @param username The username (can be <tt>NULL</tt> if no password protection).
+   * @param password The password (can be <tt>NULL</tt> if no password protection).
+   * @return 0 if success, or the error code if failure.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginHttpGet(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  target,
+    const char*                 url,
+    const char*                 username,
+    const char*                 password)
+  {
+    _OrthancPluginCallHttpClient params;
+    memset(&params, 0, sizeof(params));
+
+    params.target = target;
+    params.method = OrthancPluginHttpMethod_Get;
+    params.url = url;
+    params.username = username;
+    params.password = password;
+
+    return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
+  }
+
+
+  /**
+   * @brief Issue a HTTP POST call.
+   * 
+   * Make a HTTP POST call to the given URL. The result to the query
+   * is stored into a newly allocated memory buffer. Favor
+   * OrthancPluginRestApiPost() if calling the built-in REST API of
+   * the Orthanc instance that hosts this plugin.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param url The URL of interest.
+   * @param body The content of the body of the request.
+   * @param bodySize The size of the body of the request.
+   * @param username The username (can be <tt>NULL</tt> if no password protection).
+   * @param password The password (can be <tt>NULL</tt> if no password protection).
+   * @return 0 if success, or the error code if failure.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginHttpPost(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  target,
+    const char*                 url,
+    const void*                 body,
+    uint32_t                    bodySize,
+    const char*                 username,
+    const char*                 password)
+  {
+    _OrthancPluginCallHttpClient params;
+    memset(&params, 0, sizeof(params));
+
+    params.target = target;
+    params.method = OrthancPluginHttpMethod_Post;
+    params.url = url;
+    params.body = body;
+    params.bodySize = bodySize;
+    params.username = username;
+    params.password = password;
+
+    return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
+  }
+
+
+  /**
+   * @brief Issue a HTTP PUT call.
+   * 
+   * Make a HTTP PUT call to the given URL. The result to the query is
+   * stored into a newly allocated memory buffer. Favor
+   * OrthancPluginRestApiPut() if calling the built-in REST API of the
+   * Orthanc instance that hosts this plugin.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param url The URL of interest.
+   * @param body The content of the body of the request.
+   * @param bodySize The size of the body of the request.
+   * @param username The username (can be <tt>NULL</tt> if no password protection).
+   * @param password The password (can be <tt>NULL</tt> if no password protection).
+   * @return 0 if success, or the error code if failure.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginHttpPut(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  target,
+    const char*                 url,
+    const void*                 body,
+    uint32_t                    bodySize,
+    const char*                 username,
+    const char*                 password)
+  {
+    _OrthancPluginCallHttpClient params;
+    memset(&params, 0, sizeof(params));
+
+    params.target = target;
+    params.method = OrthancPluginHttpMethod_Put;
+    params.url = url;
+    params.body = body;
+    params.bodySize = bodySize;
+    params.username = username;
+    params.password = password;
+
+    return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
+  }
+
+
+  /**
+   * @brief Issue a HTTP DELETE call.
+   * 
+   * Make a HTTP DELETE call to the given URL. Favor
+   * OrthancPluginRestApiDelete() if calling the built-in REST API of
+   * the Orthanc instance that hosts this plugin.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param url The URL of interest.
+   * @param username The username (can be <tt>NULL</tt> if no password protection).
+   * @param password The password (can be <tt>NULL</tt> if no password protection).
+   * @return 0 if success, or the error code if failure.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginHttpDelete(
+    OrthancPluginContext*       context,
+    const char*                 url,
+    const char*                 username,
+    const char*                 password)
+  {
+    _OrthancPluginCallHttpClient params;
+    memset(&params, 0, sizeof(params));
+
+    params.method = OrthancPluginHttpMethod_Delete;
+    params.url = url;
+    params.username = username;
+    params.password = password;
+
+    return context->InvokeService(context, _OrthancPluginService_CallHttpClient, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginImage**       target;
+    const OrthancPluginImage*  source;
+    OrthancPluginPixelFormat   targetFormat;
+  } _OrthancPluginConvertPixelFormat;
+
+
+  /**
+   * @brief Change the pixel format of an image.
+   *
+   * This function creates a new image, changing the memory layout of the pixels.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param source The source image.
+   * @param targetFormat The target pixel format.
+   * @return The resulting image. It must be freed with OrthancPluginFreeImage().
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginImage *OrthancPluginConvertPixelFormat(
+    OrthancPluginContext*      context,
+    const OrthancPluginImage*  source,
+    OrthancPluginPixelFormat   targetFormat)
+  {
+    OrthancPluginImage* target = NULL;
+
+    _OrthancPluginConvertPixelFormat params;
+    params.target = &target;
+    params.source = source;
+    params.targetFormat = targetFormat;
+
+    if (context->InvokeService(context, _OrthancPluginService_ConvertPixelFormat, &params) != OrthancPluginErrorCode_Success)
+    {
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+
+
+  /**
+   * @brief Return the number of available fonts.
+   *
+   * This function returns the number of fonts that are built in the
+   * Orthanc core. These fonts can be used to draw texts on images
+   * through OrthancPluginDrawText().
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @return The number of fonts.
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontsCount(
+    OrthancPluginContext*  context)
+  {
+    uint32_t count = 0;
+
+    _OrthancPluginReturnSingleValue params;
+    memset(&params, 0, sizeof(params));
+    params.resultUint32 = &count;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetFontsCount, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return 0;
+    }
+    else
+    {
+      return count;
+    }
+  }
+
+
+
+
+  typedef struct
+  {
+    uint32_t      fontIndex; /* in */
+    const char**  name; /* out */
+    uint32_t*     size; /* out */
+  } _OrthancPluginGetFontInfo;
+
+  /**
+   * @brief Return the name of a font.
+   *
+   * This function returns the name of a font that is built in the Orthanc core.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
+   * @return The font name. This is a statically-allocated string, do not free it.
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetFontName(
+    OrthancPluginContext*  context,
+    uint32_t               fontIndex)
+  {
+    const char* result = NULL;
+
+    _OrthancPluginGetFontInfo params;
+    memset(&params, 0, sizeof(params));
+    params.name = &result;
+    params.fontIndex = fontIndex;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
+    {
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Return the size of a font.
+   *
+   * This function returns the size of a font that is built in the Orthanc core.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
+   * @return The font size.
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetFontSize(
+    OrthancPluginContext*  context,
+    uint32_t               fontIndex)
+  {
+    uint32_t result;
+
+    _OrthancPluginGetFontInfo params;
+    memset(&params, 0, sizeof(params));
+    params.size = &result;
+    params.fontIndex = fontIndex;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetFontInfo, &params) != OrthancPluginErrorCode_Success)
+    {
+      return 0;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginImage*   image;
+    uint32_t              fontIndex;
+    const char*           utf8Text;
+    int32_t               x;
+    int32_t               y;
+    uint8_t               r;
+    uint8_t               g;
+    uint8_t               b;
+  } _OrthancPluginDrawText;
+
+
+  /**
+   * @brief Draw text on an image.
+   *
+   * This function draws some text on some image.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param image The image upon which to draw the text.
+   * @param fontIndex The index of the font. This value must be less than OrthancPluginGetFontsCount().
+   * @param utf8Text The text to be drawn, encoded as an UTF-8 zero-terminated string.
+   * @param x The X position of the text over the image.
+   * @param y The Y position of the text over the image.
+   * @param r The value of the red color channel of the text.
+   * @param g The value of the green color channel of the text.
+   * @param b The value of the blue color channel of the text.
+   * @return 0 if success, other value if error.
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginDrawText(
+    OrthancPluginContext*  context,
+    OrthancPluginImage*    image,
+    uint32_t               fontIndex,
+    const char*            utf8Text,
+    int32_t                x,
+    int32_t                y,
+    uint8_t                r,
+    uint8_t                g,
+    uint8_t                b)
+  {
+    _OrthancPluginDrawText params;
+    memset(&params, 0, sizeof(params));
+    params.image = image;
+    params.fontIndex = fontIndex;
+    params.utf8Text = utf8Text;
+    params.x = x;
+    params.y = y;
+    params.r = r;
+    params.g = g;
+    params.b = b;
+
+    return context->InvokeService(context, _OrthancPluginService_DrawText, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginStorageArea*   storageArea;
+    const char*                 uuid;
+    const void*                 content;
+    uint64_t                    size;
+    OrthancPluginContentType    type;
+  } _OrthancPluginStorageAreaCreate;
+
+
+  /**
+   * @brief Create a file inside the storage area.
+   *
+   * This function creates a new file inside the storage area that is
+   * currently used by Orthanc.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param storageArea The storage area.
+   * @param uuid The identifier of the file to be created.
+   * @param content The content to store in the newly created file.
+   * @param size The size of the content.
+   * @param type The type of the file content.
+   * @return 0 if success, other value if error.
+   * @ingroup Callbacks
+   * @deprecated This function should not be used anymore. Use "OrthancPluginRestApiPut()" on
+   * "/{patients|studies|series|instances}/{id}/attachments/{name}" instead.
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginStorageAreaCreate(
+    OrthancPluginContext*       context,
+    OrthancPluginStorageArea*   storageArea,
+    const char*                 uuid,
+    const void*                 content,
+    uint64_t                    size,
+    OrthancPluginContentType    type)
+  {
+    _OrthancPluginStorageAreaCreate params;
+    params.storageArea = storageArea;
+    params.uuid = uuid;
+    params.content = content;
+    params.size = size;
+    params.type = type;
+
+    return context->InvokeService(context, _OrthancPluginService_StorageAreaCreate, &params);
+  }
+
+
+  typedef struct
+  {
+    OrthancPluginMemoryBuffer*  target;
+    OrthancPluginStorageArea*   storageArea;
+    const char*                 uuid;
+    OrthancPluginContentType    type;
+  } _OrthancPluginStorageAreaRead;
+
+
+  /**
+   * @brief Read a file from the storage area.
+   *
+   * This function reads the content of a given file from the storage
+   * area that is currently used by Orthanc.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param storageArea The storage area.
+   * @param uuid The identifier of the file to be read.
+   * @param type The type of the file content.
+   * @return 0 if success, other value if error.
+   * @ingroup Callbacks
+   * @deprecated This function should not be used anymore. Use "OrthancPluginRestApiGet()" on
+   * "/{patients|studies|series|instances}/{id}/attachments/{name}" instead.
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginStorageAreaRead(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  target,
+    OrthancPluginStorageArea*   storageArea,
+    const char*                 uuid,
+    OrthancPluginContentType    type)
+  {
+    _OrthancPluginStorageAreaRead params;
+    params.target = target;
+    params.storageArea = storageArea;
+    params.uuid = uuid;
+    params.type = type;
+
+    return context->InvokeService(context, _OrthancPluginService_StorageAreaRead, &params);
+  }
+
+
+  typedef struct
+  {
+    OrthancPluginStorageArea*   storageArea;
+    const char*                 uuid;
+    OrthancPluginContentType    type;
+  } _OrthancPluginStorageAreaRemove;
+
+  /**
+   * @brief Remove a file from the storage area.
+   *
+   * This function removes a given file from the storage area that is
+   * currently used by Orthanc.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param storageArea The storage area.
+   * @param uuid The identifier of the file to be removed.
+   * @param type The type of the file content.
+   * @return 0 if success, other value if error.
+   * @ingroup Callbacks
+   * @deprecated This function should not be used anymore. Use "OrthancPluginRestApiDelete()" on
+   * "/{patients|studies|series|instances}/{id}/attachments/{name}" instead.
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginStorageAreaRemove(
+    OrthancPluginContext*       context,
+    OrthancPluginStorageArea*   storageArea,
+    const char*                 uuid,
+    OrthancPluginContentType    type)
+  {
+    _OrthancPluginStorageAreaRemove params;
+    params.storageArea = storageArea;
+    params.uuid = uuid;
+    params.type = type;
+
+    return context->InvokeService(context, _OrthancPluginService_StorageAreaRemove, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginErrorCode*  target;
+    int32_t                  code;
+    uint16_t                 httpStatus;
+    const char*              message;
+  } _OrthancPluginRegisterErrorCode;
+  
+  /**
+   * @brief Declare a custom error code for this plugin.
+   *
+   * This function declares a custom error code that can be generated
+   * by this plugin. This declaration is used to enrich the body of
+   * the HTTP answer in the case of an error, and to set the proper
+   * HTTP status code.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param code The error code that is internal to this plugin.
+   * @param httpStatus The HTTP status corresponding to this error.
+   * @param message The description of the error.
+   * @return The error code that has been assigned inside the Orthanc core.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginRegisterErrorCode(
+    OrthancPluginContext*    context,
+    int32_t                  code,
+    uint16_t                 httpStatus,
+    const char*              message)
+  {
+    OrthancPluginErrorCode target;
+
+    _OrthancPluginRegisterErrorCode params;
+    params.target = &target;
+    params.code = code;
+    params.httpStatus = httpStatus;
+    params.message = message;
+
+    if (context->InvokeService(context, _OrthancPluginService_RegisterErrorCode, &params) == OrthancPluginErrorCode_Success)
+    {
+      return target;
+    }
+    else
+    {
+      /* There was an error while assigned the error. Use a generic code. */
+      return OrthancPluginErrorCode_Plugin;
+    }
+  }
+
+
+
+  typedef struct
+  {
+    uint16_t                          group;
+    uint16_t                          element;
+    OrthancPluginValueRepresentation  vr;
+    const char*                       name;
+    uint32_t                          minMultiplicity;
+    uint32_t                          maxMultiplicity;
+  } _OrthancPluginRegisterDictionaryTag;
+  
+  /**
+   * @brief Register a new tag into the DICOM dictionary.
+   *
+   * This function declares a new public tag in the dictionary of
+   * DICOM tags that are known to Orthanc. This function should be
+   * used in the OrthancPluginInitialize() callback.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param group The group of the tag.
+   * @param element The element of the tag.
+   * @param vr The value representation of the tag.
+   * @param name The nickname of the tag.
+   * @param minMultiplicity The minimum multiplicity of the tag (must be above 0).
+   * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means
+   * an arbitrary multiplicity ("<tt>n</tt>").
+   * @return 0 if success, other value if error.
+   * @see OrthancPluginRegisterPrivateDictionaryTag()
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginRegisterDictionaryTag(
+    OrthancPluginContext*             context,
+    uint16_t                          group,
+    uint16_t                          element,
+    OrthancPluginValueRepresentation  vr,
+    const char*                       name,
+    uint32_t                          minMultiplicity,
+    uint32_t                          maxMultiplicity)
+  {
+    _OrthancPluginRegisterDictionaryTag params;
+    params.group = group;
+    params.element = element;
+    params.vr = vr;
+    params.name = name;
+    params.minMultiplicity = minMultiplicity;
+    params.maxMultiplicity = maxMultiplicity;
+
+    return context->InvokeService(context, _OrthancPluginService_RegisterDictionaryTag, &params);
+  }
+
+
+
+  typedef struct
+  {
+    uint16_t                          group;
+    uint16_t                          element;
+    OrthancPluginValueRepresentation  vr;
+    const char*                       name;
+    uint32_t                          minMultiplicity;
+    uint32_t                          maxMultiplicity;
+    const char*                       privateCreator;
+  } _OrthancPluginRegisterPrivateDictionaryTag;
+  
+  /**
+   * @brief Register a new private tag into the DICOM dictionary.
+   *
+   * This function declares a new private tag in the dictionary of
+   * DICOM tags that are known to Orthanc. This function should be
+   * used in the OrthancPluginInitialize() callback.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param group The group of the tag.
+   * @param element The element of the tag.
+   * @param vr The value representation of the tag.
+   * @param name The nickname of the tag.
+   * @param minMultiplicity The minimum multiplicity of the tag (must be above 0).
+   * @param maxMultiplicity The maximum multiplicity of the tag. A value of 0 means
+   * an arbitrary multiplicity ("<tt>n</tt>").
+   * @param privateCreator The private creator of this private tag.
+   * @return 0 if success, other value if error.
+   * @see OrthancPluginRegisterDictionaryTag()
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginRegisterPrivateDictionaryTag(
+    OrthancPluginContext*             context,
+    uint16_t                          group,
+    uint16_t                          element,
+    OrthancPluginValueRepresentation  vr,
+    const char*                       name,
+    uint32_t                          minMultiplicity,
+    uint32_t                          maxMultiplicity,
+    const char*                       privateCreator)
+  {
+    _OrthancPluginRegisterPrivateDictionaryTag params;
+    params.group = group;
+    params.element = element;
+    params.vr = vr;
+    params.name = name;
+    params.minMultiplicity = minMultiplicity;
+    params.maxMultiplicity = maxMultiplicity;
+    params.privateCreator = privateCreator;
+
+    return context->InvokeService(context, _OrthancPluginService_RegisterPrivateDictionaryTag, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginStorageArea*  storageArea;
+    OrthancPluginResourceType  level;
+  } _OrthancPluginReconstructMainDicomTags;
+
+  /**
+   * @brief Reconstruct the main DICOM tags.
+   *
+   * This function requests the Orthanc core to reconstruct the main
+   * DICOM tags of all the resources of the given type. This function
+   * can only be used as a part of the upgrade of a custom database
+   * back-end. A database transaction will be automatically setup.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param storageArea The storage area.
+   * @param level The type of the resources of interest.
+   * @return 0 if success, other value if error.
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginReconstructMainDicomTags(
+    OrthancPluginContext*      context,
+    OrthancPluginStorageArea*  storageArea,
+    OrthancPluginResourceType  level)
+  {
+    _OrthancPluginReconstructMainDicomTags params;
+    params.level = level;
+    params.storageArea = storageArea;
+
+    return context->InvokeService(context, _OrthancPluginService_ReconstructMainDicomTags, &params);
+  }
+
+
+  typedef struct
+  {
+    char**                          result;
+    const char*                     instanceId;
+    const void*                     buffer;
+    uint32_t                        size;
+    OrthancPluginDicomToJsonFormat  format;
+    OrthancPluginDicomToJsonFlags   flags;
+    uint32_t                        maxStringLength;
+  } _OrthancPluginDicomToJson;
+
+
+  /**
+   * @brief Format a DICOM memory buffer as a JSON string.
+   *
+   * This function takes as input a memory buffer containing a DICOM
+   * file, and outputs a JSON string representing the tags of this
+   * DICOM file.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param buffer The memory buffer containing the DICOM file.
+   * @param size The size of the memory buffer.
+   * @param format The output format.
+   * @param flags Flags governing the output.
+   * @param maxStringLength The maximum length of a field. Too long fields will
+   * be output as "null". The 0 value means no maximum length.
+   * @return The NULL value if the case of an error, or the JSON
+   * string. This string must be freed by OrthancPluginFreeString().
+   * @ingroup Toolbox
+   * @see OrthancPluginDicomInstanceToJson
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomBufferToJson(
+    OrthancPluginContext*           context,
+    const void*                     buffer,
+    uint32_t                        size,
+    OrthancPluginDicomToJsonFormat  format,
+    OrthancPluginDicomToJsonFlags   flags, 
+    uint32_t                        maxStringLength)
+  {
+    char* result;
+
+    _OrthancPluginDicomToJson params;
+    memset(&params, 0, sizeof(params));
+    params.result = &result;
+    params.buffer = buffer;
+    params.size = size;
+    params.format = format;
+    params.flags = flags;
+    params.maxStringLength = maxStringLength;
+
+    if (context->InvokeService(context, _OrthancPluginService_DicomBufferToJson, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Format a DICOM instance as a JSON string.
+   *
+   * This function formats a DICOM instance that is stored in Orthanc,
+   * and outputs a JSON string representing the tags of this DICOM
+   * instance.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param instanceId The Orthanc identifier of the instance.
+   * @param format The output format.
+   * @param flags Flags governing the output.
+   * @param maxStringLength The maximum length of a field. Too long fields will
+   * be output as "null". The 0 value means no maximum length.
+   * @return The NULL value if the case of an error, or the JSON
+   * string. This string must be freed by OrthancPluginFreeString().
+   * @ingroup Toolbox
+   * @see OrthancPluginDicomInstanceToJson
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginDicomInstanceToJson(
+    OrthancPluginContext*           context,
+    const char*                     instanceId,
+    OrthancPluginDicomToJsonFormat  format,
+    OrthancPluginDicomToJsonFlags   flags, 
+    uint32_t                        maxStringLength)
+  {
+    char* result;
+
+    _OrthancPluginDicomToJson params;
+    memset(&params, 0, sizeof(params));
+    params.result = &result;
+    params.instanceId = instanceId;
+    params.format = format;
+    params.flags = flags;
+    params.maxStringLength = maxStringLength;
+
+    if (context->InvokeService(context, _OrthancPluginService_DicomInstanceToJson, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  typedef struct
+  {
+    OrthancPluginMemoryBuffer*  target;
+    const char*                 uri;
+    uint32_t                    headersCount;
+    const char* const*          headersKeys;
+    const char* const*          headersValues;
+    int32_t                     afterPlugins;
+  } _OrthancPluginRestApiGet2;
+
+  /**
+   * @brief Make a GET call to the Orthanc REST API, with custom HTTP headers.
+   * 
+   * Make a GET call to the Orthanc REST API with extended
+   * parameters. The result to the query is stored into a newly
+   * allocated memory buffer.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param uri The URI in the built-in Orthanc API.
+   * @param headersCount The number of HTTP headers.
+   * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
+   * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
+   * @param afterPlugins If 0, the built-in API of Orthanc is used.
+   * If 1, the API is tainted by the plugins.
+   * @return 0 if success, or the error code if failure.
+   * @see OrthancPluginRestApiGet, OrthancPluginRestApiGetAfterPlugins
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginRestApiGet2(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  target,
+    const char*                 uri,
+    uint32_t                    headersCount,
+    const char* const*          headersKeys,
+    const char* const*          headersValues,
+    int32_t                     afterPlugins)
+  {
+    _OrthancPluginRestApiGet2 params;
+    params.target = target;
+    params.uri = uri;
+    params.headersCount = headersCount;
+    params.headersKeys = headersKeys;
+    params.headersValues = headersValues;
+    params.afterPlugins = afterPlugins;
+
+    return context->InvokeService(context, _OrthancPluginService_RestApiGet2, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginWorklistCallback callback;
+  } _OrthancPluginWorklistCallback;
+
+  /**
+   * @brief Register a callback to handle modality worklists requests.
+   *
+   * This function registers a callback to handle C-Find SCP requests
+   * on modality worklists.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param callback The callback.
+   * @return 0 if success, other value if error.
+   * @ingroup DicomCallbacks
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterWorklistCallback(
+    OrthancPluginContext*          context,
+    OrthancPluginWorklistCallback  callback)
+  {
+    _OrthancPluginWorklistCallback params;
+    params.callback = callback;
+
+    return context->InvokeService(context, _OrthancPluginService_RegisterWorklistCallback, &params);
+  }
+
+
+  
+  typedef struct
+  {
+    OrthancPluginWorklistAnswers*      answers;
+    const OrthancPluginWorklistQuery*  query;
+    const void*                        dicom;
+    uint32_t                           size;
+  } _OrthancPluginWorklistAnswersOperation;
+
+  /**
+   * @brief Add one answer to some modality worklist request.
+   *
+   * This function adds one worklist (encoded as a DICOM file) to the
+   * set of answers corresponding to some C-Find SCP request against
+   * modality worklists.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param answers The set of answers.
+   * @param query The worklist query, as received by the callback.
+   * @param dicom The worklist to answer, encoded as a DICOM file.
+   * @param size The size of the DICOM file.
+   * @return 0 if success, other value if error.
+   * @ingroup DicomCallbacks
+   * @see OrthancPluginCreateDicom()
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginWorklistAddAnswer(
+    OrthancPluginContext*             context,
+    OrthancPluginWorklistAnswers*     answers,
+    const OrthancPluginWorklistQuery* query,
+    const void*                       dicom,
+    uint32_t                          size)
+  {
+    _OrthancPluginWorklistAnswersOperation params;
+    params.answers = answers;
+    params.query = query;
+    params.dicom = dicom;
+    params.size = size;
+
+    return context->InvokeService(context, _OrthancPluginService_WorklistAddAnswer, &params);
+  }
+
+
+  /**
+   * @brief Mark the set of worklist answers as incomplete.
+   *
+   * This function marks as incomplete the set of answers
+   * corresponding to some C-Find SCP request against modality
+   * worklists. This must be used if canceling the handling of a
+   * request when too many answers are to be returned.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param answers The set of answers.
+   * @return 0 if success, other value if error.
+   * @ingroup DicomCallbacks
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginWorklistMarkIncomplete(
+    OrthancPluginContext*          context,
+    OrthancPluginWorklistAnswers*  answers)
+  {
+    _OrthancPluginWorklistAnswersOperation params;
+    params.answers = answers;
+    params.query = NULL;
+    params.dicom = NULL;
+    params.size = 0;
+
+    return context->InvokeService(context, _OrthancPluginService_WorklistMarkIncomplete, &params);
+  }
+
+
+  typedef struct
+  {
+    const OrthancPluginWorklistQuery*  query;
+    const void*                        dicom;
+    uint32_t                           size;
+    int32_t*                           isMatch;
+    OrthancPluginMemoryBuffer*         target;
+  } _OrthancPluginWorklistQueryOperation;
+
+  /**
+   * @brief Test whether a worklist matches the query.
+   *
+   * This function checks whether one worklist (encoded as a DICOM
+   * file) matches the C-Find SCP query against modality
+   * worklists. This function must be called before adding the
+   * worklist as an answer through OrthancPluginWorklistAddAnswer().
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param query The worklist query, as received by the callback.
+   * @param dicom The worklist to answer, encoded as a DICOM file.
+   * @param size The size of the DICOM file.
+   * @return 1 if the worklist matches the query, 0 otherwise.
+   * @ingroup DicomCallbacks
+   **/
+  ORTHANC_PLUGIN_INLINE int32_t  OrthancPluginWorklistIsMatch(
+    OrthancPluginContext*              context,
+    const OrthancPluginWorklistQuery*  query,
+    const void*                        dicom,
+    uint32_t                           size)
+  {
+    int32_t isMatch = 0;
+
+    _OrthancPluginWorklistQueryOperation params;
+    params.query = query;
+    params.dicom = dicom;
+    params.size = size;
+    params.isMatch = &isMatch;
+    params.target = NULL;
+
+    if (context->InvokeService(context, _OrthancPluginService_WorklistIsMatch, &params) == OrthancPluginErrorCode_Success)
+    {
+      return isMatch;
+    }
+    else
+    {
+      /* Error: Assume non-match */
+      return 0;
+    }
+  }
+
+
+  /**
+   * @brief Retrieve the worklist query as a DICOM file.
+   *
+   * This function retrieves the DICOM file that underlies a C-Find
+   * SCP query against modality worklists.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target Memory buffer where to store the DICOM file. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param query The worklist query, as received by the callback.
+   * @return 0 if success, other value if error.
+   * @ingroup DicomCallbacks
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginWorklistGetDicomQuery(
+    OrthancPluginContext*              context,
+    OrthancPluginMemoryBuffer*         target,
+    const OrthancPluginWorklistQuery*  query)
+  {
+    _OrthancPluginWorklistQueryOperation params;
+    params.query = query;
+    params.dicom = NULL;
+    params.size = 0;
+    params.isMatch = NULL;
+    params.target = target;
+
+    return context->InvokeService(context, _OrthancPluginService_WorklistGetDicomQuery, &params);
+  }
+
+
+  /**
+   * @brief Get the origin of a DICOM file.
+   *
+   * This function returns the origin of a DICOM instance that has been received by Orthanc.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param instance The instance of interest.
+   * @return The origin of the instance.
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginInstanceOrigin OrthancPluginGetInstanceOrigin(
+    OrthancPluginContext*             context,
+    const OrthancPluginDicomInstance* instance)
+  {
+    OrthancPluginInstanceOrigin origin;
+
+    _OrthancPluginAccessDicomInstance params;
+    memset(&params, 0, sizeof(params));
+    params.resultOrigin = &origin;
+    params.instance = instance;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetInstanceOrigin, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return OrthancPluginInstanceOrigin_Unknown;
+    }
+    else
+    {
+      return origin;
+    }
+  }
+
+
+  typedef struct
+  {
+    OrthancPluginMemoryBuffer*     target;
+    const char*                    json;
+    const OrthancPluginImage*      pixelData;
+    OrthancPluginCreateDicomFlags  flags;
+  } _OrthancPluginCreateDicom;
+
+  /**
+   * @brief Create a DICOM instance from a JSON string and an image.
+   *
+   * This function takes as input a string containing a JSON file
+   * describing the content of a DICOM instance. As an output, it
+   * writes the corresponding DICOM instance to a newly allocated
+   * memory buffer. Additionally, an image to be encoded within the
+   * DICOM instance can also be provided.
+   *
+   * Private tags will be associated with the private creator whose
+   * value is specified in the "DefaultPrivateCreator" configuration
+   * option of Orthanc. The function OrthancPluginCreateDicom2() can
+   * be used if another private creator must be used to create this
+   * instance.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param json The input JSON file.
+   * @param pixelData The image. Can be NULL, if the pixel data is encoded inside the JSON with the data URI scheme.
+   * @param flags Flags governing the output.
+   * @return 0 if success, other value if error.
+   * @ingroup Toolbox
+   * @see OrthancPluginCreateDicom2
+   * @see OrthancPluginDicomBufferToJson
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateDicom(
+    OrthancPluginContext*          context,
+    OrthancPluginMemoryBuffer*     target,
+    const char*                    json,
+    const OrthancPluginImage*      pixelData,
+    OrthancPluginCreateDicomFlags  flags)
+  {
+    _OrthancPluginCreateDicom params;
+    params.target = target;
+    params.json = json;
+    params.pixelData = pixelData;
+    params.flags = flags;
+
+    return context->InvokeService(context, _OrthancPluginService_CreateDicom, &params);
+  }
+
+
+  typedef struct
+  {
+    OrthancPluginDecodeImageCallback callback;
+  } _OrthancPluginDecodeImageCallback;
+
+  /**
+   * @brief Register a callback to handle the decoding of DICOM images.
+   *
+   * This function registers a custom callback to decode DICOM images,
+   * extending the built-in decoder of Orthanc that uses
+   * DCMTK. Starting with Orthanc 1.7.0, the exact behavior is
+   * affected by the configuration option
+   * "BuiltinDecoderTranscoderOrder" of Orthanc.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param callback The callback.
+   * @return 0 if success, other value if error.
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterDecodeImageCallback(
+    OrthancPluginContext*             context,
+    OrthancPluginDecodeImageCallback  callback)
+  {
+    _OrthancPluginDecodeImageCallback params;
+    params.callback = callback;
+
+    return context->InvokeService(context, _OrthancPluginService_RegisterDecodeImageCallback, &params);
+  }
+  
+
+
+  typedef struct
+  {
+    OrthancPluginImage**       target;
+    OrthancPluginPixelFormat   format;
+    uint32_t                   width;
+    uint32_t                   height;
+    uint32_t                   pitch;
+    void*                      buffer;
+    const void*                constBuffer;
+    uint32_t                   bufferSize;
+    uint32_t                   frameIndex;
+  } _OrthancPluginCreateImage;
+
+
+  /**
+   * @brief Create an image.
+   *
+   * This function creates an image of given size and format.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param format The format of the pixels.
+   * @param width The width of the image.
+   * @param height The height of the image.
+   * @return The newly allocated image. It must be freed with OrthancPluginFreeImage().
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImage(
+    OrthancPluginContext*     context,
+    OrthancPluginPixelFormat  format,
+    uint32_t                  width,
+    uint32_t                  height)
+  {
+    OrthancPluginImage* target = NULL;
+
+    _OrthancPluginCreateImage params;
+    memset(&params, 0, sizeof(params));
+    params.target = &target;
+    params.format = format;
+    params.width = width;
+    params.height = height;
+
+    if (context->InvokeService(context, _OrthancPluginService_CreateImage, &params) != OrthancPluginErrorCode_Success)
+    {
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+
+  /**
+   * @brief Create an image pointing to a memory buffer.
+   *
+   * This function creates an image whose content points to a memory
+   * buffer managed by the plugin. Note that the buffer is directly
+   * accessed, no memory is allocated and no data is copied.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param format The format of the pixels.
+   * @param width The width of the image.
+   * @param height The height of the image.
+   * @param pitch The pitch of the image (i.e. the number of bytes
+   * between 2 successive lines of the image in the memory buffer).
+   * @param buffer The memory buffer.
+   * @return The newly allocated image. It must be freed with OrthancPluginFreeImage().
+   * @ingroup Images
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginCreateImageAccessor(
+    OrthancPluginContext*     context,
+    OrthancPluginPixelFormat  format,
+    uint32_t                  width,
+    uint32_t                  height,
+    uint32_t                  pitch,
+    void*                     buffer)
+  {
+    OrthancPluginImage* target = NULL;
+
+    _OrthancPluginCreateImage params;
+    memset(&params, 0, sizeof(params));
+    params.target = &target;
+    params.format = format;
+    params.width = width;
+    params.height = height;
+    params.pitch = pitch;
+    params.buffer = buffer;
+
+    if (context->InvokeService(context, _OrthancPluginService_CreateImageAccessor, &params) != OrthancPluginErrorCode_Success)
+    {
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+
+
+  /**
+   * @brief Decode one frame from a DICOM instance.
+   *
+   * This function decodes one frame of a DICOM image that is stored
+   * in a memory buffer. This function will give the same result as
+   * OrthancPluginUncompressImage() for single-frame DICOM images.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param buffer Pointer to a memory buffer containing the DICOM image.
+   * @param bufferSize Size of the memory buffer containing the DICOM image.
+   * @param frameIndex The index of the frame of interest in a multi-frame image.
+   * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
+   * @ingroup Images
+   * @see OrthancPluginGetInstanceDecodedFrame()
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginDecodeDicomImage(
+    OrthancPluginContext*  context,
+    const void*            buffer,
+    uint32_t               bufferSize,
+    uint32_t               frameIndex)
+  {
+    OrthancPluginImage* target = NULL;
+
+    _OrthancPluginCreateImage params;
+    memset(&params, 0, sizeof(params));
+    params.target = &target;
+    params.constBuffer = buffer;
+    params.bufferSize = bufferSize;
+    params.frameIndex = frameIndex;
+
+    if (context->InvokeService(context, _OrthancPluginService_DecodeDicomImage, &params) != OrthancPluginErrorCode_Success)
+    {
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+
+
+  typedef struct
+  {
+    char**       result;
+    const void*  buffer;
+    uint32_t     size;
+  } _OrthancPluginComputeHash;
+
+  /**
+   * @brief Compute an MD5 hash.
+   *
+   * This functions computes the MD5 cryptographic hash of the given memory buffer.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param buffer The source memory buffer.
+   * @param size The size in bytes of the source buffer.
+   * @return The NULL value in case of error, or a string containing the cryptographic hash.
+   * This string must be freed by OrthancPluginFreeString().
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeMd5(
+    OrthancPluginContext*  context,
+    const void*            buffer,
+    uint32_t               size)
+  {
+    char* result;
+
+    _OrthancPluginComputeHash params;
+    params.result = &result;
+    params.buffer = buffer;
+    params.size = size;
+
+    if (context->InvokeService(context, _OrthancPluginService_ComputeMd5, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Compute a SHA-1 hash.
+   *
+   * This functions computes the SHA-1 cryptographic hash of the given memory buffer.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param buffer The source memory buffer.
+   * @param size The size in bytes of the source buffer.
+   * @return The NULL value in case of error, or a string containing the cryptographic hash.
+   * This string must be freed by OrthancPluginFreeString().
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginComputeSha1(
+    OrthancPluginContext*  context,
+    const void*            buffer,
+    uint32_t               size)
+  {
+    char* result;
+
+    _OrthancPluginComputeHash params;
+    params.result = &result;
+    params.buffer = buffer;
+    params.size = size;
+
+    if (context->InvokeService(context, _OrthancPluginService_ComputeSha1, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginDictionaryEntry* target;
+    const char*                   name;
+  } _OrthancPluginLookupDictionary;
+
+  /**
+   * @brief Get information about the given DICOM tag.
+   *
+   * This functions makes a lookup in the dictionary of DICOM tags
+   * that are known to Orthanc, and returns information about this
+   * tag. The tag can be specified using its human-readable name
+   * (e.g. "PatientName") or a set of two hexadecimal numbers
+   * (e.g. "0010-0020").
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target Where to store the information about the tag.
+   * @param name The name of the DICOM tag.
+   * @return 0 if success, other value if error.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginLookupDictionary(
+    OrthancPluginContext*          context,
+    OrthancPluginDictionaryEntry*  target,
+    const char*                    name)
+  {
+    _OrthancPluginLookupDictionary params;
+    params.target = target;
+    params.name = name;
+    return context->InvokeService(context, _OrthancPluginService_LookupDictionary, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginRestOutput* output;
+    const void*              answer;
+    uint32_t                 answerSize;
+    uint32_t                 headersCount;
+    const char* const*       headersKeys;
+    const char* const*       headersValues;
+  } _OrthancPluginSendMultipartItem2;
+
+  /**
+   * @brief Send an item as a part of some HTTP multipart answer, with custom headers.
+   *
+   * This function sends an item as a part of some HTTP multipart
+   * answer that was initiated by OrthancPluginStartMultipartAnswer(). In addition to
+   * OrthancPluginSendMultipartItem(), this function will set HTTP header associated
+   * with the item.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param output The HTTP connection to the client application.
+   * @param answer Pointer to the memory buffer containing the item.
+   * @param answerSize Number of bytes of the item.
+   * @param headersCount The number of HTTP headers.
+   * @param headersKeys Array containing the keys of the HTTP headers.
+   * @param headersValues Array containing the values of the HTTP headers.
+   * @return 0 if success, or the error code if failure (this notably happens
+   * if the connection is closed by the client).
+   * @see OrthancPluginSendMultipartItem()
+   * @ingroup REST
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSendMultipartItem2(
+    OrthancPluginContext*    context,
+    OrthancPluginRestOutput* output,
+    const void*              answer,
+    uint32_t                 answerSize,
+    uint32_t                 headersCount,
+    const char* const*       headersKeys,
+    const char* const*       headersValues)
+  {
+    _OrthancPluginSendMultipartItem2 params;
+    params.output = output;
+    params.answer = answer;
+    params.answerSize = answerSize;
+    params.headersCount = headersCount;
+    params.headersKeys = headersKeys;
+    params.headersValues = headersValues;    
+
+    return context->InvokeService(context, _OrthancPluginService_SendMultipartItem2, &params);
+  }
+
+
+  typedef struct
+  {
+    OrthancPluginIncomingHttpRequestFilter callback;
+  } _OrthancPluginIncomingHttpRequestFilter;
+
+  /**
+   * @brief Register a callback to filter incoming HTTP requests.
+   *
+   * This function registers a custom callback to filter incoming HTTP/REST
+   * requests received by the HTTP server of Orthanc.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param callback The callback.
+   * @return 0 if success, other value if error.
+   * @ingroup Callbacks
+   * @deprecated Please instead use OrthancPluginRegisterIncomingHttpRequestFilter2()
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter(
+    OrthancPluginContext*                   context,
+    OrthancPluginIncomingHttpRequestFilter  callback)
+  {
+    _OrthancPluginIncomingHttpRequestFilter params;
+    params.callback = callback;
+
+    return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter, &params);
+  }
+  
+
+
+  typedef struct
+  {
+    OrthancPluginMemoryBuffer*  answerBody;
+    OrthancPluginMemoryBuffer*  answerHeaders;
+    uint16_t*                   httpStatus;
+    OrthancPluginHttpMethod     method;
+    const char*                 url;
+    uint32_t                    headersCount;
+    const char* const*          headersKeys;
+    const char* const*          headersValues;
+    const void*                 body;
+    uint32_t                    bodySize;
+    const char*                 username;
+    const char*                 password;
+    uint32_t                    timeout;
+    const char*                 certificateFile;
+    const char*                 certificateKeyFile;
+    const char*                 certificateKeyPassword;
+    uint8_t                     pkcs11;
+  } _OrthancPluginCallHttpClient2;
+
+
+
+  /**
+   * @brief Issue a HTTP call with full flexibility.
+   * 
+   * Make a HTTP call to the given URL. The result to the query is
+   * stored into a newly allocated memory buffer. The HTTP request
+   * will be done accordingly to the global configuration of Orthanc
+   * (in particular, the options "HttpProxy", "HttpTimeout",
+   * "HttpsVerifyPeers", "HttpsCACertificates", and "Pkcs11" will be
+   * taken into account).
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param answerBody The target memory buffer (out argument).
+   *        It must be freed with OrthancPluginFreeMemoryBuffer().
+   *        The value of this argument is ignored if the HTTP method is DELETE.
+   * @param answerHeaders The target memory buffer for the HTTP headers in the answers (out argument). 
+   *        The answer headers are formatted as a JSON object (associative array).
+   *        The buffer must be freed with OrthancPluginFreeMemoryBuffer().
+   *        This argument can be set to NULL if the plugin has no interest in the HTTP headers.
+   * @param httpStatus The HTTP status after the execution of the request (out argument).
+   * @param method HTTP method to be used.
+   * @param url The URL of interest.
+   * @param headersCount The number of HTTP headers.
+   * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
+   * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
+   * @param username The username (can be <tt>NULL</tt> if no password protection).
+   * @param password The password (can be <tt>NULL</tt> if no password protection).
+   * @param body The HTTP body for a POST or PUT request.
+   * @param bodySize The size of the body.
+   * @param timeout Timeout in seconds (0 for default timeout).
+   * @param certificateFile Path to the client certificate for HTTPS, in PEM format
+   * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
+   * @param certificateKeyFile Path to the key of the client certificate for HTTPS, in PEM format
+   * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
+   * @param certificateKeyPassword Password to unlock the key of the client certificate 
+   * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
+   * @param pkcs11 Enable PKCS#11 client authentication for hardware security modules and smart cards.
+   * @return 0 if success, or the error code if failure.
+   * @see OrthancPluginCallPeerApi()
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginHttpClient(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  answerBody,
+    OrthancPluginMemoryBuffer*  answerHeaders,
+    uint16_t*                   httpStatus,
+    OrthancPluginHttpMethod     method,
+    const char*                 url,
+    uint32_t                    headersCount,
+    const char* const*          headersKeys,
+    const char* const*          headersValues,
+    const void*                 body,
+    uint32_t                    bodySize,
+    const char*                 username,
+    const char*                 password,
+    uint32_t                    timeout,
+    const char*                 certificateFile,
+    const char*                 certificateKeyFile,
+    const char*                 certificateKeyPassword,
+    uint8_t                     pkcs11)
+  {
+    _OrthancPluginCallHttpClient2 params;
+    memset(&params, 0, sizeof(params));
+
+    params.answerBody = answerBody;
+    params.answerHeaders = answerHeaders;
+    params.httpStatus = httpStatus;
+    params.method = method;
+    params.url = url;
+    params.headersCount = headersCount;
+    params.headersKeys = headersKeys;
+    params.headersValues = headersValues;
+    params.body = body;
+    params.bodySize = bodySize;
+    params.username = username;
+    params.password = password;
+    params.timeout = timeout;
+    params.certificateFile = certificateFile;
+    params.certificateKeyFile = certificateKeyFile;
+    params.certificateKeyPassword = certificateKeyPassword;
+    params.pkcs11 = pkcs11;
+
+    return context->InvokeService(context, _OrthancPluginService_CallHttpClient2, &params);
+  }
+
+
+  /**
+   * @brief Generate an UUID.
+   *
+   * Generate a random GUID/UUID (globally unique identifier).
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @return NULL in the case of an error, or a newly allocated string
+   * containing the UUID. This string must be freed by OrthancPluginFreeString().
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateUuid(
+    OrthancPluginContext*  context)
+  {
+    char* result;
+
+    _OrthancPluginRetrieveDynamicString params;
+    params.result = &result;
+    params.argument = NULL;
+
+    if (context->InvokeService(context, _OrthancPluginService_GenerateUuid, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+
+
+  typedef struct
+  {
+    OrthancPluginFindCallback callback;
+  } _OrthancPluginFindCallback;
+
+  /**
+   * @brief Register a callback to handle C-Find requests.
+   *
+   * This function registers a callback to handle C-Find SCP requests
+   * that are not related to modality worklists.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param callback The callback.
+   * @return 0 if success, other value if error.
+   * @ingroup DicomCallbacks
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterFindCallback(
+    OrthancPluginContext*      context,
+    OrthancPluginFindCallback  callback)
+  {
+    _OrthancPluginFindCallback params;
+    params.callback = callback;
+
+    return context->InvokeService(context, _OrthancPluginService_RegisterFindCallback, &params);
+  }
+
+
+  typedef struct
+  {
+    OrthancPluginFindAnswers      *answers;
+    const OrthancPluginFindQuery  *query;
+    const void                    *dicom;
+    uint32_t                       size;
+    uint32_t                       index;
+    uint32_t                      *resultUint32;
+    uint16_t                      *resultGroup;
+    uint16_t                      *resultElement;
+    char                         **resultString;
+  } _OrthancPluginFindOperation;
+
+  /**
+   * @brief Add one answer to some C-Find request.
+   *
+   * This function adds one answer (encoded as a DICOM file) to the
+   * set of answers corresponding to some C-Find SCP request that is
+   * not related to modality worklists.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param answers The set of answers.
+   * @param dicom The answer to be added, encoded as a DICOM file.
+   * @param size The size of the DICOM file.
+   * @return 0 if success, other value if error.
+   * @ingroup DicomCallbacks
+   * @see OrthancPluginCreateDicom()
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginFindAddAnswer(
+    OrthancPluginContext*      context,
+    OrthancPluginFindAnswers*  answers,
+    const void*                dicom,
+    uint32_t                   size)
+  {
+    _OrthancPluginFindOperation params;
+    memset(&params, 0, sizeof(params));
+    params.answers = answers;
+    params.dicom = dicom;
+    params.size = size;
+
+    return context->InvokeService(context, _OrthancPluginService_FindAddAnswer, &params);
+  }
+
+
+  /**
+   * @brief Mark the set of C-Find answers as incomplete.
+   *
+   * This function marks as incomplete the set of answers
+   * corresponding to some C-Find SCP request that is not related to
+   * modality worklists. This must be used if canceling the handling
+   * of a request when too many answers are to be returned.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param answers The set of answers.
+   * @return 0 if success, other value if error.
+   * @ingroup DicomCallbacks
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginFindMarkIncomplete(
+    OrthancPluginContext*      context,
+    OrthancPluginFindAnswers*  answers)
+  {
+    _OrthancPluginFindOperation params;
+    memset(&params, 0, sizeof(params));
+    params.answers = answers;
+
+    return context->InvokeService(context, _OrthancPluginService_FindMarkIncomplete, &params);
+  }
+
+
+
+  /**
+   * @brief Get the number of tags in a C-Find query.
+   *
+   * This function returns the number of tags that are contained in
+   * the given C-Find query.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param query The C-Find query.
+   * @return The number of tags.
+   * @ingroup DicomCallbacks
+   **/
+  ORTHANC_PLUGIN_INLINE uint32_t  OrthancPluginGetFindQuerySize(
+    OrthancPluginContext*          context,
+    const OrthancPluginFindQuery*  query)
+  {
+    uint32_t count = 0;
+
+    _OrthancPluginFindOperation params;
+    memset(&params, 0, sizeof(params));
+    params.query = query;
+    params.resultUint32 = &count;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetFindQuerySize, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return 0;
+    }
+    else
+    {
+      return count;
+    }
+  }
+
+
+  /**
+   * @brief Get one tag in a C-Find query.
+   *
+   * This function returns the group and the element of one DICOM tag
+   * in the given C-Find query.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param group The group of the tag (output).
+   * @param element The element of the tag (output).
+   * @param query The C-Find query.
+   * @param index The index of the tag of interest.
+   * @return 0 if success, other value if error.
+   * @ingroup DicomCallbacks
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginGetFindQueryTag(
+    OrthancPluginContext*          context,
+    uint16_t*                      group,
+    uint16_t*                      element,
+    const OrthancPluginFindQuery*  query,
+    uint32_t                       index)
+  {
+    _OrthancPluginFindOperation params;
+    memset(&params, 0, sizeof(params));
+    params.query = query;
+    params.index = index;
+    params.resultGroup = group;
+    params.resultElement = element;
+
+    return context->InvokeService(context, _OrthancPluginService_GetFindQueryTag, &params);
+  }
+
+
+  /**
+   * @brief Get the symbolic name of one tag in a C-Find query.
+   *
+   * This function returns the symbolic name of one DICOM tag in the
+   * given C-Find query.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param query The C-Find query.
+   * @param index The index of the tag of interest.
+   * @return The NULL value in case of error, or a string containing the name of the tag.
+   * @return 0 if success, other value if error.
+   * @ingroup DicomCallbacks
+   **/
+  ORTHANC_PLUGIN_INLINE char*  OrthancPluginGetFindQueryTagName(
+    OrthancPluginContext*          context,
+    const OrthancPluginFindQuery*  query,
+    uint32_t                       index)
+  {
+    char* result;
+
+    _OrthancPluginFindOperation params;
+    memset(&params, 0, sizeof(params));
+    params.query = query;
+    params.index = index;
+    params.resultString = &result;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetFindQueryTagName, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Get the value associated with one tag in a C-Find query.
+   *
+   * This function returns the value associated with one tag in the
+   * given C-Find query.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param query The C-Find query.
+   * @param index The index of the tag of interest.
+   * @return The NULL value in case of error, or a string containing the value of the tag.
+   * @return 0 if success, other value if error.
+   * @ingroup DicomCallbacks
+   **/
+  ORTHANC_PLUGIN_INLINE char*  OrthancPluginGetFindQueryValue(
+    OrthancPluginContext*          context,
+    const OrthancPluginFindQuery*  query,
+    uint32_t                       index)
+  {
+    char* result;
+
+    _OrthancPluginFindOperation params;
+    memset(&params, 0, sizeof(params));
+    params.query = query;
+    params.index = index;
+    params.resultString = &result;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetFindQueryValue, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+ 
+
+
+
+  typedef struct
+  {
+    OrthancPluginMoveCallback   callback;
+    OrthancPluginGetMoveSize    getMoveSize;
+    OrthancPluginApplyMove      applyMove;
+    OrthancPluginFreeMove       freeMove;
+  } _OrthancPluginMoveCallback;
+
+  /**
+   * @brief Register a callback to handle C-Move requests.
+   *
+   * This function registers a callback to handle C-Move SCP requests.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param callback The main callback.
+   * @param getMoveSize Callback to read the number of C-Move suboperations.
+   * @param applyMove Callback to apply one C-Move suboperation.
+   * @param freeMove Callback to free the C-Move driver.
+   * @return 0 if success, other value if error.
+   * @ingroup DicomCallbacks
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterMoveCallback(
+    OrthancPluginContext*       context,
+    OrthancPluginMoveCallback   callback,
+    OrthancPluginGetMoveSize    getMoveSize,
+    OrthancPluginApplyMove      applyMove,
+    OrthancPluginFreeMove       freeMove)
+  {
+    _OrthancPluginMoveCallback params;
+    params.callback = callback;
+    params.getMoveSize = getMoveSize;
+    params.applyMove = applyMove;
+    params.freeMove = freeMove;
+
+    return context->InvokeService(context, _OrthancPluginService_RegisterMoveCallback, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginFindMatcher** target;
+    const void*                query;
+    uint32_t                   size;
+  } _OrthancPluginCreateFindMatcher;
+
+
+  /**
+   * @brief Create a C-Find matcher.
+   *
+   * This function creates a "matcher" object that can be used to
+   * check whether a DICOM instance matches a C-Find query. The C-Find
+   * query must be expressed as a DICOM buffer.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param query The C-Find DICOM query.
+   * @param size The size of the DICOM query.
+   * @return The newly allocated matcher. It must be freed with OrthancPluginFreeFindMatcher().
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginFindMatcher* OrthancPluginCreateFindMatcher(
+    OrthancPluginContext*  context,
+    const void*            query,
+    uint32_t               size)
+  {
+    OrthancPluginFindMatcher* target = NULL;
+
+    _OrthancPluginCreateFindMatcher params;
+    memset(&params, 0, sizeof(params));
+    params.target = &target;
+    params.query = query;
+    params.size = size;
+
+    if (context->InvokeService(context, _OrthancPluginService_CreateFindMatcher, &params) != OrthancPluginErrorCode_Success)
+    {
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+
+  typedef struct
+  {
+    OrthancPluginFindMatcher*   matcher;
+  } _OrthancPluginFreeFindMatcher;
+
+  /**
+   * @brief Free a C-Find matcher.
+   *
+   * This function frees a matcher that was created using OrthancPluginCreateFindMatcher().
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param matcher The matcher of interest.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE void  OrthancPluginFreeFindMatcher(
+    OrthancPluginContext*     context, 
+    OrthancPluginFindMatcher* matcher)
+  {
+    _OrthancPluginFreeFindMatcher params;
+    params.matcher = matcher;
+
+    context->InvokeService(context, _OrthancPluginService_FreeFindMatcher, &params);
+  }
+
+
+  typedef struct
+  {
+    const OrthancPluginFindMatcher*  matcher;
+    const void*                      dicom;
+    uint32_t                         size;
+    int32_t*                         isMatch;
+  } _OrthancPluginFindMatcherIsMatch;
+
+  /**
+   * @brief Test whether a DICOM instance matches a C-Find query.
+   *
+   * This function checks whether one DICOM instance matches C-Find
+   * matcher that was previously allocated using
+   * OrthancPluginCreateFindMatcher().
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param matcher The matcher of interest.
+   * @param dicom The DICOM instance to be matched.
+   * @param size The size of the DICOM instance.
+   * @return 1 if the DICOM instance matches the query, 0 otherwise.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE int32_t  OrthancPluginFindMatcherIsMatch(
+    OrthancPluginContext*            context,
+    const OrthancPluginFindMatcher*  matcher,
+    const void*                      dicom,
+    uint32_t                         size)
+  {
+    int32_t isMatch = 0;
+
+    _OrthancPluginFindMatcherIsMatch params;
+    params.matcher = matcher;
+    params.dicom = dicom;
+    params.size = size;
+    params.isMatch = &isMatch;
+
+    if (context->InvokeService(context, _OrthancPluginService_FindMatcherIsMatch, &params) == OrthancPluginErrorCode_Success)
+    {
+      return isMatch;
+    }
+    else
+    {
+      /* Error: Assume non-match */
+      return 0;
+    }
+  }
+
+
+  typedef struct
+  {
+    OrthancPluginIncomingHttpRequestFilter2 callback;
+  } _OrthancPluginIncomingHttpRequestFilter2;
+
+  /**
+   * @brief Register a callback to filter incoming HTTP requests.
+   *
+   * This function registers a custom callback to filter incoming HTTP/REST
+   * requests received by the HTTP server of Orthanc.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param callback The callback.
+   * @return 0 if success, other value if error.
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingHttpRequestFilter2(
+    OrthancPluginContext*                   context,
+    OrthancPluginIncomingHttpRequestFilter2 callback)
+  {
+    _OrthancPluginIncomingHttpRequestFilter2 params;
+    params.callback = callback;
+
+    return context->InvokeService(context, _OrthancPluginService_RegisterIncomingHttpRequestFilter2, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginPeers**  peers;
+  } _OrthancPluginGetPeers;
+
+  /**
+   * @brief Return the list of available Orthanc peers.
+   *
+   * This function returns the parameters of the Orthanc peers that are known to
+   * the Orthanc server hosting the plugin.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @return NULL if error, or a newly allocated opaque data structure containing the peers.
+   * This structure must be freed with OrthancPluginFreePeers().
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginPeers* OrthancPluginGetPeers(
+    OrthancPluginContext*  context)
+  {
+    OrthancPluginPeers* peers = NULL;
+
+    _OrthancPluginGetPeers params;
+    memset(&params, 0, sizeof(params));
+    params.peers = &peers;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetPeers, &params) != OrthancPluginErrorCode_Success)
+    {
+      return NULL;
+    }
+    else
+    {
+      return peers;
+    }
+  }
+
+
+  typedef struct
+  {
+    OrthancPluginPeers*   peers;
+  } _OrthancPluginFreePeers;
+
+  /**
+   * @brief Free the list of available Orthanc peers.
+   *
+   * This function frees the data structure returned by OrthancPluginGetPeers().
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param peers The data structure describing the Orthanc peers.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE void  OrthancPluginFreePeers(
+    OrthancPluginContext*     context, 
+    OrthancPluginPeers* peers)
+  {
+    _OrthancPluginFreePeers params;
+    params.peers = peers;
+
+    context->InvokeService(context, _OrthancPluginService_FreePeers, &params);
+  }
+
+
+  typedef struct
+  {
+    uint32_t*                  target;
+    const OrthancPluginPeers*  peers;
+  } _OrthancPluginGetPeersCount;
+
+  /**
+   * @brief Get the number of Orthanc peers.
+   *
+   * This function returns the number of Orthanc peers.
+   *
+   * This function is thread-safe: Several threads sharing the same
+   * OrthancPluginPeers object can simultaneously call this function.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param peers The data structure describing the Orthanc peers.
+   * @result The number of peers. 
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetPeersCount(
+    OrthancPluginContext*      context,
+    const OrthancPluginPeers*  peers)
+  {
+    uint32_t target = 0;
+
+    _OrthancPluginGetPeersCount params;
+    memset(&params, 0, sizeof(params));
+    params.target = &target;
+    params.peers = peers;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetPeersCount, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return 0;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+
+  typedef struct
+  {
+    const char**               target;
+    const OrthancPluginPeers*  peers;
+    uint32_t                   peerIndex;
+    const char*                userProperty;
+  } _OrthancPluginGetPeerProperty;
+
+  /**
+   * @brief Get the symbolic name of an Orthanc peer.
+   *
+   * This function returns the symbolic name of the Orthanc peer,
+   * which corresponds to the key of the "OrthancPeers" configuration
+   * option of Orthanc.
+   *
+   * This function is thread-safe: Several threads sharing the same
+   * OrthancPluginPeers object can simultaneously call this function.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param peers The data structure describing the Orthanc peers.
+   * @param peerIndex The index of the peer of interest.
+   * This value must be lower than OrthancPluginGetPeersCount().
+   * @result The symbolic name, or NULL in the case of an error.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerName(
+    OrthancPluginContext*      context,
+    const OrthancPluginPeers*  peers,
+    uint32_t                   peerIndex)
+  {
+    const char* target = NULL;
+
+    _OrthancPluginGetPeerProperty params;
+    memset(&params, 0, sizeof(params));
+    params.target = &target;
+    params.peers = peers;
+    params.peerIndex = peerIndex;
+    params.userProperty = NULL;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetPeerName, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+
+  /**
+   * @brief Get the base URL of an Orthanc peer.
+   *
+   * This function returns the base URL to the REST API of some Orthanc peer.
+   *
+   * This function is thread-safe: Several threads sharing the same
+   * OrthancPluginPeers object can simultaneously call this function.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param peers The data structure describing the Orthanc peers.
+   * @param peerIndex The index of the peer of interest.
+   * This value must be lower than OrthancPluginGetPeersCount().
+   * @result The URL, or NULL in the case of an error.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUrl(
+    OrthancPluginContext*      context,
+    const OrthancPluginPeers*  peers,
+    uint32_t                   peerIndex)
+  {
+    const char* target = NULL;
+
+    _OrthancPluginGetPeerProperty params;
+    memset(&params, 0, sizeof(params));
+    params.target = &target;
+    params.peers = peers;
+    params.peerIndex = peerIndex;
+    params.userProperty = NULL;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetPeerUrl, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+
+
+  /**
+   * @brief Get some user-defined property of an Orthanc peer.
+   *
+   * This function returns some user-defined property of some Orthanc
+   * peer. An user-defined property is a property that is associated
+   * with the peer in the Orthanc configuration file, but that is not
+   * recognized by the Orthanc core.
+   *
+   * This function is thread-safe: Several threads sharing the same
+   * OrthancPluginPeers object can simultaneously call this function.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param peers The data structure describing the Orthanc peers.
+   * @param peerIndex The index of the peer of interest.
+   * This value must be lower than OrthancPluginGetPeersCount().
+   * @param userProperty The user property of interest.
+   * @result The value of the user property, or NULL if it is not defined.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE const char* OrthancPluginGetPeerUserProperty(
+    OrthancPluginContext*      context,
+    const OrthancPluginPeers*  peers,
+    uint32_t                   peerIndex,
+    const char*                userProperty)
+  {
+    const char* target = NULL;
+
+    _OrthancPluginGetPeerProperty params;
+    memset(&params, 0, sizeof(params));
+    params.target = &target;
+    params.peers = peers;
+    params.peerIndex = peerIndex;
+    params.userProperty = userProperty;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetPeerUserProperty, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* No such user property */
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginMemoryBuffer*  answerBody;
+    OrthancPluginMemoryBuffer*  answerHeaders;
+    uint16_t*                   httpStatus;
+    const OrthancPluginPeers*   peers;
+    uint32_t                    peerIndex;
+    OrthancPluginHttpMethod     method;
+    const char*                 uri;
+    uint32_t                    additionalHeadersCount;
+    const char* const*          additionalHeadersKeys;
+    const char* const*          additionalHeadersValues;
+    const void*                 body;
+    uint32_t                    bodySize;
+    uint32_t                    timeout;
+  } _OrthancPluginCallPeerApi;
+
+  /**
+   * @brief Call the REST API of an Orthanc peer.
+   * 
+   * Make a REST call to the given URI in the REST API of a remote
+   * Orthanc peer. The result to the query is stored into a newly
+   * allocated memory buffer. The HTTP request will be done according
+   * to the "OrthancPeers" configuration option of Orthanc.
+   *
+   * This function is thread-safe: Several threads sharing the same
+   * OrthancPluginPeers object can simultaneously call this function.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param answerBody The target memory buffer (out argument).
+   *        It must be freed with OrthancPluginFreeMemoryBuffer().
+   *        The value of this argument is ignored if the HTTP method is DELETE.
+   * @param answerHeaders The target memory buffer for the HTTP headers in the answers (out argument). 
+   *        The answer headers are formatted as a JSON object (associative array).
+   *        The buffer must be freed with OrthancPluginFreeMemoryBuffer().
+   *        This argument can be set to NULL if the plugin has no interest in the HTTP headers.
+   * @param httpStatus The HTTP status after the execution of the request (out argument).
+   * @param peers The data structure describing the Orthanc peers.
+   * @param peerIndex The index of the peer of interest.
+   * This value must be lower than OrthancPluginGetPeersCount().
+   * @param method HTTP method to be used.
+   * @param uri The URI of interest in the REST API.
+   * @param additionalHeadersCount The number of HTTP headers to be added to the
+   * HTTP headers provided in the global configuration of Orthanc.
+   * @param additionalHeadersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
+   * @param additionalHeadersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
+   * @param body The HTTP body for a POST or PUT request.
+   * @param bodySize The size of the body.
+   * @param timeout Timeout in seconds (0 for default timeout).
+   * @return 0 if success, or the error code if failure.
+   * @see OrthancPluginHttpClient()
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginCallPeerApi(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  answerBody,
+    OrthancPluginMemoryBuffer*  answerHeaders,
+    uint16_t*                   httpStatus,
+    const OrthancPluginPeers*   peers,
+    uint32_t                    peerIndex,
+    OrthancPluginHttpMethod     method,
+    const char*                 uri,
+    uint32_t                    additionalHeadersCount,
+    const char* const*          additionalHeadersKeys,
+    const char* const*          additionalHeadersValues,
+    const void*                 body,
+    uint32_t                    bodySize,
+    uint32_t                    timeout)
+  {
+    _OrthancPluginCallPeerApi params;
+    memset(&params, 0, sizeof(params));
+
+    params.answerBody = answerBody;
+    params.answerHeaders = answerHeaders;
+    params.httpStatus = httpStatus;
+    params.peers = peers;
+    params.peerIndex = peerIndex;
+    params.method = method;
+    params.uri = uri;
+    params.additionalHeadersCount = additionalHeadersCount;
+    params.additionalHeadersKeys = additionalHeadersKeys;
+    params.additionalHeadersValues = additionalHeadersValues;
+    params.body = body;
+    params.bodySize = bodySize;
+    params.timeout = timeout;
+
+    return context->InvokeService(context, _OrthancPluginService_CallPeerApi, &params);
+  }
+
+
+
+
+
+  typedef struct
+  {
+    OrthancPluginJob**              target;
+    void                           *job;
+    OrthancPluginJobFinalize        finalize;
+    const char                     *type;
+    OrthancPluginJobGetProgress     getProgress;
+    OrthancPluginJobGetContent      getContent;
+    OrthancPluginJobGetSerialized   getSerialized;
+    OrthancPluginJobStep            step;
+    OrthancPluginJobStop            stop;
+    OrthancPluginJobReset           reset;
+  } _OrthancPluginCreateJob;
+
+  /**
+   * @brief Create a custom job.
+   *
+   * This function creates a custom job to be run by the jobs engine
+   * of Orthanc.
+   * 
+   * Orthanc starts one dedicated thread per custom job that is
+   * running. It is guaranteed that all the callbacks will only be
+   * called from this single dedicated thread, in mutual exclusion: As
+   * a consequence, it is *not* mandatory to protect the various
+   * callbacks by mutexes.
+   * 
+   * The custom job can nonetheless launch its own processing threads
+   * on the first call to the "step()" callback, and stop them once
+   * the "stop()" callback is called.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param job The job to be executed.
+   * @param finalize The finalization callback.
+   * @param type The type of the job, provided to the job unserializer. 
+   * See OrthancPluginRegisterJobsUnserializer().
+   * @param getProgress The progress callback.
+   * @param getContent The content callback.
+   * @param getSerialized The serialization callback.
+   * @param step The callback to execute the individual steps of the job.
+   * @param stop The callback that is invoked once the job leaves the "running" state.
+   * @param reset The callback that is invoked if a stopped job is started again.
+   * @return The newly allocated job. It must be freed with OrthancPluginFreeJob(),
+   * as long as it is not submitted with OrthancPluginSubmitJob().
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginJob *OrthancPluginCreateJob(
+    OrthancPluginContext           *context,
+    void                           *job,
+    OrthancPluginJobFinalize        finalize,
+    const char                     *type,
+    OrthancPluginJobGetProgress     getProgress,
+    OrthancPluginJobGetContent      getContent,
+    OrthancPluginJobGetSerialized   getSerialized,
+    OrthancPluginJobStep            step,
+    OrthancPluginJobStop            stop,
+    OrthancPluginJobReset           reset)
+  {
+    OrthancPluginJob* target = NULL;
+
+    _OrthancPluginCreateJob params;
+    memset(&params, 0, sizeof(params));
+
+    params.target = &target;
+    params.job = job;
+    params.finalize = finalize;
+    params.type = type;
+    params.getProgress = getProgress;
+    params.getContent = getContent;
+    params.getSerialized = getSerialized;
+    params.step = step;
+    params.stop = stop;
+    params.reset = reset;
+
+    if (context->InvokeService(context, _OrthancPluginService_CreateJob, &params) != OrthancPluginErrorCode_Success ||
+        target == NULL)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+
+  typedef struct
+  {
+    OrthancPluginJob*   job;
+  } _OrthancPluginFreeJob;
+
+  /**
+   * @brief Free a custom job.
+   *
+   * This function frees an image that was created with OrthancPluginCreateJob().
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param job The job.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE void  OrthancPluginFreeJob(
+    OrthancPluginContext* context, 
+    OrthancPluginJob*     job)
+  {
+    _OrthancPluginFreeJob params;
+    params.job = job;
+
+    context->InvokeService(context, _OrthancPluginService_FreeJob, &params);
+  }
+
+
+  
+  typedef struct
+  {
+    char**             resultId;
+    OrthancPluginJob  *job;
+    int32_t            priority;
+  } _OrthancPluginSubmitJob;
+
+  /**
+   * @brief Submit a new job to the jobs engine of Orthanc.
+   *
+   * This function adds the given job to the pending jobs of
+   * Orthanc. Orthanc will take take of freeing it by invoking the
+   * finalization callback provided to OrthancPluginCreateJob().
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param job The job, as received by OrthancPluginCreateJob().
+   * @param priority The priority of the job.
+   * @return ID of the newly-submitted job. This string must be freed by OrthancPluginFreeString().
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE char *OrthancPluginSubmitJob(
+    OrthancPluginContext   *context,
+    OrthancPluginJob       *job,
+    int32_t                 priority)
+  {
+    char* resultId = NULL;
+
+    _OrthancPluginSubmitJob params;
+    memset(&params, 0, sizeof(params));
+
+    params.resultId = &resultId;
+    params.job = job;
+    params.priority = priority;
+
+    if (context->InvokeService(context, _OrthancPluginService_SubmitJob, &params) != OrthancPluginErrorCode_Success ||
+        resultId == NULL)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return resultId;
+    }
+  }
+  
+
+
+  typedef struct
+  {
+    OrthancPluginJobsUnserializer unserializer;
+  } _OrthancPluginJobsUnserializer;
+
+  /**
+   * @brief Register an unserializer for custom jobs.
+   *
+   * This function registers an unserializer that decodes custom jobs
+   * from a JSON string. This callback is invoked when the jobs engine
+   * of Orthanc is started (on Orthanc initialization), for each job
+   * that is stored in the Orthanc database.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param unserializer The job unserializer.
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterJobsUnserializer(
+    OrthancPluginContext*          context,
+    OrthancPluginJobsUnserializer  unserializer)
+  {
+    _OrthancPluginJobsUnserializer params;
+    params.unserializer = unserializer;
+
+    context->InvokeService(context, _OrthancPluginService_RegisterJobsUnserializer, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginRestOutput* output;
+    const char*              details;
+    uint8_t                  log;
+  } _OrthancPluginSetHttpErrorDetails;
+
+  /**
+   * @brief Provide a detailed description for an HTTP error.
+   *
+   * This function sets the detailed description associated with an
+   * HTTP error. This description will be displayed in the "Details"
+   * field of the JSON body of the HTTP answer. It is only taken into
+   * consideration if the REST callback returns an error code that is
+   * different from "OrthancPluginErrorCode_Success", and if the
+   * "HttpDescribeErrors" configuration option of Orthanc is set to
+   * "true".
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param output The HTTP connection to the client application.
+   * @param details The details of the error message.
+   * @param log Whether to also write the detailed error to the Orthanc logs.
+   * @ingroup REST
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginSetHttpErrorDetails(
+    OrthancPluginContext*    context,
+    OrthancPluginRestOutput* output,
+    const char*              details,
+    uint8_t                  log)
+  {
+    _OrthancPluginSetHttpErrorDetails params;
+    params.output = output;
+    params.details = details;
+    params.log = log;
+    context->InvokeService(context, _OrthancPluginService_SetHttpErrorDetails, &params);
+  }
+
+
+
+  typedef struct
+  {
+    const char** result;
+    const char*  argument;
+  } _OrthancPluginRetrieveStaticString;
+
+  /**
+   * @brief Detect the MIME type of a file.
+   *
+   * This function returns the MIME type of a file by inspecting its extension.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param path Path to the file.
+   * @return The MIME type. This is a statically-allocated
+   * string, do not free it.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE const char* OrthancPluginAutodetectMimeType(
+    OrthancPluginContext*  context,
+    const char*            path)
+  {
+    const char* result = NULL;
+
+    _OrthancPluginRetrieveStaticString params;
+    params.result = &result;
+    params.argument = path;
+
+    if (context->InvokeService(context, _OrthancPluginService_AutodetectMimeType, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+
+  typedef struct
+  {
+    const char*               name;
+    float                     value;
+    OrthancPluginMetricsType  type;
+  } _OrthancPluginSetMetricsValue;
+
+  /**
+   * @brief Set the value of a metrics.
+   *
+   * This function sets the value of a metrics to monitor the behavior
+   * of the plugin through tools such as Prometheus. The values of all
+   * the metrics are stored within the Orthanc context.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param name The name of the metrics to be set.
+   * @param value The value of the metrics.
+   * @param type The type of the metrics. This parameter is only taken into consideration
+   * the first time this metrics is set.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginSetMetricsValue(
+    OrthancPluginContext*     context,
+    const char*               name,
+    float                     value,
+    OrthancPluginMetricsType  type)
+  {
+    _OrthancPluginSetMetricsValue params;
+    params.name = name;
+    params.value = value;
+    params.type = type;
+    context->InvokeService(context, _OrthancPluginService_SetMetricsValue, &params);
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginRefreshMetricsCallback  callback;
+  } _OrthancPluginRegisterRefreshMetricsCallback;
+
+  /**
+   * @brief Register a callback to refresh the metrics.
+   *
+   * This function registers a callback to refresh the metrics. The
+   * callback must make calls to OrthancPluginSetMetricsValue().
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param callback The callback function to handle the refresh.
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterRefreshMetricsCallback(
+    OrthancPluginContext*               context,
+    OrthancPluginRefreshMetricsCallback callback)
+  {
+    _OrthancPluginRegisterRefreshMetricsCallback params;
+    params.callback = callback;
+    context->InvokeService(context, _OrthancPluginService_RegisterRefreshMetricsCallback, &params);
+  }
+
+
+
+
+  typedef struct
+  {
+    char**                               target;
+    const void*                          dicom;
+    uint32_t                             dicomSize;
+    OrthancPluginDicomWebBinaryCallback  callback;
+  } _OrthancPluginEncodeDicomWeb;
+
+  /**
+   * @brief Convert a DICOM instance to DICOMweb JSON.
+   *
+   * This function converts a memory buffer containing a DICOM instance,
+   * into its DICOMweb JSON representation.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param dicom Pointer to the DICOM instance.
+   * @param dicomSize Size of the DICOM instance.
+   * @param callback Callback to set the value of the binary tags.
+   * @see OrthancPluginCreateDicom()
+   * @return The NULL value in case of error, or the JSON document. This string must
+   * be freed by OrthancPluginFreeString().
+   * @deprecated OrthancPluginEncodeDicomWebJson2()
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebJson(
+    OrthancPluginContext*                context,
+    const void*                          dicom,
+    uint32_t                             dicomSize,
+    OrthancPluginDicomWebBinaryCallback  callback)
+  {
+    char* target = NULL;
+    
+    _OrthancPluginEncodeDicomWeb params;
+    params.target = &target;
+    params.dicom = dicom;
+    params.dicomSize = dicomSize;
+    params.callback = callback;
+
+    if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebJson, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+
+  /**
+   * @brief Convert a DICOM instance to DICOMweb XML.
+   *
+   * This function converts a memory buffer containing a DICOM instance,
+   * into its DICOMweb XML representation.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param dicom Pointer to the DICOM instance.
+   * @param dicomSize Size of the DICOM instance.
+   * @param callback Callback to set the value of the binary tags.
+   * @return The NULL value in case of error, or the XML document. This string must
+   * be freed by OrthancPluginFreeString().
+   * @see OrthancPluginCreateDicom()
+   * @deprecated OrthancPluginEncodeDicomWebXml2()
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebXml(
+    OrthancPluginContext*                context,
+    const void*                          dicom,
+    uint32_t                             dicomSize,
+    OrthancPluginDicomWebBinaryCallback  callback)
+  {
+    char* target = NULL;
+    
+    _OrthancPluginEncodeDicomWeb params;
+    params.target = &target;
+    params.dicom = dicom;
+    params.dicomSize = dicomSize;
+    params.callback = callback;
+
+    if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebXml, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+  
+
+
+  typedef struct
+  {
+    char**                                target;
+    const void*                           dicom;
+    uint32_t                              dicomSize;
+    OrthancPluginDicomWebBinaryCallback2  callback;
+    void*                                 payload;
+  } _OrthancPluginEncodeDicomWeb2;
+
+  /**
+   * @brief Convert a DICOM instance to DICOMweb JSON.
+   *
+   * This function converts a memory buffer containing a DICOM instance,
+   * into its DICOMweb JSON representation.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param dicom Pointer to the DICOM instance.
+   * @param dicomSize Size of the DICOM instance.
+   * @param callback Callback to set the value of the binary tags.
+   * @param payload User payload.
+   * @return The NULL value in case of error, or the JSON document. This string must
+   * be freed by OrthancPluginFreeString().
+   * @see OrthancPluginCreateDicom()
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebJson2(
+    OrthancPluginContext*                 context,
+    const void*                           dicom,
+    uint32_t                              dicomSize,
+    OrthancPluginDicomWebBinaryCallback2  callback,
+    void*                                 payload)
+  {
+    char* target = NULL;
+    
+    _OrthancPluginEncodeDicomWeb2 params;
+    params.target = &target;
+    params.dicom = dicom;
+    params.dicomSize = dicomSize;
+    params.callback = callback;
+    params.payload = payload;
+
+    if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebJson2, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+
+  /**
+   * @brief Convert a DICOM instance to DICOMweb XML.
+   *
+   * This function converts a memory buffer containing a DICOM instance,
+   * into its DICOMweb XML representation.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param dicom Pointer to the DICOM instance.
+   * @param dicomSize Size of the DICOM instance.
+   * @param callback Callback to set the value of the binary tags.
+   * @param payload User payload.
+   * @return The NULL value in case of error, or the XML document. This string must
+   * be freed by OrthancPluginFreeString().
+   * @see OrthancPluginCreateDicom()
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginEncodeDicomWebXml2(
+    OrthancPluginContext*                 context,
+    const void*                           dicom,
+    uint32_t                              dicomSize,
+    OrthancPluginDicomWebBinaryCallback2  callback,
+    void*                                 payload)
+  {
+    char* target = NULL;
+    
+    _OrthancPluginEncodeDicomWeb2 params;
+    params.target = &target;
+    params.dicom = dicom;
+    params.dicomSize = dicomSize;
+    params.callback = callback;
+    params.payload = payload;
+
+    if (context->InvokeService(context, _OrthancPluginService_EncodeDicomWebXml2, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+  
+
+
+  /**
+   * @brief Callback executed when a HTTP header is received during a chunked transfer.
+   *
+   * Signature of a callback function that is called by Orthanc acting
+   * as a HTTP client during a chunked HTTP transfer, as soon as it
+   * receives one HTTP header from the answer of the remote HTTP
+   * server.
+   *
+   * @see OrthancPluginChunkedHttpClient()
+   * @param answer The user payload, as provided by the calling plugin.
+   * @param key The key of the HTTP header.
+   * @param value The value of the HTTP header.
+   * @return 0 if success, or the error code if failure.
+   * @ingroup Toolbox
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginChunkedClientAnswerAddHeader) (
+    void* answer,
+    const char* key,
+    const char* value);
+
+
+  /**
+   * @brief Callback executed when an answer chunk is received during a chunked transfer.
+   *
+   * Signature of a callback function that is called by Orthanc acting
+   * as a HTTP client during a chunked HTTP transfer, as soon as it
+   * receives one data chunk from the answer of the remote HTTP
+   * server.
+   *
+   * @see OrthancPluginChunkedHttpClient()
+   * @param answer The user payload, as provided by the calling plugin.
+   * @param data The content of the data chunk.
+   * @param size The size of the data chunk.
+   * @return 0 if success, or the error code if failure.
+   * @ingroup Toolbox
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginChunkedClientAnswerAddChunk) (
+    void* answer,
+    const void* data,
+    uint32_t size);
+  
+
+  /**
+   * @brief Callback to know whether the request body is entirely read during a chunked transfer 
+   *
+   * Signature of a callback function that is called by Orthanc acting
+   * as a HTTP client during a chunked HTTP transfer, while reading
+   * the body of a POST or PUT request. The plugin must answer "1" as
+   * soon as the body is entirely read: The "request" data structure
+   * must act as an iterator.
+   *
+   * @see OrthancPluginChunkedHttpClient()
+   * @param request The user payload, as provided by the calling plugin.
+   * @return "1" if the body is over, or "0" if there is still data to be read.
+   * @ingroup Toolbox
+   **/
+  typedef uint8_t (*OrthancPluginChunkedClientRequestIsDone) (void* request);
+
+
+  /**
+   * @brief Callback to advance in the request body during a chunked transfer 
+   *
+   * Signature of a callback function that is called by Orthanc acting
+   * as a HTTP client during a chunked HTTP transfer, while reading
+   * the body of a POST or PUT request. This function asks the plugin
+   * to advance to the next chunk of data of the request body: The
+   * "request" data structure must act as an iterator.
+   *
+   * @see OrthancPluginChunkedHttpClient()
+   * @param request The user payload, as provided by the calling plugin.
+   * @return 0 if success, or the error code if failure.
+   * @ingroup Toolbox
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginChunkedClientRequestNext) (void* request);
+
+
+  /**
+   * @brief Callback to read the current chunk of the request body during a chunked transfer 
+   *
+   * Signature of a callback function that is called by Orthanc acting
+   * as a HTTP client during a chunked HTTP transfer, while reading
+   * the body of a POST or PUT request. The plugin must provide the
+   * content of the current chunk of data of the request body.
+   *
+   * @see OrthancPluginChunkedHttpClient()
+   * @param request The user payload, as provided by the calling plugin.
+   * @return The content of the current request chunk.
+   * @ingroup Toolbox
+   **/
+  typedef const void* (*OrthancPluginChunkedClientRequestGetChunkData) (void* request);
+
+
+  /**
+   * @brief Callback to read the size of the current request chunk during a chunked transfer 
+   *
+   * Signature of a callback function that is called by Orthanc acting
+   * as a HTTP client during a chunked HTTP transfer, while reading
+   * the body of a POST or PUT request. The plugin must provide the
+   * size of the current chunk of data of the request body.
+   *
+   * @see OrthancPluginChunkedHttpClient()
+   * @param request The user payload, as provided by the calling plugin.
+   * @return The size of the current request chunk.
+   * @ingroup Toolbox
+   **/
+  typedef uint32_t (*OrthancPluginChunkedClientRequestGetChunkSize) (void* request);
+
+  
+  typedef struct
+  {
+    void*                                          answer;
+    OrthancPluginChunkedClientAnswerAddChunk       answerAddChunk;
+    OrthancPluginChunkedClientAnswerAddHeader      answerAddHeader;
+    uint16_t*                                      httpStatus;
+    OrthancPluginHttpMethod                        method;
+    const char*                                    url;
+    uint32_t                                       headersCount;
+    const char* const*                             headersKeys;
+    const char* const*                             headersValues;
+    void*                                          request;
+    OrthancPluginChunkedClientRequestIsDone        requestIsDone;
+    OrthancPluginChunkedClientRequestGetChunkData  requestChunkData;
+    OrthancPluginChunkedClientRequestGetChunkSize  requestChunkSize;
+    OrthancPluginChunkedClientRequestNext          requestNext;
+    const char*                                    username;
+    const char*                                    password;
+    uint32_t                                       timeout;
+    const char*                                    certificateFile;
+    const char*                                    certificateKeyFile;
+    const char*                                    certificateKeyPassword;
+    uint8_t                                        pkcs11;
+  } _OrthancPluginChunkedHttpClient;
+
+  
+  /**
+   * @brief Issue a HTTP call, using chunked HTTP transfers.
+   * 
+   * Make a HTTP call to the given URL using chunked HTTP
+   * transfers. The request body is provided as an iterator over data
+   * chunks. The answer is provided as a sequence of function calls
+   * with the individual HTTP headers and answer chunks.
+   * 
+   * Contrarily to OrthancPluginHttpClient() that entirely stores the
+   * request body and the answer body in memory buffers, this function
+   * uses chunked HTTP transfers. This results in a lower memory
+   * consumption. Pay attention to the fact that Orthanc servers with
+   * version <= 1.5.6 do not support chunked transfers: You must use
+   * OrthancPluginHttpClient() if contacting such older servers.
+   *
+   * The HTTP request will be done accordingly to the global
+   * configuration of Orthanc (in particular, the options "HttpProxy",
+   * "HttpTimeout", "HttpsVerifyPeers", "HttpsCACertificates", and
+   * "Pkcs11" will be taken into account).
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param answer The user payload for the answer body. It will be provided to the callbacks for the answer.
+   * @param answerAddChunk Callback function to report a data chunk from the answer body.
+   * @param answerAddHeader Callback function to report an HTTP header sent by the remote server.
+   * @param httpStatus The HTTP status after the execution of the request (out argument).
+   * @param method HTTP method to be used.
+   * @param url The URL of interest.
+   * @param headersCount The number of HTTP headers.
+   * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
+   * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
+   * @param request The user payload containing the request body, and acting as an iterator.
+   * It will be provided to the callbacks for the request.
+   * @param requestIsDone Callback function to tell whether the request body is entirely read.
+   * @param requestChunkData Callback function to get the content of the current data chunk of the request body.
+   * @param requestChunkSize Callback function to get the size of the current data chunk of the request body.
+   * @param requestNext Callback function to advance to the next data chunk of the request body.
+   * @param username The username (can be <tt>NULL</tt> if no password protection).
+   * @param password The password (can be <tt>NULL</tt> if no password protection).
+   * @param timeout Timeout in seconds (0 for default timeout).
+   * @param certificateFile Path to the client certificate for HTTPS, in PEM format
+   * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
+   * @param certificateKeyFile Path to the key of the client certificate for HTTPS, in PEM format
+   * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
+   * @param certificateKeyPassword Password to unlock the key of the client certificate 
+   * (can be <tt>NULL</tt> if no client certificate or if not using HTTPS).
+   * @param pkcs11 Enable PKCS#11 client authentication for hardware security modules and smart cards.
+   * @return 0 if success, or the error code if failure.
+   * @see OrthancPluginHttpClient()
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginChunkedHttpClient(
+    OrthancPluginContext*                          context,
+    void*                                          answer,
+    OrthancPluginChunkedClientAnswerAddChunk       answerAddChunk,
+    OrthancPluginChunkedClientAnswerAddHeader      answerAddHeader,
+    uint16_t*                                      httpStatus,
+    OrthancPluginHttpMethod                        method,
+    const char*                                    url,
+    uint32_t                                       headersCount,
+    const char* const*                             headersKeys,
+    const char* const*                             headersValues,
+    void*                                          request,
+    OrthancPluginChunkedClientRequestIsDone        requestIsDone,
+    OrthancPluginChunkedClientRequestGetChunkData  requestChunkData,
+    OrthancPluginChunkedClientRequestGetChunkSize  requestChunkSize,
+    OrthancPluginChunkedClientRequestNext          requestNext,
+    const char*                                    username,
+    const char*                                    password,
+    uint32_t                                       timeout,
+    const char*                                    certificateFile,
+    const char*                                    certificateKeyFile,
+    const char*                                    certificateKeyPassword,
+    uint8_t                                        pkcs11)
+  {
+    _OrthancPluginChunkedHttpClient params;
+    memset(&params, 0, sizeof(params));
+
+    /* In common with OrthancPluginHttpClient() */
+    params.httpStatus = httpStatus;
+    params.method = method;
+    params.url = url;
+    params.headersCount = headersCount;
+    params.headersKeys = headersKeys;
+    params.headersValues = headersValues;
+    params.username = username;
+    params.password = password;
+    params.timeout = timeout;
+    params.certificateFile = certificateFile;
+    params.certificateKeyFile = certificateKeyFile;
+    params.certificateKeyPassword = certificateKeyPassword;
+    params.pkcs11 = pkcs11;
+
+    /* For chunked body/answer */
+    params.answer = answer;
+    params.answerAddChunk = answerAddChunk;
+    params.answerAddHeader = answerAddHeader;
+    params.request = request;
+    params.requestIsDone = requestIsDone;
+    params.requestChunkData = requestChunkData;
+    params.requestChunkSize = requestChunkSize;
+    params.requestNext = requestNext;
+
+    return context->InvokeService(context, _OrthancPluginService_ChunkedHttpClient, &params);
+  }
+
+
+
+  /**
+   * @brief Opaque structure that reads the content of a HTTP request body during a chunked HTTP transfer.
+   * @ingroup Callback
+   **/
+  typedef struct _OrthancPluginServerChunkedRequestReader_t OrthancPluginServerChunkedRequestReader;
+
+
+
+  /**
+   * @brief Callback to create a reader to handle incoming chunked HTTP transfers.
+   *
+   * Signature of a callback function that is called by Orthanc acting
+   * as a HTTP server that supports chunked HTTP transfers. This
+   * callback is only invoked if the HTTP method is POST or PUT. The
+   * callback must create an user-specific "reader" object that will
+   * be fed with the body of the incoming body.
+   * 
+   * @see OrthancPluginRegisterChunkedRestCallback()
+   * @param reader Memory location that must be filled with the newly-created reader.
+   * @param url The URI that is accessed.
+   * @param request The body of the HTTP request. Note that "body" and "bodySize" are not used.
+   * @return 0 if success, or the error code if failure.
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginServerChunkedRequestReaderFactory) (
+    OrthancPluginServerChunkedRequestReader**  reader,
+    const char*                                url,
+    const OrthancPluginHttpRequest*            request);
+
+  
+  /**
+   * @brief Callback invoked whenever a new data chunk is available during a chunked transfer.
+   *
+   * Signature of a callback function that is called by Orthanc acting
+   * as a HTTP server that supports chunked HTTP transfers. This callback
+   * is invoked as soon as a new data chunk is available for the request body.
+   * 
+   * @see OrthancPluginRegisterChunkedRestCallback()
+   * @param reader The user payload, as created by the OrthancPluginServerChunkedRequestReaderFactory() callback.
+   * @param data The content of the data chunk.
+   * @param size The size of the data chunk.
+   * @return 0 if success, or the error code if failure.
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginServerChunkedRequestReaderAddChunk) (
+    OrthancPluginServerChunkedRequestReader* reader,
+    const void*                              data,
+    uint32_t                                 size);
+    
+
+  /**
+   * @brief Callback invoked whenever the request body is entirely received.
+   *
+   * Signature of a callback function that is called by Orthanc acting
+   * as a HTTP server that supports chunked HTTP transfers. This
+   * callback is invoked as soon as the full body of the HTTP request
+   * is available. The plugin can then send its answer thanks to the
+   * provided "output" object.
+   * 
+   * @see OrthancPluginRegisterChunkedRestCallback()
+   * @param reader The user payload, as created by the OrthancPluginServerChunkedRequestReaderFactory() callback.
+   * @param output The HTTP connection to the client application.
+   * @return 0 if success, or the error code if failure.
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginServerChunkedRequestReaderExecute) (
+    OrthancPluginServerChunkedRequestReader* reader,
+    OrthancPluginRestOutput*                 output);
+    
+
+  /**
+   * @brief Callback invoked to release the resources associated with an incoming HTTP chunked transfer.
+   *
+   * Signature of a callback function that is called by Orthanc acting
+   * as a HTTP server that supports chunked HTTP transfers. This
+   * callback is invoked to release all the resources allocated by the
+   * given reader. Note that this function might be invoked even if
+   * the entire body was not read, to deal with client error or
+   * disconnection.
+   * 
+   * @see OrthancPluginRegisterChunkedRestCallback()
+   * @param reader The user payload, as created by the OrthancPluginServerChunkedRequestReaderFactory() callback.
+   **/
+  typedef void (*OrthancPluginServerChunkedRequestReaderFinalize) (
+    OrthancPluginServerChunkedRequestReader* reader);
+  
+  typedef struct
+  {
+    const char*                                      pathRegularExpression;
+    OrthancPluginRestCallback                        getHandler;
+    OrthancPluginServerChunkedRequestReaderFactory   postHandler;
+    OrthancPluginRestCallback                        deleteHandler;
+    OrthancPluginServerChunkedRequestReaderFactory   putHandler;
+    OrthancPluginServerChunkedRequestReaderAddChunk  addChunk;
+    OrthancPluginServerChunkedRequestReaderExecute   execute;
+    OrthancPluginServerChunkedRequestReaderFinalize  finalize;
+  } _OrthancPluginChunkedRestCallback;
+
+
+  /**
+   * @brief Register a REST callback to handle chunked HTTP transfers.
+   *
+   * This function registers a REST callback against a regular
+   * expression for a URI. This function must be called during the
+   * initialization of the plugin, i.e. inside the
+   * OrthancPluginInitialize() public function.
+   *
+   * Contrarily to OrthancPluginRegisterRestCallback(), the callbacks
+   * will NOT be invoked in mutual exclusion, so it is up to the
+   * plugin to implement the required locking mechanisms.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param pathRegularExpression Regular expression for the URI. May contain groups. 
+   * @param getHandler The callback function to handle REST calls using the GET HTTP method.
+   * @param postHandler The callback function to handle REST calls using the POST HTTP method.
+   * @param deleteHandler The callback function to handle REST calls using the DELETE HTTP method.
+   * @param putHandler The callback function to handle REST calls using the PUT HTTP method.
+   * @param addChunk The callback invoked when a new chunk is available for the request body of a POST or PUT call.
+   * @param execute The callback invoked once the entire body of a POST or PUT call is read.
+   * @param finalize The callback invoked to release the resources associated with a POST or PUT call.
+   * @see OrthancPluginRegisterRestCallbackNoLock()
+   *
+   * @note
+   * The regular expression is case sensitive and must follow the
+   * [Perl syntax](https://www.boost.org/doc/libs/1_67_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html).
+   *
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterChunkedRestCallback(
+    OrthancPluginContext*                            context,
+    const char*                                      pathRegularExpression,
+    OrthancPluginRestCallback                        getHandler,
+    OrthancPluginServerChunkedRequestReaderFactory   postHandler,
+    OrthancPluginRestCallback                        deleteHandler,
+    OrthancPluginServerChunkedRequestReaderFactory   putHandler,
+    OrthancPluginServerChunkedRequestReaderAddChunk  addChunk,
+    OrthancPluginServerChunkedRequestReaderExecute   execute,
+    OrthancPluginServerChunkedRequestReaderFinalize  finalize)
+  {
+    _OrthancPluginChunkedRestCallback params;
+    params.pathRegularExpression = pathRegularExpression;
+    params.getHandler = getHandler;
+    params.postHandler = postHandler;
+    params.deleteHandler = deleteHandler;
+    params.putHandler = putHandler;
+    params.addChunk = addChunk;
+    params.execute = execute;
+    params.finalize = finalize;
+
+    context->InvokeService(context, _OrthancPluginService_RegisterChunkedRestCallback, &params);
+  }
+
+
+
+
+
+  typedef struct
+  {
+    char**       result;
+    uint16_t     group;
+    uint16_t     element;
+    const char*  privateCreator;
+  } _OrthancPluginGetTagName;
+
+  /**
+   * @brief Returns the symbolic name of a DICOM tag.
+   *
+   * This function makes a lookup to the dictionary of DICOM tags that
+   * are known to Orthanc, and returns the symbolic name of a DICOM tag.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param group The group of the tag.
+   * @param element The element of the tag.
+   * @param privateCreator For private tags, the name of the private creator (can be NULL).
+   * @return NULL in the case of an error, or a newly allocated string
+   * containing the path. This string must be freed by
+   * OrthancPluginFreeString().
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetTagName(
+    OrthancPluginContext*  context,
+    uint16_t               group,
+    uint16_t               element,
+    const char*            privateCreator)
+  {
+    char* result;
+
+    _OrthancPluginGetTagName params;
+    params.result = &result;
+    params.group = group;
+    params.element = element;
+    params.privateCreator = privateCreator;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetTagName, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+
+  /**
+   * @brief Callback executed by the storage commitment SCP.
+   *
+   * Signature of a factory function that creates an object to handle
+   * one incoming storage commitment request.
+   *
+   * @remark The factory receives the list of the SOP class/instance
+   * UIDs of interest to the remote storage commitment SCU. This gives
+   * the factory the possibility to start some prefetch process
+   * upfront in the background, before the handler object is actually
+   * queried about the status of these DICOM instances.
+   *
+   * @param handler Output variable where the factory puts the handler object it created.
+   * @param jobId ID of the Orthanc job that is responsible for handling 
+   * the storage commitment request. This job will successively look for the
+   * status of all the individual queried DICOM instances.
+   * @param transactionUid UID of the storage commitment transaction
+   * provided by the storage commitment SCU. It contains the value of the
+   * (0008,1195) DICOM tag.
+   * @param sopClassUids Array of the SOP class UIDs (0008,0016) that are queried by the SCU.
+   * @param sopInstanceUids Array of the SOP instance UIDs (0008,0018) that are queried by the SCU.
+   * @param countInstances Number of DICOM instances that are queried. This is the size
+   * of the `sopClassUids` and `sopInstanceUids` arrays.
+   * @param remoteAet The AET of the storage commitment SCU.
+   * @param calledAet The AET used by the SCU to contact the storage commitment SCP (i.e. Orthanc).
+   * @return 0 if success, other value if error.
+   * @ingroup DicomCallbacks
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginStorageCommitmentFactory) (
+    void**              handler /* out */,
+    const char*         jobId,
+    const char*         transactionUid,
+    const char* const*  sopClassUids,
+    const char* const*  sopInstanceUids,
+    uint32_t            countInstances,
+    const char*         remoteAet,
+    const char*         calledAet);
+
+  
+  /**
+   * @brief Callback to free one storage commitment SCP handler.
+   * 
+   * Signature of a callback function that releases the resources
+   * allocated by the factory of the storage commitment SCP. The
+   * handler is the return value of a previous call to the
+   * OrthancPluginStorageCommitmentFactory() callback.
+   *
+   * @param handler The handler object to be destructed.
+   * @ingroup DicomCallbacks
+   **/
+  typedef void (*OrthancPluginStorageCommitmentDestructor) (void* handler);
+
+
+  /**
+   * @brief Callback to get the status of one DICOM instance in the
+   * storage commitment SCP.
+   *
+   * Signature of a callback function that is successively invoked for
+   * each DICOM instance that is queried by the remote storage
+   * commitment SCU.  The function must be tought of as a method of
+   * the handler object that was created by a previous call to the
+   * OrthancPluginStorageCommitmentFactory() callback. After each call
+   * to this method, the progress of the associated Orthanc job is
+   * updated.
+   * 
+   * @param target Output variable where to put the status for the queried instance.
+   * @param handler The handler object associated with this storage commitment request.
+   * @param sopClassUid The SOP class UID (0008,0016) of interest.
+   * @param sopInstanceUid The SOP instance UID (0008,0018) of interest.
+   * @ingroup DicomCallbacks
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginStorageCommitmentLookup) (
+    OrthancPluginStorageCommitmentFailureReason* target,
+    void* handler,
+    const char* sopClassUid,
+    const char* sopInstanceUid);
+    
+    
+  typedef struct
+  {
+    OrthancPluginStorageCommitmentFactory     factory;
+    OrthancPluginStorageCommitmentDestructor  destructor;
+    OrthancPluginStorageCommitmentLookup      lookup;
+  } _OrthancPluginRegisterStorageCommitmentScpCallback;
+
+  /**
+   * @brief Register a callback to handle incoming requests to the storage commitment SCP.
+   *
+   * This function registers a callback to handle storage commitment SCP requests.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param factory Factory function that creates the handler object
+   * for incoming storage commitment requests.
+   * @param destructor Destructor function to destroy the handler object.
+   * @param lookup Callback method to get the status of one DICOM instance.
+   * @return 0 if success, other value if error.
+   * @ingroup DicomCallbacks
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterStorageCommitmentScpCallback(
+    OrthancPluginContext*                     context,
+    OrthancPluginStorageCommitmentFactory     factory,
+    OrthancPluginStorageCommitmentDestructor  destructor,
+    OrthancPluginStorageCommitmentLookup      lookup)
+  {
+    _OrthancPluginRegisterStorageCommitmentScpCallback params;
+    params.factory = factory;
+    params.destructor = destructor;
+    params.lookup = lookup;
+    return context->InvokeService(context, _OrthancPluginService_RegisterStorageCommitmentScpCallback, &params);
+  }
+  
+
+
+  /**
+   * @brief Callback to filter incoming DICOM instances received by Orthanc.
+   *
+   * Signature of a callback function that is triggered whenever
+   * Orthanc receives a new DICOM instance (e.g. through REST API or
+   * DICOM protocol), and that answers whether this DICOM instance
+   * should be accepted or discarded by Orthanc.
+   *
+   * Note that the metadata information is not available
+   * (i.e. GetInstanceMetadata() should not be used on "instance").
+   *
+   * @warning Your callback function will be called synchronously with
+   * the core of Orthanc. This implies that deadlocks might emerge if
+   * you call other core primitives of Orthanc in your callback (such
+   * deadlocks are particularly visible in the presence of other plugins
+   * or Lua scripts). It is thus strongly advised to avoid any call to
+   * the REST API of Orthanc in the callback. If you have to call
+   * other primitives of Orthanc, you should make these calls in a
+   * separate thread, passing the pending events to be processed
+   * through a message queue.
+   * 
+   * @param instance The received DICOM instance.
+   * @return 0 to discard the instance, 1 to store the instance, -1 if error.
+   * @ingroup Callback
+   **/
+  typedef int32_t (*OrthancPluginIncomingDicomInstanceFilter) (
+    const OrthancPluginDicomInstance* instance);
+
+
+  typedef struct
+  {
+    OrthancPluginIncomingDicomInstanceFilter callback;
+  } _OrthancPluginIncomingDicomInstanceFilter;
+
+  /**
+   * @brief Register a callback to filter incoming DICOM instances.
+   *
+   * This function registers a custom callback to filter incoming
+   * DICOM instances received by Orthanc (either through the REST API
+   * or through the DICOM protocol).
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param callback The callback.
+   * @return 0 if success, other value if error.
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingDicomInstanceFilter(
+    OrthancPluginContext*                     context,
+    OrthancPluginIncomingDicomInstanceFilter  callback)
+  {
+    _OrthancPluginIncomingDicomInstanceFilter params;
+    params.callback = callback;
+
+    return context->InvokeService(context, _OrthancPluginService_RegisterIncomingDicomInstanceFilter, &params);
+  }
+
+
+  /**
+   * @brief Callback to filter incoming DICOM instances received by 
+   * Orthanc through C-STORE.
+   *
+   * Signature of a callback function that is triggered whenever
+   * Orthanc receives a new DICOM instance using DICOM C-STORE, and
+   * that answers whether this DICOM instance should be accepted or
+   * discarded by Orthanc. If the instance is discarded, the callback
+   * can specify the DIMSE error code answered by the Orthanc C-STORE
+   * SCP.
+   *
+   * Note that the metadata information is not available
+   * (i.e. GetInstanceMetadata() should not be used on "instance").
+   *
+   * @warning Your callback function will be called synchronously with
+   * the core of Orthanc. This implies that deadlocks might emerge if
+   * you call other core primitives of Orthanc in your callback (such
+   * deadlocks are particularly visible in the presence of other plugins
+   * or Lua scripts). It is thus strongly advised to avoid any call to
+   * the REST API of Orthanc in the callback. If you have to call
+   * other primitives of Orthanc, you should make these calls in a
+   * separate thread, passing the pending events to be processed
+   * through a message queue.
+   *
+   * @param dimseStatus If the DICOM instance is discarded, 
+   * DIMSE status to be sent by the C-STORE SCP of Orthanc
+   * @param instance The received DICOM instance.
+   * @return 0 to discard the instance, 1 to store the instance, -1 if error.
+   * @ingroup Callback
+   **/
+  typedef int32_t (*OrthancPluginIncomingCStoreInstanceFilter) (
+    uint16_t* dimseStatus /* out */,
+    const OrthancPluginDicomInstance* instance);
+
+
+  typedef struct
+  {
+    OrthancPluginIncomingCStoreInstanceFilter callback;
+  } _OrthancPluginIncomingCStoreInstanceFilter;
+
+  /**
+   * @brief Register a callback to filter incoming DICOM instances
+   * received by Orthanc through C-STORE.
+   *
+   * This function registers a custom callback to filter incoming
+   * DICOM instances received by Orthanc through the DICOM protocol.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param callback The callback.
+   * @return 0 if success, other value if error.
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterIncomingCStoreInstanceFilter(
+    OrthancPluginContext*                      context,
+    OrthancPluginIncomingCStoreInstanceFilter  callback)
+  {
+    _OrthancPluginIncomingCStoreInstanceFilter params;
+    params.callback = callback;
+
+    return context->InvokeService(context, _OrthancPluginService_RegisterIncomingCStoreInstanceFilter, &params);
+  }
+
+  /**
+   * @brief Callback to keep/discard/modify a DICOM instance received
+   * by Orthanc from any source (C-STORE or REST API)
+   *
+   * Signature of a callback function that is triggered whenever
+   * Orthanc receives a new DICOM instance (through DICOM protocol or
+   * REST API), and that specifies an action to be applied to this
+   * newly received instance. The instance can be kept as it is, can
+   * be modified by the plugin, or can be discarded.
+   *
+   * This callback is invoked immediately after reception, i.e. before
+   * transcoding and before filtering
+   * (cf. OrthancPluginRegisterIncomingDicomInstanceFilter()).
+   *
+   * @warning Your callback function will be called synchronously with
+   * the core of Orthanc. This implies that deadlocks might emerge if
+   * you call other core primitives of Orthanc in your callback (such
+   * deadlocks are particularly visible in the presence of other plugins
+   * or Lua scripts). It is thus strongly advised to avoid any call to
+   * the REST API of Orthanc in the callback. If you have to call
+   * other primitives of Orthanc, you should make these calls in a
+   * separate thread, passing the pending events to be processed
+   * through a message queue.
+   *
+   * @param modifiedDicomBuffer A buffer containing the modified DICOM (output).
+   * This buffer must be allocated using OrthancPluginCreateMemoryBuffer64()
+   * and will be freed by the Orthanc core.
+   * @param receivedDicomBuffer A buffer containing the received DICOM (input).
+   * @param receivedDicomBufferSize The size of the received DICOM (input).
+   * @param origin The origin of the DICOM instance (input).
+   * @return `OrthancPluginReceivedInstanceAction_KeepAsIs` to accept the instance as is,<br/>
+   *         `OrthancPluginReceivedInstanceAction_Modify` to store the modified DICOM contained in `modifiedDicomBuffer`,<br/>
+   *         `OrthancPluginReceivedInstanceAction_Discard` to tell Orthanc to discard the instance.
+   * @ingroup Callback
+   **/
+  typedef OrthancPluginReceivedInstanceAction (*OrthancPluginReceivedInstanceCallback) (
+    OrthancPluginMemoryBuffer64* modifiedDicomBuffer,
+    const void* receivedDicomBuffer,
+    uint64_t receivedDicomBufferSize,
+    OrthancPluginInstanceOrigin origin);
+
+
+  typedef struct
+  {
+    OrthancPluginReceivedInstanceCallback callback;
+  } _OrthancPluginReceivedInstanceCallback;
+
+  /**
+   * @brief Register a callback to keep/discard/modify a DICOM instance received
+   * by Orthanc from any source (C-STORE or REST API)
+   *
+   * This function registers a custom callback to keep/discard/modify
+   * incoming DICOM instances received by Orthanc from any source
+   * (C-STORE or REST API).
+   * 
+   * @warning Contrarily to
+   * OrthancPluginRegisterIncomingCStoreInstanceFilter() and
+   * OrthancPluginRegisterIncomingDicomInstanceFilter() that can be
+   * called by multiple plugins,
+   * OrthancPluginRegisterReceivedInstanceCallback() can only be used
+   * by one single plugin.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param callback The callback.
+   * @return 0 if success, other value if error.
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterReceivedInstanceCallback(
+    OrthancPluginContext*                     context,
+    OrthancPluginReceivedInstanceCallback     callback)
+  {
+    _OrthancPluginReceivedInstanceCallback params;
+    params.callback = callback;
+
+    return context->InvokeService(context, _OrthancPluginService_RegisterReceivedInstanceCallback, &params);
+  }
+
+  /**
+   * @brief Get the transfer syntax of a DICOM file.
+   *
+   * This function returns a pointer to a newly created string that
+   * contains the transfer syntax UID of the DICOM instance. The empty
+   * string might be returned if this information is unknown.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param instance The instance of interest.
+   * @return The NULL value in case of error, or a string containing the
+   * transfer syntax UID. This string must be freed by OrthancPluginFreeString().
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceTransferSyntaxUid(
+    OrthancPluginContext*              context,
+    const OrthancPluginDicomInstance*  instance)
+  {
+    char* result;
+
+    _OrthancPluginAccessDicomInstance params;
+    memset(&params, 0, sizeof(params));
+    params.resultStringToFree = &result;
+    params.instance = instance;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetInstanceTransferSyntaxUid, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Check whether the DICOM file has pixel data.
+   *
+   * This function returns a Boolean value indicating whether the
+   * DICOM instance contains the pixel data (7FE0,0010) tag.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param instance The instance of interest.
+   * @return "1" if the DICOM instance contains pixel data, or "0" if
+   * the tag is missing, or "-1" in the case of an error.
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE int32_t OrthancPluginHasInstancePixelData(
+    OrthancPluginContext*             context,
+    const OrthancPluginDicomInstance* instance)
+  {
+    int64_t hasPixelData;
+
+    _OrthancPluginAccessDicomInstance params;
+    memset(&params, 0, sizeof(params));
+    params.resultInt64 = &hasPixelData;
+    params.instance = instance;
+
+    if (context->InvokeService(context, _OrthancPluginService_HasInstancePixelData, &params) != OrthancPluginErrorCode_Success ||
+        hasPixelData < 0 ||
+        hasPixelData > 1)
+    {
+      /* Error */
+      return -1;
+    }
+    else
+    {
+      return (hasPixelData != 0);
+    }
+  }
+
+
+
+
+
+
+  typedef struct
+  {
+    OrthancPluginDicomInstance**  target;
+    const void*                   buffer;
+    uint32_t                      size;
+    const char*                   transferSyntax;
+  } _OrthancPluginCreateDicomInstance;
+
+  /**
+   * @brief Parse a DICOM instance.
+   *
+   * This function parses a memory buffer that contains a DICOM
+   * file. The function returns a new pointer to a data structure that
+   * is managed by the Orthanc core.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param buffer The memory buffer containing the DICOM instance.
+   * @param size The size of the memory buffer.
+   * @return The newly allocated DICOM instance. It must be freed with OrthancPluginFreeDicomInstance().
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginDicomInstance* OrthancPluginCreateDicomInstance(
+    OrthancPluginContext*  context,
+    const void*            buffer,
+    uint32_t               size)
+  {
+    OrthancPluginDicomInstance* target = NULL;
+
+    _OrthancPluginCreateDicomInstance params;
+    params.target = &target;
+    params.buffer = buffer;
+    params.size = size;
+
+    if (context->InvokeService(context, _OrthancPluginService_CreateDicomInstance, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+  typedef struct
+  {
+    OrthancPluginDicomInstance*   dicom;
+  } _OrthancPluginFreeDicomInstance;
+
+  /**
+   * @brief Free a DICOM instance.
+   *
+   * This function frees a DICOM instance that was parsed using
+   * OrthancPluginCreateDicomInstance().
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param dicom The DICOM instance.
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE void  OrthancPluginFreeDicomInstance(
+    OrthancPluginContext*        context, 
+    OrthancPluginDicomInstance*  dicom)
+  {
+    _OrthancPluginFreeDicomInstance params;
+    params.dicom = dicom;
+
+    context->InvokeService(context, _OrthancPluginService_FreeDicomInstance, &params);
+  }
+
+
+  typedef struct
+  {
+    uint32_t*                             targetUint32;
+    OrthancPluginMemoryBuffer*            targetBuffer;
+    OrthancPluginImage**                  targetImage;
+    char**                                targetStringToFree;
+    const OrthancPluginDicomInstance*     instance;
+    uint32_t                              frameIndex;
+    OrthancPluginDicomToJsonFormat        format;
+    OrthancPluginDicomToJsonFlags         flags;
+    uint32_t                              maxStringLength;
+    OrthancPluginDicomWebBinaryCallback2  dicomWebCallback;
+    void*                                 dicomWebPayload;
+  } _OrthancPluginAccessDicomInstance2;
+
+  /**
+   * @brief Get the number of frames in a DICOM instance.
+   *
+   * This function returns the number of frames that are part of a
+   * DICOM image managed by the Orthanc core.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param instance The instance of interest.
+   * @return The number of frames (will be zero in the case of an error).
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE uint32_t OrthancPluginGetInstanceFramesCount(
+    OrthancPluginContext*             context,
+    const OrthancPluginDicomInstance* instance)
+  {
+    uint32_t count;
+
+    _OrthancPluginAccessDicomInstance2 params;
+    memset(&params, 0, sizeof(params));
+    params.targetUint32 = &count;
+    params.instance = instance;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetInstanceFramesCount, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return 0;
+    }
+    else
+    {
+      return count;
+    }
+  }
+
+
+  /**
+   * @brief Get the raw content of a frame in a DICOM instance.
+   *
+   * This function returns a memory buffer containing the raw content
+   * of a frame in a DICOM instance that is managed by the Orthanc
+   * core. This is notably useful for compressed transfer syntaxes, as
+   * it gives access to the embedded files (such as JPEG, JPEG-LS or
+   * JPEG2k). The Orthanc core transparently reassembles the fragments
+   * to extract the raw frame.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param instance The instance of interest.
+   * @param frameIndex The index of the frame of interest.
+   * @return 0 if success, or the error code if failure.
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginGetInstanceRawFrame(
+    OrthancPluginContext*             context,
+    OrthancPluginMemoryBuffer*        target,
+    const OrthancPluginDicomInstance* instance,
+    uint32_t                          frameIndex)
+  {
+    _OrthancPluginAccessDicomInstance2 params;
+    memset(&params, 0, sizeof(params));
+    params.targetBuffer = target;
+    params.instance = instance;
+    params.frameIndex = frameIndex;
+
+    return context->InvokeService(context, _OrthancPluginService_GetInstanceRawFrame, &params);
+  }
+
+
+  /**
+   * @brief Decode one frame from a DICOM instance.
+   *
+   * This function decodes one frame of a DICOM image that is managed
+   * by the Orthanc core.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param instance The instance of interest.
+   * @param frameIndex The index of the frame of interest.
+   * @return The uncompressed image. It must be freed with OrthancPluginFreeImage().
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginImage* OrthancPluginGetInstanceDecodedFrame(
+    OrthancPluginContext*             context,
+    const OrthancPluginDicomInstance* instance,
+    uint32_t                          frameIndex)
+  {
+    OrthancPluginImage* target = NULL;
+
+    _OrthancPluginAccessDicomInstance2 params;
+    memset(&params, 0, sizeof(params));
+    params.targetImage = &target;
+    params.instance = instance;
+    params.frameIndex = frameIndex;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetInstanceDecodedFrame, &params) != OrthancPluginErrorCode_Success)
+    {
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+  
+  /**
+   * @brief Parse and transcode a DICOM instance.
+   *
+   * This function parses a memory buffer that contains a DICOM file,
+   * then transcodes it to the given transfer syntax. The function
+   * returns a new pointer to a data structure that is managed by the
+   * Orthanc core.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param buffer The memory buffer containing the DICOM instance.
+   * @param size The size of the memory buffer.
+   * @param transferSyntax The transfer syntax UID for the transcoding.
+   * @return The newly allocated DICOM instance. It must be freed with OrthancPluginFreeDicomInstance().
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginDicomInstance* OrthancPluginTranscodeDicomInstance(
+    OrthancPluginContext*  context,
+    const void*            buffer,
+    uint32_t               size,
+    const char*            transferSyntax)
+  {
+    OrthancPluginDicomInstance* target = NULL;
+
+    _OrthancPluginCreateDicomInstance params;
+    params.target = &target;
+    params.buffer = buffer;
+    params.size = size;
+    params.transferSyntax = transferSyntax;
+
+    if (context->InvokeService(context, _OrthancPluginService_TranscodeDicomInstance, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+  /**
+   * @brief Writes a DICOM instance to a memory buffer.
+   *
+   * This function returns a memory buffer containing the
+   * serialization of a DICOM instance that is managed by the Orthanc
+   * core.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param instance The instance of interest.
+   * @return 0 if success, or the error code if failure.
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginSerializeDicomInstance(
+    OrthancPluginContext*             context,
+    OrthancPluginMemoryBuffer*        target,
+    const OrthancPluginDicomInstance* instance)
+  {
+    _OrthancPluginAccessDicomInstance2 params;
+    memset(&params, 0, sizeof(params));
+    params.targetBuffer = target;
+    params.instance = instance;
+
+    return context->InvokeService(context, _OrthancPluginService_SerializeDicomInstance, &params);
+  }
+  
+
+  /**
+   * @brief Format a DICOM memory buffer as a JSON string.
+   *
+   * This function takes as DICOM instance managed by the Orthanc
+   * core, and outputs a JSON string representing the tags of this
+   * DICOM file.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param instance The DICOM instance of interest.
+   * @param format The output format.
+   * @param flags Flags governing the output.
+   * @param maxStringLength The maximum length of a field. Too long fields will
+   * be output as "null". The 0 value means no maximum length.
+   * @return The NULL value if the case of an error, or the JSON
+   * string. This string must be freed by OrthancPluginFreeString().
+   * @ingroup DicomInstance
+   * @see OrthancPluginDicomBufferToJson
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceAdvancedJson(
+    OrthancPluginContext*              context,
+    const OrthancPluginDicomInstance*  instance,
+    OrthancPluginDicomToJsonFormat     format,
+    OrthancPluginDicomToJsonFlags      flags, 
+    uint32_t                           maxStringLength)
+  {
+    char* result = NULL;
+
+    _OrthancPluginAccessDicomInstance2 params;
+    memset(&params, 0, sizeof(params));
+    params.targetStringToFree = &result;
+    params.instance = instance;
+    params.format = format;
+    params.flags = flags;
+    params.maxStringLength = maxStringLength;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetInstanceAdvancedJson, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+  /**
+   * @brief Convert a DICOM instance to DICOMweb JSON.
+   *
+   * This function converts a DICOM instance that is managed by the
+   * Orthanc core, into its DICOMweb JSON representation.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param instance The DICOM instance of interest.
+   * @param callback Callback to set the value of the binary tags.
+   * @param payload User payload.
+   * @return The NULL value in case of error, or the JSON document. This string must
+   * be freed by OrthancPluginFreeString().
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceDicomWebJson(
+    OrthancPluginContext*                 context,
+    const OrthancPluginDicomInstance*     instance,
+    OrthancPluginDicomWebBinaryCallback2  callback,
+    void*                                 payload)
+  {
+    char* target = NULL;
+    
+    _OrthancPluginAccessDicomInstance2 params;
+    params.targetStringToFree = &target;
+    params.instance = instance;
+    params.dicomWebCallback = callback;
+    params.dicomWebPayload = payload;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetInstanceDicomWebJson, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+  
+
+  /**
+   * @brief Convert a DICOM instance to DICOMweb XML.
+   *
+   * This function converts a DICOM instance that is managed by the
+   * Orthanc core, into its DICOMweb XML representation.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param instance The DICOM instance of interest.
+   * @param callback Callback to set the value of the binary tags.
+   * @param payload User payload.
+   * @return The NULL value in case of error, or the XML document. This string must
+   * be freed by OrthancPluginFreeString().
+   * @ingroup DicomInstance
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginGetInstanceDicomWebXml(
+    OrthancPluginContext*                 context,
+    const OrthancPluginDicomInstance*     instance,
+    OrthancPluginDicomWebBinaryCallback2  callback,
+    void*                                 payload)
+  {
+    char* target = NULL;
+    
+    _OrthancPluginAccessDicomInstance2 params;
+    params.targetStringToFree = &target;
+    params.instance = instance;
+    params.dicomWebCallback = callback;
+    params.dicomWebPayload = payload;
+
+    if (context->InvokeService(context, _OrthancPluginService_GetInstanceDicomWebXml, &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return target;
+    }
+  }
+
+
+
+  /**
+   * @brief Signature of a callback function to transcode a DICOM instance.
+   * @param transcoded Target memory buffer. It must be allocated by the
+   * plugin using OrthancPluginCreateMemoryBuffer().
+   * @param buffer Memory buffer containing the source DICOM instance.
+   * @param size Size of the source memory buffer.
+   * @param allowedSyntaxes A C array of possible transfer syntaxes UIDs for the
+   * result of the transcoding. The plugin must choose by itself the 
+   * transfer syntax that will be used for the resulting DICOM image.
+   * @param countSyntaxes The number of transfer syntaxes that are contained
+   * in the "allowedSyntaxes" array.
+   * @param allowNewSopInstanceUid Whether the transcoding plugin can select
+   * a transfer syntax that will change the SOP instance UID (or, in other 
+   * terms, whether the plugin can transcode using lossy compression).
+   * @return 0 if success (i.e. image successfully transcoded and stored into
+   * "transcoded"), or the error code if failure.
+   * @ingroup Callbacks
+   **/
+  typedef OrthancPluginErrorCode (*OrthancPluginTranscoderCallback) (
+    OrthancPluginMemoryBuffer* transcoded /* out */,
+    const void*                buffer,
+    uint64_t                   size,
+    const char* const*         allowedSyntaxes,
+    uint32_t                   countSyntaxes,
+    uint8_t                    allowNewSopInstanceUid);
+
+
+  typedef struct
+  {
+    OrthancPluginTranscoderCallback callback;
+  } _OrthancPluginTranscoderCallback;
+
+  /**
+   * @brief Register a callback to handle the transcoding of DICOM images.
+   *
+   * This function registers a custom callback to transcode DICOM
+   * images, extending the built-in transcoder of Orthanc that uses
+   * DCMTK. The exact behavior is affected by the configuration option
+   * "BuiltinDecoderTranscoderOrder" of Orthanc.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param callback The callback.
+   * @return 0 if success, other value if error.
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginRegisterTranscoderCallback(
+    OrthancPluginContext*            context,
+    OrthancPluginTranscoderCallback  callback)
+  {
+    _OrthancPluginTranscoderCallback params;
+    params.callback = callback;
+
+    return context->InvokeService(context, _OrthancPluginService_RegisterTranscoderCallback, &params);
+  }
+  
+
+
+  typedef struct
+  {
+    OrthancPluginMemoryBuffer*  target;
+    uint32_t                    size;
+  } _OrthancPluginCreateMemoryBuffer;
+
+  /**
+   * @brief Create a 32-bit memory buffer.
+   *
+   * This function creates a memory buffer that is managed by the
+   * Orthanc core. The main use case of this function is for plugins
+   * that act as DICOM transcoders.
+   * 
+   * Your plugin should never call "free()" on the resulting memory
+   * buffer, as the C library that is used by the plugin is in general
+   * not the same as the one used by the Orthanc core.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param size Size of the memory buffer to be created.
+   * @return 0 if success, or the error code if failure.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateMemoryBuffer(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  target,
+    uint32_t                    size)
+  {
+    _OrthancPluginCreateMemoryBuffer params;
+    params.target = target;
+    params.size = size;
+
+    return context->InvokeService(context, _OrthancPluginService_CreateMemoryBuffer, &params);
+  }
+  
+
+  /**
+   * @brief Generate a token to grant full access to the REST API of Orthanc
+   *
+   * This function generates a token that can be set in the HTTP
+   * header "Authorization" so as to grant full access to the REST API
+   * of Orthanc using an external HTTP client. Using this function
+   * avoids the need of adding a separate user in the
+   * "RegisteredUsers" configuration of Orthanc, which eases
+   * deployments.
+   *
+   * This feature is notably useful in multiprocess scenarios, where a
+   * subprocess created by a plugin has no access to the
+   * "OrthancPluginContext", and thus cannot call
+   * "OrthancPluginRestApi[Get|Post|Put|Delete]()".
+   *
+   * This situation is frequently encountered in Python plugins, where
+   * the "multiprocessing" package can be used to bypass the Global
+   * Interpreter Lock (GIL) and thus to improve performance and
+   * concurrency.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @return The authorization token, or NULL value in the case of an error.
+   * This string must be freed by OrthancPluginFreeString().
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE char* OrthancPluginGenerateRestApiAuthorizationToken(
+    OrthancPluginContext*  context)
+  {
+    char* result;
+
+    _OrthancPluginRetrieveDynamicString params;
+    params.result = &result;
+    params.argument = NULL;
+
+    if (context->InvokeService(context, _OrthancPluginService_GenerateRestApiAuthorizationToken,
+                               &params) != OrthancPluginErrorCode_Success)
+    {
+      /* Error */
+      return NULL;
+    }
+    else
+    {
+      return result;
+    }
+  }
+
+
+
+  typedef struct
+  {
+    OrthancPluginMemoryBuffer64*  target;
+    uint64_t                      size;
+  } _OrthancPluginCreateMemoryBuffer64;
+
+  /**
+   * @brief Create a 64-bit memory buffer.
+   *
+   * This function creates a 64-bit memory buffer that is managed by
+   * the Orthanc core. The main use case of this function is for
+   * plugins that read files from the storage area.
+   * 
+   * Your plugin should never call "free()" on the resulting memory
+   * buffer, as the C library that is used by the plugin is in general
+   * not the same as the one used by the Orthanc core.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param size Size of the memory buffer to be created.
+   * @return 0 if success, or the error code if failure.
+   * @ingroup Toolbox
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateMemoryBuffer64(
+    OrthancPluginContext*         context,
+    OrthancPluginMemoryBuffer64*  target,
+    uint64_t                      size)
+  {
+    _OrthancPluginCreateMemoryBuffer64 params;
+    params.target = target;
+    params.size = size;
+
+    return context->InvokeService(context, _OrthancPluginService_CreateMemoryBuffer64, &params);
+  }
+  
+
+  typedef struct
+  {
+    OrthancPluginStorageCreate    create;
+    OrthancPluginStorageReadWhole readWhole;
+    OrthancPluginStorageReadRange readRange;
+    OrthancPluginStorageRemove    remove;
+  } _OrthancPluginRegisterStorageArea2;
+
+  /**
+   * @brief Register a custom storage area, with support for range request.
+   *
+   * This function registers a custom storage area, to replace the
+   * built-in way Orthanc stores its files on the filesystem. This
+   * function must be called during the initialization of the plugin,
+   * i.e. inside the OrthancPluginInitialize() public function.
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param create The callback function to store a file on the custom storage area.
+   * @param readWhole The callback function to read a whole file from the custom storage area.
+   * @param readRange The callback function to read some range of a file from the custom storage area.
+   * If this feature is not supported by the plugin, this value can be set to NULL.
+   * @param remove The callback function to remove a file from the custom storage area.
+   * @ingroup Callbacks
+   **/
+  ORTHANC_PLUGIN_INLINE void OrthancPluginRegisterStorageArea2(
+    OrthancPluginContext*          context,
+    OrthancPluginStorageCreate     create,
+    OrthancPluginStorageReadWhole  readWhole,
+    OrthancPluginStorageReadRange  readRange,
+    OrthancPluginStorageRemove     remove)
+  {
+    _OrthancPluginRegisterStorageArea2 params;
+    params.create = create;
+    params.readWhole = readWhole;
+    params.readRange = readRange;
+    params.remove = remove;
+    context->InvokeService(context, _OrthancPluginService_RegisterStorageArea2, &params);
+  }
+
+
+
+  typedef struct
+  {
+    _OrthancPluginCreateDicom  createDicom;
+    const char*                privateCreator;
+  } _OrthancPluginCreateDicom2;
+
+  /**
+   * @brief Create a DICOM instance from a JSON string and an image, with a private creator.
+   *
+   * This function takes as input a string containing a JSON file
+   * describing the content of a DICOM instance. As an output, it
+   * writes the corresponding DICOM instance to a newly allocated
+   * memory buffer. Additionally, an image to be encoded within the
+   * DICOM instance can also be provided.
+   *
+   * Contrarily to the function OrthancPluginCreateDicom(), this
+   * function can be explicitly provided with a private creator.
+   *
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param target The target memory buffer. It must be freed with OrthancPluginFreeMemoryBuffer().
+   * @param json The input JSON file.
+   * @param pixelData The image. Can be NULL, if the pixel data is encoded inside the JSON with the data URI scheme.
+   * @param flags Flags governing the output.
+   * @param privateCreator The private creator to be used for the private DICOM tags.
+   * Check out the global configuration option "Dictionary" of Orthanc.
+   * @return 0 if success, other value if error.
+   * @ingroup Toolbox
+   * @see OrthancPluginCreateDicom
+   * @see OrthancPluginDicomBufferToJson
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode OrthancPluginCreateDicom2(
+    OrthancPluginContext*          context,
+    OrthancPluginMemoryBuffer*     target,
+    const char*                    json,
+    const OrthancPluginImage*      pixelData,
+    OrthancPluginCreateDicomFlags  flags,
+    const char*                    privateCreator)
+  {
+    _OrthancPluginCreateDicom2 params;
+    params.createDicom.target = target;
+    params.createDicom.json = json;
+    params.createDicom.pixelData = pixelData;
+    params.createDicom.flags = flags;
+    params.privateCreator = privateCreator;
+
+    return context->InvokeService(context, _OrthancPluginService_CreateDicom2, &params);
+  }
+
+
+
+
+
+
+  typedef struct
+  {
+    OrthancPluginMemoryBuffer*  answerBody;
+    OrthancPluginMemoryBuffer*  answerHeaders;
+    uint16_t*                   httpStatus;
+    OrthancPluginHttpMethod     method;
+    const char*                 uri;
+    uint32_t                    headersCount;
+    const char* const*          headersKeys;
+    const char* const*          headersValues;
+    const void*                 body;
+    uint32_t                    bodySize;
+    uint8_t                     afterPlugins;
+  } _OrthancPluginCallRestApi;
+
+  /**
+   * @brief Call the REST API of Orthanc with full flexibility.
+   * 
+   * Make a call to the given URI in the REST API of Orthanc. The
+   * result to the query is stored into a newly allocated memory
+   * buffer. This function is always granted full access to the REST
+   * API (no credentials, nor security token is needed).
+   * 
+   * @param context The Orthanc plugin context, as received by OrthancPluginInitialize().
+   * @param answerBody The target memory buffer (out argument).
+   *        It must be freed with OrthancPluginFreeMemoryBuffer().
+   *        The value of this argument is ignored if the HTTP method is DELETE.
+   * @param answerHeaders The target memory buffer for the HTTP headers in the answer (out argument). 
+   *        The answer headers are formatted as a JSON object (associative array).
+   *        The buffer must be freed with OrthancPluginFreeMemoryBuffer().
+   *        This argument can be set to NULL if the plugin has no interest in the answer HTTP headers.
+   * @param httpStatus The HTTP status after the execution of the request (out argument).
+   * @param method HTTP method to be used.
+   * @param uri The URI of interest.
+   * @param headersCount The number of HTTP headers.
+   * @param headersKeys Array containing the keys of the HTTP headers (can be <tt>NULL</tt> if no header).
+   * @param headersValues Array containing the values of the HTTP headers (can be <tt>NULL</tt> if no header).
+   * @param body The HTTP body for a POST or PUT request.
+   * @param bodySize The size of the body.
+   * @param afterPlugins If 0, the built-in API of Orthanc is used.
+   * If 1, the API is tainted by the plugins.
+   * @return 0 if success, or the error code if failure.
+   * @see OrthancPluginRestApiGet2, OrthancPluginRestApiPost, OrthancPluginRestApiPut, OrthancPluginRestApiDelete
+   * @ingroup Orthanc
+   **/
+  ORTHANC_PLUGIN_INLINE OrthancPluginErrorCode  OrthancPluginCallRestApi(
+    OrthancPluginContext*       context,
+    OrthancPluginMemoryBuffer*  answerBody,
+    OrthancPluginMemoryBuffer*  answerHeaders,
+    uint16_t*                   httpStatus,
+    OrthancPluginHttpMethod     method,
+    const char*                 uri,
+    uint32_t                    headersCount,
+    const char* const*          headersKeys,
+    const char* const*          headersValues,
+    const void*                 body,
+    uint32_t                    bodySize,
+    uint8_t                     afterPlugins)
+  {
+    _OrthancPluginCallRestApi params;
+    memset(&params, 0, sizeof(params));
+
+    params.answerBody = answerBody;
+    params.answerHeaders = answerHeaders;
+    params.httpStatus = httpStatus;
+    params.method = method;
+    params.uri = uri;
+    params.headersCount = headersCount;
+    params.headersKeys = headersKeys;
+    params.headersValues = headersValues;
+    params.body = body;
+    params.bodySize = bodySize;
+    params.afterPlugins = afterPlugins;
+
+    return context->InvokeService(context, _OrthancPluginService_CallRestApi, &params);
+  }
+
+
+#ifdef  __cplusplus
+}
+#endif
+
+
+/** @} */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Orthanc/Toolchains/LinuxStandardBaseToolchain.cmake	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,100 @@
+# Orthanc - A Lightweight, RESTful DICOM Store
+# Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+# Department, University Hospital of Liege, Belgium
+# Copyright (C) 2017-2023 Osimis S.A., Belgium
+# Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/>.
+
+
+#
+# Full build, as used on the BuildBot CIS:
+#
+#   $ LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake ../OrthancServer/ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../OrthancFramework/Resources/Toolchains/LinuxStandardBaseToolchain.cmake -DUSE_LEGACY_JSONCPP=ON -DUSE_LEGACY_LIBICU=ON -DUSE_LEGACY_BOOST=ON -DBOOST_LOCALE_BACKEND=icu -DENABLE_PKCS11=ON -G Ninja
+#
+# Or, more lightweight version (without libp11 and ICU):
+#
+#   $ LSB_CC=gcc-4.8 LSB_CXX=g++-4.8 cmake ../OrthancServer/ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=../OrthancFramework/Resources/Toolchains/LinuxStandardBaseToolchain.cmake -DUSE_LEGACY_JSONCPP=ON -DUSE_LEGACY_BOOST=ON -G Ninja
+#
+
+INCLUDE(CMakeForceCompiler)
+
+SET(LSB_PATH $ENV{LSB_PATH} CACHE STRING "")
+SET(LSB_CC $ENV{LSB_CC} CACHE STRING "")
+SET(LSB_CXX $ENV{LSB_CXX} CACHE STRING "")
+SET(LSB_TARGET_VERSION "4.0" CACHE STRING "")
+
+IF ("${LSB_PATH}" STREQUAL "")
+  SET(LSB_PATH "/opt/lsb")
+ENDIF()
+
+IF (EXISTS ${LSB_PATH}/lib64)
+  SET(LSB_TARGET_PROCESSOR "x86_64")
+  SET(LSB_LIBPATH ${LSB_PATH}/lib64-${LSB_TARGET_VERSION})
+ELSEIF (EXISTS ${LSB_PATH}/lib)
+  SET(LSB_TARGET_PROCESSOR "x86")
+  SET(LSB_LIBPATH ${LSB_PATH}/lib-${LSB_TARGET_VERSION})
+ELSE()
+  MESSAGE(FATAL_ERROR "Unable to detect the target processor architecture. Check the LSB_PATH environment variable.")
+ENDIF()
+
+SET(LSB_CPPPATH ${LSB_PATH}/include)
+SET(PKG_CONFIG_PATH ${LSB_LIBPATH}/pkgconfig/)
+
+# the name of the target operating system
+SET(CMAKE_SYSTEM_NAME Linux)
+SET(CMAKE_SYSTEM_VERSION LinuxStandardBase)
+SET(CMAKE_SYSTEM_PROCESSOR ${LSB_TARGET_PROCESSOR})
+
+# which compilers to use for C and C++
+SET(CMAKE_C_COMPILER ${LSB_PATH}/bin/lsbcc)
+
+if (${CMAKE_VERSION} VERSION_LESS "3.6.0") 
+  CMAKE_FORCE_CXX_COMPILER(${LSB_PATH}/bin/lsbc++ GNU)
+else()
+  SET(CMAKE_CXX_COMPILER ${LSB_PATH}/bin/lsbc++)
+endif()
+
+# here is the target environment located
+SET(CMAKE_FIND_ROOT_PATH ${LSB_PATH})
+
+# adjust the default behaviour of the FIND_XXX() commands:
+# search headers and libraries in the target environment, search 
+# programs in the host environment
+SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY NEVER)
+SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE NEVER)
+
+SET(CMAKE_CROSSCOMPILING OFF)
+
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -I${LSB_PATH}/include" CACHE INTERNAL "" FORCE)
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -nostdinc++ -I${LSB_PATH}/include -I${LSB_PATH}/include/c++ -I${LSB_PATH}/include/c++/backward" CACHE INTERNAL "" FORCE)
+SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -L${LSB_LIBPATH} --lsb-besteffort" CACHE INTERNAL "" FORCE)
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --lsb-target-version=${LSB_TARGET_VERSION} -L${LSB_LIBPATH} --lsb-besteffort" CACHE INTERNAL "" FORCE)
+
+if (NOT "${LSB_CXX}" STREQUAL "")
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --lsb-cxx=${LSB_CXX}")
+  SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --lsb-cxx=${LSB_CXX}")
+  SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --lsb-cxx=${LSB_CXX}")
+endif()
+
+if (NOT "${LSB_CC}" STREQUAL "")
+  SET(CMAKE_C_FLAGS "${CMAKE_CC_FLAGS} --lsb-cc=${LSB_CC}")
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --lsb-cc=${LSB_CC}")
+  SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --lsb-cc=${LSB_CC}")
+  SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --lsb-cc=${LSB_CC}")
+endif()
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain32.cmake	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,38 @@
+# Orthanc - A Lightweight, RESTful DICOM Store
+# Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+# Department, University Hospital of Liege, Belgium
+# Copyright (C) 2017-2023 Osimis S.A., Belgium
+# Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/>.
+
+
+# the name of the target operating system
+set(CMAKE_SYSTEM_NAME Windows)
+
+# which compilers to use for C and C++
+set(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
+set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
+set(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
+
+# here is the target environment located
+set(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
+
+# adjust the default behaviour of the FIND_XXX() commands:
+# search headers and libraries in the target environment, search 
+# programs in the host environment
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/Orthanc/Toolchains/MinGW-W64-Toolchain64.cmake	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,38 @@
+# Orthanc - A Lightweight, RESTful DICOM Store
+# Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+# Department, University Hospital of Liege, Belgium
+# Copyright (C) 2017-2023 Osimis S.A., Belgium
+# Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public License
+# as published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this program. If not, see
+# <http://www.gnu.org/licenses/>.
+
+
+# the name of the target operating system
+set(CMAKE_SYSTEM_NAME Windows)
+
+# which compilers to use for C and C++
+set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
+set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
+set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
+
+# here is the target environment located
+set(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32)
+
+# adjust the default behaviour of the FIND_XXX() commands:
+# search headers and libraries in the target environment, search 
+# programs in the host environment
+set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/OrthancCPlugin-1.10.0.patch	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,155 @@
+--- OrthancCPlugin.h.orig	2023-10-14 17:06:44.406226125 +0200
++++ OrthancCPlugin.h	2023-10-14 17:09:26.978745058 +0200
+@@ -837,7 +837,7 @@
+    **/
+   typedef enum
+   {
+-    OrthancPluginDicomToJsonFlags_None                  = 0,
++    OrthancPluginDicomToJsonFlags_None                  = 0,         /*!< Default formatting */
+     OrthancPluginDicomToJsonFlags_IncludeBinary         = (1 << 0),  /*!< Include the binary tags */
+     OrthancPluginDicomToJsonFlags_IncludePrivateTags    = (1 << 1),  /*!< Include the private tags */
+     OrthancPluginDicomToJsonFlags_IncludeUnknownTags    = (1 << 2),  /*!< Include the tags unknown by the dictionary */
+@@ -858,7 +858,7 @@
+    **/
+   typedef enum
+   {
+-    OrthancPluginCreateDicomFlags_None                  = 0,
++    OrthancPluginCreateDicomFlags_None                  = 0,         /*!< Default mode */
+     OrthancPluginCreateDicomFlags_DecodeDataUriScheme   = (1 << 0),  /*!< Decode fields encoded using data URI scheme */
+     OrthancPluginCreateDicomFlags_GenerateIdentifiers   = (1 << 1),  /*!< Automatically generate DICOM identifiers */
+ 
+@@ -975,32 +975,46 @@
+    **/
+   typedef enum
+   {
++    /**
++     * Success: The DICOM instance is properly stored in the SCP
++     **/
+     OrthancPluginStorageCommitmentFailureReason_Success = 0,
+-    /*!< Success: The DICOM instance is properly stored in the SCP */
+ 
++    /**
++     * 0110H: A general failure in processing the operation was encountered
++     **/
+     OrthancPluginStorageCommitmentFailureReason_ProcessingFailure = 1,
+-    /*!< 0110H: A general failure in processing the operation was encountered */
+ 
++    /**
++     * 0112H: One or more of the elements in the Referenced SOP
++     * Instance Sequence was not available
++     **/
+     OrthancPluginStorageCommitmentFailureReason_NoSuchObjectInstance = 2,
+-    /*!< 0112H: One or more of the elements in the Referenced SOP
+-      Instance Sequence was not available */
+ 
++    /**
++     * 0213H: The SCP does not currently have enough resources to
++     * store the requested SOP Instance(s)
++     **/
+     OrthancPluginStorageCommitmentFailureReason_ResourceLimitation = 3,
+-    /*!< 0213H: The SCP does not currently have enough resources to
+-      store the requested SOP Instance(s) */
+ 
++    /**
++     * 0122H: Storage Commitment has been requested for a SOP Instance
++     * with a SOP Class that is not supported by the SCP
++     **/
+     OrthancPluginStorageCommitmentFailureReason_ReferencedSOPClassNotSupported = 4,
+-    /*!< 0122H: Storage Commitment has been requested for a SOP
+-      Instance with a SOP Class that is not supported by the SCP */
+ 
++    /**
++     * 0119H: The SOP Class of an element in the Referenced SOP
++     * Instance Sequence did not correspond to the SOP class
++     * registered for this SOP Instance at the SCP
++     **/
+     OrthancPluginStorageCommitmentFailureReason_ClassInstanceConflict = 5,
+-    /*!< 0119H: The SOP Class of an element in the Referenced SOP
+-      Instance Sequence did not correspond to the SOP class registered
+-      for this SOP Instance at the SCP */
+ 
++    /**
++     * 0131H: The Transaction UID of the Storage Commitment Request is
++     * already in use
++     **/
+     OrthancPluginStorageCommitmentFailureReason_DuplicateTransactionUID = 6
+-    /*!< 0131H: The Transaction UID of the Storage Commitment Request
+-      is already in use */
+   } OrthancPluginStorageCommitmentFailureReason;
+ 
+ 
+@@ -1829,15 +1843,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 +1950,7 @@
+    * @see OrthancPluginCheckVersionAdvanced
+    * @ingroup Callbacks
+    **/
+-  ORTHANC_PLUGIN_INLINE int  OrthancPluginCheckVersion(
++  ORTHANC_PLUGIN_INLINE int32_t  OrthancPluginCheckVersion(
+     OrthancPluginContext* context)
+   {
+     return OrthancPluginCheckVersionAdvanced(
+@@ -3077,7 +3092,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 +3871,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, &params);
+   }
+@@ -6760,7 +6775,7 @@
+   {
+     char**             resultId;
+     OrthancPluginJob  *job;
+-    int                priority;
++    int32_t            priority;
+   } _OrthancPluginSubmitJob;
+ 
+   /**
+@@ -6779,7 +6794,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/SyncOrthancFolder.py	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,107 @@
+#!/usr/bin/python3
+
+# SPDX-FileCopyrightText: 2023 Sebastien Jodogne, UCLouvain, Belgium
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# Java plugin for Orthanc
+# Copyright (C) 2023 Sebastien Jodogne, UCLouvain, Belgium
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+#
+# This maintenance script updates the content of the "Orthanc" folder
+# to match the latest version of the Orthanc source code.
+#
+
+import multiprocessing
+import os
+import stat
+import urllib.request
+import subprocess
+
+TARGET = os.path.join(os.path.dirname(__file__), 'Orthanc')
+PLUGIN_SDK_VERSION = '1.10.0'
+REPOSITORY = 'https://hg.orthanc-server.com/orthanc/raw-file'
+
+FILES = [
+    ('OrthancFramework/Resources/CMake/AutoGeneratedCode.cmake', 'CMake'),
+    ('OrthancFramework/Resources/CMake/Compiler.cmake', 'CMake'),
+    ('OrthancFramework/Resources/CMake/DownloadPackage.cmake', 'CMake'),
+    ('OrthancFramework/Resources/CMake/JsonCppConfiguration.cmake', 'CMake'),
+    ('OrthancFramework/Resources/WindowsResources.py', 'CMake'),
+    ('OrthancFramework/Resources/WindowsResources.rc', 'CMake'),
+
+    ('OrthancFramework/Resources/Toolchains/LinuxStandardBaseToolchain.cmake', 'Toolchains'),
+    ('OrthancFramework/Resources/Toolchains/MinGW-W64-Toolchain32.cmake', 'Toolchains'),
+    ('OrthancFramework/Resources/Toolchains/MinGW-W64-Toolchain64.cmake', 'Toolchains'),
+
+    ('OrthancServer/Plugins/Samples/Common/ExportedSymbolsPlugins.list', 'Plugins'),
+    ('OrthancServer/Plugins/Samples/Common/OrthancPluginsExports.cmake', 'Plugins'),
+    ('OrthancServer/Plugins/Samples/Common/VersionScriptPlugins.map', 'Plugins'),
+]
+
+SDK = [
+    'orthanc/OrthancCPlugin.h',
+]
+
+
+def Download(x):
+    branch = x[0]
+    source = x[1]
+    target = os.path.join(TARGET, x[2])
+    print(target)
+
+    try:
+        os.makedirs(os.path.dirname(target))
+    except:
+        pass
+
+    url = '%s/%s/%s' % (REPOSITORY, branch, source)
+
+    with open(target, 'wb') as f:
+        try:
+            f.write(urllib.request.urlopen(url).read())
+        except:
+            print('ERROR %s' % url)
+            raise
+
+
+commands = []
+
+for f in FILES:
+    commands.append([ 'default',
+                      f[0],
+                      os.path.join(f[1], os.path.basename(f[0])) ])
+
+for f in SDK:
+    commands.append([
+        'Orthanc-%s' % PLUGIN_SDK_VERSION, 
+        'OrthancServer/Plugins/Include/%s' % f,
+        'Sdk-%s/%s' % (PLUGIN_SDK_VERSION, f) 
+    ])
+
+
+pool = multiprocessing.Pool(10)  # simultaneous downloads
+pool.map(Download, commands)
+
+
+# Patch the SDK, if need be
+patch = os.path.join(os.path.abspath(os.path.dirname(__file__)),
+                     'OrthancCPlugin-%s.patch' % PLUGIN_SDK_VERSION)
+if os.path.exists(patch):
+    subprocess.check_call([ 'patch', '-p0', '-i', patch ],
+                          cwd = os.path.join(os.path.dirname(__file__),
+                                             'Orthanc',
+                                             'Sdk-%s' % PLUGIN_SDK_VERSION, 'orthanc'))
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/jdk8u382-b05-win32/LICENSE	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,347 @@
+The GNU General Public License (GPL)
+
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Everyone is permitted to copy and distribute verbatim copies of this license
+document, but changing it is not allowed.
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share
+and change it.  By contrast, the GNU General Public License is intended to
+guarantee your freedom to share and change free software--to make sure the
+software is free for all its users.  This General Public License applies to
+most of the Free Software Foundation's software and to any other program whose
+authors commit to using it.  (Some other Free Software Foundation software is
+covered by the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+When we speak of free software, we are referring to freedom, not price.  Our
+General Public Licenses are designed to make sure that you have the freedom to
+distribute copies of free software (and charge for this service if you wish),
+that you receive source code or can get it if you want it, that you can change
+the software or use pieces of it in new free programs; and that you know you
+can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny
+you these rights or to ask you to surrender the rights.  These restrictions
+translate to certain responsibilities for you if you distribute copies of the
+software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for
+a fee, you must give the recipients all the rights that you have.  You must
+make sure that they, too, receive or can get the source code.  And you must
+show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2)
+offer you this license which gives you legal permission to copy, distribute
+and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that
+everyone understands that there is no warranty for this free software.  If the
+software is modified by someone else and passed on, we want its recipients to
+know that what they have is not the original, so that any problems introduced
+by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents.  We
+wish to avoid the danger that redistributors of a free program will
+individually obtain patent licenses, in effect making the program proprietary.
+To prevent this, we have made it clear that any patent must be licensed for
+everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification
+follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice
+placed by the copyright holder saying it may be distributed under the terms of
+this General Public License.  The "Program", below, refers to any such program
+or work, and a "work based on the Program" means either the Program or any
+derivative work under copyright law: that is to say, a work containing the
+Program or a portion of it, either verbatim or with modifications and/or
+translated into another language.  (Hereinafter, translation is included
+without limitation in the term "modification".) Each licensee is addressed as
+"you".
+
+Activities other than copying, distribution and modification are not covered by
+this License; they are outside its scope.  The act of running the Program is
+not restricted, and the output from the Program is covered only if its contents
+constitute a work based on the Program (independent of having been made by
+running the Program).  Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's source code as
+you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice and
+disclaimer of warranty; keep intact all the notices that refer to this License
+and to the absence of any warranty; and give any other recipients of the
+Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may
+at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus
+forming a work based on the Program, and copy and distribute such modifications
+or work under the terms of Section 1 above, provided that you also meet all of
+these conditions:
+
+    a) You must cause the modified files to carry prominent notices stating
+    that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in whole or
+    in part contains or is derived from the Program or any part thereof, to be
+    licensed as a whole at no charge to all third parties under the terms of
+    this License.
+
+    c) If the modified program normally reads commands interactively when run,
+    you must cause it, when started running for such interactive use in the
+    most ordinary way, to print or display an announcement including an
+    appropriate copyright notice and a notice that there is no warranty (or
+    else, saying that you provide a warranty) and that users may redistribute
+    the program under these conditions, and telling the user how to view a copy
+    of this License.  (Exception: if the Program itself is interactive but does
+    not normally print such an announcement, your work based on the Program is
+    not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If identifiable
+sections of that work are not derived from the Program, and can be reasonably
+considered independent and separate works in themselves, then this License, and
+its terms, do not apply to those sections when you distribute them as separate
+works.  But when you distribute the same sections as part of a whole which is a
+work based on the Program, the distribution of the whole must be on the terms
+of this License, whose permissions for other licensees extend to the entire
+whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your
+rights to work written entirely by you; rather, the intent is to exercise the
+right to control the distribution of derivative or collective works based on
+the Program.
+
+In addition, mere aggregation of another work not based on the Program with the
+Program (or with a work based on the Program) on a volume of a storage or
+distribution medium does not bring the other work under the scope of this
+License.
+
+3. You may copy and distribute the Program (or a work based on it, under
+Section 2) in object code or executable form under the terms of Sections 1 and
+2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable source
+    code, which must be distributed under the terms of Sections 1 and 2 above
+    on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three years, to
+    give any third party, for a charge no more than your cost of physically
+    performing source distribution, a complete machine-readable copy of the
+    corresponding source code, to be distributed under the terms of Sections 1
+    and 2 above on a medium customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer to
+    distribute corresponding source code.  (This alternative is allowed only
+    for noncommercial distribution and only if you received the program in
+    object code or executable form with such an offer, in accord with
+    Subsection b above.)
+
+The source code for a work means the preferred form of the work for making
+modifications to it.  For an executable work, complete source code means all
+the source code for all modules it contains, plus any associated interface
+definition files, plus the scripts used to control compilation and installation
+of the executable.  However, as a special exception, the source code
+distributed need not include anything that is normally distributed (in either
+source or binary form) with the major components (compiler, kernel, and so on)
+of the operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the source
+code from the same place counts as distribution of the source code, even though
+third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as
+expressly provided under this License.  Any attempt otherwise to copy, modify,
+sublicense or distribute the Program is void, and will automatically terminate
+your rights under this License.  However, parties who have received copies, or
+rights, from you under this License will not have their licenses terminated so
+long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it.
+However, nothing else grants you permission to modify or distribute the Program
+or its derivative works.  These actions are prohibited by law if you do not
+accept this License.  Therefore, by modifying or distributing the Program (or
+any work based on the Program), you indicate your acceptance of this License to
+do so, and all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program),
+the recipient automatically receives a license from the original licensor to
+copy, distribute or modify the Program subject to these terms and conditions.
+You may not impose any further restrictions on the recipients' exercise of the
+rights granted herein.  You are not responsible for enforcing compliance by
+third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues), conditions
+are imposed on you (whether by court order, agreement or otherwise) that
+contradict the conditions of this License, they do not excuse you from the
+conditions of this License.  If you cannot distribute so as to satisfy
+simultaneously your obligations under this License and any other pertinent
+obligations, then as a consequence you may not distribute the Program at all.
+For example, if a patent license would not permit royalty-free redistribution
+of the Program by all those who receive copies directly or indirectly through
+you, then the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply and
+the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or
+other property right claims or to contest validity of any such claims; this
+section has the sole purpose of protecting the integrity of the free software
+distribution system, which is implemented by public license practices.  Many
+people have made generous contributions to the wide range of software
+distributed through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing to
+distribute software through any other system and a licensee cannot impose that
+choice.
+
+This section is intended to make thoroughly clear what is believed to be a
+consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain
+countries either by patents or by copyrighted interfaces, the original
+copyright holder who places the Program under this License may add an explicit
+geographical distribution limitation excluding those countries, so that
+distribution is permitted only in or among countries not thus excluded.  In
+such case, this License incorporates the limitation as if written in the body
+of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the
+General Public License from time to time.  Such new versions will be similar in
+spirit to the present version, but may differ in detail to address new problems
+or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any later
+version", you have the option of following the terms and conditions either of
+that version or of any later version published by the Free Software Foundation.
+If the Program does not specify a version number of this License, you may
+choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs
+whose distribution conditions are different, write to the author to ask for
+permission.  For software which is copyrighted by the Free Software Foundation,
+write to the Free Software Foundation; we sometimes make exceptions for this.
+Our decision will be guided by the two goals of preserving the free status of
+all derivatives of our free software and of promoting the sharing and reuse of
+software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
+THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN OTHERWISE
+STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE
+PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND
+PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE,
+YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
+ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
+PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
+INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
+BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER
+OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible
+use to the public, the best way to achieve this is to make it free software
+which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program.  It is safest to attach
+them to the start of each source file to most effectively convey the exclusion
+of warranty; and each file should have at least the "copyright" line and a
+pointer to where the full notice is found.
+
+    One line to give the program's name and a brief idea of what it does.
+
+    Copyright (C) <year> <name of author>
+
+    This program is free software; you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by the Free
+    Software Foundation; either version 2 of the License, or (at your option)
+    any later version.
+
+    This program is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+    more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it
+starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
+    with ABSOLUTELY NO WARRANTY; for details type 'show w'.  This is free
+    software, and you are welcome to redistribute it under certain conditions;
+    type 'show c' for details.
+
+The hypothetical commands 'show w' and 'show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may be
+called something other than 'show w' and 'show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.  Here
+is a sample; alter the names:
+
+    Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+    'Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+    signature of Ty Coon, 1 April 1989
+
+    Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General Public
+License instead of this License.
+
+
+"CLASSPATH" EXCEPTION TO THE GPL
+
+Certain source files distributed by Oracle America and/or its affiliates are
+subject to the following clarification and special exception to the GPL, but
+only where Oracle has expressly included in the particular source file's header
+the words "Oracle designates this particular file as subject to the "Classpath"
+exception as provided by Oracle in the LICENSE file that accompanied this code."
+
+    Linking this library statically or dynamically with other modules is making
+    a combined work based on this library.  Thus, the terms and conditions of
+    the GNU General Public License cover the whole combination.
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,
+    and to copy and distribute the resulting executable under terms of your
+    choice, provided that you also meet, for each linked independent module,
+    the terms and conditions of the license of that module.  An independent
+    module is a module which is not derived from or based on this library.  If
+    you modify this library, you may extend this exception to your version of
+    the library, but you are not obligated to do so.  If you do not wish to do
+    so, delete this exception statement from your version.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/jdk8u382-b05-win32/NOTES.txt	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,11 @@
+This is an excerpt of the Eclipse Temurin Latest Releases for:
+
+- Operating system: Windows
+- Architecture: x86
+- Package type: JDK
+- Version: 8 - LTS
+- Package type: ZIP
+
+https://adoptium.net/temurin/releases/
+
+Filename: OpenJDK8U-jdk_x86-32_windows_hotspot_8u382b05.zip
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/jdk8u382-b05-win32/include/jni.h	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,1960 @@
+/*
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * We used part of Netscape's Java Runtime Interface (JRI) as the starting
+ * point of our design and implementation.
+ */
+
+/******************************************************************************
+ * Java Runtime Interface
+ * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved.
+ *****************************************************************************/
+
+#ifndef _JAVASOFT_JNI_H_
+#define _JAVASOFT_JNI_H_
+
+#include <stdio.h>
+#include <stdarg.h>
+
+/* jni_md.h contains the machine-dependent typedefs for jbyte, jint
+   and jlong */
+
+#include "jni_md.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * JNI Types
+ */
+
+#ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H
+
+typedef unsigned char   jboolean;
+typedef unsigned short  jchar;
+typedef short           jshort;
+typedef float           jfloat;
+typedef double          jdouble;
+
+typedef jint            jsize;
+
+#ifdef __cplusplus
+
+class _jobject {};
+class _jclass : public _jobject {};
+class _jthrowable : public _jobject {};
+class _jstring : public _jobject {};
+class _jarray : public _jobject {};
+class _jbooleanArray : public _jarray {};
+class _jbyteArray : public _jarray {};
+class _jcharArray : public _jarray {};
+class _jshortArray : public _jarray {};
+class _jintArray : public _jarray {};
+class _jlongArray : public _jarray {};
+class _jfloatArray : public _jarray {};
+class _jdoubleArray : public _jarray {};
+class _jobjectArray : public _jarray {};
+
+typedef _jobject *jobject;
+typedef _jclass *jclass;
+typedef _jthrowable *jthrowable;
+typedef _jstring *jstring;
+typedef _jarray *jarray;
+typedef _jbooleanArray *jbooleanArray;
+typedef _jbyteArray *jbyteArray;
+typedef _jcharArray *jcharArray;
+typedef _jshortArray *jshortArray;
+typedef _jintArray *jintArray;
+typedef _jlongArray *jlongArray;
+typedef _jfloatArray *jfloatArray;
+typedef _jdoubleArray *jdoubleArray;
+typedef _jobjectArray *jobjectArray;
+
+#else
+
+struct _jobject;
+
+typedef struct _jobject *jobject;
+typedef jobject jclass;
+typedef jobject jthrowable;
+typedef jobject jstring;
+typedef jobject jarray;
+typedef jarray jbooleanArray;
+typedef jarray jbyteArray;
+typedef jarray jcharArray;
+typedef jarray jshortArray;
+typedef jarray jintArray;
+typedef jarray jlongArray;
+typedef jarray jfloatArray;
+typedef jarray jdoubleArray;
+typedef jarray jobjectArray;
+
+#endif
+
+typedef jobject jweak;
+
+typedef union jvalue {
+    jboolean z;
+    jbyte    b;
+    jchar    c;
+    jshort   s;
+    jint     i;
+    jlong    j;
+    jfloat   f;
+    jdouble  d;
+    jobject  l;
+} jvalue;
+
+struct _jfieldID;
+typedef struct _jfieldID *jfieldID;
+
+struct _jmethodID;
+typedef struct _jmethodID *jmethodID;
+
+/* Return values from jobjectRefType */
+typedef enum _jobjectType {
+     JNIInvalidRefType    = 0,
+     JNILocalRefType      = 1,
+     JNIGlobalRefType     = 2,
+     JNIWeakGlobalRefType = 3
+} jobjectRefType;
+
+
+#endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */
+
+/*
+ * jboolean constants
+ */
+
+#define JNI_FALSE 0
+#define JNI_TRUE 1
+
+/*
+ * possible return values for JNI functions.
+ */
+
+#define JNI_OK           0                 /* success */
+#define JNI_ERR          (-1)              /* unknown error */
+#define JNI_EDETACHED    (-2)              /* thread detached from the VM */
+#define JNI_EVERSION     (-3)              /* JNI version error */
+#define JNI_ENOMEM       (-4)              /* not enough memory */
+#define JNI_EEXIST       (-5)              /* VM already created */
+#define JNI_EINVAL       (-6)              /* invalid arguments */
+
+/*
+ * used in ReleaseScalarArrayElements
+ */
+
+#define JNI_COMMIT 1
+#define JNI_ABORT 2
+
+/*
+ * used in RegisterNatives to describe native method name, signature,
+ * and function pointer.
+ */
+
+typedef struct {
+    char *name;
+    char *signature;
+    void *fnPtr;
+} JNINativeMethod;
+
+/*
+ * JNI Native Method Interface.
+ */
+
+struct JNINativeInterface_;
+
+struct JNIEnv_;
+
+#ifdef __cplusplus
+typedef JNIEnv_ JNIEnv;
+#else
+typedef const struct JNINativeInterface_ *JNIEnv;
+#endif
+
+/*
+ * JNI Invocation Interface.
+ */
+
+struct JNIInvokeInterface_;
+
+struct JavaVM_;
+
+#ifdef __cplusplus
+typedef JavaVM_ JavaVM;
+#else
+typedef const struct JNIInvokeInterface_ *JavaVM;
+#endif
+
+struct JNINativeInterface_ {
+    void *reserved0;
+    void *reserved1;
+    void *reserved2;
+
+    void *reserved3;
+    jint (JNICALL *GetVersion)(JNIEnv *env);
+
+    jclass (JNICALL *DefineClass)
+      (JNIEnv *env, const char *name, jobject loader, const jbyte *buf,
+       jsize len);
+    jclass (JNICALL *FindClass)
+      (JNIEnv *env, const char *name);
+
+    jmethodID (JNICALL *FromReflectedMethod)
+      (JNIEnv *env, jobject method);
+    jfieldID (JNICALL *FromReflectedField)
+      (JNIEnv *env, jobject field);
+
+    jobject (JNICALL *ToReflectedMethod)
+      (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic);
+
+    jclass (JNICALL *GetSuperclass)
+      (JNIEnv *env, jclass sub);
+    jboolean (JNICALL *IsAssignableFrom)
+      (JNIEnv *env, jclass sub, jclass sup);
+
+    jobject (JNICALL *ToReflectedField)
+      (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic);
+
+    jint (JNICALL *Throw)
+      (JNIEnv *env, jthrowable obj);
+    jint (JNICALL *ThrowNew)
+      (JNIEnv *env, jclass clazz, const char *msg);
+    jthrowable (JNICALL *ExceptionOccurred)
+      (JNIEnv *env);
+    void (JNICALL *ExceptionDescribe)
+      (JNIEnv *env);
+    void (JNICALL *ExceptionClear)
+      (JNIEnv *env);
+    void (JNICALL *FatalError)
+      (JNIEnv *env, const char *msg);
+
+    jint (JNICALL *PushLocalFrame)
+      (JNIEnv *env, jint capacity);
+    jobject (JNICALL *PopLocalFrame)
+      (JNIEnv *env, jobject result);
+
+    jobject (JNICALL *NewGlobalRef)
+      (JNIEnv *env, jobject lobj);
+    void (JNICALL *DeleteGlobalRef)
+      (JNIEnv *env, jobject gref);
+    void (JNICALL *DeleteLocalRef)
+      (JNIEnv *env, jobject obj);
+    jboolean (JNICALL *IsSameObject)
+      (JNIEnv *env, jobject obj1, jobject obj2);
+    jobject (JNICALL *NewLocalRef)
+      (JNIEnv *env, jobject ref);
+    jint (JNICALL *EnsureLocalCapacity)
+      (JNIEnv *env, jint capacity);
+
+    jobject (JNICALL *AllocObject)
+      (JNIEnv *env, jclass clazz);
+    jobject (JNICALL *NewObject)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *NewObjectV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jobject (JNICALL *NewObjectA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jclass (JNICALL *GetObjectClass)
+      (JNIEnv *env, jobject obj);
+    jboolean (JNICALL *IsInstanceOf)
+      (JNIEnv *env, jobject obj, jclass clazz);
+
+    jmethodID (JNICALL *GetMethodID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *CallObjectMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jobject (JNICALL *CallObjectMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jobject (JNICALL *CallObjectMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jboolean (JNICALL *CallBooleanMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jboolean (JNICALL *CallBooleanMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jboolean (JNICALL *CallBooleanMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jbyte (JNICALL *CallByteMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jbyte (JNICALL *CallByteMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jbyte (JNICALL *CallByteMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jchar (JNICALL *CallCharMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jchar (JNICALL *CallCharMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jchar (JNICALL *CallCharMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jshort (JNICALL *CallShortMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jshort (JNICALL *CallShortMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jshort (JNICALL *CallShortMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jint (JNICALL *CallIntMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jint (JNICALL *CallIntMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jint (JNICALL *CallIntMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jlong (JNICALL *CallLongMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jlong (JNICALL *CallLongMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jlong (JNICALL *CallLongMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jfloat (JNICALL *CallFloatMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jfloat (JNICALL *CallFloatMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jfloat (JNICALL *CallFloatMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jdouble (JNICALL *CallDoubleMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jdouble (JNICALL *CallDoubleMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jdouble (JNICALL *CallDoubleMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    void (JNICALL *CallVoidMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    void (JNICALL *CallVoidMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    void (JNICALL *CallVoidMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jobject (JNICALL *CallNonvirtualObjectMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *CallNonvirtualObjectMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jobject (JNICALL *CallNonvirtualObjectMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jboolean (JNICALL *CallNonvirtualBooleanMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jboolean (JNICALL *CallNonvirtualBooleanMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jboolean (JNICALL *CallNonvirtualBooleanMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jbyte (JNICALL *CallNonvirtualByteMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jbyte (JNICALL *CallNonvirtualByteMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jbyte (JNICALL *CallNonvirtualByteMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jchar (JNICALL *CallNonvirtualCharMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jchar (JNICALL *CallNonvirtualCharMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jchar (JNICALL *CallNonvirtualCharMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jshort (JNICALL *CallNonvirtualShortMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jshort (JNICALL *CallNonvirtualShortMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jshort (JNICALL *CallNonvirtualShortMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jint (JNICALL *CallNonvirtualIntMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jint (JNICALL *CallNonvirtualIntMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jint (JNICALL *CallNonvirtualIntMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jlong (JNICALL *CallNonvirtualLongMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jlong (JNICALL *CallNonvirtualLongMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jlong (JNICALL *CallNonvirtualLongMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jfloat (JNICALL *CallNonvirtualFloatMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jfloat (JNICALL *CallNonvirtualFloatMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jfloat (JNICALL *CallNonvirtualFloatMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jdouble (JNICALL *CallNonvirtualDoubleMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jdouble (JNICALL *CallNonvirtualDoubleMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jdouble (JNICALL *CallNonvirtualDoubleMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    void (JNICALL *CallNonvirtualVoidMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    void (JNICALL *CallNonvirtualVoidMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    void (JNICALL *CallNonvirtualVoidMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jfieldID (JNICALL *GetFieldID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *GetObjectField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jboolean (JNICALL *GetBooleanField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jbyte (JNICALL *GetByteField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jchar (JNICALL *GetCharField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jshort (JNICALL *GetShortField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jint (JNICALL *GetIntField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jlong (JNICALL *GetLongField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jfloat (JNICALL *GetFloatField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jdouble (JNICALL *GetDoubleField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+
+    void (JNICALL *SetObjectField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val);
+    void (JNICALL *SetBooleanField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val);
+    void (JNICALL *SetByteField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val);
+    void (JNICALL *SetCharField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val);
+    void (JNICALL *SetShortField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val);
+    void (JNICALL *SetIntField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jint val);
+    void (JNICALL *SetLongField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val);
+    void (JNICALL *SetFloatField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val);
+    void (JNICALL *SetDoubleField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val);
+
+    jmethodID (JNICALL *GetStaticMethodID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *CallStaticObjectMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *CallStaticObjectMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jobject (JNICALL *CallStaticObjectMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jboolean (JNICALL *CallStaticBooleanMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jboolean (JNICALL *CallStaticBooleanMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jboolean (JNICALL *CallStaticBooleanMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jbyte (JNICALL *CallStaticByteMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jbyte (JNICALL *CallStaticByteMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jbyte (JNICALL *CallStaticByteMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jchar (JNICALL *CallStaticCharMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jchar (JNICALL *CallStaticCharMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jchar (JNICALL *CallStaticCharMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jshort (JNICALL *CallStaticShortMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jshort (JNICALL *CallStaticShortMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jshort (JNICALL *CallStaticShortMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jint (JNICALL *CallStaticIntMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jint (JNICALL *CallStaticIntMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jint (JNICALL *CallStaticIntMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jlong (JNICALL *CallStaticLongMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jlong (JNICALL *CallStaticLongMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jlong (JNICALL *CallStaticLongMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jfloat (JNICALL *CallStaticFloatMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jfloat (JNICALL *CallStaticFloatMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jfloat (JNICALL *CallStaticFloatMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jdouble (JNICALL *CallStaticDoubleMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jdouble (JNICALL *CallStaticDoubleMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jdouble (JNICALL *CallStaticDoubleMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    void (JNICALL *CallStaticVoidMethod)
+      (JNIEnv *env, jclass cls, jmethodID methodID, ...);
+    void (JNICALL *CallStaticVoidMethodV)
+      (JNIEnv *env, jclass cls, jmethodID methodID, va_list args);
+    void (JNICALL *CallStaticVoidMethodA)
+      (JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args);
+
+    jfieldID (JNICALL *GetStaticFieldID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+    jobject (JNICALL *GetStaticObjectField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jboolean (JNICALL *GetStaticBooleanField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jbyte (JNICALL *GetStaticByteField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jchar (JNICALL *GetStaticCharField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jshort (JNICALL *GetStaticShortField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jint (JNICALL *GetStaticIntField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jlong (JNICALL *GetStaticLongField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jfloat (JNICALL *GetStaticFloatField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jdouble (JNICALL *GetStaticDoubleField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+
+    void (JNICALL *SetStaticObjectField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value);
+    void (JNICALL *SetStaticBooleanField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value);
+    void (JNICALL *SetStaticByteField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value);
+    void (JNICALL *SetStaticCharField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value);
+    void (JNICALL *SetStaticShortField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value);
+    void (JNICALL *SetStaticIntField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value);
+    void (JNICALL *SetStaticLongField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value);
+    void (JNICALL *SetStaticFloatField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value);
+    void (JNICALL *SetStaticDoubleField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value);
+
+    jstring (JNICALL *NewString)
+      (JNIEnv *env, const jchar *unicode, jsize len);
+    jsize (JNICALL *GetStringLength)
+      (JNIEnv *env, jstring str);
+    const jchar *(JNICALL *GetStringChars)
+      (JNIEnv *env, jstring str, jboolean *isCopy);
+    void (JNICALL *ReleaseStringChars)
+      (JNIEnv *env, jstring str, const jchar *chars);
+
+    jstring (JNICALL *NewStringUTF)
+      (JNIEnv *env, const char *utf);
+    jsize (JNICALL *GetStringUTFLength)
+      (JNIEnv *env, jstring str);
+    const char* (JNICALL *GetStringUTFChars)
+      (JNIEnv *env, jstring str, jboolean *isCopy);
+    void (JNICALL *ReleaseStringUTFChars)
+      (JNIEnv *env, jstring str, const char* chars);
+
+
+    jsize (JNICALL *GetArrayLength)
+      (JNIEnv *env, jarray array);
+
+    jobjectArray (JNICALL *NewObjectArray)
+      (JNIEnv *env, jsize len, jclass clazz, jobject init);
+    jobject (JNICALL *GetObjectArrayElement)
+      (JNIEnv *env, jobjectArray array, jsize index);
+    void (JNICALL *SetObjectArrayElement)
+      (JNIEnv *env, jobjectArray array, jsize index, jobject val);
+
+    jbooleanArray (JNICALL *NewBooleanArray)
+      (JNIEnv *env, jsize len);
+    jbyteArray (JNICALL *NewByteArray)
+      (JNIEnv *env, jsize len);
+    jcharArray (JNICALL *NewCharArray)
+      (JNIEnv *env, jsize len);
+    jshortArray (JNICALL *NewShortArray)
+      (JNIEnv *env, jsize len);
+    jintArray (JNICALL *NewIntArray)
+      (JNIEnv *env, jsize len);
+    jlongArray (JNICALL *NewLongArray)
+      (JNIEnv *env, jsize len);
+    jfloatArray (JNICALL *NewFloatArray)
+      (JNIEnv *env, jsize len);
+    jdoubleArray (JNICALL *NewDoubleArray)
+      (JNIEnv *env, jsize len);
+
+    jboolean * (JNICALL *GetBooleanArrayElements)
+      (JNIEnv *env, jbooleanArray array, jboolean *isCopy);
+    jbyte * (JNICALL *GetByteArrayElements)
+      (JNIEnv *env, jbyteArray array, jboolean *isCopy);
+    jchar * (JNICALL *GetCharArrayElements)
+      (JNIEnv *env, jcharArray array, jboolean *isCopy);
+    jshort * (JNICALL *GetShortArrayElements)
+      (JNIEnv *env, jshortArray array, jboolean *isCopy);
+    jint * (JNICALL *GetIntArrayElements)
+      (JNIEnv *env, jintArray array, jboolean *isCopy);
+    jlong * (JNICALL *GetLongArrayElements)
+      (JNIEnv *env, jlongArray array, jboolean *isCopy);
+    jfloat * (JNICALL *GetFloatArrayElements)
+      (JNIEnv *env, jfloatArray array, jboolean *isCopy);
+    jdouble * (JNICALL *GetDoubleArrayElements)
+      (JNIEnv *env, jdoubleArray array, jboolean *isCopy);
+
+    void (JNICALL *ReleaseBooleanArrayElements)
+      (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode);
+    void (JNICALL *ReleaseByteArrayElements)
+      (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode);
+    void (JNICALL *ReleaseCharArrayElements)
+      (JNIEnv *env, jcharArray array, jchar *elems, jint mode);
+    void (JNICALL *ReleaseShortArrayElements)
+      (JNIEnv *env, jshortArray array, jshort *elems, jint mode);
+    void (JNICALL *ReleaseIntArrayElements)
+      (JNIEnv *env, jintArray array, jint *elems, jint mode);
+    void (JNICALL *ReleaseLongArrayElements)
+      (JNIEnv *env, jlongArray array, jlong *elems, jint mode);
+    void (JNICALL *ReleaseFloatArrayElements)
+      (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode);
+    void (JNICALL *ReleaseDoubleArrayElements)
+      (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode);
+
+    void (JNICALL *GetBooleanArrayRegion)
+      (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf);
+    void (JNICALL *GetByteArrayRegion)
+      (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf);
+    void (JNICALL *GetCharArrayRegion)
+      (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf);
+    void (JNICALL *GetShortArrayRegion)
+      (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf);
+    void (JNICALL *GetIntArrayRegion)
+      (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf);
+    void (JNICALL *GetLongArrayRegion)
+      (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf);
+    void (JNICALL *GetFloatArrayRegion)
+      (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf);
+    void (JNICALL *GetDoubleArrayRegion)
+      (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf);
+
+    void (JNICALL *SetBooleanArrayRegion)
+      (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf);
+    void (JNICALL *SetByteArrayRegion)
+      (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf);
+    void (JNICALL *SetCharArrayRegion)
+      (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf);
+    void (JNICALL *SetShortArrayRegion)
+      (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf);
+    void (JNICALL *SetIntArrayRegion)
+      (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf);
+    void (JNICALL *SetLongArrayRegion)
+      (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf);
+    void (JNICALL *SetFloatArrayRegion)
+      (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf);
+    void (JNICALL *SetDoubleArrayRegion)
+      (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf);
+
+    jint (JNICALL *RegisterNatives)
+      (JNIEnv *env, jclass clazz, const JNINativeMethod *methods,
+       jint nMethods);
+    jint (JNICALL *UnregisterNatives)
+      (JNIEnv *env, jclass clazz);
+
+    jint (JNICALL *MonitorEnter)
+      (JNIEnv *env, jobject obj);
+    jint (JNICALL *MonitorExit)
+      (JNIEnv *env, jobject obj);
+
+    jint (JNICALL *GetJavaVM)
+      (JNIEnv *env, JavaVM **vm);
+
+    void (JNICALL *GetStringRegion)
+      (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf);
+    void (JNICALL *GetStringUTFRegion)
+      (JNIEnv *env, jstring str, jsize start, jsize len, char *buf);
+
+    void * (JNICALL *GetPrimitiveArrayCritical)
+      (JNIEnv *env, jarray array, jboolean *isCopy);
+    void (JNICALL *ReleasePrimitiveArrayCritical)
+      (JNIEnv *env, jarray array, void *carray, jint mode);
+
+    const jchar * (JNICALL *GetStringCritical)
+      (JNIEnv *env, jstring string, jboolean *isCopy);
+    void (JNICALL *ReleaseStringCritical)
+      (JNIEnv *env, jstring string, const jchar *cstring);
+
+    jweak (JNICALL *NewWeakGlobalRef)
+       (JNIEnv *env, jobject obj);
+    void (JNICALL *DeleteWeakGlobalRef)
+       (JNIEnv *env, jweak ref);
+
+    jboolean (JNICALL *ExceptionCheck)
+       (JNIEnv *env);
+
+    jobject (JNICALL *NewDirectByteBuffer)
+       (JNIEnv* env, void* address, jlong capacity);
+    void* (JNICALL *GetDirectBufferAddress)
+       (JNIEnv* env, jobject buf);
+    jlong (JNICALL *GetDirectBufferCapacity)
+       (JNIEnv* env, jobject buf);
+
+    /* New JNI 1.6 Features */
+
+    jobjectRefType (JNICALL *GetObjectRefType)
+        (JNIEnv* env, jobject obj);
+};
+
+/*
+ * We use inlined functions for C++ so that programmers can write:
+ *
+ *    env->FindClass("java/lang/String")
+ *
+ * in C++ rather than:
+ *
+ *    (*env)->FindClass(env, "java/lang/String")
+ *
+ * in C.
+ */
+
+struct JNIEnv_ {
+    const struct JNINativeInterface_ *functions;
+#ifdef __cplusplus
+
+    jint GetVersion() {
+        return functions->GetVersion(this);
+    }
+    jclass DefineClass(const char *name, jobject loader, const jbyte *buf,
+                       jsize len) {
+        return functions->DefineClass(this, name, loader, buf, len);
+    }
+    jclass FindClass(const char *name) {
+        return functions->FindClass(this, name);
+    }
+    jmethodID FromReflectedMethod(jobject method) {
+        return functions->FromReflectedMethod(this,method);
+    }
+    jfieldID FromReflectedField(jobject field) {
+        return functions->FromReflectedField(this,field);
+    }
+
+    jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) {
+        return functions->ToReflectedMethod(this, cls, methodID, isStatic);
+    }
+
+    jclass GetSuperclass(jclass sub) {
+        return functions->GetSuperclass(this, sub);
+    }
+    jboolean IsAssignableFrom(jclass sub, jclass sup) {
+        return functions->IsAssignableFrom(this, sub, sup);
+    }
+
+    jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) {
+        return functions->ToReflectedField(this,cls,fieldID,isStatic);
+    }
+
+    jint Throw(jthrowable obj) {
+        return functions->Throw(this, obj);
+    }
+    jint ThrowNew(jclass clazz, const char *msg) {
+        return functions->ThrowNew(this, clazz, msg);
+    }
+    jthrowable ExceptionOccurred() {
+        return functions->ExceptionOccurred(this);
+    }
+    void ExceptionDescribe() {
+        functions->ExceptionDescribe(this);
+    }
+    void ExceptionClear() {
+        functions->ExceptionClear(this);
+    }
+    void FatalError(const char *msg) {
+        functions->FatalError(this, msg);
+    }
+
+    jint PushLocalFrame(jint capacity) {
+        return functions->PushLocalFrame(this,capacity);
+    }
+    jobject PopLocalFrame(jobject result) {
+        return functions->PopLocalFrame(this,result);
+    }
+
+    jobject NewGlobalRef(jobject lobj) {
+        return functions->NewGlobalRef(this,lobj);
+    }
+    void DeleteGlobalRef(jobject gref) {
+        functions->DeleteGlobalRef(this,gref);
+    }
+    void DeleteLocalRef(jobject obj) {
+        functions->DeleteLocalRef(this, obj);
+    }
+
+    jboolean IsSameObject(jobject obj1, jobject obj2) {
+        return functions->IsSameObject(this,obj1,obj2);
+    }
+
+    jobject NewLocalRef(jobject ref) {
+        return functions->NewLocalRef(this,ref);
+    }
+    jint EnsureLocalCapacity(jint capacity) {
+        return functions->EnsureLocalCapacity(this,capacity);
+    }
+
+    jobject AllocObject(jclass clazz) {
+        return functions->AllocObject(this,clazz);
+    }
+    jobject NewObject(jclass clazz, jmethodID methodID, ...) {
+        va_list args;
+        jobject result;
+        va_start(args, methodID);
+        result = functions->NewObjectV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jobject NewObjectV(jclass clazz, jmethodID methodID,
+                       va_list args) {
+        return functions->NewObjectV(this,clazz,methodID,args);
+    }
+    jobject NewObjectA(jclass clazz, jmethodID methodID,
+                       const jvalue *args) {
+        return functions->NewObjectA(this,clazz,methodID,args);
+    }
+
+    jclass GetObjectClass(jobject obj) {
+        return functions->GetObjectClass(this,obj);
+    }
+    jboolean IsInstanceOf(jobject obj, jclass clazz) {
+        return functions->IsInstanceOf(this,obj,clazz);
+    }
+
+    jmethodID GetMethodID(jclass clazz, const char *name,
+                          const char *sig) {
+        return functions->GetMethodID(this,clazz,name,sig);
+    }
+
+    jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jobject result;
+        va_start(args,methodID);
+        result = functions->CallObjectMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jobject CallObjectMethodV(jobject obj, jmethodID methodID,
+                        va_list args) {
+        return functions->CallObjectMethodV(this,obj,methodID,args);
+    }
+    jobject CallObjectMethodA(jobject obj, jmethodID methodID,
+                        const jvalue * args) {
+        return functions->CallObjectMethodA(this,obj,methodID,args);
+    }
+
+    jboolean CallBooleanMethod(jobject obj,
+                               jmethodID methodID, ...) {
+        va_list args;
+        jboolean result;
+        va_start(args,methodID);
+        result = functions->CallBooleanMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jboolean CallBooleanMethodV(jobject obj, jmethodID methodID,
+                                va_list args) {
+        return functions->CallBooleanMethodV(this,obj,methodID,args);
+    }
+    jboolean CallBooleanMethodA(jobject obj, jmethodID methodID,
+                                const jvalue * args) {
+        return functions->CallBooleanMethodA(this,obj,methodID, args);
+    }
+
+    jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jbyte result;
+        va_start(args,methodID);
+        result = functions->CallByteMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jbyte CallByteMethodV(jobject obj, jmethodID methodID,
+                          va_list args) {
+        return functions->CallByteMethodV(this,obj,methodID,args);
+    }
+    jbyte CallByteMethodA(jobject obj, jmethodID methodID,
+                          const jvalue * args) {
+        return functions->CallByteMethodA(this,obj,methodID,args);
+    }
+
+    jchar CallCharMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jchar result;
+        va_start(args,methodID);
+        result = functions->CallCharMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jchar CallCharMethodV(jobject obj, jmethodID methodID,
+                          va_list args) {
+        return functions->CallCharMethodV(this,obj,methodID,args);
+    }
+    jchar CallCharMethodA(jobject obj, jmethodID methodID,
+                          const jvalue * args) {
+        return functions->CallCharMethodA(this,obj,methodID,args);
+    }
+
+    jshort CallShortMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jshort result;
+        va_start(args,methodID);
+        result = functions->CallShortMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jshort CallShortMethodV(jobject obj, jmethodID methodID,
+                            va_list args) {
+        return functions->CallShortMethodV(this,obj,methodID,args);
+    }
+    jshort CallShortMethodA(jobject obj, jmethodID methodID,
+                            const jvalue * args) {
+        return functions->CallShortMethodA(this,obj,methodID,args);
+    }
+
+    jint CallIntMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jint result;
+        va_start(args,methodID);
+        result = functions->CallIntMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jint CallIntMethodV(jobject obj, jmethodID methodID,
+                        va_list args) {
+        return functions->CallIntMethodV(this,obj,methodID,args);
+    }
+    jint CallIntMethodA(jobject obj, jmethodID methodID,
+                        const jvalue * args) {
+        return functions->CallIntMethodA(this,obj,methodID,args);
+    }
+
+    jlong CallLongMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jlong result;
+        va_start(args,methodID);
+        result = functions->CallLongMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jlong CallLongMethodV(jobject obj, jmethodID methodID,
+                          va_list args) {
+        return functions->CallLongMethodV(this,obj,methodID,args);
+    }
+    jlong CallLongMethodA(jobject obj, jmethodID methodID,
+                          const jvalue * args) {
+        return functions->CallLongMethodA(this,obj,methodID,args);
+    }
+
+    jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jfloat result;
+        va_start(args,methodID);
+        result = functions->CallFloatMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jfloat CallFloatMethodV(jobject obj, jmethodID methodID,
+                            va_list args) {
+        return functions->CallFloatMethodV(this,obj,methodID,args);
+    }
+    jfloat CallFloatMethodA(jobject obj, jmethodID methodID,
+                            const jvalue * args) {
+        return functions->CallFloatMethodA(this,obj,methodID,args);
+    }
+
+    jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jdouble result;
+        va_start(args,methodID);
+        result = functions->CallDoubleMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jdouble CallDoubleMethodV(jobject obj, jmethodID methodID,
+                        va_list args) {
+        return functions->CallDoubleMethodV(this,obj,methodID,args);
+    }
+    jdouble CallDoubleMethodA(jobject obj, jmethodID methodID,
+                        const jvalue * args) {
+        return functions->CallDoubleMethodA(this,obj,methodID,args);
+    }
+
+    void CallVoidMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        va_start(args,methodID);
+        functions->CallVoidMethodV(this,obj,methodID,args);
+        va_end(args);
+    }
+    void CallVoidMethodV(jobject obj, jmethodID methodID,
+                         va_list args) {
+        functions->CallVoidMethodV(this,obj,methodID,args);
+    }
+    void CallVoidMethodA(jobject obj, jmethodID methodID,
+                         const jvalue * args) {
+        functions->CallVoidMethodA(this,obj,methodID,args);
+    }
+
+    jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz,
+                                       jmethodID methodID, ...) {
+        va_list args;
+        jobject result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualObjectMethodV(this,obj,clazz,
+                                                        methodID,args);
+        va_end(args);
+        return result;
+    }
+    jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz,
+                                        jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualObjectMethodV(this,obj,clazz,
+                                                      methodID,args);
+    }
+    jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz,
+                                        jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualObjectMethodA(this,obj,clazz,
+                                                      methodID,args);
+    }
+
+    jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz,
+                                         jmethodID methodID, ...) {
+        va_list args;
+        jboolean result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
+                                                         methodID,args);
+        va_end(args);
+        return result;
+    }
+    jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz,
+                                          jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
+                                                       methodID,args);
+    }
+    jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz,
+                                          jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualBooleanMethodA(this,obj,clazz,
+                                                       methodID, args);
+    }
+
+    jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz,
+                                   jmethodID methodID, ...) {
+        va_list args;
+        jbyte result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualByteMethodV(this,obj,clazz,
+                                                      methodID,args);
+        va_end(args);
+        return result;
+    }
+    jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz,
+                                    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualByteMethodV(this,obj,clazz,
+                                                    methodID,args);
+    }
+    jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz,
+                                    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualByteMethodA(this,obj,clazz,
+                                                    methodID,args);
+    }
+
+    jchar CallNonvirtualCharMethod(jobject obj, jclass clazz,
+                                   jmethodID methodID, ...) {
+        va_list args;
+        jchar result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualCharMethodV(this,obj,clazz,
+                                                      methodID,args);
+        va_end(args);
+        return result;
+    }
+    jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz,
+                                    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualCharMethodV(this,obj,clazz,
+                                                    methodID,args);
+    }
+    jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz,
+                                    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualCharMethodA(this,obj,clazz,
+                                                    methodID,args);
+    }
+
+    jshort CallNonvirtualShortMethod(jobject obj, jclass clazz,
+                                     jmethodID methodID, ...) {
+        va_list args;
+        jshort result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualShortMethodV(this,obj,clazz,
+                                                       methodID,args);
+        va_end(args);
+        return result;
+    }
+    jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz,
+                                      jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualShortMethodV(this,obj,clazz,
+                                                     methodID,args);
+    }
+    jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz,
+                                      jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualShortMethodA(this,obj,clazz,
+                                                     methodID,args);
+    }
+
+    jint CallNonvirtualIntMethod(jobject obj, jclass clazz,
+                                 jmethodID methodID, ...) {
+        va_list args;
+        jint result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualIntMethodV(this,obj,clazz,
+                                                     methodID,args);
+        va_end(args);
+        return result;
+    }
+    jint CallNonvirtualIntMethodV(jobject obj, jclass clazz,
+                                  jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualIntMethodV(this,obj,clazz,
+                                                   methodID,args);
+    }
+    jint CallNonvirtualIntMethodA(jobject obj, jclass clazz,
+                                  jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualIntMethodA(this,obj,clazz,
+                                                   methodID,args);
+    }
+
+    jlong CallNonvirtualLongMethod(jobject obj, jclass clazz,
+                                   jmethodID methodID, ...) {
+        va_list args;
+        jlong result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualLongMethodV(this,obj,clazz,
+                                                      methodID,args);
+        va_end(args);
+        return result;
+    }
+    jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz,
+                                    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualLongMethodV(this,obj,clazz,
+                                                    methodID,args);
+    }
+    jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz,
+                                    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualLongMethodA(this,obj,clazz,
+                                                    methodID,args);
+    }
+
+    jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz,
+                                     jmethodID methodID, ...) {
+        va_list args;
+        jfloat result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualFloatMethodV(this,obj,clazz,
+                                                       methodID,args);
+        va_end(args);
+        return result;
+    }
+    jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz,
+                                      jmethodID methodID,
+                                      va_list args) {
+        return functions->CallNonvirtualFloatMethodV(this,obj,clazz,
+                                                     methodID,args);
+    }
+    jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz,
+                                      jmethodID methodID,
+                                      const jvalue * args) {
+        return functions->CallNonvirtualFloatMethodA(this,obj,clazz,
+                                                     methodID,args);
+    }
+
+    jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz,
+                                       jmethodID methodID, ...) {
+        va_list args;
+        jdouble result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
+                                                        methodID,args);
+        va_end(args);
+        return result;
+    }
+    jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz,
+                                        jmethodID methodID,
+                                        va_list args) {
+        return functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
+                                                      methodID,args);
+    }
+    jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz,
+                                        jmethodID methodID,
+                                        const jvalue * args) {
+        return functions->CallNonvirtualDoubleMethodA(this,obj,clazz,
+                                                      methodID,args);
+    }
+
+    void CallNonvirtualVoidMethod(jobject obj, jclass clazz,
+                                  jmethodID methodID, ...) {
+        va_list args;
+        va_start(args,methodID);
+        functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
+        va_end(args);
+    }
+    void CallNonvirtualVoidMethodV(jobject obj, jclass clazz,
+                                   jmethodID methodID,
+                                   va_list args) {
+        functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
+    }
+    void CallNonvirtualVoidMethodA(jobject obj, jclass clazz,
+                                   jmethodID methodID,
+                                   const jvalue * args) {
+        functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args);
+    }
+
+    jfieldID GetFieldID(jclass clazz, const char *name,
+                        const char *sig) {
+        return functions->GetFieldID(this,clazz,name,sig);
+    }
+
+    jobject GetObjectField(jobject obj, jfieldID fieldID) {
+        return functions->GetObjectField(this,obj,fieldID);
+    }
+    jboolean GetBooleanField(jobject obj, jfieldID fieldID) {
+        return functions->GetBooleanField(this,obj,fieldID);
+    }
+    jbyte GetByteField(jobject obj, jfieldID fieldID) {
+        return functions->GetByteField(this,obj,fieldID);
+    }
+    jchar GetCharField(jobject obj, jfieldID fieldID) {
+        return functions->GetCharField(this,obj,fieldID);
+    }
+    jshort GetShortField(jobject obj, jfieldID fieldID) {
+        return functions->GetShortField(this,obj,fieldID);
+    }
+    jint GetIntField(jobject obj, jfieldID fieldID) {
+        return functions->GetIntField(this,obj,fieldID);
+    }
+    jlong GetLongField(jobject obj, jfieldID fieldID) {
+        return functions->GetLongField(this,obj,fieldID);
+    }
+    jfloat GetFloatField(jobject obj, jfieldID fieldID) {
+        return functions->GetFloatField(this,obj,fieldID);
+    }
+    jdouble GetDoubleField(jobject obj, jfieldID fieldID) {
+        return functions->GetDoubleField(this,obj,fieldID);
+    }
+
+    void SetObjectField(jobject obj, jfieldID fieldID, jobject val) {
+        functions->SetObjectField(this,obj,fieldID,val);
+    }
+    void SetBooleanField(jobject obj, jfieldID fieldID,
+                         jboolean val) {
+        functions->SetBooleanField(this,obj,fieldID,val);
+    }
+    void SetByteField(jobject obj, jfieldID fieldID,
+                      jbyte val) {
+        functions->SetByteField(this,obj,fieldID,val);
+    }
+    void SetCharField(jobject obj, jfieldID fieldID,
+                      jchar val) {
+        functions->SetCharField(this,obj,fieldID,val);
+    }
+    void SetShortField(jobject obj, jfieldID fieldID,
+                       jshort val) {
+        functions->SetShortField(this,obj,fieldID,val);
+    }
+    void SetIntField(jobject obj, jfieldID fieldID,
+                     jint val) {
+        functions->SetIntField(this,obj,fieldID,val);
+    }
+    void SetLongField(jobject obj, jfieldID fieldID,
+                      jlong val) {
+        functions->SetLongField(this,obj,fieldID,val);
+    }
+    void SetFloatField(jobject obj, jfieldID fieldID,
+                       jfloat val) {
+        functions->SetFloatField(this,obj,fieldID,val);
+    }
+    void SetDoubleField(jobject obj, jfieldID fieldID,
+                        jdouble val) {
+        functions->SetDoubleField(this,obj,fieldID,val);
+    }
+
+    jmethodID GetStaticMethodID(jclass clazz, const char *name,
+                                const char *sig) {
+        return functions->GetStaticMethodID(this,clazz,name,sig);
+    }
+
+    jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID,
+                             ...) {
+        va_list args;
+        jobject result;
+        va_start(args,methodID);
+        result = functions->CallStaticObjectMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID,
+                              va_list args) {
+        return functions->CallStaticObjectMethodV(this,clazz,methodID,args);
+    }
+    jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID,
+                              const jvalue *args) {
+        return functions->CallStaticObjectMethodA(this,clazz,methodID,args);
+    }
+
+    jboolean CallStaticBooleanMethod(jclass clazz,
+                                     jmethodID methodID, ...) {
+        va_list args;
+        jboolean result;
+        va_start(args,methodID);
+        result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jboolean CallStaticBooleanMethodV(jclass clazz,
+                                      jmethodID methodID, va_list args) {
+        return functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
+    }
+    jboolean CallStaticBooleanMethodA(jclass clazz,
+                                      jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticBooleanMethodA(this,clazz,methodID,args);
+    }
+
+    jbyte CallStaticByteMethod(jclass clazz,
+                               jmethodID methodID, ...) {
+        va_list args;
+        jbyte result;
+        va_start(args,methodID);
+        result = functions->CallStaticByteMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jbyte CallStaticByteMethodV(jclass clazz,
+                                jmethodID methodID, va_list args) {
+        return functions->CallStaticByteMethodV(this,clazz,methodID,args);
+    }
+    jbyte CallStaticByteMethodA(jclass clazz,
+                                jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticByteMethodA(this,clazz,methodID,args);
+    }
+
+    jchar CallStaticCharMethod(jclass clazz,
+                               jmethodID methodID, ...) {
+        va_list args;
+        jchar result;
+        va_start(args,methodID);
+        result = functions->CallStaticCharMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jchar CallStaticCharMethodV(jclass clazz,
+                                jmethodID methodID, va_list args) {
+        return functions->CallStaticCharMethodV(this,clazz,methodID,args);
+    }
+    jchar CallStaticCharMethodA(jclass clazz,
+                                jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticCharMethodA(this,clazz,methodID,args);
+    }
+
+    jshort CallStaticShortMethod(jclass clazz,
+                                 jmethodID methodID, ...) {
+        va_list args;
+        jshort result;
+        va_start(args,methodID);
+        result = functions->CallStaticShortMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jshort CallStaticShortMethodV(jclass clazz,
+                                  jmethodID methodID, va_list args) {
+        return functions->CallStaticShortMethodV(this,clazz,methodID,args);
+    }
+    jshort CallStaticShortMethodA(jclass clazz,
+                                  jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticShortMethodA(this,clazz,methodID,args);
+    }
+
+    jint CallStaticIntMethod(jclass clazz,
+                             jmethodID methodID, ...) {
+        va_list args;
+        jint result;
+        va_start(args,methodID);
+        result = functions->CallStaticIntMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jint CallStaticIntMethodV(jclass clazz,
+                              jmethodID methodID, va_list args) {
+        return functions->CallStaticIntMethodV(this,clazz,methodID,args);
+    }
+    jint CallStaticIntMethodA(jclass clazz,
+                              jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticIntMethodA(this,clazz,methodID,args);
+    }
+
+    jlong CallStaticLongMethod(jclass clazz,
+                               jmethodID methodID, ...) {
+        va_list args;
+        jlong result;
+        va_start(args,methodID);
+        result = functions->CallStaticLongMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jlong CallStaticLongMethodV(jclass clazz,
+                                jmethodID methodID, va_list args) {
+        return functions->CallStaticLongMethodV(this,clazz,methodID,args);
+    }
+    jlong CallStaticLongMethodA(jclass clazz,
+                                jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticLongMethodA(this,clazz,methodID,args);
+    }
+
+    jfloat CallStaticFloatMethod(jclass clazz,
+                                 jmethodID methodID, ...) {
+        va_list args;
+        jfloat result;
+        va_start(args,methodID);
+        result = functions->CallStaticFloatMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jfloat CallStaticFloatMethodV(jclass clazz,
+                                  jmethodID methodID, va_list args) {
+        return functions->CallStaticFloatMethodV(this,clazz,methodID,args);
+    }
+    jfloat CallStaticFloatMethodA(jclass clazz,
+                                  jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticFloatMethodA(this,clazz,methodID,args);
+    }
+
+    jdouble CallStaticDoubleMethod(jclass clazz,
+                                   jmethodID methodID, ...) {
+        va_list args;
+        jdouble result;
+        va_start(args,methodID);
+        result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jdouble CallStaticDoubleMethodV(jclass clazz,
+                                    jmethodID methodID, va_list args) {
+        return functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
+    }
+    jdouble CallStaticDoubleMethodA(jclass clazz,
+                                    jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticDoubleMethodA(this,clazz,methodID,args);
+    }
+
+    void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) {
+        va_list args;
+        va_start(args,methodID);
+        functions->CallStaticVoidMethodV(this,cls,methodID,args);
+        va_end(args);
+    }
+    void CallStaticVoidMethodV(jclass cls, jmethodID methodID,
+                               va_list args) {
+        functions->CallStaticVoidMethodV(this,cls,methodID,args);
+    }
+    void CallStaticVoidMethodA(jclass cls, jmethodID methodID,
+                               const jvalue * args) {
+        functions->CallStaticVoidMethodA(this,cls,methodID,args);
+    }
+
+    jfieldID GetStaticFieldID(jclass clazz, const char *name,
+                              const char *sig) {
+        return functions->GetStaticFieldID(this,clazz,name,sig);
+    }
+    jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticObjectField(this,clazz,fieldID);
+    }
+    jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticBooleanField(this,clazz,fieldID);
+    }
+    jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticByteField(this,clazz,fieldID);
+    }
+    jchar GetStaticCharField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticCharField(this,clazz,fieldID);
+    }
+    jshort GetStaticShortField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticShortField(this,clazz,fieldID);
+    }
+    jint GetStaticIntField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticIntField(this,clazz,fieldID);
+    }
+    jlong GetStaticLongField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticLongField(this,clazz,fieldID);
+    }
+    jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticFloatField(this,clazz,fieldID);
+    }
+    jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticDoubleField(this,clazz,fieldID);
+    }
+
+    void SetStaticObjectField(jclass clazz, jfieldID fieldID,
+                        jobject value) {
+      functions->SetStaticObjectField(this,clazz,fieldID,value);
+    }
+    void SetStaticBooleanField(jclass clazz, jfieldID fieldID,
+                        jboolean value) {
+      functions->SetStaticBooleanField(this,clazz,fieldID,value);
+    }
+    void SetStaticByteField(jclass clazz, jfieldID fieldID,
+                        jbyte value) {
+      functions->SetStaticByteField(this,clazz,fieldID,value);
+    }
+    void SetStaticCharField(jclass clazz, jfieldID fieldID,
+                        jchar value) {
+      functions->SetStaticCharField(this,clazz,fieldID,value);
+    }
+    void SetStaticShortField(jclass clazz, jfieldID fieldID,
+                        jshort value) {
+      functions->SetStaticShortField(this,clazz,fieldID,value);
+    }
+    void SetStaticIntField(jclass clazz, jfieldID fieldID,
+                        jint value) {
+      functions->SetStaticIntField(this,clazz,fieldID,value);
+    }
+    void SetStaticLongField(jclass clazz, jfieldID fieldID,
+                        jlong value) {
+      functions->SetStaticLongField(this,clazz,fieldID,value);
+    }
+    void SetStaticFloatField(jclass clazz, jfieldID fieldID,
+                        jfloat value) {
+      functions->SetStaticFloatField(this,clazz,fieldID,value);
+    }
+    void SetStaticDoubleField(jclass clazz, jfieldID fieldID,
+                        jdouble value) {
+      functions->SetStaticDoubleField(this,clazz,fieldID,value);
+    }
+
+    jstring NewString(const jchar *unicode, jsize len) {
+        return functions->NewString(this,unicode,len);
+    }
+    jsize GetStringLength(jstring str) {
+        return functions->GetStringLength(this,str);
+    }
+    const jchar *GetStringChars(jstring str, jboolean *isCopy) {
+        return functions->GetStringChars(this,str,isCopy);
+    }
+    void ReleaseStringChars(jstring str, const jchar *chars) {
+        functions->ReleaseStringChars(this,str,chars);
+    }
+
+    jstring NewStringUTF(const char *utf) {
+        return functions->NewStringUTF(this,utf);
+    }
+    jsize GetStringUTFLength(jstring str) {
+        return functions->GetStringUTFLength(this,str);
+    }
+    const char* GetStringUTFChars(jstring str, jboolean *isCopy) {
+        return functions->GetStringUTFChars(this,str,isCopy);
+    }
+    void ReleaseStringUTFChars(jstring str, const char* chars) {
+        functions->ReleaseStringUTFChars(this,str,chars);
+    }
+
+    jsize GetArrayLength(jarray array) {
+        return functions->GetArrayLength(this,array);
+    }
+
+    jobjectArray NewObjectArray(jsize len, jclass clazz,
+                                jobject init) {
+        return functions->NewObjectArray(this,len,clazz,init);
+    }
+    jobject GetObjectArrayElement(jobjectArray array, jsize index) {
+        return functions->GetObjectArrayElement(this,array,index);
+    }
+    void SetObjectArrayElement(jobjectArray array, jsize index,
+                               jobject val) {
+        functions->SetObjectArrayElement(this,array,index,val);
+    }
+
+    jbooleanArray NewBooleanArray(jsize len) {
+        return functions->NewBooleanArray(this,len);
+    }
+    jbyteArray NewByteArray(jsize len) {
+        return functions->NewByteArray(this,len);
+    }
+    jcharArray NewCharArray(jsize len) {
+        return functions->NewCharArray(this,len);
+    }
+    jshortArray NewShortArray(jsize len) {
+        return functions->NewShortArray(this,len);
+    }
+    jintArray NewIntArray(jsize len) {
+        return functions->NewIntArray(this,len);
+    }
+    jlongArray NewLongArray(jsize len) {
+        return functions->NewLongArray(this,len);
+    }
+    jfloatArray NewFloatArray(jsize len) {
+        return functions->NewFloatArray(this,len);
+    }
+    jdoubleArray NewDoubleArray(jsize len) {
+        return functions->NewDoubleArray(this,len);
+    }
+
+    jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) {
+        return functions->GetBooleanArrayElements(this,array,isCopy);
+    }
+    jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) {
+        return functions->GetByteArrayElements(this,array,isCopy);
+    }
+    jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) {
+        return functions->GetCharArrayElements(this,array,isCopy);
+    }
+    jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) {
+        return functions->GetShortArrayElements(this,array,isCopy);
+    }
+    jint * GetIntArrayElements(jintArray array, jboolean *isCopy) {
+        return functions->GetIntArrayElements(this,array,isCopy);
+    }
+    jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) {
+        return functions->GetLongArrayElements(this,array,isCopy);
+    }
+    jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) {
+        return functions->GetFloatArrayElements(this,array,isCopy);
+    }
+    jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) {
+        return functions->GetDoubleArrayElements(this,array,isCopy);
+    }
+
+    void ReleaseBooleanArrayElements(jbooleanArray array,
+                                     jboolean *elems,
+                                     jint mode) {
+        functions->ReleaseBooleanArrayElements(this,array,elems,mode);
+    }
+    void ReleaseByteArrayElements(jbyteArray array,
+                                  jbyte *elems,
+                                  jint mode) {
+        functions->ReleaseByteArrayElements(this,array,elems,mode);
+    }
+    void ReleaseCharArrayElements(jcharArray array,
+                                  jchar *elems,
+                                  jint mode) {
+        functions->ReleaseCharArrayElements(this,array,elems,mode);
+    }
+    void ReleaseShortArrayElements(jshortArray array,
+                                   jshort *elems,
+                                   jint mode) {
+        functions->ReleaseShortArrayElements(this,array,elems,mode);
+    }
+    void ReleaseIntArrayElements(jintArray array,
+                                 jint *elems,
+                                 jint mode) {
+        functions->ReleaseIntArrayElements(this,array,elems,mode);
+    }
+    void ReleaseLongArrayElements(jlongArray array,
+                                  jlong *elems,
+                                  jint mode) {
+        functions->ReleaseLongArrayElements(this,array,elems,mode);
+    }
+    void ReleaseFloatArrayElements(jfloatArray array,
+                                   jfloat *elems,
+                                   jint mode) {
+        functions->ReleaseFloatArrayElements(this,array,elems,mode);
+    }
+    void ReleaseDoubleArrayElements(jdoubleArray array,
+                                    jdouble *elems,
+                                    jint mode) {
+        functions->ReleaseDoubleArrayElements(this,array,elems,mode);
+    }
+
+    void GetBooleanArrayRegion(jbooleanArray array,
+                               jsize start, jsize len, jboolean *buf) {
+        functions->GetBooleanArrayRegion(this,array,start,len,buf);
+    }
+    void GetByteArrayRegion(jbyteArray array,
+                            jsize start, jsize len, jbyte *buf) {
+        functions->GetByteArrayRegion(this,array,start,len,buf);
+    }
+    void GetCharArrayRegion(jcharArray array,
+                            jsize start, jsize len, jchar *buf) {
+        functions->GetCharArrayRegion(this,array,start,len,buf);
+    }
+    void GetShortArrayRegion(jshortArray array,
+                             jsize start, jsize len, jshort *buf) {
+        functions->GetShortArrayRegion(this,array,start,len,buf);
+    }
+    void GetIntArrayRegion(jintArray array,
+                           jsize start, jsize len, jint *buf) {
+        functions->GetIntArrayRegion(this,array,start,len,buf);
+    }
+    void GetLongArrayRegion(jlongArray array,
+                            jsize start, jsize len, jlong *buf) {
+        functions->GetLongArrayRegion(this,array,start,len,buf);
+    }
+    void GetFloatArrayRegion(jfloatArray array,
+                             jsize start, jsize len, jfloat *buf) {
+        functions->GetFloatArrayRegion(this,array,start,len,buf);
+    }
+    void GetDoubleArrayRegion(jdoubleArray array,
+                              jsize start, jsize len, jdouble *buf) {
+        functions->GetDoubleArrayRegion(this,array,start,len,buf);
+    }
+
+    void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len,
+                               const jboolean *buf) {
+        functions->SetBooleanArrayRegion(this,array,start,len,buf);
+    }
+    void SetByteArrayRegion(jbyteArray array, jsize start, jsize len,
+                            const jbyte *buf) {
+        functions->SetByteArrayRegion(this,array,start,len,buf);
+    }
+    void SetCharArrayRegion(jcharArray array, jsize start, jsize len,
+                            const jchar *buf) {
+        functions->SetCharArrayRegion(this,array,start,len,buf);
+    }
+    void SetShortArrayRegion(jshortArray array, jsize start, jsize len,
+                             const jshort *buf) {
+        functions->SetShortArrayRegion(this,array,start,len,buf);
+    }
+    void SetIntArrayRegion(jintArray array, jsize start, jsize len,
+                           const jint *buf) {
+        functions->SetIntArrayRegion(this,array,start,len,buf);
+    }
+    void SetLongArrayRegion(jlongArray array, jsize start, jsize len,
+                            const jlong *buf) {
+        functions->SetLongArrayRegion(this,array,start,len,buf);
+    }
+    void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len,
+                             const jfloat *buf) {
+        functions->SetFloatArrayRegion(this,array,start,len,buf);
+    }
+    void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len,
+                              const jdouble *buf) {
+        functions->SetDoubleArrayRegion(this,array,start,len,buf);
+    }
+
+    jint RegisterNatives(jclass clazz, const JNINativeMethod *methods,
+                         jint nMethods) {
+        return functions->RegisterNatives(this,clazz,methods,nMethods);
+    }
+    jint UnregisterNatives(jclass clazz) {
+        return functions->UnregisterNatives(this,clazz);
+    }
+
+    jint MonitorEnter(jobject obj) {
+        return functions->MonitorEnter(this,obj);
+    }
+    jint MonitorExit(jobject obj) {
+        return functions->MonitorExit(this,obj);
+    }
+
+    jint GetJavaVM(JavaVM **vm) {
+        return functions->GetJavaVM(this,vm);
+    }
+
+    void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) {
+        functions->GetStringRegion(this,str,start,len,buf);
+    }
+    void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) {
+        functions->GetStringUTFRegion(this,str,start,len,buf);
+    }
+
+    void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) {
+        return functions->GetPrimitiveArrayCritical(this,array,isCopy);
+    }
+    void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) {
+        functions->ReleasePrimitiveArrayCritical(this,array,carray,mode);
+    }
+
+    const jchar * GetStringCritical(jstring string, jboolean *isCopy) {
+        return functions->GetStringCritical(this,string,isCopy);
+    }
+    void ReleaseStringCritical(jstring string, const jchar *cstring) {
+        functions->ReleaseStringCritical(this,string,cstring);
+    }
+
+    jweak NewWeakGlobalRef(jobject obj) {
+        return functions->NewWeakGlobalRef(this,obj);
+    }
+    void DeleteWeakGlobalRef(jweak ref) {
+        functions->DeleteWeakGlobalRef(this,ref);
+    }
+
+    jboolean ExceptionCheck() {
+        return functions->ExceptionCheck(this);
+    }
+
+    jobject NewDirectByteBuffer(void* address, jlong capacity) {
+        return functions->NewDirectByteBuffer(this, address, capacity);
+    }
+    void* GetDirectBufferAddress(jobject buf) {
+        return functions->GetDirectBufferAddress(this, buf);
+    }
+    jlong GetDirectBufferCapacity(jobject buf) {
+        return functions->GetDirectBufferCapacity(this, buf);
+    }
+    jobjectRefType GetObjectRefType(jobject obj) {
+        return functions->GetObjectRefType(this, obj);
+    }
+
+#endif /* __cplusplus */
+};
+
+typedef struct JavaVMOption {
+    char *optionString;
+    void *extraInfo;
+} JavaVMOption;
+
+typedef struct JavaVMInitArgs {
+    jint version;
+
+    jint nOptions;
+    JavaVMOption *options;
+    jboolean ignoreUnrecognized;
+} JavaVMInitArgs;
+
+typedef struct JavaVMAttachArgs {
+    jint version;
+
+    char *name;
+    jobject group;
+} JavaVMAttachArgs;
+
+/* These will be VM-specific. */
+
+#define JDK1_2
+#define JDK1_4
+
+/* End VM-specific. */
+
+struct JNIInvokeInterface_ {
+    void *reserved0;
+    void *reserved1;
+    void *reserved2;
+
+    jint (JNICALL *DestroyJavaVM)(JavaVM *vm);
+
+    jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args);
+
+    jint (JNICALL *DetachCurrentThread)(JavaVM *vm);
+
+    jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version);
+
+    jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args);
+};
+
+struct JavaVM_ {
+    const struct JNIInvokeInterface_ *functions;
+#ifdef __cplusplus
+
+    jint DestroyJavaVM() {
+        return functions->DestroyJavaVM(this);
+    }
+    jint AttachCurrentThread(void **penv, void *args) {
+        return functions->AttachCurrentThread(this, penv, args);
+    }
+    jint DetachCurrentThread() {
+        return functions->DetachCurrentThread(this);
+    }
+
+    jint GetEnv(void **penv, jint version) {
+        return functions->GetEnv(this, penv, version);
+    }
+    jint AttachCurrentThreadAsDaemon(void **penv, void *args) {
+        return functions->AttachCurrentThreadAsDaemon(this, penv, args);
+    }
+#endif
+};
+
+#ifdef _JNI_IMPLEMENTATION_
+#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT
+#else
+#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT
+#endif
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_GetDefaultJavaVMInitArgs(void *args);
+
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args);
+
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *);
+
+/* Defined by native libraries. */
+JNIEXPORT jint JNICALL
+JNI_OnLoad(JavaVM *vm, void *reserved);
+
+JNIEXPORT void JNICALL
+JNI_OnUnload(JavaVM *vm, void *reserved);
+
+#define JNI_VERSION_1_1 0x00010001
+#define JNI_VERSION_1_2 0x00010002
+#define JNI_VERSION_1_4 0x00010004
+#define JNI_VERSION_1_6 0x00010006
+#define JNI_VERSION_1_8 0x00010008
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* !_JAVASOFT_JNI_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/jdk8u382-b05-win32/include/win32/jni_md.h	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef _JAVASOFT_JNI_MD_H_
+#define _JAVASOFT_JNI_MD_H_
+
+#define JNIEXPORT __declspec(dllexport)
+#define JNIIMPORT __declspec(dllimport)
+#define JNICALL __stdcall
+
+typedef long jint;
+typedef __int64 jlong;
+typedef signed char jbyte;
+
+#endif /* !_JAVASOFT_JNI_MD_H_ */
Binary file Resources/jdk8u382-b05-win32/lib/jvm.lib has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/jdk8u382-b05-win64/LICENSE	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,347 @@
+The GNU General Public License (GPL)
+
+Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Everyone is permitted to copy and distribute verbatim copies of this license
+document, but changing it is not allowed.
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share
+and change it.  By contrast, the GNU General Public License is intended to
+guarantee your freedom to share and change free software--to make sure the
+software is free for all its users.  This General Public License applies to
+most of the Free Software Foundation's software and to any other program whose
+authors commit to using it.  (Some other Free Software Foundation software is
+covered by the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+When we speak of free software, we are referring to freedom, not price.  Our
+General Public Licenses are designed to make sure that you have the freedom to
+distribute copies of free software (and charge for this service if you wish),
+that you receive source code or can get it if you want it, that you can change
+the software or use pieces of it in new free programs; and that you know you
+can do these things.
+
+To protect your rights, we need to make restrictions that forbid anyone to deny
+you these rights or to ask you to surrender the rights.  These restrictions
+translate to certain responsibilities for you if you distribute copies of the
+software, or if you modify it.
+
+For example, if you distribute copies of such a program, whether gratis or for
+a fee, you must give the recipients all the rights that you have.  You must
+make sure that they, too, receive or can get the source code.  And you must
+show them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the software, and (2)
+offer you this license which gives you legal permission to copy, distribute
+and/or modify the software.
+
+Also, for each author's protection and ours, we want to make certain that
+everyone understands that there is no warranty for this free software.  If the
+software is modified by someone else and passed on, we want its recipients to
+know that what they have is not the original, so that any problems introduced
+by others will not reflect on the original authors' reputations.
+
+Finally, any free program is threatened constantly by software patents.  We
+wish to avoid the danger that redistributors of a free program will
+individually obtain patent licenses, in effect making the program proprietary.
+To prevent this, we have made it clear that any patent must be licensed for
+everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution and modification
+follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License applies to any program or other work which contains a notice
+placed by the copyright holder saying it may be distributed under the terms of
+this General Public License.  The "Program", below, refers to any such program
+or work, and a "work based on the Program" means either the Program or any
+derivative work under copyright law: that is to say, a work containing the
+Program or a portion of it, either verbatim or with modifications and/or
+translated into another language.  (Hereinafter, translation is included
+without limitation in the term "modification".) Each licensee is addressed as
+"you".
+
+Activities other than copying, distribution and modification are not covered by
+this License; they are outside its scope.  The act of running the Program is
+not restricted, and the output from the Program is covered only if its contents
+constitute a work based on the Program (independent of having been made by
+running the Program).  Whether that is true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the Program's source code as
+you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice and
+disclaimer of warranty; keep intact all the notices that refer to this License
+and to the absence of any warranty; and give any other recipients of the
+Program a copy of this License along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and you may
+at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any portion of it, thus
+forming a work based on the Program, and copy and distribute such modifications
+or work under the terms of Section 1 above, provided that you also meet all of
+these conditions:
+
+    a) You must cause the modified files to carry prominent notices stating
+    that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in whole or
+    in part contains or is derived from the Program or any part thereof, to be
+    licensed as a whole at no charge to all third parties under the terms of
+    this License.
+
+    c) If the modified program normally reads commands interactively when run,
+    you must cause it, when started running for such interactive use in the
+    most ordinary way, to print or display an announcement including an
+    appropriate copyright notice and a notice that there is no warranty (or
+    else, saying that you provide a warranty) and that users may redistribute
+    the program under these conditions, and telling the user how to view a copy
+    of this License.  (Exception: if the Program itself is interactive but does
+    not normally print such an announcement, your work based on the Program is
+    not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If identifiable
+sections of that work are not derived from the Program, and can be reasonably
+considered independent and separate works in themselves, then this License, and
+its terms, do not apply to those sections when you distribute them as separate
+works.  But when you distribute the same sections as part of a whole which is a
+work based on the Program, the distribution of the whole must be on the terms
+of this License, whose permissions for other licensees extend to the entire
+whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your
+rights to work written entirely by you; rather, the intent is to exercise the
+right to control the distribution of derivative or collective works based on
+the Program.
+
+In addition, mere aggregation of another work not based on the Program with the
+Program (or with a work based on the Program) on a volume of a storage or
+distribution medium does not bring the other work under the scope of this
+License.
+
+3. You may copy and distribute the Program (or a work based on it, under
+Section 2) in object code or executable form under the terms of Sections 1 and
+2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable source
+    code, which must be distributed under the terms of Sections 1 and 2 above
+    on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three years, to
+    give any third party, for a charge no more than your cost of physically
+    performing source distribution, a complete machine-readable copy of the
+    corresponding source code, to be distributed under the terms of Sections 1
+    and 2 above on a medium customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer to
+    distribute corresponding source code.  (This alternative is allowed only
+    for noncommercial distribution and only if you received the program in
+    object code or executable form with such an offer, in accord with
+    Subsection b above.)
+
+The source code for a work means the preferred form of the work for making
+modifications to it.  For an executable work, complete source code means all
+the source code for all modules it contains, plus any associated interface
+definition files, plus the scripts used to control compilation and installation
+of the executable.  However, as a special exception, the source code
+distributed need not include anything that is normally distributed (in either
+source or binary form) with the major components (compiler, kernel, and so on)
+of the operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the source
+code from the same place counts as distribution of the source code, even though
+third parties are not compelled to copy the source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the Program except as
+expressly provided under this License.  Any attempt otherwise to copy, modify,
+sublicense or distribute the Program is void, and will automatically terminate
+your rights under this License.  However, parties who have received copies, or
+rights, from you under this License will not have their licenses terminated so
+long as such parties remain in full compliance.
+
+5. You are not required to accept this License, since you have not signed it.
+However, nothing else grants you permission to modify or distribute the Program
+or its derivative works.  These actions are prohibited by law if you do not
+accept this License.  Therefore, by modifying or distributing the Program (or
+any work based on the Program), you indicate your acceptance of this License to
+do so, and all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based on the Program),
+the recipient automatically receives a license from the original licensor to
+copy, distribute or modify the Program subject to these terms and conditions.
+You may not impose any further restrictions on the recipients' exercise of the
+rights granted herein.  You are not responsible for enforcing compliance by
+third parties to this License.
+
+7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues), conditions
+are imposed on you (whether by court order, agreement or otherwise) that
+contradict the conditions of this License, they do not excuse you from the
+conditions of this License.  If you cannot distribute so as to satisfy
+simultaneously your obligations under this License and any other pertinent
+obligations, then as a consequence you may not distribute the Program at all.
+For example, if a patent license would not permit royalty-free redistribution
+of the Program by all those who receive copies directly or indirectly through
+you, then the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply and
+the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or
+other property right claims or to contest validity of any such claims; this
+section has the sole purpose of protecting the integrity of the free software
+distribution system, which is implemented by public license practices.  Many
+people have made generous contributions to the wide range of software
+distributed through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing to
+distribute software through any other system and a licensee cannot impose that
+choice.
+
+This section is intended to make thoroughly clear what is believed to be a
+consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is restricted in certain
+countries either by patents or by copyrighted interfaces, the original
+copyright holder who places the Program under this License may add an explicit
+geographical distribution limitation excluding those countries, so that
+distribution is permitted only in or among countries not thus excluded.  In
+such case, this License incorporates the limitation as if written in the body
+of this License.
+
+9. The Free Software Foundation may publish revised and/or new versions of the
+General Public License from time to time.  Such new versions will be similar in
+spirit to the present version, but may differ in detail to address new problems
+or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any later
+version", you have the option of following the terms and conditions either of
+that version or of any later version published by the Free Software Foundation.
+If the Program does not specify a version number of this License, you may
+choose any version ever published by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into other free programs
+whose distribution conditions are different, write to the author to ask for
+permission.  For software which is copyrighted by the Free Software Foundation,
+write to the Free Software Foundation; we sometimes make exceptions for this.
+Our decision will be guided by the two goals of preserving the free status of
+all derivatives of our free software and of promoting the sharing and reuse of
+software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
+THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN OTHERWISE
+STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE
+PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND
+PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE,
+YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
+ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE
+PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR
+INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA
+BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER
+OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the greatest possible
+use to the public, the best way to achieve this is to make it free software
+which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program.  It is safest to attach
+them to the start of each source file to most effectively convey the exclusion
+of warranty; and each file should have at least the "copyright" line and a
+pointer to where the full notice is found.
+
+    One line to give the program's name and a brief idea of what it does.
+
+    Copyright (C) <year> <name of author>
+
+    This program is free software; you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by the Free
+    Software Foundation; either version 2 of the License, or (at your option)
+    any later version.
+
+    This program is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+    more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this when it
+starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author Gnomovision comes
+    with ABSOLUTELY NO WARRANTY; for details type 'show w'.  This is free
+    software, and you are welcome to redistribute it under certain conditions;
+    type 'show c' for details.
+
+The hypothetical commands 'show w' and 'show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may be
+called something other than 'show w' and 'show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.  Here
+is a sample; alter the names:
+
+    Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+    'Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+    signature of Ty Coon, 1 April 1989
+
+    Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General Public
+License instead of this License.
+
+
+"CLASSPATH" EXCEPTION TO THE GPL
+
+Certain source files distributed by Oracle America and/or its affiliates are
+subject to the following clarification and special exception to the GPL, but
+only where Oracle has expressly included in the particular source file's header
+the words "Oracle designates this particular file as subject to the "Classpath"
+exception as provided by Oracle in the LICENSE file that accompanied this code."
+
+    Linking this library statically or dynamically with other modules is making
+    a combined work based on this library.  Thus, the terms and conditions of
+    the GNU General Public License cover the whole combination.
+
+    As a special exception, the copyright holders of this library give you
+    permission to link this library with independent modules to produce an
+    executable, regardless of the license terms of these independent modules,
+    and to copy and distribute the resulting executable under terms of your
+    choice, provided that you also meet, for each linked independent module,
+    the terms and conditions of the license of that module.  An independent
+    module is a module which is not derived from or based on this library.  If
+    you modify this library, you may extend this exception to your version of
+    the library, but you are not obligated to do so.  If you do not wish to do
+    so, delete this exception statement from your version.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/jdk8u382-b05-win64/NOTES.txt	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,11 @@
+This is an excerpt of the Eclipse Temurin Latest Releases for:
+
+- Operating system: Windows
+- Architecture: x64
+- Package type: JDK
+- Version: 8 - LTS
+- Package type: ZIP
+
+https://adoptium.net/temurin/releases/
+
+Filename: OpenJDK8U-jdk_x64_windows_hotspot_8u382b05.zip
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/jdk8u382-b05-win64/include/jni.h	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,1960 @@
+/*
+ * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * We used part of Netscape's Java Runtime Interface (JRI) as the starting
+ * point of our design and implementation.
+ */
+
+/******************************************************************************
+ * Java Runtime Interface
+ * Copyright (c) 1996 Netscape Communications Corporation. All rights reserved.
+ *****************************************************************************/
+
+#ifndef _JAVASOFT_JNI_H_
+#define _JAVASOFT_JNI_H_
+
+#include <stdio.h>
+#include <stdarg.h>
+
+/* jni_md.h contains the machine-dependent typedefs for jbyte, jint
+   and jlong */
+
+#include "jni_md.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * JNI Types
+ */
+
+#ifndef JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H
+
+typedef unsigned char   jboolean;
+typedef unsigned short  jchar;
+typedef short           jshort;
+typedef float           jfloat;
+typedef double          jdouble;
+
+typedef jint            jsize;
+
+#ifdef __cplusplus
+
+class _jobject {};
+class _jclass : public _jobject {};
+class _jthrowable : public _jobject {};
+class _jstring : public _jobject {};
+class _jarray : public _jobject {};
+class _jbooleanArray : public _jarray {};
+class _jbyteArray : public _jarray {};
+class _jcharArray : public _jarray {};
+class _jshortArray : public _jarray {};
+class _jintArray : public _jarray {};
+class _jlongArray : public _jarray {};
+class _jfloatArray : public _jarray {};
+class _jdoubleArray : public _jarray {};
+class _jobjectArray : public _jarray {};
+
+typedef _jobject *jobject;
+typedef _jclass *jclass;
+typedef _jthrowable *jthrowable;
+typedef _jstring *jstring;
+typedef _jarray *jarray;
+typedef _jbooleanArray *jbooleanArray;
+typedef _jbyteArray *jbyteArray;
+typedef _jcharArray *jcharArray;
+typedef _jshortArray *jshortArray;
+typedef _jintArray *jintArray;
+typedef _jlongArray *jlongArray;
+typedef _jfloatArray *jfloatArray;
+typedef _jdoubleArray *jdoubleArray;
+typedef _jobjectArray *jobjectArray;
+
+#else
+
+struct _jobject;
+
+typedef struct _jobject *jobject;
+typedef jobject jclass;
+typedef jobject jthrowable;
+typedef jobject jstring;
+typedef jobject jarray;
+typedef jarray jbooleanArray;
+typedef jarray jbyteArray;
+typedef jarray jcharArray;
+typedef jarray jshortArray;
+typedef jarray jintArray;
+typedef jarray jlongArray;
+typedef jarray jfloatArray;
+typedef jarray jdoubleArray;
+typedef jarray jobjectArray;
+
+#endif
+
+typedef jobject jweak;
+
+typedef union jvalue {
+    jboolean z;
+    jbyte    b;
+    jchar    c;
+    jshort   s;
+    jint     i;
+    jlong    j;
+    jfloat   f;
+    jdouble  d;
+    jobject  l;
+} jvalue;
+
+struct _jfieldID;
+typedef struct _jfieldID *jfieldID;
+
+struct _jmethodID;
+typedef struct _jmethodID *jmethodID;
+
+/* Return values from jobjectRefType */
+typedef enum _jobjectType {
+     JNIInvalidRefType    = 0,
+     JNILocalRefType      = 1,
+     JNIGlobalRefType     = 2,
+     JNIWeakGlobalRefType = 3
+} jobjectRefType;
+
+
+#endif /* JNI_TYPES_ALREADY_DEFINED_IN_JNI_MD_H */
+
+/*
+ * jboolean constants
+ */
+
+#define JNI_FALSE 0
+#define JNI_TRUE 1
+
+/*
+ * possible return values for JNI functions.
+ */
+
+#define JNI_OK           0                 /* success */
+#define JNI_ERR          (-1)              /* unknown error */
+#define JNI_EDETACHED    (-2)              /* thread detached from the VM */
+#define JNI_EVERSION     (-3)              /* JNI version error */
+#define JNI_ENOMEM       (-4)              /* not enough memory */
+#define JNI_EEXIST       (-5)              /* VM already created */
+#define JNI_EINVAL       (-6)              /* invalid arguments */
+
+/*
+ * used in ReleaseScalarArrayElements
+ */
+
+#define JNI_COMMIT 1
+#define JNI_ABORT 2
+
+/*
+ * used in RegisterNatives to describe native method name, signature,
+ * and function pointer.
+ */
+
+typedef struct {
+    char *name;
+    char *signature;
+    void *fnPtr;
+} JNINativeMethod;
+
+/*
+ * JNI Native Method Interface.
+ */
+
+struct JNINativeInterface_;
+
+struct JNIEnv_;
+
+#ifdef __cplusplus
+typedef JNIEnv_ JNIEnv;
+#else
+typedef const struct JNINativeInterface_ *JNIEnv;
+#endif
+
+/*
+ * JNI Invocation Interface.
+ */
+
+struct JNIInvokeInterface_;
+
+struct JavaVM_;
+
+#ifdef __cplusplus
+typedef JavaVM_ JavaVM;
+#else
+typedef const struct JNIInvokeInterface_ *JavaVM;
+#endif
+
+struct JNINativeInterface_ {
+    void *reserved0;
+    void *reserved1;
+    void *reserved2;
+
+    void *reserved3;
+    jint (JNICALL *GetVersion)(JNIEnv *env);
+
+    jclass (JNICALL *DefineClass)
+      (JNIEnv *env, const char *name, jobject loader, const jbyte *buf,
+       jsize len);
+    jclass (JNICALL *FindClass)
+      (JNIEnv *env, const char *name);
+
+    jmethodID (JNICALL *FromReflectedMethod)
+      (JNIEnv *env, jobject method);
+    jfieldID (JNICALL *FromReflectedField)
+      (JNIEnv *env, jobject field);
+
+    jobject (JNICALL *ToReflectedMethod)
+      (JNIEnv *env, jclass cls, jmethodID methodID, jboolean isStatic);
+
+    jclass (JNICALL *GetSuperclass)
+      (JNIEnv *env, jclass sub);
+    jboolean (JNICALL *IsAssignableFrom)
+      (JNIEnv *env, jclass sub, jclass sup);
+
+    jobject (JNICALL *ToReflectedField)
+      (JNIEnv *env, jclass cls, jfieldID fieldID, jboolean isStatic);
+
+    jint (JNICALL *Throw)
+      (JNIEnv *env, jthrowable obj);
+    jint (JNICALL *ThrowNew)
+      (JNIEnv *env, jclass clazz, const char *msg);
+    jthrowable (JNICALL *ExceptionOccurred)
+      (JNIEnv *env);
+    void (JNICALL *ExceptionDescribe)
+      (JNIEnv *env);
+    void (JNICALL *ExceptionClear)
+      (JNIEnv *env);
+    void (JNICALL *FatalError)
+      (JNIEnv *env, const char *msg);
+
+    jint (JNICALL *PushLocalFrame)
+      (JNIEnv *env, jint capacity);
+    jobject (JNICALL *PopLocalFrame)
+      (JNIEnv *env, jobject result);
+
+    jobject (JNICALL *NewGlobalRef)
+      (JNIEnv *env, jobject lobj);
+    void (JNICALL *DeleteGlobalRef)
+      (JNIEnv *env, jobject gref);
+    void (JNICALL *DeleteLocalRef)
+      (JNIEnv *env, jobject obj);
+    jboolean (JNICALL *IsSameObject)
+      (JNIEnv *env, jobject obj1, jobject obj2);
+    jobject (JNICALL *NewLocalRef)
+      (JNIEnv *env, jobject ref);
+    jint (JNICALL *EnsureLocalCapacity)
+      (JNIEnv *env, jint capacity);
+
+    jobject (JNICALL *AllocObject)
+      (JNIEnv *env, jclass clazz);
+    jobject (JNICALL *NewObject)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *NewObjectV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jobject (JNICALL *NewObjectA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jclass (JNICALL *GetObjectClass)
+      (JNIEnv *env, jobject obj);
+    jboolean (JNICALL *IsInstanceOf)
+      (JNIEnv *env, jobject obj, jclass clazz);
+
+    jmethodID (JNICALL *GetMethodID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *CallObjectMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jobject (JNICALL *CallObjectMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jobject (JNICALL *CallObjectMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jboolean (JNICALL *CallBooleanMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jboolean (JNICALL *CallBooleanMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jboolean (JNICALL *CallBooleanMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jbyte (JNICALL *CallByteMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jbyte (JNICALL *CallByteMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jbyte (JNICALL *CallByteMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jchar (JNICALL *CallCharMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jchar (JNICALL *CallCharMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jchar (JNICALL *CallCharMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jshort (JNICALL *CallShortMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jshort (JNICALL *CallShortMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jshort (JNICALL *CallShortMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jint (JNICALL *CallIntMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jint (JNICALL *CallIntMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jint (JNICALL *CallIntMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jlong (JNICALL *CallLongMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jlong (JNICALL *CallLongMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jlong (JNICALL *CallLongMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jfloat (JNICALL *CallFloatMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jfloat (JNICALL *CallFloatMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jfloat (JNICALL *CallFloatMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    jdouble (JNICALL *CallDoubleMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    jdouble (JNICALL *CallDoubleMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    jdouble (JNICALL *CallDoubleMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue *args);
+
+    void (JNICALL *CallVoidMethod)
+      (JNIEnv *env, jobject obj, jmethodID methodID, ...);
+    void (JNICALL *CallVoidMethodV)
+      (JNIEnv *env, jobject obj, jmethodID methodID, va_list args);
+    void (JNICALL *CallVoidMethodA)
+      (JNIEnv *env, jobject obj, jmethodID methodID, const jvalue * args);
+
+    jobject (JNICALL *CallNonvirtualObjectMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *CallNonvirtualObjectMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jobject (JNICALL *CallNonvirtualObjectMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jboolean (JNICALL *CallNonvirtualBooleanMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jboolean (JNICALL *CallNonvirtualBooleanMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jboolean (JNICALL *CallNonvirtualBooleanMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jbyte (JNICALL *CallNonvirtualByteMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jbyte (JNICALL *CallNonvirtualByteMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jbyte (JNICALL *CallNonvirtualByteMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jchar (JNICALL *CallNonvirtualCharMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jchar (JNICALL *CallNonvirtualCharMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jchar (JNICALL *CallNonvirtualCharMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jshort (JNICALL *CallNonvirtualShortMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jshort (JNICALL *CallNonvirtualShortMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jshort (JNICALL *CallNonvirtualShortMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jint (JNICALL *CallNonvirtualIntMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jint (JNICALL *CallNonvirtualIntMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jint (JNICALL *CallNonvirtualIntMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jlong (JNICALL *CallNonvirtualLongMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jlong (JNICALL *CallNonvirtualLongMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jlong (JNICALL *CallNonvirtualLongMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jfloat (JNICALL *CallNonvirtualFloatMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jfloat (JNICALL *CallNonvirtualFloatMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jfloat (JNICALL *CallNonvirtualFloatMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    jdouble (JNICALL *CallNonvirtualDoubleMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    jdouble (JNICALL *CallNonvirtualDoubleMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    jdouble (JNICALL *CallNonvirtualDoubleMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue *args);
+
+    void (JNICALL *CallNonvirtualVoidMethod)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID, ...);
+    void (JNICALL *CallNonvirtualVoidMethodV)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       va_list args);
+    void (JNICALL *CallNonvirtualVoidMethodA)
+      (JNIEnv *env, jobject obj, jclass clazz, jmethodID methodID,
+       const jvalue * args);
+
+    jfieldID (JNICALL *GetFieldID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *GetObjectField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jboolean (JNICALL *GetBooleanField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jbyte (JNICALL *GetByteField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jchar (JNICALL *GetCharField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jshort (JNICALL *GetShortField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jint (JNICALL *GetIntField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jlong (JNICALL *GetLongField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jfloat (JNICALL *GetFloatField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+    jdouble (JNICALL *GetDoubleField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID);
+
+    void (JNICALL *SetObjectField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jobject val);
+    void (JNICALL *SetBooleanField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jboolean val);
+    void (JNICALL *SetByteField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jbyte val);
+    void (JNICALL *SetCharField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jchar val);
+    void (JNICALL *SetShortField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jshort val);
+    void (JNICALL *SetIntField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jint val);
+    void (JNICALL *SetLongField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jlong val);
+    void (JNICALL *SetFloatField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jfloat val);
+    void (JNICALL *SetDoubleField)
+      (JNIEnv *env, jobject obj, jfieldID fieldID, jdouble val);
+
+    jmethodID (JNICALL *GetStaticMethodID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+
+    jobject (JNICALL *CallStaticObjectMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jobject (JNICALL *CallStaticObjectMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jobject (JNICALL *CallStaticObjectMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jboolean (JNICALL *CallStaticBooleanMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jboolean (JNICALL *CallStaticBooleanMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jboolean (JNICALL *CallStaticBooleanMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jbyte (JNICALL *CallStaticByteMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jbyte (JNICALL *CallStaticByteMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jbyte (JNICALL *CallStaticByteMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jchar (JNICALL *CallStaticCharMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jchar (JNICALL *CallStaticCharMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jchar (JNICALL *CallStaticCharMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jshort (JNICALL *CallStaticShortMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jshort (JNICALL *CallStaticShortMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jshort (JNICALL *CallStaticShortMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jint (JNICALL *CallStaticIntMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jint (JNICALL *CallStaticIntMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jint (JNICALL *CallStaticIntMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jlong (JNICALL *CallStaticLongMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jlong (JNICALL *CallStaticLongMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jlong (JNICALL *CallStaticLongMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jfloat (JNICALL *CallStaticFloatMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jfloat (JNICALL *CallStaticFloatMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jfloat (JNICALL *CallStaticFloatMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    jdouble (JNICALL *CallStaticDoubleMethod)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, ...);
+    jdouble (JNICALL *CallStaticDoubleMethodV)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, va_list args);
+    jdouble (JNICALL *CallStaticDoubleMethodA)
+      (JNIEnv *env, jclass clazz, jmethodID methodID, const jvalue *args);
+
+    void (JNICALL *CallStaticVoidMethod)
+      (JNIEnv *env, jclass cls, jmethodID methodID, ...);
+    void (JNICALL *CallStaticVoidMethodV)
+      (JNIEnv *env, jclass cls, jmethodID methodID, va_list args);
+    void (JNICALL *CallStaticVoidMethodA)
+      (JNIEnv *env, jclass cls, jmethodID methodID, const jvalue * args);
+
+    jfieldID (JNICALL *GetStaticFieldID)
+      (JNIEnv *env, jclass clazz, const char *name, const char *sig);
+    jobject (JNICALL *GetStaticObjectField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jboolean (JNICALL *GetStaticBooleanField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jbyte (JNICALL *GetStaticByteField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jchar (JNICALL *GetStaticCharField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jshort (JNICALL *GetStaticShortField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jint (JNICALL *GetStaticIntField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jlong (JNICALL *GetStaticLongField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jfloat (JNICALL *GetStaticFloatField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+    jdouble (JNICALL *GetStaticDoubleField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID);
+
+    void (JNICALL *SetStaticObjectField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jobject value);
+    void (JNICALL *SetStaticBooleanField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jboolean value);
+    void (JNICALL *SetStaticByteField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jbyte value);
+    void (JNICALL *SetStaticCharField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jchar value);
+    void (JNICALL *SetStaticShortField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jshort value);
+    void (JNICALL *SetStaticIntField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jint value);
+    void (JNICALL *SetStaticLongField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jlong value);
+    void (JNICALL *SetStaticFloatField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jfloat value);
+    void (JNICALL *SetStaticDoubleField)
+      (JNIEnv *env, jclass clazz, jfieldID fieldID, jdouble value);
+
+    jstring (JNICALL *NewString)
+      (JNIEnv *env, const jchar *unicode, jsize len);
+    jsize (JNICALL *GetStringLength)
+      (JNIEnv *env, jstring str);
+    const jchar *(JNICALL *GetStringChars)
+      (JNIEnv *env, jstring str, jboolean *isCopy);
+    void (JNICALL *ReleaseStringChars)
+      (JNIEnv *env, jstring str, const jchar *chars);
+
+    jstring (JNICALL *NewStringUTF)
+      (JNIEnv *env, const char *utf);
+    jsize (JNICALL *GetStringUTFLength)
+      (JNIEnv *env, jstring str);
+    const char* (JNICALL *GetStringUTFChars)
+      (JNIEnv *env, jstring str, jboolean *isCopy);
+    void (JNICALL *ReleaseStringUTFChars)
+      (JNIEnv *env, jstring str, const char* chars);
+
+
+    jsize (JNICALL *GetArrayLength)
+      (JNIEnv *env, jarray array);
+
+    jobjectArray (JNICALL *NewObjectArray)
+      (JNIEnv *env, jsize len, jclass clazz, jobject init);
+    jobject (JNICALL *GetObjectArrayElement)
+      (JNIEnv *env, jobjectArray array, jsize index);
+    void (JNICALL *SetObjectArrayElement)
+      (JNIEnv *env, jobjectArray array, jsize index, jobject val);
+
+    jbooleanArray (JNICALL *NewBooleanArray)
+      (JNIEnv *env, jsize len);
+    jbyteArray (JNICALL *NewByteArray)
+      (JNIEnv *env, jsize len);
+    jcharArray (JNICALL *NewCharArray)
+      (JNIEnv *env, jsize len);
+    jshortArray (JNICALL *NewShortArray)
+      (JNIEnv *env, jsize len);
+    jintArray (JNICALL *NewIntArray)
+      (JNIEnv *env, jsize len);
+    jlongArray (JNICALL *NewLongArray)
+      (JNIEnv *env, jsize len);
+    jfloatArray (JNICALL *NewFloatArray)
+      (JNIEnv *env, jsize len);
+    jdoubleArray (JNICALL *NewDoubleArray)
+      (JNIEnv *env, jsize len);
+
+    jboolean * (JNICALL *GetBooleanArrayElements)
+      (JNIEnv *env, jbooleanArray array, jboolean *isCopy);
+    jbyte * (JNICALL *GetByteArrayElements)
+      (JNIEnv *env, jbyteArray array, jboolean *isCopy);
+    jchar * (JNICALL *GetCharArrayElements)
+      (JNIEnv *env, jcharArray array, jboolean *isCopy);
+    jshort * (JNICALL *GetShortArrayElements)
+      (JNIEnv *env, jshortArray array, jboolean *isCopy);
+    jint * (JNICALL *GetIntArrayElements)
+      (JNIEnv *env, jintArray array, jboolean *isCopy);
+    jlong * (JNICALL *GetLongArrayElements)
+      (JNIEnv *env, jlongArray array, jboolean *isCopy);
+    jfloat * (JNICALL *GetFloatArrayElements)
+      (JNIEnv *env, jfloatArray array, jboolean *isCopy);
+    jdouble * (JNICALL *GetDoubleArrayElements)
+      (JNIEnv *env, jdoubleArray array, jboolean *isCopy);
+
+    void (JNICALL *ReleaseBooleanArrayElements)
+      (JNIEnv *env, jbooleanArray array, jboolean *elems, jint mode);
+    void (JNICALL *ReleaseByteArrayElements)
+      (JNIEnv *env, jbyteArray array, jbyte *elems, jint mode);
+    void (JNICALL *ReleaseCharArrayElements)
+      (JNIEnv *env, jcharArray array, jchar *elems, jint mode);
+    void (JNICALL *ReleaseShortArrayElements)
+      (JNIEnv *env, jshortArray array, jshort *elems, jint mode);
+    void (JNICALL *ReleaseIntArrayElements)
+      (JNIEnv *env, jintArray array, jint *elems, jint mode);
+    void (JNICALL *ReleaseLongArrayElements)
+      (JNIEnv *env, jlongArray array, jlong *elems, jint mode);
+    void (JNICALL *ReleaseFloatArrayElements)
+      (JNIEnv *env, jfloatArray array, jfloat *elems, jint mode);
+    void (JNICALL *ReleaseDoubleArrayElements)
+      (JNIEnv *env, jdoubleArray array, jdouble *elems, jint mode);
+
+    void (JNICALL *GetBooleanArrayRegion)
+      (JNIEnv *env, jbooleanArray array, jsize start, jsize l, jboolean *buf);
+    void (JNICALL *GetByteArrayRegion)
+      (JNIEnv *env, jbyteArray array, jsize start, jsize len, jbyte *buf);
+    void (JNICALL *GetCharArrayRegion)
+      (JNIEnv *env, jcharArray array, jsize start, jsize len, jchar *buf);
+    void (JNICALL *GetShortArrayRegion)
+      (JNIEnv *env, jshortArray array, jsize start, jsize len, jshort *buf);
+    void (JNICALL *GetIntArrayRegion)
+      (JNIEnv *env, jintArray array, jsize start, jsize len, jint *buf);
+    void (JNICALL *GetLongArrayRegion)
+      (JNIEnv *env, jlongArray array, jsize start, jsize len, jlong *buf);
+    void (JNICALL *GetFloatArrayRegion)
+      (JNIEnv *env, jfloatArray array, jsize start, jsize len, jfloat *buf);
+    void (JNICALL *GetDoubleArrayRegion)
+      (JNIEnv *env, jdoubleArray array, jsize start, jsize len, jdouble *buf);
+
+    void (JNICALL *SetBooleanArrayRegion)
+      (JNIEnv *env, jbooleanArray array, jsize start, jsize l, const jboolean *buf);
+    void (JNICALL *SetByteArrayRegion)
+      (JNIEnv *env, jbyteArray array, jsize start, jsize len, const jbyte *buf);
+    void (JNICALL *SetCharArrayRegion)
+      (JNIEnv *env, jcharArray array, jsize start, jsize len, const jchar *buf);
+    void (JNICALL *SetShortArrayRegion)
+      (JNIEnv *env, jshortArray array, jsize start, jsize len, const jshort *buf);
+    void (JNICALL *SetIntArrayRegion)
+      (JNIEnv *env, jintArray array, jsize start, jsize len, const jint *buf);
+    void (JNICALL *SetLongArrayRegion)
+      (JNIEnv *env, jlongArray array, jsize start, jsize len, const jlong *buf);
+    void (JNICALL *SetFloatArrayRegion)
+      (JNIEnv *env, jfloatArray array, jsize start, jsize len, const jfloat *buf);
+    void (JNICALL *SetDoubleArrayRegion)
+      (JNIEnv *env, jdoubleArray array, jsize start, jsize len, const jdouble *buf);
+
+    jint (JNICALL *RegisterNatives)
+      (JNIEnv *env, jclass clazz, const JNINativeMethod *methods,
+       jint nMethods);
+    jint (JNICALL *UnregisterNatives)
+      (JNIEnv *env, jclass clazz);
+
+    jint (JNICALL *MonitorEnter)
+      (JNIEnv *env, jobject obj);
+    jint (JNICALL *MonitorExit)
+      (JNIEnv *env, jobject obj);
+
+    jint (JNICALL *GetJavaVM)
+      (JNIEnv *env, JavaVM **vm);
+
+    void (JNICALL *GetStringRegion)
+      (JNIEnv *env, jstring str, jsize start, jsize len, jchar *buf);
+    void (JNICALL *GetStringUTFRegion)
+      (JNIEnv *env, jstring str, jsize start, jsize len, char *buf);
+
+    void * (JNICALL *GetPrimitiveArrayCritical)
+      (JNIEnv *env, jarray array, jboolean *isCopy);
+    void (JNICALL *ReleasePrimitiveArrayCritical)
+      (JNIEnv *env, jarray array, void *carray, jint mode);
+
+    const jchar * (JNICALL *GetStringCritical)
+      (JNIEnv *env, jstring string, jboolean *isCopy);
+    void (JNICALL *ReleaseStringCritical)
+      (JNIEnv *env, jstring string, const jchar *cstring);
+
+    jweak (JNICALL *NewWeakGlobalRef)
+       (JNIEnv *env, jobject obj);
+    void (JNICALL *DeleteWeakGlobalRef)
+       (JNIEnv *env, jweak ref);
+
+    jboolean (JNICALL *ExceptionCheck)
+       (JNIEnv *env);
+
+    jobject (JNICALL *NewDirectByteBuffer)
+       (JNIEnv* env, void* address, jlong capacity);
+    void* (JNICALL *GetDirectBufferAddress)
+       (JNIEnv* env, jobject buf);
+    jlong (JNICALL *GetDirectBufferCapacity)
+       (JNIEnv* env, jobject buf);
+
+    /* New JNI 1.6 Features */
+
+    jobjectRefType (JNICALL *GetObjectRefType)
+        (JNIEnv* env, jobject obj);
+};
+
+/*
+ * We use inlined functions for C++ so that programmers can write:
+ *
+ *    env->FindClass("java/lang/String")
+ *
+ * in C++ rather than:
+ *
+ *    (*env)->FindClass(env, "java/lang/String")
+ *
+ * in C.
+ */
+
+struct JNIEnv_ {
+    const struct JNINativeInterface_ *functions;
+#ifdef __cplusplus
+
+    jint GetVersion() {
+        return functions->GetVersion(this);
+    }
+    jclass DefineClass(const char *name, jobject loader, const jbyte *buf,
+                       jsize len) {
+        return functions->DefineClass(this, name, loader, buf, len);
+    }
+    jclass FindClass(const char *name) {
+        return functions->FindClass(this, name);
+    }
+    jmethodID FromReflectedMethod(jobject method) {
+        return functions->FromReflectedMethod(this,method);
+    }
+    jfieldID FromReflectedField(jobject field) {
+        return functions->FromReflectedField(this,field);
+    }
+
+    jobject ToReflectedMethod(jclass cls, jmethodID methodID, jboolean isStatic) {
+        return functions->ToReflectedMethod(this, cls, methodID, isStatic);
+    }
+
+    jclass GetSuperclass(jclass sub) {
+        return functions->GetSuperclass(this, sub);
+    }
+    jboolean IsAssignableFrom(jclass sub, jclass sup) {
+        return functions->IsAssignableFrom(this, sub, sup);
+    }
+
+    jobject ToReflectedField(jclass cls, jfieldID fieldID, jboolean isStatic) {
+        return functions->ToReflectedField(this,cls,fieldID,isStatic);
+    }
+
+    jint Throw(jthrowable obj) {
+        return functions->Throw(this, obj);
+    }
+    jint ThrowNew(jclass clazz, const char *msg) {
+        return functions->ThrowNew(this, clazz, msg);
+    }
+    jthrowable ExceptionOccurred() {
+        return functions->ExceptionOccurred(this);
+    }
+    void ExceptionDescribe() {
+        functions->ExceptionDescribe(this);
+    }
+    void ExceptionClear() {
+        functions->ExceptionClear(this);
+    }
+    void FatalError(const char *msg) {
+        functions->FatalError(this, msg);
+    }
+
+    jint PushLocalFrame(jint capacity) {
+        return functions->PushLocalFrame(this,capacity);
+    }
+    jobject PopLocalFrame(jobject result) {
+        return functions->PopLocalFrame(this,result);
+    }
+
+    jobject NewGlobalRef(jobject lobj) {
+        return functions->NewGlobalRef(this,lobj);
+    }
+    void DeleteGlobalRef(jobject gref) {
+        functions->DeleteGlobalRef(this,gref);
+    }
+    void DeleteLocalRef(jobject obj) {
+        functions->DeleteLocalRef(this, obj);
+    }
+
+    jboolean IsSameObject(jobject obj1, jobject obj2) {
+        return functions->IsSameObject(this,obj1,obj2);
+    }
+
+    jobject NewLocalRef(jobject ref) {
+        return functions->NewLocalRef(this,ref);
+    }
+    jint EnsureLocalCapacity(jint capacity) {
+        return functions->EnsureLocalCapacity(this,capacity);
+    }
+
+    jobject AllocObject(jclass clazz) {
+        return functions->AllocObject(this,clazz);
+    }
+    jobject NewObject(jclass clazz, jmethodID methodID, ...) {
+        va_list args;
+        jobject result;
+        va_start(args, methodID);
+        result = functions->NewObjectV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jobject NewObjectV(jclass clazz, jmethodID methodID,
+                       va_list args) {
+        return functions->NewObjectV(this,clazz,methodID,args);
+    }
+    jobject NewObjectA(jclass clazz, jmethodID methodID,
+                       const jvalue *args) {
+        return functions->NewObjectA(this,clazz,methodID,args);
+    }
+
+    jclass GetObjectClass(jobject obj) {
+        return functions->GetObjectClass(this,obj);
+    }
+    jboolean IsInstanceOf(jobject obj, jclass clazz) {
+        return functions->IsInstanceOf(this,obj,clazz);
+    }
+
+    jmethodID GetMethodID(jclass clazz, const char *name,
+                          const char *sig) {
+        return functions->GetMethodID(this,clazz,name,sig);
+    }
+
+    jobject CallObjectMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jobject result;
+        va_start(args,methodID);
+        result = functions->CallObjectMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jobject CallObjectMethodV(jobject obj, jmethodID methodID,
+                        va_list args) {
+        return functions->CallObjectMethodV(this,obj,methodID,args);
+    }
+    jobject CallObjectMethodA(jobject obj, jmethodID methodID,
+                        const jvalue * args) {
+        return functions->CallObjectMethodA(this,obj,methodID,args);
+    }
+
+    jboolean CallBooleanMethod(jobject obj,
+                               jmethodID methodID, ...) {
+        va_list args;
+        jboolean result;
+        va_start(args,methodID);
+        result = functions->CallBooleanMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jboolean CallBooleanMethodV(jobject obj, jmethodID methodID,
+                                va_list args) {
+        return functions->CallBooleanMethodV(this,obj,methodID,args);
+    }
+    jboolean CallBooleanMethodA(jobject obj, jmethodID methodID,
+                                const jvalue * args) {
+        return functions->CallBooleanMethodA(this,obj,methodID, args);
+    }
+
+    jbyte CallByteMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jbyte result;
+        va_start(args,methodID);
+        result = functions->CallByteMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jbyte CallByteMethodV(jobject obj, jmethodID methodID,
+                          va_list args) {
+        return functions->CallByteMethodV(this,obj,methodID,args);
+    }
+    jbyte CallByteMethodA(jobject obj, jmethodID methodID,
+                          const jvalue * args) {
+        return functions->CallByteMethodA(this,obj,methodID,args);
+    }
+
+    jchar CallCharMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jchar result;
+        va_start(args,methodID);
+        result = functions->CallCharMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jchar CallCharMethodV(jobject obj, jmethodID methodID,
+                          va_list args) {
+        return functions->CallCharMethodV(this,obj,methodID,args);
+    }
+    jchar CallCharMethodA(jobject obj, jmethodID methodID,
+                          const jvalue * args) {
+        return functions->CallCharMethodA(this,obj,methodID,args);
+    }
+
+    jshort CallShortMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jshort result;
+        va_start(args,methodID);
+        result = functions->CallShortMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jshort CallShortMethodV(jobject obj, jmethodID methodID,
+                            va_list args) {
+        return functions->CallShortMethodV(this,obj,methodID,args);
+    }
+    jshort CallShortMethodA(jobject obj, jmethodID methodID,
+                            const jvalue * args) {
+        return functions->CallShortMethodA(this,obj,methodID,args);
+    }
+
+    jint CallIntMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jint result;
+        va_start(args,methodID);
+        result = functions->CallIntMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jint CallIntMethodV(jobject obj, jmethodID methodID,
+                        va_list args) {
+        return functions->CallIntMethodV(this,obj,methodID,args);
+    }
+    jint CallIntMethodA(jobject obj, jmethodID methodID,
+                        const jvalue * args) {
+        return functions->CallIntMethodA(this,obj,methodID,args);
+    }
+
+    jlong CallLongMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jlong result;
+        va_start(args,methodID);
+        result = functions->CallLongMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jlong CallLongMethodV(jobject obj, jmethodID methodID,
+                          va_list args) {
+        return functions->CallLongMethodV(this,obj,methodID,args);
+    }
+    jlong CallLongMethodA(jobject obj, jmethodID methodID,
+                          const jvalue * args) {
+        return functions->CallLongMethodA(this,obj,methodID,args);
+    }
+
+    jfloat CallFloatMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jfloat result;
+        va_start(args,methodID);
+        result = functions->CallFloatMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jfloat CallFloatMethodV(jobject obj, jmethodID methodID,
+                            va_list args) {
+        return functions->CallFloatMethodV(this,obj,methodID,args);
+    }
+    jfloat CallFloatMethodA(jobject obj, jmethodID methodID,
+                            const jvalue * args) {
+        return functions->CallFloatMethodA(this,obj,methodID,args);
+    }
+
+    jdouble CallDoubleMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        jdouble result;
+        va_start(args,methodID);
+        result = functions->CallDoubleMethodV(this,obj,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jdouble CallDoubleMethodV(jobject obj, jmethodID methodID,
+                        va_list args) {
+        return functions->CallDoubleMethodV(this,obj,methodID,args);
+    }
+    jdouble CallDoubleMethodA(jobject obj, jmethodID methodID,
+                        const jvalue * args) {
+        return functions->CallDoubleMethodA(this,obj,methodID,args);
+    }
+
+    void CallVoidMethod(jobject obj, jmethodID methodID, ...) {
+        va_list args;
+        va_start(args,methodID);
+        functions->CallVoidMethodV(this,obj,methodID,args);
+        va_end(args);
+    }
+    void CallVoidMethodV(jobject obj, jmethodID methodID,
+                         va_list args) {
+        functions->CallVoidMethodV(this,obj,methodID,args);
+    }
+    void CallVoidMethodA(jobject obj, jmethodID methodID,
+                         const jvalue * args) {
+        functions->CallVoidMethodA(this,obj,methodID,args);
+    }
+
+    jobject CallNonvirtualObjectMethod(jobject obj, jclass clazz,
+                                       jmethodID methodID, ...) {
+        va_list args;
+        jobject result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualObjectMethodV(this,obj,clazz,
+                                                        methodID,args);
+        va_end(args);
+        return result;
+    }
+    jobject CallNonvirtualObjectMethodV(jobject obj, jclass clazz,
+                                        jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualObjectMethodV(this,obj,clazz,
+                                                      methodID,args);
+    }
+    jobject CallNonvirtualObjectMethodA(jobject obj, jclass clazz,
+                                        jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualObjectMethodA(this,obj,clazz,
+                                                      methodID,args);
+    }
+
+    jboolean CallNonvirtualBooleanMethod(jobject obj, jclass clazz,
+                                         jmethodID methodID, ...) {
+        va_list args;
+        jboolean result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
+                                                         methodID,args);
+        va_end(args);
+        return result;
+    }
+    jboolean CallNonvirtualBooleanMethodV(jobject obj, jclass clazz,
+                                          jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualBooleanMethodV(this,obj,clazz,
+                                                       methodID,args);
+    }
+    jboolean CallNonvirtualBooleanMethodA(jobject obj, jclass clazz,
+                                          jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualBooleanMethodA(this,obj,clazz,
+                                                       methodID, args);
+    }
+
+    jbyte CallNonvirtualByteMethod(jobject obj, jclass clazz,
+                                   jmethodID methodID, ...) {
+        va_list args;
+        jbyte result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualByteMethodV(this,obj,clazz,
+                                                      methodID,args);
+        va_end(args);
+        return result;
+    }
+    jbyte CallNonvirtualByteMethodV(jobject obj, jclass clazz,
+                                    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualByteMethodV(this,obj,clazz,
+                                                    methodID,args);
+    }
+    jbyte CallNonvirtualByteMethodA(jobject obj, jclass clazz,
+                                    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualByteMethodA(this,obj,clazz,
+                                                    methodID,args);
+    }
+
+    jchar CallNonvirtualCharMethod(jobject obj, jclass clazz,
+                                   jmethodID methodID, ...) {
+        va_list args;
+        jchar result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualCharMethodV(this,obj,clazz,
+                                                      methodID,args);
+        va_end(args);
+        return result;
+    }
+    jchar CallNonvirtualCharMethodV(jobject obj, jclass clazz,
+                                    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualCharMethodV(this,obj,clazz,
+                                                    methodID,args);
+    }
+    jchar CallNonvirtualCharMethodA(jobject obj, jclass clazz,
+                                    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualCharMethodA(this,obj,clazz,
+                                                    methodID,args);
+    }
+
+    jshort CallNonvirtualShortMethod(jobject obj, jclass clazz,
+                                     jmethodID methodID, ...) {
+        va_list args;
+        jshort result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualShortMethodV(this,obj,clazz,
+                                                       methodID,args);
+        va_end(args);
+        return result;
+    }
+    jshort CallNonvirtualShortMethodV(jobject obj, jclass clazz,
+                                      jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualShortMethodV(this,obj,clazz,
+                                                     methodID,args);
+    }
+    jshort CallNonvirtualShortMethodA(jobject obj, jclass clazz,
+                                      jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualShortMethodA(this,obj,clazz,
+                                                     methodID,args);
+    }
+
+    jint CallNonvirtualIntMethod(jobject obj, jclass clazz,
+                                 jmethodID methodID, ...) {
+        va_list args;
+        jint result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualIntMethodV(this,obj,clazz,
+                                                     methodID,args);
+        va_end(args);
+        return result;
+    }
+    jint CallNonvirtualIntMethodV(jobject obj, jclass clazz,
+                                  jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualIntMethodV(this,obj,clazz,
+                                                   methodID,args);
+    }
+    jint CallNonvirtualIntMethodA(jobject obj, jclass clazz,
+                                  jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualIntMethodA(this,obj,clazz,
+                                                   methodID,args);
+    }
+
+    jlong CallNonvirtualLongMethod(jobject obj, jclass clazz,
+                                   jmethodID methodID, ...) {
+        va_list args;
+        jlong result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualLongMethodV(this,obj,clazz,
+                                                      methodID,args);
+        va_end(args);
+        return result;
+    }
+    jlong CallNonvirtualLongMethodV(jobject obj, jclass clazz,
+                                    jmethodID methodID, va_list args) {
+        return functions->CallNonvirtualLongMethodV(this,obj,clazz,
+                                                    methodID,args);
+    }
+    jlong CallNonvirtualLongMethodA(jobject obj, jclass clazz,
+                                    jmethodID methodID, const jvalue * args) {
+        return functions->CallNonvirtualLongMethodA(this,obj,clazz,
+                                                    methodID,args);
+    }
+
+    jfloat CallNonvirtualFloatMethod(jobject obj, jclass clazz,
+                                     jmethodID methodID, ...) {
+        va_list args;
+        jfloat result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualFloatMethodV(this,obj,clazz,
+                                                       methodID,args);
+        va_end(args);
+        return result;
+    }
+    jfloat CallNonvirtualFloatMethodV(jobject obj, jclass clazz,
+                                      jmethodID methodID,
+                                      va_list args) {
+        return functions->CallNonvirtualFloatMethodV(this,obj,clazz,
+                                                     methodID,args);
+    }
+    jfloat CallNonvirtualFloatMethodA(jobject obj, jclass clazz,
+                                      jmethodID methodID,
+                                      const jvalue * args) {
+        return functions->CallNonvirtualFloatMethodA(this,obj,clazz,
+                                                     methodID,args);
+    }
+
+    jdouble CallNonvirtualDoubleMethod(jobject obj, jclass clazz,
+                                       jmethodID methodID, ...) {
+        va_list args;
+        jdouble result;
+        va_start(args,methodID);
+        result = functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
+                                                        methodID,args);
+        va_end(args);
+        return result;
+    }
+    jdouble CallNonvirtualDoubleMethodV(jobject obj, jclass clazz,
+                                        jmethodID methodID,
+                                        va_list args) {
+        return functions->CallNonvirtualDoubleMethodV(this,obj,clazz,
+                                                      methodID,args);
+    }
+    jdouble CallNonvirtualDoubleMethodA(jobject obj, jclass clazz,
+                                        jmethodID methodID,
+                                        const jvalue * args) {
+        return functions->CallNonvirtualDoubleMethodA(this,obj,clazz,
+                                                      methodID,args);
+    }
+
+    void CallNonvirtualVoidMethod(jobject obj, jclass clazz,
+                                  jmethodID methodID, ...) {
+        va_list args;
+        va_start(args,methodID);
+        functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
+        va_end(args);
+    }
+    void CallNonvirtualVoidMethodV(jobject obj, jclass clazz,
+                                   jmethodID methodID,
+                                   va_list args) {
+        functions->CallNonvirtualVoidMethodV(this,obj,clazz,methodID,args);
+    }
+    void CallNonvirtualVoidMethodA(jobject obj, jclass clazz,
+                                   jmethodID methodID,
+                                   const jvalue * args) {
+        functions->CallNonvirtualVoidMethodA(this,obj,clazz,methodID,args);
+    }
+
+    jfieldID GetFieldID(jclass clazz, const char *name,
+                        const char *sig) {
+        return functions->GetFieldID(this,clazz,name,sig);
+    }
+
+    jobject GetObjectField(jobject obj, jfieldID fieldID) {
+        return functions->GetObjectField(this,obj,fieldID);
+    }
+    jboolean GetBooleanField(jobject obj, jfieldID fieldID) {
+        return functions->GetBooleanField(this,obj,fieldID);
+    }
+    jbyte GetByteField(jobject obj, jfieldID fieldID) {
+        return functions->GetByteField(this,obj,fieldID);
+    }
+    jchar GetCharField(jobject obj, jfieldID fieldID) {
+        return functions->GetCharField(this,obj,fieldID);
+    }
+    jshort GetShortField(jobject obj, jfieldID fieldID) {
+        return functions->GetShortField(this,obj,fieldID);
+    }
+    jint GetIntField(jobject obj, jfieldID fieldID) {
+        return functions->GetIntField(this,obj,fieldID);
+    }
+    jlong GetLongField(jobject obj, jfieldID fieldID) {
+        return functions->GetLongField(this,obj,fieldID);
+    }
+    jfloat GetFloatField(jobject obj, jfieldID fieldID) {
+        return functions->GetFloatField(this,obj,fieldID);
+    }
+    jdouble GetDoubleField(jobject obj, jfieldID fieldID) {
+        return functions->GetDoubleField(this,obj,fieldID);
+    }
+
+    void SetObjectField(jobject obj, jfieldID fieldID, jobject val) {
+        functions->SetObjectField(this,obj,fieldID,val);
+    }
+    void SetBooleanField(jobject obj, jfieldID fieldID,
+                         jboolean val) {
+        functions->SetBooleanField(this,obj,fieldID,val);
+    }
+    void SetByteField(jobject obj, jfieldID fieldID,
+                      jbyte val) {
+        functions->SetByteField(this,obj,fieldID,val);
+    }
+    void SetCharField(jobject obj, jfieldID fieldID,
+                      jchar val) {
+        functions->SetCharField(this,obj,fieldID,val);
+    }
+    void SetShortField(jobject obj, jfieldID fieldID,
+                       jshort val) {
+        functions->SetShortField(this,obj,fieldID,val);
+    }
+    void SetIntField(jobject obj, jfieldID fieldID,
+                     jint val) {
+        functions->SetIntField(this,obj,fieldID,val);
+    }
+    void SetLongField(jobject obj, jfieldID fieldID,
+                      jlong val) {
+        functions->SetLongField(this,obj,fieldID,val);
+    }
+    void SetFloatField(jobject obj, jfieldID fieldID,
+                       jfloat val) {
+        functions->SetFloatField(this,obj,fieldID,val);
+    }
+    void SetDoubleField(jobject obj, jfieldID fieldID,
+                        jdouble val) {
+        functions->SetDoubleField(this,obj,fieldID,val);
+    }
+
+    jmethodID GetStaticMethodID(jclass clazz, const char *name,
+                                const char *sig) {
+        return functions->GetStaticMethodID(this,clazz,name,sig);
+    }
+
+    jobject CallStaticObjectMethod(jclass clazz, jmethodID methodID,
+                             ...) {
+        va_list args;
+        jobject result;
+        va_start(args,methodID);
+        result = functions->CallStaticObjectMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jobject CallStaticObjectMethodV(jclass clazz, jmethodID methodID,
+                              va_list args) {
+        return functions->CallStaticObjectMethodV(this,clazz,methodID,args);
+    }
+    jobject CallStaticObjectMethodA(jclass clazz, jmethodID methodID,
+                              const jvalue *args) {
+        return functions->CallStaticObjectMethodA(this,clazz,methodID,args);
+    }
+
+    jboolean CallStaticBooleanMethod(jclass clazz,
+                                     jmethodID methodID, ...) {
+        va_list args;
+        jboolean result;
+        va_start(args,methodID);
+        result = functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jboolean CallStaticBooleanMethodV(jclass clazz,
+                                      jmethodID methodID, va_list args) {
+        return functions->CallStaticBooleanMethodV(this,clazz,methodID,args);
+    }
+    jboolean CallStaticBooleanMethodA(jclass clazz,
+                                      jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticBooleanMethodA(this,clazz,methodID,args);
+    }
+
+    jbyte CallStaticByteMethod(jclass clazz,
+                               jmethodID methodID, ...) {
+        va_list args;
+        jbyte result;
+        va_start(args,methodID);
+        result = functions->CallStaticByteMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jbyte CallStaticByteMethodV(jclass clazz,
+                                jmethodID methodID, va_list args) {
+        return functions->CallStaticByteMethodV(this,clazz,methodID,args);
+    }
+    jbyte CallStaticByteMethodA(jclass clazz,
+                                jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticByteMethodA(this,clazz,methodID,args);
+    }
+
+    jchar CallStaticCharMethod(jclass clazz,
+                               jmethodID methodID, ...) {
+        va_list args;
+        jchar result;
+        va_start(args,methodID);
+        result = functions->CallStaticCharMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jchar CallStaticCharMethodV(jclass clazz,
+                                jmethodID methodID, va_list args) {
+        return functions->CallStaticCharMethodV(this,clazz,methodID,args);
+    }
+    jchar CallStaticCharMethodA(jclass clazz,
+                                jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticCharMethodA(this,clazz,methodID,args);
+    }
+
+    jshort CallStaticShortMethod(jclass clazz,
+                                 jmethodID methodID, ...) {
+        va_list args;
+        jshort result;
+        va_start(args,methodID);
+        result = functions->CallStaticShortMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jshort CallStaticShortMethodV(jclass clazz,
+                                  jmethodID methodID, va_list args) {
+        return functions->CallStaticShortMethodV(this,clazz,methodID,args);
+    }
+    jshort CallStaticShortMethodA(jclass clazz,
+                                  jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticShortMethodA(this,clazz,methodID,args);
+    }
+
+    jint CallStaticIntMethod(jclass clazz,
+                             jmethodID methodID, ...) {
+        va_list args;
+        jint result;
+        va_start(args,methodID);
+        result = functions->CallStaticIntMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jint CallStaticIntMethodV(jclass clazz,
+                              jmethodID methodID, va_list args) {
+        return functions->CallStaticIntMethodV(this,clazz,methodID,args);
+    }
+    jint CallStaticIntMethodA(jclass clazz,
+                              jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticIntMethodA(this,clazz,methodID,args);
+    }
+
+    jlong CallStaticLongMethod(jclass clazz,
+                               jmethodID methodID, ...) {
+        va_list args;
+        jlong result;
+        va_start(args,methodID);
+        result = functions->CallStaticLongMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jlong CallStaticLongMethodV(jclass clazz,
+                                jmethodID methodID, va_list args) {
+        return functions->CallStaticLongMethodV(this,clazz,methodID,args);
+    }
+    jlong CallStaticLongMethodA(jclass clazz,
+                                jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticLongMethodA(this,clazz,methodID,args);
+    }
+
+    jfloat CallStaticFloatMethod(jclass clazz,
+                                 jmethodID methodID, ...) {
+        va_list args;
+        jfloat result;
+        va_start(args,methodID);
+        result = functions->CallStaticFloatMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jfloat CallStaticFloatMethodV(jclass clazz,
+                                  jmethodID methodID, va_list args) {
+        return functions->CallStaticFloatMethodV(this,clazz,methodID,args);
+    }
+    jfloat CallStaticFloatMethodA(jclass clazz,
+                                  jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticFloatMethodA(this,clazz,methodID,args);
+    }
+
+    jdouble CallStaticDoubleMethod(jclass clazz,
+                                   jmethodID methodID, ...) {
+        va_list args;
+        jdouble result;
+        va_start(args,methodID);
+        result = functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
+        va_end(args);
+        return result;
+    }
+    jdouble CallStaticDoubleMethodV(jclass clazz,
+                                    jmethodID methodID, va_list args) {
+        return functions->CallStaticDoubleMethodV(this,clazz,methodID,args);
+    }
+    jdouble CallStaticDoubleMethodA(jclass clazz,
+                                    jmethodID methodID, const jvalue *args) {
+        return functions->CallStaticDoubleMethodA(this,clazz,methodID,args);
+    }
+
+    void CallStaticVoidMethod(jclass cls, jmethodID methodID, ...) {
+        va_list args;
+        va_start(args,methodID);
+        functions->CallStaticVoidMethodV(this,cls,methodID,args);
+        va_end(args);
+    }
+    void CallStaticVoidMethodV(jclass cls, jmethodID methodID,
+                               va_list args) {
+        functions->CallStaticVoidMethodV(this,cls,methodID,args);
+    }
+    void CallStaticVoidMethodA(jclass cls, jmethodID methodID,
+                               const jvalue * args) {
+        functions->CallStaticVoidMethodA(this,cls,methodID,args);
+    }
+
+    jfieldID GetStaticFieldID(jclass clazz, const char *name,
+                              const char *sig) {
+        return functions->GetStaticFieldID(this,clazz,name,sig);
+    }
+    jobject GetStaticObjectField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticObjectField(this,clazz,fieldID);
+    }
+    jboolean GetStaticBooleanField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticBooleanField(this,clazz,fieldID);
+    }
+    jbyte GetStaticByteField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticByteField(this,clazz,fieldID);
+    }
+    jchar GetStaticCharField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticCharField(this,clazz,fieldID);
+    }
+    jshort GetStaticShortField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticShortField(this,clazz,fieldID);
+    }
+    jint GetStaticIntField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticIntField(this,clazz,fieldID);
+    }
+    jlong GetStaticLongField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticLongField(this,clazz,fieldID);
+    }
+    jfloat GetStaticFloatField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticFloatField(this,clazz,fieldID);
+    }
+    jdouble GetStaticDoubleField(jclass clazz, jfieldID fieldID) {
+        return functions->GetStaticDoubleField(this,clazz,fieldID);
+    }
+
+    void SetStaticObjectField(jclass clazz, jfieldID fieldID,
+                        jobject value) {
+      functions->SetStaticObjectField(this,clazz,fieldID,value);
+    }
+    void SetStaticBooleanField(jclass clazz, jfieldID fieldID,
+                        jboolean value) {
+      functions->SetStaticBooleanField(this,clazz,fieldID,value);
+    }
+    void SetStaticByteField(jclass clazz, jfieldID fieldID,
+                        jbyte value) {
+      functions->SetStaticByteField(this,clazz,fieldID,value);
+    }
+    void SetStaticCharField(jclass clazz, jfieldID fieldID,
+                        jchar value) {
+      functions->SetStaticCharField(this,clazz,fieldID,value);
+    }
+    void SetStaticShortField(jclass clazz, jfieldID fieldID,
+                        jshort value) {
+      functions->SetStaticShortField(this,clazz,fieldID,value);
+    }
+    void SetStaticIntField(jclass clazz, jfieldID fieldID,
+                        jint value) {
+      functions->SetStaticIntField(this,clazz,fieldID,value);
+    }
+    void SetStaticLongField(jclass clazz, jfieldID fieldID,
+                        jlong value) {
+      functions->SetStaticLongField(this,clazz,fieldID,value);
+    }
+    void SetStaticFloatField(jclass clazz, jfieldID fieldID,
+                        jfloat value) {
+      functions->SetStaticFloatField(this,clazz,fieldID,value);
+    }
+    void SetStaticDoubleField(jclass clazz, jfieldID fieldID,
+                        jdouble value) {
+      functions->SetStaticDoubleField(this,clazz,fieldID,value);
+    }
+
+    jstring NewString(const jchar *unicode, jsize len) {
+        return functions->NewString(this,unicode,len);
+    }
+    jsize GetStringLength(jstring str) {
+        return functions->GetStringLength(this,str);
+    }
+    const jchar *GetStringChars(jstring str, jboolean *isCopy) {
+        return functions->GetStringChars(this,str,isCopy);
+    }
+    void ReleaseStringChars(jstring str, const jchar *chars) {
+        functions->ReleaseStringChars(this,str,chars);
+    }
+
+    jstring NewStringUTF(const char *utf) {
+        return functions->NewStringUTF(this,utf);
+    }
+    jsize GetStringUTFLength(jstring str) {
+        return functions->GetStringUTFLength(this,str);
+    }
+    const char* GetStringUTFChars(jstring str, jboolean *isCopy) {
+        return functions->GetStringUTFChars(this,str,isCopy);
+    }
+    void ReleaseStringUTFChars(jstring str, const char* chars) {
+        functions->ReleaseStringUTFChars(this,str,chars);
+    }
+
+    jsize GetArrayLength(jarray array) {
+        return functions->GetArrayLength(this,array);
+    }
+
+    jobjectArray NewObjectArray(jsize len, jclass clazz,
+                                jobject init) {
+        return functions->NewObjectArray(this,len,clazz,init);
+    }
+    jobject GetObjectArrayElement(jobjectArray array, jsize index) {
+        return functions->GetObjectArrayElement(this,array,index);
+    }
+    void SetObjectArrayElement(jobjectArray array, jsize index,
+                               jobject val) {
+        functions->SetObjectArrayElement(this,array,index,val);
+    }
+
+    jbooleanArray NewBooleanArray(jsize len) {
+        return functions->NewBooleanArray(this,len);
+    }
+    jbyteArray NewByteArray(jsize len) {
+        return functions->NewByteArray(this,len);
+    }
+    jcharArray NewCharArray(jsize len) {
+        return functions->NewCharArray(this,len);
+    }
+    jshortArray NewShortArray(jsize len) {
+        return functions->NewShortArray(this,len);
+    }
+    jintArray NewIntArray(jsize len) {
+        return functions->NewIntArray(this,len);
+    }
+    jlongArray NewLongArray(jsize len) {
+        return functions->NewLongArray(this,len);
+    }
+    jfloatArray NewFloatArray(jsize len) {
+        return functions->NewFloatArray(this,len);
+    }
+    jdoubleArray NewDoubleArray(jsize len) {
+        return functions->NewDoubleArray(this,len);
+    }
+
+    jboolean * GetBooleanArrayElements(jbooleanArray array, jboolean *isCopy) {
+        return functions->GetBooleanArrayElements(this,array,isCopy);
+    }
+    jbyte * GetByteArrayElements(jbyteArray array, jboolean *isCopy) {
+        return functions->GetByteArrayElements(this,array,isCopy);
+    }
+    jchar * GetCharArrayElements(jcharArray array, jboolean *isCopy) {
+        return functions->GetCharArrayElements(this,array,isCopy);
+    }
+    jshort * GetShortArrayElements(jshortArray array, jboolean *isCopy) {
+        return functions->GetShortArrayElements(this,array,isCopy);
+    }
+    jint * GetIntArrayElements(jintArray array, jboolean *isCopy) {
+        return functions->GetIntArrayElements(this,array,isCopy);
+    }
+    jlong * GetLongArrayElements(jlongArray array, jboolean *isCopy) {
+        return functions->GetLongArrayElements(this,array,isCopy);
+    }
+    jfloat * GetFloatArrayElements(jfloatArray array, jboolean *isCopy) {
+        return functions->GetFloatArrayElements(this,array,isCopy);
+    }
+    jdouble * GetDoubleArrayElements(jdoubleArray array, jboolean *isCopy) {
+        return functions->GetDoubleArrayElements(this,array,isCopy);
+    }
+
+    void ReleaseBooleanArrayElements(jbooleanArray array,
+                                     jboolean *elems,
+                                     jint mode) {
+        functions->ReleaseBooleanArrayElements(this,array,elems,mode);
+    }
+    void ReleaseByteArrayElements(jbyteArray array,
+                                  jbyte *elems,
+                                  jint mode) {
+        functions->ReleaseByteArrayElements(this,array,elems,mode);
+    }
+    void ReleaseCharArrayElements(jcharArray array,
+                                  jchar *elems,
+                                  jint mode) {
+        functions->ReleaseCharArrayElements(this,array,elems,mode);
+    }
+    void ReleaseShortArrayElements(jshortArray array,
+                                   jshort *elems,
+                                   jint mode) {
+        functions->ReleaseShortArrayElements(this,array,elems,mode);
+    }
+    void ReleaseIntArrayElements(jintArray array,
+                                 jint *elems,
+                                 jint mode) {
+        functions->ReleaseIntArrayElements(this,array,elems,mode);
+    }
+    void ReleaseLongArrayElements(jlongArray array,
+                                  jlong *elems,
+                                  jint mode) {
+        functions->ReleaseLongArrayElements(this,array,elems,mode);
+    }
+    void ReleaseFloatArrayElements(jfloatArray array,
+                                   jfloat *elems,
+                                   jint mode) {
+        functions->ReleaseFloatArrayElements(this,array,elems,mode);
+    }
+    void ReleaseDoubleArrayElements(jdoubleArray array,
+                                    jdouble *elems,
+                                    jint mode) {
+        functions->ReleaseDoubleArrayElements(this,array,elems,mode);
+    }
+
+    void GetBooleanArrayRegion(jbooleanArray array,
+                               jsize start, jsize len, jboolean *buf) {
+        functions->GetBooleanArrayRegion(this,array,start,len,buf);
+    }
+    void GetByteArrayRegion(jbyteArray array,
+                            jsize start, jsize len, jbyte *buf) {
+        functions->GetByteArrayRegion(this,array,start,len,buf);
+    }
+    void GetCharArrayRegion(jcharArray array,
+                            jsize start, jsize len, jchar *buf) {
+        functions->GetCharArrayRegion(this,array,start,len,buf);
+    }
+    void GetShortArrayRegion(jshortArray array,
+                             jsize start, jsize len, jshort *buf) {
+        functions->GetShortArrayRegion(this,array,start,len,buf);
+    }
+    void GetIntArrayRegion(jintArray array,
+                           jsize start, jsize len, jint *buf) {
+        functions->GetIntArrayRegion(this,array,start,len,buf);
+    }
+    void GetLongArrayRegion(jlongArray array,
+                            jsize start, jsize len, jlong *buf) {
+        functions->GetLongArrayRegion(this,array,start,len,buf);
+    }
+    void GetFloatArrayRegion(jfloatArray array,
+                             jsize start, jsize len, jfloat *buf) {
+        functions->GetFloatArrayRegion(this,array,start,len,buf);
+    }
+    void GetDoubleArrayRegion(jdoubleArray array,
+                              jsize start, jsize len, jdouble *buf) {
+        functions->GetDoubleArrayRegion(this,array,start,len,buf);
+    }
+
+    void SetBooleanArrayRegion(jbooleanArray array, jsize start, jsize len,
+                               const jboolean *buf) {
+        functions->SetBooleanArrayRegion(this,array,start,len,buf);
+    }
+    void SetByteArrayRegion(jbyteArray array, jsize start, jsize len,
+                            const jbyte *buf) {
+        functions->SetByteArrayRegion(this,array,start,len,buf);
+    }
+    void SetCharArrayRegion(jcharArray array, jsize start, jsize len,
+                            const jchar *buf) {
+        functions->SetCharArrayRegion(this,array,start,len,buf);
+    }
+    void SetShortArrayRegion(jshortArray array, jsize start, jsize len,
+                             const jshort *buf) {
+        functions->SetShortArrayRegion(this,array,start,len,buf);
+    }
+    void SetIntArrayRegion(jintArray array, jsize start, jsize len,
+                           const jint *buf) {
+        functions->SetIntArrayRegion(this,array,start,len,buf);
+    }
+    void SetLongArrayRegion(jlongArray array, jsize start, jsize len,
+                            const jlong *buf) {
+        functions->SetLongArrayRegion(this,array,start,len,buf);
+    }
+    void SetFloatArrayRegion(jfloatArray array, jsize start, jsize len,
+                             const jfloat *buf) {
+        functions->SetFloatArrayRegion(this,array,start,len,buf);
+    }
+    void SetDoubleArrayRegion(jdoubleArray array, jsize start, jsize len,
+                              const jdouble *buf) {
+        functions->SetDoubleArrayRegion(this,array,start,len,buf);
+    }
+
+    jint RegisterNatives(jclass clazz, const JNINativeMethod *methods,
+                         jint nMethods) {
+        return functions->RegisterNatives(this,clazz,methods,nMethods);
+    }
+    jint UnregisterNatives(jclass clazz) {
+        return functions->UnregisterNatives(this,clazz);
+    }
+
+    jint MonitorEnter(jobject obj) {
+        return functions->MonitorEnter(this,obj);
+    }
+    jint MonitorExit(jobject obj) {
+        return functions->MonitorExit(this,obj);
+    }
+
+    jint GetJavaVM(JavaVM **vm) {
+        return functions->GetJavaVM(this,vm);
+    }
+
+    void GetStringRegion(jstring str, jsize start, jsize len, jchar *buf) {
+        functions->GetStringRegion(this,str,start,len,buf);
+    }
+    void GetStringUTFRegion(jstring str, jsize start, jsize len, char *buf) {
+        functions->GetStringUTFRegion(this,str,start,len,buf);
+    }
+
+    void * GetPrimitiveArrayCritical(jarray array, jboolean *isCopy) {
+        return functions->GetPrimitiveArrayCritical(this,array,isCopy);
+    }
+    void ReleasePrimitiveArrayCritical(jarray array, void *carray, jint mode) {
+        functions->ReleasePrimitiveArrayCritical(this,array,carray,mode);
+    }
+
+    const jchar * GetStringCritical(jstring string, jboolean *isCopy) {
+        return functions->GetStringCritical(this,string,isCopy);
+    }
+    void ReleaseStringCritical(jstring string, const jchar *cstring) {
+        functions->ReleaseStringCritical(this,string,cstring);
+    }
+
+    jweak NewWeakGlobalRef(jobject obj) {
+        return functions->NewWeakGlobalRef(this,obj);
+    }
+    void DeleteWeakGlobalRef(jweak ref) {
+        functions->DeleteWeakGlobalRef(this,ref);
+    }
+
+    jboolean ExceptionCheck() {
+        return functions->ExceptionCheck(this);
+    }
+
+    jobject NewDirectByteBuffer(void* address, jlong capacity) {
+        return functions->NewDirectByteBuffer(this, address, capacity);
+    }
+    void* GetDirectBufferAddress(jobject buf) {
+        return functions->GetDirectBufferAddress(this, buf);
+    }
+    jlong GetDirectBufferCapacity(jobject buf) {
+        return functions->GetDirectBufferCapacity(this, buf);
+    }
+    jobjectRefType GetObjectRefType(jobject obj) {
+        return functions->GetObjectRefType(this, obj);
+    }
+
+#endif /* __cplusplus */
+};
+
+typedef struct JavaVMOption {
+    char *optionString;
+    void *extraInfo;
+} JavaVMOption;
+
+typedef struct JavaVMInitArgs {
+    jint version;
+
+    jint nOptions;
+    JavaVMOption *options;
+    jboolean ignoreUnrecognized;
+} JavaVMInitArgs;
+
+typedef struct JavaVMAttachArgs {
+    jint version;
+
+    char *name;
+    jobject group;
+} JavaVMAttachArgs;
+
+/* These will be VM-specific. */
+
+#define JDK1_2
+#define JDK1_4
+
+/* End VM-specific. */
+
+struct JNIInvokeInterface_ {
+    void *reserved0;
+    void *reserved1;
+    void *reserved2;
+
+    jint (JNICALL *DestroyJavaVM)(JavaVM *vm);
+
+    jint (JNICALL *AttachCurrentThread)(JavaVM *vm, void **penv, void *args);
+
+    jint (JNICALL *DetachCurrentThread)(JavaVM *vm);
+
+    jint (JNICALL *GetEnv)(JavaVM *vm, void **penv, jint version);
+
+    jint (JNICALL *AttachCurrentThreadAsDaemon)(JavaVM *vm, void **penv, void *args);
+};
+
+struct JavaVM_ {
+    const struct JNIInvokeInterface_ *functions;
+#ifdef __cplusplus
+
+    jint DestroyJavaVM() {
+        return functions->DestroyJavaVM(this);
+    }
+    jint AttachCurrentThread(void **penv, void *args) {
+        return functions->AttachCurrentThread(this, penv, args);
+    }
+    jint DetachCurrentThread() {
+        return functions->DetachCurrentThread(this);
+    }
+
+    jint GetEnv(void **penv, jint version) {
+        return functions->GetEnv(this, penv, version);
+    }
+    jint AttachCurrentThreadAsDaemon(void **penv, void *args) {
+        return functions->AttachCurrentThreadAsDaemon(this, penv, args);
+    }
+#endif
+};
+
+#ifdef _JNI_IMPLEMENTATION_
+#define _JNI_IMPORT_OR_EXPORT_ JNIEXPORT
+#else
+#define _JNI_IMPORT_OR_EXPORT_ JNIIMPORT
+#endif
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_GetDefaultJavaVMInitArgs(void *args);
+
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *args);
+
+_JNI_IMPORT_OR_EXPORT_ jint JNICALL
+JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *);
+
+/* Defined by native libraries. */
+JNIEXPORT jint JNICALL
+JNI_OnLoad(JavaVM *vm, void *reserved);
+
+JNIEXPORT void JNICALL
+JNI_OnUnload(JavaVM *vm, void *reserved);
+
+#define JNI_VERSION_1_1 0x00010001
+#define JNI_VERSION_1_2 0x00010002
+#define JNI_VERSION_1_4 0x00010004
+#define JNI_VERSION_1_6 0x00010006
+#define JNI_VERSION_1_8 0x00010008
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+
+#endif /* !_JAVASOFT_JNI_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resources/jdk8u382-b05-win64/include/win32/jni_md.h	Wed Oct 18 17:59:44 2023 +0200
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#ifndef _JAVASOFT_JNI_MD_H_
+#define _JAVASOFT_JNI_MD_H_
+
+#define JNIEXPORT __declspec(dllexport)
+#define JNIIMPORT __declspec(dllimport)
+#define JNICALL __stdcall
+
+typedef long jint;
+typedef __int64 jlong;
+typedef signed char jbyte;
+
+#endif /* !_JAVASOFT_JNI_MD_H_ */
Binary file Resources/jdk8u382-b05-win64/lib/jvm.lib has changed