Move __imlib_ItemInList() to file.c.

It may not be the ideal location but it's better than image.c
This commit is contained in:
Kim Woelders 2016-04-16 14:48:40 +02:00
parent 31a261ac37
commit 5b54980364
4 changed files with 20 additions and 21 deletions

View File

@ -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;
}

View File

@ -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

View File

@ -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)

View File

@ -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);