Skip to content

Comments

loader: introduce component adapter and route backend calls#219

Closed
saitoha wants to merge 1 commit intodevelopfrom
feat/refactor-loader-mechanism-for-generalization
Closed

loader: introduce component adapter and route backend calls#219
saitoha wants to merge 1 commit intodevelopfrom
feat/refactor-loader-mechanism-for-generalization

Conversation

@saitoha
Copy link
Owner

@saitoha saitoha commented Feb 21, 2026

Motivation

  • Prepare for componentized loader refactoring by introducing a stable abstraction for loader backends so future factory/manager work can be layered without changing backend implementations.
  • Preserve existing behavior while enabling an indirection point to inject runtime options to backends via a unified API.

Description

  • Add a sixel_loader_component_t abstraction with vtable and thin wrappers (ref, unref, setopt, load, get_name) in src/loader-component.h / src/loader-component.c.
  • Add a legacy adapter loader-component-legacy (src/loader-component-legacy.h / src/loader-component-legacy.c) that wraps existing sixel_loader_entry_t backends and maps setopt options to the legacy backend call signature.
  • Change sixel_loader_load_file() to create a legacy component per candidate registry entry, apply loader options via setopt (loader_apply_component_options) and invoke decoding using component->load() instead of calling entry->backend(...) directly.
  • Register the new sources and headers in both Meson and autotools build files (src/meson.build, src/Makefile.am, src/Makefile.in) so normal and amalgamated builds include the new files.

Testing

  • Ran source /workspace/.local/env-autotools.sh && autoreconf -fi && ./configure && make -j4, and the build completed successfully (pass).
  • Ran source /workspace/.local/env-autotools.sh && ./configure && make check, and the test suite completed with a single unrelated network test failure: io/network/0006_invalid_https_error_message (1 fail, other tests passed or skipped); this failure appears not to be related to the introduced loader component changes (⚠️).
  • Ran Meson workflow meson setup builddir --wipe && meson compile -C builddir && meson test -C builddir, and the test run also produced the same single network test failure (most tests passed, 1 fail) (⚠️).
  • Built amalgamated variants with Meson and autotools (meson setup builddir-amalgamated -Damalgamated_tools=true -Damalgamated_lib=true && meson compile -C builddir-amalgamated and ./configure --enable-amalgamated-lib --enable-amalgamated-tools && make -j4), and those builds completed successfully (pass).

Codex Task

@coveralls
Copy link

Coverage Status

coverage: 83.606% (+0.2%) from 83.377%
when pulling 8e40641 on feat/refactor-loader-mechanism-for-generalization
into 0f4b526 on develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants