5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync/** @file
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync * Stubs for dynamically loading libdbus-1 and the symbols which are needed by
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync * 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
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync/** The file name of the DBus library */
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync#define RT_RUNTIME_LOADER_LIB_NAME "libdbus-1.so.3"
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync/** The name of the loader function */
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync#define RT_RUNTIME_LOADER_FUNCTION RTDBusLoadLib
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync/** The following are the symbols which we need from the DBus library. */
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync#define RT_RUNTIME_LOADER_INSERT_SYMBOLS \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_error_init, void, (DBusError *error), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (error)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_error_is_set, dbus_bool_t, (const DBusError *error), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (error)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_bus_get, DBusConnection *, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusBusType type, DBusError *error), (type, error)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_bus_get_private, DBusConnection *, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusBusType type, DBusError *error), (type, error)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_error_free, void, (DBusError *error), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (error)) \
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync RT_PROXY_STUB(dbus_free_string_array, void, (char **str_array), \
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync (str_array)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_connection_unref, void, (DBusConnection *connection), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (connection)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_connection_close, void, (DBusConnection *connection), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (connection)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_connection_send, dbus_bool_t, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusConnection *connection, DBusMessage *message, dbus_uint32_t *serial), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (connection, message, serial)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_connection_flush, void, (DBusConnection *connection), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (connection)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_connection_set_exit_on_disconnect, void, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusConnection *connection, dbus_bool_t boolean), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (connection, boolean)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_bus_name_has_owner, dbus_bool_t, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusConnection *connection, const char *string, DBusError *error), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (connection, string, error)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_bus_add_match, void, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusConnection *connection, const char *string, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync DBusError *error), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (connection, string, error)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_bus_remove_match, void, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusConnection *connection, const char *string, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync DBusError *error), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (connection, string, error)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_message_append_args_valist, dbus_bool_t, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusMessage *message, int first_arg_type, va_list var_args), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (message, first_arg_type, var_args)) \
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync RT_PROXY_STUB(dbus_message_get_args_valist, dbus_bool_t, \
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync (DBusMessage *message, DBusError *error, int first_arg_type, va_list var_args), \
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync (message, error, first_arg_type, var_args)) \
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync RT_PROXY_STUB(dbus_message_get_type, int, \
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync (DBusMessage *message), \
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync (message)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_message_iter_open_container, dbus_bool_t, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusMessageIter *iter, int type, const char *contained_signature, DBusMessageIter *sub), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (iter, type, contained_signature, sub)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_message_iter_close_container, dbus_bool_t, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusMessageIter *iter, DBusMessageIter *sub), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (iter, sub)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_message_iter_append_fixed_array, dbus_bool_t, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusMessageIter *iter, int element_type, const void *value, int n_elements), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (iter, element_type, value, n_elements)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_message_unref, void, (DBusMessage *message), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (message)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_message_new_method_call, DBusMessage*, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (const char *string1, const char *string2, const char *string3, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync const char *string4), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (string1, string2, string3, string4)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_message_iter_init_append, void, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusMessage *message, DBusMessageIter *iter), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (message, iter)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_message_iter_append_basic, dbus_bool_t, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusMessageIter *iter, int val, const void *string), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (iter, val, string)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_connection_send_with_reply_and_block, DBusMessage *, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusConnection *connection, DBusMessage *message, int val, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync DBusError *error), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (connection, message, val, error)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_message_iter_init, dbus_bool_t, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusMessage *message, DBusMessageIter *iter), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (message, iter)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_message_iter_get_arg_type, int, (DBusMessageIter *iter), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (iter)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_message_iter_get_element_type, int, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusMessageIter *iter), (iter)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_message_iter_recurse, void, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusMessageIter *iter1, DBusMessageIter *iter2), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (iter1, iter2)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_message_iter_get_basic, void, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusMessageIter *iter, void *pvoid), (iter, pvoid)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_message_iter_next, dbus_bool_t, (DBusMessageIter *iter), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (iter)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_connection_add_filter, dbus_bool_t, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusConnection *connection, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync DBusHandleMessageFunction function1, void *pvoid, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync DBusFreeFunction function2), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (connection, function1, pvoid, function2)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_connection_remove_filter, void, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusConnection *connection, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync DBusHandleMessageFunction function, void *pvoid), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (connection, function, pvoid)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_connection_read_write_dispatch, dbus_bool_t, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusConnection *connection, int val), (connection, val)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_message_is_signal, dbus_bool_t, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (DBusMessage *message, const char *string1, \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync const char *string2), \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync (message, string1, string2)) \
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync RT_PROXY_STUB(dbus_connection_pop_message, DBusMessage *, \
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync (DBusConnection *connection), (connection)) \
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync RT_PROXY_STUB(dbus_set_error_from_message, dbus_bool_t, \
1003ebeb480229ce94b8f381fbd03412f844b193vboxsync (DBusError *error, DBusMessage *message), (error, message))
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync#ifdef VBOX_DBUS_GENERATE_HEADER
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync# define RT_RUNTIME_LOADER_GENERATE_HEADER
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync# define RT_RUNTIME_LOADER_GENERATE_DECLS
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync# include <iprt/runtime-loader.h>
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync# undef RT_RUNTIME_LOADER_GENERATE_HEADER
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync# undef RT_RUNTIME_LOADER_GENERATE_DECLS
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync#elif defined(VBOX_DBUS_GENERATE_BODY)
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync# define RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync# include <iprt/runtime-loader.h>
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync# undef RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync#else
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync# error This file should only be included to generate stubs for loading the DBus library at runtime
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync#endif
5856c5b39318bc766ccd6f823f1349c80a3dcfaavboxsync
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync#undef RT_RUNTIME_LOADER_LIB_NAME
54c3620994786a33db473956c4e6c3c7d94ab695vboxsync#undef RT_RUNTIME_LOADER_INSERT_SYMBOLS
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync