timeserver: Remove connman_timeserver_driver framework
authorAlok Barsode <alok.barsode@linux.intel.com>
Fri, 3 Feb 2012 18:26:05 +0000 (20:26 +0200)
committerSamuel Ortiz <sameo@linux.intel.com>
Sat, 4 Feb 2012 00:15:36 +0000 (01:15 +0100)
include/timeserver.h
src/timeserver.c

index 83ad557..d124537 100644 (file)
 extern "C" {
 #endif
 
-#define CONNMAN_TIMESERVER_PRIORITY_LOW      -100
-#define CONNMAN_TIMESERVER_PRIORITY_DEFAULT     0
-#define CONNMAN_TIMESERVER_PRIORITY_HIGH      100
-
-/**
- * SECTION:timeserver
- * @title: timeserver premitives
- * @short_description: Functions for handling time servers (including NTP)
- */
-
 int __connman_timeserver_system_append(const char *server);
 int __connman_timeserver_system_remove(const char *server);
 
-struct connman_timeserver_driver {
-       const char *name;
-       int priority;
-       int (*append) (const char *server);
-       int (*remove) (const char *server);
-       void (*sync) (void);
-};
-
-int connman_timeserver_driver_register(struct connman_timeserver_driver *driver);
-void connman_timeserver_driver_unregister(struct connman_timeserver_driver *driver);
-
 #ifdef __cplusplus
 }
 #endif
index 0a268f5..d31801f 100644 (file)
@@ -31,9 +31,6 @@
 
 #include "connman.h"
 
-static GSList *driver_list = NULL;
-static GHashTable *server_hash = NULL;
-
 static char **system_timeservers = NULL;
 static char **timeservers = NULL;
 
@@ -88,45 +85,6 @@ static char **load_timeservers()
        return servers;
 }
 
-static gint compare_priority(gconstpointer a, gconstpointer b)
-{
-       const struct connman_timeserver_driver *driver1 = a;
-       const struct connman_timeserver_driver *driver2 = b;
-
-       return driver2->priority - driver1->priority;
-}
-
-/**
- * connman_timeserver_driver_register:
- * @driver: timeserver driver definition
- *
- * Register a new timeserver driver
- *
- * Returns: %0 on success
- */
-int connman_timeserver_driver_register(struct connman_timeserver_driver *driver)
-{
-       DBG("driver %p name %s", driver, driver->name);
-
-       driver_list = g_slist_insert_sorted(driver_list, driver,
-                                                       compare_priority);
-
-       return 0;
-}
-
-/**
- * connman_timeserver_driver_unregister:
- * @driver: timeserver driver definition
- *
- * Remove a previously registered timeserver driver
- */
-void connman_timeserver_driver_unregister(struct connman_timeserver_driver *driver)
-{
-       DBG("driver %p name %s", driver, driver->name);
-
-       driver_list = g_slist_remove(driver_list, driver);
-}
-
 /* Restart NTP procedure */
 static void connman_timeserver_restart()
 {
@@ -379,15 +337,10 @@ int __connman_timeserver_init(void)
 {
        DBG("");
 
-       server_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
-                                               g_free, NULL);
-
        return 0;
 }
 
 void __connman_timeserver_cleanup(void)
 {
        DBG("");
-
-       g_hash_table_destroy(server_hash);
 }