GList *maps; /**< Linked list of all the maps in the mapset */
};
+struct attr_iter {
+ GList *last;
+};
+
/**
* @brief Creates a new, empty mapset
*
}
+struct attr_iter *
+mapset_attr_iter_new(void)
+{
+ return g_new0(struct attr_iter, 1);
+}
+
+void
+mapset_attr_iter_destroy(struct attr_iter *iter)
+{
+ g_free(iter);
+}
+
/**
* @brief Adds a map to a mapset
*
{
GList *map;
map=ms->maps;
+ attr->type=type;
switch (type) {
case attr_map:
- if (map) {
- attr->u.map=map->data;
- return 1;
+ while (map) {
+ if (!iter || iter->last == g_list_previous(map)) {
+ attr->u.map=map->data;
+ if (iter)
+ iter->last=map;
+ return 1;
+ }
+ map=g_list_next(map);
}
break;
default:
msh->l=g_list_next(msh->l);
if (!active)
return ret;
+ if (active == 2 && map_get_attr(ret, attr_route_active, &active_attr, NULL)) {
+ if (active_attr.u.num)
+ return ret;
+ else
+ continue;
+ }
if (!map_get_attr(ret, attr_active, &active_attr, NULL))
return ret;
if (active_attr.u.num)