Bug Summary

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

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name module.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -analyzer-output=html -analyzer-checker=python -analyzer-disable-checker=deadcode -analyzer-config prune-paths=true,suppress-c++-stdlib=true,suppress-inlined-defensive-checks=false,suppress-null-return-paths=false,crosscheck-with-z3=true,model-path=/opt/pyrefcon/lib/pyrefcon/models/models -analyzer-config experimental-enable-naive-ctu-analysis=true,ctu-dir=/tmp/pyrefcon/dbus-python/csa-scan,ctu-index-name=/tmp/pyrefcon/dbus-python/csa-scan/externalDefMap.txt,ctu-invocation-list=/tmp/pyrefcon/dbus-python/csa-scan/invocations.yaml,display-ctu-progress=false -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=none -relaxed-aliasing -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -debug-info-kind=limited -dwarf-version=4 -debugger-tuning=gdb -fcoverage-compilation-dir=/tmp/pyrefcon/dbus-python/build/temp.linux-x86_64-3.8 -resource-dir /opt/pyrefcon/lib/clang/13.0.0 -include config.h -isystem /opt/pyrefcon/lib/pyrefcon/models/python3.8 -D HAVE_CONFIG_H -I . -I /tmp/pyrefcon/dbus-python -I /tmp/pyrefcon/dbus-python/include -I /usr/include/dbus-1.0 -I /usr/lib/x86_64-linux-gnu/dbus-1.0/include -I /usr/include/glib-2.0 -I /usr/lib/x86_64-linux-gnu/glib-2.0/include -D PIC -internal-isystem /opt/pyrefcon/lib/clang/13.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wdeprecated-declarations -Wno-declaration-after-statement -Wno-duplicated-branches -Wno-inline -Wno-redundant-decls -Wno-switch-default -Wno-write-strings -Wnested-externs -Wmissing-prototypes -Wstrict-prototypes -Wimplicit-function-declaration -Wold-style-definition -Wjump-misses-init -Wall -Wextra -Wundef -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Wno-missing-field-initializers -Wformat=2 -Wcast-align -Wformat-nonliteral -Wformat-security -Wsign-compare -Wstrict-aliasing -Wshadow -Wpacked -Wmissing-format-attribute -Wmissing-noreturn -Winit-self -Wmissing-include-dirs -Wunused-but-set-variable -Warray-bounds -Wreturn-type -Wswitch-enum -Wduplicated-cond -Wlogical-op -Wrestrict -Wnull-dereference -Wdouble-promotion -Wno-error=declaration-after-statement -Wno-error=duplicated-branches -Wno-error=inline -Wno-error=redundant-decls -Wno-error=switch-default -Wno-error=write-strings -Wno-error=unused-parameter -Wno-error=missing-field-initializers -fdebug-compilation-dir=/tmp/pyrefcon/dbus-python/build/temp.linux-x86_64-3.8 -ferror-limit 19 -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/pyrefcon/dbus-python/csa-scan/reports -x c ../../dbus_bindings/module.c

