pocketbook: inkview handling rework#2294
Open
benoit-pierre wants to merge 1 commit intokoreader:masterfrom
Open
pocketbook: inkview handling rework#2294benoit-pierre wants to merge 1 commit intokoreader:masterfrom
benoit-pierre wants to merge 1 commit intokoreader:masterfrom
Conversation
Rely on a new repo collecting different inkview versions: https://github.com/benoit-pierre/pocketbook-inkview. Add a mechanism to generate a cdefs file handling all our supported inkview versions: - generate a dedicated cdefs file for each supported version using our standard ffi-cdecl tool - merge all those individual files into a single one (`ffi/inkview_h.lua`, see `base/utils/gen_inkview_h.sh`) The pocketbook code is updated to work like this: - instead of directly requiring `ffi/inkview_h` and loading the inkview shared library, a new `ffi/inkview` module is required, which will: - load the inkview shared library - get the library version, and set a global `ffi.C.POCKETBOOK_VERSION` constant (in `major * 100 + minor` integer format, for easier comparison) - require `ffi/inkview_h`, which will load the right cdefs based on `POCKETBOOK_VERSION` - return the handle to the shared library - pcall based checks for inkview symbols are changed to test `POCKETBOOK_VERSION` Supported inkview versions: - < 5.5: runtime error: 5.2 (the older inkview version I could find headers for), is not supported; as the layout of `iv_mtinfo` is not compatible with our inkview-compat code - >= 5.5, <= 6.11: explicitly supported; `ffi/inkview_h` will target the most recent version older or equal to `POCKETBOOK_VERSION` for which cdefs are available - > 6.11: no error is raised at runtime, the code assume the API we rely on is still binary compatible (`ffi/inkview_h` will target 6.11)
benoit-pierre
added a commit
to benoit-pierre/koreader
that referenced
this pull request
Mar 8, 2026
Member
Author
|
This is of course completely untested, since I don't have access to a pocketbook! :P |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rely on a new repo collecting different inkview versions: https://github.com/benoit-pierre/pocketbook-inkview.
Add a mechanism to generate a cdefs file handling all our supported inkview versions:
ffi/inkview_h.lua, seebase/utils/gen_inkview_h.sh)The pocketbook code is updated to work like this:
ffi/inkview_hand loading the inkview shared library, a newffi/inkviewmodule is required, which will:ffi.C.POCKETBOOK_VERSIONconstant (inmajor * 100 + minorinteger format, for easier comparison)ffi/inkview_h, which will load the right cdefs based onPOCKETBOOK_VERSIONPOCKETBOOK_VERSIONSupported inkview versions:
iv_mtinfois not compatible with our inkview-compat codeffi/inkview_hwill target the most recent version older or equal toPOCKETBOOK_VERSIONfor which cdefs are availableffi/inkview_hwill target 6.11)This change is