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