|
| 1 | +// generated from rosidl_generator_py/resource/_idl_pkg_bases.c.em |
| 2 | +// generated code does not contain a copyright notice |
| 3 | +#include <Python.h> |
| 4 | +#include <stdbool.h> |
| 5 | +#include <structmember.h> |
| 6 | +#include "./_example_msgs_decl.h" |
| 7 | + |
| 8 | + |
| 9 | +static struct PyMemberDef CustomMessageBase_members[] = { |
| 10 | + {"_x", T_USHORT, offsetof(CustomMessageBase, _x), 0, NULL}, |
| 11 | + {"_ts", T_OBJECT, offsetof(CustomMessageBase, _ts), 0, NULL}, |
| 12 | + {"_fixed_seq", T_OBJECT, offsetof(CustomMessageBase, _fixed_seq), 0, NULL}, |
| 13 | + {"_limited_seq", T_OBJECT, offsetof(CustomMessageBase, _limited_seq), 0, NULL}, |
| 14 | + {"_unlimited_seq", T_OBJECT, offsetof(CustomMessageBase, _unlimited_seq), 0, NULL}, |
| 15 | + {NULL} /* Sentinel */ |
| 16 | +}; |
| 17 | + |
| 18 | +static void CustomMessageBase_dealloc(CustomMessageBase * self) |
| 19 | +{ |
| 20 | + Py_XDECREF(self->_ts); |
| 21 | + Py_XDECREF(self->_fixed_seq); |
| 22 | + Py_XDECREF(self->_limited_seq); |
| 23 | + Py_XDECREF(self->_unlimited_seq); |
| 24 | + Py_TYPE(self)->tp_free((PyObject *)self); |
| 25 | +} |
| 26 | + |
| 27 | + |
| 28 | +static PyTypeObject CustomMessageBaseType = { |
| 29 | + PyVarObject_HEAD_INIT(NULL, 0) |
| 30 | + .tp_name = "CustomMessageBase", |
| 31 | + .tp_doc = "Base for CustomMessage python class", |
| 32 | + .tp_basicsize = sizeof(CustomMessageBase), |
| 33 | + .tp_itemsize = 0, |
| 34 | + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, |
| 35 | + .tp_new = PyType_GenericNew, |
| 36 | + .tp_dealloc = (destructor)CustomMessageBase_dealloc, |
| 37 | + .tp_members = CustomMessageBase_members, |
| 38 | +}; |
| 39 | + |
| 40 | + |
| 41 | +static int8_t _register_base_msg_type__msg__custom_message(PyObject * module) |
| 42 | +{ |
| 43 | + if (PyType_Ready(&CustomMessageBaseType) < 0) { |
| 44 | + return 1; |
| 45 | + } |
| 46 | + |
| 47 | + Py_INCREF(&CustomMessageBaseType); |
| 48 | + if (PyModule_AddObject(module, "CustomMessageBase", (PyObject *) &CustomMessageBaseType) < 0) { |
| 49 | + Py_DECREF(&CustomMessageBaseType); |
| 50 | + return 1; |
| 51 | + } |
| 52 | + return 0; |
| 53 | +} |
| 54 | +// already included above |
| 55 | +// #include <Python.h> |
| 56 | +// already included above |
| 57 | +// #include <stdbool.h> |
| 58 | +// already included above |
| 59 | +// #include <structmember.h> |
| 60 | +// already included above |
| 61 | +// #include "./_example_msgs_decl.h" |
| 62 | + |
| 63 | + |
| 64 | +static struct PyMemberDef CustomCall_RequestBase_members[] = { |
| 65 | + {"_my_param", T_INT, offsetof(CustomCall_RequestBase, _my_param), 0, NULL}, |
| 66 | + {NULL} /* Sentinel */ |
| 67 | +}; |
| 68 | + |
| 69 | +static void CustomCall_RequestBase_dealloc(CustomCall_RequestBase * self) |
| 70 | +{ |
| 71 | + Py_TYPE(self)->tp_free((PyObject *)self); |
| 72 | +} |
| 73 | + |
| 74 | + |
| 75 | +static PyTypeObject CustomCall_RequestBaseType = { |
| 76 | + PyVarObject_HEAD_INIT(NULL, 0) |
| 77 | + .tp_name = "CustomCall_RequestBase", |
| 78 | + .tp_doc = "Base for CustomCall_Request python class", |
| 79 | + .tp_basicsize = sizeof(CustomCall_RequestBase), |
| 80 | + .tp_itemsize = 0, |
| 81 | + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, |
| 82 | + .tp_new = PyType_GenericNew, |
| 83 | + .tp_dealloc = (destructor)CustomCall_RequestBase_dealloc, |
| 84 | + .tp_members = CustomCall_RequestBase_members, |
| 85 | +}; |
| 86 | + |
| 87 | + |
| 88 | +static int8_t _register_base_msg_type__srv__custom_call__request(PyObject * module) |
| 89 | +{ |
| 90 | + if (PyType_Ready(&CustomCall_RequestBaseType) < 0) { |
| 91 | + return 1; |
| 92 | + } |
| 93 | + |
| 94 | + Py_INCREF(&CustomCall_RequestBaseType); |
| 95 | + if (PyModule_AddObject(module, "CustomCall_RequestBase", (PyObject *) &CustomCall_RequestBaseType) < 0) { |
| 96 | + Py_DECREF(&CustomCall_RequestBaseType); |
| 97 | + return 1; |
| 98 | + } |
| 99 | + return 0; |
| 100 | +} |
| 101 | + |
| 102 | +// already included above |
| 103 | +// #include <Python.h> |
| 104 | +// already included above |
| 105 | +// #include <stdbool.h> |
| 106 | +// already included above |
| 107 | +// #include <structmember.h> |
| 108 | +// already included above |
| 109 | +// #include "./_example_msgs_decl.h" |
| 110 | + |
| 111 | + |
| 112 | +static struct PyMemberDef CustomCall_ResponseBase_members[] = { |
| 113 | + {"_my_result", T_INT, offsetof(CustomCall_ResponseBase, _my_result), 0, NULL}, |
| 114 | + {NULL} /* Sentinel */ |
| 115 | +}; |
| 116 | + |
| 117 | +static void CustomCall_ResponseBase_dealloc(CustomCall_ResponseBase * self) |
| 118 | +{ |
| 119 | + Py_TYPE(self)->tp_free((PyObject *)self); |
| 120 | +} |
| 121 | + |
| 122 | + |
| 123 | +static PyTypeObject CustomCall_ResponseBaseType = { |
| 124 | + PyVarObject_HEAD_INIT(NULL, 0) |
| 125 | + .tp_name = "CustomCall_ResponseBase", |
| 126 | + .tp_doc = "Base for CustomCall_Response python class", |
| 127 | + .tp_basicsize = sizeof(CustomCall_ResponseBase), |
| 128 | + .tp_itemsize = 0, |
| 129 | + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, |
| 130 | + .tp_new = PyType_GenericNew, |
| 131 | + .tp_dealloc = (destructor)CustomCall_ResponseBase_dealloc, |
| 132 | + .tp_members = CustomCall_ResponseBase_members, |
| 133 | +}; |
| 134 | + |
| 135 | + |
| 136 | +static int8_t _register_base_msg_type__srv__custom_call__response(PyObject * module) |
| 137 | +{ |
| 138 | + if (PyType_Ready(&CustomCall_ResponseBaseType) < 0) { |
| 139 | + return 1; |
| 140 | + } |
| 141 | + |
| 142 | + Py_INCREF(&CustomCall_ResponseBaseType); |
| 143 | + if (PyModule_AddObject(module, "CustomCall_ResponseBase", (PyObject *) &CustomCall_ResponseBaseType) < 0) { |
| 144 | + Py_DECREF(&CustomCall_ResponseBaseType); |
| 145 | + return 1; |
| 146 | + } |
| 147 | + return 0; |
| 148 | +} |
| 149 | + |
| 150 | +// already included above |
| 151 | +// #include <Python.h> |
| 152 | +// already included above |
| 153 | +// #include <stdbool.h> |
| 154 | +// already included above |
| 155 | +// #include <structmember.h> |
| 156 | +// already included above |
| 157 | +// #include "./_example_msgs_decl.h" |
| 158 | + |
| 159 | + |
| 160 | +static struct PyMemberDef CustomCall_EventBase_members[] = { |
| 161 | + {"_info", T_OBJECT, offsetof(CustomCall_EventBase, _info), 0, NULL}, |
| 162 | + {"_request", T_OBJECT, offsetof(CustomCall_EventBase, _request), 0, NULL}, |
| 163 | + {"_response", T_OBJECT, offsetof(CustomCall_EventBase, _response), 0, NULL}, |
| 164 | + {NULL} /* Sentinel */ |
| 165 | +}; |
| 166 | + |
| 167 | +static void CustomCall_EventBase_dealloc(CustomCall_EventBase * self) |
| 168 | +{ |
| 169 | + Py_XDECREF(self->_info); |
| 170 | + Py_XDECREF(self->_request); |
| 171 | + Py_XDECREF(self->_response); |
| 172 | + Py_TYPE(self)->tp_free((PyObject *)self); |
| 173 | +} |
| 174 | + |
| 175 | + |
| 176 | +static PyTypeObject CustomCall_EventBaseType = { |
| 177 | + PyVarObject_HEAD_INIT(NULL, 0) |
| 178 | + .tp_name = "CustomCall_EventBase", |
| 179 | + .tp_doc = "Base for CustomCall_Event python class", |
| 180 | + .tp_basicsize = sizeof(CustomCall_EventBase), |
| 181 | + .tp_itemsize = 0, |
| 182 | + .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, |
| 183 | + .tp_new = PyType_GenericNew, |
| 184 | + .tp_dealloc = (destructor)CustomCall_EventBase_dealloc, |
| 185 | + .tp_members = CustomCall_EventBase_members, |
| 186 | +}; |
| 187 | + |
| 188 | + |
| 189 | +static int8_t _register_base_msg_type__srv__custom_call__event(PyObject * module) |
| 190 | +{ |
| 191 | + if (PyType_Ready(&CustomCall_EventBaseType) < 0) { |
| 192 | + return 1; |
| 193 | + } |
| 194 | + |
| 195 | + Py_INCREF(&CustomCall_EventBaseType); |
| 196 | + if (PyModule_AddObject(module, "CustomCall_EventBase", (PyObject *) &CustomCall_EventBaseType) < 0) { |
| 197 | + Py_DECREF(&CustomCall_EventBaseType); |
| 198 | + return 1; |
| 199 | + } |
| 200 | + return 0; |
| 201 | +} |
| 202 | + |
| 203 | + |
| 204 | +static PyModuleDef _module = { |
| 205 | + PyModuleDef_HEAD_INIT, |
| 206 | + .m_name = "_example_msgs_bases", |
| 207 | + .m_doc = "Extention module for example_msgs messages", |
| 208 | + .m_size = -1, |
| 209 | +}; |
| 210 | + |
| 211 | + |
| 212 | +PyMODINIT_FUNC |
| 213 | +PyInit__example_msgs_bases(void) |
| 214 | +{ |
| 215 | + PyObject * pymodule = NULL; |
| 216 | + pymodule = PyModule_Create(&_module); |
| 217 | + if (!pymodule) { |
| 218 | + return NULL; |
| 219 | + } |
| 220 | + int8_t err; |
| 221 | + |
| 222 | + err = _register_base_msg_type__msg__custom_message(pymodule); |
| 223 | + if (err) { |
| 224 | + Py_XDECREF(pymodule); |
| 225 | + return NULL; |
| 226 | + } |
| 227 | + |
| 228 | + err = _register_base_msg_type__srv__custom_call__request(pymodule); |
| 229 | + if (err) { |
| 230 | + Py_XDECREF(pymodule); |
| 231 | + return NULL; |
| 232 | + } |
| 233 | + |
| 234 | + err = _register_base_msg_type__srv__custom_call__response(pymodule); |
| 235 | + if (err) { |
| 236 | + Py_XDECREF(pymodule); |
| 237 | + return NULL; |
| 238 | + } |
| 239 | + |
| 240 | + err = _register_base_msg_type__srv__custom_call__event(pymodule); |
| 241 | + if (err) { |
| 242 | + Py_XDECREF(pymodule); |
| 243 | + return NULL; |
| 244 | + } |
| 245 | + |
| 246 | + return pymodule; |
| 247 | +} |
0 commit comments