modules: Cosmetics, mostly
This commit is contained in:
parent
416f847dc3
commit
d0372038fd
|
@ -97,7 +97,7 @@ __imlib_dynamic_filters_init()
|
|||
#ifdef FDEBUG
|
||||
printf("DEBUG: Loading Filters\n");
|
||||
#endif
|
||||
list = __imlib_ListModules(__imlib_PathToFilters(), &num_filters);
|
||||
list = __imlib_ModulesList(__imlib_PathToFilters(), &num_filters);
|
||||
for (i = num_filters - 1; i >= 0; i--)
|
||||
{
|
||||
tptr = NULL;
|
||||
|
|
|
@ -46,6 +46,7 @@ int __imlib_ItemInList(char **list, int size, char *item);
|
|||
|
||||
const char *__imlib_PathToFilters(void);
|
||||
const char *__imlib_PathToLoaders(void);
|
||||
char **__imlib_ListModules(const char *path, int *num_ret);
|
||||
char **__imlib_ModulesList(const char *path, int *num_ret);
|
||||
char *__imlib_ModuleFind(const char *path, const char *name);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -233,7 +233,7 @@ __imlib_LoadAllLoaders(void)
|
|||
DP("%s\n", __func__);
|
||||
|
||||
/* list all the loaders imlib can find */
|
||||
list = __imlib_ListModules(__imlib_PathToLoaders(), &num);
|
||||
list = __imlib_ModulesList(__imlib_PathToLoaders(), &num);
|
||||
/* no loaders? well don't load anything */
|
||||
if (!list)
|
||||
return;
|
||||
|
@ -266,7 +266,7 @@ __imlib_LookupKnownLoader(const char *format)
|
|||
ImlibLoader *l;
|
||||
unsigned int i;
|
||||
const char *const *exts;
|
||||
char nbuf[4096];
|
||||
char *dso;
|
||||
|
||||
kl = NULL;
|
||||
for (i = 0; i < ARRAY_SIZE(loaders_known); i++)
|
||||
|
@ -284,9 +284,9 @@ __imlib_LookupKnownLoader(const char *format)
|
|||
l = NULL;
|
||||
if (kl)
|
||||
{
|
||||
snprintf(nbuf, sizeof(nbuf), "%s/%s.so", __imlib_PathToLoaders(),
|
||||
kl->dso);
|
||||
l = __imlib_ProduceLoader(nbuf);
|
||||
dso = __imlib_ModuleFind(__imlib_PathToLoaders(), kl->dso);
|
||||
l = __imlib_ProduceLoader(dso);
|
||||
free(dso);
|
||||
}
|
||||
DP("%s: '%s' -> '%s': %p\n", __func__, format, kl ? kl->dso : "-", l);
|
||||
return l;
|
||||
|
|
|
@ -81,7 +81,7 @@ _file_is_module(const char *name)
|
|||
}
|
||||
|
||||
char **
|
||||
__imlib_ListModules(const char *path, int *num_ret)
|
||||
__imlib_ModulesList(const char *path, int *num_ret)
|
||||
{
|
||||
char **list = NULL, **l;
|
||||
char file[1024], *p;
|
||||
|
@ -113,3 +113,13 @@ __imlib_ListModules(const char *path, int *num_ret)
|
|||
|
||||
return list;
|
||||
}
|
||||
|
||||
char *
|
||||
__imlib_ModuleFind(const char *path, const char *name)
|
||||
{
|
||||
char nbuf[4096];
|
||||
|
||||
snprintf(nbuf, sizeof(nbuf), "%s/%s.so", path, name);
|
||||
|
||||
return strdup(nbuf);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue