5 import java.foreign.memory.*;
6 import java.foreign.annotations.*;
7 import java.util.function.IntFunction;
11 public class TestAPI {
12 public static void main(String[] args) {
13 APILib lib = APILib.bind;
14 LayoutType<Data> dataLayout = LayoutType.ofStruct(Data.class);
16 try (Scope s = Libraries.libraryScope(lib).fork()) {
17 Pointer<Data> a = s.allocate(dataLayout);
18 Pointer<Data> b = s.allocate(dataLayout);
19 Callback<Call__I> cb = s.allocateCallback(Call__I.class,
40 System.out.println("from a\n");
42 System.out.println("\bfrom b\n");