]>
Commit | Line | Data |
---|---|---|
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 | 9 | SPDX-License-Identifier: LGPL-2.1+ |
06255d6f DH |
10 | --> |
11 | ||
12 | <refentry id="udev_device_has_tag" | |
13 | xmlns:xi="http://www.w3.org/2001/XInclude"> | |
14 | ||
15 | <refentryinfo> | |
16 | <title>udev_device_has_tag</title> | |
17 | <productname>systemd</productname> | |
06255d6f DH |
18 | </refentryinfo> |
19 | ||
20 | <refmeta> | |
21 | <refentrytitle>udev_device_has_tag</refentrytitle> | |
22 | <manvolnum>3</manvolnum> | |
23 | </refmeta> | |
24 | ||
25 | <refnamediv> | |
26 | <refname>udev_device_has_tag</refname> | |
27 | <refname>udev_device_get_devlinks_list_entry</refname> | |
28 | <refname>udev_device_get_properties_list_entry</refname> | |
29 | <refname>udev_device_get_tags_list_entry</refname> | |
30 | <refname>udev_device_get_sysattr_list_entry</refname> | |
31 | <refname>udev_device_get_property_value</refname> | |
32 | <refname>udev_device_get_sysattr_value</refname> | |
33 | <refname>udev_device_set_sysattr_value</refname> | |
34 | ||
35 | <refpurpose>Retrieve or set device attributes</refpurpose> | |
36 | </refnamediv> | |
37 | ||
38 | <refsynopsisdiv> | |
39 | <funcsynopsis> | |
40 | <funcsynopsisinfo>#include <libudev.h></funcsynopsisinfo> | |
41 | ||
42 | <funcprototype> | |
43 | <funcdef>struct udev_list_entry *<function>udev_device_get_devlinks_list_entry</function></funcdef> | |
44 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
45 | </funcprototype> | |
46 | ||
47 | <funcprototype> | |
48 | <funcdef>struct udev_list_entry *<function>udev_device_get_properties_list_entry</function></funcdef> | |
49 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
50 | </funcprototype> | |
51 | ||
52 | <funcprototype> | |
53 | <funcdef>struct udev_list_entry *<function>udev_device_get_tags_list_entry</function></funcdef> | |
54 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
55 | </funcprototype> | |
56 | ||
57 | <funcprototype> | |
58 | <funcdef>struct udev_list_entry *<function>udev_device_get_sysattr_list_entry</function></funcdef> | |
59 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
60 | </funcprototype> | |
61 | ||
62 | <funcprototype> | |
63 | <funcdef>const char *<function>udev_device_get_property_value</function></funcdef> | |
64 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
65 | <paramdef>const char *<parameter>key</parameter></paramdef> | |
66 | </funcprototype> | |
67 | ||
68 | <funcprototype> | |
69 | <funcdef>int <function>udev_device_has_tag</function></funcdef> | |
70 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
71 | <paramdef>const char *<parameter>tag</parameter></paramdef> | |
72 | </funcprototype> | |
73 | ||
74 | <funcprototype> | |
75 | <funcdef>const char *<function>udev_device_get_sysattr_value</function></funcdef> | |
76 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
77 | <paramdef>const char *<parameter>sysattr</parameter></paramdef> | |
78 | </funcprototype> | |
79 | ||
80 | <funcprototype> | |
81 | <funcdef>int <function>udev_device_set_sysattr_value</function></funcdef> | |
82 | <paramdef>struct udev_device *<parameter>udev_device</parameter></paramdef> | |
83 | <paramdef>const char *<parameter>sysattr</parameter></paramdef> | |
84 | <paramdef>const char *<parameter>value</parameter></paramdef> | |
85 | </funcprototype> | |
86 | ||
87 | </funcsynopsis> | |
88 | </refsynopsisdiv> | |
89 | ||
90 | <!--<refsect1> | |
91 | <title>Description</title> | |
92 | ||
93 | <para>XXX: Add short description.</para> | |
94 | </refsect1>--> | |
95 | ||
96 | <refsect1> | |
97 | <title>Return Value</title> | |
98 | ||
99 | <para>On success, | |
100 | <function>udev_device_get_devlinks_list_entry()</function>, | |
101 | <function>udev_device_get_properties_list_entry()</function>, | |
102 | <function>udev_device_get_tags_list_entry()</function> and | |
103 | <function>udev_device_get_sysattr_list_entry()</function> return | |
104 | a pointer to the first entry of the retrieved list. If that list | |
105 | is empty, or if an error occurred, <constant>NULL</constant> is | |
106 | returned.</para> | |
107 | ||
108 | <para>On success, | |
109 | <function>udev_device_get_property_value()</function> and | |
110 | <function>udev_device_get_sysattr_value()</function> return a | |
111 | pointer to a constant string of the requested value. On error, | |
8e44f571 SM |
112 | <constant>NULL</constant> is returned. Attributes that may |
113 | contain <constant>NUL</constant> bytes should not be retrieved | |
114 | with <function>udev_device_get_sysattr_value()</function>; | |
115 | instead, read them directly from the files within the device's | |
116 | <property>syspath</property>.</para> | |
06255d6f DH |
117 | |
118 | <para>On success, | |
119 | <function>udev_device_set_sysattr_value()</function> returns | |
120 | an integer greater than, or equal to, <constant>0</constant>. | |
8e44f571 SM |
121 | On failure, a negative error code is returned. Values that |
122 | contain <constant>NUL</constant> bytes should not be set with | |
123 | this function; instead, write them directly to the files within | |
124 | the device's <property>syspath</property>.</para> | |
06255d6f DH |
125 | |
126 | <para>On success, <function>udev_device_has_tag()</function> | |
127 | returns <constant>1</constant> or <constant>0</constant>, | |
128 | depending on whether the device has the given tag or not. | |
129 | On failure, a negative error code is returned.</para> | |
130 | </refsect1> | |
131 | ||
132 | <refsect1> | |
133 | <title>See Also</title> | |
134 | ||
135 | <para> | |
136 | <citerefentry><refentrytitle>udev_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
137 | <citerefentry><refentrytitle>udev_device_new_from_syspath</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
138 | <citerefentry><refentrytitle>udev_device_get_syspath</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
139 | <citerefentry><refentrytitle>udev_enumerate_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
140 | <citerefentry><refentrytitle>udev_monitor_new_from_netlink</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
141 | <citerefentry><refentrytitle>udev_list_entry</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
142 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
143 | </para> | |
144 | </refsect1> | |
145 | ||
146 | </refentry> |