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 This file is part of systemd.
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann Copyright 2015 David Herrmann <dh.herrmann@gmail.com>
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 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 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 <refentryinfo>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <authorgroup>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </authorgroup>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </refentryinfo>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <refpurpose>Create, acquire and release a udev context object</refpurpose>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </refnamediv>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <refsynopsisdiv>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <funcsynopsis>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann <funcsynopsisinfo>#include <libudev.h></funcsynopsisinfo>
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 <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 <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 </funcsynopsis>
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann </refsynopsisdiv>
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 <function>udev_unref()</function>. Once the reference count hits 0,
06255d6f76f3f630a9634d745a48910b1ea3e4d3David Herrmann the context object is destroyed and freed.</para>
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 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,