Package-level declarations
Types
Grow-on-demand byte buffer. Pure Kotlin (no platform OutputStream classes), so it works in commonMain across all targets, and it's faster than mutableListOf<Byte>() because it stores into a contiguous primitive array.
Random-access byte cursor over an in-memory PDF.
A parsed document from any handler: the fz_document equivalent. Lets a viewer treat a io.github.yuroyami.kitepdf.PdfDocument and an io.github.yuroyami.kitepdf.epub.EpubDocument uniformly.
Common supertype for "these bytes are not a well-formed document of the format this handler reads" failures. Format handlers throw a subtype (PdfFormatException, EpubFormatException, ...) with a precise message; callers that prefer null-on-failure use the handler's openOrNull.
A minimal reentrant mutual-exclusion lock (T-16). JVM/Android wrap ReentrantLock, native targets a reentrant atomic spinlock, JS/Wasm are single-threaded no-ops. Use through withLock.
A minimal reentrant mutual-exclusion lock (T-16). JVM/Android wrap ReentrantLock, native targets a reentrant atomic spinlock, JS/Wasm are single-threaded no-ops. Use through withLock.
Single-threaded target: locking is a no-op.
A minimal reentrant mutual-exclusion lock (T-16). JVM/Android wrap ReentrantLock, native targets a reentrant atomic spinlock, JS/Wasm are single-threaded no-ops. Use through withLock.
Reentrant spinlock over a single atomic owner word. POSIX mutex structs differ per native family (structs on Apple/Linux, integer typedefs on MinGW), so a portable pure-atomics lock beats four platform actuals here. Spinning is acceptable because every critical section under this lock is a few map operations; the parse work itself runs outside it (T-16). After a short spin budget the waiter yields: an empty spin on Darwin's QoS scheduler can starve a lower-priority holder scheduled on the same core (the failure mode that got OSSpinLock deprecated).
Single-threaded target: locking is a no-op.
Single-threaded target: locking is a no-op.
One node of a format-neutral outline (PDF bookmarks / EPUB table of contents), for a viewer's navigation panel.
Marks the raw object-model surface: direct access to xref tables, trailer dictionaries, indirect-object resolution, and the low-level editor primitives. The FILE FORMAT these expose is stable; the Kotlin surface is not, and may change between minor releases without a deprecation cycle. High-level API (pages, outlines, form fields, rendering, search) never requires this opt-in.
Format-neutral structured text for a KitePage: the minimal blocks → lines → text model a viewer needs for extraction, search highlights and selection, without committing to a handler's internals.
A paragraph-ish group of consecutive lines from one layout block.
One laid-out line. charEdges has text.length + 1 display-space x boundaries: charEdges[i] is the left edge of char i, the final entry the line's right edge. That is enough to build sub-line highlight quads.
The fz_warn equivalent: a process-global, nullable warning sink for the places where the engine silently salvages (cached-null resolves, repair fallbacks, skipped page-tree kids, failed filters, placeholder images).
Receives one-line diagnostics from lenient salvage paths.
Raised for any structural PDF error: bad header, truncated stream, malformed xref, etc.
Raised when a PDF is encrypted and the supplied password did not authenticate.
Functions
A stable identifier for the calling thread (0 on single-threaded targets). Lets cycle guards distinguish same-thread reentrancy (a real cycle) from another thread legitimately resolving the same object concurrently.
A stable identifier for the calling thread (0 on single-threaded targets). Lets cycle guards distinguish same-thread reentrancy (a real cycle) from another thread legitimately resolving the same object concurrently.
A stable identifier for the calling thread (0 on single-threaded targets). Lets cycle guards distinguish same-thread reentrancy (a real cycle) from another thread legitimately resolving the same object concurrently.
A stable identifier for the calling thread (0 on single-threaded targets). Lets cycle guards distinguish same-thread reentrancy (a real cycle) from another thread legitimately resolving the same object concurrently.
A stable identifier for the calling thread (0 on single-threaded targets). Lets cycle guards distinguish same-thread reentrancy (a real cycle) from another thread legitimately resolving the same object concurrently.
A stable identifier for the calling thread (0 on single-threaded targets). Lets cycle guards distinguish same-thread reentrancy (a real cycle) from another thread legitimately resolving the same object concurrently.
A stable identifier for the calling thread (0 on single-threaded targets). Lets cycle guards distinguish same-thread reentrancy (a real cycle) from another thread legitimately resolving the same object concurrently.
Emit through KiteWarnings.sink. Message construction is lazy (free when no sink is installed) and a throwing sink can never break the caller.