Debian Codegraph @

doc/html/udisks2-Utilities.html

raw
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>Utilities: UDisks Reference Manual</title>
6 <meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
7 <link rel="home" href="index.html" title="UDisks Reference Manual">
8 <link rel="up" href="ref-daemon-core.html" title="Core">
9 <link rel="prev" href="ref-daemon-core.html" title="Core">
10 <link rel="next" href="udisks2-Logging.html" title="Logging">
11 <meta name="generator" content="GTK-Doc V1.35.1 (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="5"><tr valign="middle">
16 <td width="100%" align="left" class="shortcuts">
17 <a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
18 <a href="#udisks2-Utilities.description" class="shortcut">Description</a></span>
19 </td>
20 <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
21 <td><a accesskey="u" href="ref-daemon-core.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
22 <td><a accesskey="p" href="ref-daemon-core.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
23 <td><a accesskey="n" href="udisks2-Logging.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
24 </tr></table>
25 <div class="refentry">
26 <a name="udisks2-Utilities"></a><div class="titlepage"></div>
27 <div class="refnamediv"><table width="100%"><tr>
28 <td valign="top">
29 <h2><span class="refentrytitle"><a name="udisks2-Utilities.top_of_page"></a>Utilities</span></h2>
30 <p>Utilities — Various utility routines</p>
31 </td>
32 <td class="gallery_image" valign="top" align="right"></td>
33 </tr></table></div>
34 <div class="refsect1">
35 <a name="udisks2-Utilities.functions"></a><h2>Functions</h2>
36 <div class="informaltable"><table class="informaltable" width="100%" border="0">
37 <colgroup>
38 <col width="150px" class="functions_proto_type">
39 <col class="functions_proto_name">
40 </colgroup>
41 <tbody>
42 <tr>
43 <td class="function_type">
44 <span class="returnvalue">gchar</span> *
45 </td>
46 <td class="function_name">
47 <a class="link" href="udisks2-Utilities.html#udisks-decode-udev-string" title="udisks_decode_udev_string ()">udisks_decode_udev_string</a> <span class="c_punctuation">()</span>
48 </td>
49 </tr>
50 <tr>
51 <td class="function_type">
52 <span class="returnvalue">void</span>
53 </td>
54 <td class="function_name">
55 <a class="link" href="udisks2-Utilities.html#udisks-safe-append-to-object-path" title="udisks_safe_append_to_object_path ()">udisks_safe_append_to_object_path</a> <span class="c_punctuation">()</span>
56 </td>
57 </tr>
58 <tr>
59 <td class="function_type">
60 <span class="returnvalue">guint64</span>
61 </td>
62 <td class="function_name">
63 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-block-get-size" title="udisks_daemon_util_block_get_size ()">udisks_daemon_util_block_get_size</a> <span class="c_punctuation">()</span>
64 </td>
65 </tr>
66 <tr>
67 <td class="function_type">
68 <span class="returnvalue">gchar</span> *
69 </td>
70 <td class="function_name">
71 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-resolve-link" title="udisks_daemon_util_resolve_link ()">udisks_daemon_util_resolve_link</a> <span class="c_punctuation">()</span>
72 </td>
73 </tr>
74 <tr>
75 <td class="function_type">
76 <span class="returnvalue">gchar</span> **
77 </td>
78 <td class="function_name">
79 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-resolve-links" title="udisks_daemon_util_resolve_links ()">udisks_daemon_util_resolve_links</a> <span class="c_punctuation">()</span>
80 </td>
81 </tr>
82 <tr>
83 <td class="function_type">
84 <span class="returnvalue">gboolean</span>
85 </td>
86 <td class="function_name">
87 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-check-authorization-sync" title="udisks_daemon_util_check_authorization_sync ()">udisks_daemon_util_check_authorization_sync</a> <span class="c_punctuation">()</span>
88 </td>
89 </tr>
90 <tr>
91 <td class="function_type">
92 <span class="returnvalue">gboolean</span>
93 </td>
94 <td class="function_name">
95 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-get-caller-uid-sync" title="udisks_daemon_util_get_caller_uid_sync ()">udisks_daemon_util_get_caller_uid_sync</a> <span class="c_punctuation">()</span>
96 </td>
97 </tr>
98 <tr>
99 <td class="function_type">
100 <span class="returnvalue">gboolean</span>
101 </td>
102 <td class="function_name">
103 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-get-caller-pid-sync" title="udisks_daemon_util_get_caller_pid_sync ()">udisks_daemon_util_get_caller_pid_sync</a> <span class="c_punctuation">()</span>
104 </td>
105 </tr>
106 <tr>
107 <td class="function_type">
108 <span class="returnvalue">gboolean</span>
109 </td>
110 <td class="function_name">
111 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-setup-by-user" title="udisks_daemon_util_setup_by_user ()">udisks_daemon_util_setup_by_user</a> <span class="c_punctuation">()</span>
112 </td>
113 </tr>
114 <tr>
115 <td class="function_type">
116 <span class="returnvalue">gpointer</span>
117 </td>
118 <td class="function_name">
119 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-dup-object" title="udisks_daemon_util_dup_object ()">udisks_daemon_util_dup_object</a> <span class="c_punctuation">()</span>
120 </td>
121 </tr>
122 <tr>
123 <td class="function_type">
124 <a class="link" href="udisks2-Utilities.html#UDisksInhibitCookie" title="UDisksInhibitCookie"><span class="returnvalue">UDisksInhibitCookie</span></a> *
125 </td>
126 <td class="function_name">
127 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-inhibit-system-sync" title="udisks_daemon_util_inhibit_system_sync ()">udisks_daemon_util_inhibit_system_sync</a> <span class="c_punctuation">()</span>
128 </td>
129 </tr>
130 <tr>
131 <td class="function_type">
132 <span class="returnvalue">void</span>
133 </td>
134 <td class="function_name">
135 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-uninhibit-system-sync" title="udisks_daemon_util_uninhibit_system_sync ()">udisks_daemon_util_uninhibit_system_sync</a> <span class="c_punctuation">()</span>
136 </td>
137 </tr>
138 <tr>
139 <td class="function_type">
140 <span class="returnvalue">gchar</span> *
141 </td>
142 <td class="function_name">
143 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-hexdump" title="udisks_daemon_util_hexdump ()">udisks_daemon_util_hexdump</a> <span class="c_punctuation">()</span>
144 </td>
145 </tr>
146 <tr>
147 <td class="function_type">
148 <span class="returnvalue">void</span>
149 </td>
150 <td class="function_name">
151 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-hexdump-debug" title="udisks_daemon_util_hexdump_debug ()">udisks_daemon_util_hexdump_debug</a> <span class="c_punctuation">()</span>
152 </td>
153 </tr>
154 <tr>
155 <td class="function_type">
156 <span class="returnvalue">gboolean</span>
157 </td>
158 <td class="function_name">
159 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-file-set-contents" title="udisks_daemon_util_file_set_contents ()">udisks_daemon_util_file_set_contents</a> <span class="c_punctuation">()</span>
160 </td>
161 </tr>
162 <tr>
163 <td class="function_type">
164 <span class="returnvalue">gboolean</span>
165 </td>
166 <td class="function_name">
167 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-on-user-seat" title="udisks_daemon_util_on_user_seat ()">udisks_daemon_util_on_user_seat</a> <span class="c_punctuation">()</span>
168 </td>
169 </tr>
170 <tr>
171 <td class="function_type">
172 <span class="returnvalue">gchar</span> *
173 </td>
174 <td class="function_name">
175 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-get-free-mdraid-device" title="udisks_daemon_util_get_free_mdraid_device ()">udisks_daemon_util_get_free_mdraid_device</a> <span class="c_punctuation">()</span>
176 </td>
177 </tr>
178 <tr>
179 <td class="function_type">
180 <span class="returnvalue">guint16</span>
181 </td>
182 <td class="function_name">
183 <a class="link" href="udisks2-Utilities.html#udisks-ata-identify-get-word" title="udisks_ata_identify_get_word ()">udisks_ata_identify_get_word</a> <span class="c_punctuation">()</span>
184 </td>
185 </tr>
186 <tr>
187 <td class="function_type">
188 <span class="returnvalue">void</span>
189 </td>
190 <td class="function_name">
191 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-trigger-uevent" title="udisks_daemon_util_trigger_uevent ()">udisks_daemon_util_trigger_uevent</a> <span class="c_punctuation">()</span>
192 </td>
193 </tr>
194 <tr>
195 <td class="function_type">
196 <span class="returnvalue">gboolean</span>
197 </td>
198 <td class="function_name">
199 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-trigger-uevent-sync" title="udisks_daemon_util_trigger_uevent_sync ()">udisks_daemon_util_trigger_uevent_sync</a> <span class="c_punctuation">()</span>
200 </td>
201 </tr>
202 <tr>
203 <td class="function_type">
204 <span class="returnvalue">gboolean</span>
205 </td>
206 <td class="function_name">
207 <a class="link" href="udisks2-Utilities.html#udisks-module-validate-name" title="udisks_module_validate_name ()">udisks_module_validate_name</a> <span class="c_punctuation">()</span>
208 </td>
209 </tr>
210 </tbody>
211 </table></div>
212 </div>
213 <div class="refsect1">
214 <a name="udisks2-Utilities.other"></a><h2>Types and Values</h2>
215 <div class="informaltable"><table class="informaltable" width="100%" border="0">
216 <colgroup>
217 <col width="150px" class="other_proto_type">
218 <col class="other_proto_name">
219 </colgroup>
220 <tbody><tr>
221 <td class="typedef_keyword">typedef</td>
222 <td class="function_name"><a class="link" href="udisks2-Utilities.html#UDisksInhibitCookie" title="UDisksInhibitCookie">UDisksInhibitCookie</a></td>
223 </tr></tbody>
224 </table></div>
225 </div>
226 <div class="refsect1">
227 <a name="udisks2-Utilities.description"></a><h2>Description</h2>
228 <p>Various utility routines.</p>
229 </div>
230 <div class="refsect1">
231 <a name="udisks2-Utilities.functions_details"></a><h2>Functions</h2>
232 <div class="refsect2">
233 <a name="udisks-decode-udev-string"></a><h3>udisks_decode_udev_string ()</h3>
234 <pre class="programlisting"><span class="returnvalue">gchar</span> *
235 udisks_decode_udev_string (<em class="parameter"><code>const <span class="type">gchar</span> *str</code></em>,
236 <em class="parameter"><code>const <span class="type">gchar</span> *fallback_str</code></em>);</pre>
237 <p>Unescapes sequences like \x20 to " " and ensures the returned string is valid UTF-8.</p>
238 <p>If the string is not valid UTF-8, try as hard as possible to convert to UTF-8.</p>
239 <p>If <code class="literal">NULL</code> is passed, then <code class="literal">NULL</code> is returned.</p>
240 <p>See <code class="function">udev_util_encode_string()</code> in libudev/libudev-util.c in the udev
241 tree for what kinds of strings can be used.</p>
242 <div class="refsect3">
243 <a name="udisks-decode-udev-string.parameters"></a><h4>Parameters</h4>
244 <div class="informaltable"><table class="informaltable" width="100%" border="0">
245 <colgroup>
246 <col width="150px" class="parameters_name">
247 <col class="parameters_description">
248 <col width="200px" class="parameters_annotations">
249 </colgroup>
250 <tbody>
251 <tr>
252 <td class="parameter_name"><p>str</p></td>
253 <td class="parameter_description"><p>An udev-encoded string or <code class="literal">NULL</code>.</p></td>
254 <td class="parameter_annotations"> </td>
255 </tr>
256 <tr>
257 <td class="parameter_name"><p>fallback_str</p></td>
258 <td class="parameter_description"><p>String to use when <em class="parameter"><code>str</code></em>
259 can't be converted to a valid UTF-8 string.</p></td>
260 <td class="parameter_annotations"> </td>
261 </tr>
262 </tbody>
263 </table></div>
264 </div>
265 <div class="refsect3">
266 <a name="udisks-decode-udev-string.returns"></a><h4>Returns</h4>
267 <p> A valid UTF-8 string that must be freed with <code class="function">g_free()</code>.</p>
268 </div>
269 </div>
270 <hr>
271 <div class="refsect2">
272 <a name="udisks-safe-append-to-object-path"></a><h3>udisks_safe_append_to_object_path ()</h3>
273 <pre class="programlisting"><span class="returnvalue">void</span>
274 udisks_safe_append_to_object_path (<em class="parameter"><code><span class="type">GString</span> *str</code></em>,
275 <em class="parameter"><code>const <span class="type">gchar</span> *s</code></em>);</pre>
276 <p>Appends <em class="parameter"><code>s</code></em>
277 to <em class="parameter"><code>str</code></em>
278 in a way such that only characters that can be
279 used in a D-Bus object path will be used. E.g. a character not in
280 <code class="literal">A-Z[0-9]_</code> will be escaped as _HEX where
281 HEX is a two-digit hexadecimal number.</p>
282 <p>Note that his mapping is not bijective - e.g. you cannot go back
283 to the original string.</p>
284 <div class="refsect3">
285 <a name="udisks-safe-append-to-object-path.parameters"></a><h4>Parameters</h4>
286 <div class="informaltable"><table class="informaltable" width="100%" border="0">
287 <colgroup>
288 <col width="150px" class="parameters_name">
289 <col class="parameters_description">
290 <col width="200px" class="parameters_annotations">
291 </colgroup>
292 <tbody>
293 <tr>
294 <td class="parameter_name"><p>str</p></td>
295 <td class="parameter_description"><p>A <span class="type">GString</span> to append to.</p></td>
296 <td class="parameter_annotations"> </td>
297 </tr>
298 <tr>
299 <td class="parameter_name"><p>s</p></td>
300 <td class="parameter_description"><p>A UTF-8 string.</p></td>
301 <td class="parameter_annotations"> </td>
302 </tr>
303 </tbody>
304 </table></div>
305 </div>
306 </div>
307 <hr>
308 <div class="refsect2">
309 <a name="udisks-daemon-util-block-get-size"></a><h3>udisks_daemon_util_block_get_size ()</h3>
310 <pre class="programlisting"><span class="returnvalue">guint64</span>
311 udisks_daemon_util_block_get_size (<em class="parameter"><code><a href="https://gnome.pages.gitlab.gnome.org/libgudev/libgudev/GUdevDevice.html#GUdevDevice-struct"><span class="type">GUdevDevice</span></a> *device</code></em>,
312 <em class="parameter"><code><span class="type">gboolean</span> *out_media_available</code></em>,
313 <em class="parameter"><code><span class="type">gboolean</span> *out_media_change_detected</code></em>);</pre>
314 <p>Gets the size of the <em class="parameter"><code>device</code></em>
315 top-level block device, checking for media in the process</p>
316 <div class="refsect3">
317 <a name="udisks-daemon-util-block-get-size.parameters"></a><h4>Parameters</h4>
318 <div class="informaltable"><table class="informaltable" width="100%" border="0">
319 <colgroup>
320 <col width="150px" class="parameters_name">
321 <col class="parameters_description">
322 <col width="200px" class="parameters_annotations">
323 </colgroup>
324 <tbody>
325 <tr>
326 <td class="parameter_name"><p>device</p></td>
327 <td class="parameter_description"><p>A <a href="https://gnome.pages.gitlab.gnome.org/libgudev/libgudev/GUdevDevice.html#GUdevDevice-struct"><span class="type">GUdevDevice</span></a> for a top-level block device.</p></td>
328 <td class="parameter_annotations"> </td>
329 </tr>
330 <tr>
331 <td class="parameter_name"><p>out_media_available</p></td>
332 <td class="parameter_description"><p>Return location for whether media is available or <code class="literal">NULL</code>. </p></td>
333 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
334 </tr>
335 <tr>
336 <td class="parameter_name"><p>out_media_change_detected</p></td>
337 <td class="parameter_description"><p>Return location for whether media change is detected or <code class="literal">NULL</code>. </p></td>
338 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
339 </tr>
340 </tbody>
341 </table></div>
342 </div>
343 <div class="refsect3">
344 <a name="udisks-daemon-util-block-get-size.returns"></a><h4>Returns</h4>
345 <p> The size of <em class="parameter"><code>device</code></em>
346 or 0 if no media is available or if unknown.</p>
347 </div>
348 </div>
349 <hr>
350 <div class="refsect2">
351 <a name="udisks-daemon-util-resolve-link"></a><h3>udisks_daemon_util_resolve_link ()</h3>
352 <pre class="programlisting"><span class="returnvalue">gchar</span> *
353 udisks_daemon_util_resolve_link (<em class="parameter"><code>const <span class="type">gchar</span> *path</code></em>,
354 <em class="parameter"><code>const <span class="type">gchar</span> *name</code></em>);</pre>
355 <p>Resolves the symlink <em class="parameter"><code>path</code></em>
356 /<em class="parameter"><code>name</code></em>
357 .</p>
358 <div class="refsect3">
359 <a name="udisks-daemon-util-resolve-link.parameters"></a><h4>Parameters</h4>
360 <div class="informaltable"><table class="informaltable" width="100%" border="0">
361 <colgroup>
362 <col width="150px" class="parameters_name">
363 <col class="parameters_description">
364 <col width="200px" class="parameters_annotations">
365 </colgroup>
366 <tbody>
367 <tr>
368 <td class="parameter_name"><p>path</p></td>
369 <td class="parameter_description"><p>A path</p></td>
370 <td class="parameter_annotations"> </td>
371 </tr>
372 <tr>
373 <td class="parameter_name"><p>name</p></td>
374 <td class="parameter_description"><p>Name of a symlink in <em class="parameter"><code>path</code></em>
375 .</p></td>
376 <td class="parameter_annotations"> </td>
377 </tr>
378 </tbody>
379 </table></div>
380 </div>
381 <div class="refsect3">
382 <a name="udisks-daemon-util-resolve-link.returns"></a><h4>Returns</h4>
383 <p> A canonicalized absolute pathname or <code class="literal">NULL</code> if the symlink
384 could not be resolved. Free with <code class="function">g_free()</code>.</p>
385 </div>
386 </div>
387 <hr>
388 <div class="refsect2">
389 <a name="udisks-daemon-util-resolve-links"></a><h3>udisks_daemon_util_resolve_links ()</h3>
390 <pre class="programlisting"><span class="returnvalue">gchar</span> **
391 udisks_daemon_util_resolve_links (<em class="parameter"><code>const <span class="type">gchar</span> *path</code></em>,
392 <em class="parameter"><code>const <span class="type">gchar</span> *dir_name</code></em>);</pre>
393 <p>Resolves all symlinks in <em class="parameter"><code>path</code></em>
394 /<em class="parameter"><code>dir_name</code></em>
395 . This can be used to
396 easily walk e.g. holders or slaves of block devices.</p>
397 <div class="refsect3">
398 <a name="udisks-daemon-util-resolve-links.parameters"></a><h4>Parameters</h4>
399 <div class="informaltable"><table class="informaltable" width="100%" border="0">
400 <colgroup>
401 <col width="150px" class="parameters_name">
402 <col class="parameters_description">
403 <col width="200px" class="parameters_annotations">
404 </colgroup>
405 <tbody>
406 <tr>
407 <td class="parameter_name"><p>path</p></td>
408 <td class="parameter_description"><p>A path</p></td>
409 <td class="parameter_annotations"> </td>
410 </tr>
411 <tr>
412 <td class="parameter_name"><p>dir_name</p></td>
413 <td class="parameter_description"><p>Name of a directory in <em class="parameter"><code>path</code></em>
414 holding symlinks.</p></td>
415 <td class="parameter_annotations"> </td>
416 </tr>
417 </tbody>
418 </table></div>
419 </div>
420 <div class="refsect3">
421 <a name="udisks-daemon-util-resolve-links.returns"></a><h4>Returns</h4>
422 <p> An array of canonicalized absolute pathnames. Free with <code class="function">g_strfreev()</code>.</p>
423 </div>
424 </div>
425 <hr>
426 <div class="refsect2">
427 <a name="udisks-daemon-util-check-authorization-sync"></a><h3>udisks_daemon_util_check_authorization_sync ()</h3>
428 <pre class="programlisting"><span class="returnvalue">gboolean</span>
429 udisks_daemon_util_check_authorization_sync
430 (<em class="parameter"><code><a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> *daemon</code></em>,
431 <em class="parameter"><code><a class="link" href="UDisksObject.html" title="UDisksObject"><span class="type">UDisksObject</span></a> *object</code></em>,
432 <em class="parameter"><code>const <span class="type">gchar</span> *action_id</code></em>,
433 <em class="parameter"><code><span class="type">GVariant</span> *options</code></em>,
434 <em class="parameter"><code>const <span class="type">gchar</span> *message</code></em>,
435 <em class="parameter"><code><span class="type">GDBusMethodInvocation</span> *invocation</code></em>);</pre>
436 <p>Checks if the caller represented by <em class="parameter"><code>invocation</code></em>
437 is authorized for
438 the action identified by <em class="parameter"><code>action_id</code></em>
439 , optionally displaying <em class="parameter"><code>message</code></em>
440
441 if authentication is needed. Additionally, if the caller is not
442 authorized, the appropriate error is already returned to the caller
443 via <em class="parameter"><code>invocation</code></em>
444 .</p>
445 <p>The calling thread is blocked for the duration of the authorization
446 check which could be a very long time since it may involve
447 presenting an authentication dialog and having a human user use
448 it. If <span class="quote">“<span class="quote">auth.no_user_interaction</span>”</span> in <em class="parameter"><code>options</code></em>
449 is <code class="literal">TRUE</code>
450 no authentication dialog will be presented and the check is not
451 expected to take a long time.</p>
452 <p>See <a class="xref" href="udisks-polkit-actions.html#udisks-polkit-details" title="Table 1. Known polkit variables">Table 1, “Known polkit variables”</a> for the variables that
453 can be used in <em class="parameter"><code>message</code></em>
454 but note that not all variables can be used
455 in all checks. For example, any check involving a <a class="link" href="UDisksDrive.html" title="UDisksDrive"><span class="type">UDisksDrive</span></a> or a
456 <a class="link" href="UDisksBlock.html" title="UDisksBlock"><span class="type">UDisksBlock</span></a> object can safely include the fragment</p>
457 <span class="quote">“<span class="quote">$(drive)</span>”</span> since it will always expand to the name of
458 <p>the drive, e.g. <span class="quote">“<span class="quote">INTEL SSDSA2MH080G1GC (/dev/sda1)</span>”</span> or
459 the block device file e.g. <span class="quote">“<span class="quote">/dev/vg_lucifer/lv_root</span>”</span>
460 or <span class="quote">“<span class="quote">/dev/sda1</span>”</span>. However this won't work for operations
461 that isn't on a drive or block device, for example calls on the</p>
462 <a class="link" href="gdbus-org.freedesktop.UDisks2.Manager.html#gdbus-interface-org-freedesktop-UDisks2-Manager.top_of_page">Manager</a><p>object.</p>
463 <div class="refsect3">
464 <a name="udisks-daemon-util-check-authorization-sync.parameters"></a><h4>Parameters</h4>
465 <div class="informaltable"><table class="informaltable" width="100%" border="0">
466 <colgroup>
467 <col width="150px" class="parameters_name">
468 <col class="parameters_description">
469 <col width="200px" class="parameters_annotations">
470 </colgroup>
471 <tbody>
472 <tr>
473 <td class="parameter_name"><p>daemon</p></td>
474 <td class="parameter_description"><p>A <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a>.</p></td>
475 <td class="parameter_annotations"> </td>
476 </tr>
477 <tr>
478 <td class="parameter_name"><p>object</p></td>
479 <td class="parameter_description"><p>The <span class="type">GDBusObject</span> that the call is on or <code class="literal">NULL</code>. </p></td>
480 <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
481 </tr>
482 <tr>
483 <td class="parameter_name"><p>action_id</p></td>
484 <td class="parameter_description"><p>The action id to check for.</p></td>
485 <td class="parameter_annotations"> </td>
486 </tr>
487 <tr>
488 <td class="parameter_name"><p>options</p></td>
489 <td class="parameter_description"><p>A <span class="type">GVariant</span> to check for the <span class="quote">“<span class="quote">auth.no_user_interaction</span>”</span> option or <code class="literal">NULL</code>. </p></td>
490 <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
491 </tr>
492 <tr>
493 <td class="parameter_name"><p>message</p></td>
494 <td class="parameter_description"><p>The message to convey (use N_).</p></td>
495 <td class="parameter_annotations"> </td>
496 </tr>
497 <tr>
498 <td class="parameter_name"><p>invocation</p></td>
499 <td class="parameter_description"><p>The invocation to check for.</p></td>
500 <td class="parameter_annotations"> </td>
501 </tr>
502 </tbody>
503 </table></div>
504 </div>
505 <div class="refsect3">
506 <a name="udisks-daemon-util-check-authorization-sync.returns"></a><h4>Returns</h4>
507 <p> <code class="literal">TRUE</code> if caller is authorized, <code class="literal">FALSE</code> if not.</p>
508 </div>
509 </div>
510 <hr>
511 <div class="refsect2">
512 <a name="udisks-daemon-util-get-caller-uid-sync"></a><h3>udisks_daemon_util_get_caller_uid_sync ()</h3>
513 <pre class="programlisting"><span class="returnvalue">gboolean</span>
514 udisks_daemon_util_get_caller_uid_sync
515 (<em class="parameter"><code><a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> *daemon</code></em>,
516 <em class="parameter"><code><span class="type">GDBusMethodInvocation</span> *invocation</code></em>,
517 <em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
518 <em class="parameter"><code><span class="type">uid_t</span> *out_uid</code></em>,
519 <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
520 <p>Gets the UNIX user id of the peer represented by <em class="parameter"><code>invocation</code></em>
521 .</p>
522 <div class="refsect3">
523 <a name="udisks-daemon-util-get-caller-uid-sync.parameters"></a><h4>Parameters</h4>
524 <div class="informaltable"><table class="informaltable" width="100%" border="0">
525 <colgroup>
526 <col width="150px" class="parameters_name">
527 <col class="parameters_description">
528 <col width="200px" class="parameters_annotations">
529 </colgroup>
530 <tbody>
531 <tr>
532 <td class="parameter_name"><p>daemon</p></td>
533 <td class="parameter_description"><p>A <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a>.</p></td>
534 <td class="parameter_annotations"> </td>
535 </tr>
536 <tr>
537 <td class="parameter_name"><p>invocation</p></td>
538 <td class="parameter_description"><p>A <span class="type">GDBusMethodInvocation</span>.</p></td>
539 <td class="parameter_annotations"> </td>
540 </tr>
541 <tr>
542 <td class="parameter_name"><p>cancellable</p></td>
543 <td class="parameter_description"><p>A <span class="type">GCancellable</span> or <code class="literal">NULL</code>. </p></td>
544 <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
545 </tr>
546 <tr>
547 <td class="parameter_name"><p>out_uid</p></td>
548 <td class="parameter_description"><p>Return location for resolved uid or <code class="literal">NULL</code>. </p></td>
549 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
550 </tr>
551 <tr>
552 <td class="parameter_name"><p>error</p></td>
553 <td class="parameter_description"><p>Return location for error.</p></td>
554 <td class="parameter_annotations"> </td>
555 </tr>
556 </tbody>
557 </table></div>
558 </div>
559 <div class="refsect3">
560 <a name="udisks-daemon-util-get-caller-uid-sync.returns"></a><h4>Returns</h4>
561 <p> <code class="literal">TRUE</code> if the user id (and possibly group id) was obtained, <code class="literal">FALSE</code> otherwise</p>
562 </div>
563 </div>
564 <hr>
565 <div class="refsect2">
566 <a name="udisks-daemon-util-get-caller-pid-sync"></a><h3>udisks_daemon_util_get_caller_pid_sync ()</h3>
567 <pre class="programlisting"><span class="returnvalue">gboolean</span>
568 udisks_daemon_util_get_caller_pid_sync
569 (<em class="parameter"><code><a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> *daemon</code></em>,
570 <em class="parameter"><code><span class="type">GDBusMethodInvocation</span> *invocation</code></em>,
571 <em class="parameter"><code><span class="type">GCancellable</span> *cancellable</code></em>,
572 <em class="parameter"><code><span class="type">pid_t</span> *out_pid</code></em>,
573 <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
574 <p>Gets the UNIX process id of the peer represented by <em class="parameter"><code>invocation</code></em>
575 .</p>
576 <div class="refsect3">
577 <a name="udisks-daemon-util-get-caller-pid-sync.parameters"></a><h4>Parameters</h4>
578 <div class="informaltable"><table class="informaltable" width="100%" border="0">
579 <colgroup>
580 <col width="150px" class="parameters_name">
581 <col class="parameters_description">
582 <col width="200px" class="parameters_annotations">
583 </colgroup>
584 <tbody>
585 <tr>
586 <td class="parameter_name"><p>daemon</p></td>
587 <td class="parameter_description"><p>A <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a>.</p></td>
588 <td class="parameter_annotations"> </td>
589 </tr>
590 <tr>
591 <td class="parameter_name"><p>invocation</p></td>
592 <td class="parameter_description"><p>A <span class="type">GDBusMethodInvocation</span>.</p></td>
593 <td class="parameter_annotations"> </td>
594 </tr>
595 <tr>
596 <td class="parameter_name"><p>cancellable</p></td>
597 <td class="parameter_description"><p>A <span class="type">GCancellable</span> or <code class="literal">NULL</code>. </p></td>
598 <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
599 </tr>
600 <tr>
601 <td class="parameter_name"><p>out_pid</p></td>
602 <td class="parameter_description"><p>Return location for resolved pid or <code class="literal">NULL</code>. </p></td>
603 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span></td>
604 </tr>
605 <tr>
606 <td class="parameter_name"><p>error</p></td>
607 <td class="parameter_description"><p>Return location for error.</p></td>
608 <td class="parameter_annotations"> </td>
609 </tr>
610 </tbody>
611 </table></div>
612 </div>
613 <div class="refsect3">
614 <a name="udisks-daemon-util-get-caller-pid-sync.returns"></a><h4>Returns</h4>
615 <p> <code class="literal">TRUE</code> if the process id was obtained, <code class="literal">FALSE</code> otherwise</p>
616 </div>
617 </div>
618 <hr>
619 <div class="refsect2">
620 <a name="udisks-daemon-util-setup-by-user"></a><h3>udisks_daemon_util_setup_by_user ()</h3>
621 <pre class="programlisting"><span class="returnvalue">gboolean</span>
622 udisks_daemon_util_setup_by_user (<em class="parameter"><code><a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> *daemon</code></em>,
623 <em class="parameter"><code><a class="link" href="UDisksObject.html" title="UDisksObject"><span class="type">UDisksObject</span></a> *object</code></em>,
624 <em class="parameter"><code><span class="type">uid_t</span> user</code></em>);</pre>
625 <p>Checks whether the device represented by <em class="parameter"><code>object</code></em>
626 (if any) has been
627 setup by <em class="parameter"><code>user</code></em>
628 .</p>
629 <div class="refsect3">
630 <a name="udisks-daemon-util-setup-by-user.parameters"></a><h4>Parameters</h4>
631 <div class="informaltable"><table class="informaltable" width="100%" border="0">
632 <colgroup>
633 <col width="150px" class="parameters_name">
634 <col class="parameters_description">
635 <col width="200px" class="parameters_annotations">
636 </colgroup>
637 <tbody>
638 <tr>
639 <td class="parameter_name"><p>daemon</p></td>
640 <td class="parameter_description"><p>A <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a>.</p></td>
641 <td class="parameter_annotations"> </td>
642 </tr>
643 <tr>
644 <td class="parameter_name"><p>object</p></td>
645 <td class="parameter_description"><p>The <span class="type">GDBusObject</span> that the call is on or <code class="literal">NULL</code>.</p></td>
646 <td class="parameter_annotations"> </td>
647 </tr>
648 <tr>
649 <td class="parameter_name"><p>user</p></td>
650 <td class="parameter_description"><p>The user in question.</p></td>
651 <td class="parameter_annotations"> </td>
652 </tr>
653 </tbody>
654 </table></div>
655 </div>
656 <div class="refsect3">
657 <a name="udisks-daemon-util-setup-by-user.returns"></a><h4>Returns</h4>
658 <p> <code class="literal">TRUE</code> if <em class="parameter"><code>object</code></em>
659 has been set-up by <em class="parameter"><code>user</code></em>
660 , <code class="literal">FALSE</code> if not.</p>
661 </div>
662 </div>
663 <hr>
664 <div class="refsect2">
665 <a name="udisks-daemon-util-dup-object"></a><h3>udisks_daemon_util_dup_object ()</h3>
666 <pre class="programlisting"><span class="returnvalue">gpointer</span>
667 udisks_daemon_util_dup_object (<em class="parameter"><code><span class="type">gpointer</span> interface_</code></em>,
668 <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
669 <p>Gets the enclosing <a class="link" href="UDisksObject.html" title="UDisksObject"><span class="type">UDisksObject</span></a> for <em class="parameter"><code>interface</code></em>
670 , if any.</p>
671 <div class="refsect3">
672 <a name="udisks-daemon-util-dup-object.parameters"></a><h4>Parameters</h4>
673 <div class="informaltable"><table class="informaltable" width="100%" border="0">
674 <colgroup>
675 <col width="150px" class="parameters_name">
676 <col class="parameters_description">
677 <col width="200px" class="parameters_annotations">
678 </colgroup>
679 <tbody>
680 <tr>
681 <td class="parameter_name"><p>interface_</p></td>
682 <td class="parameter_description"><p>A <span class="type">GDBusInterface</span>-derived instance. </p></td>
683 <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> GDBusInterface]</span></td>
684 </tr>
685 <tr>
686 <td class="parameter_name"><p>error</p></td>
687 <td class="parameter_description"><p><code class="literal">NULL</code>, or an unset <span class="type">GError</span> to set if the return value is <code class="literal">NULL</code>.</p></td>
688 <td class="parameter_annotations"> </td>
689 </tr>
690 </tbody>
691 </table></div>
692 </div>
693 <div class="refsect3">
694 <a name="udisks-daemon-util-dup-object.returns"></a><h4>Returns</h4>
695 <p>Either <code class="literal">NULL</code> or a
696 <a class="link" href="UDisksObject.html" title="UDisksObject"><span class="type">UDisksObject</span></a>-derived instance that must be released with
697 <code class="function">g_object_unref()</code>. </p>
698 <p><span class="annotation">[<acronym title="The caller owns the data, and is responsible for free it."><span class="acronym">transfer full</span></acronym>][<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> UDisksObject]</span></p>
699 </div>
700 </div>
701 <hr>
702 <div class="refsect2">
703 <a name="udisks-daemon-util-inhibit-system-sync"></a><h3>udisks_daemon_util_inhibit_system_sync ()</h3>
704 <pre class="programlisting"><a class="link" href="udisks2-Utilities.html#UDisksInhibitCookie" title="UDisksInhibitCookie"><span class="returnvalue">UDisksInhibitCookie</span></a> *
705 udisks_daemon_util_inhibit_system_sync
706 (<em class="parameter"><code>const <span class="type">gchar</span> *reason</code></em>);</pre>
707 <p>Tries to inhibit the system.</p>
708 <p>Right now only</p>
709 <a class="ulink" href="http://www.freedesktop.org/wiki/Software/systemd/inhibit" target="_top">systemd</a><p>inhibitors are supported but other inhibitors can be added in the future.</p>
710 <div class="refsect3">
711 <a name="udisks-daemon-util-inhibit-system-sync.parameters"></a><h4>Parameters</h4>
712 <div class="informaltable"><table class="informaltable" width="100%" border="0">
713 <colgroup>
714 <col width="150px" class="parameters_name">
715 <col class="parameters_description">
716 <col width="200px" class="parameters_annotations">
717 </colgroup>
718 <tbody><tr>
719 <td class="parameter_name"><p>reason</p></td>
720 <td class="parameter_description"><p>A human readable explanation of why the system is being inhibited.</p></td>
721 <td class="parameter_annotations"> </td>
722 </tr></tbody>
723 </table></div>
724 </div>
725 <div class="refsect3">
726 <a name="udisks-daemon-util-inhibit-system-sync.returns"></a><h4>Returns</h4>
727 <p> A cookie that can be used with <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-uninhibit-system-sync" title="udisks_daemon_util_uninhibit_system_sync ()"><code class="function">udisks_daemon_util_uninhibit_system_sync()</code></a>.</p>
728 </div>
729 </div>
730 <hr>
731 <div class="refsect2">
732 <a name="udisks-daemon-util-uninhibit-system-sync"></a><h3>udisks_daemon_util_uninhibit_system_sync ()</h3>
733 <pre class="programlisting"><span class="returnvalue">void</span>
734 udisks_daemon_util_uninhibit_system_sync
735 (<em class="parameter"><code><a class="link" href="udisks2-Utilities.html#UDisksInhibitCookie" title="UDisksInhibitCookie"><span class="type">UDisksInhibitCookie</span></a> *cookie</code></em>);</pre>
736 <p>Does nothing if <em class="parameter"><code>cookie</code></em>
737 is <code class="literal">NULL</code>, otherwise uninhibits.</p>
738 <div class="refsect3">
739 <a name="udisks-daemon-util-uninhibit-system-sync.parameters"></a><h4>Parameters</h4>
740 <div class="informaltable"><table class="informaltable" width="100%" border="0">
741 <colgroup>
742 <col width="150px" class="parameters_name">
743 <col class="parameters_description">
744 <col width="200px" class="parameters_annotations">
745 </colgroup>
746 <tbody><tr>
747 <td class="parameter_name"><p>cookie</p></td>
748 <td class="parameter_description"><p><code class="literal">NULL</code> or a cookie obtained from <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-inhibit-system-sync" title="udisks_daemon_util_inhibit_system_sync ()"><code class="function">udisks_daemon_util_inhibit_system_sync()</code></a>.</p></td>
749 <td class="parameter_annotations"> </td>
750 </tr></tbody>
751 </table></div>
752 </div>
753 </div>
754 <hr>
755 <div class="refsect2">
756 <a name="udisks-daemon-util-hexdump"></a><h3>udisks_daemon_util_hexdump ()</h3>
757 <pre class="programlisting"><span class="returnvalue">gchar</span> *
758 udisks_daemon_util_hexdump (<em class="parameter"><code><span class="type">gconstpointer</span> data</code></em>,
759 <em class="parameter"><code><span class="type">gsize</span> len</code></em>);</pre>
760 <p>Utility function to generate a hexadecimal representation of <em class="parameter"><code>len</code></em>
761
762 bytes of <em class="parameter"><code>data</code></em>
763 .</p>
764 <div class="refsect3">
765 <a name="udisks-daemon-util-hexdump.parameters"></a><h4>Parameters</h4>
766 <div class="informaltable"><table class="informaltable" width="100%" border="0">
767 <colgroup>
768 <col width="150px" class="parameters_name">
769 <col class="parameters_description">
770 <col width="200px" class="parameters_annotations">
771 </colgroup>
772 <tbody>
773 <tr>
774 <td class="parameter_name"><p>data</p></td>
775 <td class="parameter_description"><p>Pointer to data.</p></td>
776 <td class="parameter_annotations"> </td>
777 </tr>
778 <tr>
779 <td class="parameter_name"><p>len</p></td>
780 <td class="parameter_description"><p>Length of data.</p></td>
781 <td class="parameter_annotations"> </td>
782 </tr>
783 </tbody>
784 </table></div>
785 </div>
786 <div class="refsect3">
787 <a name="udisks-daemon-util-hexdump.returns"></a><h4>Returns</h4>
788 <p> A multi-line string. Free with <code class="function">g_free()</code> when done using it.</p>
789 </div>
790 </div>
791 <hr>
792 <div class="refsect2">
793 <a name="udisks-daemon-util-hexdump-debug"></a><h3>udisks_daemon_util_hexdump_debug ()</h3>
794 <pre class="programlisting"><span class="returnvalue">void</span>
795 udisks_daemon_util_hexdump_debug (<em class="parameter"><code><span class="type">gconstpointer</span> data</code></em>,
796 <em class="parameter"><code><span class="type">gsize</span> len</code></em>);</pre>
797 <p>Utility function to dumps the hexadecimal representation of <em class="parameter"><code>len</code></em>
798
799 bytes of <em class="parameter"><code>data</code></em>
800 generated with <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-hexdump" title="udisks_daemon_util_hexdump ()"><code class="function">udisks_daemon_util_hexdump()</code></a> using
801 <a class="link" href="udisks2-Logging.html#udisks-debug" title="udisks_debug()"><code class="function">udisks_debug()</code></a>.</p>
802 <div class="refsect3">
803 <a name="udisks-daemon-util-hexdump-debug.parameters"></a><h4>Parameters</h4>
804 <div class="informaltable"><table class="informaltable" width="100%" border="0">
805 <colgroup>
806 <col width="150px" class="parameters_name">
807 <col class="parameters_description">
808 <col width="200px" class="parameters_annotations">
809 </colgroup>
810 <tbody>
811 <tr>
812 <td class="parameter_name"><p>data</p></td>
813 <td class="parameter_description"><p>Pointer to data.</p></td>
814 <td class="parameter_annotations"> </td>
815 </tr>
816 <tr>
817 <td class="parameter_name"><p>len</p></td>
818 <td class="parameter_description"><p>Length of data.</p></td>
819 <td class="parameter_annotations"> </td>
820 </tr>
821 </tbody>
822 </table></div>
823 </div>
824 </div>
825 <hr>
826 <div class="refsect2">
827 <a name="udisks-daemon-util-file-set-contents"></a><h3>udisks_daemon_util_file_set_contents ()</h3>
828 <pre class="programlisting"><span class="returnvalue">gboolean</span>
829 udisks_daemon_util_file_set_contents (<em class="parameter"><code>const <span class="type">gchar</span> *filename</code></em>,
830 <em class="parameter"><code>const <span class="type">gchar</span> *contents</code></em>,
831 <em class="parameter"><code><span class="type">gssize</span> contents_len</code></em>,
832 <em class="parameter"><code><span class="type">gint</span> mode_for_new_file</code></em>,
833 <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
834 <p>Like <code class="function">g_file_set_contents()</code> but preserves the mode of the file if it
835 already exists and sets it to <em class="parameter"><code>mode_for_new_file</code></em>
836 otherwise.</p>
837 <div class="refsect3">
838 <a name="udisks-daemon-util-file-set-contents.parameters"></a><h4>Parameters</h4>
839 <div class="informaltable"><table class="informaltable" width="100%" border="0">
840 <colgroup>
841 <col width="150px" class="parameters_name">
842 <col class="parameters_description">
843 <col width="200px" class="parameters_annotations">
844 </colgroup>
845 <tbody>
846 <tr>
847 <td class="parameter_name"><p>filename</p></td>
848 <td class="parameter_description"><p>Name of a file to write <em class="parameter"><code>contents</code></em>
849 to, in the GLib file name encoding. </p></td>
850 <td class="parameter_annotations"><span class="annotation">[<acronym title="Override the parsed C type with given type."><span class="acronym">type</span></acronym> filename]</span></td>
851 </tr>
852 <tr>
853 <td class="parameter_name"><p>contents</p></td>
854 <td class="parameter_description"><p>String to write to the file. </p></td>
855 <td class="parameter_annotations"><span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=length][<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> guint8]</span></td>
856 </tr>
857 <tr>
858 <td class="parameter_name"><p>contents_len</p></td>
859 <td class="parameter_description"><p>Length of <em class="parameter"><code>contents</code></em>
860 , or -1 if <em class="parameter"><code>contents</code></em>
861 is a NUL-terminated string.</p></td>
862 <td class="parameter_annotations"> </td>
863 </tr>
864 <tr>
865 <td class="parameter_name"><p>mode_for_new_file</p></td>
866 <td class="parameter_description"><p>Mode for new file.</p></td>
867 <td class="parameter_annotations"> </td>
868 </tr>
869 <tr>
870 <td class="parameter_name"><p>error</p></td>
871 <td class="parameter_description"><p>Return location for a <span class="type">GError</span>, or <code class="literal">NULL</code>.</p></td>
872 <td class="parameter_annotations"> </td>
873 </tr>
874 </tbody>
875 </table></div>
876 </div>
877 <div class="refsect3">
878 <a name="udisks-daemon-util-file-set-contents.returns"></a><h4>Returns</h4>
879 <p> <code class="literal">TRUE</code> on success, <code class="literal">FALSE</code> if an error occurred</p>
880 </div>
881 </div>
882 <hr>
883 <div class="refsect2">
884 <a name="udisks-daemon-util-on-user-seat"></a><h3>udisks_daemon_util_on_user_seat ()</h3>
885 <pre class="programlisting"><span class="returnvalue">gboolean</span>
886 udisks_daemon_util_on_user_seat (<em class="parameter"><code><a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> *daemon</code></em>,
887 <em class="parameter"><code><a class="link" href="UDisksObject.html" title="UDisksObject"><span class="type">UDisksObject</span></a> *object</code></em>,
888 <em class="parameter"><code><span class="type">uid_t</span> user</code></em>);</pre>
889 <p>Checks whether the device represented by <em class="parameter"><code>object</code></em>
890 (if any) is plugged into
891 a seat where the caller represented by <em class="parameter"><code>user</code></em>
892 is logged in and active.</p>
893 <p>This works if <em class="parameter"><code>object</code></em>
894 is a drive or a block object.</p>
895 <div class="refsect3">
896 <a name="udisks-daemon-util-on-user-seat.parameters"></a><h4>Parameters</h4>
897 <div class="informaltable"><table class="informaltable" width="100%" border="0">
898 <colgroup>
899 <col width="150px" class="parameters_name">
900 <col class="parameters_description">
901 <col width="200px" class="parameters_annotations">
902 </colgroup>
903 <tbody>
904 <tr>
905 <td class="parameter_name"><p>daemon</p></td>
906 <td class="parameter_description"><p>A <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a>.</p></td>
907 <td class="parameter_annotations"> </td>
908 </tr>
909 <tr>
910 <td class="parameter_name"><p>object</p></td>
911 <td class="parameter_description"><p>The <span class="type">GDBusObject</span> that the call is on or <code class="literal">NULL</code>.</p></td>
912 <td class="parameter_annotations"> </td>
913 </tr>
914 <tr>
915 <td class="parameter_name"><p>user</p></td>
916 <td class="parameter_description"><p>The user to check for.</p></td>
917 <td class="parameter_annotations"> </td>
918 </tr>
919 </tbody>
920 </table></div>
921 </div>
922 <div class="refsect3">
923 <a name="udisks-daemon-util-on-user-seat.returns"></a><h4>Returns</h4>
924 <p> <code class="literal">TRUE</code> if <em class="parameter"><code>object</code></em>
925 is on the same seat as one of <em class="parameter"><code>user</code></em>
926 's
927 active sessions, <code class="literal">FALSE</code> otherwise.</p>
928 </div>
929 </div>
930 <hr>
931 <div class="refsect2">
932 <a name="udisks-daemon-util-get-free-mdraid-device"></a><h3>udisks_daemon_util_get_free_mdraid_device ()</h3>
933 <pre class="programlisting"><span class="returnvalue">gchar</span> *
934 udisks_daemon_util_get_free_mdraid_device
935 (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
936 <p>Gets a free MD RAID device.</p>
937 <div class="refsect3">
938 <a name="udisks-daemon-util-get-free-mdraid-device.returns"></a><h4>Returns</h4>
939 <p> A string of the form "/dev/mdNNN" that should be freed
940 with <code class="function">g_free()</code> or <code class="literal">NULL</code> if no free device is available.</p>
941 </div>
942 </div>
943 <hr>
944 <div class="refsect2">
945 <a name="udisks-ata-identify-get-word"></a><h3>udisks_ata_identify_get_word ()</h3>
946 <pre class="programlisting"><span class="returnvalue">guint16</span>
947 udisks_ata_identify_get_word (<em class="parameter"><code>const <span class="type">guchar</span> *identify_data</code></em>,
948 <em class="parameter"><code><span class="type">guint</span> word_number</code></em>);</pre>
949 <p>Gets a <span class="quote">“<span class="quote">word</span>”</span> from position <em class="parameter"><code>word_number</code></em>
950 from
951 <em class="parameter"><code>identify_data</code></em>
952 .</p>
953 <div class="refsect3">
954 <a name="udisks-ata-identify-get-word.parameters"></a><h4>Parameters</h4>
955 <div class="informaltable"><table class="informaltable" width="100%" border="0">
956 <colgroup>
957 <col width="150px" class="parameters_name">
958 <col class="parameters_description">
959 <col width="200px" class="parameters_annotations">
960 </colgroup>
961 <tbody>
962 <tr>
963 <td class="parameter_name"><p>identify_data</p></td>
964 <td class="parameter_description"><p>A 512-byte array containing ATA IDENTIFY or ATA IDENTIFY PACKET DEVICE data or <code class="literal">NULL</code>. </p></td>
965 <td class="parameter_annotations"><span class="annotation">[<acronym title="NULL is OK, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span></td>
966 </tr>
967 <tr>
968 <td class="parameter_name"><p>word_number</p></td>
969 <td class="parameter_description"><p>The word number to get - must be less than 256.</p></td>
970 <td class="parameter_annotations"> </td>
971 </tr>
972 </tbody>
973 </table></div>
974 </div>
975 <div class="refsect3">
976 <a name="udisks-ata-identify-get-word.returns"></a><h4>Returns</h4>
977 <p> The word at the specified position or 0 if <em class="parameter"><code>identify_data</code></em>
978 is <code class="literal">NULL</code>.</p>
979 </div>
980 </div>
981 <hr>
982 <div class="refsect2">
983 <a name="udisks-daemon-util-trigger-uevent"></a><h3>udisks_daemon_util_trigger_uevent ()</h3>
984 <pre class="programlisting"><span class="returnvalue">void</span>
985 udisks_daemon_util_trigger_uevent (<em class="parameter"><code><a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> *daemon</code></em>,
986 <em class="parameter"><code>const <span class="type">gchar</span> *device_file</code></em>,
987 <em class="parameter"><code>const <span class="type">gchar</span> *sysfs_path</code></em>);</pre>
988 <p>Triggers a 'change' uevent in the kernel.</p>
989 <p>The <em class="parameter"><code>sysfs_path</code></em>
990 takes precedence if non-NULL over a <em class="parameter"><code>device_file</code></em>
991 .
992 In case of using <em class="parameter"><code>device_file</code></em>
993 any symlinks are resolved, this expects
994 the block device has been processed by udev already.</p>
995 <p>The triggered event will bubble up from the kernel through the udev
996 stack and will eventually be received by the udisks daemon process
997 itself. This method does not wait for the event to be received.</p>
998 <div class="refsect3">
999 <a name="udisks-daemon-util-trigger-uevent.parameters"></a><h4>Parameters</h4>
1000 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1001 <colgroup>
1002 <col width="150px" class="parameters_name">
1003 <col class="parameters_description">
1004 <col width="200px" class="parameters_annotations">
1005 </colgroup>
1006 <tbody>
1007 <tr>
1008 <td class="parameter_name"><p>daemon</p></td>
1009 <td class="parameter_description"><p>A <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a>.</p></td>
1010 <td class="parameter_annotations"> </td>
1011 </tr>
1012 <tr>
1013 <td class="parameter_name"><p>device_file</p></td>
1014 <td class="parameter_description"><p>Block device file (/dev/xxx) or <code class="literal">NULL</code>.</p></td>
1015 <td class="parameter_annotations"> </td>
1016 </tr>
1017 <tr>
1018 <td class="parameter_name"><p>sysfs_path</p></td>
1019 <td class="parameter_description"><p>Device path in /sys or <code class="literal">NULL</code>.</p></td>
1020 <td class="parameter_annotations"> </td>
1021 </tr>
1022 </tbody>
1023 </table></div>
1024 </div>
1025 </div>
1026 <hr>
1027 <div class="refsect2">
1028 <a name="udisks-daemon-util-trigger-uevent-sync"></a><h3>udisks_daemon_util_trigger_uevent_sync ()</h3>
1029 <pre class="programlisting"><span class="returnvalue">gboolean</span>
1030 udisks_daemon_util_trigger_uevent_sync
1031 (<em class="parameter"><code><a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> *daemon</code></em>,
1032 <em class="parameter"><code>const <span class="type">gchar</span> *device_file</code></em>,
1033 <em class="parameter"><code>const <span class="type">gchar</span> *sysfs_path</code></em>,
1034 <em class="parameter"><code><span class="type">guint</span> timeout_seconds</code></em>);</pre>
1035 <p>Triggers a 'change' uevent in the kernel and waits until it's received and
1036 processed by udisks.</p>
1037 <p>The <em class="parameter"><code>sysfs_path</code></em>
1038 takes precedence if non-NULL over a <em class="parameter"><code>device_file</code></em>
1039 .
1040 In case of using <em class="parameter"><code>device_file</code></em>
1041 any symlinks are resolved, this expects
1042 the block device has been processed by udev already.</p>
1043 <p>Unlike <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-trigger-uevent" title="udisks_daemon_util_trigger_uevent ()"><code class="function">udisks_daemon_util_trigger_uevent()</code></a> that just triggers
1044 a synthetic uevent to the kernel, this call will actually block and wait until
1045 the <a class="link" href="UDisksLinuxProvider.html" title="UDisksLinuxProvider"><span class="type">UDisksLinuxProvider</span></a> receives the uevent, performs probing and processes
1046 the uevent further down the UDisks object stack. Upon returning from this
1047 function call the caller may assume the event has been fully processed, all
1048 D-Bus objects are updated and settled. Typically used in busy wait for
1049 a particular D-Bus interface.</p>
1050 <p>Note that this uses synthetic uevent tagging and only works on linux kernel
1051 4.13 and higher. In case an older kernel is detected this acts like the classic
1052 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-trigger-uevent" title="udisks_daemon_util_trigger_uevent ()"><code class="function">udisks_daemon_util_trigger_uevent()</code></a> call and <code class="literal">FALSE</code> is returned.</p>
1053 <div class="refsect3">
1054 <a name="udisks-daemon-util-trigger-uevent-sync.parameters"></a><h4>Parameters</h4>
1055 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1056 <colgroup>
1057 <col width="150px" class="parameters_name">
1058 <col class="parameters_description">
1059 <col width="200px" class="parameters_annotations">
1060 </colgroup>
1061 <tbody>
1062 <tr>
1063 <td class="parameter_name"><p>daemon</p></td>
1064 <td class="parameter_description"><p>A <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a>.</p></td>
1065 <td class="parameter_annotations"> </td>
1066 </tr>
1067 <tr>
1068 <td class="parameter_name"><p>device_file</p></td>
1069 <td class="parameter_description"><p>Block device file (/dev/xxx) or <code class="literal">NULL</code>.</p></td>
1070 <td class="parameter_annotations"> </td>
1071 </tr>
1072 <tr>
1073 <td class="parameter_name"><p>sysfs_path</p></td>
1074 <td class="parameter_description"><p>Device path in /sys or <code class="literal">NULL</code>.</p></td>
1075 <td class="parameter_annotations"> </td>
1076 </tr>
1077 <tr>
1078 <td class="parameter_name"><p>timeout_seconds</p></td>
1079 <td class="parameter_description"><p>Maximum time to wait for the uevent (in seconds).</p></td>
1080 <td class="parameter_annotations"> </td>
1081 </tr>
1082 </tbody>
1083 </table></div>
1084 </div>
1085 <div class="refsect3">
1086 <a name="udisks-daemon-util-trigger-uevent-sync.returns"></a><h4>Returns</h4>
1087 <p> <code class="literal">TRUE</code> if the uevent has been successfully received, <code class="literal">FALSE</code> otherwise
1088 or when the kernel version is too old.</p>
1089 </div>
1090 </div>
1091 <hr>
1092 <div class="refsect2">
1093 <a name="udisks-module-validate-name"></a><h3>udisks_module_validate_name ()</h3>
1094 <pre class="programlisting"><span class="returnvalue">gboolean</span>
1095 udisks_module_validate_name (<em class="parameter"><code>const <span class="type">gchar</span> *module_name</code></em>);</pre>
1096 <p>Checks the string for a valid udisks2 module name. Only alphanumeric characters
1097 along with the '-' and '_' separators are permitted.</p>
1098 <div class="refsect3">
1099 <a name="udisks-module-validate-name.parameters"></a><h4>Parameters</h4>
1100 <div class="informaltable"><table class="informaltable" width="100%" border="0">
1101 <colgroup>
1102 <col width="150px" class="parameters_name">
1103 <col class="parameters_description">
1104 <col width="200px" class="parameters_annotations">
1105 </colgroup>
1106 <tbody><tr>
1107 <td class="parameter_name"><p>module_name</p></td>
1108 <td class="parameter_description"><p>A udisks2 module name.</p></td>
1109 <td class="parameter_annotations"> </td>
1110 </tr></tbody>
1111 </table></div>
1112 </div>
1113 <div class="refsect3">
1114 <a name="udisks-module-validate-name.returns"></a><h4>Returns</h4>
1115 <p> <code class="literal">TRUE</code> if the string is a valid udisks2 module name, <code class="literal">FALSE</code> otherwise.</p>
1116 </div>
1117 </div>
1118 </div>
1119 <div class="refsect1">
1120 <a name="udisks2-Utilities.other_details"></a><h2>Types and Values</h2>
1121 <div class="refsect2">
1122 <a name="UDisksInhibitCookie"></a><h3>UDisksInhibitCookie</h3>
1123 <pre class="programlisting">typedef struct UDisksInhibitCookie UDisksInhibitCookie;
1124 </pre>
1125 <p>Opaque data structure used in <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-inhibit-system-sync" title="udisks_daemon_util_inhibit_system_sync ()"><code class="function">udisks_daemon_util_inhibit_system_sync()</code></a> and
1126 <a class="link" href="udisks2-Utilities.html#udisks-daemon-util-uninhibit-system-sync" title="udisks_daemon_util_uninhibit_system_sync ()"><code class="function">udisks_daemon_util_uninhibit_system_sync()</code></a>.</p>
1127 </div>
1128 </div>
1129 </div>
1130 <div class="footer">
1131 <hr>Generated by GTK-Doc V1.35.1</div>
1132 </body>
1133 </html>