VirtualBox

source: vbox/trunk/include/VBox/dbus.h@ 24271

Last change on this file since 24271 was 23864, checked in by vboxsync, 15 years ago

VBox Runtime/D-Bus: Missing declarations.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.4 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 ___VBox_DBus_h
24#define ___VBox_DBus_h
25
26#include <stdint.h>
27
28#define VBOX_DBUS_1_3_LIB "libdbus-1.so.3"
29
30/** Types and defines from the dbus header files which we need. These are
31 * taken more or less verbatim from the DBus public interface header files. */
32struct DBusError
33{
34 const char *name;
35 const char *message;
36 unsigned int dummy1 : 1;
37 unsigned int dummy2 : 1;
38 unsigned int dummy3 : 1;
39 unsigned int dummy4 : 1;
40 unsigned int dummy5 : 1;
41 void *padding1;
42};
43struct DBusConnection;
44typedef struct DBusConnection DBusConnection;
45typedef uint32_t dbus_bool_t;
46typedef uint32_t dbus_uint32_t;
47typedef enum { DBUS_BUS_SESSON, DBUS_BUS_SYSTEM, DBUS_BUS_STARTER } DBusBusType;
48struct DBusMessage;
49typedef struct DBusMessage DBusMessage;
50struct DBusMessageIter
51{
52 void *dummy1;
53 void *dummy2;
54 dbus_uint32_t dummy3;
55 int dummy4;
56 int dummy5;
57 int dummy6;
58 int dummy7;
59 int dummy8;
60 int dummy9;
61 int dummy10;
62 int dummy11;
63 int pad1;
64 int pad2;
65 void *pad3;
66};
67typedef struct DBusMessageIter DBusMessageIter;
68
69#define DBUS_ERROR_NO_MEMORY "org.freedesktop.DBus.Error.NoMemory"
70
71/* Primitive types */
72#define DBUS_TYPE_INVALID ((int) '\0')
73#define DBUS_TYPE_INT32 ((int) 'i')
74#define DBUS_TYPE_UINT32 ((int) 'u')
75#define DBUS_TYPE_STRING ((int) 's')
76#define DBUS_TYPE_STRING_AS_STRING "s"
77
78/* Compound types */
79#define DBUS_TYPE_ARRAY ((int) 'a')
80#define DBUS_TYPE_ARRAY_AS_STRING "a"
81#define DBUS_TYPE_DICT_ENTRY ((int) 'e')
82#define DBUS_TYPE_DICT_ENTRY_AS_STRING "e"
83
84typedef enum
85{
86 DBUS_HANDLER_RESULT_HANDLED,
87 DBUS_HANDLER_RESULT_NOT_YET_HANDLED,
88 DBUS_HANDLER_RESULT_NEED_MEMORY
89} DBusHandlerResult;
90
91typedef DBusHandlerResult (*DBusHandleMessageFunction) (DBusConnection *,
92 DBusMessage *, void *);
93typedef void (*DBusFreeFunction) (void *);
94
95/* Declarations of the functions that we need from libdbus-1 */
96#define VBOX_PROXY_STUB(function, rettype, signature, shortsig) \
97RTR3DECL(rettype) ( function ) signature ;
98
99#include <VBox/dbus-calls.h>
100
101#undef VBOX_PROXY_STUB
102
103/**
104 * Try to dynamically load the DBus library. This function should be called
105 * before attempting to use any of the DBus functions. It is safe to call this
106 * function multiple times.
107 *
108 * @returns iprt status code
109 */
110RTR3DECL(int) RTDBusLoadLib(void);
111
112#endif /* ___VBox_DBus_h not defined */
113/* vi: set tabstop=4 shiftwidth=4 expandtab: */
114
Note: See TracBrowser for help on using the repository browser.

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