summaryrefslogtreecommitdiffstats
path: root/src/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map.c')
-rw-r--r--src/map.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/map.c b/src/map.c
index b361fe2..4a4b7a8 100644
--- a/src/map.c
+++ b/src/map.c
@@ -299,6 +299,22 @@ map_data_foreach_entry_id(struct plugin_state *state,
return map_data_foreach_entry(state, domain, map, id, fn, cbdata);
}
+/* Iterate over all domains, calling the callback with information about the
+ * domain. */
+bool_t
+map_data_foreach_domain(struct plugin_state *state,
+ bool_t (*fn)(const char *domain, void *cbdata),
+ void *cbdata)
+{
+ int i, j;
+ for (i = 0; i < map_data.n_domains; i++) {
+ if (!(*fn)(map_data.domains[i].name, cbdata)) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
/* Iterate over all maps, calling the callback with information about the map
* and whatever the caller originally told us to keep track of when the map was
* first set up. */