├── .gitignore ├── .php74 ├── Makefile ├── composer.json ├── examples ├── bluez-music-notify.php └── bluez-volume-sync.php ├── include ├── dbus-php.h ├── dbus-php.php └── orig │ ├── dbus-address.h │ ├── dbus-bus.h │ ├── dbus-connection.h │ ├── dbus-errors.h │ ├── dbus-glib-bindings.h │ ├── dbus-glib-lowlevel.h │ ├── dbus-glib.h │ ├── dbus-gtype-specialized.h │ ├── dbus-gvalue-parse-variant.h │ ├── dbus-macros.h │ ├── dbus-memory.h │ ├── dbus-message.h │ ├── dbus-misc.h │ ├── dbus-pending-call.h │ ├── dbus-protocol.h │ ├── dbus-server.h │ ├── dbus-shared.h │ ├── dbus-signature.h │ ├── dbus-syntax.h │ ├── dbus-threads.h │ ├── dbus-types.h │ └── dbus.h ├── lib ├── DBus.php ├── DBusMessageIterDecoder.php ├── DBusObject.php ├── Message.php ├── Signal.php └── Type │ ├── DBusDict.php │ ├── DBusObjectPath.php │ ├── DBusStruct.php │ └── DBusVariant.php ├── load.php ├── phpcs.xml.dist └── phpstan.neon /.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | /composer.lock 3 | /.idea 4 | /.phpcs-cache 5 | -------------------------------------------------------------------------------- /.php74: -------------------------------------------------------------------------------- 1 | # source .php74 2 | alias php=php7.4 3 | alias composer="php7.4 $(which composer)" 4 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | PHP ?= php7.4 2 | COMPOSER ?= $(PHP) $(shell which composer) 3 | 4 | test: phpstan phpcs 5 | 6 | fix: phpcbf 7 | 8 | vendor/bin/phpstan vendor/bin/phpcs vendor/bin/phpcbf: vendor/autoload.php 9 | 10 | vendor/autoload.php: composer.lock 11 | $(COMPOSER) install 12 | 13 | phpstan: vendor/bin/phpstan 14 | $(PHP) vendor/bin/phpstan analyse -l max -a lib/ examples/ 15 | 16 | phpcs phpcbf: vendor/bin/$@ 17 | $(PHP) vendor/bin/$@ 18 | 19 | examples: 20 | (echo $(PHP) examples/bluez-music-notify.php ; echo $(PHP) examples/bluez-volume-sync.php) | parallel -u 21 | 22 | .PHONY: examples 23 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "paxal/php-dbus", 3 | "description": "DBUS PHP Bindings", 4 | "type": "library", 5 | "require": { 6 | "php": "^7.4|^8.0", 7 | "ext-FFI": "*", 8 | "ext-json": "*" 9 | }, 10 | "autoload": { 11 | "psr-4": { 12 | "Paxal\\DBus\\":"lib" 13 | } 14 | }, 15 | "license": "MIT", 16 | "authors": [ 17 | { 18 | "name": "Cyril Pascal", 19 | "email": "cyril.pascal_github@m4x.org" 20 | } 21 | ], 22 | "require-dev": { 23 | "doctrine/coding-standard": "^6.0", 24 | "phpstan/phpstan": "^0.11.12", 25 | "phpstan/phpstan-strict-rules": "^0.11.1" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /examples/bluez-music-notify.php: -------------------------------------------------------------------------------- 1 | addMatch('arg0=org.bluez.MediaPlayer1'); 12 | $lastItem = null; 13 | while (true) { 14 | usleep(10); 15 | $message = $dbus->waitLoop(); 16 | if ($message === null) { 17 | continue; 18 | } 19 | 20 | if (strpos($message->path ?? '', '/org/bluez') !== 0) { 21 | continue; 22 | } 23 | 24 | if ($message->interface !== 'org.freedesktop.DBus.Properties' || $message->member !== 'PropertiesChanged') { 25 | continue; 26 | } 27 | 28 | $arguments = $message->arguments; 29 | if (! is_array($arguments)) { 30 | continue; 31 | } 32 | 33 | $objectType = $arguments[0]; 34 | if ($objectType !== 'org.bluez.MediaPlayer1') { 35 | continue; 36 | } 37 | 38 | $track = $arguments[1]['Track'] ?? null; 39 | if ($track === null) { 40 | continue; 41 | } 42 | 43 | $item = $track['Item'] ?? null; 44 | if ($item === null) { 45 | continue; 46 | } 47 | 48 | if ($item === $lastItem) { 49 | continue; 50 | } 51 | 52 | $lastItem = $item; 53 | $arguments = ['-t', '5000', '-a', 'Music', $track['Title'], $track['Artist'] . ' - ' . $track['Album']]; 54 | $escapedArguments = array_map('escapeshellarg', $arguments); 55 | 56 | echo sprintf('%s %s', $track['Title'], $track['Artist'] . ' - ' . $track['Album']) . PHP_EOL; 57 | exec('notify-send ' . implode(' ', $escapedArguments)); 58 | } 59 | -------------------------------------------------------------------------------- /examples/bluez-volume-sync.php: -------------------------------------------------------------------------------- 1 | addMatch('arg0=org.bluez.MediaTransport1'); 14 | 15 | while (true) { 16 | $message = $dbus->waitLoop(); 17 | if ($message === null) { 18 | usleep(10); 19 | continue; 20 | } 21 | 22 | if (strpos($message->path ?? '', '/org/bluez') !== 0) { 23 | continue; 24 | } 25 | 26 | if ($message->interface !== 'org.freedesktop.DBus.Properties' || $message->member !== 'PropertiesChanged') { 27 | continue; 28 | } 29 | 30 | $arguments = $message->arguments; 31 | if (! is_array($arguments)) { 32 | continue; 33 | } 34 | 35 | $objectType = $arguments[0]; 36 | if ($objectType !== 'org.bluez.MediaTransport1') { 37 | continue; 38 | } 39 | 40 | $volume = $arguments[1]['Volume'] ?? null; 41 | if ($volume === null) { 42 | continue; 43 | } 44 | 45 | $addr = preg_replace('@^.*/dev_(.*?)(/.*)$@', '$1', (string) $message->path); 46 | $paVolume = (int) (BLUEZ_TO_PA_FACTOR * (int) $volume); 47 | echo 'Set volume to ' . round($paVolume / 65535 * 100) . '%' . PHP_EOL; 48 | exec(sprintf('pactl set-source-volume bluez_source.%s.a2dp_source %s', $addr, $paVolume)); 49 | } 50 | -------------------------------------------------------------------------------- /include/dbus-php.h: -------------------------------------------------------------------------------- 1 | #define FFI_SCOPE "PAXAL_DBUS" 2 | #define FFI_LIB "libdbus-1.so" 3 | 4 | struct DBusError 5 | { 6 | const char *name; /**< public error name field */ 7 | const char *message; /**< public error message field */ 8 | 9 | unsigned int dummy1; /**< placeholder */ 10 | unsigned int dummy2; /**< placeholder */ 11 | unsigned int dummy3; /**< placeholder */ 12 | unsigned int dummy4; /**< placeholder */ 13 | unsigned int dummy5; /**< placeholder */ 14 | 15 | void *padding1; /**< placeholder */ 16 | }; 17 | 18 | void dbus_error_init(struct DBusError* error); 19 | void dbus_error_free (struct DBusError *error); 20 | 21 | typedef struct DBusConnection DBusConnection; 22 | 23 | typedef enum 24 | { 25 | DBUS_BUS_SESSION, /**< The login session bus */ 26 | DBUS_BUS_SYSTEM, /**< The systemwide bus */ 27 | DBUS_BUS_STARTER /**< The bus that started us, if any */ 28 | } DBusBusType; 29 | 30 | DBusConnection *dbus_bus_get(DBusBusType type, struct DBusError *error); 31 | 32 | void dbus_bus_add_match(DBusConnection *connection, const char *rule, struct DBusError *error); 33 | void dbus_connection_flush(DBusConnection *connection); 34 | bool dbus_error_is_set (const struct DBusError *error); 35 | bool dbus_connection_read_write (struct DBusConnection *connection, 36 | int timeout_milliseconds); 37 | 38 | typedef struct DBusMessage DBusMessage; 39 | DBusMessage* dbus_connection_pop_message (DBusConnection *connection); 40 | 41 | void dbus_message_unref (DBusMessage *message); 42 | 43 | 44 | typedef struct DBusMessageIter DBusMessageIter; 45 | 46 | /** 47 | * DBusMessageIter struct; contains no public fields. 48 | */ 49 | struct DBusMessageIter 50 | { 51 | void *dummy1; /**< Don't use this */ 52 | void *dummy2; /**< Don't use this */ 53 | uint32_t dummy3; /**< Don't use this */ 54 | int dummy4; /**< Don't use this */ 55 | int dummy5; /**< Don't use this */ 56 | int dummy6; /**< Don't use this */ 57 | int dummy7; /**< Don't use this */ 58 | int dummy8; /**< Don't use this */ 59 | int dummy9; /**< Don't use this */ 60 | int dummy10; /**< Don't use this */ 61 | int dummy11; /**< Don't use this */ 62 | int pad1; /**< Don't use this */ 63 | void *pad2; /**< Don't use this */ 64 | void *pad3; /**< Don't use this */ 65 | }; 66 | 67 | 68 | 69 | void dbus_message_iter_init_closed (DBusMessageIter *iter); 70 | bool dbus_message_iter_init (DBusMessage *message, 71 | DBusMessageIter *iter); 72 | bool dbus_message_iter_has_next (DBusMessageIter *iter); 73 | bool dbus_message_iter_next (DBusMessageIter *iter); 74 | char* dbus_message_iter_get_signature (DBusMessageIter *iter); 75 | int dbus_message_iter_get_arg_type (DBusMessageIter *iter); 76 | int dbus_message_iter_get_element_type (DBusMessageIter *iter); 77 | void dbus_message_iter_recurse (DBusMessageIter *iter, 78 | DBusMessageIter *sub); 79 | void dbus_message_iter_get_basic (DBusMessageIter *iter, 80 | void *value); 81 | int dbus_message_iter_get_element_count(DBusMessageIter *iter); 82 | 83 | void dbus_message_iter_get_fixed_array (DBusMessageIter *iter, 84 | void *value, 85 | int *n_elements); 86 | 87 | 88 | void dbus_message_iter_init_append (DBusMessage *message, 89 | DBusMessageIter *iter); 90 | bool dbus_message_iter_append_basic (DBusMessageIter *iter, 91 | int type, 92 | const void *value); 93 | bool dbus_message_iter_append_fixed_array (DBusMessageIter *iter, 94 | int element_type, 95 | const void *value, 96 | int n_elements); 97 | bool dbus_message_iter_open_container (DBusMessageIter *iter, 98 | int type, 99 | const char *contained_signature, 100 | DBusMessageIter *sub); 101 | bool dbus_message_iter_close_container (DBusMessageIter *iter, 102 | DBusMessageIter *sub); 103 | void dbus_message_iter_abandon_container (DBusMessageIter *iter, 104 | DBusMessageIter *sub); 105 | 106 | void dbus_message_iter_abandon_container_if_open (DBusMessageIter *iter, 107 | DBusMessageIter *sub); 108 | const char* dbus_message_get_path (DBusMessage *message); 109 | const char* dbus_message_get_interface (DBusMessage *message); 110 | const char* dbus_message_get_member (DBusMessage *message); 111 | void dbus_free (void *memory); 112 | -------------------------------------------------------------------------------- /include/dbus-php.php: -------------------------------------------------------------------------------- 1 | can be included directly, this file may disappear or change contents." 25 | #endif 26 | 27 | #ifndef DBUS_ADDRESS_H 28 | #define DBUS_ADDRESS_H 29 | 30 | #include 31 | #include 32 | 33 | DBUS_BEGIN_DECLS 34 | 35 | /** 36 | * @addtogroup DBusAddress 37 | * @{ 38 | */ 39 | 40 | /** Opaque type representing one of the semicolon-separated items in an address */ 41 | typedef struct DBusAddressEntry DBusAddressEntry; 42 | 43 | DBUS_EXPORT 44 | dbus_bool_t dbus_parse_address (const char *address, 45 | DBusAddressEntry ***entry_result, 46 | int *array_len, 47 | DBusError *error); 48 | DBUS_EXPORT 49 | const char *dbus_address_entry_get_value (DBusAddressEntry *entry, 50 | const char *key); 51 | DBUS_EXPORT 52 | const char *dbus_address_entry_get_method (DBusAddressEntry *entry); 53 | DBUS_EXPORT 54 | void dbus_address_entries_free (DBusAddressEntry **entries); 55 | 56 | DBUS_EXPORT 57 | char* dbus_address_escape_value (const char *value); 58 | DBUS_EXPORT 59 | char* dbus_address_unescape_value (const char *value, 60 | DBusError *error); 61 | 62 | /** 63 | * Clear a variable or struct member that contains an array of #DBusAddressEntry. 64 | * If it does not contain #NULL, the entries that were previously 65 | * there are freed with dbus_address_entries_free(). 66 | * 67 | * This is similar to dbus_clear_connection(): see that function 68 | * for more details. 69 | * 70 | * @param pointer_to_entries A pointer to a variable or struct member. 71 | * pointer_to_entries must not be #NULL, but *pointer_to_entries 72 | * may be #NULL. 73 | */ 74 | static inline void 75 | dbus_clear_address_entries (DBusAddressEntry ***pointer_to_entries) 76 | { 77 | _dbus_clear_pointer_impl (DBusAddressEntry *, pointer_to_entries, 78 | dbus_address_entries_free); 79 | } 80 | 81 | /** @} */ 82 | 83 | DBUS_END_DECLS 84 | 85 | #endif /* DBUS_ADDRESS_H */ 86 | 87 | -------------------------------------------------------------------------------- /include/orig/dbus-bus.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 | /* dbus-bus.h Convenience functions for communicating with the bus. 3 | * 4 | * Copyright (C) 2003 CodeFactory AB 5 | * 6 | * Licensed under the Academic Free License version 2.1 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION) 24 | #error "Only can be included directly, this file may disappear or change contents." 25 | #endif 26 | 27 | #ifndef DBUS_BUS_H 28 | #define DBUS_BUS_H 29 | 30 | #include 31 | 32 | DBUS_BEGIN_DECLS 33 | 34 | /** 35 | * @addtogroup DBusBus 36 | * @{ 37 | */ 38 | 39 | DBUS_EXPORT 40 | DBusConnection *dbus_bus_get (DBusBusType type, 41 | DBusError *error); 42 | DBUS_EXPORT 43 | DBusConnection *dbus_bus_get_private (DBusBusType type, 44 | DBusError *error); 45 | 46 | DBUS_EXPORT 47 | dbus_bool_t dbus_bus_register (DBusConnection *connection, 48 | DBusError *error); 49 | DBUS_EXPORT 50 | dbus_bool_t dbus_bus_set_unique_name (DBusConnection *connection, 51 | const char *unique_name); 52 | DBUS_EXPORT 53 | const char* dbus_bus_get_unique_name (DBusConnection *connection); 54 | DBUS_EXPORT 55 | unsigned long dbus_bus_get_unix_user (DBusConnection *connection, 56 | const char *name, 57 | DBusError *error); 58 | DBUS_EXPORT 59 | char* dbus_bus_get_id (DBusConnection *connection, 60 | DBusError *error); 61 | DBUS_EXPORT 62 | int dbus_bus_request_name (DBusConnection *connection, 63 | const char *name, 64 | unsigned int flags, 65 | DBusError *error); 66 | DBUS_EXPORT 67 | int dbus_bus_release_name (DBusConnection *connection, 68 | const char *name, 69 | DBusError *error); 70 | DBUS_EXPORT 71 | dbus_bool_t dbus_bus_name_has_owner (DBusConnection *connection, 72 | const char *name, 73 | DBusError *error); 74 | 75 | DBUS_EXPORT 76 | dbus_bool_t dbus_bus_start_service_by_name (DBusConnection *connection, 77 | const char *name, 78 | dbus_uint32_t flags, 79 | dbus_uint32_t *reply, 80 | DBusError *error); 81 | 82 | DBUS_EXPORT 83 | void dbus_bus_add_match (DBusConnection *connection, 84 | const char *rule, 85 | DBusError *error); 86 | DBUS_EXPORT 87 | void dbus_bus_remove_match (DBusConnection *connection, 88 | const char *rule, 89 | DBusError *error); 90 | 91 | /** @} */ 92 | 93 | DBUS_END_DECLS 94 | 95 | #endif /* DBUS_BUS_H */ 96 | -------------------------------------------------------------------------------- /include/orig/dbus-connection.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 | /* dbus-connection.h DBusConnection object 3 | * 4 | * Copyright (C) 2002, 2003 Red Hat Inc. 5 | * 6 | * Licensed under the Academic Free License version 2.1 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION) 24 | #error "Only can be included directly, this file may disappear or change contents." 25 | #endif 26 | 27 | #ifndef DBUS_CONNECTION_H 28 | #define DBUS_CONNECTION_H 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | DBUS_BEGIN_DECLS 37 | 38 | /** 39 | * @addtogroup DBusConnection 40 | * @{ 41 | */ 42 | 43 | /* documented in dbus-watch.c */ 44 | typedef struct DBusWatch DBusWatch; 45 | /* documented in dbus-timeout.c */ 46 | typedef struct DBusTimeout DBusTimeout; 47 | /** Opaque type representing preallocated resources so a message can be sent without further memory allocation. */ 48 | typedef struct DBusPreallocatedSend DBusPreallocatedSend; 49 | /** Opaque type representing a method call that has not yet received a reply. */ 50 | typedef struct DBusPendingCall DBusPendingCall; 51 | /** Opaque type representing a connection to a remote application and associated incoming/outgoing message queues. */ 52 | typedef struct DBusConnection DBusConnection; 53 | /** Set of functions that must be implemented to handle messages sent to a particular object path. */ 54 | typedef struct DBusObjectPathVTable DBusObjectPathVTable; 55 | 56 | /** 57 | * Indicates the status of a #DBusWatch. 58 | */ 59 | typedef enum 60 | { 61 | DBUS_WATCH_READABLE = 1 << 0, /**< As in POLLIN */ 62 | DBUS_WATCH_WRITABLE = 1 << 1, /**< As in POLLOUT */ 63 | DBUS_WATCH_ERROR = 1 << 2, /**< As in POLLERR (can't watch for 64 | * this, but can be present in 65 | * current state passed to 66 | * dbus_watch_handle()). 67 | */ 68 | DBUS_WATCH_HANGUP = 1 << 3 /**< As in POLLHUP (can't watch for 69 | * it, but can be present in current 70 | * state passed to 71 | * dbus_watch_handle()). 72 | */ 73 | /* Internal to libdbus, there is also _DBUS_WATCH_NVAL in dbus-watch.h */ 74 | } DBusWatchFlags; 75 | 76 | /** 77 | * Indicates the status of incoming data on a #DBusConnection. This determines whether 78 | * dbus_connection_dispatch() needs to be called. 79 | */ 80 | typedef enum 81 | { 82 | DBUS_DISPATCH_DATA_REMAINS, /**< There is more data to potentially convert to messages. */ 83 | DBUS_DISPATCH_COMPLETE, /**< All currently available data has been processed. */ 84 | DBUS_DISPATCH_NEED_MEMORY /**< More memory is needed to continue. */ 85 | } DBusDispatchStatus; 86 | 87 | /** Called when libdbus needs a new watch to be monitored by the main 88 | * loop. Returns #FALSE if it lacks enough memory to add the 89 | * watch. Set by dbus_connection_set_watch_functions() or 90 | * dbus_server_set_watch_functions(). 91 | */ 92 | typedef dbus_bool_t (* DBusAddWatchFunction) (DBusWatch *watch, 93 | void *data); 94 | /** Called when dbus_watch_get_enabled() may return a different value 95 | * than it did before. Set by dbus_connection_set_watch_functions() 96 | * or dbus_server_set_watch_functions(). 97 | */ 98 | typedef void (* DBusWatchToggledFunction) (DBusWatch *watch, 99 | void *data); 100 | /** Called when libdbus no longer needs a watch to be monitored by the 101 | * main loop. Set by dbus_connection_set_watch_functions() or 102 | * dbus_server_set_watch_functions(). 103 | */ 104 | typedef void (* DBusRemoveWatchFunction) (DBusWatch *watch, 105 | void *data); 106 | /** Called when libdbus needs a new timeout to be monitored by the main 107 | * loop. Returns #FALSE if it lacks enough memory to add the 108 | * watch. Set by dbus_connection_set_timeout_functions() or 109 | * dbus_server_set_timeout_functions(). 110 | */ 111 | typedef dbus_bool_t (* DBusAddTimeoutFunction) (DBusTimeout *timeout, 112 | void *data); 113 | /** Called when dbus_timeout_get_enabled() may return a different 114 | * value than it did before. 115 | * Set by dbus_connection_set_timeout_functions() or 116 | * dbus_server_set_timeout_functions(). 117 | */ 118 | typedef void (* DBusTimeoutToggledFunction) (DBusTimeout *timeout, 119 | void *data); 120 | /** Called when libdbus no longer needs a timeout to be monitored by the 121 | * main loop. Set by dbus_connection_set_timeout_functions() or 122 | * dbus_server_set_timeout_functions(). 123 | */ 124 | typedef void (* DBusRemoveTimeoutFunction) (DBusTimeout *timeout, 125 | void *data); 126 | /** Called when the return value of dbus_connection_get_dispatch_status() 127 | * may have changed. Set with dbus_connection_set_dispatch_status_function(). 128 | */ 129 | typedef void (* DBusDispatchStatusFunction) (DBusConnection *connection, 130 | DBusDispatchStatus new_status, 131 | void *data); 132 | /** 133 | * Called when the main loop's thread should be notified that there's now work 134 | * to do. Set with dbus_connection_set_wakeup_main_function(). 135 | */ 136 | typedef void (* DBusWakeupMainFunction) (void *data); 137 | 138 | /** 139 | * Called during authentication to check whether the given UNIX user 140 | * ID is allowed to connect, if the client tried to auth as a UNIX 141 | * user ID. Normally on Windows this would never happen. Set with 142 | * dbus_connection_set_unix_user_function(). 143 | */ 144 | typedef dbus_bool_t (* DBusAllowUnixUserFunction) (DBusConnection *connection, 145 | unsigned long uid, 146 | void *data); 147 | 148 | /** 149 | * Called during authentication to check whether the given Windows user 150 | * ID is allowed to connect, if the client tried to auth as a Windows 151 | * user ID. Normally on UNIX this would never happen. Set with 152 | * dbus_connection_set_windows_user_function(). 153 | */ 154 | typedef dbus_bool_t (* DBusAllowWindowsUserFunction) (DBusConnection *connection, 155 | const char *user_sid, 156 | void *data); 157 | 158 | 159 | /** 160 | * Called when a pending call now has a reply available. Set with 161 | * dbus_pending_call_set_notify(). 162 | */ 163 | typedef void (* DBusPendingCallNotifyFunction) (DBusPendingCall *pending, 164 | void *user_data); 165 | 166 | /** 167 | * Called when a message needs to be handled. The result indicates whether or 168 | * not more handlers should be run. Set with dbus_connection_add_filter(). 169 | */ 170 | typedef DBusHandlerResult (* DBusHandleMessageFunction) (DBusConnection *connection, 171 | DBusMessage *message, 172 | void *user_data); 173 | DBUS_EXPORT 174 | DBusConnection* dbus_connection_open (const char *address, 175 | DBusError *error); 176 | DBUS_EXPORT 177 | DBusConnection* dbus_connection_open_private (const char *address, 178 | DBusError *error); 179 | DBUS_EXPORT 180 | DBusConnection* dbus_connection_ref (DBusConnection *connection); 181 | DBUS_EXPORT 182 | void dbus_connection_unref (DBusConnection *connection); 183 | DBUS_EXPORT 184 | void dbus_connection_close (DBusConnection *connection); 185 | DBUS_EXPORT 186 | dbus_bool_t dbus_connection_get_is_connected (DBusConnection *connection); 187 | DBUS_EXPORT 188 | dbus_bool_t dbus_connection_get_is_authenticated (DBusConnection *connection); 189 | DBUS_EXPORT 190 | dbus_bool_t dbus_connection_get_is_anonymous (DBusConnection *connection); 191 | DBUS_EXPORT 192 | char* dbus_connection_get_server_id (DBusConnection *connection); 193 | DBUS_EXPORT 194 | dbus_bool_t dbus_connection_can_send_type (DBusConnection *connection, 195 | int type); 196 | 197 | DBUS_EXPORT 198 | void dbus_connection_set_exit_on_disconnect (DBusConnection *connection, 199 | dbus_bool_t exit_on_disconnect); 200 | DBUS_EXPORT 201 | void dbus_connection_flush (DBusConnection *connection); 202 | DBUS_EXPORT 203 | dbus_bool_t dbus_connection_read_write_dispatch (DBusConnection *connection, 204 | int timeout_milliseconds); 205 | DBUS_EXPORT 206 | dbus_bool_t dbus_connection_read_write (DBusConnection *connection, 207 | int timeout_milliseconds); 208 | DBUS_EXPORT 209 | DBusMessage* dbus_connection_borrow_message (DBusConnection *connection); 210 | DBUS_EXPORT 211 | void dbus_connection_return_message (DBusConnection *connection, 212 | DBusMessage *message); 213 | DBUS_EXPORT 214 | void dbus_connection_steal_borrowed_message (DBusConnection *connection, 215 | DBusMessage *message); 216 | DBUS_EXPORT 217 | DBusMessage* dbus_connection_pop_message (DBusConnection *connection); 218 | DBUS_EXPORT 219 | DBusDispatchStatus dbus_connection_get_dispatch_status (DBusConnection *connection); 220 | DBUS_EXPORT 221 | DBusDispatchStatus dbus_connection_dispatch (DBusConnection *connection); 222 | DBUS_EXPORT 223 | dbus_bool_t dbus_connection_has_messages_to_send (DBusConnection *connection); 224 | DBUS_EXPORT 225 | dbus_bool_t dbus_connection_send (DBusConnection *connection, 226 | DBusMessage *message, 227 | dbus_uint32_t *client_serial); 228 | DBUS_EXPORT 229 | dbus_bool_t dbus_connection_send_with_reply (DBusConnection *connection, 230 | DBusMessage *message, 231 | DBusPendingCall **pending_return, 232 | int timeout_milliseconds); 233 | DBUS_EXPORT 234 | DBusMessage * dbus_connection_send_with_reply_and_block (DBusConnection *connection, 235 | DBusMessage *message, 236 | int timeout_milliseconds, 237 | DBusError *error); 238 | DBUS_EXPORT 239 | dbus_bool_t dbus_connection_set_watch_functions (DBusConnection *connection, 240 | DBusAddWatchFunction add_function, 241 | DBusRemoveWatchFunction remove_function, 242 | DBusWatchToggledFunction toggled_function, 243 | void *data, 244 | DBusFreeFunction free_data_function); 245 | DBUS_EXPORT 246 | dbus_bool_t dbus_connection_set_timeout_functions (DBusConnection *connection, 247 | DBusAddTimeoutFunction add_function, 248 | DBusRemoveTimeoutFunction remove_function, 249 | DBusTimeoutToggledFunction toggled_function, 250 | void *data, 251 | DBusFreeFunction free_data_function); 252 | DBUS_EXPORT 253 | void dbus_connection_set_wakeup_main_function (DBusConnection *connection, 254 | DBusWakeupMainFunction wakeup_main_function, 255 | void *data, 256 | DBusFreeFunction free_data_function); 257 | DBUS_EXPORT 258 | void dbus_connection_set_dispatch_status_function (DBusConnection *connection, 259 | DBusDispatchStatusFunction function, 260 | void *data, 261 | DBusFreeFunction free_data_function); 262 | DBUS_EXPORT 263 | dbus_bool_t dbus_connection_get_unix_user (DBusConnection *connection, 264 | unsigned long *uid); 265 | DBUS_EXPORT 266 | dbus_bool_t dbus_connection_get_unix_process_id (DBusConnection *connection, 267 | unsigned long *pid); 268 | DBUS_EXPORT 269 | dbus_bool_t dbus_connection_get_adt_audit_session_data (DBusConnection *connection, 270 | void **data, 271 | dbus_int32_t *data_size); 272 | DBUS_EXPORT 273 | void dbus_connection_set_unix_user_function (DBusConnection *connection, 274 | DBusAllowUnixUserFunction function, 275 | void *data, 276 | DBusFreeFunction free_data_function); 277 | DBUS_EXPORT 278 | dbus_bool_t dbus_connection_get_windows_user (DBusConnection *connection, 279 | char **windows_sid_p); 280 | DBUS_EXPORT 281 | void dbus_connection_set_windows_user_function (DBusConnection *connection, 282 | DBusAllowWindowsUserFunction function, 283 | void *data, 284 | DBusFreeFunction free_data_function); 285 | DBUS_EXPORT 286 | void dbus_connection_set_allow_anonymous (DBusConnection *connection, 287 | dbus_bool_t value); 288 | DBUS_EXPORT 289 | void dbus_connection_set_route_peer_messages (DBusConnection *connection, 290 | dbus_bool_t value); 291 | 292 | 293 | /* Filters */ 294 | 295 | DBUS_EXPORT 296 | dbus_bool_t dbus_connection_add_filter (DBusConnection *connection, 297 | DBusHandleMessageFunction function, 298 | void *user_data, 299 | DBusFreeFunction free_data_function); 300 | DBUS_EXPORT 301 | void dbus_connection_remove_filter (DBusConnection *connection, 302 | DBusHandleMessageFunction function, 303 | void *user_data); 304 | 305 | 306 | /* Other */ 307 | DBUS_EXPORT 308 | dbus_bool_t dbus_connection_allocate_data_slot (dbus_int32_t *slot_p); 309 | DBUS_EXPORT 310 | void dbus_connection_free_data_slot (dbus_int32_t *slot_p); 311 | DBUS_EXPORT 312 | dbus_bool_t dbus_connection_set_data (DBusConnection *connection, 313 | dbus_int32_t slot, 314 | void *data, 315 | DBusFreeFunction free_data_func); 316 | DBUS_EXPORT 317 | void* dbus_connection_get_data (DBusConnection *connection, 318 | dbus_int32_t slot); 319 | 320 | DBUS_EXPORT 321 | void dbus_connection_set_change_sigpipe (dbus_bool_t will_modify_sigpipe); 322 | 323 | DBUS_EXPORT 324 | void dbus_connection_set_max_message_size (DBusConnection *connection, 325 | long size); 326 | DBUS_EXPORT 327 | long dbus_connection_get_max_message_size (DBusConnection *connection); 328 | DBUS_EXPORT 329 | void dbus_connection_set_max_received_size (DBusConnection *connection, 330 | long size); 331 | DBUS_EXPORT 332 | long dbus_connection_get_max_received_size (DBusConnection *connection); 333 | 334 | DBUS_EXPORT 335 | void dbus_connection_set_max_message_unix_fds (DBusConnection *connection, 336 | long n); 337 | DBUS_EXPORT 338 | long dbus_connection_get_max_message_unix_fds (DBusConnection *connection); 339 | DBUS_EXPORT 340 | void dbus_connection_set_max_received_unix_fds(DBusConnection *connection, 341 | long n); 342 | DBUS_EXPORT 343 | long dbus_connection_get_max_received_unix_fds(DBusConnection *connection); 344 | 345 | DBUS_EXPORT 346 | long dbus_connection_get_outgoing_size (DBusConnection *connection); 347 | DBUS_EXPORT 348 | long dbus_connection_get_outgoing_unix_fds (DBusConnection *connection); 349 | 350 | DBUS_EXPORT 351 | DBusPreallocatedSend* dbus_connection_preallocate_send (DBusConnection *connection); 352 | DBUS_EXPORT 353 | void dbus_connection_free_preallocated_send (DBusConnection *connection, 354 | DBusPreallocatedSend *preallocated); 355 | DBUS_EXPORT 356 | void dbus_connection_send_preallocated (DBusConnection *connection, 357 | DBusPreallocatedSend *preallocated, 358 | DBusMessage *message, 359 | dbus_uint32_t *client_serial); 360 | 361 | 362 | /* Object tree functionality */ 363 | 364 | /** 365 | * Called when a #DBusObjectPathVTable is unregistered (or its connection is freed). 366 | * Found in #DBusObjectPathVTable. 367 | */ 368 | typedef void (* DBusObjectPathUnregisterFunction) (DBusConnection *connection, 369 | void *user_data); 370 | /** 371 | * Called when a message is sent to a registered object path. Found in 372 | * #DBusObjectPathVTable which is registered with dbus_connection_register_object_path() 373 | * or dbus_connection_register_fallback(). 374 | */ 375 | typedef DBusHandlerResult (* DBusObjectPathMessageFunction) (DBusConnection *connection, 376 | DBusMessage *message, 377 | void *user_data); 378 | 379 | /** 380 | * Virtual table that must be implemented to handle a portion of the 381 | * object path hierarchy. Attach the vtable to a particular path using 382 | * dbus_connection_register_object_path() or 383 | * dbus_connection_register_fallback(). 384 | */ 385 | struct DBusObjectPathVTable 386 | { 387 | DBusObjectPathUnregisterFunction unregister_function; /**< Function to unregister this handler */ 388 | DBusObjectPathMessageFunction message_function; /**< Function to handle messages */ 389 | 390 | void (* dbus_internal_pad1) (void *); /**< Reserved for future expansion */ 391 | void (* dbus_internal_pad2) (void *); /**< Reserved for future expansion */ 392 | void (* dbus_internal_pad3) (void *); /**< Reserved for future expansion */ 393 | void (* dbus_internal_pad4) (void *); /**< Reserved for future expansion */ 394 | }; 395 | 396 | DBUS_EXPORT 397 | dbus_bool_t dbus_connection_try_register_object_path (DBusConnection *connection, 398 | const char *path, 399 | const DBusObjectPathVTable *vtable, 400 | void *user_data, 401 | DBusError *error); 402 | 403 | DBUS_EXPORT 404 | dbus_bool_t dbus_connection_register_object_path (DBusConnection *connection, 405 | const char *path, 406 | const DBusObjectPathVTable *vtable, 407 | void *user_data); 408 | 409 | DBUS_EXPORT 410 | dbus_bool_t dbus_connection_try_register_fallback (DBusConnection *connection, 411 | const char *path, 412 | const DBusObjectPathVTable *vtable, 413 | void *user_data, 414 | DBusError *error); 415 | 416 | DBUS_EXPORT 417 | dbus_bool_t dbus_connection_register_fallback (DBusConnection *connection, 418 | const char *path, 419 | const DBusObjectPathVTable *vtable, 420 | void *user_data); 421 | DBUS_EXPORT 422 | dbus_bool_t dbus_connection_unregister_object_path (DBusConnection *connection, 423 | const char *path); 424 | 425 | DBUS_EXPORT 426 | dbus_bool_t dbus_connection_get_object_path_data (DBusConnection *connection, 427 | const char *path, 428 | void **data_p); 429 | 430 | DBUS_EXPORT 431 | dbus_bool_t dbus_connection_list_registered (DBusConnection *connection, 432 | const char *parent_path, 433 | char ***child_entries); 434 | 435 | DBUS_EXPORT 436 | dbus_bool_t dbus_connection_get_unix_fd (DBusConnection *connection, 437 | int *fd); 438 | DBUS_EXPORT 439 | dbus_bool_t dbus_connection_get_socket (DBusConnection *connection, 440 | int *fd); 441 | 442 | /** 443 | * Clear a variable or struct member that contains a #DBusConnection. 444 | * If it does not contain #NULL, the connection that was previously 445 | * there is unreferenced with dbus_connection_unref(). 446 | * 447 | * For example, this function and the similar functions for 448 | * other reference-counted types can be used in code like this: 449 | * 450 | * @code 451 | * DBusConnection *conn = NULL; 452 | * struct { ...; DBusMessage *m; ... } *larger_structure = ...; 453 | * 454 | * ... code that might set conn or m to be non-NULL ... 455 | * 456 | * dbus_clear_connection (&conn); 457 | * dbus_clear_message (&larger_structure->m); 458 | * @endcode 459 | * 460 | * @param pointer_to_connection A pointer to a variable or struct member. 461 | * pointer_to_connection must not be #NULL, but *pointer_to_connection 462 | * may be #NULL. 463 | */ 464 | static inline void 465 | dbus_clear_connection (DBusConnection **pointer_to_connection) 466 | { 467 | _dbus_clear_pointer_impl (DBusConnection, pointer_to_connection, 468 | dbus_connection_unref); 469 | } 470 | 471 | /** @} */ 472 | 473 | 474 | /** 475 | * @addtogroup DBusWatch 476 | * @{ 477 | */ 478 | 479 | #ifndef DBUS_DISABLE_DEPRECATED 480 | DBUS_EXPORT 481 | DBUS_DEPRECATED int dbus_watch_get_fd (DBusWatch *watch); 482 | #endif 483 | 484 | DBUS_EXPORT 485 | int dbus_watch_get_unix_fd (DBusWatch *watch); 486 | DBUS_EXPORT 487 | int dbus_watch_get_socket (DBusWatch *watch); 488 | DBUS_EXPORT 489 | unsigned int dbus_watch_get_flags (DBusWatch *watch); 490 | DBUS_EXPORT 491 | void* dbus_watch_get_data (DBusWatch *watch); 492 | DBUS_EXPORT 493 | void dbus_watch_set_data (DBusWatch *watch, 494 | void *data, 495 | DBusFreeFunction free_data_function); 496 | DBUS_EXPORT 497 | dbus_bool_t dbus_watch_handle (DBusWatch *watch, 498 | unsigned int flags); 499 | DBUS_EXPORT 500 | dbus_bool_t dbus_watch_get_enabled (DBusWatch *watch); 501 | 502 | /** @} */ 503 | 504 | /** 505 | * @addtogroup DBusTimeout 506 | * @{ 507 | */ 508 | 509 | DBUS_EXPORT 510 | int dbus_timeout_get_interval (DBusTimeout *timeout); 511 | DBUS_EXPORT 512 | void* dbus_timeout_get_data (DBusTimeout *timeout); 513 | DBUS_EXPORT 514 | void dbus_timeout_set_data (DBusTimeout *timeout, 515 | void *data, 516 | DBusFreeFunction free_data_function); 517 | DBUS_EXPORT 518 | dbus_bool_t dbus_timeout_handle (DBusTimeout *timeout); 519 | DBUS_EXPORT 520 | dbus_bool_t dbus_timeout_get_enabled (DBusTimeout *timeout); 521 | 522 | /** @} */ 523 | 524 | DBUS_END_DECLS 525 | 526 | #endif /* DBUS_CONNECTION_H */ 527 | -------------------------------------------------------------------------------- /include/orig/dbus-errors.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 | /* dbus-errors.h Error reporting 3 | * 4 | * Copyright (C) 2002 Red Hat Inc. 5 | * Copyright (C) 2003 CodeFactory AB 6 | * 7 | * Licensed under the Academic Free License version 2.1 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION) 25 | #error "Only can be included directly, this file may disappear or change contents." 26 | #endif 27 | 28 | #ifndef DBUS_ERROR_H 29 | #define DBUS_ERROR_H 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | DBUS_BEGIN_DECLS 36 | 37 | /** 38 | * @addtogroup DBusErrors 39 | * @{ 40 | */ 41 | 42 | /** Mostly-opaque type representing an error that occurred */ 43 | typedef struct DBusError DBusError; 44 | 45 | /** 46 | * Object representing an exception. 47 | */ 48 | struct DBusError 49 | { 50 | const char *name; /**< public error name field */ 51 | const char *message; /**< public error message field */ 52 | 53 | unsigned int dummy1 : 1; /**< placeholder */ 54 | unsigned int dummy2 : 1; /**< placeholder */ 55 | unsigned int dummy3 : 1; /**< placeholder */ 56 | unsigned int dummy4 : 1; /**< placeholder */ 57 | unsigned int dummy5 : 1; /**< placeholder */ 58 | 59 | void *padding1; /**< placeholder */ 60 | }; 61 | 62 | #define DBUS_ERROR_INIT { NULL, NULL, TRUE, 0, 0, 0, 0, NULL } 63 | 64 | DBUS_EXPORT 65 | void dbus_error_init (DBusError *error); 66 | DBUS_EXPORT 67 | void dbus_error_free (DBusError *error); 68 | DBUS_EXPORT 69 | void dbus_set_error (DBusError *error, 70 | const char *name, 71 | const char *message, 72 | ...) _DBUS_GNUC_PRINTF (3, 4); 73 | DBUS_EXPORT 74 | void dbus_set_error_const (DBusError *error, 75 | const char *name, 76 | const char *message); 77 | DBUS_EXPORT 78 | void dbus_move_error (DBusError *src, 79 | DBusError *dest); 80 | DBUS_EXPORT 81 | dbus_bool_t dbus_error_has_name (const DBusError *error, 82 | const char *name); 83 | DBUS_EXPORT 84 | dbus_bool_t dbus_error_is_set (const DBusError *error); 85 | 86 | /** @} */ 87 | 88 | DBUS_END_DECLS 89 | 90 | #endif /* DBUS_ERROR_H */ 91 | -------------------------------------------------------------------------------- /include/orig/dbus-glib-bindings.h: -------------------------------------------------------------------------------- 1 | /* Generated by dbus-binding-tool; do not edit! */ 2 | 3 | #include 4 | #include 5 | 6 | G_BEGIN_DECLS 7 | 8 | #ifndef _DBUS_GLIB_ASYNC_DATA_FREE 9 | #define _DBUS_GLIB_ASYNC_DATA_FREE 10 | static inline void 11 | _dbus_glib_async_data_free (gpointer stuff) 12 | { 13 | g_slice_free (DBusGAsyncData, stuff); 14 | } 15 | #endif 16 | 17 | #ifndef DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_DBus_Introspectable 18 | #define DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_DBus_Introspectable 19 | 20 | static inline gboolean 21 | org_freedesktop_DBus_Introspectable_introspect (DBusGProxy *proxy, char ** OUT_data, GError **error) 22 | 23 | { 24 | return dbus_g_proxy_call (proxy, "Introspect", error, G_TYPE_INVALID, G_TYPE_STRING, OUT_data, G_TYPE_INVALID); 25 | } 26 | 27 | typedef void (*org_freedesktop_DBus_Introspectable_introspect_reply) (DBusGProxy *proxy, char * OUT_data, GError *error, gpointer userdata); 28 | 29 | static void 30 | org_freedesktop_DBus_Introspectable_introspect_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) 31 | { 32 | DBusGAsyncData *data = (DBusGAsyncData*) user_data; 33 | GError *error = NULL; 34 | char * OUT_data; 35 | dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_data, G_TYPE_INVALID); 36 | (*(org_freedesktop_DBus_Introspectable_introspect_reply)data->cb) (proxy, OUT_data, error, data->userdata); 37 | return; 38 | } 39 | 40 | static inline DBusGProxyCall* 41 | org_freedesktop_DBus_Introspectable_introspect_async (DBusGProxy *proxy, org_freedesktop_DBus_Introspectable_introspect_reply callback, gpointer userdata) 42 | 43 | { 44 | DBusGAsyncData *stuff; 45 | stuff = g_slice_new (DBusGAsyncData); 46 | stuff->cb = G_CALLBACK (callback); 47 | stuff->userdata = userdata; 48 | return dbus_g_proxy_begin_call (proxy, "Introspect", org_freedesktop_DBus_Introspectable_introspect_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID); 49 | } 50 | #endif /* defined DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_DBus_Introspectable */ 51 | 52 | #ifndef DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_DBus 53 | #define DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_DBus 54 | 55 | static inline gboolean 56 | org_freedesktop_DBus_request_name (DBusGProxy *proxy, const char * IN_arg0, const guint IN_arg1, guint* OUT_arg2, GError **error) 57 | 58 | { 59 | return dbus_g_proxy_call (proxy, "RequestName", error, G_TYPE_STRING, IN_arg0, G_TYPE_UINT, IN_arg1, G_TYPE_INVALID, G_TYPE_UINT, OUT_arg2, G_TYPE_INVALID); 60 | } 61 | 62 | typedef void (*org_freedesktop_DBus_request_name_reply) (DBusGProxy *proxy, guint OUT_arg2, GError *error, gpointer userdata); 63 | 64 | static void 65 | org_freedesktop_DBus_request_name_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) 66 | { 67 | DBusGAsyncData *data = (DBusGAsyncData*) user_data; 68 | GError *error = NULL; 69 | guint OUT_arg2; 70 | dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_UINT, &OUT_arg2, G_TYPE_INVALID); 71 | (*(org_freedesktop_DBus_request_name_reply)data->cb) (proxy, OUT_arg2, error, data->userdata); 72 | return; 73 | } 74 | 75 | static inline DBusGProxyCall* 76 | org_freedesktop_DBus_request_name_async (DBusGProxy *proxy, const char * IN_arg0, const guint IN_arg1, org_freedesktop_DBus_request_name_reply callback, gpointer userdata) 77 | 78 | { 79 | DBusGAsyncData *stuff; 80 | stuff = g_slice_new (DBusGAsyncData); 81 | stuff->cb = G_CALLBACK (callback); 82 | stuff->userdata = userdata; 83 | return dbus_g_proxy_begin_call (proxy, "RequestName", org_freedesktop_DBus_request_name_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_arg0, G_TYPE_UINT, IN_arg1, G_TYPE_INVALID); 84 | } 85 | static inline gboolean 86 | org_freedesktop_DBus_release_name (DBusGProxy *proxy, const char * IN_arg0, guint* OUT_arg1, GError **error) 87 | 88 | { 89 | return dbus_g_proxy_call (proxy, "ReleaseName", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, G_TYPE_UINT, OUT_arg1, G_TYPE_INVALID); 90 | } 91 | 92 | typedef void (*org_freedesktop_DBus_release_name_reply) (DBusGProxy *proxy, guint OUT_arg1, GError *error, gpointer userdata); 93 | 94 | static void 95 | org_freedesktop_DBus_release_name_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) 96 | { 97 | DBusGAsyncData *data = (DBusGAsyncData*) user_data; 98 | GError *error = NULL; 99 | guint OUT_arg1; 100 | dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_UINT, &OUT_arg1, G_TYPE_INVALID); 101 | (*(org_freedesktop_DBus_release_name_reply)data->cb) (proxy, OUT_arg1, error, data->userdata); 102 | return; 103 | } 104 | 105 | static inline DBusGProxyCall* 106 | org_freedesktop_DBus_release_name_async (DBusGProxy *proxy, const char * IN_arg0, org_freedesktop_DBus_release_name_reply callback, gpointer userdata) 107 | 108 | { 109 | DBusGAsyncData *stuff; 110 | stuff = g_slice_new (DBusGAsyncData); 111 | stuff->cb = G_CALLBACK (callback); 112 | stuff->userdata = userdata; 113 | return dbus_g_proxy_begin_call (proxy, "ReleaseName", org_freedesktop_DBus_release_name_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID); 114 | } 115 | static inline gboolean 116 | org_freedesktop_DBus_start_service_by_name (DBusGProxy *proxy, const char * IN_arg0, const guint IN_arg1, guint* OUT_arg2, GError **error) 117 | 118 | { 119 | return dbus_g_proxy_call (proxy, "StartServiceByName", error, G_TYPE_STRING, IN_arg0, G_TYPE_UINT, IN_arg1, G_TYPE_INVALID, G_TYPE_UINT, OUT_arg2, G_TYPE_INVALID); 120 | } 121 | 122 | typedef void (*org_freedesktop_DBus_start_service_by_name_reply) (DBusGProxy *proxy, guint OUT_arg2, GError *error, gpointer userdata); 123 | 124 | static void 125 | org_freedesktop_DBus_start_service_by_name_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) 126 | { 127 | DBusGAsyncData *data = (DBusGAsyncData*) user_data; 128 | GError *error = NULL; 129 | guint OUT_arg2; 130 | dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_UINT, &OUT_arg2, G_TYPE_INVALID); 131 | (*(org_freedesktop_DBus_start_service_by_name_reply)data->cb) (proxy, OUT_arg2, error, data->userdata); 132 | return; 133 | } 134 | 135 | static inline DBusGProxyCall* 136 | org_freedesktop_DBus_start_service_by_name_async (DBusGProxy *proxy, const char * IN_arg0, const guint IN_arg1, org_freedesktop_DBus_start_service_by_name_reply callback, gpointer userdata) 137 | 138 | { 139 | DBusGAsyncData *stuff; 140 | stuff = g_slice_new (DBusGAsyncData); 141 | stuff->cb = G_CALLBACK (callback); 142 | stuff->userdata = userdata; 143 | return dbus_g_proxy_begin_call (proxy, "StartServiceByName", org_freedesktop_DBus_start_service_by_name_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_arg0, G_TYPE_UINT, IN_arg1, G_TYPE_INVALID); 144 | } 145 | static inline gboolean 146 | org_freedesktop_DBus_hello (DBusGProxy *proxy, char ** OUT_arg0, GError **error) 147 | 148 | { 149 | return dbus_g_proxy_call (proxy, "Hello", error, G_TYPE_INVALID, G_TYPE_STRING, OUT_arg0, G_TYPE_INVALID); 150 | } 151 | 152 | typedef void (*org_freedesktop_DBus_hello_reply) (DBusGProxy *proxy, char * OUT_arg0, GError *error, gpointer userdata); 153 | 154 | static void 155 | org_freedesktop_DBus_hello_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) 156 | { 157 | DBusGAsyncData *data = (DBusGAsyncData*) user_data; 158 | GError *error = NULL; 159 | char * OUT_arg0; 160 | dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_arg0, G_TYPE_INVALID); 161 | (*(org_freedesktop_DBus_hello_reply)data->cb) (proxy, OUT_arg0, error, data->userdata); 162 | return; 163 | } 164 | 165 | static inline DBusGProxyCall* 166 | org_freedesktop_DBus_hello_async (DBusGProxy *proxy, org_freedesktop_DBus_hello_reply callback, gpointer userdata) 167 | 168 | { 169 | DBusGAsyncData *stuff; 170 | stuff = g_slice_new (DBusGAsyncData); 171 | stuff->cb = G_CALLBACK (callback); 172 | stuff->userdata = userdata; 173 | return dbus_g_proxy_begin_call (proxy, "Hello", org_freedesktop_DBus_hello_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID); 174 | } 175 | static inline gboolean 176 | org_freedesktop_DBus_name_has_owner (DBusGProxy *proxy, const char * IN_arg0, gboolean* OUT_arg1, GError **error) 177 | 178 | { 179 | return dbus_g_proxy_call (proxy, "NameHasOwner", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, G_TYPE_BOOLEAN, OUT_arg1, G_TYPE_INVALID); 180 | } 181 | 182 | typedef void (*org_freedesktop_DBus_name_has_owner_reply) (DBusGProxy *proxy, gboolean OUT_arg1, GError *error, gpointer userdata); 183 | 184 | static void 185 | org_freedesktop_DBus_name_has_owner_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) 186 | { 187 | DBusGAsyncData *data = (DBusGAsyncData*) user_data; 188 | GError *error = NULL; 189 | gboolean OUT_arg1; 190 | dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_BOOLEAN, &OUT_arg1, G_TYPE_INVALID); 191 | (*(org_freedesktop_DBus_name_has_owner_reply)data->cb) (proxy, OUT_arg1, error, data->userdata); 192 | return; 193 | } 194 | 195 | static inline DBusGProxyCall* 196 | org_freedesktop_DBus_name_has_owner_async (DBusGProxy *proxy, const char * IN_arg0, org_freedesktop_DBus_name_has_owner_reply callback, gpointer userdata) 197 | 198 | { 199 | DBusGAsyncData *stuff; 200 | stuff = g_slice_new (DBusGAsyncData); 201 | stuff->cb = G_CALLBACK (callback); 202 | stuff->userdata = userdata; 203 | return dbus_g_proxy_begin_call (proxy, "NameHasOwner", org_freedesktop_DBus_name_has_owner_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID); 204 | } 205 | static inline gboolean 206 | org_freedesktop_DBus_list_names (DBusGProxy *proxy, char *** OUT_arg0, GError **error) 207 | 208 | { 209 | return dbus_g_proxy_call (proxy, "ListNames", error, G_TYPE_INVALID, G_TYPE_STRV, OUT_arg0, G_TYPE_INVALID); 210 | } 211 | 212 | typedef void (*org_freedesktop_DBus_list_names_reply) (DBusGProxy *proxy, char * *OUT_arg0, GError *error, gpointer userdata); 213 | 214 | static void 215 | org_freedesktop_DBus_list_names_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) 216 | { 217 | DBusGAsyncData *data = (DBusGAsyncData*) user_data; 218 | GError *error = NULL; 219 | char ** OUT_arg0; 220 | dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRV, &OUT_arg0, G_TYPE_INVALID); 221 | (*(org_freedesktop_DBus_list_names_reply)data->cb) (proxy, OUT_arg0, error, data->userdata); 222 | return; 223 | } 224 | 225 | static inline DBusGProxyCall* 226 | org_freedesktop_DBus_list_names_async (DBusGProxy *proxy, org_freedesktop_DBus_list_names_reply callback, gpointer userdata) 227 | 228 | { 229 | DBusGAsyncData *stuff; 230 | stuff = g_slice_new (DBusGAsyncData); 231 | stuff->cb = G_CALLBACK (callback); 232 | stuff->userdata = userdata; 233 | return dbus_g_proxy_begin_call (proxy, "ListNames", org_freedesktop_DBus_list_names_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID); 234 | } 235 | static inline gboolean 236 | org_freedesktop_DBus_list_activatable_names (DBusGProxy *proxy, char *** OUT_arg0, GError **error) 237 | 238 | { 239 | return dbus_g_proxy_call (proxy, "ListActivatableNames", error, G_TYPE_INVALID, G_TYPE_STRV, OUT_arg0, G_TYPE_INVALID); 240 | } 241 | 242 | typedef void (*org_freedesktop_DBus_list_activatable_names_reply) (DBusGProxy *proxy, char * *OUT_arg0, GError *error, gpointer userdata); 243 | 244 | static void 245 | org_freedesktop_DBus_list_activatable_names_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) 246 | { 247 | DBusGAsyncData *data = (DBusGAsyncData*) user_data; 248 | GError *error = NULL; 249 | char ** OUT_arg0; 250 | dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRV, &OUT_arg0, G_TYPE_INVALID); 251 | (*(org_freedesktop_DBus_list_activatable_names_reply)data->cb) (proxy, OUT_arg0, error, data->userdata); 252 | return; 253 | } 254 | 255 | static inline DBusGProxyCall* 256 | org_freedesktop_DBus_list_activatable_names_async (DBusGProxy *proxy, org_freedesktop_DBus_list_activatable_names_reply callback, gpointer userdata) 257 | 258 | { 259 | DBusGAsyncData *stuff; 260 | stuff = g_slice_new (DBusGAsyncData); 261 | stuff->cb = G_CALLBACK (callback); 262 | stuff->userdata = userdata; 263 | return dbus_g_proxy_begin_call (proxy, "ListActivatableNames", org_freedesktop_DBus_list_activatable_names_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID); 264 | } 265 | static inline gboolean 266 | org_freedesktop_DBus_add_match (DBusGProxy *proxy, const char * IN_arg0, GError **error) 267 | 268 | { 269 | return dbus_g_proxy_call (proxy, "AddMatch", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, G_TYPE_INVALID); 270 | } 271 | 272 | typedef void (*org_freedesktop_DBus_add_match_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); 273 | 274 | static void 275 | org_freedesktop_DBus_add_match_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) 276 | { 277 | DBusGAsyncData *data = (DBusGAsyncData*) user_data; 278 | GError *error = NULL; 279 | dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); 280 | (*(org_freedesktop_DBus_add_match_reply)data->cb) (proxy, error, data->userdata); 281 | return; 282 | } 283 | 284 | static inline DBusGProxyCall* 285 | org_freedesktop_DBus_add_match_async (DBusGProxy *proxy, const char * IN_arg0, org_freedesktop_DBus_add_match_reply callback, gpointer userdata) 286 | 287 | { 288 | DBusGAsyncData *stuff; 289 | stuff = g_slice_new (DBusGAsyncData); 290 | stuff->cb = G_CALLBACK (callback); 291 | stuff->userdata = userdata; 292 | return dbus_g_proxy_begin_call (proxy, "AddMatch", org_freedesktop_DBus_add_match_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID); 293 | } 294 | static inline gboolean 295 | org_freedesktop_DBus_remove_match (DBusGProxy *proxy, const char * IN_arg0, GError **error) 296 | 297 | { 298 | return dbus_g_proxy_call (proxy, "RemoveMatch", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, G_TYPE_INVALID); 299 | } 300 | 301 | typedef void (*org_freedesktop_DBus_remove_match_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); 302 | 303 | static void 304 | org_freedesktop_DBus_remove_match_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) 305 | { 306 | DBusGAsyncData *data = (DBusGAsyncData*) user_data; 307 | GError *error = NULL; 308 | dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); 309 | (*(org_freedesktop_DBus_remove_match_reply)data->cb) (proxy, error, data->userdata); 310 | return; 311 | } 312 | 313 | static inline DBusGProxyCall* 314 | org_freedesktop_DBus_remove_match_async (DBusGProxy *proxy, const char * IN_arg0, org_freedesktop_DBus_remove_match_reply callback, gpointer userdata) 315 | 316 | { 317 | DBusGAsyncData *stuff; 318 | stuff = g_slice_new (DBusGAsyncData); 319 | stuff->cb = G_CALLBACK (callback); 320 | stuff->userdata = userdata; 321 | return dbus_g_proxy_begin_call (proxy, "RemoveMatch", org_freedesktop_DBus_remove_match_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID); 322 | } 323 | static inline gboolean 324 | org_freedesktop_DBus_get_name_owner (DBusGProxy *proxy, const char * IN_arg0, char ** OUT_arg1, GError **error) 325 | 326 | { 327 | return dbus_g_proxy_call (proxy, "GetNameOwner", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, G_TYPE_STRING, OUT_arg1, G_TYPE_INVALID); 328 | } 329 | 330 | typedef void (*org_freedesktop_DBus_get_name_owner_reply) (DBusGProxy *proxy, char * OUT_arg1, GError *error, gpointer userdata); 331 | 332 | static void 333 | org_freedesktop_DBus_get_name_owner_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) 334 | { 335 | DBusGAsyncData *data = (DBusGAsyncData*) user_data; 336 | GError *error = NULL; 337 | char * OUT_arg1; 338 | dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_arg1, G_TYPE_INVALID); 339 | (*(org_freedesktop_DBus_get_name_owner_reply)data->cb) (proxy, OUT_arg1, error, data->userdata); 340 | return; 341 | } 342 | 343 | static inline DBusGProxyCall* 344 | org_freedesktop_DBus_get_name_owner_async (DBusGProxy *proxy, const char * IN_arg0, org_freedesktop_DBus_get_name_owner_reply callback, gpointer userdata) 345 | 346 | { 347 | DBusGAsyncData *stuff; 348 | stuff = g_slice_new (DBusGAsyncData); 349 | stuff->cb = G_CALLBACK (callback); 350 | stuff->userdata = userdata; 351 | return dbus_g_proxy_begin_call (proxy, "GetNameOwner", org_freedesktop_DBus_get_name_owner_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID); 352 | } 353 | static inline gboolean 354 | org_freedesktop_DBus_list_queued_owners (DBusGProxy *proxy, const char * IN_arg0, char *** OUT_arg1, GError **error) 355 | 356 | { 357 | return dbus_g_proxy_call (proxy, "ListQueuedOwners", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, G_TYPE_STRV, OUT_arg1, G_TYPE_INVALID); 358 | } 359 | 360 | typedef void (*org_freedesktop_DBus_list_queued_owners_reply) (DBusGProxy *proxy, char * *OUT_arg1, GError *error, gpointer userdata); 361 | 362 | static void 363 | org_freedesktop_DBus_list_queued_owners_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) 364 | { 365 | DBusGAsyncData *data = (DBusGAsyncData*) user_data; 366 | GError *error = NULL; 367 | char ** OUT_arg1; 368 | dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRV, &OUT_arg1, G_TYPE_INVALID); 369 | (*(org_freedesktop_DBus_list_queued_owners_reply)data->cb) (proxy, OUT_arg1, error, data->userdata); 370 | return; 371 | } 372 | 373 | static inline DBusGProxyCall* 374 | org_freedesktop_DBus_list_queued_owners_async (DBusGProxy *proxy, const char * IN_arg0, org_freedesktop_DBus_list_queued_owners_reply callback, gpointer userdata) 375 | 376 | { 377 | DBusGAsyncData *stuff; 378 | stuff = g_slice_new (DBusGAsyncData); 379 | stuff->cb = G_CALLBACK (callback); 380 | stuff->userdata = userdata; 381 | return dbus_g_proxy_begin_call (proxy, "ListQueuedOwners", org_freedesktop_DBus_list_queued_owners_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID); 382 | } 383 | static inline gboolean 384 | org_freedesktop_DBus_get_connection_unix_user (DBusGProxy *proxy, const char * IN_arg0, guint* OUT_arg1, GError **error) 385 | 386 | { 387 | return dbus_g_proxy_call (proxy, "GetConnectionUnixUser", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, G_TYPE_UINT, OUT_arg1, G_TYPE_INVALID); 388 | } 389 | 390 | typedef void (*org_freedesktop_DBus_get_connection_unix_user_reply) (DBusGProxy *proxy, guint OUT_arg1, GError *error, gpointer userdata); 391 | 392 | static void 393 | org_freedesktop_DBus_get_connection_unix_user_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) 394 | { 395 | DBusGAsyncData *data = (DBusGAsyncData*) user_data; 396 | GError *error = NULL; 397 | guint OUT_arg1; 398 | dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_UINT, &OUT_arg1, G_TYPE_INVALID); 399 | (*(org_freedesktop_DBus_get_connection_unix_user_reply)data->cb) (proxy, OUT_arg1, error, data->userdata); 400 | return; 401 | } 402 | 403 | static inline DBusGProxyCall* 404 | org_freedesktop_DBus_get_connection_unix_user_async (DBusGProxy *proxy, const char * IN_arg0, org_freedesktop_DBus_get_connection_unix_user_reply callback, gpointer userdata) 405 | 406 | { 407 | DBusGAsyncData *stuff; 408 | stuff = g_slice_new (DBusGAsyncData); 409 | stuff->cb = G_CALLBACK (callback); 410 | stuff->userdata = userdata; 411 | return dbus_g_proxy_begin_call (proxy, "GetConnectionUnixUser", org_freedesktop_DBus_get_connection_unix_user_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID); 412 | } 413 | static inline gboolean 414 | org_freedesktop_DBus_get_connection_unix_process_id (DBusGProxy *proxy, const char * IN_arg0, guint* OUT_arg1, GError **error) 415 | 416 | { 417 | return dbus_g_proxy_call (proxy, "GetConnectionUnixProcessID", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, G_TYPE_UINT, OUT_arg1, G_TYPE_INVALID); 418 | } 419 | 420 | typedef void (*org_freedesktop_DBus_get_connection_unix_process_id_reply) (DBusGProxy *proxy, guint OUT_arg1, GError *error, gpointer userdata); 421 | 422 | static void 423 | org_freedesktop_DBus_get_connection_unix_process_id_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) 424 | { 425 | DBusGAsyncData *data = (DBusGAsyncData*) user_data; 426 | GError *error = NULL; 427 | guint OUT_arg1; 428 | dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_UINT, &OUT_arg1, G_TYPE_INVALID); 429 | (*(org_freedesktop_DBus_get_connection_unix_process_id_reply)data->cb) (proxy, OUT_arg1, error, data->userdata); 430 | return; 431 | } 432 | 433 | static inline DBusGProxyCall* 434 | org_freedesktop_DBus_get_connection_unix_process_id_async (DBusGProxy *proxy, const char * IN_arg0, org_freedesktop_DBus_get_connection_unix_process_id_reply callback, gpointer userdata) 435 | 436 | { 437 | DBusGAsyncData *stuff; 438 | stuff = g_slice_new (DBusGAsyncData); 439 | stuff->cb = G_CALLBACK (callback); 440 | stuff->userdata = userdata; 441 | return dbus_g_proxy_begin_call (proxy, "GetConnectionUnixProcessID", org_freedesktop_DBus_get_connection_unix_process_id_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID); 442 | } 443 | static inline gboolean 444 | org_freedesktop_DBus_get_connection_se_linux_security_context (DBusGProxy *proxy, const char * IN_arg0, GArray** OUT_arg1, GError **error) 445 | 446 | { 447 | return dbus_g_proxy_call (proxy, "GetConnectionSELinuxSecurityContext", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, dbus_g_type_get_collection ("GArray", G_TYPE_UCHAR), OUT_arg1, G_TYPE_INVALID); 448 | } 449 | 450 | typedef void (*org_freedesktop_DBus_get_connection_se_linux_security_context_reply) (DBusGProxy *proxy, GArray *OUT_arg1, GError *error, gpointer userdata); 451 | 452 | static void 453 | org_freedesktop_DBus_get_connection_se_linux_security_context_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) 454 | { 455 | DBusGAsyncData *data = (DBusGAsyncData*) user_data; 456 | GError *error = NULL; 457 | GArray* OUT_arg1; 458 | dbus_g_proxy_end_call (proxy, call, &error, dbus_g_type_get_collection ("GArray", G_TYPE_UCHAR), &OUT_arg1, G_TYPE_INVALID); 459 | (*(org_freedesktop_DBus_get_connection_se_linux_security_context_reply)data->cb) (proxy, OUT_arg1, error, data->userdata); 460 | return; 461 | } 462 | 463 | static inline DBusGProxyCall* 464 | org_freedesktop_DBus_get_connection_se_linux_security_context_async (DBusGProxy *proxy, const char * IN_arg0, org_freedesktop_DBus_get_connection_se_linux_security_context_reply callback, gpointer userdata) 465 | 466 | { 467 | DBusGAsyncData *stuff; 468 | stuff = g_slice_new (DBusGAsyncData); 469 | stuff->cb = G_CALLBACK (callback); 470 | stuff->userdata = userdata; 471 | return dbus_g_proxy_begin_call (proxy, "GetConnectionSELinuxSecurityContext", org_freedesktop_DBus_get_connection_se_linux_security_context_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID); 472 | } 473 | static inline gboolean 474 | org_freedesktop_DBus_reload_config (DBusGProxy *proxy, GError **error) 475 | 476 | { 477 | return dbus_g_proxy_call (proxy, "ReloadConfig", error, G_TYPE_INVALID, G_TYPE_INVALID); 478 | } 479 | 480 | typedef void (*org_freedesktop_DBus_reload_config_reply) (DBusGProxy *proxy, GError *error, gpointer userdata); 481 | 482 | static void 483 | org_freedesktop_DBus_reload_config_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data) 484 | { 485 | DBusGAsyncData *data = (DBusGAsyncData*) user_data; 486 | GError *error = NULL; 487 | dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); 488 | (*(org_freedesktop_DBus_reload_config_reply)data->cb) (proxy, error, data->userdata); 489 | return; 490 | } 491 | 492 | static inline DBusGProxyCall* 493 | org_freedesktop_DBus_reload_config_async (DBusGProxy *proxy, org_freedesktop_DBus_reload_config_reply callback, gpointer userdata) 494 | 495 | { 496 | DBusGAsyncData *stuff; 497 | stuff = g_slice_new (DBusGAsyncData); 498 | stuff->cb = G_CALLBACK (callback); 499 | stuff->userdata = userdata; 500 | return dbus_g_proxy_begin_call (proxy, "ReloadConfig", org_freedesktop_DBus_reload_config_async_callback, stuff, _dbus_glib_async_data_free, G_TYPE_INVALID); 501 | } 502 | #endif /* defined DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_DBus */ 503 | 504 | G_END_DECLS 505 | -------------------------------------------------------------------------------- /include/orig/dbus-glib-lowlevel.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu" -*- */ 2 | /* dbus-glib-lowlevel.h GLib integration details that require dbus/dbus.h 3 | * 4 | * Copyright (C) 2002, 2003 CodeFactory AB 5 | * Copyright (C) 2003, 2004 Red Hat, Inc. 6 | * 7 | * Licensed under the Academic Free License version 2.1 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | #ifndef DBUS_GLIB_LOWLEVEL_H 25 | #define DBUS_GLIB_LOWLEVEL_H 26 | 27 | #include 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | void dbus_set_g_error (GError **gerror, 33 | DBusError *derror); 34 | 35 | #define DBUS_TYPE_CONNECTION (dbus_connection_get_g_type ()) 36 | #define DBUS_TYPE_MESSAGE (dbus_message_get_g_type ()) 37 | GType dbus_connection_get_g_type (void) G_GNUC_CONST; 38 | GType dbus_message_get_g_type (void) G_GNUC_CONST; 39 | 40 | void dbus_connection_setup_with_g_main (DBusConnection *connection, 41 | GMainContext *context); 42 | void dbus_server_setup_with_g_main (DBusServer *server, 43 | GMainContext *context); 44 | 45 | void dbus_g_proxy_send (DBusGProxy *proxy, 46 | DBusMessage *message, 47 | dbus_uint32_t *client_serial); 48 | 49 | DBusConnection* dbus_g_connection_get_connection (DBusGConnection *gconnection); 50 | DBusGConnection* dbus_connection_get_g_connection (DBusConnection *connection); 51 | DBusMessage* dbus_g_message_get_message (DBusGMessage *gmessage); 52 | 53 | gchar* dbus_g_method_get_sender (DBusGMethodInvocation *context); 54 | 55 | DBusMessage* dbus_g_method_get_reply (DBusGMethodInvocation *context); 56 | 57 | void dbus_g_method_send_reply (DBusGMethodInvocation *context, 58 | DBusMessage *reply); 59 | 60 | G_END_DECLS 61 | 62 | #endif /* DBUS_GLIB_LOWLEVEL_H */ 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /include/orig/dbus-glib.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu" -*- */ 2 | /* dbus-glib.h GLib integration 3 | * 4 | * Copyright (C) 2002, 2003 CodeFactory AB 5 | * Copyright (C) 2003, 2004 Red Hat, Inc. 6 | * 7 | * Licensed under the Academic Free License version 2.1 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | #ifndef DBUS_GLIB_H 25 | #define DBUS_GLIB_H 26 | 27 | #include 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define DBUS_INSIDE_DBUS_GLIB_H 1 33 | 34 | 35 | /* 36 | * Convert to DBusConnection with dbus_g_connection_get_connection() in dbus-glib-lowlevel.h 37 | */ 38 | typedef struct _DBusGConnection DBusGConnection; 39 | /* 40 | * Convert to DBusMessage with dbus_g_message_get_message() in dbus-glib-lowlevel.h 41 | */ 42 | typedef struct _DBusGMessage DBusGMessage; 43 | 44 | 45 | #define DBUS_TYPE_G_CONNECTION (dbus_g_connection_get_g_type ()) 46 | #define DBUS_TYPE_G_MESSAGE (dbus_g_message_get_g_type ()) 47 | GType dbus_g_connection_get_g_type (void) G_GNUC_CONST; 48 | GType dbus_g_message_get_g_type (void) G_GNUC_CONST; 49 | 50 | 51 | DBusGConnection* dbus_g_connection_ref (DBusGConnection *connection); 52 | void dbus_g_connection_unref (DBusGConnection *connection); 53 | DBusGMessage* dbus_g_message_ref (DBusGMessage *message); 54 | void dbus_g_message_unref (DBusGMessage *message); 55 | 56 | void dbus_g_connection_flush (DBusGConnection *connection); 57 | 58 | GQuark dbus_g_error_quark (void); 59 | #define DBUS_GERROR dbus_g_error_quark () 60 | 61 | typedef enum 62 | { 63 | DBUS_GERROR_FAILED, 64 | DBUS_GERROR_NO_MEMORY, 65 | DBUS_GERROR_SERVICE_UNKNOWN, 66 | DBUS_GERROR_NAME_HAS_NO_OWNER, 67 | DBUS_GERROR_NO_REPLY, 68 | DBUS_GERROR_IO_ERROR, 69 | DBUS_GERROR_BAD_ADDRESS, 70 | DBUS_GERROR_NOT_SUPPORTED, 71 | DBUS_GERROR_LIMITS_EXCEEDED, 72 | DBUS_GERROR_ACCESS_DENIED, 73 | DBUS_GERROR_AUTH_FAILED, 74 | DBUS_GERROR_NO_SERVER, 75 | DBUS_GERROR_TIMEOUT, 76 | DBUS_GERROR_NO_NETWORK, 77 | DBUS_GERROR_ADDRESS_IN_USE, 78 | DBUS_GERROR_DISCONNECTED, 79 | DBUS_GERROR_INVALID_ARGS, 80 | DBUS_GERROR_FILE_NOT_FOUND, 81 | DBUS_GERROR_FILE_EXISTS, 82 | DBUS_GERROR_UNKNOWN_METHOD, 83 | DBUS_GERROR_TIMED_OUT, 84 | DBUS_GERROR_MATCH_RULE_NOT_FOUND, 85 | DBUS_GERROR_MATCH_RULE_INVALID, 86 | DBUS_GERROR_SPAWN_EXEC_FAILED, 87 | DBUS_GERROR_SPAWN_FORK_FAILED, 88 | DBUS_GERROR_SPAWN_CHILD_EXITED, 89 | DBUS_GERROR_SPAWN_CHILD_SIGNALED, 90 | DBUS_GERROR_SPAWN_FAILED, 91 | DBUS_GERROR_UNIX_PROCESS_ID_UNKNOWN, 92 | DBUS_GERROR_INVALID_SIGNATURE, 93 | DBUS_GERROR_INVALID_FILE_CONTENT, 94 | DBUS_GERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN, 95 | DBUS_GERROR_REMOTE_EXCEPTION 96 | } DBusGError; 97 | 98 | gboolean dbus_g_error_has_name (GError *error, 99 | const char *name); 100 | const char * dbus_g_error_get_name (GError *error); 101 | 102 | void dbus_g_thread_init (void); 103 | 104 | DBusGConnection* dbus_g_connection_open (const gchar *address, 105 | GError **error); 106 | DBusGConnection* dbus_g_connection_open_private (const gchar *address, 107 | GMainContext *context, 108 | GError **error); 109 | DBusGConnection* dbus_g_bus_get (DBusBusType type, 110 | GError **error); 111 | DBusGConnection* dbus_g_bus_get_private (DBusBusType type, 112 | GMainContext *context, 113 | GError **error); 114 | 115 | 116 | typedef struct _DBusGObjectInfo DBusGObjectInfo; 117 | typedef struct _DBusGMethodInfo DBusGMethodInfo; 118 | 119 | /** 120 | * DBusGMethodInfo: 121 | * @function: C method to invoke 122 | * @marshaller: Marshaller to invoke method 123 | * @data_offset: Offset into the introspection data 124 | * 125 | * Object typically generated by #dbus-binding-tool that 126 | * stores a mapping from introspection data to a 127 | * function pointer for a C method to be invoked. 128 | */ 129 | struct _DBusGMethodInfo 130 | { 131 | GCallback function; 132 | GClosureMarshal marshaller; 133 | int data_offset; 134 | }; 135 | 136 | /** 137 | * DBusGObjectInfo: 138 | * @format_version: Allows us to change the rest of this struct 139 | * by adding DBusGObjectInfo2, DBusGObjectInfo3, etc. 140 | * @method_infos: Array of method pointers 141 | * @n_method_infos: Length of the infos array 142 | * @data: Introspection data 143 | * @exported_signals: Exported signals 144 | * @exported_properties: Exported properties 145 | * 146 | * Introspection data for a #GObject, normally autogenerated by 147 | * a tool such as #dbus-binding-tool. 148 | */ 149 | struct _DBusGObjectInfo 150 | { 151 | int format_version; 152 | 153 | const DBusGMethodInfo *method_infos; 154 | int n_method_infos; 155 | const char *data; 156 | const char *exported_signals; 157 | const char *exported_properties; 158 | }; 159 | 160 | void dbus_glib_global_set_disable_legacy_property_access (void); 161 | 162 | void dbus_g_object_type_install_info (GType object_type, 163 | const DBusGObjectInfo *info); 164 | 165 | void dbus_g_object_type_register_shadow_property (GType iface_type, 166 | const char *dbus_prop_name, 167 | const char *shadow_prop_name); 168 | 169 | void dbus_g_error_domain_register (GQuark domain, 170 | const char * default_iface, 171 | GType code_enum); 172 | 173 | void dbus_g_connection_register_g_object (DBusGConnection *connection, 174 | const char *at_path, 175 | GObject *object); 176 | void dbus_g_connection_unregister_g_object (DBusGConnection *connection, 177 | GObject *object); 178 | GObject * dbus_g_connection_lookup_g_object (DBusGConnection *connection, 179 | const char *at_path); 180 | 181 | #ifdef DBUS_COMPILATION 182 | #include "dbus/dbus-gtype-specialized.h" 183 | #else 184 | #include 185 | #endif 186 | 187 | /* definitions for some basic array types */ 188 | #define DBUS_TYPE_G_BOOLEAN_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_BOOLEAN)) 189 | #define DBUS_TYPE_G_UCHAR_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_UCHAR)) 190 | #define DBUS_TYPE_G_UINT_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_UINT)) 191 | #define DBUS_TYPE_G_INT_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_INT)) 192 | #define DBUS_TYPE_G_UINT64_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_UINT64)) 193 | #define DBUS_TYPE_G_INT64_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_INT64)) 194 | #define DBUS_TYPE_G_OBJECT_ARRAY (dbus_g_type_get_collection ("GPtrArray", G_TYPE_OBJECT)) 195 | 196 | #define DBUS_TYPE_G_STRING_STRING_HASHTABLE (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING)) 197 | 198 | typedef gchar DBusGObjectPath; 199 | GType dbus_g_object_path_get_g_type (void) G_GNUC_CONST; 200 | #define DBUS_TYPE_G_OBJECT_PATH (dbus_g_object_path_get_g_type ()) 201 | 202 | typedef gchar DBusGSignature; 203 | GType dbus_g_signature_get_g_type (void) G_GNUC_CONST; 204 | #define DBUS_TYPE_G_SIGNATURE (dbus_g_signature_get_g_type ()) 205 | 206 | void dbus_g_object_register_marshaller (GClosureMarshal marshaller, 207 | GType rettype, 208 | ...); 209 | void dbus_g_object_register_marshaller_array(GClosureMarshal marshaller, 210 | GType rettype, 211 | guint n_types, 212 | const GType* types); 213 | 214 | typedef struct _DBusGProxy DBusGProxy; 215 | typedef struct _DBusGProxyClass DBusGProxyClass; 216 | 217 | #define DBUS_TYPE_G_PROXY (dbus_g_proxy_get_type ()) 218 | #define DBUS_G_PROXY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), DBUS_TYPE_G_PROXY, DBusGProxy)) 219 | #define DBUS_G_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DBUS_TYPE_G_PROXY, DBusGProxyClass)) 220 | #define DBUS_IS_G_PROXY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), DBUS_TYPE_G_PROXY)) 221 | #define DBUS_IS_G_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUS_TYPE_G_PROXY)) 222 | #define DBUS_G_PROXY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUS_TYPE_G_PROXY, DBusGProxyClass)) 223 | 224 | struct _DBusGProxy 225 | { 226 | /*< private >*/ 227 | GObject parent; 228 | }; 229 | 230 | struct _DBusGProxyClass 231 | { 232 | /*< private >*/ 233 | GObjectClass parent_class; /**< Parent class */ 234 | }; 235 | 236 | typedef struct _DBusGProxyCall DBusGProxyCall; 237 | typedef void (* DBusGProxyCallNotify) (DBusGProxy *proxy, 238 | DBusGProxyCall *call_id, 239 | void *user_data); 240 | 241 | GType dbus_g_proxy_get_type (void) G_GNUC_CONST; 242 | DBusGProxy* dbus_g_proxy_new_for_name (DBusGConnection *connection, 243 | const char *name, 244 | const char *path, 245 | const char *iface); 246 | DBusGProxy* dbus_g_proxy_new_for_name_owner (DBusGConnection *connection, 247 | const char *name, 248 | const char *path, 249 | const char *iface, 250 | GError **error); 251 | DBusGProxy* dbus_g_proxy_new_from_proxy (DBusGProxy *proxy, 252 | const char *iface, 253 | const char *path); 254 | DBusGProxy* dbus_g_proxy_new_for_peer (DBusGConnection *connection, 255 | const char *path, 256 | const char *iface); 257 | 258 | void dbus_g_proxy_set_interface (DBusGProxy *proxy, 259 | const char *interface_name); 260 | void dbus_g_proxy_add_signal (DBusGProxy *proxy, 261 | const char *signal_name, 262 | GType first_type, 263 | ...); 264 | 265 | void dbus_g_proxy_connect_signal (DBusGProxy *proxy, 266 | const char *signal_name, 267 | GCallback handler, 268 | void *data, 269 | GClosureNotify free_data_func); 270 | void dbus_g_proxy_disconnect_signal (DBusGProxy *proxy, 271 | const char *signal_name, 272 | GCallback handler, 273 | void *data); 274 | 275 | gboolean dbus_g_proxy_call (DBusGProxy *proxy, 276 | const char *method, 277 | GError **error, 278 | GType first_arg_type, 279 | ...); 280 | 281 | gboolean dbus_g_proxy_call_with_timeout (DBusGProxy *proxy, 282 | const char *method, 283 | int timeout, 284 | GError **error, 285 | GType first_arg_type, 286 | ...); 287 | 288 | void dbus_g_proxy_call_no_reply (DBusGProxy *proxy, 289 | const char *method, 290 | GType first_arg_type, 291 | ...); 292 | 293 | DBusGProxyCall * dbus_g_proxy_begin_call (DBusGProxy *proxy, 294 | const char *method, 295 | DBusGProxyCallNotify notify, 296 | gpointer user_data, 297 | GDestroyNotify destroy, 298 | GType first_arg_type, 299 | ...); 300 | DBusGProxyCall * dbus_g_proxy_begin_call_with_timeout (DBusGProxy *proxy, 301 | const char *method, 302 | DBusGProxyCallNotify notify, 303 | gpointer user_data, 304 | GDestroyNotify destroy, 305 | int timeout, 306 | GType first_arg_type, 307 | ...); 308 | 309 | void dbus_g_proxy_set_default_timeout (DBusGProxy *proxy, 310 | int timeout); 311 | 312 | gboolean dbus_g_proxy_end_call (DBusGProxy *proxy, 313 | DBusGProxyCall *call, 314 | GError **error, 315 | GType first_arg_type, 316 | ...); 317 | void dbus_g_proxy_cancel_call (DBusGProxy *proxy, 318 | DBusGProxyCall *call); 319 | 320 | const char* dbus_g_proxy_get_path (DBusGProxy *proxy); 321 | 322 | const char* dbus_g_proxy_get_bus_name (DBusGProxy *proxy); 323 | 324 | const char* dbus_g_proxy_get_interface (DBusGProxy *proxy); 325 | 326 | typedef struct _DBusGMethodInvocation DBusGMethodInvocation; 327 | 328 | void dbus_g_method_return (DBusGMethodInvocation *context, ...); 329 | 330 | void dbus_g_method_return_error (DBusGMethodInvocation *context, const GError *error); 331 | 332 | DBusGConnection * dbus_g_method_invocation_get_g_connection (DBusGMethodInvocation *context); 333 | 334 | /* Probably possible to replace this with a closure */ 335 | typedef struct { 336 | GCallback cb; 337 | gpointer userdata; 338 | } DBusGAsyncData; 339 | 340 | #undef DBUS_INSIDE_DBUS_GLIB_H 341 | 342 | #include 343 | 344 | G_END_DECLS 345 | 346 | #endif /* DBUS_GLIB_H */ 347 | -------------------------------------------------------------------------------- /include/orig/dbus-gtype-specialized.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu" -*- */ 2 | /* dbus-gtype-specialized.h: Non-DBus-specific functions for specialized GTypes 3 | * 4 | * Copyright (C) 2005 Red Hat, Inc. 5 | * 6 | * Licensed under the Academic Free License version 2.1 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | 24 | #ifndef DBUS_GOBJECT_TYPE_SPECIALIZED_H 25 | #define DBUS_GOBJECT_TYPE_SPECIALIZED_H 26 | 27 | #include 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | GType dbus_g_type_get_collection (const char *container, 33 | GType specialization); 34 | GType dbus_g_type_get_map (const char *container, 35 | GType key_specialization, 36 | GType value_specialization); 37 | GType dbus_g_type_get_structv (const char *container, 38 | guint num_members, 39 | GType *types); 40 | GType dbus_g_type_get_struct (const char *container, 41 | GType first_type, 42 | ...); 43 | gboolean dbus_g_type_is_collection (GType gtype); 44 | gboolean dbus_g_type_is_map (GType gtype); 45 | gboolean dbus_g_type_is_struct (GType gtype); 46 | GType dbus_g_type_get_collection_specialization (GType gtype); 47 | GType dbus_g_type_get_map_key_specialization (GType gtype); 48 | GType dbus_g_type_get_map_value_specialization (GType gtype); 49 | GType dbus_g_type_get_struct_member_type (GType gtype, 50 | guint member); 51 | guint dbus_g_type_get_struct_size (GType gtype); 52 | 53 | typedef void (*DBusGTypeSpecializedCollectionIterator) (const GValue *value, 54 | gpointer user_data); 55 | typedef void (*DBusGTypeSpecializedMapIterator) (const GValue *key_val, 56 | const GValue *value_val, 57 | gpointer user_data); 58 | 59 | gpointer dbus_g_type_specialized_construct (GType gtype); 60 | 61 | typedef struct { 62 | /* public */ 63 | GValue *val; 64 | GType specialization_type; 65 | /*< private >*/ 66 | /* padding */ 67 | gpointer b; 68 | guint c; 69 | gpointer d; 70 | } DBusGTypeSpecializedAppendContext; 71 | 72 | void dbus_g_type_specialized_init_append (GValue *value, DBusGTypeSpecializedAppendContext *ctx); 73 | 74 | void dbus_g_type_specialized_collection_append (DBusGTypeSpecializedAppendContext *ctx, GValue *elt); 75 | 76 | void dbus_g_type_specialized_collection_end_append (DBusGTypeSpecializedAppendContext *ctx); 77 | 78 | void dbus_g_type_specialized_map_append (DBusGTypeSpecializedAppendContext *ctx, 79 | GValue *key, 80 | GValue *val); 81 | 82 | 83 | gboolean dbus_g_type_collection_get_fixed (GValue *value, 84 | gpointer *data_ret, 85 | guint *len_ret); 86 | 87 | void dbus_g_type_collection_value_iterate (const GValue *value, 88 | DBusGTypeSpecializedCollectionIterator iterator, 89 | gpointer user_data); 90 | 91 | void dbus_g_type_map_value_iterate (const GValue *value, 92 | DBusGTypeSpecializedMapIterator iterator, 93 | gpointer user_data); 94 | 95 | gboolean dbus_g_type_struct_get_member (const GValue *value, 96 | guint member, 97 | GValue *dest); 98 | gboolean dbus_g_type_struct_set_member (GValue *value, 99 | guint member, 100 | const GValue *src); 101 | 102 | gboolean dbus_g_type_struct_get (const GValue *value, 103 | guint member, 104 | ...); 105 | 106 | gboolean dbus_g_type_struct_set (GValue *value, 107 | guint member, 108 | ...); 109 | 110 | typedef gpointer (*DBusGTypeSpecializedConstructor) (GType type); 111 | typedef void (*DBusGTypeSpecializedFreeFunc) (GType type, gpointer val); 112 | typedef gpointer (*DBusGTypeSpecializedCopyFunc) (GType type, gpointer src); 113 | 114 | typedef struct { 115 | DBusGTypeSpecializedConstructor constructor; 116 | DBusGTypeSpecializedFreeFunc free_func; 117 | DBusGTypeSpecializedCopyFunc copy_func; 118 | GDestroyNotify simple_free_func; /* for type-independent freeing if possible */ 119 | /**/ 120 | gpointer padding2; 121 | gpointer padding3; 122 | } DBusGTypeSpecializedVtable; 123 | 124 | typedef gboolean (*DBusGTypeSpecializedCollectionFixedAccessorFunc) (GType type, gpointer instance, gpointer *values, guint *len); 125 | typedef void (*DBusGTypeSpecializedCollectionIteratorFunc) (GType type, gpointer instance, DBusGTypeSpecializedCollectionIterator iterator, gpointer user_data); 126 | typedef void (*DBusGTypeSpecializedCollectionAppendFunc) (DBusGTypeSpecializedAppendContext *ctx, GValue *val); 127 | typedef void (*DBusGTypeSpecializedCollectionEndAppendFunc) (DBusGTypeSpecializedAppendContext *ctx); 128 | 129 | typedef struct { 130 | DBusGTypeSpecializedVtable base_vtable; 131 | DBusGTypeSpecializedCollectionFixedAccessorFunc fixed_accessor; 132 | DBusGTypeSpecializedCollectionIteratorFunc iterator; 133 | DBusGTypeSpecializedCollectionAppendFunc append_func; 134 | DBusGTypeSpecializedCollectionEndAppendFunc end_append_func; 135 | } DBusGTypeSpecializedCollectionVtable; 136 | 137 | typedef void (*DBusGTypeSpecializedMapIteratorFunc) (GType type, gpointer instance, DBusGTypeSpecializedMapIterator iterator, gpointer user_data); 138 | typedef void (*DBusGTypeSpecializedMapAppendFunc) (DBusGTypeSpecializedAppendContext *ctx, GValue *key, GValue *val); 139 | 140 | typedef struct { 141 | DBusGTypeSpecializedVtable base_vtable; 142 | DBusGTypeSpecializedMapIteratorFunc iterator; 143 | DBusGTypeSpecializedMapAppendFunc append_func; 144 | } DBusGTypeSpecializedMapVtable; 145 | 146 | typedef gboolean (*DBusGTypeSpecializedStructGetMember) (GType type, gpointer instance, guint member, GValue *ret_value); 147 | typedef gboolean (*DBusGTypeSpecializedStructSetMember) (GType type, gpointer instance, guint member, const GValue *new_value); 148 | 149 | typedef struct { 150 | DBusGTypeSpecializedVtable base_vtable; 151 | DBusGTypeSpecializedStructGetMember get_member; 152 | DBusGTypeSpecializedStructSetMember set_member; 153 | } DBusGTypeSpecializedStructVtable; 154 | 155 | void dbus_g_type_specialized_init (void); 156 | 157 | void dbus_g_type_register_collection (const char *name, 158 | const DBusGTypeSpecializedCollectionVtable *vtable, 159 | guint flags); 160 | 161 | void dbus_g_type_register_map (const char *name, 162 | const DBusGTypeSpecializedMapVtable *vtable, 163 | guint flags); 164 | 165 | void dbus_g_type_register_struct (const char *name, 166 | const DBusGTypeSpecializedStructVtable *vtable, 167 | guint flags); 168 | 169 | const DBusGTypeSpecializedMapVtable* dbus_g_type_map_peek_vtable (GType map_type); 170 | const DBusGTypeSpecializedCollectionVtable* dbus_g_type_collection_peek_vtable (GType collection_type); 171 | 172 | const DBusGTypeSpecializedStructVtable* dbus_g_type_struct_peek_vtable (GType struct_type); 173 | 174 | GVariant *dbus_g_value_build_g_variant (const GValue *value); 175 | 176 | G_END_DECLS 177 | 178 | #endif 179 | -------------------------------------------------------------------------------- /include/orig/dbus-gvalue-parse-variant.h: -------------------------------------------------------------------------------- 1 | /* GVariant to dbus-glib escape hatch 2 | * 3 | * Copyright © 2010 Collabora Ltd. 4 | * 5 | * Licensed under the Academic Free License version 2.1 6 | * 7 | * This program is free software; you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation; either version 2 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Alternatively, at your option, you can redistribute and/or modify 13 | * this single file under the terms of the GNU Lesser General Public License 14 | * as published by the Free Software Foundation; either version 2.1 of 15 | * that license, or (at your option) any later version. 16 | * 17 | * This program is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with this program; if not, write to the Free Software 24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 25 | * 26 | */ 27 | 28 | #ifndef __DBUS_GVALUE_PARSE_VARIANT_H__ 29 | #define __DBUS_GVALUE_PARSE_VARIANT_H__ 30 | 31 | #include 32 | 33 | G_BEGIN_DECLS 34 | 35 | void dbus_g_value_parse_g_variant (GVariant *variant, GValue *value); 36 | 37 | G_END_DECLS 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /include/orig/dbus-macros.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 | /* dbus-macros.h generic macros 3 | * 4 | * Copyright (C) 2002 Red Hat Inc. 5 | * 6 | * Licensed under the Academic Free License version 2.1 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION) 24 | #error "Only can be included directly, this file may disappear or change contents." 25 | #endif 26 | 27 | #ifndef DBUS_MACROS_H 28 | #define DBUS_MACROS_H 29 | 30 | #ifdef __cplusplus 31 | # define DBUS_BEGIN_DECLS extern "C" { 32 | # define DBUS_END_DECLS } 33 | #else 34 | # define DBUS_BEGIN_DECLS 35 | # define DBUS_END_DECLS 36 | #endif 37 | 38 | #ifndef TRUE 39 | # define TRUE 1 40 | #endif 41 | #ifndef FALSE 42 | # define FALSE 0 43 | #endif 44 | 45 | #ifndef NULL 46 | # ifdef __cplusplus 47 | # define NULL (0L) 48 | # else /* !__cplusplus */ 49 | # define NULL ((void*) 0) 50 | # endif /* !__cplusplus */ 51 | #endif 52 | 53 | #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) 54 | # define DBUS_DEPRECATED __attribute__ ((__deprecated__)) 55 | #elif defined(_MSC_VER) && (_MSC_VER >= 1300) 56 | # define DBUS_DEPRECATED __declspec(deprecated) 57 | #else 58 | # define DBUS_DEPRECATED 59 | #endif 60 | 61 | #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8) 62 | # define _DBUS_GNUC_EXTENSION __extension__ 63 | #else 64 | # define _DBUS_GNUC_EXTENSION 65 | #endif 66 | 67 | #if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)) || \ 68 | defined(__clang__) 69 | #define _DBUS_GNUC_PRINTF( format_idx, arg_idx ) \ 70 | __attribute__((__format__ (__printf__, format_idx, arg_idx))) 71 | #define _DBUS_GNUC_NORETURN \ 72 | __attribute__((__noreturn__)) 73 | #define _DBUS_GNUC_UNUSED \ 74 | __attribute__((__unused__)) 75 | #else /* !__GNUC__ */ 76 | #define _DBUS_GNUC_PRINTF( format_idx, arg_idx ) 77 | #define _DBUS_GNUC_NORETURN 78 | #define _DBUS_GNUC_UNUSED 79 | #endif /* !__GNUC__ */ 80 | 81 | #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) 82 | #define DBUS_MALLOC __attribute__((__malloc__)) 83 | #else 84 | #define DBUS_MALLOC 85 | #endif 86 | 87 | #if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 88 | #define DBUS_ALLOC_SIZE(x) __attribute__((__alloc_size__(x))) 89 | #define DBUS_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y))) 90 | #else 91 | #define DBUS_ALLOC_SIZE(x) 92 | #define DBUS_ALLOC_SIZE2(x,y) 93 | #endif 94 | 95 | #if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) 96 | #define _DBUS_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) 97 | #else 98 | #define _DBUS_GNUC_WARN_UNUSED_RESULT 99 | #endif 100 | 101 | /** @def _DBUS_GNUC_PRINTF 102 | * used to tell gcc about printf format strings 103 | */ 104 | /** @def _DBUS_GNUC_NORETURN 105 | * used to tell gcc about functions that never return, such as _dbus_abort() 106 | */ 107 | /** @def _DBUS_GNUC_WARN_UNUSED_RESULT 108 | * used to tell gcc about functions whose result must be used 109 | */ 110 | 111 | /* Normally docs are in .c files, but there isn't a .c file for this. */ 112 | /** 113 | * @defgroup DBusMacros Utility macros 114 | * @ingroup DBus 115 | * @brief #TRUE, #FALSE, #NULL, and so on 116 | * 117 | * Utility macros. 118 | * 119 | * @{ 120 | */ 121 | 122 | /** 123 | * @def DBUS_BEGIN_DECLS 124 | * 125 | * Macro used prior to declaring functions in the D-Bus header 126 | * files. Expands to "extern "C"" when using a C++ compiler, 127 | * and expands to nothing when using a C compiler. 128 | * 129 | * Please don't use this in your own code, consider it 130 | * D-Bus internal. 131 | */ 132 | /** 133 | * @def DBUS_END_DECLS 134 | * 135 | * Macro used after declaring functions in the D-Bus header 136 | * files. Expands to "}" when using a C++ compiler, 137 | * and expands to nothing when using a C compiler. 138 | * 139 | * Please don't use this in your own code, consider it 140 | * D-Bus internal. 141 | */ 142 | /** 143 | * @def TRUE 144 | * 145 | * Expands to "1" 146 | */ 147 | /** 148 | * @def FALSE 149 | * 150 | * Expands to "0" 151 | */ 152 | /** 153 | * @def NULL 154 | * 155 | * A null pointer, defined appropriately for C or C++. 156 | */ 157 | /** 158 | * @def DBUS_DEPRECATED 159 | * 160 | * Tells the compiler to warn about a function or type if it's used. 161 | * Code marked in this way should also be enclosed in 162 | * @code 163 | * #ifndef DBUS_DISABLE_DEPRECATED 164 | * deprecated stuff here 165 | * #endif 166 | * @endcode 167 | * 168 | * Please don't use this in your own code, consider it 169 | * D-Bus internal. 170 | */ 171 | /** 172 | * @def _DBUS_GNUC_EXTENSION 173 | * 174 | * Tells gcc not to warn about extensions to the C standard in the 175 | * following expression, even if compiling with -pedantic. Do not use 176 | * this macro in your own code; please consider it to be internal to libdbus. 177 | */ 178 | 179 | /* 180 | * @def DBUS_EXPORT 181 | * 182 | * Declare the following symbol as public. This is currently a noop on 183 | * platforms other than Windows. 184 | */ 185 | 186 | #if defined(DBUS_EXPORT) 187 | /* value forced by compiler command line, don't redefine */ 188 | #elif defined(_WIN32) 189 | # if defined(DBUS_STATIC_BUILD) 190 | # define DBUS_EXPORT 191 | # elif defined(dbus_1_EXPORTS) 192 | # define DBUS_EXPORT __declspec(dllexport) 193 | # else 194 | # define DBUS_EXPORT __declspec(dllimport) 195 | # endif 196 | #elif defined(__GNUC__) && __GNUC__ >= 4 197 | # define DBUS_EXPORT __attribute__ ((__visibility__ ("default"))) 198 | #else 199 | #define DBUS_EXPORT 200 | #endif 201 | 202 | #if defined(DBUS_PRIVATE_EXPORT) 203 | /* value forced by compiler command line, don't redefine */ 204 | #elif defined(_WIN32) 205 | # if defined(DBUS_STATIC_BUILD) 206 | # define DBUS_PRIVATE_EXPORT /* no decoration */ 207 | # elif defined(dbus_1_EXPORTS) 208 | # define DBUS_PRIVATE_EXPORT __declspec(dllexport) 209 | # else 210 | # define DBUS_PRIVATE_EXPORT __declspec(dllimport) 211 | # endif 212 | #elif defined(__GNUC__) && __GNUC__ >= 4 213 | # define DBUS_PRIVATE_EXPORT __attribute__ ((__visibility__ ("default"))) 214 | #else 215 | # define DBUS_PRIVATE_EXPORT /* no decoration */ 216 | #endif 217 | 218 | /* Implementation for dbus_clear_message() etc. This is not API, 219 | * do not use it directly. 220 | * 221 | * We're using a specific type (T ** and T *) instead of void ** and 222 | * void * partly for type-safety, partly to be strict-aliasing-compliant, 223 | * and partly to keep C++ compilers happy. This code is inlined into 224 | * users of libdbus, so we can't rely on it having dbus' own compiler 225 | * settings. */ 226 | #define _dbus_clear_pointer_impl(T, pointer_to_pointer, destroy) \ 227 | do { \ 228 | T **_pp = (pointer_to_pointer); \ 229 | T *_value = *_pp; \ 230 | \ 231 | *_pp = NULL; \ 232 | \ 233 | if (_value != NULL) \ 234 | destroy (_value); \ 235 | } while (0) 236 | /* Not (destroy) (_value) in case destroy() is a function-like macro */ 237 | 238 | /** @} */ 239 | 240 | #endif /* DBUS_MACROS_H */ 241 | -------------------------------------------------------------------------------- /include/orig/dbus-memory.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 | /* dbus-memory.h D-Bus memory handling 3 | * 4 | * Copyright (C) 2002 Red Hat Inc. 5 | * 6 | * Licensed under the Academic Free License version 2.1 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION) 24 | #error "Only can be included directly, this file may disappear or change contents." 25 | #endif 26 | 27 | #ifndef DBUS_MEMORY_H 28 | #define DBUS_MEMORY_H 29 | 30 | #include 31 | #include 32 | 33 | DBUS_BEGIN_DECLS 34 | 35 | /** 36 | * @addtogroup DBusMemory 37 | * @{ 38 | */ 39 | 40 | DBUS_EXPORT 41 | DBUS_MALLOC 42 | DBUS_ALLOC_SIZE(1) 43 | void* dbus_malloc (size_t bytes); 44 | 45 | DBUS_EXPORT 46 | DBUS_MALLOC 47 | DBUS_ALLOC_SIZE(1) 48 | void* dbus_malloc0 (size_t bytes); 49 | 50 | DBUS_EXPORT 51 | DBUS_ALLOC_SIZE(2) 52 | void* dbus_realloc (void *memory, 53 | size_t bytes); 54 | DBUS_EXPORT 55 | void dbus_free (void *memory); 56 | 57 | #define dbus_new(type, count) ((type*)dbus_malloc (sizeof (type) * (count))) 58 | #define dbus_new0(type, count) ((type*)dbus_malloc0 (sizeof (type) * (count))) 59 | 60 | DBUS_EXPORT 61 | void dbus_free_string_array (char **str_array); 62 | 63 | typedef void (* DBusFreeFunction) (void *memory); 64 | 65 | DBUS_EXPORT 66 | void dbus_shutdown (void); 67 | 68 | /** @} */ 69 | 70 | DBUS_END_DECLS 71 | 72 | #endif /* DBUS_MEMORY_H */ 73 | -------------------------------------------------------------------------------- /include/orig/dbus-message.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 | /* dbus-message.h DBusMessage object 3 | * 4 | * Copyright (C) 2002, 2003, 2005 Red Hat Inc. 5 | * 6 | * Licensed under the Academic Free License version 2.1 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION) 24 | #error "Only can be included directly, this file may disappear or change contents." 25 | #endif 26 | 27 | #ifndef DBUS_MESSAGE_H 28 | #define DBUS_MESSAGE_H 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | DBUS_BEGIN_DECLS 38 | 39 | /** 40 | * @addtogroup DBusMessage 41 | * @{ 42 | */ 43 | 44 | typedef struct DBusMessage DBusMessage; 45 | /** 46 | * Opaque type representing a message iterator. Can be copied by value and 47 | * allocated on the stack. 48 | * 49 | * A DBusMessageIter usually contains no allocated memory. However, there 50 | * is one special case: after a successful call to 51 | * dbus_message_iter_open_container(), the caller is responsible for calling 52 | * either dbus_message_iter_close_container() or 53 | * dbus_message_iter_abandon_container() exactly once, with the same pair 54 | * of iterators. 55 | */ 56 | typedef struct DBusMessageIter DBusMessageIter; 57 | 58 | /** 59 | * DBusMessageIter struct; contains no public fields. 60 | */ 61 | struct DBusMessageIter 62 | { 63 | void *dummy1; /**< Don't use this */ 64 | void *dummy2; /**< Don't use this */ 65 | dbus_uint32_t dummy3; /**< Don't use this */ 66 | int dummy4; /**< Don't use this */ 67 | int dummy5; /**< Don't use this */ 68 | int dummy6; /**< Don't use this */ 69 | int dummy7; /**< Don't use this */ 70 | int dummy8; /**< Don't use this */ 71 | int dummy9; /**< Don't use this */ 72 | int dummy10; /**< Don't use this */ 73 | int dummy11; /**< Don't use this */ 74 | int pad1; /**< Don't use this */ 75 | void *pad2; /**< Don't use this */ 76 | void *pad3; /**< Don't use this */ 77 | }; 78 | 79 | /** 80 | * A message iterator for which dbus_message_iter_abandon_container_if_open() 81 | * is the only valid operation. 82 | */ 83 | #define DBUS_MESSAGE_ITER_INIT_CLOSED \ 84 | { \ 85 | NULL, /* dummy1 */ \ 86 | NULL, /* dummy2 */ \ 87 | 0, /* dummy3 */ \ 88 | 0, /* dummy4 */ \ 89 | 0, /* dummy5 */ \ 90 | 0, /* dummy6 */ \ 91 | 0, /* dummy7 */ \ 92 | 0, /* dummy8 */ \ 93 | 0, /* dummy9 */ \ 94 | 0, /* dummy10 */ \ 95 | 0, /* dummy11 */ \ 96 | 0, /* pad1 */ \ 97 | NULL, /* pad2 */ \ 98 | NULL /* pad3 */ \ 99 | } 100 | 101 | DBUS_EXPORT 102 | DBusMessage* dbus_message_new (int message_type); 103 | DBUS_EXPORT 104 | DBusMessage* dbus_message_new_method_call (const char *bus_name, 105 | const char *path, 106 | const char *iface, 107 | const char *method); 108 | DBUS_EXPORT 109 | DBusMessage* dbus_message_new_method_return (DBusMessage *method_call); 110 | DBUS_EXPORT 111 | DBusMessage* dbus_message_new_signal (const char *path, 112 | const char *iface, 113 | const char *name); 114 | DBUS_EXPORT 115 | DBusMessage* dbus_message_new_error (DBusMessage *reply_to, 116 | const char *error_name, 117 | const char *error_message); 118 | DBUS_EXPORT 119 | DBusMessage* dbus_message_new_error_printf (DBusMessage *reply_to, 120 | const char *error_name, 121 | const char *error_format, 122 | ...) _DBUS_GNUC_PRINTF (3, 4); 123 | 124 | DBUS_EXPORT 125 | DBusMessage* dbus_message_copy (const DBusMessage *message); 126 | 127 | DBUS_EXPORT 128 | DBusMessage* dbus_message_ref (DBusMessage *message); 129 | DBUS_EXPORT 130 | void dbus_message_unref (DBusMessage *message); 131 | DBUS_EXPORT 132 | int dbus_message_get_type (DBusMessage *message); 133 | DBUS_EXPORT 134 | dbus_bool_t dbus_message_set_path (DBusMessage *message, 135 | const char *object_path); 136 | DBUS_EXPORT 137 | const char* dbus_message_get_path (DBusMessage *message); 138 | DBUS_EXPORT 139 | dbus_bool_t dbus_message_has_path (DBusMessage *message, 140 | const char *object_path); 141 | DBUS_EXPORT 142 | dbus_bool_t dbus_message_set_interface (DBusMessage *message, 143 | const char *iface); 144 | DBUS_EXPORT 145 | const char* dbus_message_get_interface (DBusMessage *message); 146 | DBUS_EXPORT 147 | dbus_bool_t dbus_message_has_interface (DBusMessage *message, 148 | const char *iface); 149 | DBUS_EXPORT 150 | dbus_bool_t dbus_message_set_member (DBusMessage *message, 151 | const char *member); 152 | DBUS_EXPORT 153 | const char* dbus_message_get_member (DBusMessage *message); 154 | DBUS_EXPORT 155 | dbus_bool_t dbus_message_has_member (DBusMessage *message, 156 | const char *member); 157 | DBUS_EXPORT 158 | dbus_bool_t dbus_message_set_error_name (DBusMessage *message, 159 | const char *name); 160 | DBUS_EXPORT 161 | const char* dbus_message_get_error_name (DBusMessage *message); 162 | DBUS_EXPORT 163 | dbus_bool_t dbus_message_set_destination (DBusMessage *message, 164 | const char *destination); 165 | DBUS_EXPORT 166 | const char* dbus_message_get_destination (DBusMessage *message); 167 | DBUS_EXPORT 168 | dbus_bool_t dbus_message_set_sender (DBusMessage *message, 169 | const char *sender); 170 | DBUS_EXPORT 171 | const char* dbus_message_get_sender (DBusMessage *message); 172 | DBUS_EXPORT 173 | const char* dbus_message_get_signature (DBusMessage *message); 174 | DBUS_EXPORT 175 | void dbus_message_set_no_reply (DBusMessage *message, 176 | dbus_bool_t no_reply); 177 | DBUS_EXPORT 178 | dbus_bool_t dbus_message_get_no_reply (DBusMessage *message); 179 | DBUS_EXPORT 180 | dbus_bool_t dbus_message_is_method_call (DBusMessage *message, 181 | const char *iface, 182 | const char *method); 183 | DBUS_EXPORT 184 | dbus_bool_t dbus_message_is_signal (DBusMessage *message, 185 | const char *iface, 186 | const char *signal_name); 187 | DBUS_EXPORT 188 | dbus_bool_t dbus_message_is_error (DBusMessage *message, 189 | const char *error_name); 190 | DBUS_EXPORT 191 | dbus_bool_t dbus_message_has_destination (DBusMessage *message, 192 | const char *bus_name); 193 | DBUS_EXPORT 194 | dbus_bool_t dbus_message_has_sender (DBusMessage *message, 195 | const char *unique_bus_name); 196 | DBUS_EXPORT 197 | dbus_bool_t dbus_message_has_signature (DBusMessage *message, 198 | const char *signature); 199 | DBUS_EXPORT 200 | dbus_uint32_t dbus_message_get_serial (DBusMessage *message); 201 | DBUS_EXPORT 202 | void dbus_message_set_serial (DBusMessage *message, 203 | dbus_uint32_t serial); 204 | DBUS_EXPORT 205 | dbus_bool_t dbus_message_set_reply_serial (DBusMessage *message, 206 | dbus_uint32_t reply_serial); 207 | DBUS_EXPORT 208 | dbus_uint32_t dbus_message_get_reply_serial (DBusMessage *message); 209 | 210 | DBUS_EXPORT 211 | void dbus_message_set_auto_start (DBusMessage *message, 212 | dbus_bool_t auto_start); 213 | DBUS_EXPORT 214 | dbus_bool_t dbus_message_get_auto_start (DBusMessage *message); 215 | 216 | DBUS_EXPORT 217 | dbus_bool_t dbus_message_get_path_decomposed (DBusMessage *message, 218 | char ***path); 219 | 220 | DBUS_EXPORT 221 | dbus_bool_t dbus_message_append_args (DBusMessage *message, 222 | int first_arg_type, 223 | ...); 224 | DBUS_EXPORT 225 | dbus_bool_t dbus_message_append_args_valist (DBusMessage *message, 226 | int first_arg_type, 227 | va_list var_args); 228 | DBUS_EXPORT 229 | dbus_bool_t dbus_message_get_args (DBusMessage *message, 230 | DBusError *error, 231 | int first_arg_type, 232 | ...); 233 | DBUS_EXPORT 234 | dbus_bool_t dbus_message_get_args_valist (DBusMessage *message, 235 | DBusError *error, 236 | int first_arg_type, 237 | va_list var_args); 238 | 239 | DBUS_EXPORT 240 | dbus_bool_t dbus_message_contains_unix_fds (DBusMessage *message); 241 | 242 | DBUS_EXPORT 243 | void dbus_message_iter_init_closed (DBusMessageIter *iter); 244 | DBUS_EXPORT 245 | dbus_bool_t dbus_message_iter_init (DBusMessage *message, 246 | DBusMessageIter *iter); 247 | DBUS_EXPORT 248 | dbus_bool_t dbus_message_iter_has_next (DBusMessageIter *iter); 249 | DBUS_EXPORT 250 | dbus_bool_t dbus_message_iter_next (DBusMessageIter *iter); 251 | DBUS_EXPORT 252 | char* dbus_message_iter_get_signature (DBusMessageIter *iter); 253 | DBUS_EXPORT 254 | int dbus_message_iter_get_arg_type (DBusMessageIter *iter); 255 | DBUS_EXPORT 256 | int dbus_message_iter_get_element_type (DBusMessageIter *iter); 257 | DBUS_EXPORT 258 | void dbus_message_iter_recurse (DBusMessageIter *iter, 259 | DBusMessageIter *sub); 260 | DBUS_EXPORT 261 | void dbus_message_iter_get_basic (DBusMessageIter *iter, 262 | void *value); 263 | DBUS_EXPORT 264 | int dbus_message_iter_get_element_count(DBusMessageIter *iter); 265 | 266 | #ifndef DBUS_DISABLE_DEPRECATED 267 | /* This function returns the wire protocol size of the array in bytes, 268 | * you do not want to know that probably 269 | */ 270 | DBUS_EXPORT 271 | DBUS_DEPRECATED int dbus_message_iter_get_array_len (DBusMessageIter *iter); 272 | #endif 273 | DBUS_EXPORT 274 | void dbus_message_iter_get_fixed_array (DBusMessageIter *iter, 275 | void *value, 276 | int *n_elements); 277 | 278 | 279 | DBUS_EXPORT 280 | void dbus_message_iter_init_append (DBusMessage *message, 281 | DBusMessageIter *iter); 282 | DBUS_EXPORT 283 | dbus_bool_t dbus_message_iter_append_basic (DBusMessageIter *iter, 284 | int type, 285 | const void *value); 286 | DBUS_EXPORT 287 | dbus_bool_t dbus_message_iter_append_fixed_array (DBusMessageIter *iter, 288 | int element_type, 289 | const void *value, 290 | int n_elements); 291 | DBUS_EXPORT 292 | dbus_bool_t dbus_message_iter_open_container (DBusMessageIter *iter, 293 | int type, 294 | const char *contained_signature, 295 | DBusMessageIter *sub); 296 | DBUS_EXPORT 297 | dbus_bool_t dbus_message_iter_close_container (DBusMessageIter *iter, 298 | DBusMessageIter *sub); 299 | DBUS_EXPORT 300 | void dbus_message_iter_abandon_container (DBusMessageIter *iter, 301 | DBusMessageIter *sub); 302 | 303 | DBUS_EXPORT 304 | void dbus_message_iter_abandon_container_if_open (DBusMessageIter *iter, 305 | DBusMessageIter *sub); 306 | 307 | DBUS_EXPORT 308 | void dbus_message_lock (DBusMessage *message); 309 | 310 | DBUS_EXPORT 311 | dbus_bool_t dbus_set_error_from_message (DBusError *error, 312 | DBusMessage *message); 313 | 314 | 315 | DBUS_EXPORT 316 | dbus_bool_t dbus_message_allocate_data_slot (dbus_int32_t *slot_p); 317 | DBUS_EXPORT 318 | void dbus_message_free_data_slot (dbus_int32_t *slot_p); 319 | DBUS_EXPORT 320 | dbus_bool_t dbus_message_set_data (DBusMessage *message, 321 | dbus_int32_t slot, 322 | void *data, 323 | DBusFreeFunction free_data_func); 324 | DBUS_EXPORT 325 | void* dbus_message_get_data (DBusMessage *message, 326 | dbus_int32_t slot); 327 | 328 | DBUS_EXPORT 329 | int dbus_message_type_from_string (const char *type_str); 330 | DBUS_EXPORT 331 | const char* dbus_message_type_to_string (int type); 332 | 333 | DBUS_EXPORT 334 | dbus_bool_t dbus_message_marshal (DBusMessage *msg, 335 | char **marshalled_data_p, 336 | int *len_p); 337 | DBUS_EXPORT 338 | DBusMessage* dbus_message_demarshal (const char *str, 339 | int len, 340 | DBusError *error); 341 | 342 | DBUS_EXPORT 343 | int dbus_message_demarshal_bytes_needed (const char *str, 344 | int len); 345 | 346 | DBUS_EXPORT 347 | void dbus_message_set_allow_interactive_authorization (DBusMessage *message, 348 | dbus_bool_t allow); 349 | 350 | DBUS_EXPORT 351 | dbus_bool_t dbus_message_get_allow_interactive_authorization ( 352 | DBusMessage *message); 353 | 354 | /** 355 | * Clear a variable or struct member that contains a #DBusMessage. 356 | * If it does not contain #NULL, the message that was previously 357 | * there is unreferenced with dbus_message_unref(). 358 | * 359 | * This is very similar to dbus_clear_connection(): see that function 360 | * for more details. 361 | * 362 | * @param pointer_to_message A pointer to a variable or struct member. 363 | * pointer_to_message must not be #NULL, but *pointer_to_message 364 | * may be #NULL. 365 | */ 366 | static inline void 367 | dbus_clear_message (DBusMessage **pointer_to_message) 368 | { 369 | _dbus_clear_pointer_impl (DBusMessage, pointer_to_message, 370 | dbus_message_unref); 371 | } 372 | 373 | /** @} */ 374 | 375 | DBUS_END_DECLS 376 | 377 | #endif /* DBUS_MESSAGE_H */ 378 | -------------------------------------------------------------------------------- /include/orig/dbus-misc.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 | /* dbus-misc.h A few assorted public functions that don't fit elsewhere 3 | * 4 | * Copyright (C) 2006 Red Hat, Inc. 5 | * 6 | * Licensed under the Academic Free License version 2.1 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION) 24 | #error "Only can be included directly, this file may disappear or change contents." 25 | #endif 26 | 27 | #ifndef DBUS_MISC_H 28 | #define DBUS_MISC_H 29 | 30 | #include 31 | #include 32 | 33 | DBUS_BEGIN_DECLS 34 | 35 | /** 36 | * @addtogroup DBusMisc 37 | * @{ 38 | */ 39 | DBUS_EXPORT 40 | char* dbus_get_local_machine_id (void); 41 | 42 | DBUS_EXPORT 43 | void dbus_get_version (int *major_version_p, 44 | int *minor_version_p, 45 | int *micro_version_p); 46 | 47 | DBUS_EXPORT 48 | dbus_bool_t dbus_setenv (const char *variable, 49 | const char *value); 50 | 51 | DBUS_EXPORT 52 | char *dbus_try_get_local_machine_id (DBusError *error); 53 | 54 | /** @} */ 55 | 56 | DBUS_END_DECLS 57 | 58 | #endif /* DBUS_MISC_H */ 59 | 60 | -------------------------------------------------------------------------------- /include/orig/dbus-pending-call.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 | /* dbus-pending-call.h Object representing a call in progress. 3 | * 4 | * Copyright (C) 2002, 2003 Red Hat Inc. 5 | * 6 | * Licensed under the Academic Free License version 2.1 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION) 24 | #error "Only can be included directly, this file may disappear or change contents." 25 | #endif 26 | 27 | #ifndef DBUS_PENDING_CALL_H 28 | #define DBUS_PENDING_CALL_H 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | DBUS_BEGIN_DECLS 35 | 36 | /** 37 | * @addtogroup DBusPendingCall 38 | * @{ 39 | */ 40 | 41 | #define DBUS_TIMEOUT_INFINITE ((int) 0x7fffffff) 42 | #define DBUS_TIMEOUT_USE_DEFAULT (-1) 43 | 44 | DBUS_EXPORT 45 | DBusPendingCall* dbus_pending_call_ref (DBusPendingCall *pending); 46 | DBUS_EXPORT 47 | void dbus_pending_call_unref (DBusPendingCall *pending); 48 | DBUS_EXPORT 49 | dbus_bool_t dbus_pending_call_set_notify (DBusPendingCall *pending, 50 | DBusPendingCallNotifyFunction function, 51 | void *user_data, 52 | DBusFreeFunction free_user_data); 53 | DBUS_EXPORT 54 | void dbus_pending_call_cancel (DBusPendingCall *pending); 55 | DBUS_EXPORT 56 | dbus_bool_t dbus_pending_call_get_completed (DBusPendingCall *pending); 57 | DBUS_EXPORT 58 | DBusMessage* dbus_pending_call_steal_reply (DBusPendingCall *pending); 59 | DBUS_EXPORT 60 | void dbus_pending_call_block (DBusPendingCall *pending); 61 | 62 | DBUS_EXPORT 63 | dbus_bool_t dbus_pending_call_allocate_data_slot (dbus_int32_t *slot_p); 64 | DBUS_EXPORT 65 | void dbus_pending_call_free_data_slot (dbus_int32_t *slot_p); 66 | DBUS_EXPORT 67 | dbus_bool_t dbus_pending_call_set_data (DBusPendingCall *pending, 68 | dbus_int32_t slot, 69 | void *data, 70 | DBusFreeFunction free_data_func); 71 | DBUS_EXPORT 72 | void* dbus_pending_call_get_data (DBusPendingCall *pending, 73 | dbus_int32_t slot); 74 | 75 | /** 76 | * Clear a variable or struct member that contains a #DBusPendingCall. 77 | * If it does not contain #NULL, the pending call that was previously 78 | * there is unreferenced with dbus_pending_call_unref(). 79 | * 80 | * This is very similar to dbus_clear_connection(): see that function 81 | * for more details. 82 | * 83 | * @param pointer_to_pending_call A pointer to a variable or struct member. 84 | * pointer_to_pending_call must not be #NULL, but *pointer_to_pending_call 85 | * may be #NULL. 86 | */ 87 | static inline void 88 | dbus_clear_pending_call (DBusPendingCall **pointer_to_pending_call) 89 | { 90 | _dbus_clear_pointer_impl (DBusPendingCall, pointer_to_pending_call, 91 | dbus_pending_call_unref); 92 | } 93 | 94 | /** @} */ 95 | 96 | DBUS_END_DECLS 97 | 98 | #endif /* DBUS_PENDING_CALL_H */ 99 | -------------------------------------------------------------------------------- /include/orig/dbus-protocol.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 | /* dbus-protocol.h D-Bus protocol constants 3 | * 4 | * Copyright (C) 2002, 2003 CodeFactory AB 5 | * Copyright (C) 2004, 2005 Red Hat, Inc. 6 | * 7 | * Licensed under the Academic Free License version 2.1 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | 25 | #ifndef DBUS_PROTOCOL_H 26 | #define DBUS_PROTOCOL_H 27 | 28 | /* Don't include anything in here from anywhere else. It's 29 | * intended for use by any random library. 30 | */ 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #if 0 35 | } /* avoids confusing emacs indentation */ 36 | #endif 37 | #endif 38 | 39 | /* Normally docs are in .c files, but there isn't a .c file for this. */ 40 | /** 41 | * @defgroup DBusProtocol Protocol constants 42 | * @ingroup DBus 43 | * 44 | * @brief Defines constants which are part of the D-Bus protocol 45 | * 46 | * This header is intended for use by any library, not only libdbus. 47 | * 48 | * @{ 49 | */ 50 | 51 | 52 | /* Message byte order */ 53 | #define DBUS_LITTLE_ENDIAN ('l') /**< Code marking LSB-first byte order in the wire protocol. */ 54 | #define DBUS_BIG_ENDIAN ('B') /**< Code marking MSB-first byte order in the wire protocol. */ 55 | 56 | /** Protocol version. */ 57 | #define DBUS_MAJOR_PROTOCOL_VERSION 1 58 | 59 | /** Type code that is never equal to a legitimate type code */ 60 | #define DBUS_TYPE_INVALID ((int) '\0') 61 | /** #DBUS_TYPE_INVALID as a string literal instead of a int literal */ 62 | #define DBUS_TYPE_INVALID_AS_STRING "\0" 63 | 64 | /* Primitive types */ 65 | /** Type code marking an 8-bit unsigned integer */ 66 | #define DBUS_TYPE_BYTE ((int) 'y') 67 | /** #DBUS_TYPE_BYTE as a string literal instead of a int literal */ 68 | #define DBUS_TYPE_BYTE_AS_STRING "y" 69 | /** Type code marking a boolean */ 70 | #define DBUS_TYPE_BOOLEAN ((int) 'b') 71 | /** #DBUS_TYPE_BOOLEAN as a string literal instead of a int literal */ 72 | #define DBUS_TYPE_BOOLEAN_AS_STRING "b" 73 | /** Type code marking a 16-bit signed integer */ 74 | #define DBUS_TYPE_INT16 ((int) 'n') 75 | /** #DBUS_TYPE_INT16 as a string literal instead of a int literal */ 76 | #define DBUS_TYPE_INT16_AS_STRING "n" 77 | /** Type code marking a 16-bit unsigned integer */ 78 | #define DBUS_TYPE_UINT16 ((int) 'q') 79 | /** #DBUS_TYPE_UINT16 as a string literal instead of a int literal */ 80 | #define DBUS_TYPE_UINT16_AS_STRING "q" 81 | /** Type code marking a 32-bit signed integer */ 82 | #define DBUS_TYPE_INT32 ((int) 'i') 83 | /** #DBUS_TYPE_INT32 as a string literal instead of a int literal */ 84 | #define DBUS_TYPE_INT32_AS_STRING "i" 85 | /** Type code marking a 32-bit unsigned integer */ 86 | #define DBUS_TYPE_UINT32 ((int) 'u') 87 | /** #DBUS_TYPE_UINT32 as a string literal instead of a int literal */ 88 | #define DBUS_TYPE_UINT32_AS_STRING "u" 89 | /** Type code marking a 64-bit signed integer */ 90 | #define DBUS_TYPE_INT64 ((int) 'x') 91 | /** #DBUS_TYPE_INT64 as a string literal instead of a int literal */ 92 | #define DBUS_TYPE_INT64_AS_STRING "x" 93 | /** Type code marking a 64-bit unsigned integer */ 94 | #define DBUS_TYPE_UINT64 ((int) 't') 95 | /** #DBUS_TYPE_UINT64 as a string literal instead of a int literal */ 96 | #define DBUS_TYPE_UINT64_AS_STRING "t" 97 | /** Type code marking an 8-byte double in IEEE 754 format */ 98 | #define DBUS_TYPE_DOUBLE ((int) 'd') 99 | /** #DBUS_TYPE_DOUBLE as a string literal instead of a int literal */ 100 | #define DBUS_TYPE_DOUBLE_AS_STRING "d" 101 | /** Type code marking a UTF-8 encoded, nul-terminated Unicode string */ 102 | #define DBUS_TYPE_STRING ((int) 's') 103 | /** #DBUS_TYPE_STRING as a string literal instead of a int literal */ 104 | #define DBUS_TYPE_STRING_AS_STRING "s" 105 | /** Type code marking a D-Bus object path */ 106 | #define DBUS_TYPE_OBJECT_PATH ((int) 'o') 107 | /** #DBUS_TYPE_OBJECT_PATH as a string literal instead of a int literal */ 108 | #define DBUS_TYPE_OBJECT_PATH_AS_STRING "o" 109 | /** Type code marking a D-Bus type signature */ 110 | #define DBUS_TYPE_SIGNATURE ((int) 'g') 111 | /** #DBUS_TYPE_SIGNATURE as a string literal instead of a int literal */ 112 | #define DBUS_TYPE_SIGNATURE_AS_STRING "g" 113 | /** Type code marking a unix file descriptor */ 114 | #define DBUS_TYPE_UNIX_FD ((int) 'h') 115 | /** #DBUS_TYPE_UNIX_FD as a string literal instead of a int literal */ 116 | #define DBUS_TYPE_UNIX_FD_AS_STRING "h" 117 | 118 | /* Compound types */ 119 | /** Type code marking a D-Bus array type */ 120 | #define DBUS_TYPE_ARRAY ((int) 'a') 121 | /** #DBUS_TYPE_ARRAY as a string literal instead of a int literal */ 122 | #define DBUS_TYPE_ARRAY_AS_STRING "a" 123 | /** Type code marking a D-Bus variant type */ 124 | #define DBUS_TYPE_VARIANT ((int) 'v') 125 | /** #DBUS_TYPE_VARIANT as a string literal instead of a int literal */ 126 | #define DBUS_TYPE_VARIANT_AS_STRING "v" 127 | 128 | /** STRUCT and DICT_ENTRY are sort of special since their codes can't 129 | * appear in a type string, instead 130 | * DBUS_STRUCT_BEGIN_CHAR/DBUS_DICT_ENTRY_BEGIN_CHAR have to appear 131 | */ 132 | /** Type code used to represent a struct; however, this type code does not appear 133 | * in type signatures, instead #DBUS_STRUCT_BEGIN_CHAR and #DBUS_STRUCT_END_CHAR will 134 | * appear in a signature. 135 | */ 136 | #define DBUS_TYPE_STRUCT ((int) 'r') 137 | /** #DBUS_TYPE_STRUCT as a string literal instead of a int literal */ 138 | #define DBUS_TYPE_STRUCT_AS_STRING "r" 139 | /** Type code used to represent a dict entry; however, this type code does not appear 140 | * in type signatures, instead #DBUS_DICT_ENTRY_BEGIN_CHAR and #DBUS_DICT_ENTRY_END_CHAR will 141 | * appear in a signature. 142 | */ 143 | #define DBUS_TYPE_DICT_ENTRY ((int) 'e') 144 | /** #DBUS_TYPE_DICT_ENTRY as a string literal instead of a int literal */ 145 | #define DBUS_TYPE_DICT_ENTRY_AS_STRING "e" 146 | 147 | /** Does not include #DBUS_TYPE_INVALID, #DBUS_STRUCT_BEGIN_CHAR, #DBUS_STRUCT_END_CHAR, 148 | * #DBUS_DICT_ENTRY_BEGIN_CHAR, or #DBUS_DICT_ENTRY_END_CHAR - i.e. it is the number of 149 | * valid types, not the number of distinct characters that may appear in a type signature. 150 | */ 151 | #define DBUS_NUMBER_OF_TYPES (16) 152 | 153 | /* characters other than typecodes that appear in type signatures */ 154 | 155 | /** Code marking the start of a struct type in a type signature */ 156 | #define DBUS_STRUCT_BEGIN_CHAR ((int) '(') 157 | /** #DBUS_STRUCT_BEGIN_CHAR as a string literal instead of a int literal */ 158 | #define DBUS_STRUCT_BEGIN_CHAR_AS_STRING "(" 159 | /** Code marking the end of a struct type in a type signature */ 160 | #define DBUS_STRUCT_END_CHAR ((int) ')') 161 | /** #DBUS_STRUCT_END_CHAR a string literal instead of a int literal */ 162 | #define DBUS_STRUCT_END_CHAR_AS_STRING ")" 163 | /** Code marking the start of a dict entry type in a type signature */ 164 | #define DBUS_DICT_ENTRY_BEGIN_CHAR ((int) '{') 165 | /** #DBUS_DICT_ENTRY_BEGIN_CHAR as a string literal instead of a int literal */ 166 | #define DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING "{" 167 | /** Code marking the end of a dict entry type in a type signature */ 168 | #define DBUS_DICT_ENTRY_END_CHAR ((int) '}') 169 | /** #DBUS_DICT_ENTRY_END_CHAR as a string literal instead of a int literal */ 170 | #define DBUS_DICT_ENTRY_END_CHAR_AS_STRING "}" 171 | 172 | /** Max length in bytes of a bus name, interface, or member (not object 173 | * path, paths are unlimited). This is limited because lots of stuff 174 | * is O(n) in this number, plus it would be obnoxious to type in a 175 | * paragraph-long method name so most likely something like that would 176 | * be an exploit. 177 | */ 178 | #define DBUS_MAXIMUM_NAME_LENGTH 255 179 | 180 | /** This one is 255 so it fits in a byte */ 181 | #define DBUS_MAXIMUM_SIGNATURE_LENGTH 255 182 | 183 | /** Max length of a match rule string; to keep people from hosing the 184 | * daemon with some huge rule 185 | */ 186 | #define DBUS_MAXIMUM_MATCH_RULE_LENGTH 1024 187 | 188 | /** Max arg number you can match on in a match rule, e.g. 189 | * arg0='hello' is OK, arg3489720987='hello' is not 190 | */ 191 | #define DBUS_MAXIMUM_MATCH_RULE_ARG_NUMBER 63 192 | 193 | /** Max length of a marshaled array in bytes (64M, 2^26) We use signed 194 | * int for lengths so must be INT_MAX or less. We need something a 195 | * bit smaller than INT_MAX because the array is inside a message with 196 | * header info, etc. so an INT_MAX array wouldn't allow the message 197 | * overhead. The 64M number is an attempt at a larger number than 198 | * we'd reasonably ever use, but small enough that your bus would chew 199 | * through it fairly quickly without locking up forever. If you have 200 | * data that's likely to be larger than this, you should probably be 201 | * sending it in multiple incremental messages anyhow. 202 | */ 203 | #define DBUS_MAXIMUM_ARRAY_LENGTH (67108864) 204 | /** Number of bits you need in an unsigned to store the max array size */ 205 | #define DBUS_MAXIMUM_ARRAY_LENGTH_BITS 26 206 | 207 | /** The maximum total message size including header and body; similar 208 | * rationale to max array size. 209 | */ 210 | #define DBUS_MAXIMUM_MESSAGE_LENGTH (DBUS_MAXIMUM_ARRAY_LENGTH * 2) 211 | /** Number of bits you need in an unsigned to store the max message size */ 212 | #define DBUS_MAXIMUM_MESSAGE_LENGTH_BITS 27 213 | 214 | /** The maximum total number of unix fds in a message. Similar 215 | * rationale as DBUS_MAXIMUM_MESSAGE_LENGTH. However we divide by four 216 | * given that one fd is an int and hence at least 32 bits. 217 | */ 218 | #define DBUS_MAXIMUM_MESSAGE_UNIX_FDS (DBUS_MAXIMUM_MESSAGE_LENGTH/4) 219 | /** Number of bits you need in an unsigned to store the max message unix fds */ 220 | #define DBUS_MAXIMUM_MESSAGE_UNIX_FDS_BITS (DBUS_MAXIMUM_MESSAGE_LENGTH_BITS-2) 221 | 222 | /** Depth of recursion in the type tree. This is automatically limited 223 | * to DBUS_MAXIMUM_SIGNATURE_LENGTH since you could only have an array 224 | * of array of array of ... that fit in the max signature. But that's 225 | * probably a bit too large. 226 | */ 227 | #define DBUS_MAXIMUM_TYPE_RECURSION_DEPTH 32 228 | 229 | /* Types of message */ 230 | 231 | /** This value is never a valid message type, see dbus_message_get_type() */ 232 | #define DBUS_MESSAGE_TYPE_INVALID 0 233 | /** Message type of a method call message, see dbus_message_get_type() */ 234 | #define DBUS_MESSAGE_TYPE_METHOD_CALL 1 235 | /** Message type of a method return message, see dbus_message_get_type() */ 236 | #define DBUS_MESSAGE_TYPE_METHOD_RETURN 2 237 | /** Message type of an error reply message, see dbus_message_get_type() */ 238 | #define DBUS_MESSAGE_TYPE_ERROR 3 239 | /** Message type of a signal message, see dbus_message_get_type() */ 240 | #define DBUS_MESSAGE_TYPE_SIGNAL 4 241 | 242 | #define DBUS_NUM_MESSAGE_TYPES 5 243 | 244 | /* Header flags */ 245 | 246 | /** If set, this flag means that the sender of a message does not care about getting 247 | * a reply, so the recipient need not send one. See dbus_message_set_no_reply(). 248 | */ 249 | #define DBUS_HEADER_FLAG_NO_REPLY_EXPECTED 0x1 250 | /** 251 | * If set, this flag means that even if the message bus knows how to start an owner for 252 | * the destination bus name (see dbus_message_set_destination()), it should not 253 | * do so. If this flag is not set, the bus may launch a program to process the 254 | * message. 255 | */ 256 | #define DBUS_HEADER_FLAG_NO_AUTO_START 0x2 257 | /** 258 | * If set on a method call, this flag means that the caller is prepared to 259 | * wait for interactive authorization. 260 | */ 261 | #define DBUS_HEADER_FLAG_ALLOW_INTERACTIVE_AUTHORIZATION 0x4 262 | 263 | /* Header fields */ 264 | 265 | /** Not equal to any valid header field code */ 266 | #define DBUS_HEADER_FIELD_INVALID 0 267 | /** Header field code for the path - the path is the object emitting a signal or the object receiving a method call. 268 | * See dbus_message_set_path(). 269 | */ 270 | #define DBUS_HEADER_FIELD_PATH 1 271 | /** Header field code for the interface containing a member (method or signal). 272 | * See dbus_message_set_interface(). 273 | */ 274 | #define DBUS_HEADER_FIELD_INTERFACE 2 275 | /** Header field code for a member (method or signal). See dbus_message_set_member(). */ 276 | #define DBUS_HEADER_FIELD_MEMBER 3 277 | /** Header field code for an error name (found in #DBUS_MESSAGE_TYPE_ERROR messages). 278 | * See dbus_message_set_error_name(). 279 | */ 280 | #define DBUS_HEADER_FIELD_ERROR_NAME 4 281 | /** Header field code for a reply serial, used to match a #DBUS_MESSAGE_TYPE_METHOD_RETURN message with the 282 | * message that it's a reply to. See dbus_message_set_reply_serial(). 283 | */ 284 | #define DBUS_HEADER_FIELD_REPLY_SERIAL 5 285 | /** 286 | * Header field code for the destination bus name of a message. See dbus_message_set_destination(). 287 | */ 288 | #define DBUS_HEADER_FIELD_DESTINATION 6 289 | /** 290 | * Header field code for the sender of a message; usually initialized by the message bus. 291 | * See dbus_message_set_sender(). 292 | */ 293 | #define DBUS_HEADER_FIELD_SENDER 7 294 | /** 295 | * Header field code for the type signature of a message. 296 | */ 297 | #define DBUS_HEADER_FIELD_SIGNATURE 8 298 | /** 299 | * Header field code for the number of unix file descriptors associated 300 | * with this message. 301 | */ 302 | #define DBUS_HEADER_FIELD_UNIX_FDS 9 303 | 304 | 305 | /** 306 | * Value of the highest-numbered header field code, can be used to determine 307 | * the size of an array indexed by header field code. Remember though 308 | * that unknown codes must be ignored, so check for that before 309 | * indexing the array. 310 | */ 311 | #define DBUS_HEADER_FIELD_LAST DBUS_HEADER_FIELD_UNIX_FDS 312 | 313 | /** Header format is defined as a signature: 314 | * byte byte order 315 | * byte message type ID 316 | * byte flags 317 | * byte protocol version 318 | * uint32 body length 319 | * uint32 serial 320 | * array of struct (byte,variant) (field name, value) 321 | * 322 | * The length of the header can be computed as the 323 | * fixed size of the initial data, plus the length of 324 | * the array at the end, plus padding to an 8-boundary. 325 | */ 326 | #define DBUS_HEADER_SIGNATURE \ 327 | DBUS_TYPE_BYTE_AS_STRING \ 328 | DBUS_TYPE_BYTE_AS_STRING \ 329 | DBUS_TYPE_BYTE_AS_STRING \ 330 | DBUS_TYPE_BYTE_AS_STRING \ 331 | DBUS_TYPE_UINT32_AS_STRING \ 332 | DBUS_TYPE_UINT32_AS_STRING \ 333 | DBUS_TYPE_ARRAY_AS_STRING \ 334 | DBUS_STRUCT_BEGIN_CHAR_AS_STRING \ 335 | DBUS_TYPE_BYTE_AS_STRING \ 336 | DBUS_TYPE_VARIANT_AS_STRING \ 337 | DBUS_STRUCT_END_CHAR_AS_STRING 338 | 339 | 340 | /** 341 | * The smallest header size that can occur. (It won't be valid due to 342 | * missing required header fields.) This is 4 bytes, two uint32, an 343 | * array length. This isn't any kind of resource limit, just the 344 | * necessary/logical outcome of the header signature. 345 | */ 346 | #define DBUS_MINIMUM_HEADER_SIZE 16 347 | 348 | /* Errors */ 349 | /* WARNING these get autoconverted to an enum in dbus-glib.h. Thus, 350 | * if you change the order it breaks the ABI. Keep them in order. 351 | * Also, don't change the formatting since that will break the sed 352 | * script. 353 | */ 354 | /** A generic error; "something went wrong" - see the error message for more. */ 355 | #define DBUS_ERROR_FAILED "org.freedesktop.DBus.Error.Failed" 356 | /** There was not enough memory to complete an operation. */ 357 | #define DBUS_ERROR_NO_MEMORY "org.freedesktop.DBus.Error.NoMemory" 358 | /** The bus doesn't know how to launch a service to supply the bus name you wanted. */ 359 | #define DBUS_ERROR_SERVICE_UNKNOWN "org.freedesktop.DBus.Error.ServiceUnknown" 360 | /** The bus name you referenced doesn't exist (i.e. no application owns it). */ 361 | #define DBUS_ERROR_NAME_HAS_NO_OWNER "org.freedesktop.DBus.Error.NameHasNoOwner" 362 | /** No reply to a message expecting one, usually means a timeout occurred. */ 363 | #define DBUS_ERROR_NO_REPLY "org.freedesktop.DBus.Error.NoReply" 364 | /** Something went wrong reading or writing to a socket, for example. */ 365 | #define DBUS_ERROR_IO_ERROR "org.freedesktop.DBus.Error.IOError" 366 | /** A D-Bus bus address was malformed. */ 367 | #define DBUS_ERROR_BAD_ADDRESS "org.freedesktop.DBus.Error.BadAddress" 368 | /** Requested operation isn't supported (like ENOSYS on UNIX). */ 369 | #define DBUS_ERROR_NOT_SUPPORTED "org.freedesktop.DBus.Error.NotSupported" 370 | /** Some limited resource is exhausted. */ 371 | #define DBUS_ERROR_LIMITS_EXCEEDED "org.freedesktop.DBus.Error.LimitsExceeded" 372 | /** Security restrictions don't allow doing what you're trying to do. */ 373 | #define DBUS_ERROR_ACCESS_DENIED "org.freedesktop.DBus.Error.AccessDenied" 374 | /** Authentication didn't work. */ 375 | #define DBUS_ERROR_AUTH_FAILED "org.freedesktop.DBus.Error.AuthFailed" 376 | /** Unable to connect to server (probably caused by ECONNREFUSED on a socket). */ 377 | #define DBUS_ERROR_NO_SERVER "org.freedesktop.DBus.Error.NoServer" 378 | /** Certain timeout errors, possibly ETIMEDOUT on a socket. 379 | * Note that #DBUS_ERROR_NO_REPLY is used for message reply timeouts. 380 | * @warning this is confusingly-named given that #DBUS_ERROR_TIMED_OUT also exists. We can't fix 381 | * it for compatibility reasons so just be careful. 382 | */ 383 | #define DBUS_ERROR_TIMEOUT "org.freedesktop.DBus.Error.Timeout" 384 | /** No network access (probably ENETUNREACH on a socket). */ 385 | #define DBUS_ERROR_NO_NETWORK "org.freedesktop.DBus.Error.NoNetwork" 386 | /** Can't bind a socket since its address is in use (i.e. EADDRINUSE). */ 387 | #define DBUS_ERROR_ADDRESS_IN_USE "org.freedesktop.DBus.Error.AddressInUse" 388 | /** The connection is disconnected and you're trying to use it. */ 389 | #define DBUS_ERROR_DISCONNECTED "org.freedesktop.DBus.Error.Disconnected" 390 | /** Invalid arguments passed to a method call. */ 391 | #define DBUS_ERROR_INVALID_ARGS "org.freedesktop.DBus.Error.InvalidArgs" 392 | /** Missing file. */ 393 | #define DBUS_ERROR_FILE_NOT_FOUND "org.freedesktop.DBus.Error.FileNotFound" 394 | /** Existing file and the operation you're using does not silently overwrite. */ 395 | #define DBUS_ERROR_FILE_EXISTS "org.freedesktop.DBus.Error.FileExists" 396 | /** Method name you invoked isn't known by the object you invoked it on. */ 397 | #define DBUS_ERROR_UNKNOWN_METHOD "org.freedesktop.DBus.Error.UnknownMethod" 398 | /** Object you invoked a method on isn't known. */ 399 | #define DBUS_ERROR_UNKNOWN_OBJECT "org.freedesktop.DBus.Error.UnknownObject" 400 | /** Interface you invoked a method on isn't known by the object. */ 401 | #define DBUS_ERROR_UNKNOWN_INTERFACE "org.freedesktop.DBus.Error.UnknownInterface" 402 | /** Property you tried to access isn't known by the object. */ 403 | #define DBUS_ERROR_UNKNOWN_PROPERTY "org.freedesktop.DBus.Error.UnknownProperty" 404 | /** Property you tried to set is read-only. */ 405 | #define DBUS_ERROR_PROPERTY_READ_ONLY "org.freedesktop.DBus.Error.PropertyReadOnly" 406 | /** Certain timeout errors, e.g. while starting a service. 407 | * @warning this is confusingly-named given that #DBUS_ERROR_TIMEOUT also exists. We can't fix 408 | * it for compatibility reasons so just be careful. 409 | */ 410 | #define DBUS_ERROR_TIMED_OUT "org.freedesktop.DBus.Error.TimedOut" 411 | /** Tried to remove or modify a match rule that didn't exist. */ 412 | #define DBUS_ERROR_MATCH_RULE_NOT_FOUND "org.freedesktop.DBus.Error.MatchRuleNotFound" 413 | /** The match rule isn't syntactically valid. */ 414 | #define DBUS_ERROR_MATCH_RULE_INVALID "org.freedesktop.DBus.Error.MatchRuleInvalid" 415 | /** While starting a new process, the exec() call failed. */ 416 | #define DBUS_ERROR_SPAWN_EXEC_FAILED "org.freedesktop.DBus.Error.Spawn.ExecFailed" 417 | /** While starting a new process, the fork() call failed. */ 418 | #define DBUS_ERROR_SPAWN_FORK_FAILED "org.freedesktop.DBus.Error.Spawn.ForkFailed" 419 | /** While starting a new process, the child exited with a status code. */ 420 | #define DBUS_ERROR_SPAWN_CHILD_EXITED "org.freedesktop.DBus.Error.Spawn.ChildExited" 421 | /** While starting a new process, the child exited on a signal. */ 422 | #define DBUS_ERROR_SPAWN_CHILD_SIGNALED "org.freedesktop.DBus.Error.Spawn.ChildSignaled" 423 | /** While starting a new process, something went wrong. */ 424 | #define DBUS_ERROR_SPAWN_FAILED "org.freedesktop.DBus.Error.Spawn.Failed" 425 | /** We failed to setup the environment correctly. */ 426 | #define DBUS_ERROR_SPAWN_SETUP_FAILED "org.freedesktop.DBus.Error.Spawn.FailedToSetup" 427 | /** We failed to setup the config parser correctly. */ 428 | #define DBUS_ERROR_SPAWN_CONFIG_INVALID "org.freedesktop.DBus.Error.Spawn.ConfigInvalid" 429 | /** Bus name was not valid. */ 430 | #define DBUS_ERROR_SPAWN_SERVICE_INVALID "org.freedesktop.DBus.Error.Spawn.ServiceNotValid" 431 | /** Service file not found in system-services directory. */ 432 | #define DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND "org.freedesktop.DBus.Error.Spawn.ServiceNotFound" 433 | /** Permissions are incorrect on the setuid helper. */ 434 | #define DBUS_ERROR_SPAWN_PERMISSIONS_INVALID "org.freedesktop.DBus.Error.Spawn.PermissionsInvalid" 435 | /** Service file invalid (Name, User or Exec missing). */ 436 | #define DBUS_ERROR_SPAWN_FILE_INVALID "org.freedesktop.DBus.Error.Spawn.FileInvalid" 437 | /** Tried to get a UNIX process ID and it wasn't available. */ 438 | #define DBUS_ERROR_SPAWN_NO_MEMORY "org.freedesktop.DBus.Error.Spawn.NoMemory" 439 | /** Tried to get a UNIX process ID and it wasn't available. */ 440 | #define DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN "org.freedesktop.DBus.Error.UnixProcessIdUnknown" 441 | /** A type signature is not valid. */ 442 | #define DBUS_ERROR_INVALID_SIGNATURE "org.freedesktop.DBus.Error.InvalidSignature" 443 | /** A file contains invalid syntax or is otherwise broken. */ 444 | #define DBUS_ERROR_INVALID_FILE_CONTENT "org.freedesktop.DBus.Error.InvalidFileContent" 445 | /** Asked for SELinux security context and it wasn't available. */ 446 | #define DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN "org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown" 447 | /** Asked for ADT audit data and it wasn't available. */ 448 | #define DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN "org.freedesktop.DBus.Error.AdtAuditDataUnknown" 449 | /** There's already an object with the requested object path. */ 450 | #define DBUS_ERROR_OBJECT_PATH_IN_USE "org.freedesktop.DBus.Error.ObjectPathInUse" 451 | /** The message meta data does not match the payload. e.g. expected 452 | number of file descriptors were not sent over the socket this message was received on. */ 453 | #define DBUS_ERROR_INCONSISTENT_MESSAGE "org.freedesktop.DBus.Error.InconsistentMessage" 454 | /** The message is not allowed without performing interactive authorization, 455 | * but could have succeeded if an interactive authorization step was 456 | * allowed. */ 457 | #define DBUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED "org.freedesktop.DBus.Error.InteractiveAuthorizationRequired" 458 | 459 | /* XML introspection format */ 460 | 461 | /** XML namespace of the introspection format version 1.0 */ 462 | #define DBUS_INTROSPECT_1_0_XML_NAMESPACE "http://www.freedesktop.org/standards/dbus" 463 | /** XML public identifier of the introspection format version 1.0 */ 464 | #define DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" 465 | /** XML system identifier of the introspection format version 1.0 */ 466 | #define DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd" 467 | /** XML document type declaration of the introspection format version 1.0 */ 468 | #define DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "\n" 469 | 470 | /** @} */ 471 | 472 | #ifdef __cplusplus 473 | #if 0 474 | { /* avoids confusing emacs indentation */ 475 | #endif 476 | } 477 | #endif 478 | 479 | #endif /* DBUS_PROTOCOL_H */ 480 | -------------------------------------------------------------------------------- /include/orig/dbus-server.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 | /* dbus-server.h DBusServer object 3 | * 4 | * Copyright (C) 2002, 2003 Red Hat Inc. 5 | * 6 | * Licensed under the Academic Free License version 2.1 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION) 24 | #error "Only can be included directly, this file may disappear or change contents." 25 | #endif 26 | 27 | #ifndef DBUS_SERVER_H 28 | #define DBUS_SERVER_H 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | DBUS_BEGIN_DECLS 37 | 38 | /** 39 | * @addtogroup DBusServer 40 | * @{ 41 | */ 42 | 43 | typedef struct DBusServer DBusServer; 44 | 45 | /** Called when a new connection to the server is available. Must reference and save the new 46 | * connection, or close the new connection. Set with dbus_server_set_new_connection_function(). 47 | */ 48 | typedef void (* DBusNewConnectionFunction) (DBusServer *server, 49 | DBusConnection *new_connection, 50 | void *data); 51 | 52 | DBUS_EXPORT 53 | DBusServer* dbus_server_listen (const char *address, 54 | DBusError *error); 55 | DBUS_EXPORT 56 | DBusServer* dbus_server_ref (DBusServer *server); 57 | DBUS_EXPORT 58 | void dbus_server_unref (DBusServer *server); 59 | DBUS_EXPORT 60 | void dbus_server_disconnect (DBusServer *server); 61 | DBUS_EXPORT 62 | dbus_bool_t dbus_server_get_is_connected (DBusServer *server); 63 | DBUS_EXPORT 64 | char* dbus_server_get_address (DBusServer *server); 65 | DBUS_EXPORT 66 | char* dbus_server_get_id (DBusServer *server); 67 | DBUS_EXPORT 68 | void dbus_server_set_new_connection_function (DBusServer *server, 69 | DBusNewConnectionFunction function, 70 | void *data, 71 | DBusFreeFunction free_data_function); 72 | DBUS_EXPORT 73 | dbus_bool_t dbus_server_set_watch_functions (DBusServer *server, 74 | DBusAddWatchFunction add_function, 75 | DBusRemoveWatchFunction remove_function, 76 | DBusWatchToggledFunction toggled_function, 77 | void *data, 78 | DBusFreeFunction free_data_function); 79 | DBUS_EXPORT 80 | dbus_bool_t dbus_server_set_timeout_functions (DBusServer *server, 81 | DBusAddTimeoutFunction add_function, 82 | DBusRemoveTimeoutFunction remove_function, 83 | DBusTimeoutToggledFunction toggled_function, 84 | void *data, 85 | DBusFreeFunction free_data_function); 86 | DBUS_EXPORT 87 | dbus_bool_t dbus_server_set_auth_mechanisms (DBusServer *server, 88 | const char **mechanisms); 89 | 90 | DBUS_EXPORT 91 | dbus_bool_t dbus_server_allocate_data_slot (dbus_int32_t *slot_p); 92 | DBUS_EXPORT 93 | void dbus_server_free_data_slot (dbus_int32_t *slot_p); 94 | DBUS_EXPORT 95 | dbus_bool_t dbus_server_set_data (DBusServer *server, 96 | int slot, 97 | void *data, 98 | DBusFreeFunction free_data_func); 99 | DBUS_EXPORT 100 | void* dbus_server_get_data (DBusServer *server, 101 | int slot); 102 | 103 | /** 104 | * Clear a variable or struct member that contains a #DBusServer. 105 | * If it does not contain #NULL, the server that was previously 106 | * there is unreferenced with dbus_server_unref(). 107 | * 108 | * This is very similar to dbus_clear_connection(): see that function 109 | * for more details. 110 | * 111 | * @param pointer_to_server A pointer to a variable or struct member. 112 | * pointer_to_server must not be #NULL, but *pointer_to_server 113 | * may be #NULL. 114 | */ 115 | static inline void 116 | dbus_clear_server (DBusServer **pointer_to_server) 117 | { 118 | _dbus_clear_pointer_impl (DBusServer, pointer_to_server, dbus_server_unref); 119 | } 120 | 121 | /** @} */ 122 | 123 | DBUS_END_DECLS 124 | 125 | #endif /* DBUS_SERVER_H */ 126 | -------------------------------------------------------------------------------- /include/orig/dbus-shared.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 | /* dbus-shared.h Stuff used by both dbus/dbus.h low-level and C/C++ binding APIs 3 | * 4 | * Copyright (C) 2004 Red Hat, Inc. 5 | * 6 | * Licensed under the Academic Free License version 2.1 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | 24 | #ifndef DBUS_SHARED_H 25 | #define DBUS_SHARED_H 26 | 27 | /* Don't include anything in here from anywhere else. It's 28 | * intended for use by any random library. 29 | */ 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #if 0 34 | } /* avoids confusing emacs indentation */ 35 | #endif 36 | #endif 37 | 38 | /* Normally docs are in .c files, but there isn't a .c file for this. */ 39 | /** 40 | * @defgroup DBusShared Shared constants 41 | * @ingroup DBus 42 | * 43 | * @brief Shared header included by both libdbus and C/C++ bindings such as the GLib bindings. 44 | * 45 | * Usually a C/C++ binding such as the GLib or Qt binding won't want to include dbus.h in its 46 | * public headers. However, a few constants and macros may be useful to include; those are 47 | * found here and in dbus-protocol.h 48 | * 49 | * @{ 50 | */ 51 | 52 | 53 | /** 54 | * Well-known bus types. See dbus_bus_get(). 55 | */ 56 | typedef enum 57 | { 58 | DBUS_BUS_SESSION, /**< The login session bus */ 59 | DBUS_BUS_SYSTEM, /**< The systemwide bus */ 60 | DBUS_BUS_STARTER /**< The bus that started us, if any */ 61 | } DBusBusType; 62 | 63 | /** 64 | * Results that a message handler can return. 65 | */ 66 | typedef enum 67 | { 68 | DBUS_HANDLER_RESULT_HANDLED, /**< Message has had its effect - no need to run more handlers. */ 69 | DBUS_HANDLER_RESULT_NOT_YET_HANDLED, /**< Message has not had any effect - see if other handlers want it. */ 70 | 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. */ 71 | } DBusHandlerResult; 72 | 73 | /* Bus names */ 74 | 75 | /** The bus name used to talk to the bus itself. */ 76 | #define DBUS_SERVICE_DBUS "org.freedesktop.DBus" 77 | 78 | /* Paths */ 79 | /** The object path used to talk to the bus itself. */ 80 | #define DBUS_PATH_DBUS "/org/freedesktop/DBus" 81 | /** The object path used in local/in-process-generated messages. */ 82 | #define DBUS_PATH_LOCAL "/org/freedesktop/DBus/Local" 83 | 84 | /* Interfaces, these #define don't do much other than 85 | * catch typos at compile time 86 | */ 87 | /** The interface exported by the object with #DBUS_SERVICE_DBUS and #DBUS_PATH_DBUS */ 88 | #define DBUS_INTERFACE_DBUS "org.freedesktop.DBus" 89 | /** The monitoring interface exported by the dbus-daemon */ 90 | #define DBUS_INTERFACE_MONITORING "org.freedesktop.DBus.Monitoring" 91 | 92 | /** The verbose interface exported by the dbus-daemon */ 93 | #define DBUS_INTERFACE_VERBOSE "org.freedesktop.DBus.Verbose" 94 | /** The interface supported by introspectable objects */ 95 | #define DBUS_INTERFACE_INTROSPECTABLE "org.freedesktop.DBus.Introspectable" 96 | /** The interface supported by objects with properties */ 97 | #define DBUS_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties" 98 | /** The interface supported by most dbus peers */ 99 | #define DBUS_INTERFACE_PEER "org.freedesktop.DBus.Peer" 100 | 101 | /** This is a special interface whose methods can only be invoked 102 | * by the local implementation (messages from remote apps aren't 103 | * allowed to specify this interface). 104 | */ 105 | #define DBUS_INTERFACE_LOCAL "org.freedesktop.DBus.Local" 106 | 107 | /* Owner flags */ 108 | #define DBUS_NAME_FLAG_ALLOW_REPLACEMENT 0x1 /**< Allow another service to become the primary owner if requested */ 109 | #define DBUS_NAME_FLAG_REPLACE_EXISTING 0x2 /**< Request to replace the current primary owner */ 110 | #define DBUS_NAME_FLAG_DO_NOT_QUEUE 0x4 /**< If we can not become the primary owner do not place us in the queue */ 111 | 112 | /* Replies to request for a name */ 113 | #define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1 /**< Service has become the primary owner of the requested name */ 114 | #define DBUS_REQUEST_NAME_REPLY_IN_QUEUE 2 /**< Service could not become the primary owner and has been placed in the queue */ 115 | #define DBUS_REQUEST_NAME_REPLY_EXISTS 3 /**< Service is already in the queue */ 116 | #define DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER 4 /**< Service is already the primary owner */ 117 | 118 | /* Replies to releasing a name */ 119 | #define DBUS_RELEASE_NAME_REPLY_RELEASED 1 /**< Service was released from the given name */ 120 | #define DBUS_RELEASE_NAME_REPLY_NON_EXISTENT 2 /**< The given name does not exist on the bus */ 121 | #define DBUS_RELEASE_NAME_REPLY_NOT_OWNER 3 /**< Service is not an owner of the given name */ 122 | 123 | /* Replies to service starts */ 124 | #define DBUS_START_REPLY_SUCCESS 1 /**< Service was auto started */ 125 | #define DBUS_START_REPLY_ALREADY_RUNNING 2 /**< Service was already running */ 126 | 127 | /** @} */ 128 | 129 | #ifdef __cplusplus 130 | #if 0 131 | { /* avoids confusing emacs indentation */ 132 | #endif 133 | } 134 | #endif 135 | 136 | #endif /* DBUS_SHARED_H */ 137 | -------------------------------------------------------------------------------- /include/orig/dbus-signature.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 | /* dbus-signatures.h utility functions for D-Bus types 3 | * 4 | * Copyright (C) 2005 Red Hat Inc. 5 | * 6 | * Licensed under the Academic Free License version 2.1 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION) 24 | #error "Only can be included directly, this file may disappear or change contents." 25 | #endif 26 | 27 | #ifndef DBUS_SIGNATURES_H 28 | #define DBUS_SIGNATURES_H 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | DBUS_BEGIN_DECLS 35 | 36 | /** 37 | * @addtogroup DBusSignature 38 | * @{ 39 | */ 40 | 41 | /** 42 | * DBusSignatureIter struct; contains no public fields 43 | */ 44 | typedef struct 45 | { 46 | void *dummy1; /**< Don't use this */ 47 | void *dummy2; /**< Don't use this */ 48 | dbus_uint32_t dummy8; /**< Don't use this */ 49 | int dummy12; /**< Don't use this */ 50 | int dummy17; /**< Don't use this */ 51 | } DBusSignatureIter; 52 | 53 | DBUS_EXPORT 54 | void dbus_signature_iter_init (DBusSignatureIter *iter, 55 | const char *signature); 56 | 57 | DBUS_EXPORT 58 | int dbus_signature_iter_get_current_type (const DBusSignatureIter *iter); 59 | 60 | DBUS_EXPORT 61 | char * dbus_signature_iter_get_signature (const DBusSignatureIter *iter); 62 | 63 | DBUS_EXPORT 64 | int dbus_signature_iter_get_element_type (const DBusSignatureIter *iter); 65 | 66 | DBUS_EXPORT 67 | dbus_bool_t dbus_signature_iter_next (DBusSignatureIter *iter); 68 | 69 | DBUS_EXPORT 70 | void dbus_signature_iter_recurse (const DBusSignatureIter *iter, 71 | DBusSignatureIter *subiter); 72 | 73 | DBUS_EXPORT 74 | dbus_bool_t dbus_signature_validate (const char *signature, 75 | DBusError *error); 76 | 77 | DBUS_EXPORT 78 | dbus_bool_t dbus_signature_validate_single (const char *signature, 79 | DBusError *error); 80 | 81 | DBUS_EXPORT 82 | dbus_bool_t dbus_type_is_valid (int typecode); 83 | 84 | DBUS_EXPORT 85 | dbus_bool_t dbus_type_is_basic (int typecode); 86 | DBUS_EXPORT 87 | dbus_bool_t dbus_type_is_container (int typecode); 88 | DBUS_EXPORT 89 | dbus_bool_t dbus_type_is_fixed (int typecode); 90 | 91 | /** @} */ 92 | 93 | DBUS_END_DECLS 94 | 95 | #endif /* DBUS_SIGNATURE_H */ 96 | -------------------------------------------------------------------------------- /include/orig/dbus-syntax.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 | /* dbus-syntax.h - utility functions for strings with special syntax 3 | * 4 | * Author: Simon McVittie 5 | * Copyright © 2011 Nokia Corporation 6 | * 7 | * Licensed under the Academic Free License version 2.1 8 | * 9 | * This program is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 2 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program; if not, write to the Free Software 21 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 22 | * 23 | */ 24 | #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION) 25 | #error "Only can be included directly, this file may disappear or change contents." 26 | #endif 27 | 28 | #ifndef DBUS_SYNTAX_H 29 | #define DBUS_SYNTAX_H 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | DBUS_BEGIN_DECLS 36 | 37 | DBUS_EXPORT 38 | dbus_bool_t dbus_validate_path (const char *path, 39 | DBusError *error); 40 | DBUS_EXPORT 41 | dbus_bool_t dbus_validate_interface (const char *name, 42 | DBusError *error); 43 | DBUS_EXPORT 44 | dbus_bool_t dbus_validate_member (const char *name, 45 | DBusError *error); 46 | DBUS_EXPORT 47 | dbus_bool_t dbus_validate_error_name (const char *name, 48 | DBusError *error); 49 | DBUS_EXPORT 50 | dbus_bool_t dbus_validate_bus_name (const char *name, 51 | DBusError *error); 52 | DBUS_EXPORT 53 | dbus_bool_t dbus_validate_utf8 (const char *alleged_utf8, 54 | DBusError *error); 55 | 56 | DBUS_END_DECLS 57 | 58 | #endif /* multiple-inclusion guard */ 59 | -------------------------------------------------------------------------------- /include/orig/dbus-threads.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 | /* dbus-threads.h D-Bus threads handling 3 | * 4 | * Copyright (C) 2002 Red Hat Inc. 5 | * 6 | * Licensed under the Academic Free License version 2.1 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION) 24 | #error "Only can be included directly, this file may disappear or change contents." 25 | #endif 26 | 27 | #ifndef DBUS_THREADS_H 28 | #define DBUS_THREADS_H 29 | 30 | #include 31 | #include 32 | 33 | DBUS_BEGIN_DECLS 34 | 35 | /** 36 | * @addtogroup DBusThreads 37 | * @{ 38 | */ 39 | 40 | /** An opaque mutex type provided by the #DBusThreadFunctions implementation installed by dbus_threads_init(). */ 41 | typedef struct DBusMutex DBusMutex; 42 | /** An opaque condition variable type provided by the #DBusThreadFunctions implementation installed by dbus_threads_init(). */ 43 | typedef struct DBusCondVar DBusCondVar; 44 | 45 | /** Deprecated, provide DBusRecursiveMutexNewFunction instead. */ 46 | typedef DBusMutex* (* DBusMutexNewFunction) (void); 47 | /** Deprecated, provide DBusRecursiveMutexFreeFunction instead. */ 48 | typedef void (* DBusMutexFreeFunction) (DBusMutex *mutex); 49 | /** Deprecated, provide DBusRecursiveMutexLockFunction instead. Return value is lock success, but gets ignored in practice. */ 50 | typedef dbus_bool_t (* DBusMutexLockFunction) (DBusMutex *mutex); 51 | /** Deprecated, provide DBusRecursiveMutexUnlockFunction instead. Return value is unlock success, but gets ignored in practice. */ 52 | typedef dbus_bool_t (* DBusMutexUnlockFunction) (DBusMutex *mutex); 53 | 54 | /** Creates a new recursively-lockable mutex, or returns #NULL if not 55 | * enough memory. Can only fail due to lack of memory. Found in 56 | * #DBusThreadFunctions. Do not just use PTHREAD_MUTEX_RECURSIVE for 57 | * this, because it does not save/restore the recursion count when 58 | * waiting on a condition. libdbus requires the Java-style behavior 59 | * where the mutex is fully unlocked to wait on a condition. 60 | */ 61 | typedef DBusMutex* (* DBusRecursiveMutexNewFunction) (void); 62 | /** Frees a recursively-lockable mutex. Found in #DBusThreadFunctions. 63 | */ 64 | typedef void (* DBusRecursiveMutexFreeFunction) (DBusMutex *mutex); 65 | /** Locks a recursively-lockable mutex. Found in #DBusThreadFunctions. 66 | * Can only fail due to lack of memory. 67 | */ 68 | typedef void (* DBusRecursiveMutexLockFunction) (DBusMutex *mutex); 69 | /** Unlocks a recursively-lockable mutex. Found in #DBusThreadFunctions. 70 | * Can only fail due to lack of memory. 71 | */ 72 | typedef void (* DBusRecursiveMutexUnlockFunction) (DBusMutex *mutex); 73 | 74 | /** Creates a new condition variable. Found in #DBusThreadFunctions. 75 | * Can only fail (returning #NULL) due to lack of memory. 76 | */ 77 | typedef DBusCondVar* (* DBusCondVarNewFunction) (void); 78 | /** Frees a condition variable. Found in #DBusThreadFunctions. 79 | */ 80 | typedef void (* DBusCondVarFreeFunction) (DBusCondVar *cond); 81 | 82 | /** Waits on a condition variable. Found in 83 | * #DBusThreadFunctions. Must work with either a recursive or 84 | * nonrecursive mutex, whichever the thread implementation 85 | * provides. Note that PTHREAD_MUTEX_RECURSIVE does not work with 86 | * condition variables (does not save/restore the recursion count) so 87 | * don't try using simply pthread_cond_wait() and a 88 | * PTHREAD_MUTEX_RECURSIVE to implement this, it won't work right. 89 | * 90 | * Has no error conditions. Must succeed if it returns. 91 | */ 92 | typedef void (* DBusCondVarWaitFunction) (DBusCondVar *cond, 93 | DBusMutex *mutex); 94 | 95 | /** Waits on a condition variable with a timeout. Found in 96 | * #DBusThreadFunctions. Returns #TRUE if the wait did not 97 | * time out, and #FALSE if it did. 98 | * 99 | * Has no error conditions. Must succeed if it returns. 100 | */ 101 | typedef dbus_bool_t (* DBusCondVarWaitTimeoutFunction) (DBusCondVar *cond, 102 | DBusMutex *mutex, 103 | int timeout_milliseconds); 104 | /** Wakes one waiting thread on a condition variable. Found in #DBusThreadFunctions. 105 | * 106 | * Has no error conditions. Must succeed if it returns. 107 | */ 108 | typedef void (* DBusCondVarWakeOneFunction) (DBusCondVar *cond); 109 | 110 | /** Wakes all waiting threads on a condition variable. Found in #DBusThreadFunctions. 111 | * 112 | * Has no error conditions. Must succeed if it returns. 113 | */ 114 | typedef void (* DBusCondVarWakeAllFunction) (DBusCondVar *cond); 115 | 116 | /** 117 | * Flags indicating which functions are present in #DBusThreadFunctions. Used to allow 118 | * the library to detect older callers of dbus_threads_init() if new possible functions 119 | * are added to #DBusThreadFunctions. 120 | */ 121 | typedef enum 122 | { 123 | DBUS_THREAD_FUNCTIONS_MUTEX_NEW_MASK = 1 << 0, 124 | DBUS_THREAD_FUNCTIONS_MUTEX_FREE_MASK = 1 << 1, 125 | DBUS_THREAD_FUNCTIONS_MUTEX_LOCK_MASK = 1 << 2, 126 | DBUS_THREAD_FUNCTIONS_MUTEX_UNLOCK_MASK = 1 << 3, 127 | DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK = 1 << 4, 128 | DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK = 1 << 5, 129 | DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK = 1 << 6, 130 | DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK = 1 << 7, 131 | DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK = 1 << 8, 132 | DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK = 1 << 9, 133 | DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_NEW_MASK = 1 << 10, 134 | DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_FREE_MASK = 1 << 11, 135 | DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_LOCK_MASK = 1 << 12, 136 | DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_UNLOCK_MASK = 1 << 13, 137 | DBUS_THREAD_FUNCTIONS_ALL_MASK = (1 << 14) - 1 138 | } DBusThreadFunctionsMask; 139 | 140 | /** 141 | * Functions that must be implemented to make the D-Bus library 142 | * thread-aware. 143 | * 144 | * If you supply both recursive and non-recursive mutexes, 145 | * libdbus will use the non-recursive version for condition variables, 146 | * and the recursive version in other contexts. 147 | * 148 | * The condition variable functions have to work with nonrecursive 149 | * mutexes if you provide those, or with recursive mutexes if you 150 | * don't. 151 | */ 152 | typedef struct 153 | { 154 | unsigned int mask; /**< Mask indicating which functions are present. */ 155 | 156 | DBusMutexNewFunction mutex_new; /**< Function to create a mutex; optional and deprecated. */ 157 | DBusMutexFreeFunction mutex_free; /**< Function to free a mutex; optional and deprecated. */ 158 | DBusMutexLockFunction mutex_lock; /**< Function to lock a mutex; optional and deprecated. */ 159 | DBusMutexUnlockFunction mutex_unlock; /**< Function to unlock a mutex; optional and deprecated. */ 160 | 161 | DBusCondVarNewFunction condvar_new; /**< Function to create a condition variable */ 162 | DBusCondVarFreeFunction condvar_free; /**< Function to free a condition variable */ 163 | DBusCondVarWaitFunction condvar_wait; /**< Function to wait on a condition */ 164 | DBusCondVarWaitTimeoutFunction condvar_wait_timeout; /**< Function to wait on a condition with a timeout */ 165 | DBusCondVarWakeOneFunction condvar_wake_one; /**< Function to wake one thread waiting on the condition */ 166 | DBusCondVarWakeAllFunction condvar_wake_all; /**< Function to wake all threads waiting on the condition */ 167 | 168 | DBusRecursiveMutexNewFunction recursive_mutex_new; /**< Function to create a recursive mutex */ 169 | DBusRecursiveMutexFreeFunction recursive_mutex_free; /**< Function to free a recursive mutex */ 170 | DBusRecursiveMutexLockFunction recursive_mutex_lock; /**< Function to lock a recursive mutex */ 171 | DBusRecursiveMutexUnlockFunction recursive_mutex_unlock; /**< Function to unlock a recursive mutex */ 172 | 173 | void (* padding1) (void); /**< Reserved for future expansion */ 174 | void (* padding2) (void); /**< Reserved for future expansion */ 175 | void (* padding3) (void); /**< Reserved for future expansion */ 176 | void (* padding4) (void); /**< Reserved for future expansion */ 177 | 178 | } DBusThreadFunctions; 179 | 180 | DBUS_EXPORT 181 | dbus_bool_t dbus_threads_init (const DBusThreadFunctions *functions); 182 | DBUS_EXPORT 183 | dbus_bool_t dbus_threads_init_default (void); 184 | 185 | /** @} */ 186 | 187 | DBUS_END_DECLS 188 | 189 | #endif /* DBUS_THREADS_H */ 190 | -------------------------------------------------------------------------------- /include/orig/dbus-types.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 | /* dbus-types.h types such as dbus_bool_t 3 | * 4 | * Copyright (C) 2002 Red Hat Inc. 5 | * 6 | * Licensed under the Academic Free License version 2.1 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION) 24 | #error "Only can be included directly, this file may disappear or change contents." 25 | #endif 26 | 27 | #ifndef DBUS_TYPES_H 28 | #define DBUS_TYPES_H 29 | 30 | #include 31 | #include 32 | 33 | typedef dbus_uint32_t dbus_unichar_t; 34 | /* boolean size must be fixed at 4 bytes due to wire protocol! */ 35 | typedef dbus_uint32_t dbus_bool_t; 36 | 37 | /* Normally docs are in .c files, but there isn't a .c file for this. */ 38 | /** 39 | * @defgroup DBusTypes Basic types 40 | * @ingroup DBus 41 | * @brief dbus_bool_t, dbus_int32_t, etc. 42 | * 43 | * Typedefs for common primitive types. 44 | * 45 | * @{ 46 | */ 47 | 48 | /** 49 | * @typedef dbus_bool_t 50 | * 51 | * A boolean, valid values are #TRUE and #FALSE. 52 | */ 53 | 54 | /** 55 | * @typedef dbus_uint32_t 56 | * 57 | * A 32-bit unsigned integer on all platforms. 58 | */ 59 | 60 | /** 61 | * @typedef dbus_int32_t 62 | * 63 | * A 32-bit signed integer on all platforms. 64 | */ 65 | 66 | /** 67 | * @typedef dbus_uint16_t 68 | * 69 | * A 16-bit unsigned integer on all platforms. 70 | */ 71 | 72 | /** 73 | * @typedef dbus_int16_t 74 | * 75 | * A 16-bit signed integer on all platforms. 76 | */ 77 | 78 | 79 | /** 80 | * @typedef dbus_uint64_t 81 | * 82 | * A 64-bit unsigned integer. 83 | */ 84 | 85 | /** 86 | * @typedef dbus_int64_t 87 | * 88 | * A 64-bit signed integer. 89 | */ 90 | 91 | /** 92 | * @def DBUS_HAVE_INT64 93 | * 94 | * Always defined. 95 | * 96 | * In older libdbus versions, this would be undefined if there was no 97 | * 64-bit integer type on that platform. libdbus no longer supports 98 | * such platforms. 99 | */ 100 | 101 | /** 102 | * @def DBUS_INT64_CONSTANT 103 | * 104 | * Declare a 64-bit signed integer constant. The macro 105 | * adds the necessary "LL" or whatever after the integer, 106 | * giving a literal such as "325145246765LL" 107 | */ 108 | 109 | /** 110 | * @def DBUS_UINT64_CONSTANT 111 | * 112 | * Declare a 64-bit unsigned integer constant. The macro 113 | * adds the necessary "ULL" or whatever after the integer, 114 | * giving a literal such as "325145246765ULL" 115 | */ 116 | 117 | /** 118 | * An 8-byte struct you could use to access int64 without having 119 | * int64 support. Use #dbus_int64_t or #dbus_uint64_t instead. 120 | */ 121 | typedef struct 122 | { 123 | dbus_uint32_t first32; /**< first 32 bits in the 8 bytes (beware endian issues) */ 124 | dbus_uint32_t second32; /**< second 32 bits in the 8 bytes (beware endian issues) */ 125 | } DBus8ByteStruct; 126 | 127 | /** 128 | * A simple value union that lets you access bytes as if they 129 | * were various types; useful when dealing with basic types via 130 | * void pointers and varargs. 131 | * 132 | * This union also contains a pointer member (which can be used 133 | * to retrieve a string from dbus_message_iter_get_basic(), for 134 | * instance), so on future platforms it could conceivably be larger 135 | * than 8 bytes. 136 | */ 137 | typedef union 138 | { 139 | unsigned char bytes[8]; /**< as 8 individual bytes */ 140 | dbus_int16_t i16; /**< as int16 */ 141 | dbus_uint16_t u16; /**< as int16 */ 142 | dbus_int32_t i32; /**< as int32 */ 143 | dbus_uint32_t u32; /**< as int32 */ 144 | dbus_bool_t bool_val; /**< as boolean */ 145 | dbus_int64_t i64; /**< as int64 */ 146 | dbus_uint64_t u64; /**< as int64 */ 147 | DBus8ByteStruct eight; /**< as 8-byte struct */ 148 | double dbl; /**< as double */ 149 | unsigned char byt; /**< as byte */ 150 | char *str; /**< as char* (string, object path or signature) */ 151 | int fd; /**< as Unix file descriptor */ 152 | } DBusBasicValue; 153 | 154 | /** @} */ 155 | 156 | #endif /* DBUS_TYPES_H */ 157 | -------------------------------------------------------------------------------- /include/orig/dbus.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 2 | /* dbus.h Convenience header including all other headers 3 | * 4 | * Copyright (C) 2002, 2003 Red Hat Inc. 5 | * 6 | * Licensed under the Academic Free License version 2.1 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21 | * 22 | */ 23 | 24 | #ifndef DBUS_H 25 | #define DBUS_H 26 | 27 | #define DBUS_INSIDE_DBUS_H 1 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | 46 | #undef DBUS_INSIDE_DBUS_H 47 | 48 | /** 49 | * @defgroup DBus D-Bus low-level public API 50 | * @brief The low-level public API of the D-Bus library 51 | * 52 | * libdbus provides a low-level C API intended primarily for use by 53 | * bindings to specific object systems and languages. D-Bus is most 54 | * convenient when used with the GLib bindings, Python bindings, Qt 55 | * bindings, Mono bindings, and so forth. This low-level API has a 56 | * lot of complexity useful only for bindings. 57 | * 58 | * @{ 59 | */ 60 | 61 | /** @} */ 62 | 63 | /** 64 | * @mainpage 65 | * 66 | * This manual documents the low-level D-Bus C API. If you use 67 | * this low-level API directly, you're signing up for some pain. 68 | * 69 | * Caveats aside, you might get started learning the low-level API by reading 70 | * about @ref DBusConnection and @ref DBusMessage. 71 | * 72 | * There are several other places to look for D-Bus information, such 73 | * as the tutorial and the specification; those can be found at the D-Bus 75 | * website. If you're interested in a sysadmin or package 76 | * maintainer's perspective on the dbus-daemon itself and its 77 | * configuration, be sure to check out the man pages as well. 78 | * 79 | * The low-level API documented in this manual deliberately lacks 80 | * most convenience functions - those are left up to higher-level libraries 81 | * based on frameworks such as GLib, Qt, Python, Mono, Java, 82 | * etc. These higher-level libraries (often called "D-Bus bindings") 83 | * have features such as object systems and main loops that allow a 84 | * much more convenient API. 85 | * 86 | * The low-level API also contains plenty of clutter to support 87 | * integration with arbitrary object systems, languages, main loops, 88 | * and so forth. These features add a lot of noise to the API that you 89 | * probably don't care about unless you're coding a binding. 90 | * 91 | * This manual also contains docs for @ref DBusInternals "D-Bus internals", 92 | * so you can use it to get oriented to the D-Bus source code if you're 93 | * interested in patching the code. You should also read the 94 | * file CONTRIBUTING.md which comes with the source code if you plan to 95 | * contribute to D-Bus. 96 | * 97 | * As you read the code, you can identify internal D-Bus functions 98 | * because they start with an underscore ('_') character. Also, any 99 | * identifier or macro that lacks a DBus, dbus_, or DBUS_ namepace 100 | * prefix is internal, with a couple of exceptions such as #NULL, 101 | * #TRUE, and #FALSE. 102 | */ 103 | 104 | #endif /* DBUS_H */ 105 | -------------------------------------------------------------------------------- /lib/DBus.php: -------------------------------------------------------------------------------- 1 | conn = $conn; 88 | } 89 | 90 | public static function connect(int $busId) : self 91 | { 92 | self::init(); 93 | 94 | $err = self::$ffi->new('struct DBusError'); 95 | self::$ffi->dbus_error_init(FFI::addr($err)); 96 | $conn = self::$ffi->dbus_bus_get($busId, FFI::addr($err)); 97 | if (self::$ffi->dbus_error_is_set(FFI::addr($err))) { 98 | $message = $err->cdata['message']; 99 | self::$ffi->dbus_error_free(FFI::addr($err)); 100 | throw new RuntimeException(sprintf('Connection Error (%s)', $message)); 101 | } 102 | if ($conn === null) { 103 | throw new RuntimeException('Unable to create connection'); 104 | } 105 | 106 | return new self($conn); 107 | } 108 | 109 | public function addMatch(string $match = '') : bool 110 | { 111 | $err = self::$ffi->new('struct DBusError'); 112 | self::$ffi->dbus_bus_add_match($this->conn, $match, FFI::addr($err)); 113 | self::$ffi->dbus_connection_flush($this->conn); 114 | if (self::$ffi->dbus_error_is_set(FFI::addr($err))) { 115 | $message = $err->cdata['message']; 116 | self::$ffi->dbus_error_free(FFI::addr($err)); 117 | trigger_error(sprintf('Match Error (%s)', $message), E_USER_WARNING); 118 | 119 | return false; 120 | } 121 | 122 | return true; 123 | } 124 | 125 | public function waitLoop() : ?Message 126 | { 127 | self::$ffi->dbus_connection_read_write($this->conn, 0); 128 | $msg = self::$ffi->dbus_connection_pop_message($this->conn); 129 | 130 | // loop again if we haven't read a message 131 | if ($msg === null) { 132 | return null; 133 | } 134 | 135 | $args = self::$ffi->new('struct DBusMessageIter'); 136 | if (! self::$ffi->dbus_message_iter_init($msg, FFI::addr($args))) { 137 | trigger_error("Message has no arguments!\n", E_USER_WARNING); 138 | 139 | return null; 140 | } 141 | 142 | $message = new Message(); 143 | $message->interface = self::$ffi->dbus_message_get_interface($msg); 144 | $message->path = self::$ffi->dbus_message_get_path($msg); 145 | $message->member = self::$ffi->dbus_message_get_member($msg); 146 | $message->arguments = self::$decoder->decode($args); 147 | 148 | self::$ffi->dbus_message_unref($msg); 149 | 150 | return $message; 151 | } 152 | } 153 | -------------------------------------------------------------------------------- /lib/DBusMessageIterDecoder.php: -------------------------------------------------------------------------------- 1 | ffi = $ffi; 25 | } 26 | 27 | /** 28 | * @return mixed[] 29 | */ 30 | public function decode(FFI\CData $args) : array 31 | { 32 | assert($this->ffi instanceof PaxalDbusPhp); 33 | $result = []; 34 | $i = 0; 35 | do { 36 | $type = $this->ffi->dbus_message_iter_get_arg_type(FFI::addr($args)); 37 | switch ($type) { 38 | case DBus::TYPE_STRING: 39 | case DBus::TYPE_SIGNATURE: 40 | case DBus::TYPE_OBJECT_PATH: 41 | $w = FFI::new('char*'); 42 | $this->ffi->dbus_message_iter_get_basic(FFI::addr($args), FFI::addr($w)); 43 | $result[] = FFI::string($w); 44 | break; 45 | case DBus::TYPE_BOOLEAN: 46 | $w = FFI::new('bool'); 47 | $this->ffi->dbus_message_iter_get_basic(FFI::addr($args), FFI::addr($w)); 48 | $result[] = $w->cdata; 49 | break; 50 | case DBus::TYPE_INT16: 51 | $result[] = $this->cdata('short', $args); 52 | break; 53 | 54 | case DBus::TYPE_UINT16: 55 | $result[] = $this->cdata('unsigned short', $args); 56 | break; 57 | case DBus::TYPE_INT32: 58 | $result[] = $this->cdata('long', $args); 59 | break; 60 | case DBus::TYPE_UINT32: 61 | $result[] = $this->cdata('unsigned long', $args); 62 | break; 63 | case DBus::TYPE_INT64: 64 | $result[] = $this->cdata('int', $args); 65 | break; 66 | case DBus::TYPE_UINT64: 67 | $result[] = $this->cdata('unsigned int', $args); 68 | break; 69 | case DBus::TYPE_DOUBLE: 70 | $result[] = $this->cdata('double', $args); 71 | break; 72 | 73 | case DBus::TYPE_BYTE: 74 | $result[] = ord((string) $this->cdata('char', $args)); 75 | break; 76 | 77 | case DBus::TYPE_DICT_ENTRY: 78 | $sub = $this->ffi->new('struct DBusMessageIter'); 79 | $this->ffi->dbus_message_iter_recurse(FFI::addr($args), FFI::addr($sub)); 80 | $pair = $this->decode($sub); 81 | [$key, $value] = array_values($pair); 82 | $result[$key] = $value; 83 | break; 84 | 85 | case DBus::TYPE_ARRAY: 86 | $sub = $this->ffi->new('struct DBusMessageIter'); 87 | $this->ffi->dbus_message_iter_recurse(FFI::addr($args), FFI::addr($sub)); 88 | $result[] = $this->decode($sub); 89 | break; 90 | 91 | case DBus::TYPE_VARIANT: 92 | $sub = $this->ffi->new('struct DBusMessageIter'); 93 | $this->ffi->dbus_message_iter_recurse(FFI::addr($args), FFI::addr($sub)); 94 | $subResult = $this->decode($sub); 95 | $result[] = array_shift($subResult); 96 | break; 97 | 98 | case 0: 99 | break; 100 | 101 | default: 102 | $result[] = null; 103 | } 104 | ++$i; 105 | } while ($this->ffi->dbus_message_iter_next(FFI::addr($args))); 106 | 107 | return $result; 108 | } 109 | 110 | /** 111 | * @return int|float|string 112 | */ 113 | private function cdata(string $type, FFI\CData $args) 114 | { 115 | assert($this->ffi instanceof PaxalDbusPhp); 116 | $w = FFI::new($type); 117 | $this->ffi->dbus_message_iter_get_basic(FFI::addr($args), FFI::addr($w)); 118 | 119 | return $w->cdata; 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /lib/DBusObject.php: -------------------------------------------------------------------------------- 1 | dbus = $dbus; 25 | $this->message = $message; 26 | $this->destination = $destination; 27 | $this->path = $path; 28 | $this->interface = $interface; 29 | $this->direction = $direction; 30 | } 31 | 32 | public function getDbus() : DBus 33 | { 34 | return $this->dbus; 35 | } 36 | 37 | public function getDestination() : string 38 | { 39 | return $this->destination; 40 | } 41 | 42 | public function getPath() : string 43 | { 44 | return $this->path; 45 | } 46 | 47 | public function getInterface() : string 48 | { 49 | return $this->interface; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /lib/Message.php: -------------------------------------------------------------------------------- 1 | dbus = $dbus; 19 | $this->object = $object; 20 | $this->interface = $interface; 21 | $this->signal = $signal; 22 | } 23 | 24 | public function matches(string $interface, string $method) : bool 25 | { 26 | throw new Exception(); 27 | } 28 | 29 | public function getDbus() : DBus 30 | { 31 | return $this->dbus; 32 | } 33 | 34 | public function getObject() : string 35 | { 36 | return $this->object; 37 | } 38 | 39 | public function getInterface() : string 40 | { 41 | return $this->interface; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /lib/Type/DBusDict.php: -------------------------------------------------------------------------------- 1 | $elements 15 | */ 16 | public function __construct(int $type, array $elements) 17 | { 18 | $this->type = $type; 19 | $this->elements = $elements; 20 | } 21 | 22 | public function getType() : int 23 | { 24 | return $this->type; 25 | } 26 | 27 | /** 28 | * @return array 29 | */ 30 | public function getElements() : array 31 | { 32 | return $this->elements; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /lib/Type/DBusObjectPath.php: -------------------------------------------------------------------------------- 1 | data = $data; 14 | } 15 | 16 | public function getData() : string 17 | { 18 | return $this->data; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /lib/Type/DBusStruct.php: -------------------------------------------------------------------------------- 1 | $data 14 | */ 15 | public function __construct(string $signature, array $data) 16 | { 17 | $this->signature = $signature; 18 | $this->data = $data; 19 | } 20 | 21 | /** 22 | * @return array 23 | */ 24 | public function getData() : array 25 | { 26 | return $this->data; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/Type/DBusVariant.php: -------------------------------------------------------------------------------- 1 | data = $data; 18 | } 19 | 20 | /** 21 | * @return mixed 22 | */ 23 | public function getData() 24 | { 25 | return $this->data; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /load.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | lib 13 | examples 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /phpstan.neon: -------------------------------------------------------------------------------- 1 | parameters: 2 | inferPrivatePropertyTypeFromConstructor: true 3 | 4 | includes: 5 | - vendor/phpstan/phpstan/conf/bleedingEdge.neon 6 | --------------------------------------------------------------------------------