chiark / gitweb /
sd-event: check clock argument to sd_event_now()
[elogind.git] / man / sd_event_source_set_userdata.xml
1 <?xml version='1.0'?> <!--*- Mode: nxml; nxml-child-indent: 2; indent-tabs-mode: nil -*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4
5 <!--
6   This file is part of elogind.
7
8   Copyright 2015 Lennart Poettering
9
10   elogind is free software; you can redistribute it and/or modify it
11   under the terms of the GNU Lesser General Public License as published by
12   the Free Software Foundation; either version 2.1 of the License, or
13   (at your option) any later version.
14
15   elogind is distributed in the hope that it will be useful, but
16   WITHOUT ANY WARRANTY; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18   Lesser General Public License for more details.
19
20   You should have received a copy of the GNU Lesser General Public License
21   along with elogind; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="sd_event_source_set_userdata" xmlns:xi="http://www.w3.org/2001/XInclude">
25
26   <refentryinfo>
27     <title>sd_event_source_set_userdata</title>
28     <productname>elogind</productname>
29
30     <authorgroup>
31       <author>
32         <contrib>Developer</contrib>
33         <firstname>Lennart</firstname>
34         <surname>Poettering</surname>
35         <email>lennart@poettering.net</email>
36       </author>
37     </authorgroup>
38   </refentryinfo>
39
40   <refmeta>
41     <refentrytitle>sd_event_source_set_userdata</refentrytitle>
42     <manvolnum>3</manvolnum>
43   </refmeta>
44
45   <refnamediv>
46     <refname>sd_event_source_set_userdata</refname>
47     <refname>sd_event_source_get_userdata</refname>
48
49     <refpurpose>Set or retrieve user data pointer of event sources</refpurpose>
50   </refnamediv>
51
52   <refsynopsisdiv>
53     <funcsynopsis>
54       <funcsynopsisinfo>#include &lt;elogind/sd-event.h&gt;</funcsynopsisinfo>
55
56       <funcprototype>
57         <funcdef>void* <function>sd_event_source_set_userdata</function></funcdef>
58         <paramdef>sd_event_source *<parameter>source</parameter></paramdef>
59         <paramdef>void *<parameter>userdata</parameter></paramdef>
60       </funcprototype>
61
62       <funcprototype>
63         <funcdef>void* <function>sd_event_source_get_userdata</function></funcdef>
64         <paramdef>sd_event_source *<parameter>source</parameter></paramdef>
65       </funcprototype>
66
67     </funcsynopsis>
68   </refsynopsisdiv>
69
70   <refsect1>
71     <title>Description</title>
72
73     <para><function>sd_event_source_set_userdata()</function> may be
74     used to set an arbitrary user data pointer for the event source
75     object specified as <parameter>source</parameter>. The user data
76     pointer is usually specified when creating an event source object
77     with calls such as
78     <citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>
79     or
80     <citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
81     and may be updated with this call. The user data pointer is also
82     passed to all handler callback functions associated with the event
83     source. The <parameter>userdata</parameter> parameter specifies
84     the new user data pointer to set, the function returns the
85     previous user data pointer. Note that <constant>NULL</constant> is
86     a valid user data pointer.</para>
87
88     <para><function>sd_event_source_get_userdata()</function> may be
89     used to query the current user data pointer assigned to the event
90     source object <parameter>source</parameter>.</para>
91   </refsect1>
92
93   <refsect1>
94     <title>Return Value</title>
95
96     <para>On success,
97     <function>sd_event_source_set_userdata()</function> and
98     <function>sd_event_source_get_userdata()</function> return the
99     previously set user data pointer. On failure, they return
100     NULL.</para>
101   </refsect1>
102
103   <xi:include href="libelogind-pkgconfig.xml" />
104
105   <refsect1>
106     <title>See Also</title>
107
108     <para>
109       <citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
110       <citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
111       <citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
112       <citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
113       <citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
114       <citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
115       <citerefentry><refentrytitle>sd_event_source_set_description</refentrytitle><manvolnum>3</manvolnum></citerefentry>
116     </para>
117   </refsect1>
118
119 </refentry>