1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5
<title>DBus GLib low level</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7
<link rel="home" href="index.html" title="D-Bus GLib bindings - Reference Manual">
8
<link rel="up" href="ch02.html" title="API Reference">
9
<link rel="prev" href="dbus-glib-Specializable-GType-System.html" title="Specializable GType System">
10
<link rel="next" href="ch03.html" title="Tools Reference">
11
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17
<td><a accesskey="p" href="dbus-glib-Specializable-GType-System.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20
<th width="100%" align="center">D-Bus GLib bindings - Reference Manual</th>
21
<td><a accesskey="n" href="ch03.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23
<tr><td colspan="5" class="shortcuts">
24
<a href="#dbus-glib-DBus-GLib-low-level.synopsis" class="shortcut">Top</a>
26
<a href="#dbus-glib-DBus-GLib-low-level.description" class="shortcut">Description</a>
29
<div class="refentry">
30
<a name="dbus-glib-DBus-GLib-low-level"></a><div class="titlepage"></div>
31
<div class="refnamediv"><table width="100%"><tr>
33
<h2><span class="refentrytitle"><a name="dbus-glib-DBus-GLib-low-level.top_of_page"></a>DBus GLib low level</span></h2>
34
<p>DBus GLib low level — DBus lower level functions</p>
36
<td valign="top" align="right"></td>
38
<div class="refsect1">
39
<a name="dbus-glib-DBus-GLib-low-level.stability-level"></a><h2>Stability Level</h2>
40
Unstable, unless otherwise indicated
42
<div class="refsynopsisdiv">
43
<a name="dbus-glib-DBus-GLib-low-level.synopsis"></a><h2>Synopsis</h2>
44
<pre class="synopsis">
45
#include <dbus/dbus-glib-lowlevel.h>
47
<span class="returnvalue">void</span> <a class="link" href="dbus-glib-DBus-GLib-low-level.html#dbus-set-g-error" title="dbus_set_g_error ()">dbus_set_g_error</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **gerror</code></em>,
48
<em class="parameter"><code><span class="type">DBusError</span> *derror</code></em>);
49
<span class="returnvalue">void</span> <a class="link" href="dbus-glib-DBus-GLib-low-level.html#dbus-connection-setup-with-g-main" title="dbus_connection_setup_with_g_main ()">dbus_connection_setup_with_g_main</a> (<em class="parameter"><code><span class="type">DBusConnection</span> *connection</code></em>,
50
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> *context</code></em>);
51
<a class="link" href="dbus-glib-DBusGConnection.html#DBusGConnection" title="DBusGConnection"><span class="returnvalue">DBusGConnection</span></a> * <a class="link" href="dbus-glib-DBus-GLib-low-level.html#dbus-connection-get-g-connection" title="dbus_connection_get_g_connection ()">dbus_connection_get_g_connection</a> (<em class="parameter"><code><span class="type">DBusConnection</span> *connection</code></em>);
52
<span class="returnvalue">void</span> <a class="link" href="dbus-glib-DBus-GLib-low-level.html#dbus-server-setup-with-g-main" title="dbus_server_setup_with_g_main ()">dbus_server_setup_with_g_main</a> (<em class="parameter"><code><span class="type">DBusServer</span> *server</code></em>,
53
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> *context</code></em>);
54
#define <a class="link" href="dbus-glib-DBus-GLib-low-level.html#DBUS-TYPE-CONNECTION:CAPS" title="DBUS_TYPE_CONNECTION">DBUS_TYPE_CONNECTION</a>
55
#define <a class="link" href="dbus-glib-DBus-GLib-low-level.html#DBUS-TYPE-MESSAGE:CAPS" title="DBUS_TYPE_MESSAGE">DBUS_TYPE_MESSAGE</a>
58
<div class="refsect1">
59
<a name="dbus-glib-DBus-GLib-low-level.description"></a><h2>Description</h2>
61
These functions can be used to access lower level of DBus.
64
<div class="refsect1">
65
<a name="dbus-glib-DBus-GLib-low-level.details"></a><h2>Details</h2>
66
<div class="refsect2">
67
<a name="dbus-set-g-error"></a><h3>dbus_set_g_error ()</h3>
68
<pre class="programlisting"><span class="returnvalue">void</span> dbus_set_g_error (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **gerror</code></em>,
69
<em class="parameter"><code><span class="type">DBusError</span> *derror</code></em>);</pre>
71
Store the information from a DBus method error return into a
72
GError. For the normal case of an arbitrary remote process,
73
the error code will be DBUS_GERROR_REMOTE_EXCEPTION. Now,
74
DBus errors have two components; a message and a "name".
75
The former is an arbitrary (normally American English) string.
76
The second is a string like com.example.FooFailure which
77
programs can use as a conditional source. Because a GError
78
only has one string, we use a hack to encode both values:
81
<human readable string><null><error name><null>
84
You can use the following code to retrieve both values:
88
<div class="informalexample">
89
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
92
<td class="listing_lines" align="right"><pre>1
95
<td class="listing_code"><pre class="programlisting"><span class="gtkdoc kwb">const char</span> <span class="gtkdoc opt">*</span>msg <span class="gtkdoc opt">=</span> error<span class="gtkdoc opt">-></span>message<span class="gtkdoc opt">;</span>
96
<span class="gtkdoc kwb">size_t</span> len <span class="gtkdoc opt">=</span> <span class="function">strlen</span><span class="gtkdoc opt">(</span>msg<span class="gtkdoc opt">);</span>
97
<span class="gtkdoc kwb">const char</span> <span class="gtkdoc opt">*</span>error_name <span class="gtkdoc opt">=</span> msg<span class="gtkdoc opt">+</span>len<span class="gtkdoc opt">+</span><span class="number">1</span><span class="gtkdoc opt">;</span></pre></td>
105
<div class="variablelist"><table border="0">
106
<col align="left" valign="top">
109
<td><p><span class="term"><em class="parameter"><code>gerror</code></em> :</span></p></td>
113
<td><p><span class="term"><em class="parameter"><code>derror</code></em> :</span></p></td>
114
<td>a <span class="type">DBusError</span>
121
<div class="refsect2">
122
<a name="dbus-connection-setup-with-g-main"></a><h3>dbus_connection_setup_with_g_main ()</h3>
123
<pre class="programlisting"><span class="returnvalue">void</span> dbus_connection_setup_with_g_main (<em class="parameter"><code><span class="type">DBusConnection</span> *connection</code></em>,
124
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> *context</code></em>);</pre>
126
Sets the watch and timeout functions of a <span class="type">DBusConnection</span>
127
to integrate the connection with the GLib main loop.
128
Pass in <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for the <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> unless you're
129
doing something specialized.
132
If called twice for the same context, does nothing the second
133
time. If called once with context A and once with context B,
134
context B replaces context A as the context monitoring the
137
<div class="variablelist"><table border="0">
138
<col align="left" valign="top">
141
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
142
<td>the connection</td>
145
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
146
<td>the <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for default context</td>
152
<div class="refsect2">
153
<a name="dbus-connection-get-g-connection"></a><h3>dbus_connection_get_g_connection ()</h3>
154
<pre class="programlisting"><a class="link" href="dbus-glib-DBusGConnection.html#DBusGConnection" title="DBusGConnection"><span class="returnvalue">DBusGConnection</span></a> * dbus_connection_get_g_connection (<em class="parameter"><code><span class="type">DBusConnection</span> *connection</code></em>);</pre>
156
Get the <a class="link" href="dbus-glib-DBusGConnection.html#DBusGConnection" title="DBusGConnection"><span class="type">DBusGConnection</span></a> corresponding to this <span class="type">DBusConnection</span>. This only
157
makes sense if the <span class="type">DBusConnection</span> was originally a <a class="link" href="dbus-glib-DBusGConnection.html#DBusGConnection" title="DBusGConnection"><span class="type">DBusGConnection</span></a> that was
158
registered with the GLib main loop. The return value does not have its
159
refcount incremented.
161
<div class="variablelist"><table border="0">
162
<col align="left" valign="top">
165
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
166
<td>a <span class="type">DBusConnection</span>
170
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
171
<td><a class="link" href="dbus-glib-DBusGConnection.html#DBusGConnection" title="DBusGConnection"><span class="type">DBusGConnection</span></a></td>
177
<div class="refsect2">
178
<a name="dbus-server-setup-with-g-main"></a><h3>dbus_server_setup_with_g_main ()</h3>
179
<pre class="programlisting"><span class="returnvalue">void</span> dbus_server_setup_with_g_main (<em class="parameter"><code><span class="type">DBusServer</span> *server</code></em>,
180
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> *context</code></em>);</pre>
182
Sets the watch and timeout functions of a <span class="type">DBusServer</span>
183
to integrate the server with the GLib main loop.
184
In most cases the context argument should be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.
187
If called twice for the same context, does nothing the second
188
time. If called once with context A and once with context B,
189
context B replaces context A as the context monitoring the
192
<div class="variablelist"><table border="0">
193
<col align="left" valign="top">
196
<td><p><span class="term"><em class="parameter"><code>server</code></em> :</span></p></td>
200
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
201
<td>the <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"><span class="type">GMainContext</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for default</td>
207
<div class="refsect2">
208
<a name="DBUS-TYPE-CONNECTION:CAPS"></a><h3>DBUS_TYPE_CONNECTION</h3>
209
<pre class="programlisting">#define DBUS_TYPE_CONNECTION (dbus_connection_get_g_type ())
212
Expands to a function call returning a boxed <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> representing a
213
<span class="type">DBusConnection</span> pointer from libdbus. Not to be confused with
214
<a class="link" href="dbus-glib-DBusGConnection.html#DBUS-TYPE-G-CONNECTION:CAPS" title="DBUS_TYPE_G_CONNECTION"><code class="literal">DBUS_TYPE_G_CONNECTION</code></a>, which you should usually use instead.
216
<div class="variablelist"><table border="0">
217
<col align="left" valign="top">
219
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
220
<td>the GLib type</td>
225
<div class="refsect2">
226
<a name="DBUS-TYPE-MESSAGE:CAPS"></a><h3>DBUS_TYPE_MESSAGE</h3>
227
<pre class="programlisting">#define DBUS_TYPE_MESSAGE (dbus_message_get_g_type ())
230
Expands to a function call returning a boxed <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> representing a
231
<span class="type">DBusMessage</span> pointer from libdbus. Not to be confused with
232
<a class="link" href="dbus-glib-DBusGMessage.html#DBUS-TYPE-G-MESSAGE:CAPS" title="DBUS_TYPE_G_MESSAGE"><code class="literal">DBUS_TYPE_G_MESSAGE</code></a>, which you should usually use instead.
234
<div class="variablelist"><table border="0">
235
<col align="left" valign="top">
237
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
238
<td>the GLib type</td>
246
Generated by GTK-Doc V1.18</div>
b'\\ No newline at end of file'