hex/crates/keyboard/ffi/Cargo.toml
Sebastian Herrlinger 4a339e879e Keyboard core: the dictation rules' C interface (hk_dictation_*, ABI 3)
One call per stage the iOS pipeline and its callers use: the style
(hk_dictation_format), spoken symbols and counts, Clean up's rules, Format lists,
Spoken punctuation, French spacing, the reconstruction the tagger ends with, its
word split, and the keyboard's insertion helpers (with the host's dictionary
as a callback). Text goes both ways as UTF-8 with a length, so a transcript
holding U+0000 survives, and the core frees what it writes (hk_text_free). The
language comes as the host's Locale reads it (identifier, code, region).

spoken_symbols now returns an error, not a panic, where the Swift original
traps (two addresses back to back); the C call reports it as
HK_DICTATION_OVERLAPPING_ADDRESSES and leaves the decision to the host.

HK_ABI_VERSION is 3: 2 is the tap decoder's (PR 2).
2026-11-23 01:19:48 +01:00

28 lines
707 B
TOML

[package]
name = "hex-keyboard-ffi"
version = "0.1.0"
edition.workspace = true
license.workspace = true
publish.workspace = true
[lib]
# libhex_keyboard.a for iOS, libhex_keyboard.so for Android (and the host JVM test).
name = "hex_keyboard"
crate-type = ["staticlib", "cdylib", "rlib"]
[features]
# The Android IME's JNI entry points (ly.anoma.hex.typing.KeyboardCore).
jni = ["dep:jni"]
[dependencies]
hex-keyboard-core = { path = "../core" }
memmap2 = "0.9"
# fcntl, to duplicate a caller's descriptor (hk_model_open_fd); already in the lock via memmap2.
libc = "0.2"
jni = { version = "0.21", optional = true, default-features = false }
[dev-dependencies]
serde_json = "1"
[lints]
workspace = true