Skip to main content

lumen_app_new

Function lumen_app_new 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn lumen_app_new( dir: *const c_char, ) -> *mut LumenApp
Expand description

Allocate a new app rooted at dir (UTF-8, NUL-terminated). The directory must exist and contain main.lmn and/or lumen.toml. Returns null on error; call lumen_last_error for details.

ABI 0.3 made this validation eager: prior versions accepted any path and only surfaced a bad directory later, inside lumen_app_run (i.e. only after opening a window). The directory is now stat-ed up front and its contents checked, so a bad app directory fails at construction time with a null return.