Add call_watches utility

This commit is contained in:
Denis Kenzior 2009-08-14 15:13:58 -05:00
parent c1c04e8c8d
commit 2da0fc6070
1 changed files with 17 additions and 0 deletions

View File

@ -153,6 +153,23 @@ struct ofono_modem *__ofono_atom_get_modem(struct ofono_atom *atom)
return atom->modem;
}
static void call_watches(struct ofono_atom *atom,
enum ofono_atom_watch_condition cond)
{
struct ofono_modem *modem = atom->modem;
GSList *l;
struct ofono_atom_watch *watch;
for (l = modem->atom_watches; l; l = l->next) {
watch = l->data;
if (watch->type != atom->type)
continue;
watch->notify(atom, cond, watch->notify_data);
}
}
void __ofono_atom_register(struct ofono_atom *atom,
void (*unregister)(struct ofono_atom *))
{