]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/udev_device_has_tag.xml
test-execute: Add tests for new PassEnvironment= directive
[thirdparty/systemd.git] / man / udev_device_has_tag.xml
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4 <!ENTITY % entities SYSTEM "custom-entities.ent" >
5 %entities;
6 ]>
7
8 <!--
9 This file is part of systemd.
10
11 Copyright 2015 David Herrmann <dh.herrmann@gmail.com>
12
13 systemd is free software; you can redistribute it and/or modify it
14 under the terms of the GNU Lesser General Public License as published by
15 the Free Software Foundation; either version 2.1 of the License, or
16 (at your option) any later version.
17
18 systemd is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public License
24 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25 -->
26
27 <refentry id="udev_device_has_tag"
28 xmlns:xi="http://www.w3.org/2001/XInclude">
29
30 <refentryinfo>
31 <title>udev_device_has_tag</title>
32 <productname>systemd</productname>
33
34 <authorgroup>
35 <author>
36 <contrib>Developer</contrib>
37 <firstname>David</firstname>
38 <surname>Herrmann</surname>
39 <email>dh.herrmann@gmail.com</email>
40 </author>
41 </authorgroup>
42 </refentryinfo>
43
44 <refmeta>
45 <refentrytitle>udev_device_has_tag</refentrytitle>
46 <manvolnum>3</manvolnum>
47 </refmeta>
48
49 <refnamediv>
50 <refname>udev_device_has_tag</refname>
51 <refname>udev_device_get_devlinks_list_entry</refname>
52 <refname>udev_device_get_properties_list_entry</refname>
53 <refname>udev_device_get_tags_list_entry</refname>
54 <refname>udev_device_get_sysattr_list_entry</refname>
55 <refname>udev_device_get_property_value</refname>
56 <refname>udev_device_get_sysattr_value</refname>
57 <refname>udev_device_set_sysattr_value</refname>
58
59 <refpurpose>Retrieve or set device attributes</refpurpose>
60 </refnamediv>
61
62 <refsynopsisdiv>
63 <funcsynopsis>
64 <funcsynopsisinfo>#include &lt;libudev.h&gt;</funcsynopsisinfo>
65
66 <funcprototype>
67 <funcdef>struct udev_list_entry *<function>udev_device_get_devlinks_list_entry</function></funcdef>
68 <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef>
69 </funcprototype>
70
71 <funcprototype>
72 <funcdef>struct udev_list_entry *<function>udev_device_get_properties_list_entry</function></funcdef>
73 <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef>
74 </funcprototype>
75
76 <funcprototype>
77 <funcdef>struct udev_list_entry *<function>udev_device_get_tags_list_entry</function></funcdef>
78 <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef>
79 </funcprototype>
80
81 <funcprototype>
82 <funcdef>struct udev_list_entry *<function>udev_device_get_sysattr_list_entry</function></funcdef>
83 <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef>
84 </funcprototype>
85
86 <funcprototype>
87 <funcdef>const char *<function>udev_device_get_property_value</function></funcdef>
88 <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef>
89 <paramdef>const char *<parameter>key</parameter></paramdef>
90 </funcprototype>
91
92 <funcprototype>
93 <funcdef>int <function>udev_device_has_tag</function></funcdef>
94 <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef>
95 <paramdef>const char *<parameter>tag</parameter></paramdef>
96 </funcprototype>
97
98 <funcprototype>
99 <funcdef>const char *<function>udev_device_get_sysattr_value</function></funcdef>
100 <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef>
101 <paramdef>const char *<parameter>sysattr</parameter></paramdef>
102 </funcprototype>
103
104 <funcprototype>
105 <funcdef>int <function>udev_device_set_sysattr_value</function></funcdef>
106 <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef>
107 <paramdef>const char *<parameter>sysattr</parameter></paramdef>
108 <paramdef>const char *<parameter>value</parameter></paramdef>
109 </funcprototype>
110
111 </funcsynopsis>
112 </refsynopsisdiv>
113
114 <!--<refsect1>
115 <title>Description</title>
116
117 <para>XXX: Add short description.</para>
118 </refsect1>-->
119
120 <refsect1>
121 <title>Return Value</title>
122
123 <para>On success,
124 <function>udev_device_get_devlinks_list_entry()</function>,
125 <function>udev_device_get_properties_list_entry()</function>,
126 <function>udev_device_get_tags_list_entry()</function> and
127 <function>udev_device_get_sysattr_list_entry()</function> return
128 a pointer to the first entry of the retrieved list. If that list
129 is empty, or if an error occurred, <constant>NULL</constant> is
130 returned.</para>
131
132 <para>On success,
133 <function>udev_device_get_property_value()</function> and
134 <function>udev_device_get_sysattr_value()</function> return a
135 pointer to a constant string of the requested value. On error,
136 <constant>NULL</constant> is returned.</para>
137
138 <para>On success,
139 <function>udev_device_set_sysattr_value()</function> returns
140 an integer greater than, or equal to, <constant>0</constant>.
141 On failure, a negative error code is returned.</para>
142
143 <para>On success, <function>udev_device_has_tag()</function>
144 returns <constant>1</constant> or <constant>0</constant>,
145 depending on whether the device has the given tag or not.
146 On failure, a negative error code is returned.</para>
147 </refsect1>
148
149 <refsect1>
150 <title>See Also</title>
151
152 <para>
153 <citerefentry><refentrytitle>udev_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
154 <citerefentry><refentrytitle>udev_device_new_from_syspath</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
155 <citerefentry><refentrytitle>udev_device_get_syspath</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
156 <citerefentry><refentrytitle>udev_enumerate_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
157 <citerefentry><refentrytitle>udev_monitor_new_from_netlink</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
158 <citerefentry><refentrytitle>udev_list_entry</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
159 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
160 </para>
161 </refsect1>
162
163 </refentry>