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