VirtualBox

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

Last change on this file since 25346 was 24409, checked in by vboxsync, 15 years ago

OSE header fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.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 * The contents of this file may alternatively be used under the terms
19 * of the Common Development and Distribution License Version 1.0
20 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
21 * VirtualBox OSE distribution, in which case the provisions of the
22 * CDDL are applicable instead of those of the GPL.
23 *
24 * You may elect to license modified versions of this file under the
25 * terms and conditions of either the GPL or the CDDL or both.
26 *
27 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
28 * Clara, CA 95054 USA or visit http://www.sun.com if you need
29 * additional information or have any questions.
30 */
31
32#ifndef ___VBox_DBus_h
33#define ___VBox_DBus_h
34
35#include <stdint.h>
36
37#define VBOX_DBUS_1_3_LIB "libdbus-1.so.3"
38
39/** Types and defines from the dbus header files which we need. These are
40 * taken more or less verbatim from the DBus public interface header files. */
41struct DBusError
42{
43 const char *name;
44 const char *message;
45 unsigned int dummy1 : 1;
46 unsigned int dummy2 : 1;
47 unsigned int dummy3 : 1;
48 unsigned int dummy4 : 1;
49 unsigned int dummy5 : 1;
50 void *padding1;
51};
52struct DBusConnection;
53typedef struct DBusConnection DBusConnection;
54typedef uint32_t dbus_bool_t;
55typedef uint32_t dbus_uint32_t;
56typedef enum { DBUS_BUS_SESSON, DBUS_BUS_SYSTEM, DBUS_BUS_STARTER } DBusBusType;
57struct DBusMessage;
58typedef struct DBusMessage DBusMessage;
59struct DBusMessageIter
60{
61 void *dummy1;
62 void *dummy2;
63 dbus_uint32_t dummy3;
64 int dummy4;
65 int dummy5;
66 int dummy6;
67 int dummy7;
68 int dummy8;
69 int dummy9;
70 int dummy10;
71 int dummy11;
72 int pad1;
73 int pad2;
74 void *pad3;
75};
76typedef struct DBusMessageIter DBusMessageIter;
77
78#define DBUS_ERROR_NO_MEMORY "org.freedesktop.DBus.Error.NoMemory"
79
80/* Primitive types */
81#define DBUS_TYPE_INVALID ((int) '\0')
82#define DBUS_TYPE_INT32 ((int) 'i')
83#define DBUS_TYPE_UINT32 ((int) 'u')
84#define DBUS_TYPE_STRING ((int) 's')
85#define DBUS_TYPE_STRING_AS_STRING "s"
86
87/* Compound types */
88#define DBUS_TYPE_ARRAY ((int) 'a')
89#define DBUS_TYPE_ARRAY_AS_STRING "a"
90#define DBUS_TYPE_DICT_ENTRY ((int) 'e')
91#define DBUS_TYPE_DICT_ENTRY_AS_STRING "e"
92
93typedef enum
94{
95 DBUS_HANDLER_RESULT_HANDLED,
96 DBUS_HANDLER_RESULT_NOT_YET_HANDLED,
97 DBUS_HANDLER_RESULT_NEED_MEMORY
98} DBusHandlerResult;
99
100typedef DBusHandlerResult (*DBusHandleMessageFunction) (DBusConnection *,
101 DBusMessage *, void *);
102typedef void (*DBusFreeFunction) (void *);
103
104/* Declarations of the functions that we need from libdbus-1 */
105#define VBOX_PROXY_STUB(function, rettype, signature, shortsig) \
106RTR3DECL(rettype) ( function ) signature ;
107
108#include <VBox/dbus-calls.h>
109
110#undef VBOX_PROXY_STUB
111
112/**
113 * Try to dynamically load the DBus library. This function should be called
114 * before attempting to use any of the DBus functions. It is safe to call this
115 * function multiple times.
116 *
117 * @returns iprt status code
118 */
119RTR3DECL(int) RTDBusLoadLib(void);
120
121#endif /* ___VBox_DBus_h not defined */
122/* vi: set tabstop=4 shiftwidth=4 expandtab: */
123
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