VirtualBox

source: vbox/trunk/include/VBox/dbus-calls.h@ 89363

Last change on this file since 89363 was 86495, checked in by vboxsync, 4 years ago

VBoxSVC/HostPowerServiceLinux: Use RTThreadPoke on the notification thread if it doesn't seem to respond to dbus_connection_close() after 10 ms. Also, grab an extra reference on the connection so both the thread and the destruction have one to drop, otherwise we'd be in trouble if the other side terminates the connection and the thread exits early. bugref:9841

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.9 KB
Line 
1/** @file
2 * Stubs for dynamically loading libdbus-1 and the symbols which are needed by
3 * VirtualBox.
4 */
5
6/*
7 * Copyright (C) 2008-2020 Oracle Corporation
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * The contents of this file may alternatively be used under the terms
18 * of the Common Development and Distribution License Version 1.0
19 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20 * VirtualBox OSE distribution, in which case the provisions of the
21 * CDDL are applicable instead of those of the GPL.
22 *
23 * You may elect to license modified versions of this file under the
24 * terms and conditions of either the GPL or the CDDL or both.
25 */
26
27/** The file name of the DBus library */
28#define RT_RUNTIME_LOADER_LIB_NAME "libdbus-1.so.3"
29
30/** The name of the loader function */
31#define RT_RUNTIME_LOADER_FUNCTION RTDBusLoadLib
32
33/** The following are the symbols which we need from the DBus library. */
34#define RT_RUNTIME_LOADER_INSERT_SYMBOLS \
35 RT_PROXY_STUB(dbus_error_init, void, (DBusError *error), \
36 (error)) \
37 RT_PROXY_STUB(dbus_error_is_set, dbus_bool_t, (const DBusError *error), \
38 (error)) \
39 RT_PROXY_STUB(dbus_bus_get, DBusConnection *, \
40 (DBusBusType type, DBusError *error), (type, error)) \
41 RT_PROXY_STUB(dbus_bus_get_private, DBusConnection *, \
42 (DBusBusType type, DBusError *error), (type, error)) \
43 RT_PROXY_STUB(dbus_error_free, void, (DBusError *error), \
44 (error)) \
45 RT_PROXY_STUB(dbus_free_string_array, void, (char **str_array), \
46 (str_array)) \
47 RT_PROXY_STUB(dbus_connection_ref, DBusConnection *, (DBusConnection *connection), \
48 (connection)) \
49 RT_PROXY_STUB(dbus_connection_unref, void, (DBusConnection *connection), \
50 (connection)) \
51 RT_PROXY_STUB(dbus_connection_close, void, (DBusConnection *connection), \
52 (connection)) \
53 RT_PROXY_STUB(dbus_connection_send, dbus_bool_t, \
54 (DBusConnection *connection, DBusMessage *message, dbus_uint32_t *serial), \
55 (connection, message, serial)) \
56 RT_PROXY_STUB(dbus_connection_flush, void, (DBusConnection *connection), \
57 (connection)) \
58 RT_PROXY_STUB(dbus_connection_set_exit_on_disconnect, void, \
59 (DBusConnection *connection, dbus_bool_t boolean), \
60 (connection, boolean)) \
61 RT_PROXY_STUB(dbus_bus_name_has_owner, dbus_bool_t, \
62 (DBusConnection *connection, const char *string, DBusError *error), \
63 (connection, string, error)) \
64 RT_PROXY_STUB(dbus_bus_add_match, void, \
65 (DBusConnection *connection, const char *string, \
66 DBusError *error), \
67 (connection, string, error)) \
68 RT_PROXY_STUB(dbus_bus_remove_match, void, \
69 (DBusConnection *connection, const char *string, \
70 DBusError *error), \
71 (connection, string, error)) \
72 RT_PROXY_STUB(dbus_message_append_args_valist, dbus_bool_t, \
73 (DBusMessage *message, int first_arg_type, va_list var_args), \
74 (message, first_arg_type, var_args)) \
75 RT_PROXY_STUB(dbus_message_get_args_valist, dbus_bool_t, \
76 (DBusMessage *message, DBusError *error, int first_arg_type, va_list var_args), \
77 (message, error, first_arg_type, var_args)) \
78 RT_PROXY_STUB(dbus_message_get_type, int, \
79 (DBusMessage *message), \
80 (message)) \
81 RT_PROXY_STUB(dbus_message_iter_open_container, dbus_bool_t, \
82 (DBusMessageIter *iter, int type, const char *contained_signature, DBusMessageIter *sub), \
83 (iter, type, contained_signature, sub)) \
84 RT_PROXY_STUB(dbus_message_iter_close_container, dbus_bool_t, \
85 (DBusMessageIter *iter, DBusMessageIter *sub), \
86 (iter, sub)) \
87 RT_PROXY_STUB(dbus_message_iter_append_fixed_array, dbus_bool_t, \
88 (DBusMessageIter *iter, int element_type, const void *value, int n_elements), \
89 (iter, element_type, value, n_elements)) \
90 RT_PROXY_STUB(dbus_message_unref, void, (DBusMessage *message), \
91 (message)) \
92 RT_PROXY_STUB(dbus_message_new_method_call, DBusMessage*, \
93 (const char *string1, const char *string2, const char *string3, \
94 const char *string4), \
95 (string1, string2, string3, string4)) \
96 RT_PROXY_STUB(dbus_message_iter_init_append, void, \
97 (DBusMessage *message, DBusMessageIter *iter), \
98 (message, iter)) \
99 RT_PROXY_STUB(dbus_message_iter_append_basic, dbus_bool_t, \
100 (DBusMessageIter *iter, int val, const void *string), \
101 (iter, val, string)) \
102 RT_PROXY_STUB(dbus_connection_send_with_reply_and_block, DBusMessage *, \
103 (DBusConnection *connection, DBusMessage *message, int val, \
104 DBusError *error), \
105 (connection, message, val, error)) \
106 RT_PROXY_STUB(dbus_message_iter_init, dbus_bool_t, \
107 (DBusMessage *message, DBusMessageIter *iter), \
108 (message, iter)) \
109 RT_PROXY_STUB(dbus_message_iter_get_arg_type, int, (DBusMessageIter *iter), \
110 (iter)) \
111 RT_PROXY_STUB(dbus_message_iter_get_element_type, int, \
112 (DBusMessageIter *iter), (iter)) \
113 RT_PROXY_STUB(dbus_message_iter_recurse, void, \
114 (DBusMessageIter *iter1, DBusMessageIter *iter2), \
115 (iter1, iter2)) \
116 RT_PROXY_STUB(dbus_message_iter_get_basic, void, \
117 (DBusMessageIter *iter, void *pvoid), (iter, pvoid)) \
118 RT_PROXY_STUB(dbus_message_iter_next, dbus_bool_t, (DBusMessageIter *iter), \
119 (iter)) \
120 RT_PROXY_STUB(dbus_connection_add_filter, dbus_bool_t, \
121 (DBusConnection *connection, \
122 DBusHandleMessageFunction function1, void *pvoid, \
123 DBusFreeFunction function2), \
124 (connection, function1, pvoid, function2)) \
125 RT_PROXY_STUB(dbus_connection_remove_filter, void, \
126 (DBusConnection *connection, \
127 DBusHandleMessageFunction function, void *pvoid), \
128 (connection, function, pvoid)) \
129 RT_PROXY_STUB(dbus_connection_read_write, dbus_bool_t, \
130 (DBusConnection *connection, int val), (connection, val)) \
131 RT_PROXY_STUB(dbus_connection_read_write_dispatch, dbus_bool_t, \
132 (DBusConnection *connection, int val), (connection, val)) \
133 RT_PROXY_STUB(dbus_message_is_signal, dbus_bool_t, \
134 (DBusMessage *message, const char *string1, \
135 const char *string2), \
136 (message, string1, string2)) \
137 RT_PROXY_STUB(dbus_connection_pop_message, DBusMessage *, \
138 (DBusConnection *connection), (connection)) \
139 RT_PROXY_STUB(dbus_set_error_from_message, dbus_bool_t, \
140 (DBusError *error, DBusMessage *message), (error, message))
141
142#ifdef VBOX_DBUS_GENERATE_HEADER
143# define RT_RUNTIME_LOADER_GENERATE_HEADER
144# define RT_RUNTIME_LOADER_GENERATE_DECLS
145# include <iprt/runtime-loader.h>
146# undef RT_RUNTIME_LOADER_GENERATE_HEADER
147# undef RT_RUNTIME_LOADER_GENERATE_DECLS
148
149#elif defined(VBOX_DBUS_GENERATE_BODY)
150# define RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
151# include <iprt/runtime-loader.h>
152# undef RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
153
154#else
155# error This file should only be included to generate stubs for loading the DBus library at runtime
156#endif
157
158#undef RT_RUNTIME_LOADER_LIB_NAME
159#undef RT_RUNTIME_LOADER_INSERT_SYMBOLS
160
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