Skip to main content

do_boot_module

Function do_boot_module 

Source
pub fn do_boot_module(
    table: &mut modulestab,
    modname: &str,
    features: Option<&[String]>,
    silent: i32,
) -> i32
Expand description

Port of deletemathfunc(MathFunc f) from Src/module.c:1342.

C body:

deletemathfunc(MathFunc f) {
    MathFunc p, q;
    for (p = mathfuncs, q = NULL; p && p != f; q = p, p = p->next);
    if (p) {
        if (q) q->next = f->next; else mathfuncs = f->next;
        if (f->module) {
            zsfree(f->name); zsfree(f->module); zfree(f, sizeof(*f));
        } else
            f->flags &= ~MFF_ADDED;
        return 0;
    }
    return -1;
}

Removes math function f from the global registry. Returns 0 on hit, -1 on miss. Port of do_boot_module(Module m, Feature_enables enablesarr, int silent) from Src/module.c:2139.

C body:

do_boot_module(Module m, Feature_enables enablesarr, int silent)
{
    int ret = do_module_features(m, enablesarr,
                                 silent ? FEAT_IGNORE|FEAT_CHECKAUTO :
                                 FEAT_CHECKAUTO);
    if (ret == 1) return 1;
    if (boot_module(m)) return 1;
    return ret;
}