#include "services.h"
#include "dbus.h"
+int parse_boolean(char *arg)
+{
+ if (arg == NULL)
+ return -1;
+
+ if (strcasecmp(arg, "no") == 0 ||
+ strcasecmp(arg, "false") == 0 ||
+ strcasecmp(arg, "off" ) == 0 ||
+ strcasecmp(arg, "disable" ) == 0 ||
+ strcasecmp(arg, "n") == 0 ||
+ strcasecmp(arg, "f") == 0 ||
+ strcasecmp(arg, "0") == 0)
+ return 0;
+
+ if (strcasecmp(arg, "yes") == 0 ||
+ strcasecmp(arg, "true") == 0 ||
+ strcasecmp(arg, "on") == 0 ||
+ strcasecmp(arg, "enable" ) == 0 ||
+ strcasecmp(arg, "y") == 0 ||
+ strcasecmp(arg, "t") == 0 ||
+ strcasecmp(arg, "1") == 0)
+ return 1;
+
+ return -1;
+}
+
static void append_property_array(DBusMessageIter *iter, char *property,
char **data, int num_args)
{
dbus_bool_t online;
};
+int parse_boolean(char *arg);
char *strip_service_path(char *service);
void extract_service_name(DBusMessageIter *dict, struct service_data *service);
int set_service_property(DBusConnection *connection, DBusMessage *message,