Skip to main content

featuresarray

Function featuresarray 

Source
pub fn featuresarray(
    _m: *const module,
    bn: &[builtin],
    cd: &[conddef],
    mf: &[mathfunc],
    pd: &[paramdef],
    n_abstract: i32,
) -> Vec<String>
Expand description

Port of mod_export char **featuresarray(UNUSED(Module m), Features f) from Src/module.c:3284. Construct the feature-name array for a module: builtins get b:NAME, conditions c:NAME or C:NAME if CONDF_INFIX, math funcs f:NAME, params p:NAME. Trailing abstract slots (n_abstract) are pre-allocated but left empty so the module’s own setup can fill them in. C uses zhalloc heap allocation — Box goes out of scope here as Rust’s Vec<String> owns the entries (Drop happens automatically). Per-module Rust files in src/ported/modules/*.rs and src/ported/builtins/*.rs each carry a featuresarray shim that delegates to this canonical free fn once the modules table is wired through. WARNING: param names don’t match C — Rust=(_m, bn, cd, mf, pd, n_abstract) vs C=(m, f)