| 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.5/docbookx.dtd"> |
| 4 |
<!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
| 5 |
|
| 6 |
<refentry id="sd_varlink_set_description" xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 7 |
|
| 8 |
<refentryinfo> |
| 9 |
<title>sd_varlink_set_description</title> |
| 10 |
<productname>systemd</productname> |
| 11 |
</refentryinfo> |
| 12 |
|
| 13 |
<refmeta> |
| 14 |
<refentrytitle>sd_varlink_set_description</refentrytitle> |
| 15 |
<manvolnum>3</manvolnum> |
| 16 |
</refmeta> |
| 17 |
|
| 18 |
<refnamediv> |
| 19 |
<refname>sd_varlink_set_description</refname> |
| 20 |
<refname>sd_varlink_get_description</refname> |
| 21 |
|
| 22 |
<refpurpose>Set or query description of a Varlink connection object</refpurpose> |
| 23 |
</refnamediv> |
| 24 |
|
| 25 |
<refsynopsisdiv> |
| 26 |
<funcsynopsis> |
| 27 |
<funcsynopsisinfo>#include <systemd/sd-varlink.h></funcsynopsisinfo> |
| 28 |
|
| 29 |
<funcprototype> |
| 30 |
<funcdef>int <function>sd_varlink_set_description</function></funcdef> |
| 31 |
<paramdef>sd_varlink *<parameter>link</parameter></paramdef> |
| 32 |
<paramdef>const char *<parameter>description</parameter></paramdef> |
| 33 |
</funcprototype> |
| 34 |
|
| 35 |
<funcprototype> |
| 36 |
<funcdef>const char* <function>sd_varlink_get_description</function></funcdef> |
| 37 |
<paramdef>sd_varlink *<parameter>link</parameter></paramdef> |
| 38 |
</funcprototype> |
| 39 |
</funcsynopsis> |
| 40 |
</refsynopsisdiv> |
| 41 |
|
| 42 |
<refsect1> |
| 43 |
<title>Description</title> |
| 44 |
|
| 45 |
<para><function>sd_varlink_set_description()</function> sets the description string that is used in |
| 46 |
logging to the specified string. The string is copied internally and freed when the Varlink connection |
| 47 |
object is deallocated. The <parameter>description</parameter> argument may be <constant>NULL</constant>, |
| 48 |
in which case the description is unset.</para> |
| 49 |
|
| 50 |
<para><function>sd_varlink_get_description()</function> returns a description string for the specified |
| 51 |
Varlink connection. This string may have been previously set with |
| 52 |
<function>sd_varlink_set_description()</function>. If not set this way, a default string or |
| 53 |
<constant>NULL</constant> may be returned, depending how the connection was allocated and set up.</para> |
| 54 |
</refsect1> |
| 55 |
|
| 56 |
<refsect1> |
| 57 |
<title>Return Value</title> |
| 58 |
|
| 59 |
<para>On success, <function>sd_varlink_set_description()</function> returns a non-negative integer. On |
| 60 |
failure, it returns a negative errno-style error code. <function>sd_varlink_get_description()</function> |
| 61 |
returns either <constant>NULL</constant> or a pointer to the description string.</para> |
| 62 |
|
| 63 |
<refsect2> |
| 64 |
<title>Errors</title> |
| 65 |
|
| 66 |
<para>Returned errors may indicate the following problems:</para> |
| 67 |
|
| 68 |
<variablelist> |
| 69 |
<varlistentry> |
| 70 |
<term><constant>-EINVAL</constant></term> |
| 71 |
|
| 72 |
<listitem><para>An argument is invalid.</para></listitem> |
| 73 |
</varlistentry> |
| 74 |
|
| 75 |
<varlistentry> |
| 76 |
<term><constant>-ENOMEM</constant></term> |
| 77 |
|
| 78 |
<listitem><para>Memory allocation failed.</para></listitem> |
| 79 |
</varlistentry> |
| 80 |
</variablelist> |
| 81 |
</refsect2> |
| 82 |
</refsect1> |
| 83 |
|
| 84 |
<xi:include href="libsystemd-pkgconfig.xml" /> |
| 85 |
|
| 86 |
<refsect1> |
| 87 |
<title>History</title> |
| 88 |
<para><function>sd_varlink_set_description()</function> was added in version 257.</para> |
| 89 |
<para><function>sd_varlink_get_description()</function> was added in version 258.</para> |
| 90 |
</refsect1> |
| 91 |
|
| 92 |
<refsect1> |
| 93 |
<title>See Also</title> |
| 94 |
|
| 95 |
<para><simplelist type="inline"> |
| 96 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 97 |
<member><citerefentry><refentrytitle>sd-varlink</refentrytitle><manvolnum>3</manvolnum></citerefentry></member> |
| 98 |
</simplelist></para> |
| 99 |
</refsect1> |
| 100 |
|
| 101 |
</refentry> |