]>
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_new" | |
13 | xmlns:xi="http://www.w3.org/2001/XInclude"> | |
14 | ||
15 | <refentryinfo> | |
16 | <title>udev_new</title> | |
17 | <productname>systemd</productname> | |
06255d6f DH |
18 | </refentryinfo> |
19 | ||
20 | <refmeta> | |
21 | <refentrytitle>udev_new</refentrytitle> | |
22 | <manvolnum>3</manvolnum> | |
23 | </refmeta> | |
24 | ||
25 | <refnamediv> | |
26 | <refname>udev_new</refname> | |
27 | <refname>udev_ref</refname> | |
28 | <refname>udev_unref</refname> | |
29 | ||
30 | <refpurpose>Create, acquire and release a udev context object</refpurpose> | |
31 | </refnamediv> | |
32 | ||
33 | <refsynopsisdiv> | |
34 | <funcsynopsis> | |
35 | <funcsynopsisinfo>#include <libudev.h></funcsynopsisinfo> | |
36 | ||
37 | <funcprototype> | |
38 | <funcdef>struct udev *<function>udev_new</function></funcdef> | |
39 | <paramdef><parameter>void</parameter></paramdef> | |
40 | </funcprototype> | |
41 | ||
42 | <funcprototype> | |
43 | <funcdef>struct udev *<function>udev_ref</function></funcdef> | |
44 | <paramdef>struct udev *<parameter>udev</parameter></paramdef> | |
45 | </funcprototype> | |
46 | ||
47 | <funcprototype> | |
48 | <funcdef>struct udev *<function>udev_unref</function></funcdef> | |
49 | <paramdef>struct udev *<parameter>udev</parameter></paramdef> | |
50 | </funcprototype> | |
51 | ||
52 | </funcsynopsis> | |
53 | </refsynopsisdiv> | |
54 | ||
55 | <refsect1> | |
56 | <title>Description</title> | |
57 | ||
58 | <para><function>udev_new()</function> allocates a new udev context | |
59 | object and returns a pointer to it. This object is opaque and must | |
60 | not be accessed by the caller via different means than functions | |
61 | provided by libudev. Initially, the reference count of the context | |
62 | is 1. You can acquire further references, and drop gained references | |
63 | via <function>udev_ref()</function> and | |
64 | <function>udev_unref()</function>. Once the reference count hits 0, | |
65 | the context object is destroyed and freed.</para> | |
66 | </refsect1> | |
67 | ||
68 | <refsect1> | |
69 | <title>Return Value</title> | |
70 | ||
71 | <para>On success, <function>udev_new()</function> returns a pointer | |
72 | to the allocated udev context. On failure, <constant>NULL</constant> | |
73 | is returned. <function>udev_ref()</function> returns the argument | |
74 | that it was passed, unmodified. <function>udev_unref()</function> | |
75 | always returns <constant>NULL</constant>.</para> | |
76 | </refsect1> | |
77 | ||
78 | <refsect1> | |
79 | <title>See Also</title> | |
80 | ||
81 | <para> | |
82 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
83 | </para> | |
84 | </refsect1> | |
85 | ||
86 | </refentry> |