From: Daan De Meyer Date: Mon, 20 Apr 2020 16:38:38 +0000 (+0200) Subject: sd-bus: Add sd_bus_is_server + sd_bus_set/is_bus_client docs X-Git-Tag: v246-rc1~554 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=842a362c3a439f88186fa3a2d5903390f9fe5181;p=thirdparty%2Fsystemd.git sd-bus: Add sd_bus_is_server + sd_bus_set/is_bus_client docs --- diff --git a/man/rules/meson.build b/man/rules/meson.build index 772ac1dc248..3b52d33e371 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -398,7 +398,13 @@ manpages = [ '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_set_server', + '3', + ['sd_bus_get_bus_id', + 'sd_bus_is_bus_client', + 'sd_bus_is_server', + 'sd_bus_set_bus_client'], + ''], ['sd_bus_set_watch_bind', '3', ['sd_bus_get_watch_bind'], ''], ['sd_bus_slot_get_bus', '3', diff --git a/man/sd-bus.xml b/man/sd-bus.xml index f47e78cd682..3237eb82cc6 100644 --- a/man/sd-bus.xml +++ b/man/sd-bus.xml @@ -80,6 +80,8 @@ sd_bus_get_fd3, sd_bus_get_method_call_timeout3, sd_bus_get_n_queued_read3, +sd_bus_is_bus_client3, +sd_bus_is_server3, sd_bus_message_append3, sd_bus_message_append_array3, sd_bus_message_append_basic3, @@ -125,6 +127,7 @@ sd_bus_set_property3, sd_bus_set_propertyv3, sd_bus_set_sender3, +sd_bus_set_bus_client3, sd_bus_set_server3, sd_bus_set_watch_bind3 sd_bus_set_close_on_exit3, diff --git a/man/sd_bus_set_server.xml b/man/sd_bus_set_server.xml index 2e065596a2d..228dc806e4e 100644 --- a/man/sd_bus_set_server.xml +++ b/man/sd_bus_set_server.xml @@ -18,9 +18,12 @@ sd_bus_set_server + sd_bus_is_server sd_bus_get_bus_id + sd_bus_set_bus_client + sd_bus_is_bus_client - Configure server mode for a bus object + Configure direct connection mode for a bus object @@ -34,11 +37,27 @@ sd_id128_t id + + int sd_bus_is_server + sd_bus *bus + + int sd_bus_get_bus_id sd_bus *bus sd_id128_t *id + + + int sd_bus_set_bus_client + sd_bus *bus + int b + + + + int sd_bus_is_bus_client + sd_bus *bus + @@ -55,16 +74,44 @@ sd_id128_randomize3 can be used to generate a random id instead. + sd_bus_is_server() returns whether the server mode is enabled for + the given bus object. + sd_bus_get_bus_id() stores the D-Bus server id configured using sd_bus_set_server() (for server bus objects) or received during D-Bus authentication (for client bus objects) in id. + + sd_bus_set_bus_client() configures the bus object as a D-Bus daemon + client. b enables/disables the client mode. If zero, the client mode is + disabled and the bus object should connect directly to a D-Bus server. Otherwise, the client + mode is enabled and the bus object should connect to a D-Bus daemon. When connecting to an + existing bus using any of the functions in the + sd_bus_open3 + family of functions or any of the functions in the + sd_bus_default3 + family of functions, the bus object is automatically configured as a bus client. However, when + connecting to a D-Bus daemon by calling + sd_bus_set_address3 + followed by + sd_bus_start3, + the bus object should be manually configured as a bus client using + sd_bus_set_bus_client(). By default, a bus object is not configured as a + D-Bus daemon client. + + sd_bus_is_bus_client() returns whether the client mode is + enabled/disabled for the given bus object. Return Value - On success, these functions return a non-negative integer. On failure, they return a - negative errno-style error code. + On success, sd_bus_set_server(), + sd_bus_get_bus_id() and sd_bus_set_bus_client() return + a non-negative integer. On failure, they return a negative errno-style error code. + + sd_bus_is_server() and sd_bus_is_bus_client() + return 1 when the server or client mode is enabled, respectively. Otherwise, they return 0. + Errors