]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/udev_new.xml
tree-wide: beautify remaining copyright statements
[thirdparty/systemd.git] / man / udev_new.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 SPDX-License-Identifier: LGPL-2.1+
10
11 Copyright © 2015 David Herrmann <dh.herrmann@gmail.com>
12 -->
13
14 <refentry id="udev_new"
15 xmlns:xi="http://www.w3.org/2001/XInclude">
16
17 <refentryinfo>
18 <title>udev_new</title>
19 <productname>systemd</productname>
20
21 <authorgroup>
22 <author>
23 <contrib>Developer</contrib>
24 <firstname>David</firstname>
25 <surname>Herrmann</surname>
26 <email>dh.herrmann@gmail.com</email>
27 </author>
28 </authorgroup>
29 </refentryinfo>
30
31 <refmeta>
32 <refentrytitle>udev_new</refentrytitle>
33 <manvolnum>3</manvolnum>
34 </refmeta>
35
36 <refnamediv>
37 <refname>udev_new</refname>
38 <refname>udev_ref</refname>
39 <refname>udev_unref</refname>
40
41 <refpurpose>Create, acquire and release a udev context object</refpurpose>
42 </refnamediv>
43
44 <refsynopsisdiv>
45 <funcsynopsis>
46 <funcsynopsisinfo>#include &lt;libudev.h&gt;</funcsynopsisinfo>
47
48 <funcprototype>
49 <funcdef>struct udev *<function>udev_new</function></funcdef>
50 <paramdef><parameter>void</parameter></paramdef>
51 </funcprototype>
52
53 <funcprototype>
54 <funcdef>struct udev *<function>udev_ref</function></funcdef>
55 <paramdef>struct udev *<parameter>udev</parameter></paramdef>
56 </funcprototype>
57
58 <funcprototype>
59 <funcdef>struct udev *<function>udev_unref</function></funcdef>
60 <paramdef>struct udev *<parameter>udev</parameter></paramdef>
61 </funcprototype>
62
63 </funcsynopsis>
64 </refsynopsisdiv>
65
66 <refsect1>
67 <title>Description</title>
68
69 <para><function>udev_new()</function> allocates a new udev context
70 object and returns a pointer to it. This object is opaque and must
71 not be accessed by the caller via different means than functions
72 provided by libudev. Initially, the reference count of the context
73 is 1. You can acquire further references, and drop gained references
74 via <function>udev_ref()</function> and
75 <function>udev_unref()</function>. Once the reference count hits 0,
76 the context object is destroyed and freed.</para>
77 </refsect1>
78
79 <refsect1>
80 <title>Return Value</title>
81
82 <para>On success, <function>udev_new()</function> returns a pointer
83 to the allocated udev context. On failure, <constant>NULL</constant>
84 is returned. <function>udev_ref()</function> returns the argument
85 that it was passed, unmodified. <function>udev_unref()</function>
86 always returns <constant>NULL</constant>.</para>
87 </refsect1>
88
89 <refsect1>
90 <title>See Also</title>
91
92 <para>
93 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
94 </para>
95 </refsect1>
96
97 </refentry>