]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/shared/bus-map-properties.h
hwdb: Add mapping for Xiaomi Mipad 2 bottom bezel capacitive buttons
[thirdparty/systemd.git] / src / shared / bus-map-properties.h
CommitLineData
db9ecf05 1/* SPDX-License-Identifier: LGPL-2.1-or-later */
807542be
LP
2#pragma once
3
4#include "sd-bus.h"
5
6typedef int (*bus_property_set_t) (sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_error *error, void *userdata);
7
8struct bus_properties_map {
9 const char *member;
10 const char *signature;
11 bus_property_set_t set;
12 size_t offset;
13};
14
15enum {
16 BUS_MAP_STRDUP = 1 << 0, /* If set, each "s" message is duplicated. Thus, each pointer needs to be freed. */
387f6955 17 BUS_MAP_BOOLEAN_AS_BOOL = 1 << 1, /* If set, each "b" message is written to a bool pointer. If not set, "b" is written to an int pointer. */
807542be
LP
18};
19
20int bus_map_id128(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_error *error, void *userdata);
af781878 21int bus_map_strv_sort(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_error *error, void *userdata);
807542be
LP
22
23int bus_message_map_all_properties(sd_bus_message *m, const struct bus_properties_map *map, unsigned flags, sd_bus_error *error, void *userdata);
24int bus_map_all_properties(sd_bus *bus, const char *destination, const char *path, const struct bus_properties_map *map,
25 unsigned flags, sd_bus_error *error, sd_bus_message **reply, void *userdata);