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