Lyricdev
GitHub

struct Export

pub struct Export :: [OnFunction]

Conforms to OnFunction.

Makes a function C's to call, by a symbol of its own.

@Export("geo_area") on a pub fn gives C the function geo_area; a bare @Export names it as the function is named. Its parameters and its result are what crosses into C, as for an extern "C" function. One that throws returns C's LyrStatus and hands its result through a last parameter, a pointer. An exported function is always part of the program, and lyric build --lib builds the library C links, with a header that declares every export.