storage: remove storage module framework
authorAlok Barsode <alok.barsode@linux.intel.com>
Wed, 24 Aug 2011 13:44:27 +0000 (16:44 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 25 Aug 2011 09:14:24 +0000 (11:14 +0200)
Makefile.am
include/storage.h [deleted file]
src/connman.h
src/main.c
src/storage.c

index acd0c76..de634c6 100644 (file)
@@ -4,8 +4,7 @@ AM_MAKEFLAGS = --no-print-directory
 includedir = @includedir@/connman
 
 include_HEADERS = include/types.h include/log.h include/plugin.h \
-                       include/notifier.h \
-                       include/storage.h include/service.h \
+                       include/notifier.h include/service.h \
                        include/resolver.h include/ipconfig.h \
                        include/device.h include/network.h include/inet.h
 
diff --git a/include/storage.h b/include/storage.h
deleted file mode 100644 (file)
index f75ee97..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- *  Connection Manager
- *
- *  Copyright (C) 2007-2010  Intel Corporation. All rights reserved.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License version 2 as
- *  published by the Free Software Foundation.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-#ifndef __CONNMAN_STORAGE_H
-#define __CONNMAN_STORAGE_H
-
-#include <connman/service.h>
-#include <connman/device.h>
-#include <connman/technology.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * SECTION:storage
- * @title: Storage premitives
- * @short_description: Functions for registering storage modules
- */
-
-#define CONNMAN_STORAGE_PRIORITY_LOW      -100
-#define CONNMAN_STORAGE_PRIORITY_DEFAULT     0
-#define CONNMAN_STORAGE_PRIORITY_HIGH      100
-
-struct connman_storage {
-       const char *name;
-       int priority;
-       enum connman_service_type service_type;
-       int (*service_load) (struct connman_service *service);
-       int (*service_save) (struct connman_service *service);
-};
-
-int connman_storage_register(struct connman_storage *storage);
-void connman_storage_unregister(struct connman_storage *storage);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __CONNMAN_STORAGE_H */
index 614cb01..b7dc002 100644 (file)
@@ -142,11 +142,6 @@ void __connman_resolver_cleanup(void);
 int __connman_resolvfile_append(const char *interface, const char *domain, const char *server);
 int __connman_resolvfile_remove(const char *interface, const char *domain, const char *server);
 
-#include <connman/storage.h>
-
-int __connman_storage_init(void);
-void __connman_storage_cleanup(void);
-
 GKeyFile *__connman_storage_open(const char *ident, const char *suffix);
 void __connman_storage_close(const char *ident, const char *suffix,
                                        GKeyFile *keyfile, gboolean save);
@@ -162,9 +157,6 @@ void __connman_storage_close_config(const char *ident,
                                        GKeyFile *keyfile, gboolean save);
 void __connman_storage_delete_config(const char *ident);
 
-int __connman_storage_load_service(struct connman_service *service);
-int __connman_storage_save_service(struct connman_service *service);
-
 int __connman_detect_init(void);
 void __connman_detect_cleanup(void);
 
index 535d2d1..959a43f 100644 (file)
@@ -334,7 +334,6 @@ int main(int argc, char *argv[])
 
        parse_config(config);
 
-       __connman_storage_init();
        __connman_technology_init();
        __connman_notifier_init();
        __connman_location_init();
@@ -409,7 +408,6 @@ int main(int argc, char *argv[])
        __connman_location_cleanup();
        __connman_notifier_cleanup();
        __connman_technology_cleanup();
-       __connman_storage_cleanup();
 
        __connman_dbus_cleanup();
 
index 3444fbe..271d49c 100644 (file)
 #define PROFILE_SUFFIX "profile"
 #define CONFIG_SUFFIX  "config"
 
-static GSList *storage_list = NULL;
-
-static gint compare_priority(gconstpointer a, gconstpointer b)
-{
-       const struct connman_storage *storage1 = a;
-       const struct connman_storage *storage2 = b;
-
-       return storage2->priority - storage1->priority;
-}
-
-/**
- * connman_storage_register:
- * @storage: storage module
- *
- * Register a new storage module
- *
- * Returns: %0 on success
- */
-int connman_storage_register(struct connman_storage *storage)
-{
-       DBG("storage %p name %s", storage, storage->name);
-
-       storage_list = g_slist_insert_sorted(storage_list, storage,
-                                                       compare_priority);
-
-       return 0;
-}
-
-/**
- * connman_storage_unregister:
- * @storage: storage module
- *
- * Remove a previously registered storage module
- */
-void connman_storage_unregister(struct connman_storage *storage)
-{
-       DBG("storage %p name %s", storage, storage->name);
-
-       storage_list = g_slist_remove(storage_list, storage);
-}
-
 GKeyFile *__connman_storage_open(const char *ident, const char *suffix)
 {
        GKeyFile *keyfile;
@@ -180,51 +139,3 @@ void __connman_storage_delete_config(const char *ident)
 {
        __connman_storage_delete(ident, CONFIG_SUFFIX);
 }
-
-int __connman_storage_load_service(struct connman_service *service)
-{
-       GSList *list;
-
-       DBG("service %p", service);
-
-       for (list = storage_list; list; list = list->next) {
-               struct connman_storage *storage = list->data;
-
-               if (storage->service_load) {
-                       if (storage->service_load(service) == 0)
-                               return 0;
-               }
-       }
-
-       return -ENOENT;
-}
-
-int __connman_storage_save_service(struct connman_service *service)
-{
-       GSList *list;
-
-       DBG("service %p", service);
-
-       for (list = storage_list; list; list = list->next) {
-               struct connman_storage *storage = list->data;
-
-               if (storage->service_save) {
-                       if (storage->service_save(service) == 0)
-                               return 0;
-               }
-       }
-
-       return -ENOENT;
-}
-
-int __connman_storage_init(void)
-{
-       DBG("");
-
-       return 0;
-}
-
-void __connman_storage_cleanup(void)
-{
-       DBG("");
-}