1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
2 #pragma once
3 
4 #include "sd-bus.h"
5 
6 typedef struct BusLocator {
7         const char *destination;
8         const char *path;
9         const char *interface;
10 } BusLocator;
11 
12 extern const BusLocator* const bus_home_mgr;
13 extern const BusLocator* const bus_import_mgr;
14 extern const BusLocator* const bus_locale;
15 extern const BusLocator* const bus_login_mgr;
16 extern const BusLocator* const bus_machine_mgr;
17 extern const BusLocator* const bus_network_mgr;
18 extern const BusLocator* const bus_portable_mgr;
19 extern const BusLocator* const bus_resolve_mgr;
20 extern const BusLocator* const bus_systemd_mgr;
21 extern const BusLocator* const bus_timedate;
22 
23 /* Shorthand flavors of the sd-bus convenience helpers with destination,path,interface strings encapsulated
24  * within a single struct. */
25 int bus_call_method_async(sd_bus *bus, sd_bus_slot **slot, const BusLocator *locator, const char *member, sd_bus_message_handler_t callback, void *userdata, const char *types, ...);
26 int bus_call_method(sd_bus *bus, const BusLocator *locator, const char *member, sd_bus_error *error, sd_bus_message **reply, const char *types, ...);
27 int bus_get_property(sd_bus *bus, const BusLocator *locator, const char *member, sd_bus_error *error, sd_bus_message **reply, const char *type);
28 int bus_get_property_trivial(sd_bus *bus, const BusLocator *locator, const char *member, sd_bus_error *error, char type, void *ptr);
29 int bus_get_property_string(sd_bus *bus, const BusLocator *locator, const char *member, sd_bus_error *error, char **ret);
30 int bus_get_property_strv(sd_bus *bus, const BusLocator *locator, const char *member, sd_bus_error *error, char ***ret);
31 int bus_set_property(sd_bus *bus, const BusLocator *locator, const char *member, sd_bus_error *error, const char *type, ...);
32 int bus_match_signal(sd_bus *bus, sd_bus_slot **ret, const BusLocator *locator, const char *member, sd_bus_message_handler_t callback, void *userdata);
33 int bus_match_signal_async(sd_bus *bus, sd_bus_slot **ret, const BusLocator *locator, const char *member, sd_bus_message_handler_t callback, sd_bus_message_handler_t install_callback, void *userdata);
34 int bus_message_new_method_call(sd_bus *bus, sd_bus_message **m, const BusLocator *locator, const char *member);
35