Skip to main content

brink_format/
lib.rs

1//! Binary interface between the brink compiler and runtime.
2//!
3//! This crate defines the types shared across the compiler/runtime boundary:
4//! `DefinitionId`, opcodes, value types, line templates, and the top-level
5//! `StoryData` container.
6//!
7//! `brink-runtime` depends ONLY on this crate — nothing else from brink.
8
9mod codec;
10mod counting;
11mod definition;
12mod id;
13mod inkb;
14mod inkl;
15mod line;
16mod opcode;
17mod story;
18mod value;
19
20#[cfg(feature = "inkt")]
21mod inkt;
22
23pub use counting::CountingFlags;
24pub use definition::{
25    AddressDef, AddressPath, ContainerDef, ExternalFnDef, GlobalVarDef, LineEntry, ListDef,
26    ListItemDef, LocaleData, LocaleLineEntry, LocaleScopeTable, ScopeLineTable, SlotInfo,
27    SourceLocation, content_hash,
28};
29pub use id::{DefinitionId, DefinitionTag, LineId, NameId};
30pub use inkb::{
31    InkbIndex, SectionEntry, SectionKind, assemble_inkb, read_inkb, read_inkb_index,
32    read_section_address_paths, read_section_addresses, read_section_containers,
33    read_section_externals, read_section_line_tables, read_section_list_defs,
34    read_section_list_items, read_section_list_literals, read_section_name_table,
35    read_section_variables, write_inkb, write_section_address_paths, write_section_addresses,
36    write_section_containers, write_section_externals, write_section_line_tables,
37    write_section_list_defs, write_section_list_items, write_section_list_literals,
38    write_section_name_table, write_section_variables,
39};
40pub use inkl::{read_inkl, write_inkl};
41pub use line::{
42    LineContent, LineFlags, LinePart, LineTemplate, PluralCategory, PluralResolver, SelectKey,
43};
44pub use opcode::{ChoiceFlags, DecodeError, Opcode, SequenceKind};
45pub use story::StoryData;
46pub use value::{ListValue, Value, ValueType};
47
48#[cfg(feature = "inkt")]
49pub use inkt::{InktParseError, read_inkt, write_inkt};