$ show derf/feh
feh is a lightweight, configurable X11 image viewer and cataloguer written in C. It provides multiple viewing modes: slideshow, index (montage), thumbnail browser, multiwindow, file list, and wallpaper setting. The application relies on Imlib2 for image loading and rendering, with optional support for libcurl (HTTP/HTTPS), libexif (EXIF metadata), Xinerama (multi-monitor), inotify (auto-reload), and libmagic (MIME detection). The codebase is modular, featuring reusable generic data structures (doubly linked list, hash table, Imlib2 wrapper) and a format specifier system for actions, captions, and titles. It is a mature, stable project with a long history (since 1999) and an extensive test suite using X11::GUITest. However, it shows signs of technical drift: manual memory management, legacy code comments, deprecated options, platform-specific conditionals, and reliance on external tools like dcraw and ImageMagick for certain image formats. The project is actively maintained with regular releases.
The LLM identified 4 files worth highlighting for reuse:
Generic doubly linked list implementation supporting sort, reverse, randomize, merge, foreach, and find operations. It is self-contained (no internal dependencies beyond standard C) and can be extracted for use in any project requiring a flexible list.
Simple hash table using linked-list buckets with insert, lookup, delete, and iteration. It is independent and reusable; could serve as a lightweight key-value store in other C projects.
Wrapper around Imlib2 functions for image loading, rendering, text drawing, rotation, and blur. It provides a simplified, consistent API and handles image loading from files, HTTP, stdin, and custom loaders. Isolated and suitable for reuse in any C application needing Imlib2 integration.
Collection of utility functions including memory allocation (emalloc, erealloc), string operations (estrdup, shell_escape, gib_string_split, feh_wrap_string), and filename generation (feh_unique_filename). These are generic, have no internal dependencies, and can be used independently.