06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann<?xml version='1.0'?> <!--*-nxml-*-->
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann<!ENTITY % entities SYSTEM "custom-entities.ent" >
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann%entities;
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann]>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann<!--
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann This file is part of systemd.
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann Copyright 2015 David Herrmann <dh.herrmann@gmail.com>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann systemd is free software; you can redistribute it and/or modify it
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann under the terms of the GNU Lesser General Public License as published by
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann the Free Software Foundation; either version 2.1 of the License, or
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann (at your option) any later version.
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann systemd is distributed in the hope that it will be useful, but
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann WITHOUT ANY WARRANTY; without even the implied warranty of
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann Lesser General Public License for more details.
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann You should have received a copy of the GNU Lesser General Public License
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann along with systemd; If not, see <http://www.gnu.org/licenses/>.
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann-->
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann<refentry id="udev_new"
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann xmlns:xi="http://www.w3.org/2001/XInclude">
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <refentryinfo>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <title>udev_new</title>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <productname>systemd</productname>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <authorgroup>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <author>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <contrib>Developer</contrib>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <firstname>David</firstname>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <surname>Herrmann</surname>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <email>dh.herrmann@gmail.com</email>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </author>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </authorgroup>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </refentryinfo>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <refmeta>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <refentrytitle>udev_new</refentrytitle>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <manvolnum>3</manvolnum>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </refmeta>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <refnamediv>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <refname>udev_new</refname>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <refname>udev_ref</refname>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <refname>udev_unref</refname>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <refpurpose>Create, acquire and release a udev context object</refpurpose>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </refnamediv>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <refsynopsisdiv>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <funcsynopsis>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <funcsynopsisinfo>#include &lt;libudev.h&gt;</funcsynopsisinfo>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <funcprototype>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <funcdef>struct udev *<function>udev_new</function></funcdef>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <paramdef><parameter>void</parameter></paramdef>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </funcprototype>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <funcprototype>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <funcdef>struct udev *<function>udev_ref</function></funcdef>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <paramdef>struct udev *<parameter>udev</parameter></paramdef>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </funcprototype>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <funcprototype>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <funcdef>struct udev *<function>udev_unref</function></funcdef>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <paramdef>struct udev *<parameter>udev</parameter></paramdef>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </funcprototype>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </funcsynopsis>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </refsynopsisdiv>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <refsect1>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <title>Description</title>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <para><function>udev_new()</function> allocates a new udev context
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann object and returns a pointer to it. This object is opaque and must
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann not be accessed by the caller via different means than functions
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann provided by libudev. Initially, the reference count of the context
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann is 1. You can acquire further references, and drop gained references
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann via <function>udev_ref()</function> and
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <function>udev_unref()</function>. Once the reference count hits 0,
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann the context object is destroyed and freed.</para>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </refsect1>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <refsect1>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <title>Return Value</title>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <para>On success, <function>udev_new()</function> returns a pointer
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann to the allocated udev context. On failure, <constant>NULL</constant>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann is returned. <function>udev_ref()</function> returns the argument
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann that it was passed, unmodified. <function>udev_unref()</function>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann always returns <constant>NULL</constant>.</para>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </refsect1>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <refsect1>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <title>See Also</title>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <para>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </para>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </refsect1>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann</refentry>