core/dynlib/example
example
Types
1Symbols
Symbols :: struct {
// `foo_` is prefixed, so we look for the symbol `foo_add`.
add: proc() -> (int),
// We use the tag here to override the symbol to look for, namely `bar_sub`.
sub: proc() -> (int),
// Exported global (if exporting an i32, the type must be ^i32 because the symbol is a pointer to the export.)
// If it's not a pointer or procedure type, we'll skip the struct field.
hellope: ^i32,
// Handle to free library.
// We can have more than one of these so we can match symbols for more than one DLL with one struct.
_my_lib_handle: dynlib.Library,
}SourceVariables
1foo_hellope
foo_hellope :: i32 = 42Source