~ubuntu-branches/ubuntu/quantal/dbus-glib/quantal

« back to all changes in this revision

Viewing changes to doc/reference/html/dbus-glib-DBus-GLib-low-level.html

  • Committer: Package Import Robot
  • Author(s): Simon McVittie
  • Date: 2012-06-25 18:25:27 UTC
  • mfrom: (2.1.17 sid)
  • Revision ID: package-import@ubuntu.com-20120625182527-4427g7sb4bietikt
Tags: 0.100-1
* Update dbus-daemon introspection (from dbus 1.6.2)
* New upstream version
  - fixes the build with -Werror=format-security (patch from Ubuntu)
* Include /usr/share/dpkg/default.mk for recommended build flags

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
 
<html>
3
 
<head>
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">
13
 
</head>
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">
16
 
<tr valign="middle">
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>
22
 
</tr>
23
 
<tr><td colspan="5" class="shortcuts">
24
 
<a href="#dbus-glib-DBus-GLib-low-level.synopsis" class="shortcut">Top</a>
25
 
                   | 
26
 
                  <a href="#dbus-glib-DBus-GLib-low-level.description" class="shortcut">Description</a>
27
 
</td></tr>
28
 
</table>
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>
32
 
<td valign="top">
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>
35
 
</td>
36
 
<td valign="top" align="right"></td>
37
 
</tr></table></div>
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
41
 
</div>
42
 
<div class="refsynopsisdiv">
43
 
<a name="dbus-glib-DBus-GLib-low-level.synopsis"></a><h2>Synopsis</h2>
44
 
<pre class="synopsis">
45
 
#include &lt;dbus/dbus-glib-lowlevel.h&gt;
46
 
 
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>
56
 
</pre>
57
 
</div>
58
 
<div class="refsect1">
59
 
<a name="dbus-glib-DBus-GLib-low-level.description"></a><h2>Description</h2>
60
 
<p>
61
 
These functions can be used to access lower level of DBus.
62
 
</p>
63
 
</div>
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>
70
 
<p>
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:
79
 
</p>
80
 
<p>
81
 
&lt;human readable string&gt;&lt;null&gt;&lt;error name&gt;&lt;null&gt;
82
 
</p>
83
 
<p>
84
 
You can use the following code to retrieve both values:
85
 
</p>
86
 
<p>
87
 
</p>
88
 
<div class="informalexample">
89
 
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
90
 
    <tbody>
91
 
      <tr>
92
 
        <td class="listing_lines" align="right"><pre>1
93
 
2
94
 
3</pre></td>
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">-&gt;</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>
98
 
      </tr>
99
 
    </tbody>
100
 
  </table>
101
 
</div>
102
 
 
103
 
<p>
104
 
</p>
105
 
<div class="variablelist"><table border="0">
106
 
<col align="left" valign="top">
107
 
<tbody>
108
 
<tr>
109
 
<td><p><span class="term"><em class="parameter"><code>gerror</code></em> :</span></p></td>
110
 
<td>an error</td>
111
 
</tr>
112
 
<tr>
113
 
<td><p><span class="term"><em class="parameter"><code>derror</code></em> :</span></p></td>
114
 
<td>a <span class="type">DBusError</span>
115
 
</td>
116
 
</tr>
117
 
</tbody>
118
 
</table></div>
119
 
</div>
120
 
<hr>
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>
125
 
<p>
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.
130
 
</p>
131
 
<p>
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
135
 
connection.
136
 
</p>
137
 
<div class="variablelist"><table border="0">
138
 
<col align="left" valign="top">
139
 
<tbody>
140
 
<tr>
141
 
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
142
 
<td>the connection</td>
143
 
</tr>
144
 
<tr>
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>
147
 
</tr>
148
 
</tbody>
149
 
</table></div>
150
 
</div>
151
 
<hr>
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>
155
 
<p>
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.
160
 
</p>
161
 
<div class="variablelist"><table border="0">
162
 
<col align="left" valign="top">
163
 
<tbody>
164
 
<tr>
165
 
<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td>
166
 
<td>a <span class="type">DBusConnection</span>
167
 
</td>
168
 
</tr>
169
 
<tr>
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>
172
 
</tr>
173
 
</tbody>
174
 
</table></div>
175
 
</div>
176
 
<hr>
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>
181
 
<p>
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>.
185
 
</p>
186
 
<p>
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
190
 
connection.
191
 
</p>
192
 
<div class="variablelist"><table border="0">
193
 
<col align="left" valign="top">
194
 
<tbody>
195
 
<tr>
196
 
<td><p><span class="term"><em class="parameter"><code>server</code></em> :</span></p></td>
197
 
<td>the server</td>
198
 
</tr>
199
 
<tr>
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>
202
 
</tr>
203
 
</tbody>
204
 
</table></div>
205
 
</div>
206
 
<hr>
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 ())
210
 
</pre>
211
 
<p>
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.
215
 
</p>
216
 
<div class="variablelist"><table border="0">
217
 
<col align="left" valign="top">
218
 
<tbody><tr>
219
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
220
 
<td>the GLib type</td>
221
 
</tr></tbody>
222
 
</table></div>
223
 
</div>
224
 
<hr>
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 ())
228
 
</pre>
229
 
<p>
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.
233
 
</p>
234
 
<div class="variablelist"><table border="0">
235
 
<col align="left" valign="top">
236
 
<tbody><tr>
237
 
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
238
 
<td>the GLib type</td>
239
 
</tr></tbody>
240
 
</table></div>
241
 
</div>
242
 
</div>
243
 
</div>
244
 
<div class="footer">
245
 
<hr>
246
 
          Generated by GTK-Doc V1.18</div>
247
 
</body>
248
 
</html>
 
 
b'\\ No newline at end of file'