-static int status_property(const char *name, DBusMessageIter *iter, StatusInfo *i) {
- assert(name);
- assert(iter);
-
- switch (dbus_message_iter_get_arg_type(iter)) {
-
- case DBUS_TYPE_STRING: {
- const char *s;
-
- dbus_message_iter_get_basic(iter, &s);
- if (!isempty(s)) {
- if (streq(name, "Hostname"))
- i->hostname = s;
- if (streq(name, "StaticHostname"))
- i->static_hostname = s;
- if (streq(name, "PrettyHostname"))
- i->pretty_hostname = s;
- if (streq(name, "IconName"))
- i->icon_name = s;
- if (streq(name, "Chassis"))
- i->chassis = s;
- }
- break;
- }
- }
-
- return 0;
-}
-
-static int show_status(DBusConnection *bus, char **args, unsigned n) {
- _cleanup_dbus_message_unref_ DBusMessage *reply = NULL;
- const char *interface = "";
+static int show_one_name(sd_bus *bus, const char* attr) {
+ _cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
+ _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+ const char *s;