8
8
<link rel="up" href="ch02.html" title="API Reference">
9
9
<link rel="prev" href="dbus-glib-Specializable-GType-System.html" title="Specializable GType System">
10
10
<link rel="next" href="ch03.html" title="Tools Reference">
11
<meta name="generator" content="GTK-Doc V1.11 (XML mode)">
11
<meta name="generator" content="GTK-Doc V1.15 (XML mode)">
12
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="chapter" href="ch01.html" title="Introduction">
14
<link rel="chapter" href="ch02.html" title="API Reference">
15
<link rel="chapter" href="ch03.html" title="Tools Reference">
17
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
18
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
26
23
<tr><td colspan="5" class="shortcuts">
27
24
<a href="#dbus-glib-DBus-GLib-low-level.synopsis" class="shortcut">Top</a>
29
<a href="#dbus-glib-DBus-GLib-low-level.description" class="shortcut">Description</a>
26
<a href="#dbus-glib-DBus-GLib-low-level.description" class="shortcut">Description</a>
32
29
<div class="refentry" title="DBus GLib low level">
45
42
<div class="refsynopsisdiv" title="Synopsis">
46
43
<a name="dbus-glib-DBus-GLib-low-level.synopsis"></a><h2>Synopsis</h2>
47
<pre class="synopsis">
48
void <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> (<a
49
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
52
void <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> (DBusConnection *connection,
54
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"
55
>GMainContext</a> *context);
56
void <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> (DBusServer *server,
58
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"
59
>GMainContext</a> *context);
44
<pre class="synopsis"><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>,
45
<em class="parameter"><code><span class="type">DBusError</span> *derror</code></em>);
46
<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>,
47
<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>);
48
<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>,
49
<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>);
62
52
<div class="refsect1" title="Description">
63
53
<a name="dbus-glib-DBus-GLib-low-level.description"></a><h2>Description</h2>
65
These functions can be used to access lower level of DBus.</p>
55
These functions can be used to access lower level of DBus.
69
58
<div class="refsect1" title="Details">
70
59
<a name="dbus-glib-DBus-GLib-low-level.details"></a><h2>Details</h2>
71
60
<div class="refsect2" title="dbus_set_g_error ()">
72
61
<a name="dbus-set-g-error"></a><h3>dbus_set_g_error ()</h3>
73
<pre class="programlisting">void dbus_set_g_error (<a
74
href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"
76
DBusError *derror);</pre>
62
<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>,
63
<em class="parameter"><code><span class="type">DBusError</span> *derror</code></em>);</pre>
78
65
Store the information from a DBus method error return into a
79
66
GError. For the normal case of an arbitrary remote process,
95
<div class="informalexample"><pre class="programlisting">const char *msg = error->message;
96
size_t len = strlen(msg);
97
const char *error_name = msg+len+1;</pre></div>
82
<div class="informalexample">
83
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
86
<td class="listing_lines" align="right"><pre>1
89
<td class="listing_code"><pre class="programlisting"><span class="keyword">const</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">msg </span><span class="symbol">=</span><span class="normal"> error</span><span class="symbol">-></span><span class="normal">message</span><span class="symbol">;</span>
90
<span class="usertype">size_t</span><span class="normal"> len </span><span class="symbol">=</span><span class="normal"> </span><span class="function">strlen</span><span class="symbol">(</span><span class="normal">msg</span><span class="symbol">);</span>
91
<span class="keyword">const</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">error_name </span><span class="symbol">=</span><span class="normal"> msg</span><span class="symbol">+</span><span class="normal">len</span><span class="symbol">+</span><span class="number">1</span><span class="symbol">;</span></pre></td>
100
99
<div class="variablelist"><table border="0">
117
116
<div class="refsect2" title="dbus_connection_setup_with_g_main ()">
118
117
<a name="dbus-connection-setup-with-g-main"></a><h3>dbus_connection_setup_with_g_main ()</h3>
119
<pre class="programlisting">void dbus_connection_setup_with_g_main (DBusConnection *connection,
121
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"
122
>GMainContext</a> *context);</pre>
118
<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>,
119
<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>
124
121
Sets the watch and timeout functions of a <span class="type">DBusConnection</span>
125
122
to integrate the connection with the GLib main loop.
126
Pass in <span class="type">NULL</span> for the <a
127
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"
128
><span class="type">GMainContext</span></a> unless you're
123
Pass in <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></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
124
doing something specialized.
132
127
If called twice for the same context, does nothing the second
133
128
time. If called once with context A and once with context B,
134
129
context B replaces context A as the context monitoring the
138
132
<div class="variablelist"><table border="0">
139
133
<col align="left" valign="top">
142
136
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
147
141
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
149
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"
150
><span class="type">GMainContext</span></a> or <span class="type">NULL</span> for default context
142
<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"><span class="type">NULL</span></a> for default context
157
149
<div class="refsect2" title="dbus_server_setup_with_g_main ()">
158
150
<a name="dbus-server-setup-with-g-main"></a><h3>dbus_server_setup_with_g_main ()</h3>
159
<pre class="programlisting">void dbus_server_setup_with_g_main (DBusServer *server,
161
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"
162
>GMainContext</a> *context);</pre>
151
<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>,
152
<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>
164
154
Sets the watch and timeout functions of a <span class="type">DBusServer</span>
165
155
to integrate the server with the GLib main loop.
166
In most cases the context argument should be <span class="type">NULL</span>.
156
In most cases the context argument should be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a>.
169
159
If called twice for the same context, does nothing the second
170
160
time. If called once with context A and once with context B,
171
161
context B replaces context A as the context monitoring the
175
164
<div class="variablelist"><table border="0">
176
165
<col align="left" valign="top">
179
168
<td><p><span class="term"><em class="parameter"><code>server</code></em> :</span></p></td>
184
173
<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td>
186
href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainContext"
187
><span class="type">GMainContext</span></a> or <span class="type">NULL</span> for default
174
<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"><span class="type">NULL</span></a> for default