From f45139f38cdc7171f1375b28bcc82a1c2397e06a Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 22 Jul 2009 13:04:25 +0200 Subject: Add infrastructure for global settings storage --- src/storage.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/storage.c') diff --git a/src/storage.c b/src/storage.c index 08b7249c..2018cf25 100644 --- a/src/storage.c +++ b/src/storage.c @@ -66,6 +66,42 @@ void connman_storage_unregister(struct connman_storage *storage) storage_list = g_slist_remove(storage_list, storage); } +int __connman_storage_load_global(void) +{ + GSList *list; + + DBG(""); + + for (list = storage_list; list; list = list->next) { + struct connman_storage *storage = list->data; + + if (storage->global_load) { + if (storage->global_load() == 0) + return 0; + } + } + + return -ENOENT; +} + +int __connman_storage_save_global(void) +{ + GSList *list; + + DBG(""); + + for (list = storage_list; list; list = list->next) { + struct connman_storage *storage = list->data; + + if (storage->global_save) { + if (storage->global_save() == 0) + return 0; + } + } + + return -ENOENT; +} + int __connman_storage_init_device(void) { GSList *list; -- cgit v1.2.3