bus-util: introduce bus_property_get_tristate()
This will be used in later commits.
This commit is contained in:
@@ -38,6 +38,22 @@ int bus_property_set_bool(
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bus_property_get_tristate(
|
||||
sd_bus *bus,
|
||||
const char *path,
|
||||
const char *interface,
|
||||
const char *property,
|
||||
sd_bus_message *reply,
|
||||
void *userdata,
|
||||
sd_bus_error *error) {
|
||||
|
||||
/* Defaults to false. */
|
||||
|
||||
int b = (*(int*) userdata) > 0;
|
||||
|
||||
return sd_bus_message_append_basic(reply, 'b', &b);
|
||||
}
|
||||
|
||||
int bus_property_get_id128(
|
||||
sd_bus *bus,
|
||||
const char *path,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
int bus_property_get_bool(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);
|
||||
int bus_property_set_bool(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *value, void *userdata, sd_bus_error *error);
|
||||
int bus_property_get_tristate(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);
|
||||
int bus_property_get_id128(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error);
|
||||
|
||||
#define bus_property_get_usec ((sd_bus_property_get_t) NULL)
|
||||
|
||||
Reference in New Issue
Block a user