+ return out;
+}
+
+
+/*! Reads a list of input strings, strips out invalid stuff, and parses
+ backslash-stuff.
+ */
+static gchar** parse_value_strings(const gchar *in,
+ gboolean locale,
+ gulong *nstrings,
+ const ObtDDParse *const parse,
+ gboolean *error)
+{
+ gchar **out;
+ const gchar *i;
+
+ out = g_new(gchar*, 1);
+ out[0] = NULL;
+ *nstrings = 0;
+
+ i = in;
+ while (TRUE) {
+ gchar *a;
+ gulong len;
+
+ a = parse_value_string(i, locale, TRUE, &len, parse, error);
+ i += len;
+
+ if (len) {
+ (*nstrings)++;
+ out = g_renew(gchar*, out, *nstrings+1);
+ out[*nstrings-1] = a;
+ out[*nstrings] = NULL;
+ }
+
+ if (!*i) break; /* no more strings */
+ ++i;
+ }
+ return out;
+}
+
+static guint parse_value_environments(const gchar *in,
+ const ObtDDParse *const parse,
+ gboolean *error)
+{
+ const gchar *s;
+ guint mask = 0;
+
+ s = in;
+ while (*s) {
+ switch (*(s++)) {
+ case 'G':
+ if (strcmp(s, "NOME") == 0) {
+ mask |= OBT_LINK_ENV_GNOME;
+ s += 4;
+ }
+ break;
+ case 'K':
+ if (strcmp(s, "DE") == 0) {
+ mask |= OBT_LINK_ENV_KDE;
+ s += 2;
+ }
+ break;
+ case 'L':
+ if (strcmp(s, "XDE") == 0) {
+ mask |= OBT_LINK_ENV_LXDE;
+ s += 3;
+ }
+ break;
+ case 'R':
+ if (strcmp(s, "OX") == 0) {
+ mask |= OBT_LINK_ENV_ROX;
+ s += 2;
+ }
+ break;
+ case 'X':
+ if (strcmp(s, "FCE") == 0) {
+ mask |= OBT_LINK_ENV_XFCE;
+ s += 3;
+ }
+ break;
+ case 'O':
+ switch (*(s++)) {
+ case 'l':
+ if (strcmp(s, "d") == 0) {
+ mask |= OBT_LINK_ENV_OLD;
+ s += 1;
+ }
+ break;
+ case 'P':
+ if (strcmp(s, "ENBOX") == 0) {
+ mask |= OBT_LINK_ENV_OPENBOX;
+ s += 5;
+ }
+ break;
+ }
+ }
+ /* find the next string, or the end of the sequence */
+ while (*s && *s != ';') ++s;
+ }
+ return mask;