Mercurial > hg > orthanc-python
comparison Sources/Autogenerated/sdk_OrthancPluginPeers.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 |
comparison
equal
deleted
inserted
replaced
128:5b59ebc267e1 | 129:5643e97d9367 |
---|---|
1 // Actual implementation of the methods | |
2 static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeersCount( | |
3 sdk_OrthancPluginPeers_Object* self, PyObject *args) | |
4 { | |
5 PythonLock::LogCall("Calling method OrthancPluginGetPeersCount() on object of class OrthancPluginPeers"); | |
6 | |
7 if (self->object_ == NULL) | |
8 { | |
9 PyErr_SetString(PyExc_ValueError, "Invalid object"); | |
10 return NULL; | |
11 } | |
12 | |
13 | |
14 long value = OrthancPluginGetPeersCount(OrthancPlugins::GetGlobalContext(), self->object_); | |
15 | |
16 return PyLong_FromLong(value); | |
17 } | |
18 | |
19 static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeerName( | |
20 sdk_OrthancPluginPeers_Object* self, PyObject *args) | |
21 { | |
22 PythonLock::LogCall("Calling method OrthancPluginGetPeerName() on object of class OrthancPluginPeers"); | |
23 | |
24 if (self->object_ == NULL) | |
25 { | |
26 PyErr_SetString(PyExc_ValueError, "Invalid object"); | |
27 return NULL; | |
28 } | |
29 | |
30 unsigned long arg0 = 0; | |
31 | |
32 if (!PyArg_ParseTuple(args, "k", &arg0)) | |
33 { | |
34 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
35 return NULL; | |
36 } | |
37 const char* s = OrthancPluginGetPeerName(OrthancPlugins::GetGlobalContext(), self->object_, arg0); | |
38 | |
39 if (s == NULL) | |
40 { | |
41 Py_INCREF(Py_None); | |
42 return Py_None; | |
43 } | |
44 else | |
45 { | |
46 return PyUnicode_FromString(s); | |
47 } | |
48 } | |
49 | |
50 static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeerUrl( | |
51 sdk_OrthancPluginPeers_Object* self, PyObject *args) | |
52 { | |
53 PythonLock::LogCall("Calling method OrthancPluginGetPeerUrl() on object of class OrthancPluginPeers"); | |
54 | |
55 if (self->object_ == NULL) | |
56 { | |
57 PyErr_SetString(PyExc_ValueError, "Invalid object"); | |
58 return NULL; | |
59 } | |
60 | |
61 unsigned long arg0 = 0; | |
62 | |
63 if (!PyArg_ParseTuple(args, "k", &arg0)) | |
64 { | |
65 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (1 arguments expected)"); | |
66 return NULL; | |
67 } | |
68 const char* s = OrthancPluginGetPeerUrl(OrthancPlugins::GetGlobalContext(), self->object_, arg0); | |
69 | |
70 if (s == NULL) | |
71 { | |
72 Py_INCREF(Py_None); | |
73 return Py_None; | |
74 } | |
75 else | |
76 { | |
77 return PyUnicode_FromString(s); | |
78 } | |
79 } | |
80 | |
81 static PyObject *sdk_OrthancPluginPeers_OrthancPluginGetPeerUserProperty( | |
82 sdk_OrthancPluginPeers_Object* self, PyObject *args) | |
83 { | |
84 PythonLock::LogCall("Calling method OrthancPluginGetPeerUserProperty() on object of class OrthancPluginPeers"); | |
85 | |
86 if (self->object_ == NULL) | |
87 { | |
88 PyErr_SetString(PyExc_ValueError, "Invalid object"); | |
89 return NULL; | |
90 } | |
91 | |
92 unsigned long arg0 = 0; | |
93 const char* arg1 = NULL; | |
94 | |
95 if (!PyArg_ParseTuple(args, "ks", &arg0, &arg1)) | |
96 { | |
97 PyErr_SetString(PyExc_TypeError, "Bad types for the arguments (2 arguments expected)"); | |
98 return NULL; | |
99 } | |
100 const char* s = OrthancPluginGetPeerUserProperty(OrthancPlugins::GetGlobalContext(), self->object_, arg0, arg1); | |
101 | |
102 if (s == NULL) | |
103 { | |
104 Py_INCREF(Py_None); | |
105 return Py_None; | |
106 } | |
107 else | |
108 { | |
109 return PyUnicode_FromString(s); | |
110 } | |
111 } | |
112 |