Skip to main content

do_load_module

Function do_load_module 

Source
pub fn do_load_module(table: &mut modulestab, name: &str, silent: i32) -> i32
Expand description

Port of do_load_module(char const *name, int silent) from Src/module.c:1610.

C body:

do_load_module(char const *name, int silent)
{
    void *ret;
    ret = try_load_module(name);
    if (!ret && !silent) {
        zwarn("failed to load module `%s': %s", name, ...);
    }
    return ret;
}

C returns void * (the dlopen handle); Rust port returns 0 on success / 1 on failure. zshrs’s static-link path: try_load_module always succeeds for built-in modules. Returns 1 + zwarn on miss. WARNING: param names don’t match C — Rust=(table, name, silent) vs C=(name, silent)