../../dbus_bindings/module.c

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
33PyDoc_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
42PyDoc_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
60static PyObject *
61validate_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
81PyDoc_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
90static PyObject *
91validate_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
104PyDoc_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
111PyDoc_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
118static PyObject *
119validate_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
132PyDoc_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
139static PyObject *
140validate_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 */
156static PyObject *default_main_loop = NULL((void*)0);
157
158/* Return a new reference to the default main loop */
159PyObject *
160dbus_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
169PyDoc_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"
;
178static PyObject *
179get_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
185PyDoc_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"
;
203static PyObject *
204set_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
222static 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
237PyMODINIT_FUNCPyObject*
238PyInit__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;
1
Taking false branch
263 if (!dbus_py_init_abstract()) goto init_error;
2
Taking false branch
264 if (!dbus_py_init_signature()) goto init_error;
3
Taking false branch
265 if (!dbus_py_init_int_types()) goto init_error;
4
Taking false branch
266 if (!dbus_py_init_unixfd_type()) goto init_error;
5
Taking false branch
267 if (!dbus_py_init_string_types()) goto init_error;
6
Taking false branch
268 if (!dbus_py_init_float_types()) goto init_error;
7
Taking false branch
269 if (!dbus_py_init_container_types()) goto init_error;
8
Taking false branch
270 if (!dbus_py_init_byte_types()) goto init_error;
9
Taking false branch
271 if (!dbus_py_init_message_types()) goto init_error;
10
Taking false branch
272 if (!dbus_py_init_pending_call()) goto init_error;
11
Taking false branch
273 if (!dbus_py_init_mainloop()) goto init_error;
12
Taking false branch
274 if (!dbus_py_init_libdbus_conn_types()) goto init_error;
13
Taking false branch
275 if (!dbus_py_init_conn_types()) goto init_error;
14
Taking false branch
276 if (!dbus_py_init_server_types()) goto init_error;
15
Taking false branch
277
278 this_module = PyModule_Create(&moduledef)PyModule_Create2(&moduledef, 1013);
279 if (!this_module) goto init_error;
16
Assuming 'this_module' is non-null
17
Taking false branch
280
281 if (!dbus_py_insert_abstract_types(this_module)) goto init_error;
18
Taking false branch
282 if (!dbus_py_insert_signature(this_module)) goto init_error;
19
Taking false branch
283 if (!dbus_py_insert_int_types(this_module)) goto init_error;
20
Taking false branch
284 if (!dbus_py_insert_unixfd_type(this_module)) goto init_error;
21
Taking false branch
285 if (!dbus_py_insert_string_types(this_module)) goto init_error;
22
Taking false branch
286 if (!dbus_py_insert_float_types(this_module)) goto init_error;
23
Taking false branch
287 if (!dbus_py_insert_container_types(this_module)) goto init_error;
24
Taking false branch
288 if (!dbus_py_insert_byte_types(this_module)) goto init_error;
25
Taking false branch
289 if (!dbus_py_insert_message_types(this_module)) goto init_error;
26
Taking false branch
290 if (!dbus_py_insert_pending_call(this_module)) goto init_error;
27
Taking false branch
291 if (!dbus_py_insert_mainloop_types(this_module)) goto init_error;
28
Taking false branch
292 if (!dbus_py_insert_libdbus_conn_types(this_module)) goto init_error;
29
Taking false branch
293 if (!dbus_py_insert_conn_types(this_module)) goto init_error;
30
Taking false branch
294 if (!dbus_py_insert_server_types(this_module)) goto init_error;
31
Taking false branch
295
296 if (PyModule_AddStringConstant(this_module, "BUS_DAEMON_NAME",
32
Assuming the condition is false
33
Taking false branch
297 DBUS_SERVICE_DBUS"org.freedesktop.DBus") < 0) goto init_error;
298 if (PyModule_AddStringConstant(this_module, "BUS_DAEMON_PATH",
34
Assuming the condition is false
35
Taking false branch
299 DBUS_PATH_DBUS"/org/freedesktop/DBus") < 0) goto init_error;
300 if (PyModule_AddStringConstant(this_module, "BUS_DAEMON_IFACE",
36
Assuming the condition is false
37
Taking false branch
301 DBUS_INTERFACE_DBUS"org.freedesktop.DBus") < 0) goto init_error;
302 if (PyModule_AddStringConstant(this_module, "LOCAL_PATH",
38
Assuming the condition is false
39
Taking false branch
303 DBUS_PATH_LOCAL"/org/freedesktop/DBus/Local") < 0) goto init_error;
304 if (PyModule_AddStringConstant(this_module, "LOCAL_IFACE",
40
Assuming the condition is false
41
Taking false branch
305 DBUS_INTERFACE_LOCAL"org.freedesktop.DBus.Local") < 0) goto init_error;
306 if (PyModule_AddStringConstant(this_module, "INTROSPECTABLE_IFACE",
42
Assuming the condition is false
43
Taking false branch
307 DBUS_INTERFACE_INTROSPECTABLE"org.freedesktop.DBus.Introspectable") < 0)
308 goto init_error;
309 if (PyModule_AddStringConstant(this_module, "PEER_IFACE",
44
Assuming the condition is false
45
Taking false branch
310 DBUS_INTERFACE_PEER"org.freedesktop.DBus.Peer") < 0) goto init_error;
311 if (PyModule_AddStringConstant(this_module, "PROPERTIES_IFACE",
46
Assuming the condition is false
47
Taking false branch
312 DBUS_INTERFACE_PROPERTIES"org.freedesktop.DBus.Properties") < 0)
313 goto init_error;
314 if (PyModule_AddStringConstant(this_module,
48
Assuming the condition is false
49
Taking false branch
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,
50
Assuming the condition is false
51
Taking false branch
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,
52
Assuming the condition is false
53
Taking false branch
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;
54
Assuming the condition is false
55
Taking false branch
333 ADD_CONST(DBUS_START_REPLY_ALREADY_RUNNING)if (PyModule_AddIntConstant(this_module, "DBUS_START_REPLY_ALREADY_RUNNING"
, 2) < 0) goto init_error;
56
Assuming the condition is false
57
Taking false branch
334
335 ADD_CONST_PREFIXED(RELEASE_NAME_REPLY_RELEASED)if (PyModule_AddIntConstant(this_module, "RELEASE_NAME_REPLY_RELEASED"
, 1) < 0) goto init_error;
58
Assuming the condition is false
59
Taking false branch
336 ADD_CONST_PREFIXED(RELEASE_NAME_REPLY_NON_EXISTENT)if (PyModule_AddIntConstant(this_module, "RELEASE_NAME_REPLY_NON_EXISTENT"
, 2) < 0) goto init_error;
60
Assuming the condition is false
61
Taking false branch
337 ADD_CONST_PREFIXED(RELEASE_NAME_REPLY_NOT_OWNER)if (PyModule_AddIntConstant(this_module, "RELEASE_NAME_REPLY_NOT_OWNER"
, 3) < 0) goto init_error;
62
Assuming the condition is false
63
Taking false branch
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;
64
Assuming the condition is false
65
Taking false branch
340 ADD_CONST_PREFIXED(REQUEST_NAME_REPLY_IN_QUEUE)if (PyModule_AddIntConstant(this_module, "REQUEST_NAME_REPLY_IN_QUEUE"
, 2) < 0) goto init_error;
66
Assuming the condition is false
67
Taking false branch
341 ADD_CONST_PREFIXED(REQUEST_NAME_REPLY_EXISTS)if (PyModule_AddIntConstant(this_module, "REQUEST_NAME_REPLY_EXISTS"
, 3) < 0) goto init_error;
68
Assuming the condition is false
69
Taking false branch
342 ADD_CONST_PREFIXED(REQUEST_NAME_REPLY_ALREADY_OWNER)if (PyModule_AddIntConstant(this_module, "REQUEST_NAME_REPLY_ALREADY_OWNER"
, 4) < 0) goto init_error;
70
Assuming the condition is false
71
Taking false branch
343
344 ADD_CONST_PREFIXED(NAME_FLAG_ALLOW_REPLACEMENT)if (PyModule_AddIntConstant(this_module, "NAME_FLAG_ALLOW_REPLACEMENT"
, 0x1) < 0) goto init_error;
72
Assuming the condition is false
73
Taking false branch
345 ADD_CONST_PREFIXED(NAME_FLAG_REPLACE_EXISTING)if (PyModule_AddIntConstant(this_module, "NAME_FLAG_REPLACE_EXISTING"
, 0x2) < 0) goto init_error;
74
Assuming the condition is false
75
Taking false branch
346 ADD_CONST_PREFIXED(NAME_FLAG_DO_NOT_QUEUE)if (PyModule_AddIntConstant(this_module, "NAME_FLAG_DO_NOT_QUEUE"
, 0x4) < 0) goto init_error;
76
Assuming the condition is false
77
Taking false branch
347
348 ADD_CONST_PREFIXED(BUS_SESSION)if (PyModule_AddIntConstant(this_module, "BUS_SESSION", DBUS_BUS_SESSION
) < 0) goto init_error;
78
Assuming the condition is false
79
Taking false branch
349 ADD_CONST_PREFIXED(BUS_SYSTEM)if (PyModule_AddIntConstant(this_module, "BUS_SYSTEM", DBUS_BUS_SYSTEM
) < 0) goto init_error;
80
Assuming the condition is false
81
Taking false branch
350 ADD_CONST_PREFIXED(BUS_STARTER)if (PyModule_AddIntConstant(this_module, "BUS_STARTER", DBUS_BUS_STARTER
) < 0) goto init_error;
82
Assuming the condition is false
83
Taking false branch
351
352 ADD_CONST_PREFIXED(MESSAGE_TYPE_INVALID)if (PyModule_AddIntConstant(this_module, "MESSAGE_TYPE_INVALID"
, 0) < 0) goto init_error;
84
Assuming the condition is false
85
Taking false branch
353 ADD_CONST_PREFIXED(MESSAGE_TYPE_METHOD_CALL)if (PyModule_AddIntConstant(this_module, "MESSAGE_TYPE_METHOD_CALL"
, 1) < 0) goto init_error;
86
Assuming the condition is false
87
Taking false branch
354 ADD_CONST_PREFIXED(MESSAGE_TYPE_METHOD_RETURN)if (PyModule_AddIntConstant(this_module, "MESSAGE_TYPE_METHOD_RETURN"
, 2) < 0) goto init_error;
88
Assuming the condition is false
89
Taking false branch
355 ADD_CONST_PREFIXED(MESSAGE_TYPE_ERROR)if (PyModule_AddIntConstant(this_module, "MESSAGE_TYPE_ERROR"
, 3) < 0) goto init_error;
90
Assuming the condition is false
91
Taking false branch
356 ADD_CONST_PREFIXED(MESSAGE_TYPE_SIGNAL)if (PyModule_AddIntConstant(this_module, "MESSAGE_TYPE_SIGNAL"
, 4) < 0) goto init_error;
92
Assuming the condition is false
93
Taking false branch
357
358 ADD_CONST_PREFIXED(TYPE_INVALID)if (PyModule_AddIntConstant(this_module, "TYPE_INVALID", ((int
) '\0')) < 0) goto init_error;
94
Assuming the condition is false
95
Taking false branch
359 ADD_CONST_PREFIXED(TYPE_BYTE)if (PyModule_AddIntConstant(this_module, "TYPE_BYTE", ((int) 'y'
)) < 0) goto init_error;
96
Assuming the condition is false
97
Taking false branch
360 ADD_CONST_PREFIXED(TYPE_BOOLEAN)if (PyModule_AddIntConstant(this_module, "TYPE_BOOLEAN", ((int
) 'b')) < 0) goto init_error;
98
Assuming the condition is false
99
Taking false branch
361 ADD_CONST_PREFIXED(TYPE_INT16)if (PyModule_AddIntConstant(this_module, "TYPE_INT16", ((int)
'n')) < 0) goto init_error;
100
Assuming the condition is false
101
Taking false branch
362 ADD_CONST_PREFIXED(TYPE_UINT16)if (PyModule_AddIntConstant(this_module, "TYPE_UINT16", ((int
) 'q')) < 0) goto init_error;
102
Assuming the condition is false
103
Taking false branch
363 ADD_CONST_PREFIXED(TYPE_INT32)if (PyModule_AddIntConstant(this_module, "TYPE_INT32", ((int)
'i')) < 0) goto init_error;
104
Assuming the condition is false
105
Taking false branch
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;
106
Assuming the condition is false
107
Taking false branch
366#endif
367 ADD_CONST_PREFIXED(TYPE_UINT32)if (PyModule_AddIntConstant(this_module, "TYPE_UINT32", ((int
) 'u')) < 0) goto init_error;
108
Assuming the condition is false
109
Taking false branch
368 ADD_CONST_PREFIXED(TYPE_INT64)if (PyModule_AddIntConstant(this_module, "TYPE_INT64", ((int)
'x')) < 0) goto init_error;
110
Assuming the condition is false
111
Taking false branch
369 ADD_CONST_PREFIXED(TYPE_UINT64)if (PyModule_AddIntConstant(this_module, "TYPE_UINT64", ((int
) 't')) < 0) goto init_error;
112
Assuming the condition is false
113
Taking false branch
370 ADD_CONST_PREFIXED(TYPE_DOUBLE)if (PyModule_AddIntConstant(this_module, "TYPE_DOUBLE", ((int
) 'd')) < 0) goto init_error;
114
Assuming the condition is false
115
Taking false branch
371 ADD_CONST_PREFIXED(TYPE_STRING)if (PyModule_AddIntConstant(this_module, "TYPE_STRING", ((int
) 's')) < 0) goto init_error;
116
Assuming the condition is false
117
Taking false branch
372 ADD_CONST_PREFIXED(TYPE_OBJECT_PATH)if (PyModule_AddIntConstant(this_module, "TYPE_OBJECT_PATH", (
(int) 'o')) < 0) goto init_error;
118
Assuming the condition is false
119
Taking false branch
373 ADD_CONST_PREFIXED(TYPE_SIGNATURE)if (PyModule_AddIntConstant(this_module, "TYPE_SIGNATURE", ((
int) 'g')) < 0) goto init_error;
120
Assuming the condition is false
121
Taking false branch
374 ADD_CONST_PREFIXED(TYPE_ARRAY)if (PyModule_AddIntConstant(this_module, "TYPE_ARRAY", ((int)
'a')) < 0) goto init_error;
122
Assuming the condition is false
123
Taking false branch
375 ADD_CONST_PREFIXED(TYPE_STRUCT)if (PyModule_AddIntConstant(this_module, "TYPE_STRUCT", ((int
) 'r')) < 0) goto init_error;
124
Assuming the condition is false
125
Taking false branch
376 ADD_CONST_VAL("STRUCT_BEGIN", DBUS_STRUCT_BEGIN_CHAR)if (PyModule_AddIntConstant(this_module, "STRUCT_BEGIN", ((int
) '(')) < 0) goto init_error;
126
Assuming the condition is false
127
Taking false branch
377 ADD_CONST_VAL("STRUCT_END", DBUS_STRUCT_END_CHAR)if (PyModule_AddIntConstant(this_module, "STRUCT_END", ((int)
')')) < 0) goto init_error;
128
Assuming the condition is false
129
Taking false branch
378 ADD_CONST_PREFIXED(TYPE_VARIANT)if (PyModule_AddIntConstant(this_module, "TYPE_VARIANT", ((int
) 'v')) < 0) goto init_error;
130
Assuming the condition is false
131
Taking false branch
379 ADD_CONST_PREFIXED(TYPE_DICT_ENTRY)if (PyModule_AddIntConstant(this_module, "TYPE_DICT_ENTRY", (
(int) 'e')) < 0) goto init_error;
132
Assuming the condition is false
133
Taking false branch
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;
134
Assuming the condition is false
135
Taking false branch
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;
136
Assuming the condition is false
137
Taking false branch
382
383 ADD_CONST_PREFIXED(HANDLER_RESULT_HANDLED)if (PyModule_AddIntConstant(this_module, "HANDLER_RESULT_HANDLED"
, DBUS_HANDLER_RESULT_HANDLED) < 0) goto init_error;
138
Assuming the condition is false
139
Taking false branch
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
;
140
Assuming the condition is false
141
Taking false branch
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;
142
Assuming the condition is false
143
Taking false branch
386
387 ADD_CONST_PREFIXED(WATCH_READABLE)if (PyModule_AddIntConstant(this_module, "WATCH_READABLE", DBUS_WATCH_READABLE
) < 0) goto init_error;
144
Assuming the condition is false
145
Taking false branch
388 ADD_CONST_PREFIXED(WATCH_WRITABLE)if (PyModule_AddIntConstant(this_module, "WATCH_WRITABLE", DBUS_WATCH_WRITABLE
) < 0) goto init_error;
146
Assuming the condition is false
147
Taking false branch
389 ADD_CONST_PREFIXED(WATCH_HANGUP)if (PyModule_AddIntConstant(this_module, "WATCH_HANGUP", DBUS_WATCH_HANGUP
) < 0) goto init_error;
148
Assuming the condition is false
149
Taking false branch
390 ADD_CONST_PREFIXED(WATCH_ERROR)if (PyModule_AddIntConstant(this_module, "WATCH_ERROR", DBUS_WATCH_ERROR
) < 0) goto init_error;
150
Assuming the condition is false
151
Taking false branch
391
392 if (PyModule_AddStringConstant(this_module, "__docformat__",
152
Assuming the condition is false
153
Taking false branch
393 "restructuredtext") < 0) goto init_error;
394
395 if (PyModule_AddStringConstant(this_module, "__version__",
154
Assuming the condition is false
155
Taking false branch
396 PACKAGE_VERSION"1.2.18") < 0) goto init_error;
397
398 if (PyModule_AddIntConstant(this_module, "_python_version",
156
Assuming the condition is false
157
Taking false branch
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,
158
Calling 'PyCapsule_New'
160
Returning from 'PyCapsule_New'
163
PyObject ownership leak with reference count of 1
402 PYDBUS_CAPSULE_NAME"_dbus_bindings._C_API", NULL((void*)0));
403 if (!c_api) {
161
Assuming 'c_api' is non-null
162
Taking false branch
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: */

/opt/pyrefcon/lib/pyrefcon/models/models/PyCapsule_New.model

1#ifndef PyCapsule_New
2struct _object;
3typedef struct _object PyObject;
4PyObject* clang_analyzer_PyObject_New_Reference();
5PyObject* PyCapsule_New(void *pointer, const char *name, PyCapsule_Destructor destructor) {
6 return clang_analyzer_PyObject_New_Reference();
159
Setting reference count to 1
7}
8#else
9#warning "API PyCapsule_New is defined as a macro."
10#endif