Imported existing code

This commit is contained in:
Hazim Gazov
2010-04-02 02:48:44 -03:00
parent 48fbc5ae91
commit 7a86d01598
13996 changed files with 2468699 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-address.h Server address parser.
*
* Copyright (C) 2003 CodeFactory AB
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_ADDRESS_H
#define DBUS_ADDRESS_H
#include <dbus/dbus-types.h>
#include <dbus/dbus-errors.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusAddress
* @{
*/
/** Opaque type representing one of the semicolon-separated items in an address */
typedef struct DBusAddressEntry DBusAddressEntry;
dbus_bool_t dbus_parse_address (const char *address,
DBusAddressEntry ***entry,
int *array_len,
DBusError *error);
const char *dbus_address_entry_get_value (DBusAddressEntry *entry,
const char *key);
const char *dbus_address_entry_get_method (DBusAddressEntry *entry);
void dbus_address_entries_free (DBusAddressEntry **entries);
char* dbus_address_escape_value (const char *value);
char* dbus_address_unescape_value (const char *value,
DBusError *error);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_ADDRESS_H */

View File

@@ -0,0 +1,56 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-arch-deps.h Header with architecture/compiler specific information, installed to libdir
*
* Copyright (C) 2003 Red Hat, Inc.
*
* Licensed under the Academic Free License version 2.0
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_ARCH_DEPS_H
#define DBUS_ARCH_DEPS_H
#include <dbus/dbus-macros.h>
DBUS_BEGIN_DECLS
#if 1
#define DBUS_HAVE_INT64 1
typedef long long dbus_int64_t;
typedef unsigned long long dbus_uint64_t;
#define DBUS_INT64_CONSTANT(val) (val##LL)
#define DBUS_UINT64_CONSTANT(val) (val##ULL)
#else
#undef DBUS_HAVE_INT64
#undef DBUS_INT64_CONSTANT
#undef DBUS_UINT64_CONSTANT
#endif
typedef int dbus_int32_t;
typedef unsigned int dbus_uint32_t;
typedef short dbus_int16_t;
typedef unsigned short dbus_uint16_t;
DBUS_END_DECLS
#endif /* DBUS_ARCH_DEPS_H */

View File

@@ -0,0 +1,80 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-bus.h Convenience functions for communicating with the bus.
*
* Copyright (C) 2003 CodeFactory AB
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_BUS_H
#define DBUS_BUS_H
#include <dbus/dbus-connection.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusBus
* @{
*/
DBusConnection *dbus_bus_get (DBusBusType type,
DBusError *error);
DBusConnection *dbus_bus_get_private (DBusBusType type,
DBusError *error);
dbus_bool_t dbus_bus_register (DBusConnection *connection,
DBusError *error);
dbus_bool_t dbus_bus_set_unique_name (DBusConnection *connection,
const char *unique_name);
const char* dbus_bus_get_unique_name (DBusConnection *connection);
unsigned long dbus_bus_get_unix_user (DBusConnection *connection,
const char *name,
DBusError *error);
int dbus_bus_request_name (DBusConnection *connection,
const char *name,
unsigned int flags,
DBusError *error);
int dbus_bus_release_name (DBusConnection *connection,
const char *name,
DBusError *error);
dbus_bool_t dbus_bus_name_has_owner (DBusConnection *connection,
const char *name,
DBusError *error);
dbus_bool_t dbus_bus_start_service_by_name (DBusConnection *connection,
const char *name,
dbus_uint32_t flags,
dbus_uint32_t *reply,
DBusError *error);
void dbus_bus_add_match (DBusConnection *connection,
const char *rule,
DBusError *error);
void dbus_bus_remove_match (DBusConnection *connection,
const char *rule,
DBusError *error);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_BUS_H */

View File

@@ -0,0 +1,361 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-connection.h DBusConnection object
*
* Copyright (C) 2002, 2003 Red Hat Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_CONNECTION_H
#define DBUS_CONNECTION_H
#include <dbus/dbus-errors.h>
#include <dbus/dbus-memory.h>
#include <dbus/dbus-message.h>
#include <dbus/dbus-shared.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusConnection
* @{
*/
/* documented in dbus-watch.c */
typedef struct DBusWatch DBusWatch;
/* documented in dbus-timeout.c */
typedef struct DBusTimeout DBusTimeout;
/** Opaque type representing preallocated resources so a message can be sent without further memory allocation. */
typedef struct DBusPreallocatedSend DBusPreallocatedSend;
/** Opaque type representing a method call that has not yet received a reply. */
typedef struct DBusPendingCall DBusPendingCall;
/** Opaque type representing a connection to a remote application and associated incoming/outgoing message queues. */
typedef struct DBusConnection DBusConnection;
/** Set of functions that must be implemented to handle messages sent to a particular object path. */
typedef struct DBusObjectPathVTable DBusObjectPathVTable;
/**
* Indicates the status of a #DBusWatch.
*/
typedef enum
{
DBUS_WATCH_READABLE = 1 << 0, /**< As in POLLIN */
DBUS_WATCH_WRITABLE = 1 << 1, /**< As in POLLOUT */
DBUS_WATCH_ERROR = 1 << 2, /**< As in POLLERR (can't watch for
* this, but can be present in
* current state passed to
* dbus_watch_handle()).
*/
DBUS_WATCH_HANGUP = 1 << 3 /**< As in POLLHUP (can't watch for
* it, but can be present in current
* state passed to
* dbus_watch_handle()).
*/
} DBusWatchFlags;
/**
* Indicates the status of incoming data on a #DBusConnection. This determines whether
* dbus_connection_dispatch() needs to be called.
*/
typedef enum
{
DBUS_DISPATCH_DATA_REMAINS, /**< There is more data to potentially convert to messages. */
DBUS_DISPATCH_COMPLETE, /**< All currently available data has been processed. */
DBUS_DISPATCH_NEED_MEMORY /**< More memory is needed to continue. */
} DBusDispatchStatus;
/** Called when libdbus needs a new watch to be monitored by the main
* loop. Returns #FALSE if it lacks enough memory to add the
* watch. Set by dbus_connection_set_watch_functions() or
* dbus_server_set_watch_functions().
*/
typedef dbus_bool_t (* DBusAddWatchFunction) (DBusWatch *watch,
void *data);
/** Called when dbus_watch_get_enabled() may return a different value
* than it did before. Set by dbus_connection_set_watch_functions()
* or dbus_server_set_watch_functions().
*/
typedef void (* DBusWatchToggledFunction) (DBusWatch *watch,
void *data);
/** Called when libdbus no longer needs a watch to be monitored by the
* main loop. Set by dbus_connection_set_watch_functions() or
* dbus_server_set_watch_functions().
*/
typedef void (* DBusRemoveWatchFunction) (DBusWatch *watch,
void *data);
/** Called when libdbus needs a new timeout to be monitored by the main
* loop. Returns #FALSE if it lacks enough memory to add the
* watch. Set by dbus_connection_set_timeout_functions() or
* dbus_server_set_timeout_functions().
*/
typedef dbus_bool_t (* DBusAddTimeoutFunction) (DBusTimeout *timeout,
void *data);
/** Called when dbus_timeout_get_enabled() may return a different
* value than it did before.
* Set by dbus_connection_set_timeout_functions() or
* dbus_server_set_timeout_functions().
*/
typedef void (* DBusTimeoutToggledFunction) (DBusTimeout *timeout,
void *data);
/** Called when libdbus no longer needs a timeout to be monitored by the
* main loop. Set by dbus_connection_set_timeout_functions() or
* dbus_server_set_timeout_functions().
*/
typedef void (* DBusRemoveTimeoutFunction) (DBusTimeout *timeout,
void *data);
/** Called when the return value of dbus_connection_get_dispatch_status()
* may have changed. Set with dbus_connection_set_dispatch_status_function().
*/
typedef void (* DBusDispatchStatusFunction) (DBusConnection *connection,
DBusDispatchStatus new_status,
void *data);
/**
* Called when the main loop's thread should be notified that there's now work
* to do. Set with dbus_connection_set_wakeup_main_function().
*/
typedef void (* DBusWakeupMainFunction) (void *data);
/**
* Called during authentication on UNIX systems to check whether the given
* user ID is allowed to connect. Never called on Windows. Set with
* dbus_connection_set_unix_user_function().
*/
typedef dbus_bool_t (* DBusAllowUnixUserFunction) (DBusConnection *connection,
unsigned long uid,
void *data);
/**
* Called when a pending call now has a reply available. Set with
* dbus_pending_call_set_notify().
*/
typedef void (* DBusPendingCallNotifyFunction) (DBusPendingCall *pending,
void *user_data);
/**
* Called when a message needs to be handled. The result indicates whether or
* not more handlers should be run. Set with dbus_connection_add_filter().
*/
typedef DBusHandlerResult (* DBusHandleMessageFunction) (DBusConnection *connection,
DBusMessage *message,
void *user_data);
DBusConnection* dbus_connection_open (const char *address,
DBusError *error);
DBusConnection* dbus_connection_open_private (const char *address,
DBusError *error);
DBusConnection* dbus_connection_ref (DBusConnection *connection);
void dbus_connection_unref (DBusConnection *connection);
void dbus_connection_close (DBusConnection *connection);
dbus_bool_t dbus_connection_get_is_connected (DBusConnection *connection);
dbus_bool_t dbus_connection_get_is_authenticated (DBusConnection *connection);
void dbus_connection_set_exit_on_disconnect (DBusConnection *connection,
dbus_bool_t exit_on_disconnect);
void dbus_connection_flush (DBusConnection *connection);
dbus_bool_t dbus_connection_read_write_dispatch (DBusConnection *connection,
int timeout_milliseconds);
dbus_bool_t dbus_connection_read_write (DBusConnection *connection,
int timeout_milliseconds);
DBusMessage* dbus_connection_borrow_message (DBusConnection *connection);
void dbus_connection_return_message (DBusConnection *connection,
DBusMessage *message);
void dbus_connection_steal_borrowed_message (DBusConnection *connection,
DBusMessage *message);
DBusMessage* dbus_connection_pop_message (DBusConnection *connection);
DBusDispatchStatus dbus_connection_get_dispatch_status (DBusConnection *connection);
DBusDispatchStatus dbus_connection_dispatch (DBusConnection *connection);
dbus_bool_t dbus_connection_has_messages_to_send (DBusConnection *connection);
dbus_bool_t dbus_connection_send (DBusConnection *connection,
DBusMessage *message,
dbus_uint32_t *client_serial);
dbus_bool_t dbus_connection_send_with_reply (DBusConnection *connection,
DBusMessage *message,
DBusPendingCall **pending_return,
int timeout_milliseconds);
DBusMessage * dbus_connection_send_with_reply_and_block (DBusConnection *connection,
DBusMessage *message,
int timeout_milliseconds,
DBusError *error);
dbus_bool_t dbus_connection_set_watch_functions (DBusConnection *connection,
DBusAddWatchFunction add_function,
DBusRemoveWatchFunction remove_function,
DBusWatchToggledFunction toggled_function,
void *data,
DBusFreeFunction free_data_function);
dbus_bool_t dbus_connection_set_timeout_functions (DBusConnection *connection,
DBusAddTimeoutFunction add_function,
DBusRemoveTimeoutFunction remove_function,
DBusTimeoutToggledFunction toggled_function,
void *data,
DBusFreeFunction free_data_function);
void dbus_connection_set_wakeup_main_function (DBusConnection *connection,
DBusWakeupMainFunction wakeup_main_function,
void *data,
DBusFreeFunction free_data_function);
void dbus_connection_set_dispatch_status_function (DBusConnection *connection,
DBusDispatchStatusFunction function,
void *data,
DBusFreeFunction free_data_function);
dbus_bool_t dbus_connection_get_unix_user (DBusConnection *connection,
unsigned long *uid);
dbus_bool_t dbus_connection_get_unix_process_id (DBusConnection *connection,
unsigned long *pid);
void dbus_connection_set_unix_user_function (DBusConnection *connection,
DBusAllowUnixUserFunction function,
void *data,
DBusFreeFunction free_data_function);
void dbus_connection_set_route_peer_messages (DBusConnection *connection,
dbus_bool_t value);
/* Filters */
dbus_bool_t dbus_connection_add_filter (DBusConnection *connection,
DBusHandleMessageFunction function,
void *user_data,
DBusFreeFunction free_data_function);
void dbus_connection_remove_filter (DBusConnection *connection,
DBusHandleMessageFunction function,
void *user_data);
/* Other */
dbus_bool_t dbus_connection_allocate_data_slot (dbus_int32_t *slot_p);
void dbus_connection_free_data_slot (dbus_int32_t *slot_p);
dbus_bool_t dbus_connection_set_data (DBusConnection *connection,
dbus_int32_t slot,
void *data,
DBusFreeFunction free_data_func);
void* dbus_connection_get_data (DBusConnection *connection,
dbus_int32_t slot);
void dbus_connection_set_change_sigpipe (dbus_bool_t will_modify_sigpipe);
void dbus_connection_set_max_message_size (DBusConnection *connection,
long size);
long dbus_connection_get_max_message_size (DBusConnection *connection);
void dbus_connection_set_max_received_size (DBusConnection *connection,
long size);
long dbus_connection_get_max_received_size (DBusConnection *connection);
long dbus_connection_get_outgoing_size (DBusConnection *connection);
DBusPreallocatedSend* dbus_connection_preallocate_send (DBusConnection *connection);
void dbus_connection_free_preallocated_send (DBusConnection *connection,
DBusPreallocatedSend *preallocated);
void dbus_connection_send_preallocated (DBusConnection *connection,
DBusPreallocatedSend *preallocated,
DBusMessage *message,
dbus_uint32_t *client_serial);
/* Object tree functionality */
/**
* Called when a #DBusObjectPathVTable is unregistered (or its connection is freed).
* Found in #DBusObjectPathVTable.
*/
typedef void (* DBusObjectPathUnregisterFunction) (DBusConnection *connection,
void *user_data);
/**
* Called when a message is sent to a registered object path. Found in
* #DBusObjectPathVTable which is registered with dbus_connection_register_object_path()
* or dbus_connection_register_fallback().
*/
typedef DBusHandlerResult (* DBusObjectPathMessageFunction) (DBusConnection *connection,
DBusMessage *message,
void *user_data);
/**
* Virtual table that must be implemented to handle a portion of the
* object path hierarchy. Attach the vtable to a particular path using
* dbus_connection_register_object_path() or
* dbus_connection_register_fallback().
*/
struct DBusObjectPathVTable
{
DBusObjectPathUnregisterFunction unregister_function; /**< Function to unregister this handler */
DBusObjectPathMessageFunction message_function; /**< Function to handle messages */
void (* dbus_internal_pad1) (void *); /**< Reserved for future expansion */
void (* dbus_internal_pad2) (void *); /**< Reserved for future expansion */
void (* dbus_internal_pad3) (void *); /**< Reserved for future expansion */
void (* dbus_internal_pad4) (void *); /**< Reserved for future expansion */
};
dbus_bool_t dbus_connection_register_object_path (DBusConnection *connection,
const char *path,
const DBusObjectPathVTable *vtable,
void *user_data);
dbus_bool_t dbus_connection_register_fallback (DBusConnection *connection,
const char *path,
const DBusObjectPathVTable *vtable,
void *user_data);
dbus_bool_t dbus_connection_unregister_object_path (DBusConnection *connection,
const char *path);
dbus_bool_t dbus_connection_get_object_path_data (DBusConnection *connection,
const char *path,
void **data_p);
dbus_bool_t dbus_connection_list_registered (DBusConnection *connection,
const char *parent_path,
char ***child_entries);
dbus_bool_t dbus_connection_get_unix_fd (DBusConnection *connection,
int *fd);
dbus_bool_t dbus_connection_get_socket (DBusConnection *connection,
int *fd);
/** @} */
/**
* @addtogroup DBusWatch
* @{
*/
int dbus_watch_get_fd (DBusWatch *watch);
unsigned int dbus_watch_get_flags (DBusWatch *watch);
void* dbus_watch_get_data (DBusWatch *watch);
void dbus_watch_set_data (DBusWatch *watch,
void *data,
DBusFreeFunction free_data_function);
dbus_bool_t dbus_watch_handle (DBusWatch *watch,
unsigned int flags);
dbus_bool_t dbus_watch_get_enabled (DBusWatch *watch);
/** @} */
/**
* @addtogroup DBusTimeout
* @{
*/
int dbus_timeout_get_interval (DBusTimeout *timeout);
void* dbus_timeout_get_data (DBusTimeout *timeout);
void dbus_timeout_set_data (DBusTimeout *timeout,
void *data,
DBusFreeFunction free_data_function);
dbus_bool_t dbus_timeout_handle (DBusTimeout *timeout);
dbus_bool_t dbus_timeout_get_enabled (DBusTimeout *timeout);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_CONNECTION_H */

View File

@@ -0,0 +1,80 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-errors.h Error reporting
*
* Copyright (C) 2002 Red Hat Inc.
* Copyright (C) 2003 CodeFactory AB
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_ERROR_H
#define DBUS_ERROR_H
#include <dbus/dbus-macros.h>
#include <dbus/dbus-types.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusErrors
* @{
*/
/** Mostly-opaque type representing an error that occurred */
typedef struct DBusError DBusError;
/**
* Object representing an exception.
*/
struct DBusError
{
const char *name; /**< public error name field */
const char *message; /**< public error message field */
unsigned int dummy1 : 1; /**< placeholder */
unsigned int dummy2 : 1; /**< placeholder */
unsigned int dummy3 : 1; /**< placeholder */
unsigned int dummy4 : 1; /**< placeholder */
unsigned int dummy5 : 1; /**< placeholder */
void *padding1; /**< placeholder */
};
void dbus_error_init (DBusError *error);
void dbus_error_free (DBusError *error);
void dbus_set_error (DBusError *error,
const char *name,
const char *message,
...);
void dbus_set_error_const (DBusError *error,
const char *name,
const char *message);
void dbus_move_error (DBusError *src,
DBusError *dest);
dbus_bool_t dbus_error_has_name (const DBusError *error,
const char *name);
dbus_bool_t dbus_error_is_set (const DBusError *error);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_ERROR_H */

View File

@@ -0,0 +1,624 @@
/* Generated by dbus-binding-tool; do not edit! */
#include <glib/gtypes.h>
#include <glib/gerror.h>
#include <dbus/dbus-glib.h>
G_BEGIN_DECLS
#ifndef DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_DBus_Introspectable
#define DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_DBus_Introspectable
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_DBus_Introspectable_introspect (DBusGProxy *proxy, char ** OUT_data, GError **error)
{
return dbus_g_proxy_call (proxy, "Introspect", error, G_TYPE_INVALID, G_TYPE_STRING, OUT_data, G_TYPE_INVALID);
}
typedef void (*org_freedesktop_DBus_Introspectable_introspect_reply) (DBusGProxy *proxy, char * OUT_data, GError *error, gpointer userdata);
static void
org_freedesktop_DBus_Introspectable_introspect_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
char * OUT_data;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_data, G_TYPE_INVALID);
(*(org_freedesktop_DBus_Introspectable_introspect_reply)data->cb) (proxy, OUT_data, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_freedesktop_DBus_Introspectable_introspect_async (DBusGProxy *proxy, org_freedesktop_DBus_Introspectable_introspect_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "Introspect", org_freedesktop_DBus_Introspectable_introspect_async_callback, stuff, g_free, G_TYPE_INVALID);
}
#endif /* defined DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_DBus_Introspectable */
#ifndef DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_DBus
#define DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_DBus
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_DBus_request_name (DBusGProxy *proxy, const char * IN_arg0, const guint IN_arg1, guint* OUT_arg2, GError **error)
{
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);
}
typedef void (*org_freedesktop_DBus_request_name_reply) (DBusGProxy *proxy, guint OUT_arg2, GError *error, gpointer userdata);
static void
org_freedesktop_DBus_request_name_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
guint OUT_arg2;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_UINT, &OUT_arg2, G_TYPE_INVALID);
(*(org_freedesktop_DBus_request_name_reply)data->cb) (proxy, OUT_arg2, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
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)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "RequestName", org_freedesktop_DBus_request_name_async_callback, stuff, g_free, G_TYPE_STRING, IN_arg0, G_TYPE_UINT, IN_arg1, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_DBus_release_name (DBusGProxy *proxy, const char * IN_arg0, guint* OUT_arg1, GError **error)
{
return dbus_g_proxy_call (proxy, "ReleaseName", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, G_TYPE_UINT, OUT_arg1, G_TYPE_INVALID);
}
typedef void (*org_freedesktop_DBus_release_name_reply) (DBusGProxy *proxy, guint OUT_arg1, GError *error, gpointer userdata);
static void
org_freedesktop_DBus_release_name_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
guint OUT_arg1;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_UINT, &OUT_arg1, G_TYPE_INVALID);
(*(org_freedesktop_DBus_release_name_reply)data->cb) (proxy, OUT_arg1, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_freedesktop_DBus_release_name_async (DBusGProxy *proxy, const char * IN_arg0, org_freedesktop_DBus_release_name_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "ReleaseName", org_freedesktop_DBus_release_name_async_callback, stuff, g_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_DBus_start_service_by_name (DBusGProxy *proxy, const char * IN_arg0, const guint IN_arg1, guint* OUT_arg2, GError **error)
{
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);
}
typedef void (*org_freedesktop_DBus_start_service_by_name_reply) (DBusGProxy *proxy, guint OUT_arg2, GError *error, gpointer userdata);
static void
org_freedesktop_DBus_start_service_by_name_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
guint OUT_arg2;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_UINT, &OUT_arg2, G_TYPE_INVALID);
(*(org_freedesktop_DBus_start_service_by_name_reply)data->cb) (proxy, OUT_arg2, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
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)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "StartServiceByName", org_freedesktop_DBus_start_service_by_name_async_callback, stuff, g_free, G_TYPE_STRING, IN_arg0, G_TYPE_UINT, IN_arg1, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_DBus_hello (DBusGProxy *proxy, char ** OUT_arg0, GError **error)
{
return dbus_g_proxy_call (proxy, "Hello", error, G_TYPE_INVALID, G_TYPE_STRING, OUT_arg0, G_TYPE_INVALID);
}
typedef void (*org_freedesktop_DBus_hello_reply) (DBusGProxy *proxy, char * OUT_arg0, GError *error, gpointer userdata);
static void
org_freedesktop_DBus_hello_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
char * OUT_arg0;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_arg0, G_TYPE_INVALID);
(*(org_freedesktop_DBus_hello_reply)data->cb) (proxy, OUT_arg0, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_freedesktop_DBus_hello_async (DBusGProxy *proxy, org_freedesktop_DBus_hello_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "Hello", org_freedesktop_DBus_hello_async_callback, stuff, g_free, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_DBus_name_has_owner (DBusGProxy *proxy, const char * IN_arg0, gboolean* OUT_arg1, GError **error)
{
return dbus_g_proxy_call (proxy, "NameHasOwner", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, G_TYPE_BOOLEAN, OUT_arg1, G_TYPE_INVALID);
}
typedef void (*org_freedesktop_DBus_name_has_owner_reply) (DBusGProxy *proxy, gboolean OUT_arg1, GError *error, gpointer userdata);
static void
org_freedesktop_DBus_name_has_owner_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
gboolean OUT_arg1;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_BOOLEAN, &OUT_arg1, G_TYPE_INVALID);
(*(org_freedesktop_DBus_name_has_owner_reply)data->cb) (proxy, OUT_arg1, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_freedesktop_DBus_name_has_owner_async (DBusGProxy *proxy, const char * IN_arg0, org_freedesktop_DBus_name_has_owner_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "NameHasOwner", org_freedesktop_DBus_name_has_owner_async_callback, stuff, g_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_DBus_list_names (DBusGProxy *proxy, char *** OUT_arg0, GError **error)
{
return dbus_g_proxy_call (proxy, "ListNames", error, G_TYPE_INVALID, G_TYPE_STRV, OUT_arg0, G_TYPE_INVALID);
}
typedef void (*org_freedesktop_DBus_list_names_reply) (DBusGProxy *proxy, char * *OUT_arg0, GError *error, gpointer userdata);
static void
org_freedesktop_DBus_list_names_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
char ** OUT_arg0;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRV, &OUT_arg0, G_TYPE_INVALID);
(*(org_freedesktop_DBus_list_names_reply)data->cb) (proxy, OUT_arg0, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_freedesktop_DBus_list_names_async (DBusGProxy *proxy, org_freedesktop_DBus_list_names_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "ListNames", org_freedesktop_DBus_list_names_async_callback, stuff, g_free, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_DBus_list_activatable_names (DBusGProxy *proxy, char *** OUT_arg0, GError **error)
{
return dbus_g_proxy_call (proxy, "ListActivatableNames", error, G_TYPE_INVALID, G_TYPE_STRV, OUT_arg0, G_TYPE_INVALID);
}
typedef void (*org_freedesktop_DBus_list_activatable_names_reply) (DBusGProxy *proxy, char * *OUT_arg0, GError *error, gpointer userdata);
static void
org_freedesktop_DBus_list_activatable_names_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
char ** OUT_arg0;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRV, &OUT_arg0, G_TYPE_INVALID);
(*(org_freedesktop_DBus_list_activatable_names_reply)data->cb) (proxy, OUT_arg0, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_freedesktop_DBus_list_activatable_names_async (DBusGProxy *proxy, org_freedesktop_DBus_list_activatable_names_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "ListActivatableNames", org_freedesktop_DBus_list_activatable_names_async_callback, stuff, g_free, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_DBus_add_match (DBusGProxy *proxy, const char * IN_arg0, GError **error)
{
return dbus_g_proxy_call (proxy, "AddMatch", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, G_TYPE_INVALID);
}
typedef void (*org_freedesktop_DBus_add_match_reply) (DBusGProxy *proxy, GError *error, gpointer userdata);
static void
org_freedesktop_DBus_add_match_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID);
(*(org_freedesktop_DBus_add_match_reply)data->cb) (proxy, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_freedesktop_DBus_add_match_async (DBusGProxy *proxy, const char * IN_arg0, org_freedesktop_DBus_add_match_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "AddMatch", org_freedesktop_DBus_add_match_async_callback, stuff, g_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_DBus_remove_match (DBusGProxy *proxy, const char * IN_arg0, GError **error)
{
return dbus_g_proxy_call (proxy, "RemoveMatch", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, G_TYPE_INVALID);
}
typedef void (*org_freedesktop_DBus_remove_match_reply) (DBusGProxy *proxy, GError *error, gpointer userdata);
static void
org_freedesktop_DBus_remove_match_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID);
(*(org_freedesktop_DBus_remove_match_reply)data->cb) (proxy, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_freedesktop_DBus_remove_match_async (DBusGProxy *proxy, const char * IN_arg0, org_freedesktop_DBus_remove_match_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "RemoveMatch", org_freedesktop_DBus_remove_match_async_callback, stuff, g_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_DBus_get_name_owner (DBusGProxy *proxy, const char * IN_arg0, char ** OUT_arg1, GError **error)
{
return dbus_g_proxy_call (proxy, "GetNameOwner", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, G_TYPE_STRING, OUT_arg1, G_TYPE_INVALID);
}
typedef void (*org_freedesktop_DBus_get_name_owner_reply) (DBusGProxy *proxy, char * OUT_arg1, GError *error, gpointer userdata);
static void
org_freedesktop_DBus_get_name_owner_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
char * OUT_arg1;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRING, &OUT_arg1, G_TYPE_INVALID);
(*(org_freedesktop_DBus_get_name_owner_reply)data->cb) (proxy, OUT_arg1, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_freedesktop_DBus_get_name_owner_async (DBusGProxy *proxy, const char * IN_arg0, org_freedesktop_DBus_get_name_owner_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "GetNameOwner", org_freedesktop_DBus_get_name_owner_async_callback, stuff, g_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_DBus_list_queued_owners (DBusGProxy *proxy, const char * IN_arg0, char *** OUT_arg1, GError **error)
{
return dbus_g_proxy_call (proxy, "ListQueuedOwners", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, G_TYPE_STRV, OUT_arg1, G_TYPE_INVALID);
}
typedef void (*org_freedesktop_DBus_list_queued_owners_reply) (DBusGProxy *proxy, char * *OUT_arg1, GError *error, gpointer userdata);
static void
org_freedesktop_DBus_list_queued_owners_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
char ** OUT_arg1;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_STRV, &OUT_arg1, G_TYPE_INVALID);
(*(org_freedesktop_DBus_list_queued_owners_reply)data->cb) (proxy, OUT_arg1, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_freedesktop_DBus_list_queued_owners_async (DBusGProxy *proxy, const char * IN_arg0, org_freedesktop_DBus_list_queued_owners_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "ListQueuedOwners", org_freedesktop_DBus_list_queued_owners_async_callback, stuff, g_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_DBus_get_connection_unix_user (DBusGProxy *proxy, const char * IN_arg0, guint* OUT_arg1, GError **error)
{
return dbus_g_proxy_call (proxy, "GetConnectionUnixUser", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, G_TYPE_UINT, OUT_arg1, G_TYPE_INVALID);
}
typedef void (*org_freedesktop_DBus_get_connection_unix_user_reply) (DBusGProxy *proxy, guint OUT_arg1, GError *error, gpointer userdata);
static void
org_freedesktop_DBus_get_connection_unix_user_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
guint OUT_arg1;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_UINT, &OUT_arg1, G_TYPE_INVALID);
(*(org_freedesktop_DBus_get_connection_unix_user_reply)data->cb) (proxy, OUT_arg1, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
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)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "GetConnectionUnixUser", org_freedesktop_DBus_get_connection_unix_user_async_callback, stuff, g_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_DBus_get_connection_unix_process_id (DBusGProxy *proxy, const char * IN_arg0, guint* OUT_arg1, GError **error)
{
return dbus_g_proxy_call (proxy, "GetConnectionUnixProcessID", error, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID, G_TYPE_UINT, OUT_arg1, G_TYPE_INVALID);
}
typedef void (*org_freedesktop_DBus_get_connection_unix_process_id_reply) (DBusGProxy *proxy, guint OUT_arg1, GError *error, gpointer userdata);
static void
org_freedesktop_DBus_get_connection_unix_process_id_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
guint OUT_arg1;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_UINT, &OUT_arg1, G_TYPE_INVALID);
(*(org_freedesktop_DBus_get_connection_unix_process_id_reply)data->cb) (proxy, OUT_arg1, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
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)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "GetConnectionUnixProcessID", org_freedesktop_DBus_get_connection_unix_process_id_async_callback, stuff, g_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_DBus_get_connection_se_linux_security_context (DBusGProxy *proxy, const char * IN_arg0, GArray** OUT_arg1, GError **error)
{
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);
}
typedef void (*org_freedesktop_DBus_get_connection_se_linux_security_context_reply) (DBusGProxy *proxy, GArray *OUT_arg1, GError *error, gpointer userdata);
static void
org_freedesktop_DBus_get_connection_se_linux_security_context_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
GArray* OUT_arg1;
dbus_g_proxy_end_call (proxy, call, &error, dbus_g_type_get_collection ("GArray", G_TYPE_UCHAR), &OUT_arg1, G_TYPE_INVALID);
(*(org_freedesktop_DBus_get_connection_se_linux_security_context_reply)data->cb) (proxy, OUT_arg1, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
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)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "GetConnectionSELinuxSecurityContext", org_freedesktop_DBus_get_connection_se_linux_security_context_async_callback, stuff, g_free, G_TYPE_STRING, IN_arg0, G_TYPE_INVALID);
}
static
#ifdef G_HAVE_INLINE
inline
#endif
gboolean
org_freedesktop_DBus_reload_config (DBusGProxy *proxy, GError **error)
{
return dbus_g_proxy_call (proxy, "ReloadConfig", error, G_TYPE_INVALID, G_TYPE_INVALID);
}
typedef void (*org_freedesktop_DBus_reload_config_reply) (DBusGProxy *proxy, GError *error, gpointer userdata);
static void
org_freedesktop_DBus_reload_config_async_callback (DBusGProxy *proxy, DBusGProxyCall *call, void *user_data)
{
DBusGAsyncData *data = (DBusGAsyncData*) user_data;
GError *error = NULL;
dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID);
(*(org_freedesktop_DBus_reload_config_reply)data->cb) (proxy, error, data->userdata);
return;
}
static
#ifdef G_HAVE_INLINE
inline
#endif
DBusGProxyCall*
org_freedesktop_DBus_reload_config_async (DBusGProxy *proxy, org_freedesktop_DBus_reload_config_reply callback, gpointer userdata)
{
DBusGAsyncData *stuff;
stuff = g_new (DBusGAsyncData, 1);
stuff->cb = G_CALLBACK (callback);
stuff->userdata = userdata;
return dbus_g_proxy_begin_call (proxy, "ReloadConfig", org_freedesktop_DBus_reload_config_async_callback, stuff, g_free, G_TYPE_INVALID);
}
#endif /* defined DBUS_GLIB_CLIENT_WRAPPERS_org_freedesktop_DBus */
G_END_DECLS

View File

@@ -0,0 +1,36 @@
DBUS_GERROR_FAILED,
DBUS_GERROR_NO_MEMORY,
DBUS_GERROR_SERVICE_UNKNOWN,
DBUS_GERROR_NAME_HAS_NO_OWNER,
DBUS_GERROR_NO_REPLY,
DBUS_GERROR_IO_ERROR,
DBUS_GERROR_BAD_ADDRESS,
DBUS_GERROR_NOT_SUPPORTED,
DBUS_GERROR_LIMITS_EXCEEDED,
DBUS_GERROR_ACCESS_DENIED,
DBUS_GERROR_AUTH_FAILED,
DBUS_GERROR_NO_SERVER,
DBUS_GERROR_TIMEOUT,
DBUS_GERROR_NO_NETWORK,
DBUS_GERROR_ADDRESS_IN_USE,
DBUS_GERROR_DISCONNECTED,
DBUS_GERROR_INVALID_ARGS,
DBUS_GERROR_FILE_NOT_FOUND,
DBUS_GERROR_FILE_EXISTS,
DBUS_GERROR_UNKNOWN_METHOD,
DBUS_GERROR_TIMED_OUT,
DBUS_GERROR_MATCH_RULE_NOT_FOUND,
DBUS_GERROR_MATCH_RULE_INVALID,
DBUS_GERROR_SPAWN_EXEC_FAILED,
DBUS_GERROR_SPAWN_FORK_FAILED,
DBUS_GERROR_SPAWN_CHILD_EXITED,
DBUS_GERROR_SPAWN_CHILD_SIGNALED,
DBUS_GERROR_SPAWN_FAILED,
DBUS_GERROR_UNIX_PROCESS_ID_UNKNOWN,
DBUS_GERROR_INVALID_SIGNATURE,
DBUS_GERROR_INVALID_FILE_CONTENT,
DBUS_GERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN,
DBUS_GERROR_REMOTE_EXCEPTION
#ifndef DBUS_INSIDE_DBUS_GLIB_H
#error " dbus-glib-error-enum.h may only be included by dbus-glib.h"
#endif

View File

@@ -0,0 +1,72 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-glib-lowlevel.h GLib integration details that require dbus/dbus.h
*
* Copyright (C) 2002, 2003 CodeFactory AB
* Copyright (C) 2003, 2004 Red Hat, Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef DBUS_GLIB_LOWLEVEL_H
#define DBUS_GLIB_LOWLEVEL_H
#include <dbus/dbus-glib.h>
#include <dbus/dbus.h>
G_BEGIN_DECLS
void dbus_set_g_error (GError **gerror,
DBusError *derror);
#define DBUS_TYPE_CONNECTION (dbus_connection_get_g_type ())
#define DBUS_TYPE_MESSAGE (dbus_message_get_g_type ())
#define DBUS_TYPE_PENDING_CALL (dbus_pending_call_get_g_type ())
GType dbus_connection_get_g_type (void) G_GNUC_CONST;
GType dbus_message_get_g_type (void) G_GNUC_CONST;
GType dbus_pending_call_get_g_type (void) G_GNUC_CONST;
void dbus_connection_setup_with_g_main (DBusConnection *connection,
GMainContext *context);
void dbus_server_setup_with_g_main (DBusServer *server,
GMainContext *context);
void dbus_g_proxy_send (DBusGProxy *proxy,
DBusMessage *message,
dbus_uint32_t *client_serial);
DBusConnection* dbus_g_connection_get_connection (DBusGConnection *gconnection);
DBusMessage* dbus_g_message_get_message (DBusGMessage *gmessage);
/* dbus_g_pending_call_get_pending_call() deliberately skipped for now;
* not sure it makes sense to use any of the DBusPendingCall functions
* on the wrapped pending call (once we have the right exported
* g-functions anyhow)
*/
gchar* dbus_g_method_get_sender (DBusGMethodInvocation *context);
DBusMessage* dbus_g_method_get_reply (DBusGMethodInvocation *context);
void dbus_g_method_send_reply (DBusGMethodInvocation *context,
DBusMessage *reply);
G_END_DECLS
#endif /* DBUS_GLIB_LOWLEVEL_H */

View File

@@ -0,0 +1,285 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-glib.h GLib integration
*
* Copyright (C) 2002, 2003 CodeFactory AB
* Copyright (C) 2003, 2004 Red Hat, Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef DBUS_GLIB_H
#define DBUS_GLIB_H
#include <glib-object.h>
#include <dbus/dbus-shared.h>
G_BEGIN_DECLS
#define DBUS_INSIDE_DBUS_GLIB_H 1
/**
* Convert to DBusConnection with dbus_g_connection_get_connection() in dbus-glib-lowlevel.h
*/
typedef struct _DBusGConnection DBusGConnection;
/**
* Convert to DBusMessage with dbus_g_message_get_message() in dbus-glib-lowlevel.h
*/
typedef struct _DBusGMessage DBusGMessage;
#define DBUS_TYPE_G_CONNECTION (dbus_g_connection_get_g_type ())
#define DBUS_TYPE_G_MESSAGE (dbus_g_message_get_g_type ())
GType dbus_g_connection_get_g_type (void) G_GNUC_CONST;
GType dbus_g_message_get_g_type (void) G_GNUC_CONST;
DBusGConnection* dbus_g_connection_ref (DBusGConnection *connection);
void dbus_g_connection_unref (DBusGConnection *connection);
DBusGMessage* dbus_g_message_ref (DBusGMessage *message);
void dbus_g_message_unref (DBusGMessage *message);
void dbus_g_connection_flush (DBusGConnection *connection);
GQuark dbus_g_error_quark (void);
#define DBUS_GERROR dbus_g_error_quark ()
typedef enum
{
#include "dbus-glib-error-enum.h"
} DBusGError;
gboolean dbus_g_error_has_name (GError *error,
const char *name);
const char * dbus_g_error_get_name (GError *error);
void dbus_g_thread_init (void);
DBusGConnection* dbus_g_connection_open (const gchar *address,
GError **error);
DBusGConnection* dbus_g_bus_get (DBusBusType type,
GError **error);
typedef struct _DBusGObjectInfo DBusGObjectInfo;
typedef struct _DBusGMethodInfo DBusGMethodInfo;
/**
* DBusGMethodInfo:
* @function: C method to invoke
* @marshaller: Marshaller to invoke method
* @data_offset: Offset into the introspection data
*
* Object typically generated by #dbus-binding-tool that
* stores a mapping from introspection data to a
* function pointer for a C method to be invoked.
*/
struct _DBusGMethodInfo
{
GCallback function;
GClosureMarshal marshaller;
int data_offset;
};
/**
* DBusGObjectInfo:
* @format_version: Allows us to change the rest of this struct
* by adding DBusGObjectInfo2, DBusGObjectInfo3, etc.
* @method_infos: Array of method pointers
* @n_method_infos: Length of the infos array
* @data: Introspection data
* @exported_signals: Exported signals
* @exported_properties: Exported properties
*
* Introspection data for a #GObject, normally autogenerated by
* a tool such as #dbus-binding-tool.
*/
struct _DBusGObjectInfo
{
int format_version;
const DBusGMethodInfo *method_infos;
int n_method_infos;
const char *data;
const char *exported_signals;
const char *exported_properties;
};
void dbus_g_object_type_install_info (GType object_type,
const DBusGObjectInfo *info);
void dbus_g_error_domain_register (GQuark domain,
const char * default_iface,
GType code_enum);
void dbus_g_connection_register_g_object (DBusGConnection *connection,
const char *at_path,
GObject *object);
GObject * dbus_g_connection_lookup_g_object (DBusGConnection *connection,
const char *at_path);
#ifdef DBUS_COMPILATION
#include "dbus/dbus-gtype-specialized.h"
#else
#include <dbus/dbus-gtype-specialized.h>
#endif
/* definitions for some basic array types */
#define DBUS_TYPE_G_BOOLEAN_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_BOOLEAN))
#define DBUS_TYPE_G_UCHAR_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_UCHAR))
#define DBUS_TYPE_G_UINT_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_UINT))
#define DBUS_TYPE_G_INT_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_INT))
#define DBUS_TYPE_G_UINT64_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_UINT64))
#define DBUS_TYPE_G_INT64_ARRAY (dbus_g_type_get_collection ("GArray", G_TYPE_INT64))
#define DBUS_TYPE_G_OBJECT_ARRAY (dbus_g_type_get_collection ("GPtrArray", G_TYPE_OBJECT))
#define DBUS_TYPE_G_STRING_STRING_HASHTABLE (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_STRING))
GType dbus_g_object_path_get_g_type (void) G_GNUC_CONST;
#define DBUS_TYPE_G_OBJECT_PATH (dbus_g_object_path_get_g_type ())
void dbus_g_object_register_marshaller (GClosureMarshal marshaller,
GType rettype,
...);
void dbus_g_object_register_marshaller_array(GClosureMarshal marshaller,
GType rettype,
guint n_types,
const GType* types);
typedef struct _DBusGProxy DBusGProxy;
typedef struct _DBusGProxyClass DBusGProxyClass;
#define DBUS_TYPE_G_PROXY (dbus_g_proxy_get_type ())
#define DBUS_G_PROXY(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), DBUS_TYPE_G_PROXY, DBusGProxy))
#define DBUS_G_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DBUS_TYPE_G_PROXY, DBusGProxyClass))
#define DBUS_IS_G_PROXY(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), DBUS_TYPE_G_PROXY))
#define DBUS_IS_G_PROXY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DBUS_TYPE_G_PROXY))
#define DBUS_G_PROXY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DBUS_TYPE_G_PROXY, DBusGProxyClass))
struct _DBusGProxy
{
GObject parent;
};
struct _DBusGProxyClass
{
GObjectClass parent_class; /**< Parent class */
};
typedef struct _DBusGProxyCall DBusGProxyCall;
typedef void (* DBusGProxyCallNotify) (DBusGProxy *proxy,
DBusGProxyCall *call_id,
void *user_data);
GType dbus_g_proxy_get_type (void) G_GNUC_CONST;
DBusGProxy* dbus_g_proxy_new_for_name (DBusGConnection *connection,
const char *name,
const char *path,
const char *interface);
DBusGProxy* dbus_g_proxy_new_for_name_owner (DBusGConnection *connection,
const char *name,
const char *path,
const char *interface,
GError **error);
DBusGProxy* dbus_g_proxy_new_from_proxy (DBusGProxy *proxy,
const char *interface,
const char *path_name);
DBusGProxy* dbus_g_proxy_new_for_peer (DBusGConnection *connection,
const char *path_name,
const char *interface_name);
void dbus_g_proxy_set_interface (DBusGProxy *proxy,
const char *interface_name);
void dbus_g_proxy_add_signal (DBusGProxy *proxy,
const char *signal_name,
GType first_type,
...);
void dbus_g_proxy_connect_signal (DBusGProxy *proxy,
const char *signal_name,
GCallback handler,
void *data,
GClosureNotify free_data_func);
void dbus_g_proxy_disconnect_signal (DBusGProxy *proxy,
const char *signal_name,
GCallback handler,
void *data);
gboolean dbus_g_proxy_call (DBusGProxy *proxy,
const char *method,
GError **error,
GType first_arg_type,
...);
gboolean dbus_g_proxy_call_with_timeout (DBusGProxy *proxy,
const char *method,
int timeout,
GError **error,
GType first_arg_type,
...);
void dbus_g_proxy_call_no_reply (DBusGProxy *proxy,
const char *method,
GType first_arg_type,
...);
DBusGProxyCall * dbus_g_proxy_begin_call (DBusGProxy *proxy,
const char *method,
DBusGProxyCallNotify notify,
gpointer data,
GDestroyNotify destroy,
GType first_arg_type,
...);
DBusGProxyCall * dbus_g_proxy_begin_call_with_timeout (DBusGProxy *proxy,
const char *method,
DBusGProxyCallNotify notify,
gpointer user_data,
GDestroyNotify destroy,
int timeout,
GType first_arg_type,
...);
gboolean dbus_g_proxy_end_call (DBusGProxy *proxy,
DBusGProxyCall *call,
GError **error,
GType first_arg_type,
...);
void dbus_g_proxy_cancel_call (DBusGProxy *proxy,
DBusGProxyCall *call);
const char* dbus_g_proxy_get_path (DBusGProxy *proxy);
const char* dbus_g_proxy_get_bus_name (DBusGProxy *proxy);
const char* dbus_g_proxy_get_interface (DBusGProxy *proxy);
typedef struct _DBusGMethodInvocation DBusGMethodInvocation;
void dbus_g_method_return (DBusGMethodInvocation *context, ...);
void dbus_g_method_return_error (DBusGMethodInvocation *context, GError *error);
/* Probably possible to replace this with a closure */
typedef struct {
GCallback cb;
gpointer userdata;
} DBusGAsyncData;
#undef DBUS_INSIDE_DBUS_GLIB_H
G_END_DECLS
#endif /* DBUS_GLIB_H */

View File

@@ -0,0 +1,176 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-gtype-specialized.h: Non-DBus-specific functions for specialized GTypes
*
* Copyright (C) 2005 Red Hat, Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef DBUS_GOBJECT_TYPE_SPECIALIZED_H
#define DBUS_GOBJECT_TYPE_SPECIALIZED_H
#include <glib.h>
#include <glib-object.h>
G_BEGIN_DECLS
GType dbus_g_type_get_collection (const char *container,
GType specialization);
GType dbus_g_type_get_map (const char *container,
GType key_specialization,
GType value_specialization);
GType dbus_g_type_get_structv (const char *container,
guint num_items,
GType *types);
GType dbus_g_type_get_struct (const char *container,
GType first_type,
...);
gboolean dbus_g_type_is_collection (GType gtype);
gboolean dbus_g_type_is_map (GType gtype);
gboolean dbus_g_type_is_struct (GType gtype);
GType dbus_g_type_get_collection_specialization (GType gtype);
GType dbus_g_type_get_map_key_specialization (GType gtype);
GType dbus_g_type_get_map_value_specialization (GType gtype);
GType dbus_g_type_get_struct_member_type (GType gtype,
guint index);
guint dbus_g_type_get_struct_size (GType gtype);
typedef void (*DBusGTypeSpecializedCollectionIterator) (const GValue *val,
gpointer user_data);
typedef void (*DBusGTypeSpecializedMapIterator) (const GValue *key_val,
const GValue *value_val,
gpointer user_data);
gpointer dbus_g_type_specialized_construct (GType type);
typedef struct {
/* public */
GValue *val;
GType specialization_type;
/* padding */
gpointer b;
guint c;
gpointer d;
} DBusGTypeSpecializedAppendContext;
void dbus_g_type_specialized_init_append (GValue *val, DBusGTypeSpecializedAppendContext *ctx);
void dbus_g_type_specialized_collection_append (DBusGTypeSpecializedAppendContext *ctx, GValue *elt);
void dbus_g_type_specialized_collection_end_append (DBusGTypeSpecializedAppendContext *ctx);
void dbus_g_type_specialized_map_append (DBusGTypeSpecializedAppendContext *ctx,
GValue *key,
GValue *val);
gboolean dbus_g_type_collection_get_fixed (GValue *value,
gpointer *data,
guint *len);
void dbus_g_type_collection_value_iterate (const GValue *value,
DBusGTypeSpecializedCollectionIterator iterator,
gpointer user_data);
void dbus_g_type_map_value_iterate (const GValue *value,
DBusGTypeSpecializedMapIterator iterator,
gpointer user_data);
gboolean dbus_g_type_struct_get_member (const GValue *value,
guint index,
GValue *dest);
gboolean dbus_g_type_struct_set_member (GValue *value,
guint index,
const GValue *src);
gboolean dbus_g_type_struct_get (const GValue *value,
guint member,
...);
gboolean dbus_g_type_struct_set (GValue *value,
guint member,
...);
typedef gpointer (*DBusGTypeSpecializedConstructor) (GType type);
typedef void (*DBusGTypeSpecializedFreeFunc) (GType type, gpointer val);
typedef gpointer (*DBusGTypeSpecializedCopyFunc) (GType type, gpointer src);
typedef struct {
DBusGTypeSpecializedConstructor constructor;
DBusGTypeSpecializedFreeFunc free_func;
DBusGTypeSpecializedCopyFunc copy_func;
GDestroyNotify simple_free_func; /* for type-independent freeing if possible */
gpointer padding2;
gpointer padding3;
} DBusGTypeSpecializedVtable;
typedef gboolean (*DBusGTypeSpecializedCollectionFixedAccessorFunc) (GType type, gpointer instance, gpointer *values, guint *len);
typedef void (*DBusGTypeSpecializedCollectionIteratorFunc) (GType type, gpointer instance, DBusGTypeSpecializedCollectionIterator iterator, gpointer user_data);
typedef void (*DBusGTypeSpecializedCollectionAppendFunc) (DBusGTypeSpecializedAppendContext *ctx, GValue *val);
typedef void (*DBusGTypeSpecializedCollectionEndAppendFunc) (DBusGTypeSpecializedAppendContext *ctx);
typedef struct {
DBusGTypeSpecializedVtable base_vtable;
DBusGTypeSpecializedCollectionFixedAccessorFunc fixed_accessor;
DBusGTypeSpecializedCollectionIteratorFunc iterator;
DBusGTypeSpecializedCollectionAppendFunc append_func;
DBusGTypeSpecializedCollectionEndAppendFunc end_append_func;
} DBusGTypeSpecializedCollectionVtable;
typedef void (*DBusGTypeSpecializedMapIteratorFunc) (GType type, gpointer instance, DBusGTypeSpecializedMapIterator iterator, gpointer user_data);
typedef void (*DBusGTypeSpecializedMapAppendFunc) (DBusGTypeSpecializedAppendContext *ctx, GValue *key, GValue *val);
typedef struct {
DBusGTypeSpecializedVtable base_vtable;
DBusGTypeSpecializedMapIteratorFunc iterator;
DBusGTypeSpecializedMapAppendFunc append_func;
} DBusGTypeSpecializedMapVtable;
typedef gboolean (*DBusGTypeSpecializedStructGetMember) (GType type, gpointer instance, guint member, GValue *ret_value);
typedef gboolean (*DBusGTypeSpecializedStructSetMember) (GType type, gpointer instance, guint member, const GValue *new_value);
typedef struct {
DBusGTypeSpecializedVtable base_vtable;
DBusGTypeSpecializedStructGetMember get_member;
DBusGTypeSpecializedStructSetMember set_member;
} DBusGTypeSpecializedStructVtable;
void dbus_g_type_specialized_init (void);
void dbus_g_type_register_collection (const char *name,
const DBusGTypeSpecializedCollectionVtable *vtable,
guint flags);
void dbus_g_type_register_map (const char *name,
const DBusGTypeSpecializedMapVtable *vtable,
guint flags);
const DBusGTypeSpecializedMapVtable* dbus_g_type_map_peek_vtable (GType map_type);
const DBusGTypeSpecializedCollectionVtable* dbus_g_type_collection_peek_vtable (GType collection_type);
void dbus_g_type_register_struct (const char *name,
const DBusGTypeSpecializedStructVtable *vtable,
guint flags);
const DBusGTypeSpecializedMapVtable* dbus_g_type_map_peek_vtable (GType map_type);
const DBusGTypeSpecializedCollectionVtable* dbus_g_type_collection_peek_vtable (GType collection_type);
const DBusGTypeSpecializedStructVtable* dbus_g_type_struct_peek_vtable (GType struct_type);
G_END_DECLS
#endif

View File

@@ -0,0 +1,122 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-macros.h generic macros
*
* Copyright (C) 2002 Red Hat Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_MACROS_H
#define DBUS_MACROS_H
#ifdef __cplusplus
# define DBUS_BEGIN_DECLS extern "C" {
# define DBUS_END_DECLS }
#else
# define DBUS_BEGIN_DECLS
# define DBUS_END_DECLS
#endif
#ifndef TRUE
# define TRUE 1
#endif
#ifndef FALSE
# define FALSE 0
#endif
#ifndef NULL
# ifdef __cplusplus
# define NULL (0L)
# else /* !__cplusplus */
# define NULL ((void*) 0)
# endif /* !__cplusplus */
#endif
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
#define DBUS_GNUC_DEPRECATED __attribute__((__deprecated__))
#else
#define DBUS_GNUC_DEPRECATED
#endif
/* Normally docs are in .c files, but there isn't a .c file for this. */
/**
* @defgroup DBusMacros Utility macros
* @ingroup DBus
* @brief #TRUE, #FALSE, #NULL, and so on
*
* Utility macros.
*
* @{
*/
/**
* @def DBUS_BEGIN_DECLS
*
* Macro used prior to declaring functions in the D-Bus header
* files. Expands to "extern "C"" when using a C++ compiler,
* and expands to nothing when using a C compiler.
*
* Please don't use this in your own code, consider it
* D-Bus internal.
*/
/**
* @def DBUS_END_DECLS
*
* Macro used after declaring functions in the D-Bus header
* files. Expands to "}" when using a C++ compiler,
* and expands to nothing when using a C compiler.
*
* Please don't use this in your own code, consider it
* D-Bus internal.
*/
/**
* @def TRUE
*
* Expands to "1"
*/
/**
* @def FALSE
*
* Expands to "0"
*/
/**
* @def NULL
*
* A null pointer, defined appropriately for C or C++.
*/
/**
* @def DBUS_GNUC_DEPRECATED
*
* Tells gcc to warn about a function or type if it's used.
* Code marked in this way should also be enclosed in
* @code
* #ifndef DBUS_DISABLE_DEPRECATED
* deprecated stuff here
* #endif
* @endcode
*
* Please don't use this in your own code, consider it
* D-Bus internal.
*/
/** @} */
#endif /* DBUS_MACROS_H */

View File

@@ -0,0 +1,59 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-memory.h D-Bus memory handling
*
* Copyright (C) 2002 Red Hat Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_MEMORY_H
#define DBUS_MEMORY_H
#include <dbus/dbus-macros.h>
#include <stddef.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusMemory
* @{
*/
void* dbus_malloc (size_t bytes);
void* dbus_malloc0 (size_t bytes);
void* dbus_realloc (void *memory,
size_t bytes);
void dbus_free (void *memory);
#define dbus_new(type, count) ((type*)dbus_malloc (sizeof (type) * (count)));
#define dbus_new0(type, count) ((type*)dbus_malloc0 (sizeof (type) * (count)));
void dbus_free_string_array (char **str_array);
typedef void (* DBusFreeFunction) (void *memory);
void dbus_shutdown (void);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_MEMORY_H */

View File

@@ -0,0 +1,220 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-message.h DBusMessage object
*
* Copyright (C) 2002, 2003, 2005 Red Hat Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_MESSAGE_H
#define DBUS_MESSAGE_H
#include <dbus/dbus-macros.h>
#include <dbus/dbus-types.h>
#include <dbus/dbus-arch-deps.h>
#include <dbus/dbus-memory.h>
#include <dbus/dbus-errors.h>
#include <stdarg.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusMessage
* @{
*/
typedef struct DBusMessage DBusMessage;
/** Opaque type representing a message iterator. Can be copied by value, and contains no allocated memory so never needs to be freed and can be allocated on the stack. */
typedef struct DBusMessageIter DBusMessageIter;
/**
* DBusMessageIter struct; contains no public fields.
*/
struct DBusMessageIter
{
void *dummy1; /**< Don't use this */
void *dummy2; /**< Don't use this */
dbus_uint32_t dummy3; /**< Don't use this */
int dummy4; /**< Don't use this */
int dummy5; /**< Don't use this */
int dummy6; /**< Don't use this */
int dummy7; /**< Don't use this */
int dummy8; /**< Don't use this */
int dummy9; /**< Don't use this */
int dummy10; /**< Don't use this */
int dummy11; /**< Don't use this */
int pad1; /**< Don't use this */
int pad2; /**< Don't use this */
void *pad3; /**< Don't use this */
};
DBusMessage* dbus_message_new (int message_type);
DBusMessage* dbus_message_new_method_call (const char *bus_name,
const char *path,
const char *interface,
const char *method);
DBusMessage* dbus_message_new_method_return (DBusMessage *method_call);
DBusMessage* dbus_message_new_signal (const char *path,
const char *interface,
const char *name);
DBusMessage* dbus_message_new_error (DBusMessage *reply_to,
const char *error_name,
const char *error_message);
DBusMessage* dbus_message_new_error_printf (DBusMessage *reply_to,
const char *error_name,
const char *error_format,
...);
DBusMessage* dbus_message_copy (const DBusMessage *message);
DBusMessage* dbus_message_ref (DBusMessage *message);
void dbus_message_unref (DBusMessage *message);
int dbus_message_get_type (DBusMessage *message);
dbus_bool_t dbus_message_set_path (DBusMessage *message,
const char *object_path);
const char* dbus_message_get_path (DBusMessage *message);
dbus_bool_t dbus_message_has_path (DBusMessage *message,
const char *object_path);
dbus_bool_t dbus_message_set_interface (DBusMessage *message,
const char *interface);
const char* dbus_message_get_interface (DBusMessage *message);
dbus_bool_t dbus_message_has_interface (DBusMessage *message,
const char *interface);
dbus_bool_t dbus_message_set_member (DBusMessage *message,
const char *member);
const char* dbus_message_get_member (DBusMessage *message);
dbus_bool_t dbus_message_has_member (DBusMessage *message,
const char *member);
dbus_bool_t dbus_message_set_error_name (DBusMessage *message,
const char *name);
const char* dbus_message_get_error_name (DBusMessage *message);
dbus_bool_t dbus_message_set_destination (DBusMessage *message,
const char *destination);
const char* dbus_message_get_destination (DBusMessage *message);
dbus_bool_t dbus_message_set_sender (DBusMessage *message,
const char *sender);
const char* dbus_message_get_sender (DBusMessage *message);
const char* dbus_message_get_signature (DBusMessage *message);
void dbus_message_set_no_reply (DBusMessage *message,
dbus_bool_t no_reply);
dbus_bool_t dbus_message_get_no_reply (DBusMessage *message);
dbus_bool_t dbus_message_is_method_call (DBusMessage *message,
const char *interface,
const char *method);
dbus_bool_t dbus_message_is_signal (DBusMessage *message,
const char *interface,
const char *signal_name);
dbus_bool_t dbus_message_is_error (DBusMessage *message,
const char *error_name);
dbus_bool_t dbus_message_has_destination (DBusMessage *message,
const char *bus_name);
dbus_bool_t dbus_message_has_sender (DBusMessage *message,
const char *unique_bus_name);
dbus_bool_t dbus_message_has_signature (DBusMessage *message,
const char *signature);
dbus_uint32_t dbus_message_get_serial (DBusMessage *message);
dbus_bool_t dbus_message_set_reply_serial (DBusMessage *message,
dbus_uint32_t reply_serial);
dbus_uint32_t dbus_message_get_reply_serial (DBusMessage *message);
void dbus_message_set_auto_start (DBusMessage *message,
dbus_bool_t auto_start);
dbus_bool_t dbus_message_get_auto_start (DBusMessage *message);
dbus_bool_t dbus_message_get_path_decomposed (DBusMessage *message,
char ***path);
dbus_bool_t dbus_message_append_args (DBusMessage *message,
int first_arg_type,
...);
dbus_bool_t dbus_message_append_args_valist (DBusMessage *message,
int first_arg_type,
va_list var_args);
dbus_bool_t dbus_message_get_args (DBusMessage *message,
DBusError *error,
int first_arg_type,
...);
dbus_bool_t dbus_message_get_args_valist (DBusMessage *message,
DBusError *error,
int first_arg_type,
va_list var_args);
dbus_bool_t dbus_message_iter_init (DBusMessage *message,
DBusMessageIter *iter);
dbus_bool_t dbus_message_iter_has_next (DBusMessageIter *iter);
dbus_bool_t dbus_message_iter_next (DBusMessageIter *iter);
char* dbus_message_iter_get_signature (DBusMessageIter *iter);
int dbus_message_iter_get_arg_type (DBusMessageIter *iter);
int dbus_message_iter_get_element_type (DBusMessageIter *iter);
void dbus_message_iter_recurse (DBusMessageIter *iter,
DBusMessageIter *sub);
void dbus_message_iter_get_basic (DBusMessageIter *iter,
void *value);
#ifndef DBUS_DISABLE_DEPRECATED
/* This function returns the wire protocol size of the array in bytes,
* you do not want to know that probably
*/
int dbus_message_iter_get_array_len (DBusMessageIter *iter) DBUS_GNUC_DEPRECATED;
#endif
void dbus_message_iter_get_fixed_array (DBusMessageIter *iter,
void *value,
int *n_elements);
void dbus_message_iter_init_append (DBusMessage *message,
DBusMessageIter *iter);
dbus_bool_t dbus_message_iter_append_basic (DBusMessageIter *iter,
int type,
const void *value);
dbus_bool_t dbus_message_iter_append_fixed_array (DBusMessageIter *iter,
int element_type,
const void *value,
int n_elements);
dbus_bool_t dbus_message_iter_open_container (DBusMessageIter *iter,
int type,
const char *contained_signature,
DBusMessageIter *sub);
dbus_bool_t dbus_message_iter_close_container (DBusMessageIter *iter,
DBusMessageIter *sub);
dbus_bool_t dbus_set_error_from_message (DBusError *error,
DBusMessage *message);
dbus_bool_t dbus_message_allocate_data_slot (dbus_int32_t *slot_p);
void dbus_message_free_data_slot (dbus_int32_t *slot_p);
dbus_bool_t dbus_message_set_data (DBusMessage *message,
dbus_int32_t slot,
void *data,
DBusFreeFunction free_data_func);
void* dbus_message_get_data (DBusMessage *message,
dbus_int32_t slot);
int dbus_message_type_from_string (const char *type_str);
const char * dbus_message_type_to_string (int type);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_MESSAGE_H */

View File

@@ -0,0 +1,47 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-misc.h A few assorted public functions that don't fit elsewhere
*
* Copyright (C) 2006 Red Hat, Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_MISC_H
#define DBUS_MISC_H
#include <dbus/dbus-types.h>
#include <dbus/dbus-errors.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusMisc
* @{
*/
char* dbus_get_local_machine_id (void);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_MISC_H */

View File

@@ -0,0 +1,65 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-pending-call.h Object representing a call in progress.
*
* Copyright (C) 2002, 2003 Red Hat Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_PENDING_CALL_H
#define DBUS_PENDING_CALL_H
#include <dbus/dbus-macros.h>
#include <dbus/dbus-types.h>
#include <dbus/dbus-connection.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusPendingCall
* @{
*/
DBusPendingCall* dbus_pending_call_ref (DBusPendingCall *pending);
void dbus_pending_call_unref (DBusPendingCall *pending);
dbus_bool_t dbus_pending_call_set_notify (DBusPendingCall *pending,
DBusPendingCallNotifyFunction function,
void *user_data,
DBusFreeFunction free_user_data);
void dbus_pending_call_cancel (DBusPendingCall *pending);
dbus_bool_t dbus_pending_call_get_completed (DBusPendingCall *pending);
DBusMessage* dbus_pending_call_steal_reply (DBusPendingCall *pending);
void dbus_pending_call_block (DBusPendingCall *pending);
dbus_bool_t dbus_pending_call_allocate_data_slot (dbus_int32_t *slot_p);
void dbus_pending_call_free_data_slot (dbus_int32_t *slot_p);
dbus_bool_t dbus_pending_call_set_data (DBusPendingCall *pending,
dbus_int32_t slot,
void *data,
DBusFreeFunction free_data_func);
void* dbus_pending_call_get_data (DBusPendingCall *pending,
dbus_int32_t slot);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_PENDING_CALL_H */

View File

@@ -0,0 +1,421 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-protocol.h D-Bus protocol constants
*
* Copyright (C) 2002, 2003 CodeFactory AB
* Copyright (C) 2004, 2005 Red Hat, Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef DBUS_PROTOCOL_H
#define DBUS_PROTOCOL_H
/* Don't include anything in here from anywhere else. It's
* intended for use by any random library.
*/
#ifdef __cplusplus
extern "C" {
#if 0
} /* avoids confusing emacs indentation */
#endif
#endif
/* Normally docs are in .c files, but there isn't a .c file for this. */
/**
* @defgroup DBusProtocol Protocol constants
* @ingroup DBus
*
* @brief Defines constants which are part of the D-Bus protocol
*
* This header is intended for use by any library, not only libdbus.
*
* @{
*/
/* Message byte order */
#define DBUS_LITTLE_ENDIAN ('l') /**< Code marking LSB-first byte order in the wire protocol. */
#define DBUS_BIG_ENDIAN ('B') /**< Code marking MSB-first byte order in the wire protocol. */
/** Protocol version. */
#define DBUS_MAJOR_PROTOCOL_VERSION 1
/** Type code that is never equal to a legitimate type code */
#define DBUS_TYPE_INVALID ((int) '\0')
/** #DBUS_TYPE_INVALID as a string literal instead of a int literal */
#define DBUS_TYPE_INVALID_AS_STRING "\0"
/* Primitive types */
/** Type code marking an 8-bit unsigned integer */
#define DBUS_TYPE_BYTE ((int) 'y')
/** #DBUS_TYPE_BYTE as a string literal instead of a int literal */
#define DBUS_TYPE_BYTE_AS_STRING "y"
/** Type code marking a boolean */
#define DBUS_TYPE_BOOLEAN ((int) 'b')
/** #DBUS_TYPE_BOOLEAN as a string literal instead of a int literal */
#define DBUS_TYPE_BOOLEAN_AS_STRING "b"
/** Type code marking a 16-bit signed integer */
#define DBUS_TYPE_INT16 ((int) 'n')
/** #DBUS_TYPE_INT16 as a string literal instead of a int literal */
#define DBUS_TYPE_INT16_AS_STRING "n"
/** Type code marking a 16-bit unsigned integer */
#define DBUS_TYPE_UINT16 ((int) 'q')
/** #DBUS_TYPE_UINT16 as a string literal instead of a int literal */
#define DBUS_TYPE_UINT16_AS_STRING "q"
/** Type code marking a 32-bit signed integer */
#define DBUS_TYPE_INT32 ((int) 'i')
/** #DBUS_TYPE_INT32 as a string literal instead of a int literal */
#define DBUS_TYPE_INT32_AS_STRING "i"
/** Type code marking a 32-bit unsigned integer */
#define DBUS_TYPE_UINT32 ((int) 'u')
/** #DBUS_TYPE_UINT32 as a string literal instead of a int literal */
#define DBUS_TYPE_UINT32_AS_STRING "u"
/** Type code marking a 64-bit signed integer */
#define DBUS_TYPE_INT64 ((int) 'x')
/** #DBUS_TYPE_INT64 as a string literal instead of a int literal */
#define DBUS_TYPE_INT64_AS_STRING "x"
/** Type code marking a 64-bit unsigned integer */
#define DBUS_TYPE_UINT64 ((int) 't')
/** #DBUS_TYPE_UINT64 as a string literal instead of a int literal */
#define DBUS_TYPE_UINT64_AS_STRING "t"
/** Type code marking an 8-byte double in IEEE 754 format */
#define DBUS_TYPE_DOUBLE ((int) 'd')
/** #DBUS_TYPE_DOUBLE as a string literal instead of a int literal */
#define DBUS_TYPE_DOUBLE_AS_STRING "d"
/** Type code marking a UTF-8 encoded, nul-terminated Unicode string */
#define DBUS_TYPE_STRING ((int) 's')
/** #DBUS_TYPE_STRING as a string literal instead of a int literal */
#define DBUS_TYPE_STRING_AS_STRING "s"
/** Type code marking a D-Bus object path */
#define DBUS_TYPE_OBJECT_PATH ((int) 'o')
/** #DBUS_TYPE_OBJECT_PATH as a string literal instead of a int literal */
#define DBUS_TYPE_OBJECT_PATH_AS_STRING "o"
/** Type code marking a D-Bus type signature */
#define DBUS_TYPE_SIGNATURE ((int) 'g')
/** #DBUS_TYPE_SIGNATURE as a string literal instead of a int literal */
#define DBUS_TYPE_SIGNATURE_AS_STRING "g"
/* Compound types */
/** Type code marking a D-Bus array type */
#define DBUS_TYPE_ARRAY ((int) 'a')
/** #DBUS_TYPE_ARRAY as a string literal instead of a int literal */
#define DBUS_TYPE_ARRAY_AS_STRING "a"
/** Type code marking a D-Bus variant type */
#define DBUS_TYPE_VARIANT ((int) 'v')
/** #DBUS_TYPE_VARIANT as a string literal instead of a int literal */
#define DBUS_TYPE_VARIANT_AS_STRING "v"
/** STRUCT and DICT_ENTRY are sort of special since their codes can't
* appear in a type string, instead
* DBUS_STRUCT_BEGIN_CHAR/DBUS_DICT_ENTRY_BEGIN_CHAR have to appear
*/
/** Type code used to represent a struct; however, this type code does not appear
* in type signatures, instead #DBUS_STRUCT_BEGIN_CHAR and #DBUS_STRUCT_END_CHAR will
* appear in a signature.
*/
#define DBUS_TYPE_STRUCT ((int) 'r')
/** #DBUS_TYPE_STRUCT as a string literal instead of a int literal */
#define DBUS_TYPE_STRUCT_AS_STRING "r"
/** Type code used to represent a dict entry; however, this type code does not appear
* in type signatures, instead #DBUS_DICT_ENTRY_BEGIN_CHAR and #DBUS_DICT_ENTRY_END_CHAR will
* appear in a signature.
*/
#define DBUS_TYPE_DICT_ENTRY ((int) 'e')
/** #DBUS_TYPE_DICT_ENTRY as a string literal instead of a int literal */
#define DBUS_TYPE_DICT_ENTRY_AS_STRING "e"
/** Does not include #DBUS_TYPE_INVALID, #DBUS_STRUCT_BEGIN_CHAR, #DBUS_STRUCT_END_CHAR,
* #DBUS_DICT_ENTRY_BEGIN_CHAR, or #DBUS_DICT_ENTRY_END_CHAR - i.e. it is the number of
* valid types, not the number of distinct characters that may appear in a type signature.
*/
#define DBUS_NUMBER_OF_TYPES (16)
/* characters other than typecodes that appear in type signatures */
/** Code marking the start of a struct type in a type signature */
#define DBUS_STRUCT_BEGIN_CHAR ((int) '(')
/** #DBUS_STRUCT_BEGIN_CHAR as a string literal instead of a int literal */
#define DBUS_STRUCT_BEGIN_CHAR_AS_STRING "("
/** Code marking the end of a struct type in a type signature */
#define DBUS_STRUCT_END_CHAR ((int) ')')
/** #DBUS_STRUCT_END_CHAR a string literal instead of a int literal */
#define DBUS_STRUCT_END_CHAR_AS_STRING ")"
/** Code marking the start of a dict entry type in a type signature */
#define DBUS_DICT_ENTRY_BEGIN_CHAR ((int) '{')
/** #DBUS_DICT_ENTRY_BEGIN_CHAR as a string literal instead of a int literal */
#define DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING "{"
/** Code marking the end of a dict entry type in a type signature */
#define DBUS_DICT_ENTRY_END_CHAR ((int) '}')
/** #DBUS_DICT_ENTRY_END_CHAR as a string literal instead of a int literal */
#define DBUS_DICT_ENTRY_END_CHAR_AS_STRING "}"
/** Max length in bytes of a bus name, interface, or member (not object
* path, paths are unlimited). This is limited because lots of stuff
* is O(n) in this number, plus it would be obnoxious to type in a
* paragraph-long method name so most likely something like that would
* be an exploit.
*/
#define DBUS_MAXIMUM_NAME_LENGTH 255
/** This one is 255 so it fits in a byte */
#define DBUS_MAXIMUM_SIGNATURE_LENGTH 255
/** Max length of a match rule string; to keep people from hosing the
* daemon with some huge rule
*/
#define DBUS_MAXIMUM_MATCH_RULE_LENGTH 1024
/** Max arg number you can match on in a match rule, e.g.
* arg0='hello' is OK, arg3489720987='hello' is not
*/
#define DBUS_MAXIMUM_MATCH_RULE_ARG_NUMBER 63
/** Max length of a marshaled array in bytes (64M, 2^26) We use signed
* int for lengths so must be INT_MAX or less. We need something a
* bit smaller than INT_MAX because the array is inside a message with
* header info, etc. so an INT_MAX array wouldn't allow the message
* overhead. The 64M number is an attempt at a larger number than
* we'd reasonably ever use, but small enough that your bus would chew
* through it fairly quickly without locking up forever. If you have
* data that's likely to be larger than this, you should probably be
* sending it in multiple incremental messages anyhow.
*/
#define DBUS_MAXIMUM_ARRAY_LENGTH (67108864)
/** Number of bits you need in an unsigned to store the max array size */
#define DBUS_MAXIMUM_ARRAY_LENGTH_BITS 26
/** The maximum total message size including header and body; similar
* rationale to max array size.
*/
#define DBUS_MAXIMUM_MESSAGE_LENGTH (DBUS_MAXIMUM_ARRAY_LENGTH * 2)
/** Number of bits you need in an unsigned to store the max message size */
#define DBUS_MAXIMUM_MESSAGE_LENGTH_BITS 27
/** Depth of recursion in the type tree. This is automatically limited
* to DBUS_MAXIMUM_SIGNATURE_LENGTH since you could only have an array
* of array of array of ... that fit in the max signature. But that's
* probably a bit too large.
*/
#define DBUS_MAXIMUM_TYPE_RECURSION_DEPTH 32
/* Types of message */
/** This value is never a valid message type, see dbus_message_get_type() */
#define DBUS_MESSAGE_TYPE_INVALID 0
/** Message type of a method call message, see dbus_message_get_type() */
#define DBUS_MESSAGE_TYPE_METHOD_CALL 1
/** Message type of a method return message, see dbus_message_get_type() */
#define DBUS_MESSAGE_TYPE_METHOD_RETURN 2
/** Message type of an error reply message, see dbus_message_get_type() */
#define DBUS_MESSAGE_TYPE_ERROR 3
/** Message type of a signal message, see dbus_message_get_type() */
#define DBUS_MESSAGE_TYPE_SIGNAL 4
/* Header flags */
/** If set, this flag means that the sender of a message does not care about getting
* a reply, so the recipient need not send one. See dbus_message_set_no_reply().
*/
#define DBUS_HEADER_FLAG_NO_REPLY_EXPECTED 0x1
/**
* If set, this flag means that even if the message bus knows how to start an owner for
* the destination bus name (see dbus_message_set_destination()), it should not
* do so. If this flag is not set, the bus may launch a program to process the
* message.
*/
#define DBUS_HEADER_FLAG_NO_AUTO_START 0x2
/* Header fields */
/** Not equal to any valid header field code */
#define DBUS_HEADER_FIELD_INVALID 0
/** Header field code for the path - the path is the object emitting a signal or the object receiving a method call.
* See dbus_message_set_path().
*/
#define DBUS_HEADER_FIELD_PATH 1
/** Header field code for the interface containing a member (method or signal).
* See dbus_message_set_interface().
*/
#define DBUS_HEADER_FIELD_INTERFACE 2
/** Header field code for a member (method or signal). See dbus_message_set_member(). */
#define DBUS_HEADER_FIELD_MEMBER 3
/** Header field code for an error name (found in #DBUS_MESSAGE_TYPE_ERROR messages).
* See dbus_message_set_error_name().
*/
#define DBUS_HEADER_FIELD_ERROR_NAME 4
/** Header field code for a reply serial, used to match a #DBUS_MESSAGE_TYPE_METHOD_RETURN message with the
* message that it's a reply to. See dbus_message_set_reply_serial().
*/
#define DBUS_HEADER_FIELD_REPLY_SERIAL 5
/**
* Header field code for the destination bus name of a message. See dbus_message_set_destination().
*/
#define DBUS_HEADER_FIELD_DESTINATION 6
/**
* Header field code for the sender of a message; usually initialized by the message bus.
* See dbus_message_set_sender().
*/
#define DBUS_HEADER_FIELD_SENDER 7
/**
* Header field code for the type signature of a message.
*/
#define DBUS_HEADER_FIELD_SIGNATURE 8
/**
* Value of the highest-numbered header field code, can be used to determine
* the size of an array indexed by header field code. Remember though
* that unknown codes must be ignored, so check for that before
* indexing the array.
*/
#define DBUS_HEADER_FIELD_LAST DBUS_HEADER_FIELD_SIGNATURE
/** Header format is defined as a signature:
* byte byte order
* byte message type ID
* byte flags
* byte protocol version
* uint32 body length
* uint32 serial
* array of struct (byte,variant) (field name, value)
*
* The length of the header can be computed as the
* fixed size of the initial data, plus the length of
* the array at the end, plus padding to an 8-boundary.
*/
#define DBUS_HEADER_SIGNATURE \
DBUS_TYPE_BYTE_AS_STRING \
DBUS_TYPE_BYTE_AS_STRING \
DBUS_TYPE_BYTE_AS_STRING \
DBUS_TYPE_BYTE_AS_STRING \
DBUS_TYPE_UINT32_AS_STRING \
DBUS_TYPE_UINT32_AS_STRING \
DBUS_TYPE_ARRAY_AS_STRING \
DBUS_STRUCT_BEGIN_CHAR_AS_STRING \
DBUS_TYPE_BYTE_AS_STRING \
DBUS_TYPE_VARIANT_AS_STRING \
DBUS_STRUCT_END_CHAR_AS_STRING
/**
* The smallest header size that can occur. (It won't be valid due to
* missing required header fields.) This is 4 bytes, two uint32, an
* array length. This isn't any kind of resource limit, just the
* necessary/logical outcome of the header signature.
*/
#define DBUS_MINIMUM_HEADER_SIZE 16
/* Errors */
/* WARNING these get autoconverted to an enum in dbus-glib.h. Thus,
* if you change the order it breaks the ABI. Keep them in order.
* Also, don't change the formatting since that will break the sed
* script.
*/
/** A generic error; "something went wrong" - see the error message for more. */
#define DBUS_ERROR_FAILED "org.freedesktop.DBus.Error.Failed"
/** There was not enough memory to complete an operation. */
#define DBUS_ERROR_NO_MEMORY "org.freedesktop.DBus.Error.NoMemory"
/** The bus doesn't know how to launch a service to supply the bus name you wanted. */
#define DBUS_ERROR_SERVICE_UNKNOWN "org.freedesktop.DBus.Error.ServiceUnknown"
/** The bus name you referenced doesn't exist (i.e. no application owns it). */
#define DBUS_ERROR_NAME_HAS_NO_OWNER "org.freedesktop.DBus.Error.NameHasNoOwner"
/** No reply to a message expecting one, usually means a timeout occurred. */
#define DBUS_ERROR_NO_REPLY "org.freedesktop.DBus.Error.NoReply"
/** Something went wrong reading or writing to a socket, for example. */
#define DBUS_ERROR_IO_ERROR "org.freedesktop.DBus.Error.IOError"
/** A D-Bus bus address was malformed. */
#define DBUS_ERROR_BAD_ADDRESS "org.freedesktop.DBus.Error.BadAddress"
/** Requested operation isn't supported (like ENOSYS on UNIX). */
#define DBUS_ERROR_NOT_SUPPORTED "org.freedesktop.DBus.Error.NotSupported"
/** Some limited resource is exhausted. */
#define DBUS_ERROR_LIMITS_EXCEEDED "org.freedesktop.DBus.Error.LimitsExceeded"
/** Security restrictions don't allow doing what you're trying to do. */
#define DBUS_ERROR_ACCESS_DENIED "org.freedesktop.DBus.Error.AccessDenied"
/** Authentication didn't work. */
#define DBUS_ERROR_AUTH_FAILED "org.freedesktop.DBus.Error.AuthFailed"
/** Unable to connect to server (probably caused by ECONNREFUSED on a socket). */
#define DBUS_ERROR_NO_SERVER "org.freedesktop.DBus.Error.NoServer"
/** Certain timeout errors, possibly ETIMEDOUT on a socket.
* Note that #DBUS_ERROR_NO_REPLY is used for message reply timeouts.
* @warning this is confusingly-named given that #DBUS_ERROR_TIMED_OUT also exists. We can't fix
* it for compatibility reasons so just be careful.
*/
#define DBUS_ERROR_TIMEOUT "org.freedesktop.DBus.Error.Timeout"
/** No network access (probably ENETUNREACH on a socket). */
#define DBUS_ERROR_NO_NETWORK "org.freedesktop.DBus.Error.NoNetwork"
/** Can't bind a socket since its address is in use (i.e. EADDRINUSE). */
#define DBUS_ERROR_ADDRESS_IN_USE "org.freedesktop.DBus.Error.AddressInUse"
/** The connection is disconnected and you're trying to use it. */
#define DBUS_ERROR_DISCONNECTED "org.freedesktop.DBus.Error.Disconnected"
/** Invalid arguments passed to a method call. */
#define DBUS_ERROR_INVALID_ARGS "org.freedesktop.DBus.Error.InvalidArgs"
/** Missing file. */
#define DBUS_ERROR_FILE_NOT_FOUND "org.freedesktop.DBus.Error.FileNotFound"
/** Existing file and the operation you're using does not silently overwrite. */
#define DBUS_ERROR_FILE_EXISTS "org.freedesktop.DBus.Error.FileExists"
/** Method name you invoked isn't known by the object you invoked it on. */
#define DBUS_ERROR_UNKNOWN_METHOD "org.freedesktop.DBus.Error.UnknownMethod"
/** Certain timeout errors, e.g. while starting a service.
* @warning this is confusingly-named given that #DBUS_ERROR_TIMEOUT also exists. We can't fix
* it for compatibility reasons so just be careful.
*/
#define DBUS_ERROR_TIMED_OUT "org.freedesktop.DBus.Error.TimedOut"
/** Tried to remove or modify a match rule that didn't exist. */
#define DBUS_ERROR_MATCH_RULE_NOT_FOUND "org.freedesktop.DBus.Error.MatchRuleNotFound"
/** The match rule isn't syntactically valid. */
#define DBUS_ERROR_MATCH_RULE_INVALID "org.freedesktop.DBus.Error.MatchRuleInvalid"
/** While starting a new process, the exec() call failed. */
#define DBUS_ERROR_SPAWN_EXEC_FAILED "org.freedesktop.DBus.Error.Spawn.ExecFailed"
/** While starting a new process, the fork() call failed. */
#define DBUS_ERROR_SPAWN_FORK_FAILED "org.freedesktop.DBus.Error.Spawn.ForkFailed"
/** While starting a new process, the child exited with a status code. */
#define DBUS_ERROR_SPAWN_CHILD_EXITED "org.freedesktop.DBus.Error.Spawn.ChildExited"
/** While starting a new process, the child exited on a signal. */
#define DBUS_ERROR_SPAWN_CHILD_SIGNALED "org.freedesktop.DBus.Error.Spawn.ChildSignaled"
/** While starting a new process, something went wrong. */
#define DBUS_ERROR_SPAWN_FAILED "org.freedesktop.DBus.Error.Spawn.Failed"
/** Tried to get a UNIX process ID and it wasn't available. */
#define DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN "org.freedesktop.DBus.Error.UnixProcessIdUnknown"
/** A type signature is not valid. */
#define DBUS_ERROR_INVALID_SIGNATURE "org.freedesktop.DBus.Error.InvalidSignature"
/** A file contains invalid syntax or is otherwise broken. */
#define DBUS_ERROR_INVALID_FILE_CONTENT "org.freedesktop.DBus.Error.InvalidFileContent"
/** Asked for SELinux security context and it wasn't available. */
#define DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN "org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown"
/* XML introspection format */
/** XML namespace of the introspection format version 1.0 */
#define DBUS_INTROSPECT_1_0_XML_NAMESPACE "http://www.freedesktop.org/standards/dbus"
/** XML public identifier of the introspection format version 1.0 */
#define DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
/** XML system identifier of the introspection format version 1.0 */
#define DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"
/** XML document type declaration of the introspection format version 1.0 */
#define DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "<!DOCTYPE node PUBLIC \""DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER"\"\n\""DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER"\">\n"
/** @} */
#ifdef __cplusplus
#if 0
{ /* avoids confusing emacs indentation */
#endif
}
#endif
#endif /* DBUS_PROTOCOL_H */

View File

@@ -0,0 +1,99 @@
/* C API for _dbus_bindings, used by _dbus_glib_bindings and any third-party
* main loop integration which might happen in future.
*
* This file is currently Python-version-independent - please keep it that way.
*
* Copyright (C) 2006 Collabora Ltd.
*
* Licensed under the Academic Free License version 2.1
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef DBUS_PYTHON_H
#define DBUS_PYTHON_H
#include <Python.h>
#define DBUS_API_SUBJECT_TO_CHANGE 1
#include <dbus/dbus.h>
DBUS_BEGIN_DECLS
typedef void (*_dbus_py_func_ptr)(void);
typedef dbus_bool_t (*_dbus_py_conn_setup_func)(DBusConnection *, void *);
typedef dbus_bool_t (*_dbus_py_srv_setup_func)(DBusServer *, void *);
typedef void (*_dbus_py_free_func)(void *);
#define DBUS_BINDINGS_API_COUNT 3
#ifdef INSIDE_DBUS_PYTHON_BINDINGS
extern DBusConnection *DBusPyConnection_BorrowDBusConnection(PyObject *);
extern PyObject *DBusPyNativeMainLoop_New4(_dbus_py_conn_setup_func,
_dbus_py_srv_setup_func,
_dbus_py_free_func,
void *);
#else
static PyObject *_dbus_bindings_module = NULL;
static _dbus_py_func_ptr *dbus_bindings_API;
#define DBusPyConnection_BorrowDBusConnection \
(*(DBusConnection *(*)(PyObject *))dbus_bindings_API[1])
#define DBusPyNativeMainLoop_New4 \
((PyObject *(*)(_dbus_py_conn_setup_func, _dbus_py_srv_setup_func, \
_dbus_py_free_func, void *))dbus_bindings_API[2])
static int
import_dbus_bindings(const char *this_module_name)
{
PyObject *c_api;
int count;
_dbus_bindings_module = PyImport_ImportModule("_dbus_bindings");
if (!_dbus_bindings_module) {
return -1;
}
c_api = PyObject_GetAttrString(_dbus_bindings_module, "_C_API");
if (c_api == NULL) return -1;
if (PyCObject_Check(c_api)) {
dbus_bindings_API = (_dbus_py_func_ptr *)PyCObject_AsVoidPtr(c_api);
}
else {
Py_DECREF(c_api);
PyErr_SetString(PyExc_RuntimeError, "C API is not a PyCObject");
return -1;
}
Py_DECREF (c_api);
count = *(int *)dbus_bindings_API[0];
if (count < DBUS_BINDINGS_API_COUNT) {
PyErr_Format(PyExc_RuntimeError,
"_dbus_bindings has API version %d but %s needs "
"_dbus_bindings API version at least %d",
count, this_module_name,
DBUS_BINDINGS_API_COUNT);
return -1;
}
return 0;
}
#endif
DBUS_END_DECLS
#endif

View File

@@ -0,0 +1,90 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-server.h DBusServer object
*
* Copyright (C) 2002, 2003 Red Hat Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_SERVER_H
#define DBUS_SERVER_H
#include <dbus/dbus-errors.h>
#include <dbus/dbus-message.h>
#include <dbus/dbus-connection.h>
#include <dbus/dbus-protocol.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusServer
* @{
*/
typedef struct DBusServer DBusServer;
/** Called when a new connection to the server is available. Must reference and save the new
* connection, or close the new connection. Set with dbus_server_set_new_connection_function().
*/
typedef void (* DBusNewConnectionFunction) (DBusServer *server,
DBusConnection *new_connection,
void *data);
DBusServer* dbus_server_listen (const char *address,
DBusError *error);
DBusServer* dbus_server_ref (DBusServer *server);
void dbus_server_unref (DBusServer *server);
void dbus_server_disconnect (DBusServer *server);
dbus_bool_t dbus_server_get_is_connected (DBusServer *server);
char* dbus_server_get_address (DBusServer *server);
void dbus_server_set_new_connection_function (DBusServer *server,
DBusNewConnectionFunction function,
void *data,
DBusFreeFunction free_data_function);
dbus_bool_t dbus_server_set_watch_functions (DBusServer *server,
DBusAddWatchFunction add_function,
DBusRemoveWatchFunction remove_function,
DBusWatchToggledFunction toggled_function,
void *data,
DBusFreeFunction free_data_function);
dbus_bool_t dbus_server_set_timeout_functions (DBusServer *server,
DBusAddTimeoutFunction add_function,
DBusRemoveTimeoutFunction remove_function,
DBusTimeoutToggledFunction toggled_function,
void *data,
DBusFreeFunction free_data_function);
dbus_bool_t dbus_server_set_auth_mechanisms (DBusServer *server,
const char **mechanisms);
dbus_bool_t dbus_server_allocate_data_slot (dbus_int32_t *slot_p);
void dbus_server_free_data_slot (dbus_int32_t *slot_p);
dbus_bool_t dbus_server_set_data (DBusServer *server,
int slot,
void *data,
DBusFreeFunction free_data_func);
void* dbus_server_get_data (DBusServer *server,
int slot);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_SERVER_H */

View File

@@ -0,0 +1,131 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-shared.h Stuff used by both dbus/dbus.h low-level and C/C++ binding APIs
*
* Copyright (C) 2004 Red Hat, Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef DBUS_SHARED_H
#define DBUS_SHARED_H
/* Don't include anything in here from anywhere else. It's
* intended for use by any random library.
*/
#ifdef __cplusplus
extern "C" {
#if 0
} /* avoids confusing emacs indentation */
#endif
#endif
/* Normally docs are in .c files, but there isn't a .c file for this. */
/**
* @defgroup DBusShared Shared constants
* @ingroup DBus
*
* @brief Shared header included by both libdbus and C/C++ bindings such as the GLib bindings.
*
* Usually a C/C++ binding such as the GLib or Qt binding won't want to include dbus.h in its
* public headers. However, a few constants and macros may be useful to include; those are
* found here and in dbus-protocol.h
*
* @{
*/
/**
* Well-known bus types. See dbus_bus_get().
*/
typedef enum
{
DBUS_BUS_SESSION, /**< The login session bus */
DBUS_BUS_SYSTEM, /**< The systemwide bus */
DBUS_BUS_STARTER /**< The bus that started us, if any */
} DBusBusType;
/**
* Results that a message handler can return.
*/
typedef enum
{
DBUS_HANDLER_RESULT_HANDLED, /**< Message has had its effect - no need to run more handlers. */
DBUS_HANDLER_RESULT_NOT_YET_HANDLED, /**< Message has not had any effect - see if other handlers want it. */
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. */
} DBusHandlerResult;
/* Bus names */
/** The bus name used to talk to the bus itself. */
#define DBUS_SERVICE_DBUS "org.freedesktop.DBus"
/* Paths */
/** The object path used to talk to the bus itself. */
#define DBUS_PATH_DBUS "/org/freedesktop/DBus"
/** The object path used in local/in-process-generated messages. */
#define DBUS_PATH_LOCAL "/org/freedesktop/DBus/Local"
/* Interfaces, these #define don't do much other than
* catch typos at compile time
*/
/** The interface exported by the object with #DBUS_SERVICE_DBUS and #DBUS_PATH_DBUS */
#define DBUS_INTERFACE_DBUS "org.freedesktop.DBus"
/** The interface supported by introspectable objects */
#define DBUS_INTERFACE_INTROSPECTABLE "org.freedesktop.DBus.Introspectable"
/** The interface supported by objects with properties */
#define DBUS_INTERFACE_PROPERTIES "org.freedesktop.DBus.Properties"
/** The interface supported by most dbus peers */
#define DBUS_INTERFACE_PEER "org.freedesktop.DBus.Peer"
/** This is a special interface whose methods can only be invoked
* by the local implementation (messages from remote apps aren't
* allowed to specify this interface).
*/
#define DBUS_INTERFACE_LOCAL "org.freedesktop.DBus.Local"
/* Owner flags */
#define DBUS_NAME_FLAG_ALLOW_REPLACEMENT 0x1 /**< Allow another service to become the primary owner if requested */
#define DBUS_NAME_FLAG_REPLACE_EXISTING 0x2 /**< Request to replace the current primary owner */
#define DBUS_NAME_FLAG_DO_NOT_QUEUE 0x4 /**< If we can not become the primary owner do not place us in the queue */
/* Replies to request for a name */
#define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER 1 /**< Service has become the primary owner of the requested name */
#define DBUS_REQUEST_NAME_REPLY_IN_QUEUE 2 /**< Service could not become the primary owner and has been placed in the queue */
#define DBUS_REQUEST_NAME_REPLY_EXISTS 3 /**< Service is already in the queue */
#define DBUS_REQUEST_NAME_REPLY_ALREADY_OWNER 4 /**< Service is already the primary owner */
/* Replies to releasing a name */
#define DBUS_RELEASE_NAME_REPLY_RELEASED 1 /**< Service was released from the given name */
#define DBUS_RELEASE_NAME_REPLY_NON_EXISTENT 2 /**< The given name does not exist on the bus */
#define DBUS_RELEASE_NAME_REPLY_NOT_OWNER 3 /**< Service is not an owner of the given name */
/* Replies to service starts */
#define DBUS_START_REPLY_SUCCESS 1 /**< Service was auto started */
#define DBUS_START_REPLY_ALREADY_RUNNING 2 /**< Service was already running */
/** @} */
#ifdef __cplusplus
#if 0
{ /* avoids confusing emacs indentation */
#endif
}
#endif
#endif /* DBUS_SHARED_H */

View File

@@ -0,0 +1,81 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-signatures.h utility functions for D-Bus types
*
* Copyright (C) 2005 Red Hat Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_SIGNATURES_H
#define DBUS_SIGNATURES_H
#include <dbus/dbus-macros.h>
#include <dbus/dbus-types.h>
#include <dbus/dbus-errors.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusSignature
* @{
*/
/**
* DBusSignatureIter struct; contains no public fields
*/
typedef struct
{
void *dummy1; /**< Don't use this */
void *dummy2; /**< Don't use this */
dbus_uint32_t dummy8; /**< Don't use this */
int dummy12; /**< Don't use this */
int dummy17; /**< Don't use this */
} DBusSignatureIter;
void dbus_signature_iter_init (DBusSignatureIter *iter,
const char *signature);
int dbus_signature_iter_get_current_type (const DBusSignatureIter *iter);
char * dbus_signature_iter_get_signature (const DBusSignatureIter *iter);
int dbus_signature_iter_get_element_type (const DBusSignatureIter *iter);
dbus_bool_t dbus_signature_iter_next (DBusSignatureIter *iter);
void dbus_signature_iter_recurse (const DBusSignatureIter *iter,
DBusSignatureIter *subiter);
dbus_bool_t dbus_signature_validate (const char *signature,
DBusError *error);
dbus_bool_t dbus_signature_validate_single (const char *signature,
DBusError *error);
dbus_bool_t dbus_type_is_basic (int typecode);
dbus_bool_t dbus_type_is_container (int typecode);
dbus_bool_t dbus_type_is_fixed (int typecode);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_SIGNATURE_H */

View File

@@ -0,0 +1,196 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-threads.h D-Bus threads handling
*
* Copyright (C) 2002 Red Hat Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_THREADS_H
#define DBUS_THREADS_H
#include <dbus/dbus-macros.h>
#include <dbus/dbus-types.h>
DBUS_BEGIN_DECLS
/**
* @addtogroup DBusThreads
* @{
*/
/** An opaque mutex type provided by the #DBusThreadFunctions implementation installed by dbus_threads_init(). */
typedef struct DBusMutex DBusMutex;
/** An opaque condition variable type provided by the #DBusThreadFunctions implementation installed by dbus_threads_init(). */
typedef struct DBusCondVar DBusCondVar;
/** Deprecated, provide DBusRecursiveMutexNewFunction instead. */
typedef DBusMutex* (* DBusMutexNewFunction) (void);
/** Deprecated, provide DBusRecursiveMutexFreeFunction instead. */
typedef void (* DBusMutexFreeFunction) (DBusMutex *mutex);
/** Deprecated, provide DBusRecursiveMutexLockFunction instead. Return value is lock success, but gets ignored in practice. */
typedef dbus_bool_t (* DBusMutexLockFunction) (DBusMutex *mutex);
/** Deprecated, provide DBusRecursiveMutexUnlockFunction instead. Return value is unlock success, but gets ignored in practice. */
typedef dbus_bool_t (* DBusMutexUnlockFunction) (DBusMutex *mutex);
/** Creates a new recursively-lockable mutex, or returns #NULL if not
* enough memory. Can only fail due to lack of memory. Found in
* #DBusThreadFunctions. Do not just use PTHREAD_MUTEX_RECURSIVE for
* this, because it does not save/restore the recursion count when
* waiting on a condition. libdbus requires the Java-style behavior
* where the mutex is fully unlocked to wait on a condition.
*/
typedef DBusMutex* (* DBusRecursiveMutexNewFunction) (void);
/** Frees a recursively-lockable mutex. Found in #DBusThreadFunctions.
*/
typedef void (* DBusRecursiveMutexFreeFunction) (DBusMutex *mutex);
/** Locks a recursively-lockable mutex. Found in #DBusThreadFunctions.
* Can only fail due to lack of memory.
*/
typedef void (* DBusRecursiveMutexLockFunction) (DBusMutex *mutex);
/** Unlocks a recursively-lockable mutex. Found in #DBusThreadFunctions.
* Can only fail due to lack of memory.
*/
typedef void (* DBusRecursiveMutexUnlockFunction) (DBusMutex *mutex);
/** Creates a new condition variable. Found in #DBusThreadFunctions.
* Can only fail (returning #NULL) due to lack of memory.
*/
typedef DBusCondVar* (* DBusCondVarNewFunction) (void);
/** Frees a condition variable. Found in #DBusThreadFunctions.
*/
typedef void (* DBusCondVarFreeFunction) (DBusCondVar *cond);
/** Waits on a condition variable. Found in
* #DBusThreadFunctions. Must work with either a recursive or
* nonrecursive mutex, whichever the thread implementation
* provides. Note that PTHREAD_MUTEX_RECURSIVE does not work with
* condition variables (does not save/restore the recursion count) so
* don't try using simply pthread_cond_wait() and a
* PTHREAD_MUTEX_RECURSIVE to implement this, it won't work right.
*
* Has no error conditions. Must succeed if it returns.
*/
typedef void (* DBusCondVarWaitFunction) (DBusCondVar *cond,
DBusMutex *mutex);
/** Waits on a condition variable with a timeout. Found in
* #DBusThreadFunctions. Returns #TRUE if the wait did not
* time out, and #FALSE if it did.
*
* Has no error conditions. Must succeed if it returns.
*/
typedef dbus_bool_t (* DBusCondVarWaitTimeoutFunction) (DBusCondVar *cond,
DBusMutex *mutex,
int timeout_milliseconds);
/** Wakes one waiting thread on a condition variable. Found in #DBusThreadFunctions.
*
* Has no error conditions. Must succeed if it returns.
*/
typedef void (* DBusCondVarWakeOneFunction) (DBusCondVar *cond);
/** Wakes all waiting threads on a condition variable. Found in #DBusThreadFunctions.
*
* Has no error conditions. Must succeed if it returns.
*/
typedef void (* DBusCondVarWakeAllFunction) (DBusCondVar *cond);
/**
* Flags indicating which functions are present in #DBusThreadFunctions. Used to allow
* the library to detect older callers of dbus_threads_init() if new possible functions
* are added to #DBusThreadFunctions.
*/
typedef enum
{
DBUS_THREAD_FUNCTIONS_MUTEX_NEW_MASK = 1 << 0,
DBUS_THREAD_FUNCTIONS_MUTEX_FREE_MASK = 1 << 1,
DBUS_THREAD_FUNCTIONS_MUTEX_LOCK_MASK = 1 << 2,
DBUS_THREAD_FUNCTIONS_MUTEX_UNLOCK_MASK = 1 << 3,
DBUS_THREAD_FUNCTIONS_CONDVAR_NEW_MASK = 1 << 4,
DBUS_THREAD_FUNCTIONS_CONDVAR_FREE_MASK = 1 << 5,
DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_MASK = 1 << 6,
DBUS_THREAD_FUNCTIONS_CONDVAR_WAIT_TIMEOUT_MASK = 1 << 7,
DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ONE_MASK = 1 << 8,
DBUS_THREAD_FUNCTIONS_CONDVAR_WAKE_ALL_MASK = 1 << 9,
DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_NEW_MASK = 1 << 10,
DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_FREE_MASK = 1 << 11,
DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_LOCK_MASK = 1 << 12,
DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_UNLOCK_MASK = 1 << 13,
DBUS_THREAD_FUNCTIONS_ALL_MASK = (1 << 14) - 1
} DBusThreadFunctionsMask;
/**
* Functions that must be implemented to make the D-Bus library
* thread-aware. The recursive mutex functions should be specified
* rather than the old, deprecated nonrecursive ones.
*
* The condition variable functions have to work with recursive
* mutexes if you provide those, or with nonrecursive mutexes if you
* provide those.
*
* If implementing threads using pthreads, be aware that
* PTHREAD_MUTEX_RECURSIVE is broken in combination with condition
* variables. libdbus relies on the Java-style behavior that when
* waiting on a condition, the recursion count is saved and restored,
* and the mutex is completely unlocked, not just decremented one
* level of recursion.
*
* Thus with pthreads you probably have to roll your own emulated
* recursive mutexes, you can't use PTHREAD_MUTEX_RECURSIVE. This is
* what dbus_threads_init_default() does on platforms that use
* pthreads.
*/
typedef struct
{
unsigned int mask; /**< Mask indicating which functions are present. */
DBusMutexNewFunction mutex_new; /**< Function to create a mutex; optional and deprecated. */
DBusMutexFreeFunction mutex_free; /**< Function to free a mutex; optional and deprecated. */
DBusMutexLockFunction mutex_lock; /**< Function to lock a mutex; optional and deprecated. */
DBusMutexUnlockFunction mutex_unlock; /**< Function to unlock a mutex; optional and deprecated. */
DBusCondVarNewFunction condvar_new; /**< Function to create a condition variable */
DBusCondVarFreeFunction condvar_free; /**< Function to free a condition variable */
DBusCondVarWaitFunction condvar_wait; /**< Function to wait on a condition */
DBusCondVarWaitTimeoutFunction condvar_wait_timeout; /**< Function to wait on a condition with a timeout */
DBusCondVarWakeOneFunction condvar_wake_one; /**< Function to wake one thread waiting on the condition */
DBusCondVarWakeAllFunction condvar_wake_all; /**< Function to wake all threads waiting on the condition */
DBusRecursiveMutexNewFunction recursive_mutex_new; /**< Function to create a recursive mutex */
DBusRecursiveMutexFreeFunction recursive_mutex_free; /**< Function to free a recursive mutex */
DBusRecursiveMutexLockFunction recursive_mutex_lock; /**< Function to lock a recursive mutex */
DBusRecursiveMutexUnlockFunction recursive_mutex_unlock; /**< Function to unlock a recursive mutex */
void (* padding1) (void); /**< Reserved for future expansion */
void (* padding2) (void); /**< Reserved for future expansion */
void (* padding3) (void); /**< Reserved for future expansion */
void (* padding4) (void); /**< Reserved for future expansion */
} DBusThreadFunctions;
dbus_bool_t dbus_threads_init (const DBusThreadFunctions *functions);
dbus_bool_t dbus_threads_init_default (void);
/** @} */
DBUS_END_DECLS
#endif /* DBUS_THREADS_H */

View File

@@ -0,0 +1,139 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus-types.h types such as dbus_bool_t
*
* Copyright (C) 2002 Red Hat Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
#error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
#endif
#ifndef DBUS_TYPES_H
#define DBUS_TYPES_H
#include <stddef.h>
#include <dbus/dbus-arch-deps.h>
typedef dbus_uint32_t dbus_unichar_t;
/* boolean size must be fixed at 4 bytes due to wire protocol! */
typedef dbus_uint32_t dbus_bool_t;
/* Normally docs are in .c files, but there isn't a .c file for this. */
/**
* @defgroup DBusTypes Basic types
* @ingroup DBus
* @brief dbus_bool_t, dbus_int32_t, etc.
*
* Typedefs for common primitive types.
*
* @{
*/
/**
* @typedef dbus_bool_t
*
* A boolean, valid values are #TRUE and #FALSE.
*/
/**
* @typedef dbus_uint32_t
*
* A 32-bit unsigned integer on all platforms.
*/
/**
* @typedef dbus_int32_t
*
* A 32-bit signed integer on all platforms.
*/
/**
* @typedef dbus_uint16_t
*
* A 16-bit unsigned integer on all platforms.
*/
/**
* @typedef dbus_int16_t
*
* A 16-bit signed integer on all platforms.
*/
/**
* @typedef dbus_uint64_t
*
* A 64-bit unsigned integer on all platforms that support it.
* If supported, #DBUS_HAVE_INT64 will be defined.
*
* C99 requires a 64-bit type and most likely all interesting
* compilers support one. GLib for example flat-out requires
* a 64-bit type.
*
* You probably want to just assume #DBUS_HAVE_INT64 is always defined.
*/
/**
* @typedef dbus_int64_t
*
* A 64-bit signed integer on all platforms that support it.
* If supported, #DBUS_HAVE_INT64 will be defined.
*
* C99 requires a 64-bit type and most likely all interesting
* compilers support one. GLib for example flat-out requires
* a 64-bit type.
*
* You probably want to just assume #DBUS_HAVE_INT64 is always defined.
*/
/**
* @def DBUS_HAVE_INT64
*
* Defined if 64-bit integers are available. Will be defined
* on any platform you care about, unless you care about
* some truly ancient UNIX, or some bizarre embedded platform.
*
* C99 requires a 64-bit type and most likely all interesting
* compilers support one. GLib for example flat-out requires
* a 64-bit type.
*
* You should feel comfortable ignoring this macro and just using
* int64 unconditionally.
*
*/
/**
* @def DBUS_INT64_CONSTANT
*
* Declare a 64-bit signed integer constant. The macro
* adds the necessary "LL" or whatever after the integer,
* giving a literal such as "325145246765LL"
*/
/**
* @def DBUS_UINT64_CONSTANT
*
* Declare a 64-bit unsigned integer constant. The macro
* adds the necessary "ULL" or whatever after the integer,
* giving a literal such as "325145246765ULL"
*/
/** @} */
#endif /* DBUS_TYPES_H */

View File

@@ -0,0 +1,103 @@
/* -*- mode: C; c-file-style: "gnu" -*- */
/* dbus.h Convenience header including all other headers
*
* Copyright (C) 2002, 2003 Red Hat Inc.
*
* Licensed under the Academic Free License version 2.1
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef DBUS_H
#define DBUS_H
#define DBUS_INSIDE_DBUS_H 1
#include <dbus/dbus-arch-deps.h>
#include <dbus/dbus-address.h>
#include <dbus/dbus-bus.h>
#include <dbus/dbus-connection.h>
#include <dbus/dbus-errors.h>
#include <dbus/dbus-macros.h>
#include <dbus/dbus-message.h>
#include <dbus/dbus-misc.h>
#include <dbus/dbus-pending-call.h>
#include <dbus/dbus-protocol.h>
#include <dbus/dbus-server.h>
#include <dbus/dbus-shared.h>
#include <dbus/dbus-signature.h>
#include <dbus/dbus-threads.h>
#include <dbus/dbus-types.h>
#undef DBUS_INSIDE_DBUS_H
/**
* @defgroup DBus D-Bus low-level public API
* @brief The low-level public API of the D-Bus library
*
* libdbus provides a low-level C API intended primarily for use by
* bindings to specific object systems and languages. D-Bus is most
* convenient when used with the GLib bindings, Python bindings, Qt
* bindings, Mono bindings, and so forth. This low-level API has a
* lot of complexity useful only for bindings.
*
* @{
*/
/** @} */
/**
* @mainpage
*
* This manual documents the <em>low-level</em> D-Bus C API. <b>If you use
* this low-level API directly, you're signing up for some pain.</b>
*
* Caveats aside, you might get started learning the low-level API by reading
* about @ref DBusConnection and @ref DBusMessage.
*
* There are several other places to look for D-Bus information, such
* as the tutorial and the specification; those can be found at <a
* href="http://www.freedesktop.org/wiki/Software/dbus">the D-Bus
* website</a>. If you're interested in a sysadmin or package
* maintainer's perspective on the dbus-daemon itself and its
* configuration, be sure to check out the man pages as well.
*
* The low-level API documented in this manual deliberately lacks
* most convenience functions - those are left up to higher-level libraries
* based on frameworks such as GLib, Qt, Python, Mono, Java,
* etc. These higher-level libraries (often called "D-Bus bindings")
* have features such as object systems and main loops that allow a
* <em>much</em> more convenient API.
*
* The low-level API also contains plenty of clutter to support
* integration with arbitrary object systems, languages, main loops,
* and so forth. These features add a lot of noise to the API that you
* probably don't care about unless you're coding a binding.
*
* This manual also contains docs for @ref DBusInternals "D-Bus internals",
* so you can use it to get oriented to the D-Bus source code if you're
* interested in patching the code. You should also read the
* file HACKING which comes with the source code if you plan to contribute to
* D-Bus.
*
* As you read the code, you can identify internal D-Bus functions
* because they start with an underscore ('_') character. Also, any
* identifier or macro that lacks a DBus, dbus_, or DBUS_ namepace
* prefix is internal, with a couple of exceptions such as #NULL,
* #TRUE, and #FALSE.
*/
#endif /* DBUS_H */