summaryrefslogtreecommitdiff
path: root/src/storage.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-07-22 13:04:25 +0200
committerMarcel Holtmann <marcel@holtmann.org>2009-07-22 13:04:25 +0200
commitf45139f38cdc7171f1375b28bcc82a1c2397e06a (patch)
tree98d6bfe16d7cbba1d9c45df3955e422b83a90d08 /src/storage.c
parentf1d33fcac327890a4a32b6591025ad245c2f9a85 (diff)
downloadconnman-f45139f38cdc7171f1375b28bcc82a1c2397e06a.tar.gz
connman-f45139f38cdc7171f1375b28bcc82a1c2397e06a.tar.bz2
connman-f45139f38cdc7171f1375b28bcc82a1c2397e06a.zip
Add infrastructure for global settings storage
Diffstat (limited to 'src/storage.c')
-rw-r--r--src/storage.c36
1 files changed, 36 insertions, 0 deletions
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;