systemd/docs/libudev/html/libudev-udev-enumerate.html
2014-12-12 19:54:51 +02:00

772 lines
31 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>libudev Reference Manual: udev_enumerate</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="libudev Reference Manual">
<link rel="up" href="ch01.html" title="API Reference">
<link rel="prev" href="libudev-udev-monitor.html" title="udev_monitor">
<link rel="next" href="libudev-udev-queue.html" title="udev_queue">
<meta name="generator" content="GTK-Doc V1.21 (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="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
<a href="#libudev-udev-enumerate.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="libudev-udev-monitor.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="libudev-udev-queue.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libudev-udev-enumerate"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libudev-udev-enumerate.top_of_page"></a>udev_enumerate</span></h2>
<p>udev_enumerate — lookup and sort sys devices</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libudev-udev-enumerate.functions"></a><h2>Functions</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="functions_return">
<col class="functions_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">struct <a class="link" href="libudev-udev-enumerate.html#udev-enumerate" title="struct udev_enumerate"><span class="returnvalue">udev_enumerate</span></a> *
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-ref" title="udev_enumerate_ref ()">udev_enumerate_ref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">struct <a class="link" href="libudev-udev-enumerate.html#udev-enumerate" title="struct udev_enumerate"><span class="returnvalue">udev_enumerate</span></a> *
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-unref" title="udev_enumerate_unref ()">udev_enumerate_unref</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">struct <a class="link" href="libudev-udev.html#udev" title="struct udev"><span class="returnvalue">udev</span></a> *
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-get-udev" title="udev_enumerate_get_udev ()">udev_enumerate_get_udev</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">struct <a class="link" href="libudev-udev-enumerate.html#udev-enumerate" title="struct udev_enumerate"><span class="returnvalue">udev_enumerate</span></a> *
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-new" title="udev_enumerate_new ()">udev_enumerate_new</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-add-match-subsystem" title="udev_enumerate_add_match_subsystem ()">udev_enumerate_add_match_subsystem</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-add-nomatch-subsystem" title="udev_enumerate_add_nomatch_subsystem ()">udev_enumerate_add_nomatch_subsystem</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-add-match-sysattr" title="udev_enumerate_add_match_sysattr ()">udev_enumerate_add_match_sysattr</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-add-nomatch-sysattr" title="udev_enumerate_add_nomatch_sysattr ()">udev_enumerate_add_nomatch_sysattr</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-add-match-property" title="udev_enumerate_add_match_property ()">udev_enumerate_add_match_property</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-add-match-tag" title="udev_enumerate_add_match_tag ()">udev_enumerate_add_match_tag</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-add-match-parent" title="udev_enumerate_add_match_parent ()">udev_enumerate_add_match_parent</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-add-match-is-initialized" title="udev_enumerate_add_match_is_initialized ()">udev_enumerate_add_match_is_initialized</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-add-match-sysname" title="udev_enumerate_add_match_sysname ()">udev_enumerate_add_match_sysname</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-add-syspath" title="udev_enumerate_add_syspath ()">udev_enumerate_add_syspath</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-scan-devices" title="udev_enumerate_scan_devices ()">udev_enumerate_scan_devices</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">int</span>
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-scan-subsystems" title="udev_enumerate_scan_subsystems ()">udev_enumerate_scan_subsystems</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> *
</td>
<td class="function_name">
<a class="link" href="libudev-udev-enumerate.html#udev-enumerate-get-list-entry" title="udev_enumerate_get_list_entry ()">udev_enumerate_get_list_entry</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libudev-udev-enumerate.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="name">
<col class="description">
</colgroup>
<tbody><tr>
<td class="datatype_keyword">struct</td>
<td class="function_name"><a class="link" href="libudev-udev-enumerate.html#udev-enumerate" title="struct udev_enumerate">udev_enumerate</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libudev-udev-enumerate.description"></a><h2>Description</h2>
<p>Lookup devices in the sys filesystem, filter devices by properties,
and return a sorted list of devices.</p>
</div>
<div class="refsect1">
<a name="libudev-udev-enumerate.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="udev-enumerate-ref"></a><h3>udev_enumerate_ref ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-enumerate.html#udev-enumerate" title="struct udev_enumerate"><span class="returnvalue">udev_enumerate</span></a> *
udev_enumerate_ref (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);</pre>
<p>Take a reference of a enumeration context.</p>
<div class="refsect3">
<a name="id-1.2.6.6.2.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>udev_enumerate</p></td>
<td class="parameter_description"><p>context</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.2.6"></a><h4>Returns</h4>
<p> the passed enumeration context</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udev-enumerate-unref"></a><h3>udev_enumerate_unref ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-enumerate.html#udev-enumerate" title="struct udev_enumerate"><span class="returnvalue">udev_enumerate</span></a> *
udev_enumerate_unref (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);</pre>
<p>Drop a reference of an enumeration context. If the refcount reaches zero,
all resources of the enumeration context will be released.</p>
<div class="refsect3">
<a name="id-1.2.6.6.3.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>udev_enumerate</p></td>
<td class="parameter_description"><p>context</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.3.6"></a><h4>Returns</h4>
<p> <span class="type">NULL</span></p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udev-enumerate-get-udev"></a><h3>udev_enumerate_get_udev ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev.html#udev" title="struct udev"><span class="returnvalue">udev</span></a> *
udev_enumerate_get_udev (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);</pre>
<p>Get the udev library context.</p>
<div class="refsect3">
<a name="id-1.2.6.6.4.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>udev_enumerate</p></td>
<td class="parameter_description"><p>context</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.4.6"></a><h4>Returns</h4>
<p> a pointer to the context.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udev-enumerate-new"></a><h3>udev_enumerate_new ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-enumerate.html#udev-enumerate" title="struct udev_enumerate"><span class="returnvalue">udev_enumerate</span></a> *
udev_enumerate_new (<em class="parameter"><code><span class="type">struct udev</span> *udev</code></em>);</pre>
<p>Create an enumeration context to scan /sys.</p>
<div class="refsect3">
<a name="id-1.2.6.6.5.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>udev</p></td>
<td class="parameter_description"><p>udev library context</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.5.6"></a><h4>Returns</h4>
<p> an enumeration context.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udev-enumerate-add-match-subsystem"></a><h3>udev_enumerate_add_match_subsystem ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
udev_enumerate_add_match_subsystem (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *subsystem</code></em>);</pre>
<p>Match only devices belonging to a certain kernel subsystem.</p>
<div class="refsect3">
<a name="id-1.2.6.6.6.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>udev_enumerate</p></td>
<td class="parameter_description"><p>context</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>subsystem</p></td>
<td class="parameter_description"><p>filter for a subsystem of the device to include in the list</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.6.6"></a><h4>Returns</h4>
<p> 0 on success, otherwise a negative error value.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udev-enumerate-add-nomatch-subsystem"></a><h3>udev_enumerate_add_nomatch_subsystem ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
udev_enumerate_add_nomatch_subsystem (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *subsystem</code></em>);</pre>
<p>Match only devices not belonging to a certain kernel subsystem.</p>
<div class="refsect3">
<a name="id-1.2.6.6.7.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>udev_enumerate</p></td>
<td class="parameter_description"><p>context</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>subsystem</p></td>
<td class="parameter_description"><p>filter for a subsystem of the device to exclude from the list</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.7.6"></a><h4>Returns</h4>
<p> 0 on success, otherwise a negative error value.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udev-enumerate-add-match-sysattr"></a><h3>udev_enumerate_add_match_sysattr ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
udev_enumerate_add_match_sysattr (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *sysattr</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *value</code></em>);</pre>
<p>Match only devices with a certain /sys device attribute.</p>
<div class="refsect3">
<a name="id-1.2.6.6.8.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>udev_enumerate</p></td>
<td class="parameter_description"><p>context</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>sysattr</p></td>
<td class="parameter_description"><p>filter for a sys attribute at the device to include in the list</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>optional value of the sys attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.8.6"></a><h4>Returns</h4>
<p> 0 on success, otherwise a negative error value.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udev-enumerate-add-nomatch-sysattr"></a><h3>udev_enumerate_add_nomatch_sysattr ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
udev_enumerate_add_nomatch_sysattr (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *sysattr</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *value</code></em>);</pre>
<p>Match only devices not having a certain /sys device attribute.</p>
<div class="refsect3">
<a name="id-1.2.6.6.9.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>udev_enumerate</p></td>
<td class="parameter_description"><p>context</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>sysattr</p></td>
<td class="parameter_description"><p>filter for a sys attribute at the device to exclude from the list</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>optional value of the sys attribute</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.9.6"></a><h4>Returns</h4>
<p> 0 on success, otherwise a negative error value.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udev-enumerate-add-match-property"></a><h3>udev_enumerate_add_match_property ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
udev_enumerate_add_match_property (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *property</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *value</code></em>);</pre>
<p>Match only devices with a certain property.</p>
<div class="refsect3">
<a name="id-1.2.6.6.10.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>udev_enumerate</p></td>
<td class="parameter_description"><p>context</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>property</p></td>
<td class="parameter_description"><p>filter for a property of the device to include in the list</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>value</p></td>
<td class="parameter_description"><p>value of the property</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.10.6"></a><h4>Returns</h4>
<p> 0 on success, otherwise a negative error value.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udev-enumerate-add-match-tag"></a><h3>udev_enumerate_add_match_tag ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
udev_enumerate_add_match_tag (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *tag</code></em>);</pre>
<p>Match only devices with a certain tag.</p>
<div class="refsect3">
<a name="id-1.2.6.6.11.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>udev_enumerate</p></td>
<td class="parameter_description"><p>context</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>tag</p></td>
<td class="parameter_description"><p>filter for a tag of the device to include in the list</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.11.6"></a><h4>Returns</h4>
<p> 0 on success, otherwise a negative error value.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udev-enumerate-add-match-parent"></a><h3>udev_enumerate_add_match_parent ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
udev_enumerate_add_match_parent (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code><span class="type">struct udev_device</span> *parent</code></em>);</pre>
<p>Return the devices on the subtree of one given device. The parent
itself is included in the list.</p>
<p>A reference for the device is held until the udev_enumerate context
is cleaned up.</p>
<div class="refsect3">
<a name="id-1.2.6.6.12.6"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>udev_enumerate</p></td>
<td class="parameter_description"><p>context</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>parent</p></td>
<td class="parameter_description"><p>parent device where to start searching</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.12.7"></a><h4>Returns</h4>
<p> 0 on success, otherwise a negative error value.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udev-enumerate-add-match-is-initialized"></a><h3>udev_enumerate_add_match_is_initialized ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
udev_enumerate_add_match_is_initialized
(<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);</pre>
<p>Match only devices which udev has set up already. This makes
sure, that the device node permissions and context are properly set
and that network devices are fully renamed.</p>
<p>Usually, devices which are found in the kernel but not already
handled by udev, have still pending events. Services should subscribe
to monitor events and wait for these devices to become ready, instead
of using uninitialized devices.</p>
<p>For now, this will not affect devices which do not have a device node
and are not network interfaces.</p>
<div class="refsect3">
<a name="id-1.2.6.6.13.7"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>udev_enumerate</p></td>
<td class="parameter_description"><p>context</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.13.8"></a><h4>Returns</h4>
<p> 0 on success, otherwise a negative error value.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udev-enumerate-add-match-sysname"></a><h3>udev_enumerate_add_match_sysname ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
udev_enumerate_add_match_sysname (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *sysname</code></em>);</pre>
<p>Match only devices with a given /sys device name.</p>
<div class="refsect3">
<a name="id-1.2.6.6.14.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>udev_enumerate</p></td>
<td class="parameter_description"><p>context</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>sysname</p></td>
<td class="parameter_description"><p>filter for the name of the device to include in the list</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.14.6"></a><h4>Returns</h4>
<p> 0 on success, otherwise a negative error value.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udev-enumerate-add-syspath"></a><h3>udev_enumerate_add_syspath ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
udev_enumerate_add_syspath (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>,
<em class="parameter"><code>const <span class="type">char</span> *syspath</code></em>);</pre>
<p>Add a device to the list of devices, to retrieve it back sorted in dependency order.</p>
<div class="refsect3">
<a name="id-1.2.6.6.15.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>udev_enumerate</p></td>
<td class="parameter_description"><p>context</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>syspath</p></td>
<td class="parameter_description"><p>path of a device</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.15.6"></a><h4>Returns</h4>
<p> 0 on success, otherwise a negative error value.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udev-enumerate-scan-devices"></a><h3>udev_enumerate_scan_devices ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
udev_enumerate_scan_devices (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);</pre>
<p>Scan /sys for all devices which match the given filters. No matches
will return all currently available devices.</p>
<div class="refsect3">
<a name="id-1.2.6.6.16.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>udev_enumerate</p></td>
<td class="parameter_description"><p>udev enumeration context</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.16.6"></a><h4>Returns</h4>
<p> 0 on success, otherwise a negative error value.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udev-enumerate-scan-subsystems"></a><h3>udev_enumerate_scan_subsystems ()</h3>
<pre class="programlisting"><span class="returnvalue">int</span>
udev_enumerate_scan_subsystems (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);</pre>
<p>Scan /sys for all kernel subsystems, including buses, classes, drivers.</p>
<div class="refsect3">
<a name="id-1.2.6.6.17.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>udev_enumerate</p></td>
<td class="parameter_description"><p>udev enumeration context</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.17.6"></a><h4>Returns</h4>
<p> 0 on success, otherwise a negative error value.</p>
<p></p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="udev-enumerate-get-list-entry"></a><h3>udev_enumerate_get_list_entry ()</h3>
<pre class="programlisting">struct <a class="link" href="libudev-udev-list.html#udev-list-entry" title="struct udev_list_entry"><span class="returnvalue">udev_list_entry</span></a> *
udev_enumerate_get_list_entry (<em class="parameter"><code><span class="type">struct udev_enumerate</span> *udev_enumerate</code></em>);</pre>
<p>Get the first entry of the sorted list of device paths.</p>
<div class="refsect3">
<a name="id-1.2.6.6.18.5"></a><h4>Parameters</h4>
<div class="informaltable"><table width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>udev_enumerate</p></td>
<td class="parameter_description"><p>context</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="id-1.2.6.6.18.6"></a><h4>Returns</h4>
<p> a udev_list_entry.</p>
<p></p>
</div>
</div>
</div>
<div class="refsect1">
<a name="libudev-udev-enumerate.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="udev-enumerate"></a><h3>struct udev_enumerate</h3>
<pre class="programlisting">struct udev_enumerate;</pre>
<p>Opaque object representing one device lookup/sort context.</p>
</div>
</div>
</div>
<div class="footer">
<hr>
Generated by GTK-Doc V1.21</div>
</body>
</html>