Expand description
kr_vocabulary: dictionary sources that engines adopt, without scheduling or native editing
authority.
A vocabulary handle holds six vocabulary sources, the English and Russian Vim spell files and four learned-word slots, each with a configured path, flags, a generation and a current snapshot. Two locks keep the slow path away from the controller thread:
acquisition one Source per slot; held across file I/O by kr_vocabulary_observe
published path, flags, generation and snapshot per slot; held briefly by configure,
adopt, and the start and end of observeObserve takes acquisition before published and nothing takes them in the other order, so
configure and adopt never wait for a file read. A configuration change advances the slot’s
generation; an observation that began under the old generation finds the change when it
locks published again and publishes nothing (STALE_CONFIGURATION). Adoption clones every
snapshot under one lock, so an engine never pairs a language from before a change with one
from after it.
Structs§
- Vocabulary
Handle kr_vocabulary: six vocabulary sources behind two locks, shared by the acquisition queue and the controller thread. Free only after every operation has completed.
Functions§
- kr_
adopt_ ⚠vocabulary - Adopt the language views and learned lists together, without changing session state or authority.
- kr_
vocabulary_ ⚠configure - Configure one logical source without I/O. Changed paths or flags immediately become missing.
- kr_
vocabulary_ ⚠configure_ default - Configure one language’s Vim spell file under the absolute
homedirectory, without I/O:.vim/spell(vimfiles\spellon Windows) anden.utf-8.addorru.utf-8.add. A missing file there behaves as withMISSING_IS_EMPTY; a joined path overMAX_PATHisBOUNDS. - kr_
vocabulary_ ⚠free - Free after all source and adoption operations have completed. Null is a no-op.
- kr_
vocabulary_ ⚠new - Allocate an isolated source handle with no configured paths or file reads.
- kr_
vocabulary_ ⚠observe - Observe on a serialized acquisition queue, outside UI/native input callbacks.