diff options
author | Vlad Zahorodnii <vlad.zahorodnii@kde.org> | 2022-01-30 21:56:02 +0100 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2022-01-31 14:10:08 +0000 |
commit | ab3b9f9a773e3ec2c40d80ab14277659b2a55ca6 (patch) | |
tree | 1833d8f116548d090f654f39eeb9cc7e21e9dd7b | |
parent | ba6ba4b07ac2691b381a6a463d9217a031c699c7 (diff) |
xcursor: garbage collect XcursorLibraryLoadImages
XcursorLibraryLoadImages is unused, let's drop it.
Same as [1].
[1]: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/206
Co-authored-by: Simon Ser <contact@emersion.fr>
-rw-r--r-- | include/xcursor/xcursor.h | 3 | ||||
-rw-r--r-- | xcursor/xcursor.c | 79 |
2 files changed, 0 insertions, 82 deletions
diff --git a/include/xcursor/xcursor.h b/include/xcursor/xcursor.h index 285f4de6..c21707b4 100644 --- a/include/xcursor/xcursor.h +++ b/include/xcursor/xcursor.h @@ -54,9 +54,6 @@ typedef struct _XcursorImages { char *name; /* name used to load images */ } XcursorImages; -XcursorImages * -XcursorLibraryLoadImages (const char *file, const char *theme, int size); - void XcursorImagesDestroy (XcursorImages *images); diff --git a/xcursor/xcursor.c b/xcursor/xcursor.c index 4415a659..293d6e9d 100644 --- a/xcursor/xcursor.c +++ b/xcursor/xcursor.c @@ -795,85 +795,6 @@ _XcursorThemeInherits (const char *full) return result; } -static FILE * -XcursorScanTheme (const char *theme, const char *name) -{ - FILE *f = NULL; - char *full; - char *dir; - const char *path; - char *inherits = NULL; - const char *i; - - if (!theme || !name) - return NULL; - - /* - * Scan this theme - */ - for (path = XcursorLibraryPath (); - path && f == NULL; - path = _XcursorNextPath (path)) - { - dir = _XcursorBuildThemeDir (path, theme); - if (dir) - { - full = _XcursorBuildFullname (dir, "cursors", name); - if (full) - { - f = fopen (full, "r"); - free (full); - } - if (!f && !inherits) - { - full = _XcursorBuildFullname (dir, "", "index.theme"); - if (full) - { - inherits = _XcursorThemeInherits (full); - free (full); - } - } - free (dir); - } - } - /* - * Recurse to scan inherited themes - */ - for (i = inherits; i && f == NULL; i = _XcursorNextPath (i)) - { - if (strcmp(i, theme) != 0) - f = XcursorScanTheme (i, name); - else - printf("Not calling XcursorScanTheme because of circular dependency: %s. %s", i, name); - } - if (inherits != NULL) - free (inherits); - return f; -} - -XcursorImages * -XcursorLibraryLoadImages (const char *file, const char *theme, int size) -{ - FILE *f = NULL; - XcursorImages *images = NULL; - - if (!file) - return NULL; - - if (theme) - f = XcursorScanTheme (theme, file); - if (!f) - f = XcursorScanTheme ("default", file); - if (f) - { - images = XcursorFileLoadImages (f, size); - if (images) - XcursorImagesSetName (images, file); - fclose (f); - } - return images; -} - static void load_all_cursors_from_dir(const char *path, int size, void (*load_callback)(XcursorImages *, void *), |