From 774cb729301bc45742283010a1da911f72c987b6 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Wed, 30 Mar 2011 13:04:42 -0500 Subject: modem: Add __ofono_modem_foreach_registered_atom --- src/modem.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/modem.c') diff --git a/src/modem.c b/src/modem.c index 7ff38350..d43059f9 100644 --- a/src/modem.c +++ b/src/modem.c @@ -345,6 +345,30 @@ void __ofono_modem_foreach_atom(struct ofono_modem *modem, } } +void __ofono_modem_foreach_registered_atom(struct ofono_modem *modem, + enum ofono_atom_type type, + ofono_atom_func callback, + void *data) +{ + GSList *l; + struct ofono_atom *atom; + + if (modem == NULL) + return; + + for (l = modem->atoms; l; l = l->next) { + atom = l->data; + + if (atom->type != type) + continue; + + if (atom->unregister == NULL) + continue; + + callback(atom, data); + } +} + void __ofono_atom_free(struct ofono_atom *atom) { struct ofono_modem *modem = atom->modem; -- cgit v1.2.3