diff options
author | emersion <contact@emersion.fr> | 2018-09-19 14:15:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-19 14:15:16 +0200 |
commit | 842368ec983cdf671cf16f5be51633392ed52d5e (patch) | |
tree | 506b2886ae2aa9f07d2f66a8783377d311cc31af /backend/multi/backend.c | |
parent | 33a3d8a55504e4fc17dbaa5c268435df0102033f (diff) | |
parent | 691a63d66bdf45bc30e427b59958e7e12440e53e (diff) |
Merge pull request #1253 from RyanDwyer/multi-for-each-backend
Introduce wlr_multi_for_each_backend
Diffstat (limited to 'backend/multi/backend.c')
-rw-r--r-- | backend/multi/backend.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/backend/multi/backend.c b/backend/multi/backend.c index 1665bf28..3707fe34 100644 --- a/backend/multi/backend.c +++ b/backend/multi/backend.c @@ -207,3 +207,13 @@ bool wlr_multi_is_empty(struct wlr_backend *_backend) { struct wlr_multi_backend *backend = (struct wlr_multi_backend *)_backend; return wl_list_length(&backend->backends) < 1; } + +void wlr_multi_for_each_backend(struct wlr_backend *_backend, + void (*callback)(struct wlr_backend *backend, void *data), void *data) { + assert(wlr_backend_is_multi(_backend)); + struct wlr_multi_backend *backend = (struct wlr_multi_backend *)_backend; + struct subbackend_state *sub; + wl_list_for_each(sub, &backend->backends, link) { + callback(sub->backend, data); + } +} |