5 * Copyright (C) 2007-2009 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 static GSList *notifier_list = NULL;
30 static gint compare_priority(gconstpointer a, gconstpointer b)
32 const struct connman_notifier *notifier1 = a;
33 const struct connman_notifier *notifier2 = b;
35 return notifier2->priority - notifier1->priority;
39 * connman_notifier_register:
40 * @notifier: notifier module
42 * Register a new notifier module
44 * Returns: %0 on success
46 int connman_notifier_register(struct connman_notifier *notifier)
48 DBG("notifier %p name %s", notifier, notifier->name);
50 notifier_list = g_slist_insert_sorted(notifier_list, notifier,
57 * connman_notifier_unregister:
58 * @notifier: notifier module
60 * Remove a previously registered notifier module
62 void connman_notifier_unregister(struct connman_notifier *notifier)
64 DBG("notifier %p name %s", notifier, notifier->name);
66 notifier_list = g_slist_remove(notifier_list, notifier);
69 int __connman_notifier_init(void)
76 void __connman_notifier_cleanup(void)