annotate Sources/Autogenerated/sdk_OrthancPluginStorageArea.methods.h @ 129:5643e97d9367 fix-leak

reproducible code generation
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Aug 2023 11:40:22 +0200
parents
children e9be3c9294d4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
129
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 // Actual implementation of the methods
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaCreate(
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 sdk_OrthancPluginStorageArea_Object* self, PyObject *args)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
5 PythonLock::LogCall("Calling method OrthancPluginStorageAreaCreate() on object of class OrthancPluginStorageArea");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 if (self->object_ == NULL)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 PyErr_SetString(PyExc_ValueError, "Invalid object");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 const char* arg0 = NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 Py_buffer arg1;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 unsigned long long arg2 = 0;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 long int arg3 = 0;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 if (!PyArg_ParseTuple(args, "ss*Kl", &arg0, &arg1, &arg2, &arg3))
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (4 arguments expected)");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 OrthancPluginErrorCode code = OrthancPluginStorageAreaCreate(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1.buf, arg2, static_cast<OrthancPluginContentType>(arg3));
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 PyBuffer_Release(&arg1);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 if (code == OrthancPluginErrorCode_Success)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 Py_INCREF(Py_None);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 return Py_None;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 else
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 PythonLock::RaiseException(code);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38 static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaRead(
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 sdk_OrthancPluginStorageArea_Object* self, PyObject *args)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 PythonLock::LogCall("Calling method OrthancPluginStorageAreaRead() on object of class OrthancPluginStorageArea");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 if (self->object_ == NULL)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 PyErr_SetString(PyExc_ValueError, "Invalid object");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 const char* arg0 = NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 long int arg1 = 0;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 if (!PyArg_ParseTuple(args, "sl", &arg0, &arg1))
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 OrthancPlugins::MemoryBuffer buffer;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 OrthancPluginErrorCode code = OrthancPluginStorageAreaRead(OrthancPlugins::GetGlobalContext(), *buffer, self->object_, arg0, static_cast<OrthancPluginContentType>(arg1));
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60 if (code == OrthancPluginErrorCode_Success)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 return PyBytes_FromStringAndSize(buffer.GetData(), buffer.GetSize());
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 else
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 PythonLock::RaiseException(code);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginStorageAreaRemove(
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 sdk_OrthancPluginStorageArea_Object* self, PyObject *args)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 PythonLock::LogCall("Calling method OrthancPluginStorageAreaRemove() on object of class OrthancPluginStorageArea");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 if (self->object_ == NULL)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78 PyErr_SetString(PyExc_ValueError, "Invalid object");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 const char* arg0 = NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 long int arg1 = 0;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 if (!PyArg_ParseTuple(args, "sl", &arg0, &arg1))
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 OrthancPluginErrorCode code = OrthancPluginStorageAreaRemove(OrthancPlugins::GetGlobalContext(), self->object_, arg0, static_cast<OrthancPluginContentType>(arg1));
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 if (code == OrthancPluginErrorCode_Success)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 Py_INCREF(Py_None);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 return Py_None;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 else
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 PythonLock::RaiseException(code);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105 static PyObject *sdk_OrthancPluginStorageArea_OrthancPluginReconstructMainDicomTags(
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106 sdk_OrthancPluginStorageArea_Object* self, PyObject *args)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 PythonLock::LogCall("Calling method OrthancPluginReconstructMainDicomTags() on object of class OrthancPluginStorageArea");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 if (self->object_ == NULL)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112 PyErr_SetString(PyExc_ValueError, "Invalid object");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 long int arg0 = 0;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 if (!PyArg_ParseTuple(args, "l", &arg0))
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)");
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 OrthancPluginErrorCode code = OrthancPluginReconstructMainDicomTags(OrthancPlugins::GetGlobalContext(), self->object_, static_cast<OrthancPluginResourceType>(arg0));
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 if (code == OrthancPluginErrorCode_Success)
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 Py_INCREF(Py_None);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 return Py_None;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 else
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 {
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 PythonLock::RaiseException(code);
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 return NULL;
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 }
5643e97d9367 reproducible code generation
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137