changeset 33780:04b4fa214c2a

Remove duplicated list code from the Win32 GUI. Use common code. Patch by Stephen Sheldon, sfsheldo gmail com.
author ib
date Sun, 10 Jul 2011 15:45:18 +0000
parents 55d46640a679
children cdd4fc0616b6
files Makefile gui/win32/interface.c
diffstat 2 files changed, 1 insertions(+), 48 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Sun Jul 10 15:42:09 2011 +0000
+++ b/Makefile	Sun Jul 10 15:45:18 2011 +0000
@@ -518,6 +518,7 @@
 SRCS_MPLAYER-$(GL_X11)       += libvo/x11_common.c
 SRCS_MPLAYER-$(MATRIXVIEW)   += libvo/vo_matrixview.c libvo/matrixview.c
 SRCS_MPLAYER-$(GUI)          += gui/util/bitmap.c \
+                                gui/util/list.c \
                                 gui/util/string.c
 SRCS_MPLAYER-$(GUI_GTK)      += gui/app.c \
                                 gui/cfg.c \
@@ -542,7 +543,6 @@
                                 gui/ui/sub.c \
                                 gui/ui/widgets.c \
                                 gui/util/cut.c \
-                                gui/util/list.c \
                                 gui/wm/ws.c \
                                 gui/wm/wsxdnd.c \
 
--- a/gui/win32/interface.c	Sun Jul 10 15:42:09 2011 +0000
+++ b/gui/win32/interface.c	Sun Jul 10 15:45:18 2011 +0000
@@ -94,53 +94,6 @@
     return 0;
 }
 
-/**
- * \brief this actually creates a new list containing only one element...
- */
-void gaddlist( char ***list, const char *entry)
-{
-    int i;
-
-    if (*list)
-    {
-        for (i=0; (*list)[i]; i++) free((*list)[i]);
-        free(*list);
-    }
-
-    *list = malloc(2 * sizeof(char **));
-    (*list)[0] = gstrdup(entry);
-    (*list)[1] = NULL;
-}
-
-/**
- * \brief this replaces a string starting with search by replace.
- * If not found, replace is appended.
- */
-void greplace(char ***list, const char *search, const char *replace)
-{
-    int i = 0;
-    int len = (search) ? strlen(search) : 0;
-
-    if (*list)
-    {
-        for (i = 0; (*list)[i]; i++)
-        {
-            if (search && (!strncmp((*list)[i], search, len)))
-            {
-                free((*list)[i]);
-                (*list)[i] = gstrdup(replace);
-                return;
-            }
-        }
-    *list = realloc(*list, (i + 2) * sizeof(char *));
-    }
-    else
-        *list = malloc(2 * sizeof(char *));
-
-    (*list)[i] = gstrdup(replace);
-    (*list)[i + 1] = NULL;
-}
-
 /* this function gets called by the gui to update mplayer */
 static void guiSetEvent(int event)
 {