Skip to main content

loadparamnode

Function loadparamnode 

Source
pub fn loadparamnode(
    _ht: &HashTable,
    pm: Option<Param>,
    nam: &str,
) -> Option<Param>
Expand description

Direct port of static Param loadparamnode(HashTable ht, Param pm, const char *nam) from Src/params.c:544-567. If pm is an AUTOLOAD stub, fires the module loader and re-fetches the node from ht; otherwise returns pm unchanged.

C body: if (pm && (pm->flags & PM_AUTOLOAD) && pm->u.str) { int level = pm->level; char *mn = dupstring(pm->u.str); (void)ensurefeature(mn, “p:”, nam); pm = (Param)gethashnode2(ht, nam); while (pm && pm->level > level) pm = pm->old; if (pm && (pm->level != level || (pm->flags & PM_AUTOLOAD))) pm = NULL; if (!pm) zerr(“autoloading module %s failed…”, mn, nam); } return pm; Port of loadparamnode(HashTable ht, Param pm, const char *nam) from Src/params.c:544. WARNING: param names don’t match C — Rust=(pm, nam) vs C=(ht, pm, nam)