]> git.proxmox.com Git - systemd.git/blob - docs/gudev/html/GUdevClient.html
ed718f55bfef025d4f39b18e88a5587ece5b6941
[systemd.git] / docs / gudev / html / GUdevClient.html
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>GUdevClient</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
7 <link rel="home" href="index.html" title="GUdev Reference Manual">
8 <link rel="up" href="ref-API.html" title="API Reference">
9 <link rel="prev" href="ref-API.html" title="API Reference">
10 <link rel="next" href="GUdevDevice.html" title="GUdevDevice">
11 <meta name="generator" content="GTK-Doc V1.19 (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="ref-API.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="ref-API.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">GUdev Reference Manual</th>
21 <td><a accesskey="n" href="GUdevDevice.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="#GUdevClient.synopsis" class="shortcut">Top</a>
25  | 
26 <a href="#GUdevClient.description" class="shortcut">Description</a>
27  | 
28 <a href="#GUdevClient.object-hierarchy" class="shortcut">Object Hierarchy</a>
29  | 
30 <a href="#GUdevClient.properties" class="shortcut">Properties</a>
31  | 
32 <a href="#GUdevClient.signals" class="shortcut">Signals</a>
33 </td></tr>
34 </table>
35 <div class="refentry">
36 <a name="GUdevClient"></a><div class="titlepage"></div>
37 <div class="refnamediv"><table width="100%"><tr>
38 <td valign="top">
39 <h2><span class="refentrytitle"><a name="GUdevClient.top_of_page"></a>GUdevClient</span></h2>
40 <p>GUdevClient — Query devices and listen to uevents</p>
41 </td>
42 <td valign="top" align="right"></td>
43 </tr></table></div>
44 <div class="refsynopsisdiv">
45 <a name="GUdevClient.synopsis"></a><h2>Synopsis</h2>
46 <a name="GUdevDeviceType"></a><pre class="synopsis"> <a class="link" href="GUdevClient.html#GUdevClient-struct" title="GUdevClient">GUdevClient</a>;
47 struct <a class="link" href="GUdevClient.html#GUdevClientClass" title="struct GUdevClientClass">GUdevClientClass</a>;
48 enum <a class="link" href="GUdevClient.html#GUdevDeviceType-enum" title="enum GUdevDeviceType">GUdevDeviceType</a>;
49 typedef <a class="link" href="GUdevClient.html#GUdevDeviceNumber" title="GUdevDeviceNumber">GUdevDeviceNumber</a>;
50 <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="returnvalue">GUdevClient</span></a> * <a class="link" href="GUdevClient.html#g-udev-client-new" title="g_udev_client_new ()">g_udev_client_new</a> (<em class="parameter"><code>const <span class="type">gchar</span> * const *subsystems</code></em>);
51 <span class="returnvalue">GList</span> * <a class="link" href="GUdevClient.html#g-udev-client-query-by-subsystem" title="g_udev_client_query_by_subsystem ()">g_udev_client_query_by_subsystem</a> (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
52 <em class="parameter"><code>const <span class="type">gchar</span> *subsystem</code></em>);
53 <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * <a class="link" href="GUdevClient.html#g-udev-client-query-by-device-number" title="g_udev_client_query_by_device_number ()">g_udev_client_query_by_device_number</a>
54 (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
55 <em class="parameter"><code><a class="link" href="GUdevClient.html#GUdevDeviceType"><span class="type">GUdevDeviceType</span></a> type</code></em>,
56 <em class="parameter"><code><a class="link" href="GUdevClient.html#GUdevDeviceNumber" title="GUdevDeviceNumber"><span class="type">GUdevDeviceNumber</span></a> number</code></em>);
57 <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * <a class="link" href="GUdevClient.html#g-udev-client-query-by-device-file" title="g_udev_client_query_by_device_file ()">g_udev_client_query_by_device_file</a> (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
58 <em class="parameter"><code>const <span class="type">gchar</span> *device_file</code></em>);
59 <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * <a class="link" href="GUdevClient.html#g-udev-client-query-by-sysfs-path" title="g_udev_client_query_by_sysfs_path ()">g_udev_client_query_by_sysfs_path</a> (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
60 <em class="parameter"><code>const <span class="type">gchar</span> *sysfs_path</code></em>);
61 <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * <a class="link" href="GUdevClient.html#g-udev-client-query-by-subsystem-and-name" title="g_udev_client_query_by_subsystem_and_name ()">g_udev_client_query_by_subsystem_and_name</a>
62 (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
63 <em class="parameter"><code>const <span class="type">gchar</span> *subsystem</code></em>,
64 <em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>);
65 </pre>
66 </div>
67 <div class="refsect1">
68 <a name="GUdevClient.object-hierarchy"></a><h2>Object Hierarchy</h2>
69 <pre class="synopsis">
70 GObject
71 +----GUdevClient
72 </pre>
73 <pre class="synopsis">
74 GEnum
75 +----GUdevDeviceType
76 </pre>
77 </div>
78 <div class="refsect1">
79 <a name="GUdevClient.properties"></a><h2>Properties</h2>
80 <pre class="synopsis">
81 "<a class="link" href="GUdevClient.html#GUdevClient--subsystems" title='The "subsystems" property'>subsystems</a>" <span class="type">GStrv</span> : Read / Write / Construct Only
82 </pre>
83 </div>
84 <div class="refsect1">
85 <a name="GUdevClient.signals"></a><h2>Signals</h2>
86 <pre class="synopsis">
87 "<a class="link" href="GUdevClient.html#GUdevClient-uevent" title='The "uevent" signal'>uevent</a>" : <code class="literal">Run Last</code>
88 </pre>
89 </div>
90 <div class="refsect1">
91 <a name="GUdevClient.description"></a><h2>Description</h2>
92 <p>
93 <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> is used to query information about devices on a Linux
94 system from the Linux kernel and the udev device
95 manager.
96 </p>
97 <p>
98 Device information is retrieved from the kernel (through the
99 <code class="literal">sysfs</code> filesystem) and the udev daemon (through a
100 <code class="literal">tmpfs</code> filesystem) and presented through
101 <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> objects. This means that no blocking IO ever happens
102 (in both cases, we are essentially just reading data from kernel
103 memory) and as such there are no asynchronous versions of the
104 provided methods.
105 </p>
106 <p>
107 To get <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> objects, use
108 <a class="link" href="GUdevClient.html#g-udev-client-query-by-subsystem" title="g_udev_client_query_by_subsystem ()"><code class="function">g_udev_client_query_by_subsystem()</code></a>,
109 <a class="link" href="GUdevClient.html#g-udev-client-query-by-device-number" title="g_udev_client_query_by_device_number ()"><code class="function">g_udev_client_query_by_device_number()</code></a>,
110 <a class="link" href="GUdevClient.html#g-udev-client-query-by-device-file" title="g_udev_client_query_by_device_file ()"><code class="function">g_udev_client_query_by_device_file()</code></a>,
111 <a class="link" href="GUdevClient.html#g-udev-client-query-by-sysfs-path" title="g_udev_client_query_by_sysfs_path ()"><code class="function">g_udev_client_query_by_sysfs_path()</code></a>,
112 <a class="link" href="GUdevClient.html#g-udev-client-query-by-subsystem-and-name" title="g_udev_client_query_by_subsystem_and_name ()"><code class="function">g_udev_client_query_by_subsystem_and_name()</code></a>
113 or the <a class="link" href="GUdevEnumerator.html" title="GUdevEnumerator"><span class="type">GUdevEnumerator</span></a> type.
114 </p>
115 <p>
116 To listen to uevents, connect to the <a class="link" href="GUdevClient.html#GUdevClient-uevent" title='The "uevent" signal'><span class="type">"uevent"</span></a> signal.
117 </p>
118 </div>
119 <div class="refsect1">
120 <a name="GUdevClient.details"></a><h2>Details</h2>
121 <div class="refsect2">
122 <a name="GUdevClient-struct"></a><h3>GUdevClient</h3>
123 <pre class="programlisting">typedef struct _GUdevClient GUdevClient;</pre>
124 <p>
125 The <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> struct is opaque and should not be accessed directly.
126 </p>
127 </div>
128 <hr>
129 <div class="refsect2">
130 <a name="GUdevClientClass"></a><h3>struct GUdevClientClass</h3>
131 <pre class="programlisting">struct GUdevClientClass {
132 GObjectClass parent_class;
133
134 /* signals */
135 void (*uevent) (GUdevClient *client,
136 const gchar *action,
137 GUdevDevice *device);
138 };
139 </pre>
140 <p>
141 Class structure for <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.
142 </p>
143 <div class="variablelist"><table border="0" class="variablelist">
144 <colgroup>
145 <col align="left" valign="top">
146 <col>
147 </colgroup>
148 <tbody>
149 <tr>
150 <td><p><span class="term"><span class="type">GObjectClass</span> <em class="structfield"><code><a name="GUdevClientClass.parent-class"></a>parent_class</code></em>;</span></p></td>
151 <td>Parent class.</td>
152 </tr>
153 <tr>
154 <td><p><span class="term"><em class="structfield"><code><a name="GUdevClientClass.uevent"></a>uevent</code></em> ()</span></p></td>
155 <td>Signal class handler for the <a class="link" href="GUdevClient.html#GUdevClient-uevent" title='The "uevent" signal'><span class="type">"uevent"</span></a> signal.</td>
156 </tr>
157 </tbody>
158 </table></div>
159 </div>
160 <hr>
161 <div class="refsect2">
162 <a name="GUdevDeviceType-enum"></a><h3>enum GUdevDeviceType</h3>
163 <pre class="programlisting">typedef enum {
164 G_UDEV_DEVICE_TYPE_NONE = 0,
165 G_UDEV_DEVICE_TYPE_BLOCK = 'b',
166 G_UDEV_DEVICE_TYPE_CHAR = 'c',
167 } GUdevDeviceType;
168 </pre>
169 <p>
170 Enumeration used to specify a the type of a device.
171 </p>
172 <div class="variablelist"><table border="0" class="variablelist">
173 <colgroup>
174 <col align="left" valign="top">
175 <col>
176 </colgroup>
177 <tbody>
178 <tr>
179 <td><p><a name="G-UDEV-DEVICE-TYPE-NONE:CAPS"></a><span class="term"><code class="literal">G_UDEV_DEVICE_TYPE_NONE</code></span></p></td>
180 <td>Device does not have a device file.
181 </td>
182 </tr>
183 <tr>
184 <td><p><a name="G-UDEV-DEVICE-TYPE-BLOCK:CAPS"></a><span class="term"><code class="literal">G_UDEV_DEVICE_TYPE_BLOCK</code></span></p></td>
185 <td>Device is a block device.
186 </td>
187 </tr>
188 <tr>
189 <td><p><a name="G-UDEV-DEVICE-TYPE-CHAR:CAPS"></a><span class="term"><code class="literal">G_UDEV_DEVICE_TYPE_CHAR</code></span></p></td>
190 <td>Device is a character device.
191 </td>
192 </tr>
193 </tbody>
194 </table></div>
195 </div>
196 <hr>
197 <div class="refsect2">
198 <a name="GUdevDeviceNumber"></a><h3>GUdevDeviceNumber</h3>
199 <pre class="programlisting">typedef guint64 GUdevDeviceNumber; /* __UQUAD_TYPE */
200 </pre>
201 <p>
202 Corresponds to the standard <span class="type">dev_t</span> type as defined by POSIX (Until
203 bug 584517 is resolved this work-around is needed).
204 </p>
205 </div>
206 <hr>
207 <div class="refsect2">
208 <a name="g-udev-client-new"></a><h3>g_udev_client_new ()</h3>
209 <pre class="programlisting"><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="returnvalue">GUdevClient</span></a> * g_udev_client_new (<em class="parameter"><code>const <span class="type">gchar</span> * const *subsystems</code></em>);</pre>
210 <p>
211 Constructs a <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> object that can be used to query
212 information about devices. Connect to the <a class="link" href="GUdevClient.html#GUdevClient-uevent" title='The "uevent" signal'><span class="type">"uevent"</span></a>
213 signal to listen for uevents. Note that signals are emitted in the
214 thread-default main loop
215 of the thread that you call this constructor from.
216 </p>
217 <div class="variablelist"><table border="0" class="variablelist">
218 <colgroup>
219 <col align="left" valign="top">
220 <col>
221 </colgroup>
222 <tbody>
223 <tr>
224 <td><p><span class="term"><em class="parameter"><code>subsystems</code></em> :</span></p></td>
225 <td>A <code class="literal">NULL</code> terminated string array of subsystems to listen for uevents on, <code class="literal">NULL</code> to not listen on uevents at all, or an empty array to listen to uevents on all subsystems. See the documentation for the <a class="link" href="GUdevClient.html#GUdevClient--subsystems" title='The "subsystems" property'><span class="type">"subsystems"</span></a> property for details on this parameter. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> utf8][<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
226 </td>
227 </tr>
228 <tr>
229 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
230 <td>A new <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> object. Free with <code class="function">g_object_unref()</code>.</td>
231 </tr>
232 </tbody>
233 </table></div>
234 </div>
235 <hr>
236 <div class="refsect2">
237 <a name="g-udev-client-query-by-subsystem"></a><h3>g_udev_client_query_by_subsystem ()</h3>
238 <pre class="programlisting"><span class="returnvalue">GList</span> * g_udev_client_query_by_subsystem (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
239 <em class="parameter"><code>const <span class="type">gchar</span> *subsystem</code></em>);</pre>
240 <p>
241 Gets all devices belonging to <em class="parameter"><code>subsystem</code></em>.
242 </p>
243 <div class="variablelist"><table border="0" class="variablelist">
244 <colgroup>
245 <col align="left" valign="top">
246 <col>
247 </colgroup>
248 <tbody>
249 <tr>
250 <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td>
251 <td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.</td>
252 </tr>
253 <tr>
254 <td><p><span class="term"><em class="parameter"><code>subsystem</code></em> :</span></p></td>
255 <td>The subsystem to get devices for or <code class="literal">NULL</code> to get all devices. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
256 </td>
257 </tr>
258 <tr>
259 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
260 <td>A list of <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> objects. The caller should free the result by using <code class="function">g_object_unref()</code> on each element in the list and then <code class="function">g_list_free()</code> on the list. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GUdevDevice][<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
261 </td>
262 </tr>
263 </tbody>
264 </table></div>
265 </div>
266 <hr>
267 <div class="refsect2">
268 <a name="g-udev-client-query-by-device-number"></a><h3>g_udev_client_query_by_device_number ()</h3>
269 <pre class="programlisting"><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * g_udev_client_query_by_device_number
270 (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
271 <em class="parameter"><code><a class="link" href="GUdevClient.html#GUdevDeviceType"><span class="type">GUdevDeviceType</span></a> type</code></em>,
272 <em class="parameter"><code><a class="link" href="GUdevClient.html#GUdevDeviceNumber" title="GUdevDeviceNumber"><span class="type">GUdevDeviceNumber</span></a> number</code></em>);</pre>
273 <p>
274 Looks up a device for a type and device number.
275 </p>
276 <div class="variablelist"><table border="0" class="variablelist">
277 <colgroup>
278 <col align="left" valign="top">
279 <col>
280 </colgroup>
281 <tbody>
282 <tr>
283 <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td>
284 <td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.</td>
285 </tr>
286 <tr>
287 <td><p><span class="term"><em class="parameter"><code>type</code></em> :</span></p></td>
288 <td>A value from the <a class="link" href="GUdevClient.html#GUdevDeviceType"><span class="type">GUdevDeviceType</span></a> enumeration.</td>
289 </tr>
290 <tr>
291 <td><p><span class="term"><em class="parameter"><code>number</code></em> :</span></p></td>
292 <td>A device number.</td>
293 </tr>
294 <tr>
295 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
296 <td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> object or <code class="literal">NULL</code> if the device was not found. Free with <code class="function">g_object_unref()</code>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
297 </td>
298 </tr>
299 </tbody>
300 </table></div>
301 </div>
302 <hr>
303 <div class="refsect2">
304 <a name="g-udev-client-query-by-device-file"></a><h3>g_udev_client_query_by_device_file ()</h3>
305 <pre class="programlisting"><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * g_udev_client_query_by_device_file (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
306 <em class="parameter"><code>const <span class="type">gchar</span> *device_file</code></em>);</pre>
307 <p>
308 Looks up a device for a device file.
309 </p>
310 <div class="variablelist"><table border="0" class="variablelist">
311 <colgroup>
312 <col align="left" valign="top">
313 <col>
314 </colgroup>
315 <tbody>
316 <tr>
317 <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td>
318 <td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.</td>
319 </tr>
320 <tr>
321 <td><p><span class="term"><em class="parameter"><code>device_file</code></em> :</span></p></td>
322 <td>A device file.</td>
323 </tr>
324 <tr>
325 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
326 <td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> object or <code class="literal">NULL</code> if the device was not found. Free with <code class="function">g_object_unref()</code>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
327 </td>
328 </tr>
329 </tbody>
330 </table></div>
331 </div>
332 <hr>
333 <div class="refsect2">
334 <a name="g-udev-client-query-by-sysfs-path"></a><h3>g_udev_client_query_by_sysfs_path ()</h3>
335 <pre class="programlisting"><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * g_udev_client_query_by_sysfs_path (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
336 <em class="parameter"><code>const <span class="type">gchar</span> *sysfs_path</code></em>);</pre>
337 <p>
338 Looks up a device for a sysfs path.
339 </p>
340 <div class="variablelist"><table border="0" class="variablelist">
341 <colgroup>
342 <col align="left" valign="top">
343 <col>
344 </colgroup>
345 <tbody>
346 <tr>
347 <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td>
348 <td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.</td>
349 </tr>
350 <tr>
351 <td><p><span class="term"><em class="parameter"><code>sysfs_path</code></em> :</span></p></td>
352 <td>A sysfs path.</td>
353 </tr>
354 <tr>
355 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
356 <td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> object or <code class="literal">NULL</code> if the device was not found. Free with <code class="function">g_object_unref()</code>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
357 </td>
358 </tr>
359 </tbody>
360 </table></div>
361 </div>
362 <hr>
363 <div class="refsect2">
364 <a name="g-udev-client-query-by-subsystem-and-name"></a><h3>g_udev_client_query_by_subsystem_and_name ()</h3>
365 <pre class="programlisting"><a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="returnvalue">GUdevDevice</span></a> * g_udev_client_query_by_subsystem_and_name
366 (<em class="parameter"><code><a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client</code></em>,
367 <em class="parameter"><code>const <span class="type">gchar</span> *subsystem</code></em>,
368 <em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>);</pre>
369 <p>
370 Looks up a device for a subsystem and name.
371 </p>
372 <div class="variablelist"><table border="0" class="variablelist">
373 <colgroup>
374 <col align="left" valign="top">
375 <col>
376 </colgroup>
377 <tbody>
378 <tr>
379 <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td>
380 <td>A <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a>.</td>
381 </tr>
382 <tr>
383 <td><p><span class="term"><em class="parameter"><code>subsystem</code></em> :</span></p></td>
384 <td>A subsystem name.</td>
385 </tr>
386 <tr>
387 <td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
388 <td>The name of the device.</td>
389 </tr>
390 <tr>
391 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
392 <td>A <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> object or <code class="literal">NULL</code> if the device was not found. Free with <code class="function">g_object_unref()</code>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span>
393 </td>
394 </tr>
395 </tbody>
396 </table></div>
397 </div>
398 </div>
399 <div class="refsect1">
400 <a name="GUdevClient.property-details"></a><h2>Property Details</h2>
401 <div class="refsect2">
402 <a name="GUdevClient--subsystems"></a><h3>The <code class="literal">"subsystems"</code> property</h3>
403 <pre class="programlisting"> "subsystems" <span class="type">GStrv</span> : Read / Write / Construct Only</pre>
404 <p>
405 The subsystems to listen for uevents on.
406 </p>
407 <p>
408 To listen for only a specific DEVTYPE for a given SUBSYSTEM, use
409 "subsystem/devtype". For example, to only listen for uevents
410 where SUBSYSTEM is usb and DEVTYPE is usb_interface, use
411 "usb/usb_interface".
412 </p>
413 <p>
414 If this property is <code class="literal">NULL</code>, then no events will be reported. If
415 it's the empty array, events from all subsystems will be
416 reported.
417 </p>
418 </div>
419 </div>
420 <div class="refsect1">
421 <a name="GUdevClient.signal-details"></a><h2>Signal Details</h2>
422 <div class="refsect2">
423 <a name="GUdevClient-uevent"></a><h3>The <code class="literal">"uevent"</code> signal</h3>
424 <pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> *client,
425 <span class="type">gchar</span> *action,
426 <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> *device,
427 <span class="type">gpointer</span> user_data) : <code class="literal">Run Last</code></pre>
428 <p>
429 Emitted when <em class="parameter"><code>client</code></em> receives an uevent.
430 </p>
431 <p>
432 This signal is emitted in the
433 thread-default main loop
434 of the thread that <em class="parameter"><code>client</code></em> was created in.
435 </p>
436 <div class="variablelist"><table border="0" class="variablelist">
437 <colgroup>
438 <col align="left" valign="top">
439 <col>
440 </colgroup>
441 <tbody>
442 <tr>
443 <td><p><span class="term"><em class="parameter"><code>client</code></em> :</span></p></td>
444 <td>The <a class="link" href="GUdevClient.html" title="GUdevClient"><span class="type">GUdevClient</span></a> receiving the event.</td>
445 </tr>
446 <tr>
447 <td><p><span class="term"><em class="parameter"><code>action</code></em> :</span></p></td>
448 <td>The action for the uevent e.g. "add", "remove", "change", "move", etc.</td>
449 </tr>
450 <tr>
451 <td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td>
452 <td>Details about the <a class="link" href="GUdevDevice.html" title="GUdevDevice"><span class="type">GUdevDevice</span></a> the event is for.</td>
453 </tr>
454 <tr>
455 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
456 <td>user data set when the signal handler was connected.</td>
457 </tr>
458 </tbody>
459 </table></div>
460 </div>
461 </div>
462 </div>
463 <div class="footer">
464 <hr>
465 Generated by GTK-Doc V1.19</div>
466 </body>
467 </html>