← 都来码 / Dolaima← 例程索引lua/test/sysinfo.lua原文

lua/test/sysinfo.lua · 1494 字节 · 下载原文

-- sysinfo.lua —— 全能接口 CALLJSON(#573) 自检:调用 sysinfo 并把返回的 JSON 整份打出来。

-- sysinfo.lua — self-check for the all-purpose CALLJSON(#573) interface: call sysinfo and print the whole returned JSON.


-- ── 显式引用 UI 库的声明文件 ────────────────────────────────────────────────

-- Explicit reference to the UI library's declaration file.

--

-- `Lib/lua/vml_ui.lua` 由 `GenLib -n -c vmlui -l lua` 从 `Lib/shared/src/vmlui.c` 生成(155 个 `ui_*`)。

-- `Lib/lua/vml_ui.lua` is produced by `GenLib -n -c vmlui -l lua` from `Lib/shared/src/vmlui.c` (155 `ui_*`).

-- **不要手写、也不要手改生成物**(要改就改生成器 `tools/GenLib`)。

-- Never hand-write it and never edit the generated file (change the generator `tools/GenLib` instead).

--

-- ⚠ 这条 `require` 对 Lua 是**文档级**引用:本前端按名字解析库函数,删掉它照样编得过、跑得对。

-- ⚠ For Lua this `require` is a **documentation-level** reference: the front end resolves library

-- functions by name, so removing it still compiles and runs.

-- 实测结论与命令见 `docs/UI库导入约定.md` 的「lua 实测结论」一节。

-- Measured results and the exact commands are in the UI-library import convention doc (Lua section).

require("vml_ui")
ui_call_json_s("sysinfo", "")
ui_call_json_print()