chiark / gitweb /
man: drop unused <authorgroup> tags from man sources
[elogind.git] / man / sd_bus_message_read_basic.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   SPDX-License-Identifier: LGPL-2.1+
7
8   Copyright © 2016 Julian Orth
9 -->
10
11 <refentry id="sd_bus_message_read_basic">
12
13   <refentryinfo>
14     <title>sd_bus_message_read_basic</title>
15     <productname>systemd</productname>
16   </refentryinfo>
17
18   <refmeta>
19     <refentrytitle>sd_bus_message_read_basic</refentrytitle>
20     <manvolnum>3</manvolnum>
21   </refmeta>
22
23   <refnamediv>
24     <refname>sd_bus_message_read_basic</refname>
25
26     <refpurpose>Read a basic type from a message</refpurpose>
27   </refnamediv>
28
29   <refsynopsisdiv>
30     <funcsynopsis>
31       <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
32
33       <funcprototype>
34         <funcdef>int <function>sd_bus_message_read_basic</function></funcdef>
35         <paramdef>sd_bus_message *<parameter>m</parameter></paramdef>
36         <paramdef>char <parameter>type</parameter></paramdef>
37         <paramdef>void *<parameter>p</parameter></paramdef>
38       </funcprototype>
39     </funcsynopsis>
40   </refsynopsisdiv>
41
42   <refsect1>
43     <title>Description</title>
44
45     <para>
46       <function>sd_bus_message_read_basic()</function> reads a basic type from a
47       message and advances the read position in the message. The set of basic
48       types and their ascii codes passed in <parameter>type</parameter> are
49       described in the <ulink
50         url="https://dbus.freedesktop.org/doc/dbus-specification.html">D-Bus
51         Specification</ulink>.
52     </para>
53
54     <para>
55       If <parameter>p</parameter> is not NULL, it should contain a pointer to an
56       appropriate object. For example, if <parameter>type</parameter> is
57       <constant>'y'</constant>, the object passed in <parameter>p</parameter>
58       should have type <code>uint8_t *</code>. If <parameter>type</parameter>
59       is <constant>'s'</constant>, the object passed in <parameter>p</parameter>
60       should have type <code>const char **</code>. Note that, if the basic type
61       is a pointer (e.g., <code>const char *</code> in the case of a string),
62       the pointer is only borrowed and the contents must be copied if they are
63       to be used after the end of the messages lifetime. Similarly, during the
64       lifetime of such a pointer, the message must not be modified.
65     </para>
66
67     <para>
68       If there is no object of the specified type at the current position in the
69       message, an error is returned.
70     </para>
71   </refsect1>
72
73   <refsect1>
74     <title>Return Value</title>
75
76     <para>
77       On success, <function>sd_bus_message_read_basic()</function> returns 0 or
78       a positive integer. On failure, it returns a negative errno-style error
79       code.
80     </para>
81   </refsect1>
82
83   <refsect1>
84     <title>See Also</title>
85
86     <para>
87       <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
88       <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
89     </para>
90   </refsect1>
91
92 </refentry>