5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync/** @file
f9b086a7629afa88e4848c334a3b50c5812b924cvboxsync * Module to dynamically load libdbus and load all symbols which are needed by
f9b086a7629afa88e4848c334a3b50c5812b924cvboxsync * VirtualBox.
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync */
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync/*
c7814cf6e1240a519cbec0441e033d0e2470ed00vboxsync * Copyright (C) 2008-2012 Oracle Corporation
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync *
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync * available from http://www.virtualbox.org. This file is free software;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync * you can redistribute it and/or modify it under the terms of the GNU
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync * General Public License (GPL) as published by the Free Software
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync *
8f22303f06a6aeb6f4e186f9db1492ec13d9fcecvboxsync * The contents of this file may alternatively be used under the terms
8f22303f06a6aeb6f4e186f9db1492ec13d9fcecvboxsync * of the Common Development and Distribution License Version 1.0
8f22303f06a6aeb6f4e186f9db1492ec13d9fcecvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
8f22303f06a6aeb6f4e186f9db1492ec13d9fcecvboxsync * VirtualBox OSE distribution, in which case the provisions of the
8f22303f06a6aeb6f4e186f9db1492ec13d9fcecvboxsync * CDDL are applicable instead of those of the GPL.
8f22303f06a6aeb6f4e186f9db1492ec13d9fcecvboxsync *
8f22303f06a6aeb6f4e186f9db1492ec13d9fcecvboxsync * You may elect to license modified versions of this file under the
8f22303f06a6aeb6f4e186f9db1492ec13d9fcecvboxsync * terms and conditions of either the GPL or the CDDL or both.
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync */
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync
f9b086a7629afa88e4848c334a3b50c5812b924cvboxsync#ifndef ___VBox_dbus_h
f9b086a7629afa88e4848c334a3b50c5812b924cvboxsync#define ___VBox_dbus_h
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync
23df26da18fddb059fc7ea1c77bf091a0ef31dd0vboxsync#include <iprt/types.h>
23df26da18fddb059fc7ea1c77bf091a0ef31dd0vboxsync#include <iprt/stdarg.h>
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync
f9b086a7629afa88e4848c334a3b50c5812b924cvboxsync#ifndef __cplusplus
f9b086a7629afa88e4848c334a3b50c5812b924cvboxsync# error "This header requires C++ to avoid name clashes."
f9b086a7629afa88e4848c334a3b50c5812b924cvboxsync#endif
f9b086a7629afa88e4848c334a3b50c5812b924cvboxsync
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync/** Types and defines from the dbus header files which we need. These are
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync * taken more or less verbatim from the DBus public interface header files. */
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsyncstruct DBusError
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync{
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync const char *name;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync const char *message;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync unsigned int dummy1 : 1;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync unsigned int dummy2 : 1;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync unsigned int dummy3 : 1;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync unsigned int dummy4 : 1;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync unsigned int dummy5 : 1;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync void *padding1;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync};
23df26da18fddb059fc7ea1c77bf091a0ef31dd0vboxsynctypedef struct DBusError DBusError;
23df26da18fddb059fc7ea1c77bf091a0ef31dd0vboxsync
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsyncstruct DBusConnection;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsynctypedef struct DBusConnection DBusConnection;
23df26da18fddb059fc7ea1c77bf091a0ef31dd0vboxsync
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsynctypedef uint32_t dbus_bool_t;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsynctypedef uint32_t dbus_uint32_t;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsynctypedef enum { DBUS_BUS_SESSON, DBUS_BUS_SYSTEM, DBUS_BUS_STARTER } DBusBusType;
23df26da18fddb059fc7ea1c77bf091a0ef31dd0vboxsync
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsyncstruct DBusMessage;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsynctypedef struct DBusMessage DBusMessage;
23df26da18fddb059fc7ea1c77bf091a0ef31dd0vboxsync
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsyncstruct DBusMessageIter
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync{
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync void *dummy1;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync void *dummy2;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync dbus_uint32_t dummy3;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync int dummy4;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync int dummy5;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync int dummy6;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync int dummy7;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync int dummy8;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync int dummy9;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync int dummy10;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync int dummy11;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync int pad1;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync int pad2;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync void *pad3;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync};
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsynctypedef struct DBusMessageIter DBusMessageIter;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync
ff98d1430ee87b5bbf43e4054bf433d70b163e26vboxsync#define DBUS_ERROR_NO_MEMORY "org.freedesktop.DBus.Error.NoMemory"
ff98d1430ee87b5bbf43e4054bf433d70b163e26vboxsync
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync/* Message types. */
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync#define DBUS_MESSAGE_TYPE_INVALID 0
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync#define DBUS_MESSAGE_TYPE_METHOD_CALL 1
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync#define DBUS_MESSAGE_TYPE_METHOD_RETURN 2
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync#define DBUS_MESSAGE_TYPE_ERROR 3
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync#define DBUS_MESSAGE_TYPE_SIGNAL 4
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync/* Primitive types. */
ff98d1430ee87b5bbf43e4054bf433d70b163e26vboxsync#define DBUS_TYPE_INVALID ((int) '\0')
2363f5f39dbc33520972d6fc09906563ed5b39eevboxsync#define DBUS_TYPE_BOOLEAN ((int) 'b')
ff98d1430ee87b5bbf43e4054bf433d70b163e26vboxsync#define DBUS_TYPE_INT32 ((int) 'i')
ff98d1430ee87b5bbf43e4054bf433d70b163e26vboxsync#define DBUS_TYPE_UINT32 ((int) 'u')
ff98d1430ee87b5bbf43e4054bf433d70b163e26vboxsync#define DBUS_TYPE_STRING ((int) 's')
ff98d1430ee87b5bbf43e4054bf433d70b163e26vboxsync#define DBUS_TYPE_STRING_AS_STRING "s"
ff98d1430ee87b5bbf43e4054bf433d70b163e26vboxsync
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync/* Compound types. */
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync#define DBUS_TYPE_OBJECT_PATH ((int) 'o')
ff98d1430ee87b5bbf43e4054bf433d70b163e26vboxsync#define DBUS_TYPE_ARRAY ((int) 'a')
ff98d1430ee87b5bbf43e4054bf433d70b163e26vboxsync#define DBUS_TYPE_ARRAY_AS_STRING "a"
ff98d1430ee87b5bbf43e4054bf433d70b163e26vboxsync#define DBUS_TYPE_DICT_ENTRY ((int) 'e')
ff98d1430ee87b5bbf43e4054bf433d70b163e26vboxsync#define DBUS_TYPE_DICT_ENTRY_AS_STRING "e"
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsynctypedef enum
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync{
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync DBUS_HANDLER_RESULT_HANDLED,
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync DBUS_HANDLER_RESULT_NOT_YET_HANDLED,
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync DBUS_HANDLER_RESULT_NEED_MEMORY
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync} DBusHandlerResult;
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync
f9b086a7629afa88e4848c334a3b50c5812b924cvboxsynctypedef DBusHandlerResult (* DBusHandleMessageFunction)(DBusConnection *,
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync DBusMessage *, void *);
f9b086a7629afa88e4848c334a3b50c5812b924cvboxsynctypedef void (* DBusFreeFunction) (void *);
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync/* Declarations of the functions that we need from libdbus-1 */
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync#define VBOX_DBUS_GENERATE_HEADER
f9b086a7629afa88e4848c334a3b50c5812b924cvboxsync
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync#include <VBox/dbus-calls.h>
f9b086a7629afa88e4848c334a3b50c5812b924cvboxsync
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync#undef VBOX_DBUS_GENERATE_HEADER
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync
ff98d1430ee87b5bbf43e4054bf433d70b163e26vboxsync#endif /* ___VBox_DBus_h not defined */
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync