VirtualBox

source: vbox/trunk/src/VBox/Main/include/vbox-dbus.h@ 15239

Last change on this file since 15239 was 15058, checked in by vboxsync, 16 years ago

Main: fix a burn

  • Property svn:eol-style set to native
File size: 4.8 KB
Line 
1/** @file
2 *
3 * Module to dynamically load libdbus and load all symbols
4 * which are needed by VirtualBox.
5 */
6
7/*
8 * Copyright (C) 2008 Sun Microsystems, Inc.
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
19 * Clara, CA 95054 USA or visit http://www.sun.com if you need
20 * additional information or have any questions.
21 */
22
23#ifndef ____H_VBOX_DBUS
24#define ____H_VBOX_DBUS
25
26#include <stdint.h>
27
28#define LIB_DBUS_1_2 "libdbus-1.so.2" /* This should be compatible */
29#define LIB_DBUS_1_3 "libdbus-1.so.3"
30
31/** Types from the dbus header files which we need. These are taken more or less
32 verbatim from the DBus public interface header files. */
33struct DBusError
34{
35 const char *name;
36 const char *message;
37 unsigned int dummy1 : 1; /**< placeholder */
38 unsigned int dummy2 : 1; /**< placeholder */
39 unsigned int dummy3 : 1; /**< placeholder */
40 unsigned int dummy4 : 1; /**< placeholder */
41 unsigned int dummy5 : 1; /**< placeholder */
42 void *padding1; /**< placeholder */
43};
44struct DBusConnection;
45typedef struct DBusConnection DBusConnection;
46typedef uint32_t dbus_bool_t;
47typedef uint32_t dbus_uint32_t;
48typedef enum { DBUS_BUS_SESSON, DBUS_BUS_SYSTEM, DBUS_BUS_STARTER } DBusBusType;
49struct DBusMessage;
50typedef struct DBusMessage DBusMessage;
51struct DBusMessageIter
52{
53 void *dummy1; /**< Don't use this */
54 void *dummy2; /**< Don't use this */
55 dbus_uint32_t dummy3; /**< Don't use this */
56 int dummy4; /**< Don't use this */
57 int dummy5; /**< Don't use this */
58 int dummy6; /**< Don't use this */
59 int dummy7; /**< Don't use this */
60 int dummy8; /**< Don't use this */
61 int dummy9; /**< Don't use this */
62 int dummy10; /**< Don't use this */
63 int dummy11; /**< Don't use this */
64 int pad1; /**< Don't use this */
65 int pad2; /**< Don't use this */
66 void *pad3; /**< Don't use this */
67};
68typedef struct DBusMessageIter DBusMessageIter;
69
70/** Defines from the dbus header files which we need. These are taken more or less
71 verbatim from the DBus public interface header files. */
72#define DBUS_ERROR_NO_MEMORY "org.freedesktop.DBus.Error.NoMemory"
73#define DBUS_TYPE_STRING ((int) 's')
74#define DBUS_TYPE_ARRAY ((int) 'a')
75#define DBUS_TYPE_DICT_ENTRY ((int) 'e')
76
77/** The following are the symbols which we need from libdbus-1. */
78extern void (*dbus_error_init)(DBusError *);
79extern DBusConnection *(*dbus_bus_get)(DBusBusType, DBusError *);
80extern void (*dbus_error_free)(DBusError *);
81extern void (*dbus_connection_unref)(DBusConnection *);
82extern void (*dbus_connection_set_exit_on_disconnect)(DBusConnection *, dbus_bool_t);
83extern dbus_bool_t (*dbus_bus_name_has_owner)(DBusConnection *, const char *,
84 DBusError *);
85extern void (*dbus_bus_add_match)(DBusConnection *, const char *, DBusError *);
86extern void (*dbus_bus_remove_match)(DBusConnection *, const char *, DBusError *);
87extern void (*dbus_message_unref)(DBusMessage *);
88extern DBusMessage* (*dbus_message_new_method_call)(const char *, const char *,
89 const char *, const char *);
90extern void (*dbus_message_iter_init_append)(DBusMessage *, DBusMessageIter *);
91extern dbus_bool_t (*dbus_message_iter_append_basic)(DBusMessageIter *, int,
92 const void *);
93extern DBusMessage * (*dbus_connection_send_with_reply_and_block)(DBusConnection *,
94 DBusMessage *, int,
95 DBusError *error);
96extern dbus_bool_t (*dbus_message_iter_init) (DBusMessage *, DBusMessageIter *);
97extern int (*dbus_message_iter_get_arg_type) (DBusMessageIter *);
98extern int (*dbus_message_iter_get_element_type) (DBusMessageIter *);
99extern void (*dbus_message_iter_recurse) (DBusMessageIter *, DBusMessageIter *);
100extern void (*dbus_message_iter_get_basic) (DBusMessageIter *, void *);
101extern dbus_bool_t (*dbus_message_iter_next) (DBusMessageIter *);
102
103extern bool VBoxDBusCheckPresence(void);
104extern void VBoxDBusConnectionUnref(DBusConnection *pConnection);
105extern void VBoxDBusMessageUnref(DBusMessage *pMessage);
106
107#endif /* ____H_VBOX_DBUS not defined */
108/* vi: set tabstop=4 shiftwidth=4 expandtab: */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette