1<?xml version='1.0'?>
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
5
6<refentry id="sd_event_source_get_event" xmlns:xi="http://www.w3.org/2001/XInclude">
7
8  <refentryinfo>
9    <title>sd_event_source_get_event</title>
10    <productname>systemd</productname>
11  </refentryinfo>
12
13  <refmeta>
14    <refentrytitle>sd_event_source_get_event</refentrytitle>
15    <manvolnum>3</manvolnum>
16  </refmeta>
17
18  <refnamediv>
19    <refname>sd_event_source_get_event</refname>
20
21    <refpurpose>Retrieve the event loop of an event source</refpurpose>
22  </refnamediv>
23
24  <refsynopsisdiv>
25    <funcsynopsis>
26      <funcsynopsisinfo>#include &lt;systemd/sd-event.h&gt;</funcsynopsisinfo>
27
28      <funcprototype>
29        <funcdef>sd_event* <function>sd_event_source_get_event</function></funcdef>
30        <paramdef>sd_event_source *<parameter>source</parameter></paramdef>
31      </funcprototype>
32
33    </funcsynopsis>
34  </refsynopsisdiv>
35
36  <refsect1>
37    <title>Description</title>
38
39    <para><function>sd_event_source_get_event()</function> may be used
40    to retrieve the event loop object the event source object specified
41    as <parameter>source</parameter> is associated with. The event
42    loop object is specified when creating an event source object with
43    calls such as
44    <citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>
45    or
46    <citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para>
47  </refsect1>
48
49  <refsect1>
50    <title>Return Value</title>
51
52    <para>On success, <function>sd_event_source_get_event()</function>
53    returns the associated event loop object. On failure, it returns
54    <constant>NULL</constant>.</para>
55  </refsect1>
56
57  <xi:include href="libsystemd-pkgconfig.xml" />
58
59  <refsect1>
60    <title>See Also</title>
61
62    <para>
63      <citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
64      <citerefentry><refentrytitle>sd_event_add_io</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
65      <citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
66      <citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
67      <citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
68      <citerefentry><refentrytitle>sd_event_add_inotify</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
69      <citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
70      <citerefentry><refentrytitle>sd_event_source_set_userdata</refentrytitle><manvolnum>3</manvolnum></citerefentry>
71    </para>
72  </refsect1>
73
74</refentry>
75