kwo pushed a commit to branch master.

http://git.enlightenment.org/legacy/imlib2.git/commit/?id=5b549803647b86cea94fd0965e4de354fe933538

commit 5b549803647b86cea94fd0965e4de354fe933538
Author: Kim Woelders <k...@woelders.dk>
Date:   Sat Apr 16 14:48:40 2016 +0200

    Move __imlib_ItemInList() to file.c.
    
    It may not be the ideal location but it's better than image.c
---
 src/lib/file.c  | 18 ++++++++++++++++++
 src/lib/file.h  |  2 ++
 src/lib/image.c | 20 --------------------
 src/lib/image.h |  1 -
 4 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/src/lib/file.c b/src/lib/file.c
index ee0898c..4e61752 100644
--- a/src/lib/file.c
+++ b/src/lib/file.c
@@ -392,3 +392,21 @@ __imlib_FileHomeDir(int uid)
 
    return NULL;
 }
+
+int
+__imlib_ItemInList(char **list, int size, char *item)
+{
+   int                 i;
+
+   if (!list)
+      return 0;
+   if (!item)
+      return 0;
+
+   for (i = 0; i < size; i++)
+     {
+        if (!strcmp(list[i], item))
+           return 1;
+     }
+   return 0;
+}
diff --git a/src/lib/file.h b/src/lib/file.h
index 18fdd39..4e9a0d1 100644
--- a/src/lib/file.h
+++ b/src/lib/file.h
@@ -18,4 +18,6 @@ int                 __imlib_FilePermissions(const char *s);
 int                 __imlib_FileCanRead(const char *s);
 int                 __imlib_IsRealFile(const char *s);
 
+int                 __imlib_ItemInList(char **list, int size, char *item);
+
 #endif
diff --git a/src/lib/image.c b/src/lib/image.c
index 0b7790d..b9fb9d1 100644
--- a/src/lib/image.c
+++ b/src/lib/image.c
@@ -676,26 +676,6 @@ __imlib_TrimLoaderList(char **list, int *num)
    return ret;
 }
 
-int
-__imlib_ItemInList(char **list, int size, char *item)
-{
-   int                 i;
-
-   if (!size)
-      return 0;
-   if (!list)
-      return 0;
-   if (!item)
-      return 0;
-
-   for (i = 0; i < size; i++)
-     {
-        if (!strcmp(list[i], item))
-           return 1;
-     }
-   return 0;
-}
-
 /* fre the struct for a loader and close its dlopen'd handle */
 static void
 __imlib_ConsumeLoader(ImlibLoader * l)
diff --git a/src/lib/image.h b/src/lib/image.h
index 24b7907..42bea83 100644
--- a/src/lib/image.h
+++ b/src/lib/image.h
@@ -136,7 +136,6 @@ void                
__imlib_RemoveImagePixmapFromCache(ImlibImagePixmap * ip);
 void                __imlib_CleanupImagePixmapCache(void);
 #endif
 char              **__imlib_TrimLoaderList(char **list, int *num);
-int                 __imlib_ItemInList(char **list, int size, char *item);
 void                __imlib_RemoveAllLoaders(void);
 ImlibLoader        *__imlib_FindBestLoaderForFile(const char *file,
                                                   int for_save);

-- 


Reply via email to