Browse Source

Fix documentation building an inheritance rules

Signed-off-by: Sven Eden <seden@havi.de>
pull/181/head
Sven Eden 5 months ago
parent
commit
66dfdf619c
7 changed files with 876 additions and 32 deletions
  1. +5
    -5
      man/elogind.time.xml
  2. +2
    -2
      man/logind.conf.xml
  3. +125
    -19
      man/rules/meson.build
  4. +651
    -0
      man/sd_bus_add_object.xml
  5. +6
    -5
      man/sd_journal_query_unique.xml
  6. +1
    -1
      pwx
  7. +86
    -0
      tools/update-man-rules.py

+ 5
- 5
man/elogind.time.xml View File

@ -100,16 +100,16 @@
<refsect1>
<title>Parsing Timestamps</title>
<!-- 0 /// No timedatectl in elogind
--><!-- else // 0 -->
timezone, or the timezone name in the IANA timezone database format.
<!-- // 0 -->
<para>When parsing, elogind will accept a similar syntax, but expects no timezone specification, unless
it is given as the literal string <literal>UTC</literal> (for the UTC timezone), or is specified to be
<!-- 0 /// No timedatectl in elogind
the locally configured timezone, or the timezone name in the IANA timezone database format. The complete
list of timezones supported on your system can be obtained using the <literal>timedatectl
list-timezones</literal> (see
<citerefentry><refentrytitle>timedatectl</refentrytitle><manvolnum>1</manvolnum></citerefentry>). Using
--><!-- else // 0 -->
the locally configured timezone, or the timezone name in the IANA timezone database format. Using
<!-- // 0 -->
IANA format is recommended over local timezone names, as less prone to errors (e.g. with local timezone
it's possible to specify daylight saving time in winter, even though that is not correct). The weekday
specification is optional, but when the weekday is specified, it must either be in the abbreviated
@ -291,8 +291,8 @@ Wed..Sat,Tue 12-10-15 1:2:3 → Tue..Sat 2012-10-15 01:02:03
<para>Use the <command>calendar</command> command of
<citerefentry><refentrytitle>systemd-analyze</refentrytitle><manvolnum>1</manvolnum></citerefentry> to validate
and normalize calendar time specifications for testing purposes. The tool also calculates when a specified
// 0 -->
calendar event would occur next.</para>
// 0 -->
</refsect1>
<refsect1>

+ 2
- 2
man/logind.conf.xml View File

@ -67,6 +67,7 @@
<!-- 0 /// elogind also supports a few system commands
<para>All options are configured in the
[Login] section:</para>
--><!-- else // 0 -->
<para>All login options are configured in the
<literal>[Login]</literal> section, system sleep options are
@ -76,7 +77,6 @@
<!-- 1 /// elogind needs a second level, as we use two sections. -->
<refsect2><title>[Login] section:</title>
<!-- // 1 -->
[Login] section:</para>
<variablelist class='config-directives'>
<!-- 0 /// elogind has no support for AutoVT
@ -327,8 +327,8 @@
<varlistentry>
<term><varname>HoldoffTimeoutSec=</varname></term>
<!-- 0 /// Wow. Unbelievable how often you can write 'elogind' in one tiny paragraph. Lets improve this for elogind a bit.
<listitem><para>Specifies a period of time after system startup or
<!-- 0 /// Wow. Unbelievable how often you can write 'systemd' in one tiny paragraph. Lets improve this for elogind a bit.
system resume in which systemd will hold off on reacting to
lid events. This is required for the system to properly
detect any hotplugged devices so systemd can ignore lid events

+ 125
- 19
man/rules/meson.build View File

@ -1,4 +1,4 @@
# Do not edit. Generated by make-man-rules.py.
# Do not edit. Generated by update-man-rules.py.
# Update with:
# ninja -C build man/update-man-rules
manpages = [
@ -21,7 +21,8 @@ manpages = [
'sd_bus_match_signal',
'sd_bus_match_signal_async'],
''],
['sd_bus_add_object_vtable',
['sd_bus_add_node_enumerator', '3', [], ''],
['sd_bus_add_object',
'3',
['SD_BUS_METHOD',
'SD_BUS_METHOD_WITH_NAMES',
@ -34,10 +35,22 @@ manpages = [
'SD_BUS_VTABLE_END',
'SD_BUS_VTABLE_START',
'SD_BUS_WRITABLE_PROPERTY',
'sd_bus_add_fallback_vtable'],
'sd_bus_add_fallback',
'sd_bus_add_fallback_vtable',
'sd_bus_add_filter',
'sd_bus_add_object_vtable'],
''],
['sd_bus_add_object_manager', '3', [], ''],
['sd_bus_attach_event', '3', ['sd_bus_detach_event', 'sd_bus_get_event'], ''],
['sd_bus_close', '3', ['sd_bus_flush'], ''],
['sd_bus_call', '3', ['sd_bus_call_async'], ''],
['sd_bus_call_method',
'3',
['sd_bus_call_method_async',
'sd_bus_call_method_asyncv',
'sd_bus_call_methodv'],
''],
['sd_bus_can_send', '3', [], ''],
['sd_bus_close', '3', ['sd_bus_default_flush_close', 'sd_bus_flush'], ''],
['sd_bus_creds_get_pid',
'3',
['sd_bus_creds_get_audit_login_uid',
@ -95,6 +108,18 @@ manpages = [
'sd_bus_open_user_with_description',
'sd_bus_open_with_description'],
''],
['sd_bus_emit_signal',
'3',
['sd_bus_emit_interfaces_added',
'sd_bus_emit_interfaces_added_strv',
'sd_bus_emit_interfaces_removed',
'sd_bus_emit_interfaces_removed_strv',
'sd_bus_emit_object_added',
'sd_bus_emit_object_removed',
'sd_bus_emit_properties_changed',
'sd_bus_emit_properties_changed_strv',
'sd_bus_emit_signalv'],
''],
['sd_bus_error',
'3',
['SD_BUS_ERROR_MAKE_CONST',
@ -116,9 +141,27 @@ manpages = [
'3',
['SD_BUS_ERROR_END', 'SD_BUS_ERROR_MAP', 'sd_bus_error_map'],
''],
['sd_bus_get_fd', '3', ['sd_bus_get_events', 'sd_bus_get_timeout'], ''],
['sd_bus_get_current_handler',
'3',
['sd_bus_get_current_message',
'sd_bus_get_current_slot',
'sd_bus_get_current_userdata'],
''],
['sd_bus_get_fd',
'3',
['sd_bus_get_events', 'sd_bus_get_timeout', 'sd_bus_set_fd'],
''],
['sd_bus_get_n_queued_read', '3', ['sd_bus_get_n_queued_write'], ''],
['sd_bus_get_name_creds', '3', ['sd_bus_get_owner_creds'], ''],
['sd_bus_get_name_machine_id', '3', [], ''],
['sd_bus_interface_name_is_valid',
'3',
['sd_bus_member_name_is_valid',
'sd_bus_object_path_is_valid',
'sd_bus_service_name_is_valid'],
''],
['sd_bus_is_open', '3', ['sd_bus_is_ready'], ''],
['sd_bus_list_names', '3', [], ''],
['sd_bus_message_append', '3', ['sd_bus_message_appendv'], ''],
['sd_bus_message_append_array',
'3',
@ -145,7 +188,10 @@ manpages = [
''],
['sd_bus_message_get_type',
'3',
['sd_bus_message_is_method_call',
['sd_bus_message_get_creds',
'sd_bus_message_get_errno',
'sd_bus_message_get_error',
'sd_bus_message_is_method_call',
'sd_bus_message_is_method_error',
'sd_bus_message_is_signal'],
''],
@ -171,10 +217,20 @@ manpages = [
'sd_bus_message_new_method_errorf'],
''],
['sd_bus_message_new_signal', '3', [], ''],
['sd_bus_message_read', '3', ['sd_bus_message_readv'], ''],
['sd_bus_message_open_container',
'3',
['sd_bus_message_close_container',
'sd_bus_message_enter_container',
'sd_bus_message_exit_container'],
''],
['sd_bus_message_read',
'3',
['sd_bus_message_peek_type', 'sd_bus_message_readv'],
''],
['sd_bus_message_read_array', '3', [], ''],
['sd_bus_message_read_basic', '3', [], ''],
['sd_bus_message_rewind', '3', [], ''],
['sd_bus_message_seal', '3', [], ''],
['sd_bus_message_set_destination',
'3',
['sd_bus_message_get_destination',
@ -186,15 +242,19 @@ manpages = [
''],
['sd_bus_message_set_expect_reply',
'3',
['sd_bus_message_get_auto_start',
['sd_bus_message_get_allow_interactive_authorization',
'sd_bus_message_get_auto_start',
'sd_bus_message_get_expect_reply',
'sd_bus_message_set_allow_interactive_authorization',
'sd_bus_message_set_auto_start'],
''],
['sd_bus_message_skip', '3', [], ''],
['sd_bus_message_verify_type', '3', [], ''],
['sd_bus_negotiate_fds',
'3',
['sd_bus_negotiate_creds', 'sd_bus_negotiate_timestamp'],
['sd_bus_get_creds_mask',
'sd_bus_negotiate_creds',
'sd_bus_negotiate_timestamp'],
''],
['sd_bus_new',
'3',
@ -211,34 +271,70 @@ manpages = [
['sd_bus_path_decode', 'sd_bus_path_decode_many', 'sd_bus_path_encode_many'],
''],
['sd_bus_process', '3', [], ''],
['sd_bus_query_sender_creds', '3', ['sd_bus_query_sender_privilege'], ''],
['sd_bus_reply_method_error',
'3',
['sd_bus_reply_method_errno',
'sd_bus_reply_method_errnof',
'sd_bus_reply_method_errorf'],
'sd_bus_reply_method_errnofv',
'sd_bus_reply_method_errorf',
'sd_bus_reply_method_errorfv'],
''],
['sd_bus_reply_method_return', '3', ['sd_bus_reply_method_returnv'], ''],
['sd_bus_request_name',
'3',
['sd_bus_release_name',
'sd_bus_release_name_async',
'sd_bus_request_name_async'],
''],
['sd_bus_send', '3', ['sd_bus_send_to'], ''],
['sd_bus_set_address', '3', ['sd_bus_get_address', 'sd_bus_set_exec'], ''],
['sd_bus_set_close_on_exit', '3', ['sd_bus_get_close_on_exit'], ''],
['sd_bus_set_connected_signal', '3', ['sd_bus_get_connected_signal'], ''],
['sd_bus_set_description',
'3',
['sd_bus_get_allow_interactive_authorization',
'sd_bus_get_description',
'sd_bus_get_scope',
'sd_bus_get_tid',
'sd_bus_get_unique_name',
'sd_bus_is_anonymous',
'sd_bus_is_trusted',
'sd_bus_set_allow_interactive_authorization',
'sd_bus_set_anonymous',
'sd_bus_set_trusted'],
''],
['sd_bus_set_exit_on_disconnect', '3', ['sd_bus_get_exit_on_disconnect'], ''],
['sd_bus_set_method_call_timeout',
'3',
['sd_bus_get_method_call_timeout'],
''],
['sd_bus_set_property',
'3',
['sd_bus_get_property',
'sd_bus_get_property_string',
'sd_bus_get_property_strv',
'sd_bus_get_property_trivial',
'sd_bus_set_propertyv'],
''],
['sd_bus_set_sender', '3', ['sd_bus_get_sender'], ''],
['sd_bus_set_server',
'3',
['sd_bus_get_bus_id',
'sd_bus_is_bus_client',
'sd_bus_is_monitor',
'sd_bus_is_server',
'sd_bus_set_bus_client',
'sd_bus_set_monitor'],
''],
['sd_bus_set_watch_bind', '3', ['sd_bus_get_watch_bind'], ''],
['sd_bus_slot_ref',
['sd_bus_slot_get_bus',
'3',
['sd_bus_slot_get_bus', 'sd_bus_slot_unref', 'sd_bus_slot_unrefp'],
['sd_bus_slot_get_current_handler',
'sd_bus_slot_get_current_message',
'sd_bus_slot_get_current_userdata'],
''],
['sd_bus_slot_ref', '3', ['sd_bus_slot_unref', 'sd_bus_slot_unrefp'], ''],
['sd_bus_slot_set_description', '3', ['sd_bus_slot_get_description'], ''],
['sd_bus_slot_set_destroy_callback',
'3',
@ -249,6 +345,7 @@ manpages = [
''],
['sd_bus_slot_set_floating', '3', ['sd_bus_slot_get_floating'], ''],
['sd_bus_slot_set_userdata', '3', ['sd_bus_slot_get_userdata'], ''],
['sd_bus_start', '3', [], ''],
['sd_bus_track_add_name',
'3',
['sd_bus_track_add_sender',
@ -421,6 +518,7 @@ manpages = [
['sd_journal_get_data',
'3',
['SD_JOURNAL_FOREACH_DATA',
'sd_journal_enumerate_available_data',
'sd_journal_enumerate_data',
'sd_journal_get_data_threshold',
'sd_journal_restart_data',
@ -450,19 +548,26 @@ manpages = [
'sd_journal_open_directory',
'sd_journal_open_directory_fd',
'sd_journal_open_files',
'sd_journal_open_files_fd'],
'sd_journal_open_files_fd',
'sd_journal_open_namespace'],
''],
['sd_journal_print',
'3',
['SD_JOURNAL_SUPPRESS_LOCATION',
'sd_journal_perror',
'sd_journal_perror_with_location',
'sd_journal_print_with_location',
'sd_journal_printv',
'sd_journal_printv_with_location',
'sd_journal_send',
'sd_journal_sendv'],
'sd_journal_send_with_location',
'sd_journal_sendv',
'sd_journal_sendv_with_location'],
''],
['sd_journal_query_unique',
'3',
['SD_JOURNAL_FOREACH_UNIQUE',
'sd_journal_enumerate_available_unique',
'sd_journal_enumerate_unique',
'sd_journal_restart_unique'],
''],
@ -491,7 +596,11 @@ manpages = [
['sd_machine_get_class', '3', ['sd_machine_get_ifindices'], ''],
['sd_notify',
'3',
['sd_notifyf', 'sd_pid_notify', 'sd_pid_notify_with_fds', 'sd_pid_notifyf'],
['sd_notify_barrier',
'sd_notifyf',
'sd_pid_notify',
'sd_pid_notify_with_fds',
'sd_pid_notifyf'],
''],
['sd_pid_get_owner_uid',
'3',
@ -513,10 +622,7 @@ manpages = [
'HAVE_PAM'],
['sd_seat_get_active',
'3',
['sd_seat_can_graphical',
'sd_seat_can_multi_session',
'sd_seat_can_tty',
'sd_seat_get_sessions'],
['sd_seat_can_graphical', 'sd_seat_can_tty', 'sd_seat_get_sessions'],
'HAVE_PAM'],
['sd_session_is_active',
'3',

+ 651
- 0
man/sd_bus_add_object.xml View File

@ -0,0 +1,651 @@
<?xml version='1.0'?> <!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<!-- SPDX-License-Identifier: LGPL-2.1+ -->
<refentry id="sd_bus_add_object"
xmlns:xi="http://www.w3.org/2001/XInclude">
<refentryinfo>
<title>sd_bus_add_object</title>
<productname>elogind</productname>
</refentryinfo>
<refmeta>
<refentrytitle>sd_bus_add_object</refentrytitle>
<manvolnum>3</manvolnum>
</refmeta>
<refnamediv>
<refname>sd_bus_add_object</refname>
<refname>sd_bus_add_fallback</refname>
<refname>sd_bus_add_object_vtable</refname>
<refname>sd_bus_add_fallback_vtable</refname>
<refname>sd_bus_add_filter</refname>
<refname>SD_BUS_VTABLE_START</refname>
<refname>SD_BUS_VTABLE_END</refname>
<refname>SD_BUS_METHOD_WITH_NAMES_OFFSET</refname>
<refname>SD_BUS_METHOD_WITH_NAMES</refname>
<refname>SD_BUS_METHOD_WITH_OFFSET</refname>
<refname>SD_BUS_METHOD</refname>
<refname>SD_BUS_SIGNAL_WITH_NAMES</refname>
<refname>SD_BUS_SIGNAL</refname>
<refname>SD_BUS_WRITABLE_PROPERTY</refname>
<refname>SD_BUS_PROPERTY</refname>
<refname>SD_BUS_PARAM</refname>
<refpurpose>Declare properties and methods for a D-Bus path</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>#include &lt;elogind/sd-bus-vtable.h&gt;</funcsynopsisinfo>
<xi:include href="sd_bus_add_match.xml" xpointer="sd_bus_message_handler_t"/>
<funcprototype>
<funcdef>typedef int (*<function>sd_bus_property_get_t</function>)</funcdef>
<paramdef>sd_bus *<parameter>bus</parameter></paramdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
<paramdef>const char *<parameter>interface</parameter></paramdef>
<paramdef>const char *<parameter>property</parameter></paramdef>
<paramdef>sd_bus_message *<parameter>reply</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
<paramdef>sd_bus_error *<parameter>ret_error</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>typedef int (*<function>sd_bus_property_set_t</function>)</funcdef>
<paramdef>sd_bus *<parameter>bus</parameter></paramdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
<paramdef>const char *<parameter>interface</parameter></paramdef>
<paramdef>const char *<parameter>property</parameter></paramdef>
<paramdef>sd_bus_message *<parameter>value</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
<paramdef>sd_bus_error *<parameter>ret_error</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>typedef int (*<function>sd_bus_object_find_t</function>)</funcdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
<paramdef>const char *<parameter>interface</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
<paramdef>void **<parameter>ret_found</parameter></paramdef>
<paramdef>sd_bus_error *<parameter>ret_error</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_bus_add_object</function></funcdef>
<paramdef>sd_bus *<parameter>bus</parameter></paramdef>
<paramdef>sd_bus_slot **<parameter>slot</parameter></paramdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
<paramdef>sd_bus_message_handler_t <parameter>callback</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_bus_add_fallback</function></funcdef>
<paramdef>sd_bus *<parameter>bus</parameter></paramdef>
<paramdef>sd_bus_slot **<parameter>slot</parameter></paramdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
<paramdef>sd_bus_message_handler_t <parameter>callback</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_bus_add_object_vtable</function></funcdef>
<paramdef>sd_bus *<parameter>bus</parameter></paramdef>
<paramdef>sd_bus_slot **<parameter>slot</parameter></paramdef>
<paramdef>const char *<parameter>path</parameter></paramdef>
<paramdef>const char *<parameter>interface</parameter></paramdef>
<paramdef>const sd_bus_vtable *<parameter>vtable</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_bus_add_fallback_vtable</function></funcdef>
<paramdef>sd_bus *<parameter>bus</parameter></paramdef>
<paramdef>sd_bus_slot **<parameter>slot</parameter></paramdef>
<paramdef>const char *<parameter>prefix</parameter></paramdef>
<paramdef>const char *<parameter>interface</parameter></paramdef>
<paramdef>const sd_bus_vtable *<parameter>vtable</parameter></paramdef>
<paramdef>sd_bus_object_find_t <parameter>find</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>int <function>sd_bus_add_filter</function></funcdef>
<paramdef>sd_bus *<parameter>bus</parameter></paramdef>
<paramdef>sd_bus_slot **<parameter>slot</parameter></paramdef>
<paramdef>sd_bus_message_handler_t <parameter>callback</parameter></paramdef>
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
<para>
<constant>SD_BUS_VTABLE_START(<replaceable>flags</replaceable>)</constant>
</para>
<para>
<constant>SD_BUS_VTABLE_END</constant>
</para>
<para>
<constant>SD_BUS_METHOD_WITH_ARGS_OFFSET(
<replaceable>member</replaceable>,
<replaceable>args</replaceable>,
<replaceable>result</replaceable>,
<replaceable>handler</replaceable>,
<replaceable>offset</replaceable>,
<replaceable>flags</replaceable>)
</constant>
</para>
<para>
<constant>SD_BUS_METHOD_WITH_ARGS(
<replaceable>member</replaceable>,
<replaceable>args</replaceable>,
<replaceable>result</replaceable>,
<replaceable>handler</replaceable>,
<replaceable>flags</replaceable>)
</constant>
</para>
<para>
<constant>SD_BUS_METHOD_WITH_NAMES_OFFSET(
<replaceable>member</replaceable>,
<replaceable>signature</replaceable>,
<replaceable>in_names</replaceable>,
<replaceable>result</replaceable>,
<replaceable>out_names</replaceable>,
<replaceable>handler</replaceable>,
<replaceable>offset</replaceable>,
<replaceable>flags</replaceable>)
</constant>
</para>
<para>
<constant>SD_BUS_METHOD_WITH_NAMES(
<replaceable>member</replaceable>,
<replaceable>signature</replaceable>,
<replaceable>in_names</replaceable>,
<replaceable>result</replaceable>,
<replaceable>out_names</replaceable>,
<replaceable>handler</replaceable>,
<replaceable>flags</replaceable>)
</constant>
</para>
<para>
<constant>SD_BUS_METHOD_WITH_OFFSET(
<replaceable>member</replaceable>,
<replaceable>signature</replaceable>,
<replaceable>result</replaceable>,
<replaceable>handler</replaceable>,
<replaceable>offset</replaceable>,
<replaceable>flags</replaceable>)
</constant>
</para>
<para>
<constant>SD_BUS_METHOD(
<replaceable>member</replaceable>,
<replaceable>signature</replaceable>,
<replaceable>result</replaceable>,
<replaceable>handler</replaceable>,
<replaceable>flags</replaceable>)
</constant>
</para>
<para>
<constant>SD_BUS_SIGNAL_WITH_ARGS(
<replaceable>member</replaceable>,
<replaceable>args</replaceable>,
<replaceable>flags</replaceable>)
</constant>
</para>
<para>
<constant>SD_BUS_SIGNAL_WITH_NAMES(
<replaceable>member</replaceable>,
<replaceable>signature</replaceable>,
<replaceable>names</replaceable>,
<replaceable>flags</replaceable>)
</constant>
</para>
<para>
<constant>SD_BUS_SIGNAL(
<replaceable>member</replaceable>,
<replaceable>signature</replaceable>,
<replaceable>flags</replaceable>)
</constant>
</para>
<para>
<constant>SD_BUS_WRITABLE_PROPERTY(
<replaceable>member</replaceable>,
<replaceable>signature</replaceable>,
<replaceable>get</replaceable>,
<replaceable>set</replaceable>,
<replaceable>offset</replaceable>,
<replaceable>flags</replaceable>)
</constant>
</para>
<para>
<constant>SD_BUS_PROPERTY(
<replaceable>member</replaceable>,
<replaceable>signature</replaceable>,
<replaceable>get</replaceable>,
<replaceable>offset</replaceable>,
<replaceable>flags</replaceable>)
</constant>
</para>
<para>
<constant>SD_BUS_PARAM(<replaceable>name</replaceable>)</constant>
<constant>SD_BUS_ARGS(<replaceable>...</replaceable>)</constant>
<constant>SD_BUS_RESULT(<replaceable>...</replaceable>)</constant>
<constant>SD_BUS_NO_ARGS</constant>
<constant>SD_BUS_NO_RESULT</constant>
</para>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Description</title>
<para><function>sd_bus_add_object_vtable()</function> is used to declare attributes for the
object path <parameter>path</parameter> connected to the bus connection
<parameter>bus</parameter> under the interface <parameter>interface</parameter>. The table
<parameter>vtable</parameter> may contain property declarations using
<constant>SD_BUS_PROPERTY()</constant> or <constant>SD_BUS_WRITABLE_PROPERTY()</constant>,
method declarations using <constant>SD_BUS_METHOD()</constant>,
<constant>SD_BUS_METHOD_WITH_NAMES()</constant>,
<constant>SD_BUS_METHOD_WITH_OFFSET()</constant>, or
<constant>SD_BUS_METHOD_WITH_NAMES_OFFSET()</constant>, and signal declarations using
<constant>SD_BUS_SIGNAL_WITH_NAMES()</constant> or <constant>SD_BUS_SIGNAL()</constant>, see
below. The <replaceable>userdata</replaceable> parameter contains a pointer that will be passed
to various callback functions. It may be specified as <constant>NULL</constant> if no value is
necessary. An interface can have any number of vtables attached to it.</para>
<para><function>sd_bus_add_fallback_vtable()</function> is similar to
<function>sd_bus_add_object_vtable()</function>, but is used to register "fallback" attributes.
When looking for an attribute declaration, bus object paths registered with
<function>sd_bus_add_object_vtable()</function> are checked first. If no match is found, the
fallback vtables are checked for each prefix of the bus object path, i.e. with the last
slash-separated components successively removed. This allows the vtable to be used for an
arbitrary number of dynamically created objects.</para>
<para>Parameter <replaceable>find</replaceable> is a function which is used to locate the target
object based on the bus object path <replaceable>path</replaceable>. It must return
<constant>1</constant> and set the <parameter>ret_found</parameter> output parameter if the
object is found, return <constant>0</constant> if the object was not found, and return a
negative errno-style error code or initialize the error structure
<replaceable>ret_error</replaceable> on error. The pointer passed in
<parameter>ret_found</parameter> will be used as the <parameter>userdata</parameter> parameter
for the callback functions (offset by the <parameter>offset</parameter> offsets as specified in
the vtable entries).</para>
<para><function>sd_bus_add_object()</function> attaches a callback directly to the object path
<parameter>path</parameter>. An object path can have any number of callbacks attached to it.
Each callback is prepended to the list of callbacks which are always called in order.
<function>sd_bus_add_fallback()</function> is similar to
<function>sd_bus_add_object()</function> but applies to fallback paths instead.</para>
<para><function>sd_bus_add_filter()</function> installs a callback that is invoked for each
incoming D-Bus message. Filters can be used to handle logic common to all messages received by
a service (e.g. authentication or authorization).</para>
<para>When a request is received, any associated callbacks are called sequentially until a
callback returns a non-zero integer. Return zero from a callback to give other callbacks the
chance to process the request. Callbacks are called in the following order: first, global
callbacks installed with <function>sd_bus_add_filter()</function> are called. Second, callbacks
attached directly to the request object path are called, followed by any D-Bus method callbacks
attached to the request object path, interface and member. Finally, the property callbacks
attached to the request object path, interface and member are called. If the final callback
returns zero, an error reply is sent back to the caller indicating no matching object for the
request was found. Note that you can return a positive integer from a callback without
immediately sending a reply. This informs sd-bus this callback will take responsibility for
replying to the request without forcing the callback to produce a reply immediately. This allows
a callback to perform any number of asynchronous operations required to construct a reply. Note
that if producing a reply takes too long, the method call will time out at the caller.</para>
<para>If a callback was invoked to handle a request that expects a reply and the callback
returns a negative value, the value is interpreted as a negative errno-style error code and sent
back to the caller as a D-Bus error as if
<citerefentry><refentrytitle>sd_bus_reply_method_errno</refentrytitle><manvolnum>3</manvolnum></citerefentry>
was called. Additionally, all callbacks take a <structname>sd_bus_error</structname> output
parameter that can be used to provide more detailed error information. If
<parameter>ret_error</parameter> is set when the callback finishes, the corresponding D-Bus
error is sent back to the caller as if
<citerefentry><refentrytitle>sd_bus_reply_method_error</refentrytitle><manvolnum>3</manvolnum></citerefentry>
was called. Any error stored in <parameter>ret_error</parameter> takes priority over any
negative values returned by the same callback when determining which error to send back to
the caller. Use
<citerefentry><refentrytitle>sd_bus_error_set</refentrytitle><manvolnum>3</manvolnum></citerefentry>
or one of its variants to set <parameter>ret_error</parameter> and return a negative integer
from a callback with a single function call. To send an error reply after a callback has already
finished, use
<citerefentry><refentrytitle>sd_bus_reply_method_errno</refentrytitle><manvolnum>3</manvolnum></citerefentry>
or one of its variants.</para>
<para>For all functions, a match slot is created internally. If the output parameter
<replaceable>slot</replaceable> is <constant>NULL</constant>, a "floating" slot object is
created, see
<citerefentry><refentrytitle>sd_bus_slot_set_floating</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
Otherwise, a pointer to the slot object is returned. In that case, the reference to the slot
object should be dropped when the vtable is not needed anymore, see
<citerefentry><refentrytitle>sd_bus_slot_unref</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
</para>
<refsect2>
<title>The <structname>sd_bus_vtable</structname> array</title>
<para>The array consists of the structures of type <structname>sd_bus_vtable</structname>, but it
should never be filled in manually, but through one of the following macros:</para>
<variablelist>
<varlistentry>
<term><constant>SD_BUS_VTABLE_START()</constant></term>
<term><constant>SD_BUS_VTABLE_END</constant></term>
<listitem><para>Those must always be the first and last element.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_BUS_METHOD_WITH_ARGS_OFFSET()</constant></term>
<term><constant>SD_BUS_METHOD_WITH_ARGS()</constant></term>
<listitem><para>Declare a D-Bus method with the name <replaceable>member</replaceable>,
arguments <replaceable>args</replaceable> and result <replaceable>result</replaceable>.
<replaceable>args</replaceable> expects a sequence of argument type/name pairs wrapped in the
<constant>SD_BUS_ARGS()</constant> macro. The elements at even indices in this list describe the
types of the method's arguments. The method's parameter signature is the concatenation of all the
string literals at even indices in <replaceable>args</replaceable>. If a method has no parameters,
pass <constant>SD_BUS_NO_ARGS</constant> to <replaceable>args</replaceable>. The elements at uneven
indices describe the names of the method's arguments. <replaceable>result</replaceable> expects a
sequence of type/name pairs wrapped in the <constant>SD_BUS_RESULT()</constant> macro in the same
format as <constant>SD_BUS_ARGS()</constant>. The method's result signature is the concatenation of
all the string literals at even indices in <replaceable>result</replaceable>. If a method has no
result, pass <constant>SD_BUS_NO_RESULT</constant> to <replaceable>result</replaceable>. Note that
argument types are expected to be quoted string literals and argument names are expected to be
unquoted string literals. See below for a complete example.</para>
<para>The handler function <replaceable>handler</replaceable> must be of type
<function>sd_bus_message_handler_t</function>. It will be called to handle the incoming messages
that call this method. It receives a pointer that is the <replaceable>userdata</replaceable>
parameter passed to the registration function offset by <replaceable>offset</replaceable> bytes.
This may be used to pass pointers to different fields in the same data structure to different
methods in the same vtable. To send a reply from <parameter>handler</parameter>, call
<citerefentry><refentrytitle>sd_bus_reply_method_return</refentrytitle><manvolnum>3</manvolnum></citerefentry>
with the message the callback was invoked with. Parameter <replaceable>flags</replaceable> is a
combination of flags, see below.</para>
<constant>SD_BUS_METHOD_WITH_ARGS()</constant> is a shorthand for calling
<constant>SD_BUS_METHOD_WITH_ARGS_OFFSET()</constant> with an offset of zero.
</listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_BUS_METHOD_WITH_NAMES_OFFSET()</constant></term>
<term><constant>SD_BUS_METHOD_WITH_NAMES()</constant></term>
<term><constant>SD_BUS_METHOD_WITH_OFFSET()</constant></term>
<term><constant>SD_BUS_METHOD()</constant></term>
<listitem><para>Declare a D-Bus method with the name <replaceable>member</replaceable>,
parameter signature <replaceable>signature</replaceable>, result signature
<replaceable>result</replaceable>. Parameters <replaceable>in_names</replaceable> and
<replaceable>out_names</replaceable> specify the argument names of the input and output
arguments in the function signature. <replaceable>in_names</replaceable> and
<replaceable>out_names</replaceable> should be created using the
<constant>SD_BUS_PARAM()</constant> macro, see below. In all other regards, this macro behaves
exactly the same as <constant>SD_BUS_METHOD_WITH_ARGS_OFFSET()</constant>.</para>
<para><constant>SD_BUS_METHOD_WITH_NAMES()</constant>,
<constant>SD_BUS_METHOD_WITH_OFFSET()</constant>, and <constant>SD_BUS_METHOD()</constant>
are variants which specify zero offset (<replaceable>userdata</replaceable> parameter is
passed with no change), leave the names unset (i.e. no parameter names), or both.</para>
<para>Prefer using <constant>SD_BUS_METHOD_WITH_ARGS_OFFSET()</constant> and
<constant>SD_BUS_METHOD_WITH_ARGS()</constant> over these macros as they allow specifying argument
types and names next to each other which is less error-prone than first specifying all argument
types followed by specifying all argument names.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_BUS_SIGNAL_WITH_ARGS()</constant></term>
<listitem><para>>Declare a D-Bus signal with the name <replaceable>member</replaceable> and
arguments <replaceable>args</replaceable>. <replaceable>args</replaceable> expects a sequence of
argument type/name pairs wrapped in the <constant>SD_BUS_ARGS()</constant> macro. The elements at
even indices in this list describe the types of the signal's arguments. The signal's parameter
signature is the concatenation of all the string literals at even indices in
<replaceable>args</replaceable>. If a signal has no parameters, pass
<constant>SD_BUS_NO_ARGS</constant> to <replaceable>args</replaceable>. The elements at uneven
indices describe the names of the signal's arguments. Parameter <replaceable>flags</replaceable> is
a combination of flags. See below for a complete example.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_BUS_SIGNAL_WITH_NAMES()</constant></term>
<term><constant>SD_BUS_SIGNAL()</constant></term>
<listitem><para>Declare a D-Bus signal with the name <replaceable>member</replaceable>,
parameter signature <replaceable>signature</replaceable>, and argument names
<replaceable>names</replaceable>. <replaceable>names</replaceable> should be
created using the <constant>SD_BUS_PARAM()</constant> macro, see below.
Parameter <replaceable>flags</replaceable> is a combination of flags, see below.
</para>
<para><constant>SD_BUS_SIGNAL()</constant> is equivalent to
<constant>SD_BUS_SIGNAL_WITH_NAMES()</constant> with the <replaceable>names</replaceable> parameter
unset (i.e. no parameter names).</para>
<para>Prefer using <constant>SD_BUS_SIGNAL_WITH_ARGS()</constant> over these macros as it allows
specifying argument types and names next to each other which is less error-prone than first
specifying all argument types followed by specifying all argument names.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_BUS_WRITABLE_PROPERTY()</constant></term>
<term><constant>SD_BUS_PROPERTY()</constant></term>
<listitem><para>Declare a D-Bus property with the name <replaceable>member</replaceable>
and value signature <replaceable>signature</replaceable>. Parameters
<replaceable>get</replaceable> and <replaceable>set</replaceable> are the getter and
setter methods. They are called with a pointer that is the
<replaceable>userdata</replaceable> parameter passed to the registration function offset
by <replaceable>offset</replaceable> bytes. This may be used pass pointers to different
fields in the same data structure to different setters and getters in the same vtable.
Parameter <replaceable>flags</replaceable> is a combination of flags, see below.</para>
<para>The setter and getter methods may be omitted (specified as
<constant>NULL</constant>), if the property is one of the basic types or
<literal>as</literal> in case of read-only properties. In those cases, the
<replaceable>userdata</replaceable> and <replaceable>offset</replaceable> parameters must
together point to a valid variable of the corresponding type. A default setter and getter
will be provided, which simply copy the argument between this variable and the message.
</para>
<para><constant>SD_BUS_PROPERTY()</constant> is used to define a read-only property.
</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_BUS_PARAM()</constant></term>
<listitem><para>Parameter names should be wrapped in this macro, see the example below.
</para></listitem>
</varlistentry>
</variablelist>
</refsect2>
<refsect2>
<title>Flags</title>
<para>The <replaceable>flags</replaceable> parameter is used to specify a combination of
<ulink url="https://dbus.freedesktop.org/doc/dbus-specification.html#introspection-format">D-Bus annotations</ulink>.
</para>
<variablelist>
<varlistentry>
<term><constant>SD_BUS_VTABLE_DEPRECATED</constant></term>
<listitem><para>Mark this vtable entry as deprecated using the
<constant>org.freedesktop.DBus.Deprecated</constant> annotation in introspection data. If
specified for <constant>SD_BUS_VTABLE_START()</constant>, the annotation is applied to the
enclosing interface.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_BUS_VTABLE_HIDDEN</constant></term>
<listitem><para>Make this vtable entry hidden. It will not be shown in introspection data.
If specified for <constant>SD_BUS_VTABLE_START()</constant>, all entries in the array are
hidden.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_BUS_VTABLE_UNPRIVILEGED</constant></term>
<listitem><para>Mark this vtable entry as unprivileged. If not specified, the
<constant>org.freedesktop.systemd1.Privileged</constant> annotation with value
<literal>true</literal> will be shown in introspection data.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_BUS_VTABLE_METHOD_NO_REPLY</constant></term>
<listitem><para>Mark his vtable entry as a method that will not return a reply using the
<constant>org.freedesktop.DBus.Method.NoReply</constant> annotation in introspection data.
</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_BUS_VTABLE_PROPERTY_CONST</constant></term>
<term><constant>SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE</constant></term>
<term><constant>SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION</constant></term>
<listitem><para>Those three flags correspond to different values of the
<constant>org.freedesktop.DBus.Property.EmitsChangedSignal</constant> annotation, which
specifies whether the
<constant>org.freedesktop.DBus.Properties.PropertiesChanged</constant> signal is emitted
whenever the property changes. <constant>SD_BUS_VTABLE_PROPERTY_CONST</constant>
corresponds to <constant>const</constant> and means that the property never changes during
the lifetime of the object it belongs to, so no signal needs to be emitted.
<constant>SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE</constant> corresponds to
<constant>true</constant> and means that the signal is emitted.
<constant>SD_BUS_VTABLE_PROPERTY_EMITS_INVALIDATION</constant> corresponds to
<constant>invalidates</constant> and means that the signal is emitted, but the value is
not included in the signal.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_BUS_VTABLE_PROPERTY_EXPLICIT</constant></term>
<listitem><para>Mark this vtable property entry as requiring explicit request to for the
value to be shown (generally because the value is large or slow to calculate). This entry
cannot be combined with <constant>SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE</constant>, and will
not be shown in property listings by default (e.g. <command>busctl introspect</command>).
This corresponds to the <constant>org.freedesktop.systemd1.Explicit</constant> annotation
in introspection data.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_BUS_VTABLE_SENSITIVE</constant></term>
<listitem><para>Mark this vtable method entry as processing sensitive data. When set,
incoming method call messages and their outgoing reply messages are marked as sensitive using
<citerefentry><refentrytitle>sd_bus_message_sensitive</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
so that they are erased from memory when freed.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>SD_BUS_VTABLE_ABSOLUTE_OFFSET</constant></term>
<listitem><para>Mark this vtable method or property entry so that the user data pointer passed to
its associated handler functions is determined slightly differently: instead of adding the offset
parameter of the entry to the user data pointer specified during vtable registration, the offset is
passed directly, converted to a pointer, without taking the user data pointer specified during
vtable registration into account.</para></listitem>
</varlistentry>
</variablelist>
</refsect2>
</refsect1>
<refsect1>
<title>Examples</title>
<example>
<title>Create a simple listener on the bus</title>
<programlisting><xi:include href="vtable-example.c" parse="text" /></programlisting>
<para>This creates a simple client on the bus (the user bus, when run as normal user). We may
use the D-Bus <constant>org.freedesktop.DBus.Introspectable.Introspect</constant> call to
acquire the XML description of the interface:</para>
<programlisting><xi:include href="vtable-example.xml" parse="text" /></programlisting>
</example>
</refsect1>
<refsect1>
<title>Return Value</title>
<para>On success, <function>sd_bus_add_object_vtable()</function> and
<function>sd_bus_add_fallback_vtable()</function> return a non-negative integer. On
failure, they return a negative errno-style error code.</para>
<refsect2>
<title>Errors</title>
<para>Returned errors may indicate the following problems:</para>
<variablelist>
<varlistentry>
<term><constant>-EINVAL</constant></term>
<listitem><para>One of the required parameters is <constant>NULL</constant> or invalid. A
reserved D-Bus interface was passed as the <replaceable>interface</replaceable> parameter.
</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ENOPKG</constant></term>
<listitem><para>The bus cannot be resolved.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ECHILD</constant></term>
<listitem><para>The bus was created in a different process.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-ENOMEM</constant></term>
<listitem><para>Memory allocation failed.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-EPROTOTYPE</constant></term>
<listitem><para><function>sd_bus_add_object_vtable</function> and
<function>sd_bus_add_fallback_vtable</function> have been both called for the same bus
object path, which is not allowed.</para></listitem>
</varlistentry>
<varlistentry>
<term><constant>-EEXIST</constant></term>
<listitem><para>This vtable has already been registered for this
<replaceable>interface</replaceable> and <replaceable>path</replaceable>.
</para></listitem>
</varlistentry>
</variablelist>
</refsect2>
</refsect1>
<xi:include href="libelogind-pkgconfig.xml" />
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>busctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_emit_properties_changed</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_emit_object_added</refentrytitle><manvolnum>3</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>

+ 6
- 5
man/sd_journal_query_unique.xml View File

@ -131,17 +131,17 @@
<refsect1>
<title>Return Value</title>
<!-- 0 /// Be clear that they always return 0 in elogind
--><!-- else // 0 -->
<para><function>sd_journal_query_unique()</function> and
<function>sd_journal_enumerate_unique()</function> always return 0.
<!-- // 0 -->
<para><function>sd_journal_query_unique()</function> returns 0 on success or a negative errno-style error
code. <function>sd_journal_enumerate_unique()</function> and and
<!-- 0 /// Be clear that they always return 0 in elogind
<function>sd_journal_query_available_unique()</function> return a positive integer if the next field data
has been read, 0 when no more fields remain, or a negative errno-style error code.
--><!-- else // 0 -->
<function>sd_journal_query_available_unique()</function> always return 0.
<!-- // 0 -->
<function>sd_journal_restart_unique()</function> doesn't return anything.</para>
<!-- 0 /// In elogind none of these get returned
<refsect2>
<title>Errors</title>
@ -159,6 +159,7 @@
<xi:include href="sd_journal_get_data.xml" xpointer="EIO"/>
</variablelist>
</refsect2>
// 0 -->
</refsect1>
<refsect1>

+ 1
- 1
pwx

@ -1 +1 @@
Subproject commit bf72c3fbe40d6c9f6b65c3bd5a53f9fd53fa3b16
Subproject commit e3da112693685676bbb826d9623f49e38bfa873f

+ 86
- 0
tools/update-man-rules.py View File

@ -0,0 +1,86 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1+
from __future__ import print_function
import collections
import sys
import pprint
from os.path import basename
from xml_helper import xml_parse
def man(page, number):
return '{}.{}'.format(page, number)
def add_rules(rules, name):
xml = xml_parse(name)
# print('parsing {}'.format(name), file=sys.stderr)
if xml.getroot().tag != 'refentry':
return
conditional = xml.getroot().get('conditional') or ''
rulegroup = rules[conditional]
refmeta = xml.find('./refmeta')
title = refmeta.find('./refentrytitle').text
number = refmeta.find('./manvolnum').text
refnames = xml.findall('./refnamediv/refname')
target = man(refnames[0].text, number)
if title != refnames[0].text:
raise ValueError('refmeta and refnamediv disagree: ' + name)
for refname in refnames:
assert all(refname not in group
for group in rules.values()), "duplicate page name"
alias = man(refname.text, number)
rulegroup[alias] = target
# print('{} => {} [{}]'.format(alias, target, conditional), file=sys.stderr)
def create_rules(xml_files):
" {conditional => {alias-name => source-name}} "
rules = collections.defaultdict(dict)
for name in xml_files:
try:
add_rules(rules, name)
except Exception:
print("Failed to process", name, file=sys.stderr)
raise
return rules
def mjoin(files):
return ' \\\n\t'.join(sorted(files) or '#')
MESON_HEADER = '''\
# Do not edit. Generated by update-man-rules.py.
# Update with:
# ninja -C build man/update-man-rules
manpages = ['''
MESON_FOOTER = '''\
]
# Really, do not edit.'''
def make_mesonfile(rules, dist_files):
# reformat rules as
# grouped = [ [name, section, [alias...], condition], ...]
#
# but first create a dictionary like
# lists = { (name, condition) => [alias...]
grouped = collections.defaultdict(list)
for condition, items in rules.items():
for alias, name in items.items():
group = grouped[(name, condition)]
if name != alias:
group.append(alias)
lines = [ [p[0][:-2], p[0][-1], sorted(a[:-2] for a in aliases), p[1]]
for p, aliases in sorted(grouped.items()) ]
return '\n'.join((MESON_HEADER, pprint.pformat(lines)[1:-1], MESON_FOOTER))
if __name__ == '__main__':
pages = sys.argv[1:]
pages = (p for p in pages
if basename(p) not in {
'systemd.directives.xml',
'systemd.index.xml',
'directives-template.xml'})
rules = create_rules(pages)
dist_files = (basename(p) for p in pages)
print(make_mesonfile(rules, dist_files))

Loading…
Cancel
Save