static gpointer setup_func(xmlNodePtr node) { xmlNodePtr n; Options *o; o = g_slice_new0(Options); o->stop_int = TRUE; if ((n = obt_xml_find_node(node, "here"))) o->here = obt_xml_node_bool(n); if ((n = obt_xml_find_node(node, "stopInteractive"))) o->stop_int = obt_xml_node_bool(n); return o; }
static gpointer setup_func(xmlNodePtr node) { xmlNodePtr n; Options *o; o = g_slice_new0(Options); if ((n = obt_xml_find_node(node, "command")) || (n = obt_xml_find_node(node, "execute"))) { gchar *s = obt_xml_node_string(n); o->cmd = obt_paths_expand_tilde(s); g_free(s); } if ((n = obt_xml_find_node(node, "prompt"))) o->prompt = obt_xml_node_string(n); if ((n = obt_xml_find_node(node, "startupnotify"))) { xmlNodePtr m; if ((m = obt_xml_find_node(n->children, "enabled"))) o->sn = obt_xml_node_bool(m); if ((m = obt_xml_find_node(n->children, "name"))) o->sn_name = obt_xml_node_string(m); if ((m = obt_xml_find_node(n->children, "icon"))) o->sn_icon = obt_xml_node_string(m); if ((m = obt_xml_find_node(n->children, "wmclass"))) o->sn_wmclass = obt_xml_node_string(m); } return o; }
gboolean tree_get_bool(const gchar *node, gboolean def) { xmlNodePtr n; n = tree_get_node(node, (def ? "yes" : "no")); return obt_xml_node_bool(n); }