1// Copyright (C) 2002, 2003 CodeFactory AB
2// Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc.
3// Copyright (C) 2016 Intel Corporation.
4// SPDX-License-Identifier: AFL-2.1 OR GPL-2.0-or-later
5// Qt-Security score:significant reason:default
6
7#ifndef DBUS_MINIMAL_P_H
8#define DBUS_MINIMAL_P_H
9
10//
11// W A R N I N G
12// -------------
13//
14// This file is not part of the Qt API. It exists for the convenience
15// of other Qt classes. This header file may change from version to
16// version without notice, or even be removed.
17//
18// We mean it.
19//
20
21// These structures are not ours, so ELFVERSION:stop
22
23extern "C" {
24
25// Equivalent to dbus-arch-deps.h (generated from dbus-arch-deps.h.in)
26typedef qint64 dbus_int64_t;
27typedef quint64 dbus_uint64_t;
28typedef qint32 dbus_int32_t;
29typedef quint32 dbus_uint32_t;
30typedef qint16 dbus_int16_t;
31typedef quint16 dbus_uint16_t;
32
33// simulate minimum version we support
34#define DBUS_MAJOR_VERSION 1
35#define DBUS_MINOR_VERSION 2
36#define DBUS_VERSION ((1 << 16) | (2 << 8))
37
38// forward declaration to opaque types we use
39struct DBusConnection;
40struct DBusMessage;
41struct DBusPendingCall;
42struct DBusServer;
43struct DBusTimeout;
44struct DBusWatch;
45
46// This file contains constants and typedefs from libdbus-1 headers,
47// which carry the following copyright:
48/*
49 * Copyright (C) 2002, 2003 CodeFactory AB
50 * Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc.
51 *
52 * Licensed under the Academic Free License version 2.1
53 *
54 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
56 * the Free Software Foundation; either version 2 of the License, or
57 * (at your option) any later version.
58 *
59 * This program is distributed in the hope that it will be useful,
60 * but WITHOUT ANY WARRANTY; without even the implied warranty of
61 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
62 * GNU General Public License for more details.
63 *
64 * You should have received a copy of the GNU General Public License
65 * along with this program; if not, write to the Free Software
66 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
67 *
68 */
69
70/* dbus-types.h */
71typedef dbus_uint32_t dbus_unichar_t;
72typedef dbus_uint32_t dbus_bool_t;
73
74/* dbus-shared.h */
75typedef enum
76{
77 DBUS_BUS_SESSION, /**< The login session bus */
78 DBUS_BUS_SYSTEM, /**< The systemwide bus */
79 DBUS_BUS_STARTER /**< The bus that started us, if any */
80} DBusBusType;
81
82typedef enum
83{
84 DBUS_HANDLER_RESULT_HANDLED, /**< Message has had its effect - no need to run more handlers. */
85 DBUS_HANDLER_RESULT_NOT_YET_HANDLED, /**< Message has not had any effect - see if other handlers want it. */
86 DBUS_HANDLER_RESULT_NEED_MEMORY /**< Need more memory in order to return #DBUS_HANDLER_RESULT_HANDLED or #DBUS_HANDLER_RESULT_NOT_YET_HANDLED. Please try again later with more memory. */
87} DBusHandlerResult;
88
89#define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
90#define DBUS_PATH_DBUS "/org/freedesktop/DBus"
91#define DBUS_PATH_LOCAL "/org/freedesktop/DBus/Local"
92#define DBUS_INTERFACE_DBUS "org.freedesktop.DBus"
93#define DBUS_INTERFACE_INTROSPECTABLE "org.freedesktop.DBus.Introspectable"
94#define DBUS_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties"
95#define DBUS_INTERFACE_LOCAL "org.freedesktop.DBus.Local"
96
97#define DBUS_NAME_FLAG_ALLOW_REPLACEMENT 0x1 /**< Allow another service to become the primary owner if requested */
98#define DBUS_NAME_FLAG_REPLACE_EXISTING 0x2 /**< Request to replace the current primary owner */
99#define DBUS_NAME_FLAG_DO_NOT_QUEUE 0x4 /**< If we can not become the primary owner do not place us in the queue */
100
101#define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1 /**< Service has become the primary owner of the requested name */
102#define DBUS_REQUEST_NAME_REPLY_IN_QUEUE 2 /**< Service could not become the primary owner and has been placed in the queue */
103#define DBUS_REQUEST_NAME_REPLY_EXISTS 3 /**< Service is already in the queue */
104#define DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER 4 /**< Service is already the primary owner */
105
106#define DBUS_RELEASE_NAME_REPLY_RELEASED 1 /**< Service was released from the given name */
107#define DBUS_RELEASE_NAME_REPLY_NON_EXISTENT 2 /**< The given name does not exist on the bus */
108#define DBUS_RELEASE_NAME_REPLY_NOT_OWNER 3 /**< Service is not an owner of the given name */
109
110/* dbus-memory.h */
111typedef void (* DBusFreeFunction) (void *memory);
112
113/* dbus-connection.h */
114typedef enum
115{
116 DBUS_WATCH_READABLE = 1 << 0, /**< As in POLLIN */
117 DBUS_WATCH_WRITABLE = 1 << 1, /**< As in POLLOUT */
118 DBUS_WATCH_ERROR = 1 << 2, /**< As in POLLERR (can't watch for
119 * this, but can be present in
120 * current state passed to
121 * dbus_watch_handle()).
122 */
123 DBUS_WATCH_HANGUP = 1 << 3 /**< As in POLLHUP (can't watch for
124 * it, but can be present in current
125 * state passed to
126 * dbus_watch_handle()).
127 */
128 /* Internal to libdbus, there is also _DBUS_WATCH_NVAL in dbus-watch.h */
129} DBusWatchFlags;
130
131typedef enum
132{
133 DBUS_DISPATCH_DATA_REMAINS, /**< There is more data to potentially convert to messages. */
134 DBUS_DISPATCH_COMPLETE, /**< All currently available data has been processed. */
135 DBUS_DISPATCH_NEED_MEMORY /**< More memory is needed to continue. */
136} DBusDispatchStatus;
137
138typedef dbus_bool_t (* DBusAddWatchFunction) (DBusWatch *watch,
139 void *data);
140typedef void (* DBusWatchToggledFunction) (DBusWatch *watch,
141 void *data);
142typedef void (* DBusRemoveWatchFunction) (DBusWatch *watch,
143 void *data);
144typedef dbus_bool_t (* DBusAddTimeoutFunction) (DBusTimeout *timeout,
145 void *data);
146typedef void (* DBusTimeoutToggledFunction) (DBusTimeout *timeout,
147 void *data);
148typedef void (* DBusRemoveTimeoutFunction) (DBusTimeout *timeout,
149 void *data);
150typedef void (* DBusDispatchStatusFunction) (DBusConnection *connection,
151 DBusDispatchStatus new_status,
152 void *data);
153typedef void (* DBusWakeupMainFunction) (void *data);
154typedef void (* DBusPendingCallNotifyFunction) (DBusPendingCall *pending,
155 void *user_data);
156typedef DBusHandlerResult (* DBusHandleMessageFunction) (DBusConnection *connection,
157 DBusMessage *message,
158 void *user_data);
159
160/* dbus-errors.h */
161struct DBusError
162{
163 const char *name; /**< public error name field */
164 const char *message; /**< public error message field */
165
166 unsigned int dummy1 : 1; /**< placeholder */
167 unsigned int dummy2 : 1; /**< placeholder */
168 unsigned int dummy3 : 1; /**< placeholder */
169 unsigned int dummy4 : 1; /**< placeholder */
170 unsigned int dummy5 : 1; /**< placeholder */
171
172 void *padding1; /**< placeholder */
173};
174
175/* dbus-message.h */
176struct DBusMessageIter
177{
178 void *dummy1; /**< Don't use this */
179 void *dummy2; /**< Don't use this */
180 dbus_uint32_t dummy3; /**< Don't use this */
181 int dummy4; /**< Don't use this */
182 int dummy5; /**< Don't use this */
183 int dummy6; /**< Don't use this */
184 int dummy7; /**< Don't use this */
185 int dummy8; /**< Don't use this */
186 int dummy9; /**< Don't use this */
187 int dummy10; /**< Don't use this */
188 int dummy11; /**< Don't use this */
189 int pad1; /**< Don't use this */
190 void *pad2; /**< Don't use this */ /* Was int; changed to void* at 1.10.8 */
191 void *pad3; /**< Don't use this */
192};
193
194/* dbus-protocol.h */
195#define DBUS_TYPE_INVALID ((int) '\0')
196#define DBUS_TYPE_INVALID_AS_STRING "\0"
197#define DBUS_TYPE_BYTE ((int) 'y')
198#define DBUS_TYPE_BYTE_AS_STRING "y"
199#define DBUS_TYPE_BOOLEAN ((int) 'b')
200#define DBUS_TYPE_BOOLEAN_AS_STRING "b"
201#define DBUS_TYPE_INT16 ((int) 'n')
202#define DBUS_TYPE_INT16_AS_STRING "n"
203#define DBUS_TYPE_UINT16 ((int) 'q')
204#define DBUS_TYPE_UINT16_AS_STRING "q"
205#define DBUS_TYPE_INT32 ((int) 'i')
206#define DBUS_TYPE_INT32_AS_STRING "i"
207#define DBUS_TYPE_UINT32 ((int) 'u')
208#define DBUS_TYPE_UINT32_AS_STRING "u"
209#define DBUS_TYPE_INT64 ((int) 'x')
210#define DBUS_TYPE_INT64_AS_STRING "x"
211#define DBUS_TYPE_UINT64 ((int) 't')
212#define DBUS_TYPE_UINT64_AS_STRING "t"
213#define DBUS_TYPE_DOUBLE ((int) 'd')
214#define DBUS_TYPE_DOUBLE_AS_STRING "d"
215#define DBUS_TYPE_STRING ((int) 's')
216#define DBUS_TYPE_STRING_AS_STRING "s"
217#define DBUS_TYPE_OBJECT_PATH ((int) 'o')
218#define DBUS_TYPE_OBJECT_PATH_AS_STRING "o"
219#define DBUS_TYPE_SIGNATURE ((int) 'g')
220#define DBUS_TYPE_SIGNATURE_AS_STRING "g"
221#define DBUS_TYPE_UNIX_FD ((int) 'h')
222#define DBUS_TYPE_UNIX_FD_AS_STRING "h"
223
224#define DBUS_TYPE_ARRAY ((int) 'a')
225#define DBUS_TYPE_ARRAY_AS_STRING "a"
226#define DBUS_TYPE_VARIANT ((int) 'v')
227#define DBUS_TYPE_VARIANT_AS_STRING "v"
228
229#define DBUS_TYPE_STRUCT ((int) 'r')
230#define DBUS_TYPE_STRUCT_AS_STRING "r"
231#define DBUS_TYPE_DICT_ENTRY ((int) 'e')
232#define DBUS_TYPE_DICT_ENTRY_AS_STRING "e"
233
234#define DBUS_STRUCT_BEGIN_CHAR ((int) '(')
235#define DBUS_STRUCT_BEGIN_CHAR_AS_STRING "("
236#define DBUS_STRUCT_END_CHAR ((int) ')')
237#define DBUS_STRUCT_END_CHAR_AS_STRING ")"
238#define DBUS_DICT_ENTRY_BEGIN_CHAR ((int) '{')
239#define DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING "{"
240#define DBUS_DICT_ENTRY_END_CHAR ((int) '}')
241#define DBUS_DICT_ENTRY_END_CHAR_AS_STRING "}"
242
243#define DBUS_MAXIMUM_NAME_LENGTH 255
244
245#define DBUS_MESSAGE_TYPE_INVALID 0
246#define DBUS_MESSAGE_TYPE_METHOD_CALL 1
247#define DBUS_MESSAGE_TYPE_METHOD_RETURN 2
248#define DBUS_MESSAGE_TYPE_ERROR 3
249#define DBUS_MESSAGE_TYPE_SIGNAL 4
250
251#define DBUS_INTROSPECT_1_0_XML_NAMESPACE "http://www.freedesktop.org/standards/dbus"
252#define DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
253#define DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"
254#define DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "<!DOCTYPE node PUBLIC \"" DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER "\"\n\"" DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "\">\n"
255
256/* dbus-server.h */
257typedef void (* DBusNewConnectionFunction) (DBusServer *server,
258 DBusConnection *new_connection,
259 void *data);
260
261} // extern "C"
262
263#endif // DBUS_MINIMAL_P_H
264
265

source code of qtbase/src/dbus/dbus_minimal_p.h