alef 0.23.71

Opinionated polyglot binding generator for Rust libraries
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

    // Visitor FFI handles
    static final MethodHandle {{ prefix_upper }}_VISITOR_CREATE = LINKER.downcallHandle(
        LIB.find("{{ prefix }}_visitor_create")
            .or(() -> LIB.find("_{{ prefix }}_visitor_create"))  // Try underscore-prefixed variant for macOS
            .orElseThrow(),
        FunctionDescriptor.of(ValueLayout.ADDRESS, ValueLayout.ADDRESS)
    );

    static final MethodHandle {{ prefix_upper }}_VISITOR_FREE = LINKER.downcallHandle(
        LIB.find("{{ prefix }}_visitor_free")
            .or(() -> LIB.find("_{{ prefix }}_visitor_free"))  // Try underscore-prefixed variant for macOS
            .orElseThrow(),
        FunctionDescriptor.ofVoid(ValueLayout.ADDRESS)
    );

{{ options_set_handles }}