[gnome-settings-daemon/wip/xsettings-manager: 5/16] xsettings: drop now-unused XSettingsList



commit 809f22e9ebf964250569990995dab1d9ab49c356
Author: Ryan Lortie <desrt desrt ca>
Date:   Wed Mar 7 20:00:39 2012 -0500

    xsettings: drop now-unused XSettingsList

 plugins/xsettings/xsettings-common.c |  141 ----------------------------------
 plugins/xsettings/xsettings-common.h |   16 ----
 2 files changed, 0 insertions(+), 157 deletions(-)
---
diff --git a/plugins/xsettings/xsettings-common.c b/plugins/xsettings/xsettings-common.c
index 992175a..9ac5296 100644
--- a/plugins/xsettings/xsettings-common.c
+++ b/plugins/xsettings/xsettings-common.c
@@ -77,45 +77,6 @@ xsettings_setting_copy (XSettingsSetting *setting)
   return NULL;
 }
 
-XSettingsList *
-xsettings_list_copy (XSettingsList *list)
-{
-  XSettingsList *new = NULL;
-  XSettingsList *old_iter = list;
-  XSettingsList *new_iter = NULL;
-
-  while (old_iter)
-    {
-      XSettingsList *new_node;
-
-      new_node = malloc (sizeof *new_node);
-      if (!new_node)
-	goto error;
-
-      new_node->setting = xsettings_setting_copy (old_iter->setting);
-      if (!new_node->setting)
-	{
-	  free (new_node);
-	  goto error;
-	}
-
-      if (new_iter)
-	new_iter->next = new_node;
-      else
-	new = new_node;
-
-      new_iter = new_node;
-      
-      old_iter = old_iter->next;
-    }
-
-  return new;
-
- error:
-  xsettings_list_free (new);
-  return NULL;
-}
-
 int
 xsettings_setting_equal (XSettingsSetting *setting_a,
 			 XSettingsSetting *setting_b)
@@ -154,108 +115,6 @@ xsettings_setting_free (XSettingsSetting *setting)
   free (setting);
 }
 
-void
-xsettings_list_free (XSettingsList *list)
-{
-  while (list)
-    {
-      XSettingsList *next = list->next;
-
-      xsettings_setting_free (list->setting);
-      free (list);
-
-      list = next;
-    }
-}
-
-XSettingsResult
-xsettings_list_insert (XSettingsList    **list,
-		       XSettingsSetting  *setting)
-{
-  XSettingsList *node;
-  XSettingsList *iter;
-  XSettingsList *last = NULL;
-
-  node = malloc (sizeof *node);
-  if (!node)
-    return XSETTINGS_NO_MEM;
-  node->setting = setting;
-
-  iter = *list;
-  while (iter)
-    {
-      int cmp = strcmp (setting->name, iter->setting->name);
-
-      if (cmp < 0)
-	break;
-      else if (cmp == 0)
-	{
-	  free (node);
-	  return XSETTINGS_DUPLICATE_ENTRY;
-	}
-
-      last = iter;
-      iter = iter->next;
-    }
-  
-  if (last)
-    last->next = node;
-  else
-    *list = node;
-  
-  node->next = iter;
-  
-  return XSETTINGS_SUCCESS;
-}
-
-XSettingsResult
-xsettings_list_delete (XSettingsList **list,
-		       const char     *name)
-{
-  XSettingsList *iter;
-  XSettingsList *last = NULL;
-
-  iter = *list;
-  while (iter)
-    {
-      if (strcmp (name, iter->setting->name) == 0)
-	{
-	  if (last)
-	    last->next = iter->next;
-	  else
-	    *list = iter->next;
-  
-	  xsettings_setting_free (iter->setting);
-	  free (iter);
-
-	  return XSETTINGS_SUCCESS;
-	}
-
-      last = iter;
-      iter = iter->next;
-    }
-
-  return XSETTINGS_FAILED;
-}
-
-XSettingsSetting *
-xsettings_list_lookup (XSettingsList *list,
-		       const char    *name)
-{
-  XSettingsList *iter;
-
-  iter = list;
-  while (iter)
-    {
-      if (strcmp (name, iter->setting->name) == 0)
-	return iter->setting;
-
-      iter = iter->next;
-    }
-
-  return NULL;
-}
-
 char
 xsettings_byte_order (void)
 {
diff --git a/plugins/xsettings/xsettings-common.h b/plugins/xsettings/xsettings-common.h
index e3af4a6..3bbd85a 100644
--- a/plugins/xsettings/xsettings-common.h
+++ b/plugins/xsettings/xsettings-common.h
@@ -29,7 +29,6 @@ extern "C" {
 
 typedef struct _XSettingsBuffer  XSettingsBuffer;
 typedef struct _XSettingsColor   XSettingsColor;
-typedef struct _XSettingsList    XSettingsList;
 typedef struct _XSettingsSetting XSettingsSetting;
 
 /* Types of settings possible. Enum values correspond to
@@ -65,12 +64,6 @@ struct _XSettingsColor
   unsigned short red, green, blue, alpha;
 };
 
-struct _XSettingsList
-{
-  XSettingsSetting *setting;
-  XSettingsList *next;
-};
-
 struct _XSettingsSetting
 {
   char *name;
@@ -90,15 +83,6 @@ void              xsettings_setting_free  (XSettingsSetting *setting);
 int               xsettings_setting_equal (XSettingsSetting *setting_a,
 					   XSettingsSetting *setting_b);
 
-void              xsettings_list_free   (XSettingsList     *list);
-XSettingsList    *xsettings_list_copy   (XSettingsList     *list);
-XSettingsResult   xsettings_list_insert (XSettingsList    **list,
-					 XSettingsSetting  *setting);
-XSettingsSetting *xsettings_list_lookup (XSettingsList     *list,
-					 const char        *name);
-XSettingsResult   xsettings_list_delete (XSettingsList    **list,
-					 const char        *name);
-
 char xsettings_byte_order (void);
 
 #define XSETTINGS_PAD(n,m) ((n + m - 1) & (~(m-1)))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]