Modules

Remap_Context

moduleSource

Available on macOS, Linux, Windows, Wasm

#import "Remap_Context";

Turns a context built by another program into this program's #Context: remap_context returns it, Remap_Context() installs it for the rest of the scope.

Module parameters#

VERBOSE := true
Warns about a context it cannot map; false silences it.

Procedures#

()

Makes remap_context() the context for the rest of the enclosing scope, so code that received a context built by another program (a plugin, say) runs with one laid out the way this program expects.

{
    Remap_Context();
    assert(context.context_info == type_info(#Context));
}
↗
() -> result: #Context
(foreign_context: *void, foreign_type: *Type_Info_Struct) -> result: #Context

Returns the current context as this program's #Context. When context came from a program with a different layout, its fields are copied over by name; see the two-argument form.