JFLib

plat/hosted.rs#

Source: lib/plat/hosted.rs

hosted -- a program with the standard library (feature std, docs/CRATES.md CR6); the only file
of plat that names std, compiled only with that feature.  Its start is std's (the C runtime's
entry, std's main), so plat has no entry point of its own: the program's fn main calls
std_start (win.rs, linux_glibc.rs, apple.rs), which sets up what plat's entry sets up without std.
rt::main! and ui::main! write that fn main.

  exit(code)          plat::exit: std::process::exit, which writes out what std's stdout holds
  jfgui_std_start()   the symbol the fn main of rt::main! and ui::main! calls: std_start()
  std_start()         (browser, Android) the host starts the app there (web.rs), never a fn main
  initial_block()     (Linux) argc, argv[], 0, envp[], 0 from std, as the kernel lays them out
  • fn exit(code: i32) -> ! end the process: std::process::exit, which writes out what std's stdout still holds; from any thread, not from a crash handler

  • fn jfgui_std_start() -> ! what rt::main!'s and ui::main!'s fn main calls: std_start

  • fn std_start() -> ! In the browser and on Android the host starts the app (web.rs), never a fn main.

Source: docs/API.md in the JFLib repository.