dbus-gutils.h

00001 /* -*- mode: C; c-file-style: "gnu" -*- */
00002 /* dbus-gutils.h Utils shared between convenience lib and installed lib
00003  *
00004  * Copyright (C) 2003  Red Hat, Inc.
00005  *
00006  * Licensed under the Academic Free License version 2.1
00007  *
00008  * This program is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation; either version 2 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * This program is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this program; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021  *
00022  */
00023 
00024 #ifndef DBUS_GLIB_UTILS_H
00025 #define DBUS_GLIB_UTILS_H
00026 
00027 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00028 
00029 #include <dbus/dbus.h>
00030 #include <glib-object.h>
00031 
00032 G_BEGIN_DECLS
00033 
00034 char      **_dbus_gutils_split_path     (const char *path);
00035 
00036 char       *_dbus_gutils_wincaps_to_uscore (const char *uscore);
00037 
00038 /* These munge the pointer to enforce that a plain cast won't work,
00039  * accessor functions must be used; i.e. to ensure the ABI
00040  * reflects our encapsulation.
00041  */
00042 #define _DBUS_POINTER_SHIFT(p)   ((void*) (((char*)p) + sizeof (void*)))
00043 #define _DBUS_POINTER_UNSHIFT(p) ((void*) (((char*)p) - sizeof (void*)))
00044 
00045 #define DBUS_CONNECTION_FROM_G_CONNECTION(x)     ((DBusConnection*) _DBUS_POINTER_UNSHIFT(x))
00046 #define DBUS_MESSAGE_FROM_G_MESSAGE(x)           ((DBusMessage*) _DBUS_POINTER_UNSHIFT(x))
00047 #define DBUS_PENDING_CALL_FROM_G_PENDING_CALL(x) ((DBusPendingCall*) _DBUS_POINTER_UNSHIFT(x))
00048 
00049 #define DBUS_G_CONNECTION_FROM_CONNECTION(x)     ((DBusGConnection*) _DBUS_POINTER_SHIFT(x))
00050 #define DBUS_G_MESSAGE_FROM_MESSAGE(x)           ((DBusGMessage*) _DBUS_POINTER_SHIFT(x))
00051 #define DBUS_G_PENDING_CALL_FROM_PENDING_CALL(x) ((DBusGPendingCall*) _DBUS_POINTER_SHIFT(x))
00052 
00053 G_END_DECLS
00054 
00055 #endif /* DBUS_GLIB_UTILS_H */
00056 
00057 #endif /* DOXYGEN_SHOULD_SKIP_THIS */

Generated on Wed Oct 3 10:04:23 2007 for D-BUSGLibBindings by  doxygen 1.5.1