]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/udev_new.xml
test-execute: Add tests for new PassEnvironment= directive
[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 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_new"
28 xmlns:xi="http://www.w3.org/2001/XInclude">
29
30 <refentryinfo>
31 <title>udev_new</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_new</refentrytitle>
46 <manvolnum>3</manvolnum>
47 </refmeta>
48
49 <refnamediv>
50 <refname>udev_new</refname>
51 <refname>udev_ref</refname>
52 <refname>udev_unref</refname>
53
54 <refpurpose>Create, acquire and release a udev context object</refpurpose>
55 </refnamediv>
56
57 <refsynopsisdiv>
58 <funcsynopsis>
59 <funcsynopsisinfo>#include &lt;libudev.h&gt;</funcsynopsisinfo>
60
61 <funcprototype>
62 <funcdef>struct udev *<function>udev_new</function></funcdef>
63 <paramdef><parameter>void</parameter></paramdef>
64 </funcprototype>
65
66 <funcprototype>
67 <funcdef>struct udev *<function>udev_ref</function></funcdef>
68 <paramdef>struct udev *<parameter>udev</parameter></paramdef>
69 </funcprototype>
70
71 <funcprototype>
72 <funcdef>struct udev *<function>udev_unref</function></funcdef>
73 <paramdef>struct udev *<parameter>udev</parameter></paramdef>
74 </funcprototype>
75
76 </funcsynopsis>
77 </refsynopsisdiv>
78
79 <refsect1>
80 <title>Description</title>
81
82 <para><function>udev_new()</function> allocates a new udev context
83 object and returns a pointer to it. This object is opaque and must
84 not be accessed by the caller via different means than functions
85 provided by libudev. Initially, the reference count of the context
86 is 1. You can acquire further references, and drop gained references
87 via <function>udev_ref()</function> and
88 <function>udev_unref()</function>. Once the reference count hits 0,
89 the context object is destroyed and freed.</para>
90 </refsect1>
91
92 <refsect1>
93 <title>Return Value</title>
94
95 <para>On success, <function>udev_new()</function> returns a pointer
96 to the allocated udev context. On failure, <constant>NULL</constant>
97 is returned. <function>udev_ref()</function> returns the argument
98 that it was passed, unmodified. <function>udev_unref()</function>
99 always returns <constant>NULL</constant>.</para>
100 </refsect1>
101
102 <refsect1>
103 <title>See Also</title>
104
105 <para>
106 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
107 </para>
108 </refsect1>
109
110 </refentry>