File: | build/temp.linux-x86_64-3.8/../../dbus_bindings/module.c |
Warning: | line 401, column 13 PyObject ownership leak with reference count of 1 |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* Main module source for the _dbus_bindings extension. | |||
2 | * | |||
3 | * Copyright (C) 2006 Collabora Ltd. <http://www.collabora.co.uk/> | |||
4 | * | |||
5 | * SPDX-License-Identifier: MIT | |||
6 | * | |||
7 | * Permission is hereby granted, free of charge, to any person | |||
8 | * obtaining a copy of this software and associated documentation | |||
9 | * files (the "Software"), to deal in the Software without | |||
10 | * restriction, including without limitation the rights to use, copy, | |||
11 | * modify, merge, publish, distribute, sublicense, and/or sell copies | |||
12 | * of the Software, and to permit persons to whom the Software is | |||
13 | * furnished to do so, subject to the following conditions: | |||
14 | * | |||
15 | * The above copyright notice and this permission notice shall be | |||
16 | * included in all copies or substantial portions of the Software. | |||
17 | * | |||
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
19 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
20 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | |||
21 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | |||
22 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | |||
23 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |||
24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |||
25 | * DEALINGS IN THE SOFTWARE. | |||
26 | */ | |||
27 | ||||
28 | #include "dbus_bindings-internal.h" | |||
29 | ||||
30 | #include <Python.h> | |||
31 | #include <structmember.h> | |||
32 | ||||
33 | PyDoc_STRVAR(module_doc,static const char module_doc[] = "Low-level Python bindings for libdbus. Don't use this module directly -\n" "the public API is provided by the `dbus`, `dbus.service`, `dbus.mainloop`\n" "and `dbus.mainloop.glib` modules, with a lower-level API provided by the\n" "`dbus.lowlevel` module.\n" | |||
34 | "Low-level Python bindings for libdbus. Don't use this module directly -\n"static const char module_doc[] = "Low-level Python bindings for libdbus. Don't use this module directly -\n" "the public API is provided by the `dbus`, `dbus.service`, `dbus.mainloop`\n" "and `dbus.mainloop.glib` modules, with a lower-level API provided by the\n" "`dbus.lowlevel` module.\n" | |||
35 | "the public API is provided by the `dbus`, `dbus.service`, `dbus.mainloop`\n"static const char module_doc[] = "Low-level Python bindings for libdbus. Don't use this module directly -\n" "the public API is provided by the `dbus`, `dbus.service`, `dbus.mainloop`\n" "and `dbus.mainloop.glib` modules, with a lower-level API provided by the\n" "`dbus.lowlevel` module.\n" | |||
36 | "and `dbus.mainloop.glib` modules, with a lower-level API provided by the\n"static const char module_doc[] = "Low-level Python bindings for libdbus. Don't use this module directly -\n" "the public API is provided by the `dbus`, `dbus.service`, `dbus.mainloop`\n" "and `dbus.mainloop.glib` modules, with a lower-level API provided by the\n" "`dbus.lowlevel` module.\n" | |||
37 | "`dbus.lowlevel` module.\n"static const char module_doc[] = "Low-level Python bindings for libdbus. Don't use this module directly -\n" "the public API is provided by the `dbus`, `dbus.service`, `dbus.mainloop`\n" "and `dbus.mainloop.glib` modules, with a lower-level API provided by the\n" "`dbus.lowlevel` module.\n" | |||
38 | )static const char module_doc[] = "Low-level Python bindings for libdbus. Don't use this module directly -\n" "the public API is provided by the `dbus`, `dbus.service`, `dbus.mainloop`\n" "and `dbus.mainloop.glib` modules, with a lower-level API provided by the\n" "`dbus.lowlevel` module.\n"; | |||
39 | ||||
40 | /* Global functions - validation wrappers ===========================*/ | |||
41 | ||||
42 | PyDoc_STRVAR(validate_bus_name__doc__,static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n" | |||
43 | "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n"static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n" | |||
44 | "\n"static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n" | |||
45 | "Raise ValueError if the argument is not a valid bus name.\n"static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n" | |||
46 | "\n"static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n" | |||
47 | "By default both unique and well-known names are accepted.\n"static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n" | |||
48 | "\n"static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n" | |||
49 | ":Parameters:\n"static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n" | |||
50 | " `name` : str\n"static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n" | |||
51 | " The name to be validated\n"static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n" | |||
52 | " `allow_unique` : bool\n"static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n" | |||
53 | " If False, unique names of the form :1.123 will be rejected\n"static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n" | |||
54 | " `allow_well_known` : bool\n"static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n" | |||
55 | " If False, well-known names of the form com.example.Foo\n"static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n" | |||
56 | " will be rejected\n"static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n" | |||
57 | ":Since: 0.80\n"static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n" | |||
58 | )static const char validate_bus_name__doc__[] = "validate_bus_name(name, allow_unique=True, allow_well_known=True)\n" "\n""Raise ValueError if the argument is not a valid bus name.\n" "\n""By default both unique and well-known names are accepted.\n" "\n"":Parameters:\n"" `name` : str\n"" The name to be validated\n" " `allow_unique` : bool\n"" If False, unique names of the form :1.123 will be rejected\n" " `allow_well_known` : bool\n"" If False, well-known names of the form com.example.Foo\n" " will be rejected\n"":Since: 0.80\n"; | |||
59 | ||||
60 | static PyObject * | |||
61 | validate_bus_name(PyObject *unused UNUSED__attribute__((__unused__)), PyObject *args, PyObject *kwargs) | |||
62 | { | |||
63 | const char *name; | |||
64 | int allow_unique = 1; | |||
65 | int allow_well_known = 1; | |||
66 | static char *argnames[] = { "name", "allow_unique", "allow_well_known", | |||
67 | NULL((void*)0) }; | |||
68 | ||||
69 | if (!PyArg_ParseTupleAndKeywords_PyArg_ParseTupleAndKeywords_SizeT(args, kwargs, | |||
70 | "s|ii:validate_bus_name", argnames, | |||
71 | &name, &allow_unique, | |||
72 | &allow_well_known)) { | |||
73 | return NULL((void*)0); | |||
74 | } | |||
75 | if (!dbus_py_validate_bus_name(name, !!allow_unique, !!allow_well_known)) { | |||
76 | return NULL((void*)0); | |||
77 | } | |||
78 | Py_RETURN_NONEreturn _Py_INCREF(((PyObject*)((&_Py_NoneStruct)))), (& _Py_NoneStruct); | |||
79 | } | |||
80 | ||||
81 | PyDoc_STRVAR(validate_member_name__doc__,static const char validate_member_name__doc__[] = "validate_member_name(name)\n" "\n""Raise ValueError if the argument is not a valid member (signal or method) " "name.\n""\n"":Since: 0.80\n" | |||
82 | "validate_member_name(name)\n"static const char validate_member_name__doc__[] = "validate_member_name(name)\n" "\n""Raise ValueError if the argument is not a valid member (signal or method) " "name.\n""\n"":Since: 0.80\n" | |||
83 | "\n"static const char validate_member_name__doc__[] = "validate_member_name(name)\n" "\n""Raise ValueError if the argument is not a valid member (signal or method) " "name.\n""\n"":Since: 0.80\n" | |||
84 | "Raise ValueError if the argument is not a valid member (signal or method) "static const char validate_member_name__doc__[] = "validate_member_name(name)\n" "\n""Raise ValueError if the argument is not a valid member (signal or method) " "name.\n""\n"":Since: 0.80\n" | |||
85 | "name.\n"static const char validate_member_name__doc__[] = "validate_member_name(name)\n" "\n""Raise ValueError if the argument is not a valid member (signal or method) " "name.\n""\n"":Since: 0.80\n" | |||
86 | "\n"static const char validate_member_name__doc__[] = "validate_member_name(name)\n" "\n""Raise ValueError if the argument is not a valid member (signal or method) " "name.\n""\n"":Since: 0.80\n" | |||
87 | ":Since: 0.80\n"static const char validate_member_name__doc__[] = "validate_member_name(name)\n" "\n""Raise ValueError if the argument is not a valid member (signal or method) " "name.\n""\n"":Since: 0.80\n" | |||
88 | )static const char validate_member_name__doc__[] = "validate_member_name(name)\n" "\n""Raise ValueError if the argument is not a valid member (signal or method) " "name.\n""\n"":Since: 0.80\n"; | |||
89 | ||||
90 | static PyObject * | |||
91 | validate_member_name(PyObject *unused UNUSED__attribute__((__unused__)), PyObject *args) | |||
92 | { | |||
93 | const char *name; | |||
94 | ||||
95 | if (!PyArg_ParseTuple_PyArg_ParseTuple_SizeT(args, "s:validate_member_name", &name)) { | |||
96 | return NULL((void*)0); | |||
97 | } | |||
98 | if (!dbus_py_validate_member_name(name)) { | |||
99 | return NULL((void*)0); | |||
100 | } | |||
101 | Py_RETURN_NONEreturn _Py_INCREF(((PyObject*)((&_Py_NoneStruct)))), (& _Py_NoneStruct); | |||
102 | } | |||
103 | ||||
104 | PyDoc_STRVAR(validate_interface_name__doc__,static const char validate_interface_name__doc__[] = "validate_interface_name(name)\n\n" "Raise ValueError if the given string is not a valid interface name.\n" "\n"":Since: 0.80\n" | |||
105 | "validate_interface_name(name)\n\n"static const char validate_interface_name__doc__[] = "validate_interface_name(name)\n\n" "Raise ValueError if the given string is not a valid interface name.\n" "\n"":Since: 0.80\n" | |||
106 | "Raise ValueError if the given string is not a valid interface name.\n"static const char validate_interface_name__doc__[] = "validate_interface_name(name)\n\n" "Raise ValueError if the given string is not a valid interface name.\n" "\n"":Since: 0.80\n" | |||
107 | "\n"static const char validate_interface_name__doc__[] = "validate_interface_name(name)\n\n" "Raise ValueError if the given string is not a valid interface name.\n" "\n"":Since: 0.80\n" | |||
108 | ":Since: 0.80\n"static const char validate_interface_name__doc__[] = "validate_interface_name(name)\n\n" "Raise ValueError if the given string is not a valid interface name.\n" "\n"":Since: 0.80\n" | |||
109 | )static const char validate_interface_name__doc__[] = "validate_interface_name(name)\n\n" "Raise ValueError if the given string is not a valid interface name.\n" "\n"":Since: 0.80\n"; | |||
110 | ||||
111 | PyDoc_STRVAR(validate_error_name__doc__,static const char validate_error_name__doc__[] = "validate_error_name(name)\n\n" "Raise ValueError if the given string is not a valid error name.\n" "\n"":Since: 0.80\n" | |||
112 | "validate_error_name(name)\n\n"static const char validate_error_name__doc__[] = "validate_error_name(name)\n\n" "Raise ValueError if the given string is not a valid error name.\n" "\n"":Since: 0.80\n" | |||
113 | "Raise ValueError if the given string is not a valid error name.\n"static const char validate_error_name__doc__[] = "validate_error_name(name)\n\n" "Raise ValueError if the given string is not a valid error name.\n" "\n"":Since: 0.80\n" | |||
114 | "\n"static const char validate_error_name__doc__[] = "validate_error_name(name)\n\n" "Raise ValueError if the given string is not a valid error name.\n" "\n"":Since: 0.80\n" | |||
115 | ":Since: 0.80\n"static const char validate_error_name__doc__[] = "validate_error_name(name)\n\n" "Raise ValueError if the given string is not a valid error name.\n" "\n"":Since: 0.80\n" | |||
116 | )static const char validate_error_name__doc__[] = "validate_error_name(name)\n\n" "Raise ValueError if the given string is not a valid error name.\n" "\n"":Since: 0.80\n"; | |||
117 | ||||
118 | static PyObject * | |||
119 | validate_interface_name(PyObject *unused UNUSED__attribute__((__unused__)), PyObject *args) | |||
120 | { | |||
121 | const char *name; | |||
122 | ||||
123 | if (!PyArg_ParseTuple_PyArg_ParseTuple_SizeT(args, "s:validate_interface_name", &name)) { | |||
124 | return NULL((void*)0); | |||
125 | } | |||
126 | if (!dbus_py_validate_interface_name(name)) { | |||
127 | return NULL((void*)0); | |||
128 | } | |||
129 | Py_RETURN_NONEreturn _Py_INCREF(((PyObject*)((&_Py_NoneStruct)))), (& _Py_NoneStruct); | |||
130 | } | |||
131 | ||||
132 | PyDoc_STRVAR(validate_object_path__doc__,static const char validate_object_path__doc__[] = "validate_object_path(name)\n\n" "Raise ValueError if the given string is not a valid object path.\n" "\n"":Since: 0.80\n" | |||
133 | "validate_object_path(name)\n\n"static const char validate_object_path__doc__[] = "validate_object_path(name)\n\n" "Raise ValueError if the given string is not a valid object path.\n" "\n"":Since: 0.80\n" | |||
134 | "Raise ValueError if the given string is not a valid object path.\n"static const char validate_object_path__doc__[] = "validate_object_path(name)\n\n" "Raise ValueError if the given string is not a valid object path.\n" "\n"":Since: 0.80\n" | |||
135 | "\n"static const char validate_object_path__doc__[] = "validate_object_path(name)\n\n" "Raise ValueError if the given string is not a valid object path.\n" "\n"":Since: 0.80\n" | |||
136 | ":Since: 0.80\n"static const char validate_object_path__doc__[] = "validate_object_path(name)\n\n" "Raise ValueError if the given string is not a valid object path.\n" "\n"":Since: 0.80\n" | |||
137 | )static const char validate_object_path__doc__[] = "validate_object_path(name)\n\n" "Raise ValueError if the given string is not a valid object path.\n" "\n"":Since: 0.80\n"; | |||
138 | ||||
139 | static PyObject * | |||
140 | validate_object_path(PyObject *unused UNUSED__attribute__((__unused__)), PyObject *args) | |||
141 | { | |||
142 | const char *name; | |||
143 | ||||
144 | if (!PyArg_ParseTuple_PyArg_ParseTuple_SizeT(args, "s:validate_object_path", &name)) { | |||
145 | return NULL((void*)0); | |||
146 | } | |||
147 | if (!dbus_py_validate_object_path(name)) { | |||
148 | return NULL((void*)0); | |||
149 | } | |||
150 | Py_RETURN_NONEreturn _Py_INCREF(((PyObject*)((&_Py_NoneStruct)))), (& _Py_NoneStruct); | |||
151 | } | |||
152 | ||||
153 | /* Global functions - main loop =====================================*/ | |||
154 | ||||
155 | /* The main loop if none is passed to the constructor */ | |||
156 | static PyObject *default_main_loop = NULL((void*)0); | |||
157 | ||||
158 | /* Return a new reference to the default main loop */ | |||
159 | PyObject * | |||
160 | dbus_py_get_default_main_loop(void) | |||
161 | { | |||
162 | if (!default_main_loop) { | |||
163 | Py_RETURN_NONEreturn _Py_INCREF(((PyObject*)((&_Py_NoneStruct)))), (& _Py_NoneStruct); | |||
164 | } | |||
165 | Py_INCREF(default_main_loop)_Py_INCREF(((PyObject*)(default_main_loop))); | |||
166 | return default_main_loop; | |||
167 | } | |||
168 | ||||
169 | PyDoc_STRVAR(get_default_main_loop__doc__,static const char get_default_main_loop__doc__[] = "get_default_main_loop() -> object\n\n" "Return the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, there is no default and you should always pass the mainloop\n" "parameter to the constructor - if you don't, then asynchronous calls,\n" "connecting to signals and exporting objects will raise an exception.\n" "There is no default until set_default_main_loop is called.\n" | |||
170 | "get_default_main_loop() -> object\n\n"static const char get_default_main_loop__doc__[] = "get_default_main_loop() -> object\n\n" "Return the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, there is no default and you should always pass the mainloop\n" "parameter to the constructor - if you don't, then asynchronous calls,\n" "connecting to signals and exporting objects will raise an exception.\n" "There is no default until set_default_main_loop is called.\n" | |||
171 | "Return the global default dbus-python main loop wrapper, which is used\n"static const char get_default_main_loop__doc__[] = "get_default_main_loop() -> object\n\n" "Return the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, there is no default and you should always pass the mainloop\n" "parameter to the constructor - if you don't, then asynchronous calls,\n" "connecting to signals and exporting objects will raise an exception.\n" "There is no default until set_default_main_loop is called.\n" | |||
172 | "when no main loop wrapper is passed to the Connection constructor.\n"static const char get_default_main_loop__doc__[] = "get_default_main_loop() -> object\n\n" "Return the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, there is no default and you should always pass the mainloop\n" "parameter to the constructor - if you don't, then asynchronous calls,\n" "connecting to signals and exporting objects will raise an exception.\n" "There is no default until set_default_main_loop is called.\n" | |||
173 | "\n"static const char get_default_main_loop__doc__[] = "get_default_main_loop() -> object\n\n" "Return the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, there is no default and you should always pass the mainloop\n" "parameter to the constructor - if you don't, then asynchronous calls,\n" "connecting to signals and exporting objects will raise an exception.\n" "There is no default until set_default_main_loop is called.\n" | |||
174 | "If None, there is no default and you should always pass the mainloop\n"static const char get_default_main_loop__doc__[] = "get_default_main_loop() -> object\n\n" "Return the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, there is no default and you should always pass the mainloop\n" "parameter to the constructor - if you don't, then asynchronous calls,\n" "connecting to signals and exporting objects will raise an exception.\n" "There is no default until set_default_main_loop is called.\n" | |||
175 | "parameter to the constructor - if you don't, then asynchronous calls,\n"static const char get_default_main_loop__doc__[] = "get_default_main_loop() -> object\n\n" "Return the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, there is no default and you should always pass the mainloop\n" "parameter to the constructor - if you don't, then asynchronous calls,\n" "connecting to signals and exporting objects will raise an exception.\n" "There is no default until set_default_main_loop is called.\n" | |||
176 | "connecting to signals and exporting objects will raise an exception.\n"static const char get_default_main_loop__doc__[] = "get_default_main_loop() -> object\n\n" "Return the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, there is no default and you should always pass the mainloop\n" "parameter to the constructor - if you don't, then asynchronous calls,\n" "connecting to signals and exporting objects will raise an exception.\n" "There is no default until set_default_main_loop is called.\n" | |||
177 | "There is no default until set_default_main_loop is called.\n")static const char get_default_main_loop__doc__[] = "get_default_main_loop() -> object\n\n" "Return the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, there is no default and you should always pass the mainloop\n" "parameter to the constructor - if you don't, then asynchronous calls,\n" "connecting to signals and exporting objects will raise an exception.\n" "There is no default until set_default_main_loop is called.\n"; | |||
178 | static PyObject * | |||
179 | get_default_main_loop(PyObject *always_null UNUSED__attribute__((__unused__)), | |||
180 | PyObject *no_args UNUSED__attribute__((__unused__))) | |||
181 | { | |||
182 | return dbus_py_get_default_main_loop(); | |||
183 | } | |||
184 | ||||
185 | PyDoc_STRVAR(set_default_main_loop__doc__,static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n" | |||
186 | "set_default_main_loop(object)\n\n"static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n" | |||
187 | "Change the global default dbus-python main loop wrapper, which is used\n"static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n" | |||
188 | "when no main loop wrapper is passed to the Connection constructor.\n"static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n" | |||
189 | "\n"static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n" | |||
190 | "If None, return to the initial situation: there is no default, and you\n"static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n" | |||
191 | "must always pass the mainloop parameter to the constructor.\n"static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n" | |||
192 | "\n"static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n" | |||
193 | "Two types of main loop wrapper are planned in dbus-python.\n"static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n" | |||
194 | "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n"static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n" | |||
195 | "supplied by extension modules like `dbus.mainloop.glib`: they have no\n"static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n" | |||
196 | "Python API, but connect themselves to ``libdbus`` using native code.\n"static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n" | |||
197 | ||||
198 | "Python main-loop wrappers are not yet implemented. They will be objects\n"static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n" | |||
199 | "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n"static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n" | |||
200 | "API entirely based on Python methods.\n"static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n" | |||
201 | "\n"static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n" | |||
202 | )static const char set_default_main_loop__doc__[] = "set_default_main_loop(object)\n\n" "Change the global default dbus-python main loop wrapper, which is used\n" "when no main loop wrapper is passed to the Connection constructor.\n" "\n""If None, return to the initial situation: there is no default, and you\n" "must always pass the mainloop parameter to the constructor.\n" "\n""Two types of main loop wrapper are planned in dbus-python.\n" "Native main-loop wrappers are instances of `dbus.mainloop.NativeMainLoop`\n" "supplied by extension modules like `dbus.mainloop.glib`: they have no\n" "Python API, but connect themselves to ``libdbus`` using native code.\n" "Python main-loop wrappers are not yet implemented. They will be objects\n" "supporting the interface defined by `dbus.mainloop.MainLoop`, with an\n" "API entirely based on Python methods.\n""\n"; | |||
203 | static PyObject * | |||
204 | set_default_main_loop(PyObject *always_null UNUSED__attribute__((__unused__)), | |||
205 | PyObject *args) | |||
206 | { | |||
207 | PyObject *new_loop, *old_loop; | |||
208 | ||||
209 | if (!PyArg_ParseTuple_PyArg_ParseTuple_SizeT(args, "O", &new_loop)) { | |||
210 | return NULL((void*)0); | |||
211 | } | |||
212 | if (!dbus_py_check_mainloop_sanity(new_loop)) { | |||
213 | return NULL((void*)0); | |||
214 | } | |||
215 | old_loop = default_main_loop; | |||
216 | Py_INCREF(new_loop)_Py_INCREF(((PyObject*)(new_loop))); | |||
217 | default_main_loop = new_loop; | |||
218 | Py_CLEAR(old_loop)do { PyObject *_py_tmp = ((PyObject*)(old_loop)); if (_py_tmp != ((void*)0)) { (old_loop) = ((void*)0); _Py_DECREF(((PyObject *)(_py_tmp))); } } while (0); | |||
219 | Py_RETURN_NONEreturn _Py_INCREF(((PyObject*)((&_Py_NoneStruct)))), (& _Py_NoneStruct); | |||
220 | } | |||
221 | ||||
222 | static PyMethodDef module_functions[] = { | |||
223 | #define ENTRY(name,flags) {#name, (PyCFunction) (void (*)(void))name, flags, name##__doc__} | |||
224 | ENTRY(validate_interface_name, METH_VARARGS0x0001), | |||
225 | ENTRY(validate_member_name, METH_VARARGS0x0001), | |||
226 | ENTRY(validate_bus_name, METH_VARARGS0x0001|METH_KEYWORDS0x0002), | |||
227 | ENTRY(validate_object_path, METH_VARARGS0x0001), | |||
228 | ENTRY(set_default_main_loop, METH_VARARGS0x0001), | |||
229 | ENTRY(get_default_main_loop, METH_NOARGS0x0004), | |||
230 | /* validate_error_name is just implemented as validate_interface_name */ | |||
231 | {"validate_error_name", validate_interface_name, | |||
232 | METH_VARARGS0x0001, validate_error_name__doc__}, | |||
233 | #undef ENTRY | |||
234 | {NULL((void*)0), NULL((void*)0), 0, NULL((void*)0)} | |||
235 | }; | |||
236 | ||||
237 | PyMODINIT_FUNCPyObject* | |||
238 | PyInit__dbus_bindings(void) | |||
239 | { | |||
240 | PyObject *this_module = NULL((void*)0), *c_api; | |||
241 | static const int API_count = DBUS_BINDINGS_API_COUNT3; | |||
242 | static _dbus_py_func_ptr dbus_bindings_API[DBUS_BINDINGS_API_COUNT3]; | |||
243 | ||||
244 | static struct PyModuleDef moduledef = { | |||
245 | PyModuleDef_HEAD_INIT{ { 1, ((void*)0) }, ((void*)0), 0, ((void*)0), }, | |||
246 | "_dbus_bindings", /* m_name */ | |||
247 | module_doc, /* m_doc */ | |||
248 | -1, /* m_size */ | |||
249 | module_functions, /* m_methods */ | |||
250 | NULL((void*)0), /* m_reload */ | |||
251 | NULL((void*)0), /* m_traverse */ | |||
252 | NULL((void*)0), /* m_clear */ | |||
253 | NULL((void*)0) /* m_free */ | |||
254 | }; | |||
255 | ||||
256 | dbus_bindings_API[0] = (_dbus_py_func_ptr)&API_count; | |||
257 | dbus_bindings_API[1] = (_dbus_py_func_ptr)DBusPyConnection_BorrowDBusConnection; | |||
258 | dbus_bindings_API[2] = (_dbus_py_func_ptr)DBusPyNativeMainLoop_New4; | |||
259 | ||||
260 | default_main_loop = NULL((void*)0); | |||
261 | ||||
262 | if (!dbus_py_init_generic()) goto init_error; | |||
| ||||
263 | if (!dbus_py_init_abstract()) goto init_error; | |||
264 | if (!dbus_py_init_signature()) goto init_error; | |||
265 | if (!dbus_py_init_int_types()) goto init_error; | |||
266 | if (!dbus_py_init_unixfd_type()) goto init_error; | |||
267 | if (!dbus_py_init_string_types()) goto init_error; | |||
268 | if (!dbus_py_init_float_types()) goto init_error; | |||
269 | if (!dbus_py_init_container_types()) goto init_error; | |||
270 | if (!dbus_py_init_byte_types()) goto init_error; | |||
271 | if (!dbus_py_init_message_types()) goto init_error; | |||
272 | if (!dbus_py_init_pending_call()) goto init_error; | |||
273 | if (!dbus_py_init_mainloop()) goto init_error; | |||
274 | if (!dbus_py_init_libdbus_conn_types()) goto init_error; | |||
275 | if (!dbus_py_init_conn_types()) goto init_error; | |||
276 | if (!dbus_py_init_server_types()) goto init_error; | |||
277 | ||||
278 | this_module = PyModule_Create(&moduledef)PyModule_Create2(&moduledef, 1013); | |||
279 | if (!this_module) goto init_error; | |||
280 | ||||
281 | if (!dbus_py_insert_abstract_types(this_module)) goto init_error; | |||
282 | if (!dbus_py_insert_signature(this_module)) goto init_error; | |||
283 | if (!dbus_py_insert_int_types(this_module)) goto init_error; | |||
284 | if (!dbus_py_insert_unixfd_type(this_module)) goto init_error; | |||
285 | if (!dbus_py_insert_string_types(this_module)) goto init_error; | |||
286 | if (!dbus_py_insert_float_types(this_module)) goto init_error; | |||
287 | if (!dbus_py_insert_container_types(this_module)) goto init_error; | |||
288 | if (!dbus_py_insert_byte_types(this_module)) goto init_error; | |||
289 | if (!dbus_py_insert_message_types(this_module)) goto init_error; | |||
290 | if (!dbus_py_insert_pending_call(this_module)) goto init_error; | |||
291 | if (!dbus_py_insert_mainloop_types(this_module)) goto init_error; | |||
292 | if (!dbus_py_insert_libdbus_conn_types(this_module)) goto init_error; | |||
293 | if (!dbus_py_insert_conn_types(this_module)) goto init_error; | |||
294 | if (!dbus_py_insert_server_types(this_module)) goto init_error; | |||
295 | ||||
296 | if (PyModule_AddStringConstant(this_module, "BUS_DAEMON_NAME", | |||
297 | DBUS_SERVICE_DBUS"org.freedesktop.DBus") < 0) goto init_error; | |||
298 | if (PyModule_AddStringConstant(this_module, "BUS_DAEMON_PATH", | |||
299 | DBUS_PATH_DBUS"/org/freedesktop/DBus") < 0) goto init_error; | |||
300 | if (PyModule_AddStringConstant(this_module, "BUS_DAEMON_IFACE", | |||
301 | DBUS_INTERFACE_DBUS"org.freedesktop.DBus") < 0) goto init_error; | |||
302 | if (PyModule_AddStringConstant(this_module, "LOCAL_PATH", | |||
303 | DBUS_PATH_LOCAL"/org/freedesktop/DBus/Local") < 0) goto init_error; | |||
304 | if (PyModule_AddStringConstant(this_module, "LOCAL_IFACE", | |||
305 | DBUS_INTERFACE_LOCAL"org.freedesktop.DBus.Local") < 0) goto init_error; | |||
306 | if (PyModule_AddStringConstant(this_module, "INTROSPECTABLE_IFACE", | |||
307 | DBUS_INTERFACE_INTROSPECTABLE"org.freedesktop.DBus.Introspectable") < 0) | |||
308 | goto init_error; | |||
309 | if (PyModule_AddStringConstant(this_module, "PEER_IFACE", | |||
310 | DBUS_INTERFACE_PEER"org.freedesktop.DBus.Peer") < 0) goto init_error; | |||
311 | if (PyModule_AddStringConstant(this_module, "PROPERTIES_IFACE", | |||
312 | DBUS_INTERFACE_PROPERTIES"org.freedesktop.DBus.Properties") < 0) | |||
313 | goto init_error; | |||
314 | if (PyModule_AddStringConstant(this_module, | |||
315 | "DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER", | |||
316 | DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN") < 0) | |||
317 | goto init_error; | |||
318 | if (PyModule_AddStringConstant(this_module, | |||
319 | "DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER", | |||
320 | DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd") < 0) | |||
321 | goto init_error; | |||
322 | if (PyModule_AddStringConstant(this_module, | |||
323 | "DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE", | |||
324 | DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE"<!DOCTYPE node PUBLIC \"" "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "\"\n\"" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd" "\">\n") < 0) | |||
325 | goto init_error; | |||
326 | ||||
327 | #define ADD_CONST_VAL(x, v)if (PyModule_AddIntConstant(this_module, x, v) < 0) goto init_error ; \ | |||
328 | if (PyModule_AddIntConstant(this_module, x, v) < 0) goto init_error; | |||
329 | #define ADD_CONST_PREFIXED(x)if (PyModule_AddIntConstant(this_module, "x", DBUS_x) < 0) goto init_error; ADD_CONST_VAL(#x, DBUS_##x)if (PyModule_AddIntConstant(this_module, #x, DBUS_##x) < 0 ) goto init_error; | |||
330 | #define ADD_CONST(x)if (PyModule_AddIntConstant(this_module, "x", x) < 0) goto init_error; ADD_CONST_VAL(#x, x)if (PyModule_AddIntConstant(this_module, #x, x) < 0) goto init_error ; | |||
331 | ||||
332 | ADD_CONST(DBUS_START_REPLY_SUCCESS)if (PyModule_AddIntConstant(this_module, "DBUS_START_REPLY_SUCCESS" , 1) < 0) goto init_error; | |||
333 | ADD_CONST(DBUS_START_REPLY_ALREADY_RUNNING)if (PyModule_AddIntConstant(this_module, "DBUS_START_REPLY_ALREADY_RUNNING" , 2) < 0) goto init_error; | |||
334 | ||||
335 | ADD_CONST_PREFIXED(RELEASE_NAME_REPLY_RELEASED)if (PyModule_AddIntConstant(this_module, "RELEASE_NAME_REPLY_RELEASED" , 1) < 0) goto init_error; | |||
336 | ADD_CONST_PREFIXED(RELEASE_NAME_REPLY_NON_EXISTENT)if (PyModule_AddIntConstant(this_module, "RELEASE_NAME_REPLY_NON_EXISTENT" , 2) < 0) goto init_error; | |||
337 | ADD_CONST_PREFIXED(RELEASE_NAME_REPLY_NOT_OWNER)if (PyModule_AddIntConstant(this_module, "RELEASE_NAME_REPLY_NOT_OWNER" , 3) < 0) goto init_error; | |||
338 | ||||
339 | ADD_CONST_PREFIXED(REQUEST_NAME_REPLY_PRIMARY_OWNER)if (PyModule_AddIntConstant(this_module, "REQUEST_NAME_REPLY_PRIMARY_OWNER" , 1) < 0) goto init_error; | |||
340 | ADD_CONST_PREFIXED(REQUEST_NAME_REPLY_IN_QUEUE)if (PyModule_AddIntConstant(this_module, "REQUEST_NAME_REPLY_IN_QUEUE" , 2) < 0) goto init_error; | |||
341 | ADD_CONST_PREFIXED(REQUEST_NAME_REPLY_EXISTS)if (PyModule_AddIntConstant(this_module, "REQUEST_NAME_REPLY_EXISTS" , 3) < 0) goto init_error; | |||
342 | ADD_CONST_PREFIXED(REQUEST_NAME_REPLY_ALREADY_OWNER)if (PyModule_AddIntConstant(this_module, "REQUEST_NAME_REPLY_ALREADY_OWNER" , 4) < 0) goto init_error; | |||
343 | ||||
344 | ADD_CONST_PREFIXED(NAME_FLAG_ALLOW_REPLACEMENT)if (PyModule_AddIntConstant(this_module, "NAME_FLAG_ALLOW_REPLACEMENT" , 0x1) < 0) goto init_error; | |||
345 | ADD_CONST_PREFIXED(NAME_FLAG_REPLACE_EXISTING)if (PyModule_AddIntConstant(this_module, "NAME_FLAG_REPLACE_EXISTING" , 0x2) < 0) goto init_error; | |||
346 | ADD_CONST_PREFIXED(NAME_FLAG_DO_NOT_QUEUE)if (PyModule_AddIntConstant(this_module, "NAME_FLAG_DO_NOT_QUEUE" , 0x4) < 0) goto init_error; | |||
347 | ||||
348 | ADD_CONST_PREFIXED(BUS_SESSION)if (PyModule_AddIntConstant(this_module, "BUS_SESSION", DBUS_BUS_SESSION ) < 0) goto init_error; | |||
349 | ADD_CONST_PREFIXED(BUS_SYSTEM)if (PyModule_AddIntConstant(this_module, "BUS_SYSTEM", DBUS_BUS_SYSTEM ) < 0) goto init_error; | |||
350 | ADD_CONST_PREFIXED(BUS_STARTER)if (PyModule_AddIntConstant(this_module, "BUS_STARTER", DBUS_BUS_STARTER ) < 0) goto init_error; | |||
351 | ||||
352 | ADD_CONST_PREFIXED(MESSAGE_TYPE_INVALID)if (PyModule_AddIntConstant(this_module, "MESSAGE_TYPE_INVALID" , 0) < 0) goto init_error; | |||
353 | ADD_CONST_PREFIXED(MESSAGE_TYPE_METHOD_CALL)if (PyModule_AddIntConstant(this_module, "MESSAGE_TYPE_METHOD_CALL" , 1) < 0) goto init_error; | |||
354 | ADD_CONST_PREFIXED(MESSAGE_TYPE_METHOD_RETURN)if (PyModule_AddIntConstant(this_module, "MESSAGE_TYPE_METHOD_RETURN" , 2) < 0) goto init_error; | |||
355 | ADD_CONST_PREFIXED(MESSAGE_TYPE_ERROR)if (PyModule_AddIntConstant(this_module, "MESSAGE_TYPE_ERROR" , 3) < 0) goto init_error; | |||
356 | ADD_CONST_PREFIXED(MESSAGE_TYPE_SIGNAL)if (PyModule_AddIntConstant(this_module, "MESSAGE_TYPE_SIGNAL" , 4) < 0) goto init_error; | |||
357 | ||||
358 | ADD_CONST_PREFIXED(TYPE_INVALID)if (PyModule_AddIntConstant(this_module, "TYPE_INVALID", ((int ) '\0')) < 0) goto init_error; | |||
359 | ADD_CONST_PREFIXED(TYPE_BYTE)if (PyModule_AddIntConstant(this_module, "TYPE_BYTE", ((int) 'y' )) < 0) goto init_error; | |||
360 | ADD_CONST_PREFIXED(TYPE_BOOLEAN)if (PyModule_AddIntConstant(this_module, "TYPE_BOOLEAN", ((int ) 'b')) < 0) goto init_error; | |||
361 | ADD_CONST_PREFIXED(TYPE_INT16)if (PyModule_AddIntConstant(this_module, "TYPE_INT16", ((int) 'n')) < 0) goto init_error; | |||
362 | ADD_CONST_PREFIXED(TYPE_UINT16)if (PyModule_AddIntConstant(this_module, "TYPE_UINT16", ((int ) 'q')) < 0) goto init_error; | |||
363 | ADD_CONST_PREFIXED(TYPE_INT32)if (PyModule_AddIntConstant(this_module, "TYPE_INT32", ((int) 'i')) < 0) goto init_error; | |||
364 | #ifdef DBUS_TYPE_UNIX_FD((int) 'h') | |||
365 | ADD_CONST_PREFIXED(TYPE_UNIX_FD)if (PyModule_AddIntConstant(this_module, "TYPE_UNIX_FD", ((int ) 'h')) < 0) goto init_error; | |||
366 | #endif | |||
367 | ADD_CONST_PREFIXED(TYPE_UINT32)if (PyModule_AddIntConstant(this_module, "TYPE_UINT32", ((int ) 'u')) < 0) goto init_error; | |||
368 | ADD_CONST_PREFIXED(TYPE_INT64)if (PyModule_AddIntConstant(this_module, "TYPE_INT64", ((int) 'x')) < 0) goto init_error; | |||
369 | ADD_CONST_PREFIXED(TYPE_UINT64)if (PyModule_AddIntConstant(this_module, "TYPE_UINT64", ((int ) 't')) < 0) goto init_error; | |||
370 | ADD_CONST_PREFIXED(TYPE_DOUBLE)if (PyModule_AddIntConstant(this_module, "TYPE_DOUBLE", ((int ) 'd')) < 0) goto init_error; | |||
371 | ADD_CONST_PREFIXED(TYPE_STRING)if (PyModule_AddIntConstant(this_module, "TYPE_STRING", ((int ) 's')) < 0) goto init_error; | |||
372 | ADD_CONST_PREFIXED(TYPE_OBJECT_PATH)if (PyModule_AddIntConstant(this_module, "TYPE_OBJECT_PATH", ( (int) 'o')) < 0) goto init_error; | |||
373 | ADD_CONST_PREFIXED(TYPE_SIGNATURE)if (PyModule_AddIntConstant(this_module, "TYPE_SIGNATURE", (( int) 'g')) < 0) goto init_error; | |||
374 | ADD_CONST_PREFIXED(TYPE_ARRAY)if (PyModule_AddIntConstant(this_module, "TYPE_ARRAY", ((int) 'a')) < 0) goto init_error; | |||
375 | ADD_CONST_PREFIXED(TYPE_STRUCT)if (PyModule_AddIntConstant(this_module, "TYPE_STRUCT", ((int ) 'r')) < 0) goto init_error; | |||
376 | ADD_CONST_VAL("STRUCT_BEGIN", DBUS_STRUCT_BEGIN_CHAR)if (PyModule_AddIntConstant(this_module, "STRUCT_BEGIN", ((int ) '(')) < 0) goto init_error; | |||
377 | ADD_CONST_VAL("STRUCT_END", DBUS_STRUCT_END_CHAR)if (PyModule_AddIntConstant(this_module, "STRUCT_END", ((int) ')')) < 0) goto init_error; | |||
378 | ADD_CONST_PREFIXED(TYPE_VARIANT)if (PyModule_AddIntConstant(this_module, "TYPE_VARIANT", ((int ) 'v')) < 0) goto init_error; | |||
379 | ADD_CONST_PREFIXED(TYPE_DICT_ENTRY)if (PyModule_AddIntConstant(this_module, "TYPE_DICT_ENTRY", ( (int) 'e')) < 0) goto init_error; | |||
380 | ADD_CONST_VAL("DICT_ENTRY_BEGIN", DBUS_DICT_ENTRY_BEGIN_CHAR)if (PyModule_AddIntConstant(this_module, "DICT_ENTRY_BEGIN", ( (int) '{')) < 0) goto init_error; | |||
381 | ADD_CONST_VAL("DICT_ENTRY_END", DBUS_DICT_ENTRY_END_CHAR)if (PyModule_AddIntConstant(this_module, "DICT_ENTRY_END", (( int) '}')) < 0) goto init_error; | |||
382 | ||||
383 | ADD_CONST_PREFIXED(HANDLER_RESULT_HANDLED)if (PyModule_AddIntConstant(this_module, "HANDLER_RESULT_HANDLED" , DBUS_HANDLER_RESULT_HANDLED) < 0) goto init_error; | |||
384 | ADD_CONST_PREFIXED(HANDLER_RESULT_NOT_YET_HANDLED)if (PyModule_AddIntConstant(this_module, "HANDLER_RESULT_NOT_YET_HANDLED" , DBUS_HANDLER_RESULT_NOT_YET_HANDLED) < 0) goto init_error ; | |||
385 | ADD_CONST_PREFIXED(HANDLER_RESULT_NEED_MEMORY)if (PyModule_AddIntConstant(this_module, "HANDLER_RESULT_NEED_MEMORY" , DBUS_HANDLER_RESULT_NEED_MEMORY) < 0) goto init_error; | |||
386 | ||||
387 | ADD_CONST_PREFIXED(WATCH_READABLE)if (PyModule_AddIntConstant(this_module, "WATCH_READABLE", DBUS_WATCH_READABLE ) < 0) goto init_error; | |||
388 | ADD_CONST_PREFIXED(WATCH_WRITABLE)if (PyModule_AddIntConstant(this_module, "WATCH_WRITABLE", DBUS_WATCH_WRITABLE ) < 0) goto init_error; | |||
389 | ADD_CONST_PREFIXED(WATCH_HANGUP)if (PyModule_AddIntConstant(this_module, "WATCH_HANGUP", DBUS_WATCH_HANGUP ) < 0) goto init_error; | |||
390 | ADD_CONST_PREFIXED(WATCH_ERROR)if (PyModule_AddIntConstant(this_module, "WATCH_ERROR", DBUS_WATCH_ERROR ) < 0) goto init_error; | |||
391 | ||||
392 | if (PyModule_AddStringConstant(this_module, "__docformat__", | |||
393 | "restructuredtext") < 0) goto init_error; | |||
394 | ||||
395 | if (PyModule_AddStringConstant(this_module, "__version__", | |||
396 | PACKAGE_VERSION"1.2.18") < 0) goto init_error; | |||
397 | ||||
398 | if (PyModule_AddIntConstant(this_module, "_python_version", | |||
399 | PY_VERSION_HEX((3 << 24) | (8 << 16) | (5 << 8) | (0xF << 4) | (0 << 0))) < 0) goto init_error; | |||
400 | ||||
401 | c_api = PyCapsule_New((void *)dbus_bindings_API, | |||
| ||||
402 | PYDBUS_CAPSULE_NAME"_dbus_bindings._C_API", NULL((void*)0)); | |||
403 | if (!c_api) { | |||
404 | goto init_error; | |||
405 | } | |||
406 | PyModule_AddObject(this_module, "_C_API", c_api); | |||
407 | ||||
408 | return this_module; | |||
409 | init_error: | |||
410 | Py_CLEAR(this_module)do { PyObject *_py_tmp = ((PyObject*)(this_module)); if (_py_tmp != ((void*)0)) { (this_module) = ((void*)0); _Py_DECREF(((PyObject *)(_py_tmp))); } } while (0); | |||
411 | return NULL((void*)0); | |||
412 | } | |||
413 | ||||
414 | /* vim:set ft=c cino< sw=4 sts=4 et: */ |
1 | #ifndef PyCapsule_New |
2 | struct _object; |
3 | typedef struct _object PyObject; |
4 | PyObject* clang_analyzer_PyObject_New_Reference(); |
5 | PyObject* PyCapsule_New(void *pointer, const char *name, PyCapsule_Destructor destructor) { |
6 | return clang_analyzer_PyObject_New_Reference(); |
7 | } |
8 | #else |
9 | #warning "API PyCapsule_New is defined as a macro." |
10 | #endif |