VirtualBox

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

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

Runtime: generalise the code used to load libdbus at runtime to a template for loading shared libraries

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.3 KB
Line 
1/** @file
2 *
3 * Stubs for dynamically loading libdbus-1 and the 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/** The file name of the DBus library */
33#define RT_RUNTIME_LOADER_LIB_NAME "libdbus-1.so.3"
34
35/** The name of the loader function */
36#define RT_RUNTIME_LOADER_FUNCTION RTDBusLoadLib
37
38/** The following are the symbols which we need from the DBus library. */
39#define RT_RUNTIME_LOADER_INSERT_SYMBOLS \
40 RT_PROXY_STUB(dbus_error_init, void, (DBusError *error), \
41 (error)) \
42 RT_PROXY_STUB(dbus_error_is_set, dbus_bool_t, (const DBusError *error), \
43 (error)) \
44 RT_PROXY_STUB(dbus_bus_get, DBusConnection *, \
45 (DBusBusType type, DBusError *error), (type, error)) \
46 RT_PROXY_STUB(dbus_bus_get_private, DBusConnection *, \
47 (DBusBusType type, DBusError *error), (type, error)) \
48 RT_PROXY_STUB(dbus_error_free, void, (DBusError *error), \
49 (error)) \
50 RT_PROXY_STUB(dbus_connection_unref, void, (DBusConnection *connection), \
51 (connection)) \
52 RT_PROXY_STUB(dbus_connection_close, void, (DBusConnection *connection), \
53 (connection)) \
54 RT_PROXY_STUB(dbus_connection_send, dbus_bool_t, \
55 (DBusConnection *connection, DBusMessage *message, dbus_uint32_t *serial), \
56 (connection, message, serial)) \
57 RT_PROXY_STUB(dbus_connection_flush, void, (DBusConnection *connection), \
58 (connection)) \
59 RT_PROXY_STUB(dbus_connection_set_exit_on_disconnect, void, \
60 (DBusConnection *connection, dbus_bool_t boolean), \
61 (connection, boolean)) \
62 RT_PROXY_STUB(dbus_bus_name_has_owner, dbus_bool_t, \
63 (DBusConnection *connection, const char *string, DBusError *error), \
64 (connection, string, error)) \
65 RT_PROXY_STUB(dbus_bus_add_match, void, \
66 (DBusConnection *connection, const char *string, \
67 DBusError *error), \
68 (connection, string, error)) \
69 RT_PROXY_STUB(dbus_bus_remove_match, void, \
70 (DBusConnection *connection, const char *string, \
71 DBusError *error), \
72 (connection, string, error)) \
73 RT_PROXY_STUB(dbus_message_append_args_valist, dbus_bool_t, \
74 (DBusMessage *message, int first_arg_type, va_list var_args), \
75 (message, first_arg_type, var_args)) \
76 RT_PROXY_STUB(dbus_message_iter_open_container, dbus_bool_t, \
77 (DBusMessageIter *iter, int type, const char *contained_signature, DBusMessageIter *sub), \
78 (iter, type, contained_signature, sub)) \
79 RT_PROXY_STUB(dbus_message_iter_close_container, dbus_bool_t, \
80 (DBusMessageIter *iter, DBusMessageIter *sub), \
81 (iter, sub)) \
82 RT_PROXY_STUB(dbus_message_iter_append_fixed_array, dbus_bool_t, \
83 (DBusMessageIter *iter, int element_type, const void *value, int n_elements), \
84 (iter, element_type, value, n_elements)) \
85 RT_PROXY_STUB(dbus_message_unref, void, (DBusMessage *message), \
86 (message)) \
87 RT_PROXY_STUB(dbus_message_new_method_call, DBusMessage*, \
88 (const char *string1, const char *string2, const char *string3, \
89 const char *string4), \
90 (string1, string2, string3, string4)) \
91 RT_PROXY_STUB(dbus_message_iter_init_append, void, \
92 (DBusMessage *message, DBusMessageIter *iter), \
93 (message, iter)) \
94 RT_PROXY_STUB(dbus_message_iter_append_basic, dbus_bool_t, \
95 (DBusMessageIter *iter, int val, const void *string), \
96 (iter, val, string)) \
97 RT_PROXY_STUB(dbus_connection_send_with_reply_and_block, DBusMessage *, \
98 (DBusConnection *connection, DBusMessage *message, int val, \
99 DBusError *error), \
100 (connection, message, val, error)) \
101 RT_PROXY_STUB(dbus_message_iter_init, dbus_bool_t, \
102 (DBusMessage *message, DBusMessageIter *iter), \
103 (message, iter)) \
104 RT_PROXY_STUB(dbus_message_iter_get_arg_type, int, (DBusMessageIter *iter), \
105 (iter)) \
106 RT_PROXY_STUB(dbus_message_iter_get_element_type, int, \
107 (DBusMessageIter *iter), (iter)) \
108 RT_PROXY_STUB(dbus_message_iter_recurse, void, \
109 (DBusMessageIter *iter1, DBusMessageIter *iter2), \
110 (iter1, iter2)) \
111 RT_PROXY_STUB(dbus_message_iter_get_basic, void, \
112 (DBusMessageIter *iter, void *pvoid), (iter, pvoid)) \
113 RT_PROXY_STUB(dbus_message_iter_next, dbus_bool_t, (DBusMessageIter *iter), \
114 (iter)) \
115 RT_PROXY_STUB(dbus_connection_add_filter, dbus_bool_t, \
116 (DBusConnection *connection, \
117 DBusHandleMessageFunction function1, void *pvoid, \
118 DBusFreeFunction function2), \
119 (connection, function1, pvoid, function2)) \
120 RT_PROXY_STUB(dbus_connection_remove_filter, void, \
121 (DBusConnection *connection, \
122 DBusHandleMessageFunction function, void *pvoid), \
123 (connection, function, pvoid)) \
124 RT_PROXY_STUB(dbus_connection_read_write_dispatch, dbus_bool_t, \
125 (DBusConnection *connection, int val), (connection, val)) \
126 RT_PROXY_STUB(dbus_message_is_signal, dbus_bool_t, \
127 (DBusMessage *message, const char *string1, \
128 const char *string2), \
129 (message, string1, string2)) \
130 RT_PROXY_STUB(dbus_connection_pop_message, DBusMessage *, \
131 (DBusConnection *connection), (connection))
132
133#ifdef VBOX_DBUS_GENERATE_HEADER
134# define RT_RUNTIME_LOADER_GENERATE_HEADER
135# define RT_RUNTIME_LOADER_GENERATE_DECLS
136# include <iprt/runtime-loader.h>
137# undef RT_RUNTIME_LOADER_GENERATE_HEADER
138# undef RT_RUNTIME_LOADER_GENERATE_DECLS
139#elif defined (VBOX_DBUS_GENERATE_BODY)
140# define RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
141# include <iprt/runtime-loader.h>
142# undef RT_RUNTIME_LOADER_GENERATE_BODY_STUBS
143#else
144# error This file should only be included to generate stubs for loading the \
145DBus library at runtime
146#endif
147
148#undef RT_RUNTIME_LOADER_LIB_NAME
149#undef RT_RUNTIME_LOADER_INSERT_SYMBOLS
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