1 <?xml version='
1.0'
?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4 <!ENTITY % entities SYSTEM
"custom-entities.ent" >
7 <!-- SPDX-License-Identifier: LGPL-2.1+ -->
9 <refentry id=
"udev_device_has_tag"
10 xmlns:
xi=
"http://www.w3.org/2001/XInclude">
13 <title>udev_device_has_tag
</title>
14 <productname>systemd
</productname>
18 <refentrytitle>udev_device_has_tag
</refentrytitle>
19 <manvolnum>3</manvolnum>
23 <refname>udev_device_has_tag
</refname>
24 <refname>udev_device_get_devlinks_list_entry
</refname>
25 <refname>udev_device_get_properties_list_entry
</refname>
26 <refname>udev_device_get_tags_list_entry
</refname>
27 <refname>udev_device_get_sysattr_list_entry
</refname>
28 <refname>udev_device_get_property_value
</refname>
29 <refname>udev_device_get_sysattr_value
</refname>
30 <refname>udev_device_set_sysattr_value
</refname>
32 <refpurpose>Retrieve or set device attributes
</refpurpose>
37 <funcsynopsisinfo>#include
<libudev.h
></funcsynopsisinfo>
40 <funcdef>struct udev_list_entry *
<function>udev_device_get_devlinks_list_entry
</function></funcdef>
41 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
45 <funcdef>struct udev_list_entry *
<function>udev_device_get_properties_list_entry
</function></funcdef>
46 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
50 <funcdef>struct udev_list_entry *
<function>udev_device_get_tags_list_entry
</function></funcdef>
51 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
55 <funcdef>struct udev_list_entry *
<function>udev_device_get_sysattr_list_entry
</function></funcdef>
56 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
60 <funcdef>const char *
<function>udev_device_get_property_value
</function></funcdef>
61 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
62 <paramdef>const char *
<parameter>key
</parameter></paramdef>
66 <funcdef>int
<function>udev_device_has_tag
</function></funcdef>
67 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
68 <paramdef>const char *
<parameter>tag
</parameter></paramdef>
72 <funcdef>const char *
<function>udev_device_get_sysattr_value
</function></funcdef>
73 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
74 <paramdef>const char *
<parameter>sysattr
</parameter></paramdef>
78 <funcdef>int
<function>udev_device_set_sysattr_value
</function></funcdef>
79 <paramdef>struct udev_device *
<parameter>udev_device
</parameter></paramdef>
80 <paramdef>const char *
<parameter>sysattr
</parameter></paramdef>
81 <paramdef>const char *
<parameter>value
</parameter></paramdef>
88 <title>Description</title>
90 <para>XXX: Add short description.</para>
94 <title>Return Value
</title>
97 <function>udev_device_get_devlinks_list_entry()
</function>,
98 <function>udev_device_get_properties_list_entry()
</function>,
99 <function>udev_device_get_tags_list_entry()
</function> and
100 <function>udev_device_get_sysattr_list_entry()
</function> return
101 a pointer to the first entry of the retrieved list. If that list
102 is empty, or if an error occurred,
<constant>NULL
</constant> is
106 <function>udev_device_get_property_value()
</function> and
107 <function>udev_device_get_sysattr_value()
</function> return a
108 pointer to a constant string of the requested value. On error,
109 <constant>NULL
</constant> is returned. Attributes that may
110 contain
<constant>NUL
</constant> bytes should not be retrieved
111 with
<function>udev_device_get_sysattr_value()
</function>;
112 instead, read them directly from the files within the device's
113 <property>syspath
</property>.
</para>
116 <function>udev_device_set_sysattr_value()
</function> returns
117 an integer greater than, or equal to,
<constant>0</constant>.
118 On failure, a negative error code is returned. Values that
119 contain
<constant>NUL
</constant> bytes should not be set with
120 this function; instead, write them directly to the files within
121 the device's
<property>syspath
</property>.
</para>
123 <para>On success,
<function>udev_device_has_tag()
</function>
124 returns
<constant>1</constant> or
<constant>0</constant>,
125 depending on whether the device has the given tag or not.
126 On failure, a negative error code is returned.
</para>
130 <title>See Also
</title>
133 <citerefentry><refentrytitle>udev_new
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
134 <citerefentry><refentrytitle>udev_device_new_from_syspath
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
135 <citerefentry><refentrytitle>udev_device_get_syspath
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
136 <citerefentry><refentrytitle>udev_enumerate_new
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
137 <citerefentry><refentrytitle>udev_monitor_new_from_netlink
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
138 <citerefentry><refentrytitle>udev_list_entry
</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
139 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,