diff options
Diffstat (limited to 'doc/reference/html/dbus-glib-dbus-glib-lowlevel.html')
-rw-r--r-- | doc/reference/html/dbus-glib-dbus-glib-lowlevel.html | 436 |
1 files changed, 436 insertions, 0 deletions
diff --git a/doc/reference/html/dbus-glib-dbus-glib-lowlevel.html b/doc/reference/html/dbus-glib-dbus-glib-lowlevel.html new file mode 100644 index 0000000..6bfc7fa --- /dev/null +++ b/doc/reference/html/dbus-glib-dbus-glib-lowlevel.html @@ -0,0 +1,436 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<title>DBus GLib low level</title> +<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> +<link rel="home" href="index.html" title="D-Bus GLib bindings - Reference Manual"> +<link rel="up" href="ch02.html" title="API Reference"> +<link rel="prev" href="dbus-glib-dbus-gtype-specialized.html" title="Specializable GType System"> +<link rel="next" href="ch03.html" title="Tools Reference"> +<meta name="generator" content="GTK-Doc V1.18 (XML mode)"> +<link rel="stylesheet" href="style.css" type="text/css"> +</head> +<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> +<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"> +<tr valign="middle"> +<td><a accesskey="p" href="dbus-glib-dbus-gtype-specialized.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td> +<td><a accesskey="u" href="ch02.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td> +<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td> +<th width="100%" align="center">D-Bus GLib bindings - Reference Manual</th> +<td><a accesskey="n" href="ch03.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td> +</tr> +<tr><td colspan="5" class="shortcuts"> +<a href="#dbus-glib-dbus-glib-lowlevel.synopsis" class="shortcut">Top</a> + | + <a href="#dbus-glib-dbus-glib-lowlevel.description" class="shortcut">Description</a> +</td></tr> +</table> +<div class="refentry"> +<a name="dbus-glib-dbus-glib-lowlevel"></a><div class="titlepage"></div> +<div class="refnamediv"><table width="100%"><tr> +<td valign="top"> +<h2><span class="refentrytitle"><a name="dbus-glib-dbus-glib-lowlevel.top_of_page"></a>DBus GLib low level</span></h2> +<p>DBus GLib low level — DBus lower level functions</p> +</td> +<td valign="top" align="right"></td> +</tr></table></div> +<div class="refsect1"> +<a name="dbus-glib-dbus-glib-lowlevel.stability-level"></a><h2>Stability Level</h2> +Unstable, unless otherwise indicated +</div> +<div class="refsynopsisdiv"> +<a name="dbus-glib-dbus-glib-lowlevel.synopsis"></a><h2>Synopsis</h2> +<pre class="synopsis">#define <a class="link" href="dbus-glib-dbus-glib-lowlevel.html#DBUS-TYPE-CONNECTION:CAPS" title="DBUS_TYPE_CONNECTION">DBUS_TYPE_CONNECTION</a> +#define <a class="link" href="dbus-glib-dbus-glib-lowlevel.html#DBUS-TYPE-MESSAGE:CAPS" title="DBUS_TYPE_MESSAGE">DBUS_TYPE_MESSAGE</a> +<a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGConnection.html#DBusGConnection"><span class="returnvalue">DBusGConnection</span></a> * <a class="link" href="dbus-glib-dbus-glib-lowlevel.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>); +<a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="returnvalue">GType</span></a> <a class="link" href="dbus-glib-dbus-glib-lowlevel.html#dbus-connection-get-g-type" title="dbus_connection_get_g_type ()">dbus_connection_get_g_type</a> (<em class="parameter"><code><span class="type">void</span></code></em>); +<span class="returnvalue">void</span> <a class="link" href="dbus-glib-dbus-glib-lowlevel.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>, + <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>); +<span class="returnvalue">DBusConnection</span> * <a class="link" href="dbus-glib-dbus-glib-lowlevel.html#dbus-g-connection-get-connection" title="dbus_g_connection_get_connection ()">dbus_g_connection_get_connection</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGConnection.html#DBusGConnection"><span class="type">DBusGConnection</span></a> *gconnection</code></em>); +<span class="returnvalue">DBusMessage</span> * <a class="link" href="dbus-glib-dbus-glib-lowlevel.html#dbus-g-message-get-message" title="dbus_g_message_get_message ()">dbus_g_message_get_message</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGMessage.html#DBusGMessage"><span class="type">DBusGMessage</span></a> *gmessage</code></em>); +<span class="returnvalue">DBusMessage</span> * <a class="link" href="dbus-glib-dbus-glib-lowlevel.html#dbus-g-method-get-reply" title="dbus_g_method_get_reply ()">dbus_g_method_get_reply</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGMethod.html#DBusGMethodInvocation"><span class="type">DBusGMethodInvocation</span></a> *context</code></em>); +<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="dbus-glib-dbus-glib-lowlevel.html#dbus-g-method-get-sender" title="dbus_g_method_get_sender ()">dbus_g_method_get_sender</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGMethod.html#DBusGMethodInvocation"><span class="type">DBusGMethodInvocation</span></a> *context</code></em>); +<span class="returnvalue">void</span> <a class="link" href="dbus-glib-dbus-glib-lowlevel.html#dbus-g-method-send-reply" title="dbus_g_method_send_reply ()">dbus_g_method_send_reply</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGMethod.html#DBusGMethodInvocation"><span class="type">DBusGMethodInvocation</span></a> *context</code></em>, + <em class="parameter"><code><span class="type">DBusMessage</span> *reply</code></em>); +<span class="returnvalue">void</span> <a class="link" href="dbus-glib-dbus-glib-lowlevel.html#dbus-g-proxy-send" title="dbus_g_proxy_send ()">dbus_g_proxy_send</a> (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGProxy.html#DBusGProxy"><span class="type">DBusGProxy</span></a> *proxy</code></em>, + <em class="parameter"><code><span class="type">DBusMessage</span> *message</code></em>, + <em class="parameter"><code><span class="type">dbus_uint32_t</span> *client_serial</code></em>); +<a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="returnvalue">GType</span></a> <a class="link" href="dbus-glib-dbus-glib-lowlevel.html#dbus-message-get-g-type" title="dbus_message_get_g_type ()">dbus_message_get_g_type</a> (<em class="parameter"><code><span class="type">void</span></code></em>); +<span class="returnvalue">void</span> <a class="link" href="dbus-glib-dbus-glib-lowlevel.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>, + <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>); +<span class="returnvalue">void</span> <a class="link" href="dbus-glib-dbus-glib-lowlevel.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>, + <em class="parameter"><code><span class="type">DBusError</span> *derror</code></em>); +</pre> +</div> +<div class="refsect1"> +<a name="dbus-glib-dbus-glib-lowlevel.description"></a><h2>Description</h2> +<p> +These functions can be used to access lower level of DBus. +</p> +</div> +<div class="refsect1"> +<a name="dbus-glib-dbus-glib-lowlevel.details"></a><h2>Details</h2> +<div class="refsect2"> +<a name="DBUS-TYPE-CONNECTION:CAPS"></a><h3>DBUS_TYPE_CONNECTION</h3> +<pre class="programlisting">#define DBUS_TYPE_CONNECTION (dbus_connection_get_g_type ()) +</pre> +<p> +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 +<span class="type">DBusConnection</span> pointer from libdbus. Not to be confused with +<a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGConnection.html#DBUS-TYPE-G-CONNECTION:CAPS"><code class="literal">DBUS_TYPE_G_CONNECTION</code></a>, which you should usually use instead. +</p> +<div class="variablelist"><table border="0"> +<col align="left" valign="top"> +<tbody><tr> +<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> +<td>the GLib type</td> +</tr></tbody> +</table></div> +</div> +<hr> +<div class="refsect2"> +<a name="DBUS-TYPE-MESSAGE:CAPS"></a><h3>DBUS_TYPE_MESSAGE</h3> +<pre class="programlisting">#define DBUS_TYPE_MESSAGE (dbus_message_get_g_type ()) +</pre> +<p> +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 +<span class="type">DBusMessage</span> pointer from libdbus. Not to be confused with +<a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGMessage.html#DBUS-TYPE-G-MESSAGE:CAPS"><code class="literal">DBUS_TYPE_G_MESSAGE</code></a>, which you should usually use instead. +</p> +<div class="variablelist"><table border="0"> +<col align="left" valign="top"> +<tbody><tr> +<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> +<td>the GLib type</td> +</tr></tbody> +</table></div> +</div> +<hr> +<div class="refsect2"> +<a name="dbus-connection-get-g-connection"></a><h3>dbus_connection_get_g_connection ()</h3> +<pre class="programlisting"><a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGConnection.html#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> +<p> +Get the <a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGConnection.html#DBusGConnection"><span class="type">DBusGConnection</span></a> corresponding to this <span class="type">DBusConnection</span>. This only +makes sense if the <span class="type">DBusConnection</span> was originally a <a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGConnection.html#DBusGConnection"><span class="type">DBusGConnection</span></a> that was +registered with the GLib main loop. The return value does not have its +refcount incremented. +</p> +<div class="variablelist"><table border="0"> +<col align="left" valign="top"> +<tbody> +<tr> +<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td> +<td>a <span class="type">DBusConnection</span> +</td> +</tr> +<tr> +<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> +<td><a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGConnection.html#DBusGConnection"><span class="type">DBusGConnection</span></a></td> +</tr> +</tbody> +</table></div> +</div> +<hr> +<div class="refsect2"> +<a name="dbus-connection-get-g-type"></a><h3>dbus_connection_get_g_type ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="returnvalue">GType</span></a> dbus_connection_get_g_type (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> +<p> +</p> +</div> +<hr> +<div class="refsect2"> +<a name="dbus-connection-setup-with-g-main"></a><h3>dbus_connection_setup_with_g_main ()</h3> +<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>, + <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> +<p> +Sets the watch and timeout functions of a <span class="type">DBusConnection</span> +to integrate the connection with the GLib main loop. +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 +doing something specialized. +</p> +<p> +If called twice for the same context, does nothing the second +time. If called once with context A and once with context B, +context B replaces context A as the context monitoring the +connection. +</p> +<div class="variablelist"><table border="0"> +<col align="left" valign="top"> +<tbody> +<tr> +<td><p><span class="term"><em class="parameter"><code>connection</code></em> :</span></p></td> +<td>the connection</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td> +<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> +</tr> +</tbody> +</table></div> +</div> +<hr> +<div class="refsect2"> +<a name="dbus-g-connection-get-connection"></a><h3>dbus_g_connection_get_connection ()</h3> +<pre class="programlisting"><span class="returnvalue">DBusConnection</span> * dbus_g_connection_get_connection (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGConnection.html#DBusGConnection"><span class="type">DBusGConnection</span></a> *gconnection</code></em>);</pre> +<p> +Get the <span class="type">DBusConnection</span> corresponding to this <a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGConnection.html#DBusGConnection"><span class="type">DBusGConnection</span></a>. +The return value does not have its refcount incremented. +</p> +<div class="variablelist"><table border="0"> +<col align="left" valign="top"> +<tbody> +<tr> +<td><p><span class="term"><em class="parameter"><code>gconnection</code></em> :</span></p></td> +<td>a <a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGConnection.html#DBusGConnection"><span class="type">DBusGConnection</span></a> +</td> +</tr> +<tr> +<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> +<td><span class="type">DBusConnection</span></td> +</tr> +</tbody> +</table></div> +</div> +<hr> +<div class="refsect2"> +<a name="dbus-g-message-get-message"></a><h3>dbus_g_message_get_message ()</h3> +<pre class="programlisting"><span class="returnvalue">DBusMessage</span> * dbus_g_message_get_message (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGMessage.html#DBusGMessage"><span class="type">DBusGMessage</span></a> *gmessage</code></em>);</pre> +<p> +Get the <span class="type">DBusMessage</span> corresponding to this <a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGMessage.html#DBusGMessage"><span class="type">DBusGMessage</span></a>. +The return value does not have its refcount incremented. +</p> +<div class="variablelist"><table border="0"> +<col align="left" valign="top"> +<tbody> +<tr> +<td><p><span class="term"><em class="parameter"><code>gmessage</code></em> :</span></p></td> +<td>a <a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGMessage.html#DBusGMessage"><span class="type">DBusGMessage</span></a> +</td> +</tr> +<tr> +<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> +<td><span class="type">DBusMessage</span></td> +</tr> +</tbody> +</table></div> +</div> +<hr> +<div class="refsect2"> +<a name="dbus-g-method-get-reply"></a><h3>dbus_g_method_get_reply ()</h3> +<pre class="programlisting"><span class="returnvalue">DBusMessage</span> * dbus_g_method_get_reply (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGMethod.html#DBusGMethodInvocation"><span class="type">DBusGMethodInvocation</span></a> *context</code></em>);</pre> +<p> +Get the reply message to append reply values +Used as a sidedoor when you can't generate dbus values +of the correct type due to glib binding limitations +</p> +<div class="variablelist"><table border="0"> +<col align="left" valign="top"> +<tbody> +<tr> +<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td> +<td>the method context</td> +</tr> +<tr> +<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> +<td>a <span class="type">DBusMessage</span> with the reply</td> +</tr> +</tbody> +</table></div> +</div> +<hr> +<div class="refsect2"> +<a name="dbus-g-method-get-sender"></a><h3>dbus_g_method_get_sender ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * dbus_g_method_get_sender (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGMethod.html#DBusGMethodInvocation"><span class="type">DBusGMethodInvocation</span></a> *context</code></em>);</pre> +<p> +Get the sender of a message so we can send a +"reply" later (i.e. send a message directly +to a service which invoked the method at a +later time). +</p> +<div class="variablelist"><table border="0"> +<col align="left" valign="top"> +<tbody> +<tr> +<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td> +<td>the method context</td> +</tr> +<tr> +<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> +<td>the unique name of the sender. It +is up to the caller to free the returned string.</td> +</tr> +</tbody> +</table></div> +</div> +<hr> +<div class="refsect2"> +<a name="dbus-g-method-send-reply"></a><h3>dbus_g_method_send_reply ()</h3> +<pre class="programlisting"><span class="returnvalue">void</span> dbus_g_method_send_reply (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGMethod.html#DBusGMethodInvocation"><span class="type">DBusGMethodInvocation</span></a> *context</code></em>, + <em class="parameter"><code><span class="type">DBusMessage</span> *reply</code></em>);</pre> +<p> +Send a manually created reply message. +</p> +<p> +Used as a sidedoor when you can't generate dbus values +of the correct type due to glib binding limitations +</p> +<div class="variablelist"><table border="0"> +<col align="left" valign="top"> +<tbody> +<tr> +<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td> +<td>the method context</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>reply</code></em> :</span></p></td> +<td>the reply message, will be unreffed</td> +</tr> +</tbody> +</table></div> +</div> +<hr> +<div class="refsect2"> +<a name="dbus-g-proxy-send"></a><h3>dbus_g_proxy_send ()</h3> +<pre class="programlisting"><span class="returnvalue">void</span> dbus_g_proxy_send (<em class="parameter"><code><a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGProxy.html#DBusGProxy"><span class="type">DBusGProxy</span></a> *proxy</code></em>, + <em class="parameter"><code><span class="type">DBusMessage</span> *message</code></em>, + <em class="parameter"><code><span class="type">dbus_uint32_t</span> *client_serial</code></em>);</pre> +<p> +Sends a message to the interface we're proxying for. Does not +block or wait for a reply. The message is only actually written out +when you return to the main loop or block in +<a href="/usr/share/gtk-doc/html/dbus-glib/dbus-glib-DBusGConnection.html#dbus-g-connection-flush"><code class="function">dbus_g_connection_flush()</code></a>. +</p> +<p> +The message is modified to be addressed to the target interface. +That is, a destination name field or whatever is needed will be +added to the message. The basic point of this function is to add +the necessary header fields, otherwise it's equivalent to +<code class="function">dbus_connection_send()</code>. +</p> +<p> +This function adds a reference to the message, so the caller +still owns its original reference. +</p> +<p> +It is an error to call this method on a proxy that has emitted +the <span class="type">"destroy"</span> signal. +</p> +<div class="variablelist"><table border="0"> +<col align="left" valign="top"> +<tbody> +<tr> +<td><p><span class="term"><em class="parameter"><code>proxy</code></em> :</span></p></td> +<td>a proxy for a remote interface</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>message</code></em> :</span></p></td> +<td>the message to address and send</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>client_serial</code></em> :</span></p></td> +<td>return location for message's serial, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> +</td> +</tr> +</tbody> +</table></div> +</div> +<hr> +<div class="refsect2"> +<a name="dbus-message-get-g-type"></a><h3>dbus_message_get_g_type ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="returnvalue">GType</span></a> dbus_message_get_g_type (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> +<p> +</p> +</div> +<hr> +<div class="refsect2"> +<a name="dbus-server-setup-with-g-main"></a><h3>dbus_server_setup_with_g_main ()</h3> +<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>, + <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> +<p> +Sets the watch and timeout functions of a <span class="type">DBusServer</span> +to integrate the server with the GLib main loop. +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>. +</p> +<p> +If called twice for the same context, does nothing the second +time. If called once with context A and once with context B, +context B replaces context A as the context monitoring the +connection. +</p> +<div class="variablelist"><table border="0"> +<col align="left" valign="top"> +<tbody> +<tr> +<td><p><span class="term"><em class="parameter"><code>server</code></em> :</span></p></td> +<td>the server</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>context</code></em> :</span></p></td> +<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> +</tr> +</tbody> +</table></div> +</div> +<hr> +<div class="refsect2"> +<a name="dbus-set-g-error"></a><h3>dbus_set_g_error ()</h3> +<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>, + <em class="parameter"><code><span class="type">DBusError</span> *derror</code></em>);</pre> +<p> +Store the information from a DBus method error return into a +GError. For the normal case of an arbitrary remote process, +the error code will be DBUS_GERROR_REMOTE_EXCEPTION. Now, +DBus errors have two components; a message and a "name". +The former is an arbitrary (normally American English) string. +The second is a string like com.example.FooFailure which +programs can use as a conditional source. Because a GError +only has one string, we use a hack to encode both values: +</p> +<p> +<human readable string><null><error name><null> +</p> +<p> +You can use the following code to retrieve both values: +</p> +<p> +</p> +<div class="informalexample"> + <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> + <tbody> + <tr> + <td class="listing_lines" align="right"><pre>1 +2 +3</pre></td> + <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> +<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> +<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> + </tr> + </tbody> + </table> +</div> + +<p> +</p> +<div class="variablelist"><table border="0"> +<col align="left" valign="top"> +<tbody> +<tr> +<td><p><span class="term"><em class="parameter"><code>gerror</code></em> :</span></p></td> +<td>an error</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>derror</code></em> :</span></p></td> +<td>a <span class="type">DBusError</span> +</td> +</tr> +</tbody> +</table></div> +</div> +</div> +</div> +<div class="footer"> +<hr> + Generated by GTK-Doc V1.18</div> +</body> +</html>
\ No newline at end of file |