entelechy-ffi自动生成
层:接口层 · 代码行数:1,638 · 集成测试文件:3
C ABI:把会话作为库载入任何程序的进程,原地读取 Field。
C ABI host: a session as a library any program loads in its own process, the Fields read in place
Entelechy as a library in another process: the session the CLI and the
Player run, behind the C ABI in include/entelechy.h. A host opens a scene,
evaluates it under its own input, and reads Fields in place in the
Host’s memory; the JSON protocol is reachable one line at a time.
A session is used from one thread and one call at a time: a call made
while another is inside it is refused (EntelechySession). Returned
strings and pointers belong to the session until the next call on it;
a Field’s words until the next evaluate, request or close. No panic
crosses the boundary: each entry reports one as an error.
| 内部依赖 | entelechy-abi, entelechy-gpu, entelechy-graph, entelechy-kernel, entelechy-protocol, entelechy-session |
| 外部依赖 | — |
| 源码 | crates/interface/ffi |
| 名称 | 简述 |
|---|---|
EntelechyInput |
What an evaluation sees; the layout of EntelechyInput in the header. |
EntelechyPointer |
The scene’s pointer as it lies in memory; the layout of EntelechyPointer in the header. |
EntelechyField |
A Field as it lies in memory; the layout of EntelechyField in the header. |
EntelechySession |
A session as a caller holds it, and whether a call is inside it. A call made while another is inside (a page reaching in while Entelechy waits for its device) is refused as a NULL session is, so no two calls touch what is held at once. |
EntelechyFiles |
An in-memory file store a session opened on it reads instead of a disk. Files put after opening are read on the session’s next evaluate. |
| 名称 | 类型 | 取值 | 简述 |
|---|---|---|---|
ABI_VERSION |
u32 |
2 |
The version of the header’s contract, ENTELECHY_ABI_VERSION. |
play
EntelechyInput
Section titled “EntelechyInput”crates/interface/ffi/src/lib.rs#L27
What an evaluation sees; the layout of EntelechyInput in the header.
属性
| 名称 | 类型 | 说明 |
|---|---|---|
time |
f64 |
|
rate |
f32 |
|
pointer |
[f32; 2] |
|
wheel |
[f32; 2] |
|
window |
[f32; 2] |
|
scale |
f32 |
|
buttons |
u32 |
|
keys |
[u32; 8] |
实现的 Trait: Clone, Copy, Debug, Default
EntelechyPointer
Section titled “EntelechyPointer”crates/interface/ffi/src/lib.rs#L57
The scene’s pointer as it lies in memory; the layout of
EntelechyPointer in the header.
属性
| 名称 | 类型 | 说明 |
|---|---|---|
rgba |
*const u8 |
|
width |
u32 |
|
height |
u32 |
|
hotspot_x |
u32 |
|
hotspot_y |
u32 |
实现的 Trait: Clone, Copy, Debug
EntelechyField
Section titled “EntelechyField”crates/interface/ffi/src/lib.rs#L68
A Field as it lies in memory; the layout of EntelechyField in the header.
属性
| 名称 | 类型 | 说明 |
|---|---|---|
words |
*const u32 |
|
width |
u32 |
|
height |
u32 |
|
depth |
u32 |
|
count |
u32 |
|
stride |
u32 |
|
shape |
u32 |
|
pixels |
u32 |
|
schema |
*const c_char |
实现的 Trait: Clone, Copy, Debug
EntelechySession
Section titled “EntelechySession”crates/interface/ffi/src/lib.rs#L84
A session as a caller holds it, and whether a call is inside it. A call made while another is inside (a page reaching in while Entelechy waits for its device) is refused as a NULL session is, so no two calls touch what is held at once.
EntelechyFiles
Section titled “EntelechyFiles”crates/interface/ffi/src/lib.rs#L564
An in-memory file store a session opened on it reads instead of a disk. Files put after opening are read on the session’s next evaluate.

