]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/sd_event_set_name.xml
Merge pull request #245 from poettering/always-sdbus-man-pages
[thirdparty/systemd.git] / man / sd_event_set_name.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 <!ENTITY % entities SYSTEM "custom-entities.ent" >
5 %entities;
6 ]>
7
8 <!--
9 This file is part of systemd.
10
11 Copyright 2014 Zbigniew Jędrzejewski-Szmek
12
13 systemd is free software; you can redistribute it and/or modify it
14 under the terms of the GNU Lesser General Public License as published by
15 the Free Software Foundation; either version 2.1 of the License, or
16 (at your option) any later version.
17
18 systemd is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 Lesser General Public License for more details.
22
23 You should have received a copy of the GNU Lesser General Public License
24 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25 -->
26
27 <refentry id="sd_event_set_name"
28 xmlns:xi="http://www.w3.org/2001/XInclude">
29
30 <refentryinfo>
31 <title>sd_event_set_name</title>
32 <productname>systemd</productname>
33
34 <authorgroup>
35 <author>
36 <contrib>More text</contrib>
37 <firstname>Zbigniew</firstname>
38 <surname>Jędrzejewski-Szmek</surname>
39 <email>zbyszek@in.waw.pl</email>
40 </author>
41 </authorgroup>
42 </refentryinfo>
43
44 <refmeta>
45 <refentrytitle>sd_event_set_name</refentrytitle>
46 <manvolnum>3</manvolnum>
47 </refmeta>
48
49 <refnamediv>
50 <refname>sd_event_set_name</refname>
51 <refname>sd_event_get_name</refname>
52
53 <refpurpose>Set human-readable names for event sources</refpurpose>
54 </refnamediv>
55
56 <refsynopsisdiv>
57 <funcsynopsis>
58 <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
59
60 <funcprototype>
61 <funcdef>int <function>sd_event_set_name</function></funcdef>
62 <paramdef>sd_event_source *<parameter>source</parameter></paramdef>
63 <paramdef>const char *<parameter>name</parameter></paramdef>
64 </funcprototype>
65
66 <funcprototype>
67 <funcdef>int <function>sd_event_get_name</function></funcdef>
68 <paramdef>sd_event_source *<parameter>source</parameter></paramdef>
69 <paramdef>const char **<parameter>name</parameter></paramdef>
70 </funcprototype>
71
72 </funcsynopsis>
73 </refsynopsisdiv>
74
75 <refsect1>
76 <title>Description</title>
77
78 <para><function>sd_event_set_name()</function> can be used to set
79 an arbitrary name for the event source
80 <parameter>source</parameter>. This name will be used in error
81 messages generated by
82 <citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>
83 for this source. Specified <parameter>name</parameter> must point
84 to a <constant>NUL</constant>-terminated string or be
85 <constant>NULL</constant>. In the latter case, the name will be
86 unset. The string is copied internally, so the
87 <parameter>name</parameter> argument is not referenced after the
88 function returns.</para>
89
90 <para><function>sd_event_set_name()</function> can be used to
91 query the current name assigned to source
92 <parameter>source</parameter>. It returns a pointer to the current
93 name (possibly <constant>NULL</constant>) in
94 <parameter>name</parameter>.</para>
95 </refsect1>
96
97 <refsect1>
98 <title>Return Value</title>
99
100 <para>On success, <function>sd_event_set_name()</function> and
101 <function>sd_event_get_name()</function> return a
102 non-negative integer. On failure, they return a negative
103 errno-style error code.</para>
104 </refsect1>
105
106 <refsect1>
107 <title>Errors</title>
108
109 <para>Returned errors may indicate the following problems:</para>
110
111 <variablelist>
112 <varlistentry>
113 <term><constant>-EINVAL</constant></term>
114
115 <listitem><para><parameter>source</parameter> is not a valid
116 pointer to an <structname>sd_event_source</structname>
117 structure or the <parameter>name</parameter> argument for
118 <function>sd_event_get_name()</function> is
119 <constant>NULL</constant>.</para></listitem>
120 </varlistentry>
121
122 <varlistentry>
123 <term><constant>-ENOMEM</constant></term>
124
125 <listitem><para>Not enough memory to copy the
126 name.</para></listitem>
127 </varlistentry>
128 </variablelist>
129 </refsect1>
130
131 <refsect1>
132 <title>Notes</title>
133
134 <para>Functions described here are available as a
135 shared library, which can be compiled and linked to with the
136 <constant>libsystemd</constant> <citerefentry
137 project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
138 file.</para>
139 </refsect1>
140
141 <refsect1>
142 <title>See Also</title>
143
144 <para>
145 <citerefentry><refentrytitle>sd-event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
146 <citerefentry><refentrytitle>sd_event_add_time</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
147 <citerefentry><refentrytitle>sd_event_add_child</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
148 <citerefentry><refentrytitle>sd_event_add_signal</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
149 <citerefentry><refentrytitle>sd_event_add_defer</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
150 <citerefentry><refentrytitle>sd_event_run</refentrytitle><manvolnum>3</manvolnum></citerefentry>
151 </para>
152 </refsect1>
153
154 </refentry>