From 576f9c9eafa17e9f3bb13e2c85d2ef4516620a3c Mon Sep 17 00:00:00 2001 From: exaucae Date: Fri, 11 Nov 2022 23:43:57 +0000 Subject: [PATCH 1/7] feat: print hello world with Java down calling C --- java-panama/pom.xml | 46 +++++++++++++++++++ .../com/baeldung/java/panama/HelloWorld.java | 42 +++++++++++++++++ 2 files changed, 88 insertions(+) create mode 100644 java-panama/pom.xml create mode 100644 java-panama/src/main/java/com/baeldung/java/panama/HelloWorld.java diff --git a/java-panama/pom.xml b/java-panama/pom.xml new file mode 100644 index 0000000000..ad711d0718 --- /dev/null +++ b/java-panama/pom.xml @@ -0,0 +1,46 @@ + + 4.0.0 + + com.baeldung.java.panama + java-panama + 1.0-SNAPSHOT + jar + + java-panama + https://maven.apache.org + + + UTF-8 + 19 + 19 + 3.10.1 + + + + + org.junit.jupiter + junit-jupiter + 5.9.0 + test + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + ${maven.compiler.version} + + ${maven.compiler.source} + ${maven.compiler.target} + + --add-opens=java.base/java.lang.foreign=ALL-UNNAMED + --enable-preview + + + + + + diff --git a/java-panama/src/main/java/com/baeldung/java/panama/HelloWorld.java b/java-panama/src/main/java/com/baeldung/java/panama/HelloWorld.java new file mode 100644 index 0000000000..060a8552ef --- /dev/null +++ b/java-panama/src/main/java/com/baeldung/java/panama/HelloWorld.java @@ -0,0 +1,42 @@ +package com.baeldung.java.panama; + +import java.lang.foreign.*; +import java.lang.invoke.MethodHandle; +import java.util.Objects; + +import static java.lang.foreign.ValueLayout.ADDRESS; +import static java.lang.foreign.ValueLayout.JAVA_INT; + + +public class HelloWorld { + + public static void main(String[] args) throws Throwable { + + String symbolName = "printf"; + String greetings = "Hello World from Project Panama Baeldung Article"; + + Linker nativeLinker = Linker.nativeLinker(); + SymbolLookup stdlibLookup = nativeLinker.defaultLookup(); + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + + FunctionDescriptor functionDescriptor = FunctionDescriptor.of( + JAVA_INT.withBitAlignment(32), + ADDRESS.withBitAlignment(64) + ); + + MethodHandle methodHandle = + loaderLookup.lookup(symbolName) + .or(() -> stdlibLookup.lookup(symbolName)) + .map( + symbolAddress -> nativeLinker.downcallHandle(symbolAddress, functionDescriptor) + ).orElse(null); + + + Objects.requireNonNull(methodHandle); + + try (MemorySession memorySession = MemorySession.openConfined()) { + MemorySegment nativeGreetings = memorySession.allocateUtf8String(greetings + "\n"); + methodHandle.invoke(nativeGreetings); + } + } +} From 7e1a06e2e6af2410674f0b3cb90dfdbc7172a2fb Mon Sep 17 00:00:00 2001 From: exaucae Date: Sat, 12 Nov 2022 00:21:08 +0000 Subject: [PATCH 2/7] refactor: curate hello world sample Remove noisy bits --- .../com/baeldung/java/panama/HelloWorld.java | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/java-panama/src/main/java/com/baeldung/java/panama/HelloWorld.java b/java-panama/src/main/java/com/baeldung/java/panama/HelloWorld.java index 060a8552ef..79c57cdbc4 100644 --- a/java-panama/src/main/java/com/baeldung/java/panama/HelloWorld.java +++ b/java-panama/src/main/java/com/baeldung/java/panama/HelloWorld.java @@ -13,30 +13,25 @@ public class HelloWorld { public static void main(String[] args) throws Throwable { String symbolName = "printf"; - String greetings = "Hello World from Project Panama Baeldung Article"; + String greeting = "Hello World from Project Panama Baeldung Article"; Linker nativeLinker = Linker.nativeLinker(); SymbolLookup stdlibLookup = nativeLinker.defaultLookup(); SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); - FunctionDescriptor functionDescriptor = FunctionDescriptor.of( - JAVA_INT.withBitAlignment(32), - ADDRESS.withBitAlignment(64) - ); + FunctionDescriptor descriptor = FunctionDescriptor.of(JAVA_INT, ADDRESS); - MethodHandle methodHandle = - loaderLookup.lookup(symbolName) - .or(() -> stdlibLookup.lookup(symbolName)) - .map( - symbolAddress -> nativeLinker.downcallHandle(symbolAddress, functionDescriptor) - ).orElse(null); + MethodHandle methodHandle = loaderLookup.lookup(symbolName) + .or(() -> stdlibLookup.lookup(symbolName)) + .map(symbolSegment -> nativeLinker.downcallHandle(symbolSegment, descriptor)) + .orElse(null); Objects.requireNonNull(methodHandle); try (MemorySession memorySession = MemorySession.openConfined()) { - MemorySegment nativeGreetings = memorySession.allocateUtf8String(greetings + "\n"); - methodHandle.invoke(nativeGreetings); + MemorySegment greetingSegment = memorySession.allocateUtf8String(greeting); + methodHandle.invoke(greetingSegment); } } } From ed738777df2cdb8c2f01bbd629cb7e3c6bbce2ea Mon Sep 17 00:00:00 2001 From: exaucae Date: Wed, 8 Feb 2023 01:19:46 +0000 Subject: [PATCH 3/7] feat: add jextract & FFM API examples --- .../{HelloWorld.java => core/Greetings.java} | 12 +- .../java/panama/core/MemoryAllocation.java | 26 + .../java/panama/core/MemoryLayout.java | 56 + .../java/panama/jextract/Greetings.java | 17 + .../main/java/foreign/c/Constants$root.java | 23 + java-panama/src/main/java/foreign/c/FILE.java | 14 + .../main/java/foreign/c/RuntimeHelper.java | 233 ++ .../src/main/java/foreign/c/_iobuf.java | 162 ++ .../src/main/java/foreign/c/constants$0.java | 52 + .../src/main/java/foreign/c/constants$1.java | 54 + .../src/main/java/foreign/c/constants$10.java | 61 + .../src/main/java/foreign/c/constants$11.java | 60 + .../src/main/java/foreign/c/constants$12.java | 58 + .../src/main/java/foreign/c/constants$13.java | 53 + .../src/main/java/foreign/c/constants$14.java | 52 + .../src/main/java/foreign/c/constants$15.java | 50 + .../src/main/java/foreign/c/constants$16.java | 61 + .../src/main/java/foreign/c/constants$17.java | 64 + .../src/main/java/foreign/c/constants$18.java | 63 + .../src/main/java/foreign/c/constants$19.java | 62 + .../src/main/java/foreign/c/constants$2.java | 60 + .../src/main/java/foreign/c/constants$20.java | 56 + .../src/main/java/foreign/c/constants$21.java | 18 + .../src/main/java/foreign/c/constants$3.java | 64 + .../src/main/java/foreign/c/constants$4.java | 64 + .../src/main/java/foreign/c/constants$5.java | 63 + .../src/main/java/foreign/c/constants$6.java | 67 + .../src/main/java/foreign/c/constants$7.java | 69 + .../src/main/java/foreign/c/constants$8.java | 61 + .../src/main/java/foreign/c/constants$9.java | 59 + .../src/main/java/foreign/c/stdio_h.java | 1881 +++++++++++++++++ java-panama/src/main/resources/hello.c | 5 + 32 files changed, 3694 insertions(+), 6 deletions(-) rename java-panama/src/main/java/com/baeldung/java/panama/{HelloWorld.java => core/Greetings.java} (80%) create mode 100644 java-panama/src/main/java/com/baeldung/java/panama/core/MemoryAllocation.java create mode 100644 java-panama/src/main/java/com/baeldung/java/panama/core/MemoryLayout.java create mode 100644 java-panama/src/main/java/com/baeldung/java/panama/jextract/Greetings.java create mode 100644 java-panama/src/main/java/foreign/c/Constants$root.java create mode 100644 java-panama/src/main/java/foreign/c/FILE.java create mode 100644 java-panama/src/main/java/foreign/c/RuntimeHelper.java create mode 100644 java-panama/src/main/java/foreign/c/_iobuf.java create mode 100644 java-panama/src/main/java/foreign/c/constants$0.java create mode 100644 java-panama/src/main/java/foreign/c/constants$1.java create mode 100644 java-panama/src/main/java/foreign/c/constants$10.java create mode 100644 java-panama/src/main/java/foreign/c/constants$11.java create mode 100644 java-panama/src/main/java/foreign/c/constants$12.java create mode 100644 java-panama/src/main/java/foreign/c/constants$13.java create mode 100644 java-panama/src/main/java/foreign/c/constants$14.java create mode 100644 java-panama/src/main/java/foreign/c/constants$15.java create mode 100644 java-panama/src/main/java/foreign/c/constants$16.java create mode 100644 java-panama/src/main/java/foreign/c/constants$17.java create mode 100644 java-panama/src/main/java/foreign/c/constants$18.java create mode 100644 java-panama/src/main/java/foreign/c/constants$19.java create mode 100644 java-panama/src/main/java/foreign/c/constants$2.java create mode 100644 java-panama/src/main/java/foreign/c/constants$20.java create mode 100644 java-panama/src/main/java/foreign/c/constants$21.java create mode 100644 java-panama/src/main/java/foreign/c/constants$3.java create mode 100644 java-panama/src/main/java/foreign/c/constants$4.java create mode 100644 java-panama/src/main/java/foreign/c/constants$5.java create mode 100644 java-panama/src/main/java/foreign/c/constants$6.java create mode 100644 java-panama/src/main/java/foreign/c/constants$7.java create mode 100644 java-panama/src/main/java/foreign/c/constants$8.java create mode 100644 java-panama/src/main/java/foreign/c/constants$9.java create mode 100644 java-panama/src/main/java/foreign/c/stdio_h.java create mode 100644 java-panama/src/main/resources/hello.c diff --git a/java-panama/src/main/java/com/baeldung/java/panama/HelloWorld.java b/java-panama/src/main/java/com/baeldung/java/panama/core/Greetings.java similarity index 80% rename from java-panama/src/main/java/com/baeldung/java/panama/HelloWorld.java rename to java-panama/src/main/java/com/baeldung/java/panama/core/Greetings.java index 79c57cdbc4..7c210f1216 100644 --- a/java-panama/src/main/java/com/baeldung/java/panama/HelloWorld.java +++ b/java-panama/src/main/java/com/baeldung/java/panama/core/Greetings.java @@ -1,14 +1,12 @@ -package com.baeldung.java.panama; +package com.baeldung.java.panama.core; import java.lang.foreign.*; import java.lang.invoke.MethodHandle; -import java.util.Objects; -import static java.lang.foreign.ValueLayout.ADDRESS; -import static java.lang.foreign.ValueLayout.JAVA_INT; +import static java.lang.foreign.ValueLayout.*; -public class HelloWorld { +public class Greetings { public static void main(String[] args) throws Throwable { @@ -27,7 +25,9 @@ public class HelloWorld { .orElse(null); - Objects.requireNonNull(methodHandle); + if(methodHandle == null){ + throw new NoSuchMethodError("Method Handle was not found"); + }; try (MemorySession memorySession = MemorySession.openConfined()) { MemorySegment greetingSegment = memorySession.allocateUtf8String(greeting); diff --git a/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryAllocation.java b/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryAllocation.java new file mode 100644 index 0000000000..710f1a1e87 --- /dev/null +++ b/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryAllocation.java @@ -0,0 +1,26 @@ +package com.baeldung.java.panama.core; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.MemorySession; +import java.lang.foreign.ValueLayout; +import java.lang.foreign.SegmentAllocator; + + + +public class MemoryAllocation { + + public static void main(String[] args) throws Throwable { + + + try (MemorySession session = MemorySession.openConfined()) { + String[] greetingStrings = {"hello", "world", "panama", "baeldung"}; + SegmentAllocator allocator = SegmentAllocator.implicitAllocator(); + MemorySegment offHeapSegment = allocator.allocateArray(ValueLayout.ADDRESS, greetingStrings.length); + for (int i = 0; i < greetingStrings.length; i++) { + // Allocate a string off-heap, then store a pointer to it + MemorySegment cString = allocator.allocateUtf8String(greetingStrings[i]); + offHeapSegment.setAtIndex(ValueLayout.ADDRESS, i, cString); + } + } + } +} diff --git a/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryLayout.java b/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryLayout.java new file mode 100644 index 0000000000..620577f887 --- /dev/null +++ b/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryLayout.java @@ -0,0 +1,56 @@ +package com.baeldung.java.panama.core; + +import java.lang.foreign.GroupLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.MemorySession; +import java.lang.foreign.SequenceLayout; +import java.lang.invoke.VarHandle; + +import static java.lang.foreign.MemoryLayout.sequenceLayout; +import static java.lang.foreign.MemoryLayout.structLayout; +import static java.lang.foreign.ValueLayout.*; + + +public class MemoryLayout { + + public static void main(String[] args) { + + GroupLayout pointLayout = structLayout( + JAVA_DOUBLE.withName("x"), + JAVA_DOUBLE.withName("y") + ); + + SequenceLayout ptsLayout = sequenceLayout(10, + pointLayout); + + VarHandle xvarHandle = pointLayout.varHandle(PathElement.groupElement("x")); + VarHandle yvarHandle = pointLayout.varHandle(PathElement.groupElement("y")); + + try (MemorySession memorySession = MemorySession.openConfined()) { + + MemorySegment pointSegment = memorySession.allocate(pointLayout); + xvarHandle.set(pointSegment, 3d); + yvarHandle.set(pointSegment, 4d); + + System.out.println(pointSegment.toString()); + + } + + } + + static class ValueLayout { + + public static void main(String[] args) { + + try (MemorySession memorySession = MemorySession.openConfined()) { + int byteSize = 5; + int index = 3; + float value = 6; + MemorySegment segment = MemorySegment.allocateNative(byteSize, memorySession); + segment.setAtIndex(JAVA_FLOAT, index, value); + float result = segment.getAtIndex(JAVA_FLOAT, index); + System.out.println("Float value is:" + result); + } + } + } +} diff --git a/java-panama/src/main/java/com/baeldung/java/panama/jextract/Greetings.java b/java-panama/src/main/java/com/baeldung/java/panama/jextract/Greetings.java new file mode 100644 index 0000000000..7a22c70fce --- /dev/null +++ b/java-panama/src/main/java/com/baeldung/java/panama/jextract/Greetings.java @@ -0,0 +1,17 @@ +package com.baeldung.java.panama.jextract; + +import java.lang.foreign.MemorySegment; +import java.lang.foreign.MemorySession; +import static foreign.c.stdio_h.printf; + +public class Greetings { + + public static void main(String[] args) { + String greeting = "Hello World from Project Panama Baeldung Article, using JExtract!"; + + try (MemorySession memorySession = MemorySession.openConfined()) { + MemorySegment greetingSegment = memorySession.allocateUtf8String(greeting); + printf(greetingSegment); + } + } +} diff --git a/java-panama/src/main/java/foreign/c/Constants$root.java b/java-panama/src/main/java/foreign/c/Constants$root.java new file mode 100644 index 0000000000..2a8f1bad0c --- /dev/null +++ b/java-panama/src/main/java/foreign/c/Constants$root.java @@ -0,0 +1,23 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +public class Constants$root { + + static final OfBoolean C_BOOL$LAYOUT = JAVA_BOOLEAN; + static final OfByte C_CHAR$LAYOUT = JAVA_BYTE; + static final OfShort C_SHORT$LAYOUT = JAVA_SHORT.withBitAlignment(16); + static final OfInt C_INT$LAYOUT = JAVA_INT.withBitAlignment(32); + static final OfInt C_LONG$LAYOUT = JAVA_INT.withBitAlignment(32); + static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG.withBitAlignment(64); + static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT.withBitAlignment(32); + static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE.withBitAlignment(64); + static final OfAddress C_POINTER$LAYOUT = ADDRESS.withBitAlignment(64); +} + + diff --git a/java-panama/src/main/java/foreign/c/FILE.java b/java-panama/src/main/java/foreign/c/FILE.java new file mode 100644 index 0000000000..1956914637 --- /dev/null +++ b/java-panama/src/main/java/foreign/c/FILE.java @@ -0,0 +1,14 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +public class FILE extends _iobuf { + +} + + diff --git a/java-panama/src/main/java/foreign/c/RuntimeHelper.java b/java-panama/src/main/java/foreign/c/RuntimeHelper.java new file mode 100644 index 0000000000..5fd36bdc7b --- /dev/null +++ b/java-panama/src/main/java/foreign/c/RuntimeHelper.java @@ -0,0 +1,233 @@ +package foreign.c; +// Generated by jextract + +import java.lang.foreign.Addressable; +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryAddress; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private RuntimeHelper() {} + private final static Linker LINKER = Linker.nativeLinker(); + private final static ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private final static MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private final static SymbolLookup SYMBOL_LOOKUP; + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> MemorySegment.allocateNative(size, align, MemorySession.openImplicit()); + + static { + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.lookup(name).or(() -> LINKER.defaultLookup().lookup(name)); + } + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + private final static SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + + static final MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.lookup(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), MemorySession.openShared())).orElse(null); + } + + static final MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.lookup(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static final MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static final MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.lookup(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static final MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, MemorySession session) { + try { + MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", Linker.upcallType(fdesc)); + handle = handle.bindTo(z); + return LINKER.upcallStub(handle, fdesc, session); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemoryAddress addr, MemoryLayout layout, int numElements, MemorySession session) { + return MemorySegment.ofAddress(addr, numElements * layout.byteSize(), session); + } + + // Internals only below this point + + private static class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + if (mtype.returnType().equals(MemorySegment.class)) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return (ret || valueLayout.carrier() != MemoryAddress.class) ? + valueLayout.carrier() : Addressable.class; + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + if (mh.type().returnType() == MemorySegment.class) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (MemoryAddress.class.isAssignableFrom(c)) { + return MemoryAddress.class; + } + if (MemorySegment.class.isAssignableFrom(c)) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (MemoryAddress.class.isAssignableFrom(c)) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/java-panama/src/main/java/foreign/c/_iobuf.java b/java-panama/src/main/java/foreign/c/_iobuf.java new file mode 100644 index 0000000000..b9f546f634 --- /dev/null +++ b/java-panama/src/main/java/foreign/c/_iobuf.java @@ -0,0 +1,162 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +public class _iobuf { + + static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + Constants$root.C_POINTER$LAYOUT.withName("_ptr"), + Constants$root.C_LONG$LAYOUT.withName("_cnt"), + MemoryLayout.paddingLayout(32), + Constants$root.C_POINTER$LAYOUT.withName("_base"), + Constants$root.C_LONG$LAYOUT.withName("_flag"), + Constants$root.C_LONG$LAYOUT.withName("_file"), + Constants$root.C_LONG$LAYOUT.withName("_charbuf"), + Constants$root.C_LONG$LAYOUT.withName("_bufsiz"), + Constants$root.C_POINTER$LAYOUT.withName("_tmpfname") + ).withName("_iobuf"); + public static MemoryLayout $LAYOUT() { + return _iobuf.$struct$LAYOUT; + } + static final VarHandle _ptr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("_ptr")); + public static VarHandle _ptr$VH() { + return _iobuf._ptr$VH; + } + public static MemoryAddress _ptr$get(MemorySegment seg) { + return (java.lang.foreign.MemoryAddress)_iobuf._ptr$VH.get(seg); + } + public static void _ptr$set( MemorySegment seg, MemoryAddress x) { + _iobuf._ptr$VH.set(seg, x); + } + public static MemoryAddress _ptr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemoryAddress)_iobuf._ptr$VH.get(seg.asSlice(index*sizeof())); + } + public static void _ptr$set(MemorySegment seg, long index, MemoryAddress x) { + _iobuf._ptr$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle _cnt$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("_cnt")); + public static VarHandle _cnt$VH() { + return _iobuf._cnt$VH; + } + public static int _cnt$get(MemorySegment seg) { + return (int)_iobuf._cnt$VH.get(seg); + } + public static void _cnt$set( MemorySegment seg, int x) { + _iobuf._cnt$VH.set(seg, x); + } + public static int _cnt$get(MemorySegment seg, long index) { + return (int)_iobuf._cnt$VH.get(seg.asSlice(index*sizeof())); + } + public static void _cnt$set(MemorySegment seg, long index, int x) { + _iobuf._cnt$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle _base$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("_base")); + public static VarHandle _base$VH() { + return _iobuf._base$VH; + } + public static MemoryAddress _base$get(MemorySegment seg) { + return (java.lang.foreign.MemoryAddress)_iobuf._base$VH.get(seg); + } + public static void _base$set( MemorySegment seg, MemoryAddress x) { + _iobuf._base$VH.set(seg, x); + } + public static MemoryAddress _base$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemoryAddress)_iobuf._base$VH.get(seg.asSlice(index*sizeof())); + } + public static void _base$set(MemorySegment seg, long index, MemoryAddress x) { + _iobuf._base$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle _flag$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("_flag")); + public static VarHandle _flag$VH() { + return _iobuf._flag$VH; + } + public static int _flag$get(MemorySegment seg) { + return (int)_iobuf._flag$VH.get(seg); + } + public static void _flag$set( MemorySegment seg, int x) { + _iobuf._flag$VH.set(seg, x); + } + public static int _flag$get(MemorySegment seg, long index) { + return (int)_iobuf._flag$VH.get(seg.asSlice(index*sizeof())); + } + public static void _flag$set(MemorySegment seg, long index, int x) { + _iobuf._flag$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle _file$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("_file")); + public static VarHandle _file$VH() { + return _iobuf._file$VH; + } + public static int _file$get(MemorySegment seg) { + return (int)_iobuf._file$VH.get(seg); + } + public static void _file$set( MemorySegment seg, int x) { + _iobuf._file$VH.set(seg, x); + } + public static int _file$get(MemorySegment seg, long index) { + return (int)_iobuf._file$VH.get(seg.asSlice(index*sizeof())); + } + public static void _file$set(MemorySegment seg, long index, int x) { + _iobuf._file$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle _charbuf$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("_charbuf")); + public static VarHandle _charbuf$VH() { + return _iobuf._charbuf$VH; + } + public static int _charbuf$get(MemorySegment seg) { + return (int)_iobuf._charbuf$VH.get(seg); + } + public static void _charbuf$set( MemorySegment seg, int x) { + _iobuf._charbuf$VH.set(seg, x); + } + public static int _charbuf$get(MemorySegment seg, long index) { + return (int)_iobuf._charbuf$VH.get(seg.asSlice(index*sizeof())); + } + public static void _charbuf$set(MemorySegment seg, long index, int x) { + _iobuf._charbuf$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle _bufsiz$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("_bufsiz")); + public static VarHandle _bufsiz$VH() { + return _iobuf._bufsiz$VH; + } + public static int _bufsiz$get(MemorySegment seg) { + return (int)_iobuf._bufsiz$VH.get(seg); + } + public static void _bufsiz$set( MemorySegment seg, int x) { + _iobuf._bufsiz$VH.set(seg, x); + } + public static int _bufsiz$get(MemorySegment seg, long index) { + return (int)_iobuf._bufsiz$VH.get(seg.asSlice(index*sizeof())); + } + public static void _bufsiz$set(MemorySegment seg, long index, int x) { + _iobuf._bufsiz$VH.set(seg.asSlice(index*sizeof()), x); + } + static final VarHandle _tmpfname$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("_tmpfname")); + public static VarHandle _tmpfname$VH() { + return _iobuf._tmpfname$VH; + } + public static MemoryAddress _tmpfname$get(MemorySegment seg) { + return (java.lang.foreign.MemoryAddress)_iobuf._tmpfname$VH.get(seg); + } + public static void _tmpfname$set( MemorySegment seg, MemoryAddress x) { + _iobuf._tmpfname$VH.set(seg, x); + } + public static MemoryAddress _tmpfname$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemoryAddress)_iobuf._tmpfname$VH.get(seg.asSlice(index*sizeof())); + } + public static void _tmpfname$set(MemorySegment seg, long index, MemoryAddress x) { + _iobuf._tmpfname$VH.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$0.java b/java-panama/src/main/java/foreign/c/constants$0.java new file mode 100644 index 0000000000..4bd3d3fa4b --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$0.java @@ -0,0 +1,52 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$0 { + + static final FunctionDescriptor fopen$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fopen$MH = RuntimeHelper.downcallHandle( + "fopen", + constants$0.fopen$FUNC + ); + static final FunctionDescriptor freopen$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle freopen$MH = RuntimeHelper.downcallHandle( + "freopen", + constants$0.freopen$FUNC + ); + static final FunctionDescriptor fflush$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fflush$MH = RuntimeHelper.downcallHandle( + "fflush", + constants$0.fflush$FUNC + ); + static final FunctionDescriptor fclose$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fclose$MH = RuntimeHelper.downcallHandle( + "fclose", + constants$0.fclose$FUNC + ); + static final FunctionDescriptor remove$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle remove$MH = RuntimeHelper.downcallHandle( + "remove", + constants$0.remove$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$1.java b/java-panama/src/main/java/foreign/c/constants$1.java new file mode 100644 index 0000000000..acd4dbf615 --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$1.java @@ -0,0 +1,54 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$1 { + + static final FunctionDescriptor rename$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle rename$MH = RuntimeHelper.downcallHandle( + "rename", + constants$1.rename$FUNC + ); + static final FunctionDescriptor tmpfile$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT); + static final MethodHandle tmpfile$MH = RuntimeHelper.downcallHandle( + "tmpfile", + constants$1.tmpfile$FUNC + ); + static final FunctionDescriptor tmpnam$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle tmpnam$MH = RuntimeHelper.downcallHandle( + "tmpnam", + constants$1.tmpnam$FUNC + ); + static final FunctionDescriptor _tempnam$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle _tempnam$MH = RuntimeHelper.downcallHandle( + "_tempnam", + constants$1._tempnam$FUNC + ); + static final FunctionDescriptor _rmtmp$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); + static final MethodHandle _rmtmp$MH = RuntimeHelper.downcallHandle( + "_rmtmp", + constants$1._rmtmp$FUNC + ); + static final FunctionDescriptor _unlink$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle _unlink$MH = RuntimeHelper.downcallHandle( + "_unlink", + constants$1._unlink$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$10.java b/java-panama/src/main/java/foreign/c/constants$10.java new file mode 100644 index 0000000000..5f9cef3d67 --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$10.java @@ -0,0 +1,61 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$10 { + + static final FunctionDescriptor getc$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle getc$MH = RuntimeHelper.downcallHandle( + "getc", + constants$10.getc$FUNC + ); + static final FunctionDescriptor putc$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle putc$MH = RuntimeHelper.downcallHandle( + "putc", + constants$10.putc$FUNC + ); + static final FunctionDescriptor getchar$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); + static final MethodHandle getchar$MH = RuntimeHelper.downcallHandle( + "getchar", + constants$10.getchar$FUNC + ); + static final FunctionDescriptor putchar$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG$LAYOUT + ); + static final MethodHandle putchar$MH = RuntimeHelper.downcallHandle( + "putchar", + constants$10.putchar$FUNC + ); + static final FunctionDescriptor fread$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fread$MH = RuntimeHelper.downcallHandle( + "fread", + constants$10.fread$FUNC + ); + static final FunctionDescriptor fwrite$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fwrite$MH = RuntimeHelper.downcallHandle( + "fwrite", + constants$10.fwrite$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$11.java b/java-panama/src/main/java/foreign/c/constants$11.java new file mode 100644 index 0000000000..c854ef9302 --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$11.java @@ -0,0 +1,60 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$11 { + + static final FunctionDescriptor fseek$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG$LAYOUT + ); + static final MethodHandle fseek$MH = RuntimeHelper.downcallHandle( + "fseek", + constants$11.fseek$FUNC + ); + static final FunctionDescriptor ftell$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle ftell$MH = RuntimeHelper.downcallHandle( + "ftell", + constants$11.ftell$FUNC + ); + static final FunctionDescriptor rewind$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle rewind$MH = RuntimeHelper.downcallHandle( + "rewind", + constants$11.rewind$FUNC + ); + static final FunctionDescriptor fgetpos$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fgetpos$MH = RuntimeHelper.downcallHandle( + "fgetpos", + constants$11.fgetpos$FUNC + ); + static final FunctionDescriptor fsetpos$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fsetpos$MH = RuntimeHelper.downcallHandle( + "fsetpos", + constants$11.fsetpos$FUNC + ); + static final FunctionDescriptor feof$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle feof$MH = RuntimeHelper.downcallHandle( + "feof", + constants$11.feof$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$12.java b/java-panama/src/main/java/foreign/c/constants$12.java new file mode 100644 index 0000000000..db0d19a2b8 --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$12.java @@ -0,0 +1,58 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$12 { + + static final FunctionDescriptor ferror$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle ferror$MH = RuntimeHelper.downcallHandle( + "ferror", + constants$12.ferror$FUNC + ); + static final FunctionDescriptor clearerr$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle clearerr$MH = RuntimeHelper.downcallHandle( + "clearerr", + constants$12.clearerr$FUNC + ); + static final FunctionDescriptor perror$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle perror$MH = RuntimeHelper.downcallHandle( + "perror", + constants$12.perror$FUNC + ); + static final FunctionDescriptor _popen$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle _popen$MH = RuntimeHelper.downcallHandle( + "_popen", + constants$12._popen$FUNC + ); + static final FunctionDescriptor _pclose$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle _pclose$MH = RuntimeHelper.downcallHandle( + "_pclose", + constants$12._pclose$FUNC + ); + static final FunctionDescriptor popen$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle popen$MH = RuntimeHelper.downcallHandle( + "popen", + constants$12.popen$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$13.java b/java-panama/src/main/java/foreign/c/constants$13.java new file mode 100644 index 0000000000..f71ff564a0 --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$13.java @@ -0,0 +1,53 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$13 { + + static final FunctionDescriptor pclose$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle pclose$MH = RuntimeHelper.downcallHandle( + "pclose", + constants$13.pclose$FUNC + ); + static final FunctionDescriptor _flushall$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); + static final MethodHandle _flushall$MH = RuntimeHelper.downcallHandle( + "_flushall", + constants$13._flushall$FUNC + ); + static final FunctionDescriptor _fgetchar$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); + static final MethodHandle _fgetchar$MH = RuntimeHelper.downcallHandle( + "_fgetchar", + constants$13._fgetchar$FUNC + ); + static final FunctionDescriptor _fputchar$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG$LAYOUT + ); + static final MethodHandle _fputchar$MH = RuntimeHelper.downcallHandle( + "_fputchar", + constants$13._fputchar$FUNC + ); + static final FunctionDescriptor _fdopen$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle _fdopen$MH = RuntimeHelper.downcallHandle( + "_fdopen", + constants$13._fdopen$FUNC + ); + static final FunctionDescriptor _fileno$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle _fileno$MH = RuntimeHelper.downcallHandle( + "_fileno", + constants$13._fileno$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$14.java b/java-panama/src/main/java/foreign/c/constants$14.java new file mode 100644 index 0000000000..d1c82c9abb --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$14.java @@ -0,0 +1,52 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$14 { + + static final FunctionDescriptor _fcloseall$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); + static final MethodHandle _fcloseall$MH = RuntimeHelper.downcallHandle( + "_fcloseall", + constants$14._fcloseall$FUNC + ); + static final FunctionDescriptor _fsopen$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG$LAYOUT + ); + static final MethodHandle _fsopen$MH = RuntimeHelper.downcallHandle( + "_fsopen", + constants$14._fsopen$FUNC + ); + static final FunctionDescriptor __mingw_get_output_format$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); + static final MethodHandle __mingw_get_output_format$MH = RuntimeHelper.downcallHandle( + "__mingw_get_output_format", + constants$14.__mingw_get_output_format$FUNC + ); + static final FunctionDescriptor __mingw_set_output_format$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG$LAYOUT + ); + static final MethodHandle __mingw_set_output_format$MH = RuntimeHelper.downcallHandle( + "__mingw_set_output_format", + constants$14.__mingw_set_output_format$FUNC + ); + static final FunctionDescriptor __mingw_get_printf_count_output$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); + static final MethodHandle __mingw_get_printf_count_output$MH = RuntimeHelper.downcallHandle( + "__mingw_get_printf_count_output", + constants$14.__mingw_get_printf_count_output$FUNC + ); + static final FunctionDescriptor __mingw_set_printf_count_output$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG$LAYOUT + ); + static final MethodHandle __mingw_set_printf_count_output$MH = RuntimeHelper.downcallHandle( + "__mingw_set_printf_count_output", + constants$14.__mingw_set_printf_count_output$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$15.java b/java-panama/src/main/java/foreign/c/constants$15.java new file mode 100644 index 0000000000..426e33db00 --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$15.java @@ -0,0 +1,50 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$15 { + + static final FunctionDescriptor _get_output_format$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); + static final MethodHandle _get_output_format$MH = RuntimeHelper.downcallHandle( + "_get_output_format", + constants$15._get_output_format$FUNC + ); + static final FunctionDescriptor _set_output_format$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG$LAYOUT + ); + static final MethodHandle _set_output_format$MH = RuntimeHelper.downcallHandle( + "_set_output_format", + constants$15._set_output_format$FUNC + ); + static final FunctionDescriptor _get_printf_count_output$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); + static final MethodHandle _get_printf_count_output$MH = RuntimeHelper.downcallHandle( + "_get_printf_count_output", + constants$15._get_printf_count_output$FUNC + ); + static final FunctionDescriptor _set_printf_count_output$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG$LAYOUT + ); + static final MethodHandle _set_printf_count_output$MH = RuntimeHelper.downcallHandle( + "_set_printf_count_output", + constants$15._set_printf_count_output$FUNC + ); + static final FunctionDescriptor fgetchar$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); + static final MethodHandle fgetchar$MH = RuntimeHelper.downcallHandle( + "fgetchar", + constants$15.fgetchar$FUNC + ); + static final FunctionDescriptor fputchar$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG$LAYOUT + ); + static final MethodHandle fputchar$MH = RuntimeHelper.downcallHandle( + "fputchar", + constants$15.fputchar$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$16.java b/java-panama/src/main/java/foreign/c/constants$16.java new file mode 100644 index 0000000000..58e06fa164 --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$16.java @@ -0,0 +1,61 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$16 { + + static final FunctionDescriptor fdopen$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fdopen$MH = RuntimeHelper.downcallHandle( + "fdopen", + constants$16.fdopen$FUNC + ); + static final FunctionDescriptor fileno$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fileno$MH = RuntimeHelper.downcallHandle( + "fileno", + constants$16.fileno$FUNC + ); + static final FunctionDescriptor fwprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fwprintf$MH = RuntimeHelper.downcallHandleVariadic( + "fwprintf", + constants$16.fwprintf$FUNC + ); + static final FunctionDescriptor wprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle wprintf$MH = RuntimeHelper.downcallHandleVariadic( + "wprintf", + constants$16.wprintf$FUNC + ); + static final FunctionDescriptor vfwprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle vfwprintf$MH = RuntimeHelper.downcallHandle( + "vfwprintf", + constants$16.vfwprintf$FUNC + ); + static final FunctionDescriptor vwprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle vwprintf$MH = RuntimeHelper.downcallHandle( + "vwprintf", + constants$16.vwprintf$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$17.java b/java-panama/src/main/java/foreign/c/constants$17.java new file mode 100644 index 0000000000..f58aad6fb6 --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$17.java @@ -0,0 +1,64 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$17 { + + static final FunctionDescriptor _snwprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle _snwprintf$MH = RuntimeHelper.downcallHandleVariadic( + "_snwprintf", + constants$17._snwprintf$FUNC + ); + static final FunctionDescriptor _vscwprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle _vscwprintf$MH = RuntimeHelper.downcallHandle( + "_vscwprintf", + constants$17._vscwprintf$FUNC + ); + static final FunctionDescriptor _vsnwprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle _vsnwprintf$MH = RuntimeHelper.downcallHandle( + "_vsnwprintf", + constants$17._vsnwprintf$FUNC + ); + static final FunctionDescriptor fwscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fwscanf$MH = RuntimeHelper.downcallHandleVariadic( + "fwscanf", + constants$17.fwscanf$FUNC + ); + static final FunctionDescriptor wscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle wscanf$MH = RuntimeHelper.downcallHandleVariadic( + "wscanf", + constants$17.wscanf$FUNC + ); + static final FunctionDescriptor swscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle swscanf$MH = RuntimeHelper.downcallHandleVariadic( + "swscanf", + constants$17.swscanf$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$18.java b/java-panama/src/main/java/foreign/c/constants$18.java new file mode 100644 index 0000000000..15af05eb64 --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$18.java @@ -0,0 +1,63 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$18 { + + static final FunctionDescriptor fgetwc$FUNC = FunctionDescriptor.of(Constants$root.C_SHORT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fgetwc$MH = RuntimeHelper.downcallHandle( + "fgetwc", + constants$18.fgetwc$FUNC + ); + static final FunctionDescriptor fputwc$FUNC = FunctionDescriptor.of(Constants$root.C_SHORT$LAYOUT, + Constants$root.C_SHORT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fputwc$MH = RuntimeHelper.downcallHandle( + "fputwc", + constants$18.fputwc$FUNC + ); + static final FunctionDescriptor ungetwc$FUNC = FunctionDescriptor.of(Constants$root.C_SHORT$LAYOUT, + Constants$root.C_SHORT$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle ungetwc$MH = RuntimeHelper.downcallHandle( + "ungetwc", + constants$18.ungetwc$FUNC + ); + static final FunctionDescriptor swprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle swprintf$MH = RuntimeHelper.downcallHandleVariadic( + "swprintf", + constants$18.swprintf$FUNC + ); + static final FunctionDescriptor vswprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle vswprintf$MH = RuntimeHelper.downcallHandle( + "vswprintf", + constants$18.vswprintf$FUNC + ); + static final FunctionDescriptor snwprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle snwprintf$MH = RuntimeHelper.downcallHandleVariadic( + "snwprintf", + constants$18.snwprintf$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$19.java b/java-panama/src/main/java/foreign/c/constants$19.java new file mode 100644 index 0000000000..a9cadf6ddb --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$19.java @@ -0,0 +1,62 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$19 { + + static final FunctionDescriptor vsnwprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle vsnwprintf$MH = RuntimeHelper.downcallHandle( + "vsnwprintf", + constants$19.vsnwprintf$FUNC + ); + static final FunctionDescriptor vwscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle vwscanf$MH = RuntimeHelper.downcallHandle( + "vwscanf", + constants$19.vwscanf$FUNC + ); + static final FunctionDescriptor vfwscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle vfwscanf$MH = RuntimeHelper.downcallHandle( + "vfwscanf", + constants$19.vfwscanf$FUNC + ); + static final FunctionDescriptor vswscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle vswscanf$MH = RuntimeHelper.downcallHandle( + "vswscanf", + constants$19.vswscanf$FUNC + ); + static final FunctionDescriptor _fgetwchar$FUNC = FunctionDescriptor.of(Constants$root.C_SHORT$LAYOUT); + static final MethodHandle _fgetwchar$MH = RuntimeHelper.downcallHandle( + "_fgetwchar", + constants$19._fgetwchar$FUNC + ); + static final FunctionDescriptor _fputwchar$FUNC = FunctionDescriptor.of(Constants$root.C_SHORT$LAYOUT, + Constants$root.C_SHORT$LAYOUT + ); + static final MethodHandle _fputwchar$MH = RuntimeHelper.downcallHandle( + "_fputwchar", + constants$19._fputwchar$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$2.java b/java-panama/src/main/java/foreign/c/constants$2.java new file mode 100644 index 0000000000..a522b398aa --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$2.java @@ -0,0 +1,60 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$2 { + + static final FunctionDescriptor tempnam$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle tempnam$MH = RuntimeHelper.downcallHandle( + "tempnam", + constants$2.tempnam$FUNC + ); + static final FunctionDescriptor rmtmp$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); + static final MethodHandle rmtmp$MH = RuntimeHelper.downcallHandle( + "rmtmp", + constants$2.rmtmp$FUNC + ); + static final FunctionDescriptor unlink$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle unlink$MH = RuntimeHelper.downcallHandle( + "unlink", + constants$2.unlink$FUNC + ); + static final FunctionDescriptor setvbuf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG_LONG$LAYOUT + ); + static final MethodHandle setvbuf$MH = RuntimeHelper.downcallHandle( + "setvbuf", + constants$2.setvbuf$FUNC + ); + static final FunctionDescriptor setbuf$FUNC = FunctionDescriptor.ofVoid( + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle setbuf$MH = RuntimeHelper.downcallHandle( + "setbuf", + constants$2.setbuf$FUNC + ); + static final FunctionDescriptor __mingw_fprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle __mingw_fprintf$MH = RuntimeHelper.downcallHandleVariadic( + "__mingw_fprintf", + constants$2.__mingw_fprintf$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$20.java b/java-panama/src/main/java/foreign/c/constants$20.java new file mode 100644 index 0000000000..feec0d4d44 --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$20.java @@ -0,0 +1,56 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$20 { + + static final FunctionDescriptor _getw$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle _getw$MH = RuntimeHelper.downcallHandle( + "_getw", + constants$20._getw$FUNC + ); + static final FunctionDescriptor _putw$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle _putw$MH = RuntimeHelper.downcallHandle( + "_putw", + constants$20._putw$FUNC + ); + static final FunctionDescriptor fgetwchar$FUNC = FunctionDescriptor.of(Constants$root.C_SHORT$LAYOUT); + static final MethodHandle fgetwchar$MH = RuntimeHelper.downcallHandle( + "fgetwchar", + constants$20.fgetwchar$FUNC + ); + static final FunctionDescriptor fputwchar$FUNC = FunctionDescriptor.of(Constants$root.C_SHORT$LAYOUT, + Constants$root.C_SHORT$LAYOUT + ); + static final MethodHandle fputwchar$MH = RuntimeHelper.downcallHandle( + "fputwchar", + constants$20.fputwchar$FUNC + ); + static final FunctionDescriptor getw$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle getw$MH = RuntimeHelper.downcallHandle( + "getw", + constants$20.getw$FUNC + ); + static final FunctionDescriptor putw$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle putw$MH = RuntimeHelper.downcallHandle( + "putw", + constants$20.putw$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$21.java b/java-panama/src/main/java/foreign/c/constants$21.java new file mode 100644 index 0000000000..ed21424dc5 --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$21.java @@ -0,0 +1,18 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$21 { + + static final MemoryAddress NULL$ADDR = MemoryAddress.ofLong(0L); + static final MemorySegment _P_tmpdir$SEGMENT = RuntimeHelper.CONSTANT_ALLOCATOR.allocateUtf8String("\\"); + static final MemorySegment P_tmpdir$SEGMENT = RuntimeHelper.CONSTANT_ALLOCATOR.allocateUtf8String("\\"); + static final MemorySegment _wP_tmpdir$SEGMENT = RuntimeHelper.CONSTANT_ALLOCATOR.allocateUtf8String("\\"); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$3.java b/java-panama/src/main/java/foreign/c/constants$3.java new file mode 100644 index 0000000000..0709e943bd --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$3.java @@ -0,0 +1,64 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$3 { + + static final FunctionDescriptor __mingw_printf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle __mingw_printf$MH = RuntimeHelper.downcallHandleVariadic( + "__mingw_printf", + constants$3.__mingw_printf$FUNC + ); + static final FunctionDescriptor __mingw_sprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle __mingw_sprintf$MH = RuntimeHelper.downcallHandleVariadic( + "__mingw_sprintf", + constants$3.__mingw_sprintf$FUNC + ); + static final FunctionDescriptor __mingw_snprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle __mingw_snprintf$MH = RuntimeHelper.downcallHandleVariadic( + "__mingw_snprintf", + constants$3.__mingw_snprintf$FUNC + ); + static final FunctionDescriptor __mingw_vfprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle __mingw_vfprintf$MH = RuntimeHelper.downcallHandle( + "__mingw_vfprintf", + constants$3.__mingw_vfprintf$FUNC + ); + static final FunctionDescriptor __mingw_vprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle __mingw_vprintf$MH = RuntimeHelper.downcallHandle( + "__mingw_vprintf", + constants$3.__mingw_vprintf$FUNC + ); + static final FunctionDescriptor __mingw_vsprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle __mingw_vsprintf$MH = RuntimeHelper.downcallHandle( + "__mingw_vsprintf", + constants$3.__mingw_vsprintf$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$4.java b/java-panama/src/main/java/foreign/c/constants$4.java new file mode 100644 index 0000000000..b5098ce7fd --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$4.java @@ -0,0 +1,64 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$4 { + + static final FunctionDescriptor __mingw_vsnprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle __mingw_vsnprintf$MH = RuntimeHelper.downcallHandle( + "__mingw_vsnprintf", + constants$4.__mingw_vsnprintf$FUNC + ); + static final FunctionDescriptor _mingw_output_format_control$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG$LAYOUT + ); + static final MethodHandle _mingw_output_format_control$MH = RuntimeHelper.downcallHandle( + "_mingw_output_format_control", + constants$4._mingw_output_format_control$FUNC + ); + static final FunctionDescriptor fprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fprintf$MH = RuntimeHelper.downcallHandleVariadic( + "fprintf", + constants$4.fprintf$FUNC + ); + static final FunctionDescriptor printf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle printf$MH = RuntimeHelper.downcallHandleVariadic( + "printf", + constants$4.printf$FUNC + ); + static final FunctionDescriptor sprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sprintf$MH = RuntimeHelper.downcallHandleVariadic( + "sprintf", + constants$4.sprintf$FUNC + ); + static final FunctionDescriptor vfprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle vfprintf$MH = RuntimeHelper.downcallHandle( + "vfprintf", + constants$4.vfprintf$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$5.java b/java-panama/src/main/java/foreign/c/constants$5.java new file mode 100644 index 0000000000..663b2d6143 --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$5.java @@ -0,0 +1,63 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$5 { + + static final FunctionDescriptor vprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle vprintf$MH = RuntimeHelper.downcallHandle( + "vprintf", + constants$5.vprintf$FUNC + ); + static final FunctionDescriptor vsprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle vsprintf$MH = RuntimeHelper.downcallHandle( + "vsprintf", + constants$5.vsprintf$FUNC + ); + static final FunctionDescriptor __msvcrt_fprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle __msvcrt_fprintf$MH = RuntimeHelper.downcallHandleVariadic( + "__msvcrt_fprintf", + constants$5.__msvcrt_fprintf$FUNC + ); + static final FunctionDescriptor __msvcrt_printf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle __msvcrt_printf$MH = RuntimeHelper.downcallHandleVariadic( + "__msvcrt_printf", + constants$5.__msvcrt_printf$FUNC + ); + static final FunctionDescriptor __msvcrt_sprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle __msvcrt_sprintf$MH = RuntimeHelper.downcallHandleVariadic( + "__msvcrt_sprintf", + constants$5.__msvcrt_sprintf$FUNC + ); + static final FunctionDescriptor __msvcrt_vfprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle __msvcrt_vfprintf$MH = RuntimeHelper.downcallHandle( + "__msvcrt_vfprintf", + constants$5.__msvcrt_vfprintf$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$6.java b/java-panama/src/main/java/foreign/c/constants$6.java new file mode 100644 index 0000000000..c03430d45d --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$6.java @@ -0,0 +1,67 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$6 { + + static final FunctionDescriptor __msvcrt_vprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle __msvcrt_vprintf$MH = RuntimeHelper.downcallHandle( + "__msvcrt_vprintf", + constants$6.__msvcrt_vprintf$FUNC + ); + static final FunctionDescriptor __msvcrt_vsprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle __msvcrt_vsprintf$MH = RuntimeHelper.downcallHandle( + "__msvcrt_vsprintf", + constants$6.__msvcrt_vsprintf$FUNC + ); + static final FunctionDescriptor _snprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle _snprintf$MH = RuntimeHelper.downcallHandleVariadic( + "_snprintf", + constants$6._snprintf$FUNC + ); + static final FunctionDescriptor _vsnprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle _vsnprintf$MH = RuntimeHelper.downcallHandle( + "_vsnprintf", + constants$6._vsnprintf$FUNC + ); + static final FunctionDescriptor _vscprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle _vscprintf$MH = RuntimeHelper.downcallHandle( + "_vscprintf", + constants$6._vscprintf$FUNC + ); + static final FunctionDescriptor snprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle snprintf$MH = RuntimeHelper.downcallHandleVariadic( + "snprintf", + constants$6.snprintf$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$7.java b/java-panama/src/main/java/foreign/c/constants$7.java new file mode 100644 index 0000000000..21676e164a --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$7.java @@ -0,0 +1,69 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$7 { + + static final FunctionDescriptor vsnprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle vsnprintf$MH = RuntimeHelper.downcallHandle( + "vsnprintf", + constants$7.vsnprintf$FUNC + ); + static final FunctionDescriptor vscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle vscanf$MH = RuntimeHelper.downcallHandle( + "vscanf", + constants$7.vscanf$FUNC + ); + static final FunctionDescriptor vfscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle vfscanf$MH = RuntimeHelper.downcallHandle( + "vfscanf", + constants$7.vfscanf$FUNC + ); + static final FunctionDescriptor vsscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle vsscanf$MH = RuntimeHelper.downcallHandle( + "vsscanf", + constants$7.vsscanf$FUNC + ); + static final FunctionDescriptor getdelim$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle getdelim$MH = RuntimeHelper.downcallHandle( + "getdelim", + constants$7.getdelim$FUNC + ); + static final FunctionDescriptor getline$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle getline$MH = RuntimeHelper.downcallHandle( + "getline", + constants$7.getline$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$8.java b/java-panama/src/main/java/foreign/c/constants$8.java new file mode 100644 index 0000000000..5fb37ec59e --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$8.java @@ -0,0 +1,61 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$8 { + + static final FunctionDescriptor fscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fscanf$MH = RuntimeHelper.downcallHandleVariadic( + "fscanf", + constants$8.fscanf$FUNC + ); + static final FunctionDescriptor scanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle scanf$MH = RuntimeHelper.downcallHandleVariadic( + "scanf", + constants$8.scanf$FUNC + ); + static final FunctionDescriptor sscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle sscanf$MH = RuntimeHelper.downcallHandleVariadic( + "sscanf", + constants$8.sscanf$FUNC + ); + static final FunctionDescriptor fgetc$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fgetc$MH = RuntimeHelper.downcallHandle( + "fgetc", + constants$8.fgetc$FUNC + ); + static final FunctionDescriptor fgets$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fgets$MH = RuntimeHelper.downcallHandle( + "fgets", + constants$8.fgets$FUNC + ); + static final FunctionDescriptor fputc$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fputc$MH = RuntimeHelper.downcallHandle( + "fputc", + constants$8.fputc$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/constants$9.java b/java-panama/src/main/java/foreign/c/constants$9.java new file mode 100644 index 0000000000..1badf27ac5 --- /dev/null +++ b/java-panama/src/main/java/foreign/c/constants$9.java @@ -0,0 +1,59 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +class constants$9 { + + static final FunctionDescriptor fputs$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle fputs$MH = RuntimeHelper.downcallHandle( + "fputs", + constants$9.fputs$FUNC + ); + static final FunctionDescriptor gets$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle gets$MH = RuntimeHelper.downcallHandle( + "gets", + constants$9.gets$FUNC + ); + static final FunctionDescriptor puts$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle puts$MH = RuntimeHelper.downcallHandle( + "puts", + constants$9.puts$FUNC + ); + static final FunctionDescriptor ungetc$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle ungetc$MH = RuntimeHelper.downcallHandle( + "ungetc", + constants$9.ungetc$FUNC + ); + static final FunctionDescriptor _filbuf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle _filbuf$MH = RuntimeHelper.downcallHandle( + "_filbuf", + constants$9._filbuf$FUNC + ); + static final FunctionDescriptor _flsbuf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + Constants$root.C_LONG$LAYOUT, + Constants$root.C_POINTER$LAYOUT + ); + static final MethodHandle _flsbuf$MH = RuntimeHelper.downcallHandle( + "_flsbuf", + constants$9._flsbuf$FUNC + ); +} + + diff --git a/java-panama/src/main/java/foreign/c/stdio_h.java b/java-panama/src/main/java/foreign/c/stdio_h.java new file mode 100644 index 0000000000..7aba552771 --- /dev/null +++ b/java-panama/src/main/java/foreign/c/stdio_h.java @@ -0,0 +1,1881 @@ +// Generated by jextract + +package foreign.c; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +public class stdio_h { + + /* package-private */ stdio_h() {} + public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; + public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; + public static OfInt C_INT = Constants$root.C_LONG$LAYOUT; + public static OfInt C_LONG = Constants$root.C_LONG$LAYOUT; + public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; + public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; + public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; + public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + public static int __MINGW32_MAJOR_VERSION() { + return (int)5L; + } + public static int __MINGW32_MINOR_VERSION() { + return (int)0L; + } + public static int __MINGW32_PATCHLEVEL() { + return (int)2L; + } + public static int __MSVCR60_DLL() { + return (int)1536L; + } + public static int __MSVCR61_DLL() { + return (int)1537L; + } + public static int __MSVCR70_DLL() { + return (int)1792L; + } + public static int __MSVCR71_DLL() { + return (int)1793L; + } + public static int __MSVCR80_DLL() { + return (int)2048L; + } + public static int __MSVCR90_DLL() { + return (int)2304L; + } + public static int __MSVCR100_DLL() { + return (int)4096L; + } + public static int __MSVCR110_DLL() { + return (int)4352L; + } + public static int __MSVCR120_DLL() { + return (int)4608L; + } + public static int __W32API_MAJOR_VERSION() { + return (int)5L; + } + public static int __W32API_MINOR_VERSION() { + return (int)0L; + } + public static int __W32API_PATCHLEVEL() { + return (int)2L; + } + public static int SPVERSION_MASK() { + return (int)65280L; + } + public static int SUBVERSION_MASK() { + return (int)255L; + } + public static int _WIN32_WINNT_NT4() { + return (int)1024L; + } + public static int _WIN32_WINNT_NT4E() { + return (int)1025L; + } + public static int _WIN32_WINNT_NT4SP3() { + return (int)1027L; + } + public static int _WIN32_WINDOWS_95() { + return (int)1024L; + } + public static int _WIN32_WINDOWS_98() { + return (int)1040L; + } + public static int _WIN32_WINDOWS_ME() { + return (int)1168L; + } + public static int _WIN32_WINNT_WIN2K() { + return (int)1280L; + } + public static int _WIN32_WINNT_WINXP() { + return (int)1281L; + } + public static int _WIN32_WINNT_WS03() { + return (int)1282L; + } + public static int _WIN32_WINNT_WIN6() { + return (int)1536L; + } + public static int _WIN32_WINNT_VISTA() { + return (int)1536L; + } + public static int _WIN32_WINNT_WS08() { + return (int)1536L; + } + public static int _WIN32_WINNT_LONGHORN() { + return (int)1536L; + } + public static int _WIN32_WINNT_WIN7() { + return (int)1537L; + } + public static int _WIN32_WINNT_WIN8() { + return (int)1538L; + } + public static int _WIN32_WINNT_WINBLUE() { + return (int)1539L; + } + public static int _WIN32_IE_IE50() { + return (int)1280L; + } + public static int _WIN32_IE_IE501() { + return (int)1281L; + } + public static int _WIN32_IE_IE55() { + return (int)1360L; + } + public static int _WIN32_IE_IE56() { + return (int)1376L; + } + public static int _WIN32_IE_IE60() { + return (int)1536L; + } + public static int _WIN32_IE_IE60SP1() { + return (int)1537L; + } + public static int _WIN32_IE_IE60SP2() { + return (int)1539L; + } + public static int _WIN32_IE_IE70() { + return (int)1792L; + } + public static int _WIN32_IE_IE80() { + return (int)2048L; + } + public static int _WIN32_IE_IE30() { + return (int)768L; + } + public static int _WIN32_IE_IE301() { + return (int)769L; + } + public static int _WIN32_IE_IE302() { + return (int)770L; + } + public static int _WIN32_IE_IE40() { + return (int)1024L; + } + public static int _WIN32_IE_IE401() { + return (int)1025L; + } + public static int __NTDDI_WIN5() { + return (int)83886080L; + } + public static int __NTDDI_WIN51() { + return (int)83951616L; + } + public static int __NTDDI_WIN52() { + return (int)84017152L; + } + public static int __NTDDI_WIN6() { + return (int)100663296L; + } + public static int __NTDDI_WIN61() { + return (int)100728832L; + } + public static int __NTDDI_WIN62() { + return (int)100794368L; + } + public static int __NTDDI_WIN63() { + return (int)100859904L; + } + public static int __NTDDI_SP0() { + return (int)0L; + } + public static int __NTDDI_SP1() { + return (int)256L; + } + public static int __NTDDI_SP2() { + return (int)512L; + } + public static int __NTDDI_SP3() { + return (int)768L; + } + public static int __NTDDI_SP4() { + return (int)1024L; + } + public static int __CRT_GLOB_USE_MSVCRT__() { + return (int)1L; + } + public static int __CRT_GLOB_USE_MINGW__() { + return (int)2L; + } + public static int __CRT_GLOB_USE_SINGLE_QUOTE__() { + return (int)16L; + } + public static int __CRT_GLOB_BRACKET_GROUPS__() { + return (int)32L; + } + public static int _EMULATE_GLIBC() { + return (int)1L; + } + public static int _ISOC99_SOURCE() { + return (int)7L; + } + public static int _MINGW32_SOURCE_EXTENDED() { + return (int)1L; + } + public static int _IOREAD() { + return (int)1L; + } + public static int _IOWRT() { + return (int)2L; + } + public static int _IORW() { + return (int)128L; + } + public static int STDIN_FILENO() { + return (int)0L; + } + public static int STDOUT_FILENO() { + return (int)1L; + } + public static int STDERR_FILENO() { + return (int)2L; + } + public static int TMP_MAX() { + return (int)32767L; + } + public static int _IOFBF() { + return (int)0L; + } + public static int _IOLBF() { + return (int)64L; + } + public static int _IONBF() { + return (int)4L; + } + public static int _IOMYBUF() { + return (int)8L; + } + public static int _IOEOF() { + return (int)16L; + } + public static int _IOERR() { + return (int)32L; + } + public static int _IOSTRG() { + return (int)64L; + } + public static int BUFSIZ() { + return (int)512L; + } + public static int SEEK_SET() { + return (int)0L; + } + public static int SEEK_CUR() { + return (int)1L; + } + public static int SEEK_END() { + return (int)2L; + } + public static int _TWO_DIGIT_EXPONENT() { + return (int)1L; + } + public static int _THREE_DIGIT_EXPONENT() { + return (int)0L; + } + public static int __USE_MINGW_PRINTF() { + return (int)0L; + } + public static OfInt __off32_t = Constants$root.C_LONG$LAYOUT; + public static OfInt _off_t = Constants$root.C_LONG$LAYOUT; + public static OfInt off_t = Constants$root.C_LONG$LAYOUT; + public static OfInt _ssize_t = Constants$root.C_LONG$LAYOUT; + public static OfInt ssize_t = Constants$root.C_LONG$LAYOUT; + public static MethodHandle fopen$MH() { + return RuntimeHelper.requireNonNull(constants$0.fopen$MH,"fopen"); + } + public static MemoryAddress fopen ( Addressable x0, Addressable x1) { + var mh$ = fopen$MH(); + try { + return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle freopen$MH() { + return RuntimeHelper.requireNonNull(constants$0.freopen$MH,"freopen"); + } + public static MemoryAddress freopen ( Addressable x0, Addressable x1, Addressable x2) { + var mh$ = freopen$MH(); + try { + return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fflush$MH() { + return RuntimeHelper.requireNonNull(constants$0.fflush$MH,"fflush"); + } + public static int fflush ( Addressable x0) { + var mh$ = fflush$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fclose$MH() { + return RuntimeHelper.requireNonNull(constants$0.fclose$MH,"fclose"); + } + public static int fclose ( Addressable x0) { + var mh$ = fclose$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle remove$MH() { + return RuntimeHelper.requireNonNull(constants$0.remove$MH,"remove"); + } + public static int remove ( Addressable x0) { + var mh$ = remove$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle rename$MH() { + return RuntimeHelper.requireNonNull(constants$1.rename$MH,"rename"); + } + public static int rename ( Addressable x0, Addressable x1) { + var mh$ = rename$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle tmpfile$MH() { + return RuntimeHelper.requireNonNull(constants$1.tmpfile$MH,"tmpfile"); + } + public static MemoryAddress tmpfile () { + var mh$ = tmpfile$MH(); + try { + return (java.lang.foreign.MemoryAddress)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle tmpnam$MH() { + return RuntimeHelper.requireNonNull(constants$1.tmpnam$MH,"tmpnam"); + } + public static MemoryAddress tmpnam ( Addressable x0) { + var mh$ = tmpnam$MH(); + try { + return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _tempnam$MH() { + return RuntimeHelper.requireNonNull(constants$1._tempnam$MH,"_tempnam"); + } + public static MemoryAddress _tempnam ( Addressable x0, Addressable x1) { + var mh$ = _tempnam$MH(); + try { + return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _rmtmp$MH() { + return RuntimeHelper.requireNonNull(constants$1._rmtmp$MH,"_rmtmp"); + } + public static int _rmtmp () { + var mh$ = _rmtmp$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _unlink$MH() { + return RuntimeHelper.requireNonNull(constants$1._unlink$MH,"_unlink"); + } + public static int _unlink ( Addressable x0) { + var mh$ = _unlink$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle tempnam$MH() { + return RuntimeHelper.requireNonNull(constants$2.tempnam$MH,"tempnam"); + } + public static MemoryAddress tempnam ( Addressable x0, Addressable x1) { + var mh$ = tempnam$MH(); + try { + return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle rmtmp$MH() { + return RuntimeHelper.requireNonNull(constants$2.rmtmp$MH,"rmtmp"); + } + public static int rmtmp () { + var mh$ = rmtmp$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle unlink$MH() { + return RuntimeHelper.requireNonNull(constants$2.unlink$MH,"unlink"); + } + public static int unlink ( Addressable x0) { + var mh$ = unlink$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle setvbuf$MH() { + return RuntimeHelper.requireNonNull(constants$2.setvbuf$MH,"setvbuf"); + } + public static int setvbuf ( Addressable x0, Addressable x1, int x2, long x3) { + var mh$ = setvbuf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle setbuf$MH() { + return RuntimeHelper.requireNonNull(constants$2.setbuf$MH,"setbuf"); + } + public static void setbuf ( Addressable x0, Addressable x1) { + var mh$ = setbuf$MH(); + try { + mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __mingw_fprintf$MH() { + return RuntimeHelper.requireNonNull(constants$2.__mingw_fprintf$MH,"__mingw_fprintf"); + } + public static int __mingw_fprintf ( Addressable x0, Addressable x1, Object... x2) { + var mh$ = __mingw_fprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __mingw_printf$MH() { + return RuntimeHelper.requireNonNull(constants$3.__mingw_printf$MH,"__mingw_printf"); + } + public static int __mingw_printf ( Addressable x0, Object... x1) { + var mh$ = __mingw_printf$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __mingw_sprintf$MH() { + return RuntimeHelper.requireNonNull(constants$3.__mingw_sprintf$MH,"__mingw_sprintf"); + } + public static int __mingw_sprintf ( Addressable x0, Addressable x1, Object... x2) { + var mh$ = __mingw_sprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __mingw_snprintf$MH() { + return RuntimeHelper.requireNonNull(constants$3.__mingw_snprintf$MH,"__mingw_snprintf"); + } + public static int __mingw_snprintf ( Addressable x0, long x1, Addressable x2, Object... x3) { + var mh$ = __mingw_snprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __mingw_vfprintf$MH() { + return RuntimeHelper.requireNonNull(constants$3.__mingw_vfprintf$MH,"__mingw_vfprintf"); + } + public static int __mingw_vfprintf ( Addressable x0, Addressable x1, Addressable x2) { + var mh$ = __mingw_vfprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __mingw_vprintf$MH() { + return RuntimeHelper.requireNonNull(constants$3.__mingw_vprintf$MH,"__mingw_vprintf"); + } + public static int __mingw_vprintf ( Addressable x0, Addressable x1) { + var mh$ = __mingw_vprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __mingw_vsprintf$MH() { + return RuntimeHelper.requireNonNull(constants$3.__mingw_vsprintf$MH,"__mingw_vsprintf"); + } + public static int __mingw_vsprintf ( Addressable x0, Addressable x1, Addressable x2) { + var mh$ = __mingw_vsprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __mingw_vsnprintf$MH() { + return RuntimeHelper.requireNonNull(constants$4.__mingw_vsnprintf$MH,"__mingw_vsnprintf"); + } + public static int __mingw_vsnprintf ( Addressable x0, long x1, Addressable x2, Addressable x3) { + var mh$ = __mingw_vsnprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _mingw_output_format_control$MH() { + return RuntimeHelper.requireNonNull(constants$4._mingw_output_format_control$MH,"_mingw_output_format_control"); + } + public static int _mingw_output_format_control ( int x0, int x1) { + var mh$ = _mingw_output_format_control$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fprintf$MH() { + return RuntimeHelper.requireNonNull(constants$4.fprintf$MH,"fprintf"); + } + public static int fprintf ( Addressable x0, Addressable x1, Object... x2) { + var mh$ = fprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle printf$MH() { + return RuntimeHelper.requireNonNull(constants$4.printf$MH,"printf"); + } + public static int printf ( Addressable x0, Object... x1) { + var mh$ = printf$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sprintf$MH() { + return RuntimeHelper.requireNonNull(constants$4.sprintf$MH,"sprintf"); + } + public static int sprintf ( Addressable x0, Addressable x1, Object... x2) { + var mh$ = sprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle vfprintf$MH() { + return RuntimeHelper.requireNonNull(constants$4.vfprintf$MH,"vfprintf"); + } + public static int vfprintf ( Addressable x0, Addressable x1, Addressable x2) { + var mh$ = vfprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle vprintf$MH() { + return RuntimeHelper.requireNonNull(constants$5.vprintf$MH,"vprintf"); + } + public static int vprintf ( Addressable x0, Addressable x1) { + var mh$ = vprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle vsprintf$MH() { + return RuntimeHelper.requireNonNull(constants$5.vsprintf$MH,"vsprintf"); + } + public static int vsprintf ( Addressable x0, Addressable x1, Addressable x2) { + var mh$ = vsprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __msvcrt_fprintf$MH() { + return RuntimeHelper.requireNonNull(constants$5.__msvcrt_fprintf$MH,"__msvcrt_fprintf"); + } + public static int __msvcrt_fprintf ( Addressable x0, Addressable x1, Object... x2) { + var mh$ = __msvcrt_fprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __msvcrt_printf$MH() { + return RuntimeHelper.requireNonNull(constants$5.__msvcrt_printf$MH,"__msvcrt_printf"); + } + public static int __msvcrt_printf ( Addressable x0, Object... x1) { + var mh$ = __msvcrt_printf$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __msvcrt_sprintf$MH() { + return RuntimeHelper.requireNonNull(constants$5.__msvcrt_sprintf$MH,"__msvcrt_sprintf"); + } + public static int __msvcrt_sprintf ( Addressable x0, Addressable x1, Object... x2) { + var mh$ = __msvcrt_sprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __msvcrt_vfprintf$MH() { + return RuntimeHelper.requireNonNull(constants$5.__msvcrt_vfprintf$MH,"__msvcrt_vfprintf"); + } + public static int __msvcrt_vfprintf ( Addressable x0, Addressable x1, Addressable x2) { + var mh$ = __msvcrt_vfprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __msvcrt_vprintf$MH() { + return RuntimeHelper.requireNonNull(constants$6.__msvcrt_vprintf$MH,"__msvcrt_vprintf"); + } + public static int __msvcrt_vprintf ( Addressable x0, Addressable x1) { + var mh$ = __msvcrt_vprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __msvcrt_vsprintf$MH() { + return RuntimeHelper.requireNonNull(constants$6.__msvcrt_vsprintf$MH,"__msvcrt_vsprintf"); + } + public static int __msvcrt_vsprintf ( Addressable x0, Addressable x1, Addressable x2) { + var mh$ = __msvcrt_vsprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _snprintf$MH() { + return RuntimeHelper.requireNonNull(constants$6._snprintf$MH,"_snprintf"); + } + public static int _snprintf ( Addressable x0, long x1, Addressable x2, Object... x3) { + var mh$ = _snprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _vsnprintf$MH() { + return RuntimeHelper.requireNonNull(constants$6._vsnprintf$MH,"_vsnprintf"); + } + public static int _vsnprintf ( Addressable x0, long x1, Addressable x2, Addressable x3) { + var mh$ = _vsnprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _vscprintf$MH() { + return RuntimeHelper.requireNonNull(constants$6._vscprintf$MH,"_vscprintf"); + } + public static int _vscprintf ( Addressable x0, Addressable x1) { + var mh$ = _vscprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle snprintf$MH() { + return RuntimeHelper.requireNonNull(constants$6.snprintf$MH,"snprintf"); + } + public static int snprintf ( Addressable x0, long x1, Addressable x2, Object... x3) { + var mh$ = snprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle vsnprintf$MH() { + return RuntimeHelper.requireNonNull(constants$7.vsnprintf$MH,"vsnprintf"); + } + public static int vsnprintf ( Addressable x0, long x1, Addressable x2, Addressable x3) { + var mh$ = vsnprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle vscanf$MH() { + return RuntimeHelper.requireNonNull(constants$7.vscanf$MH,"vscanf"); + } + public static int vscanf ( Addressable x0, Addressable x1) { + var mh$ = vscanf$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle vfscanf$MH() { + return RuntimeHelper.requireNonNull(constants$7.vfscanf$MH,"vfscanf"); + } + public static int vfscanf ( Addressable x0, Addressable x1, Addressable x2) { + var mh$ = vfscanf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle vsscanf$MH() { + return RuntimeHelper.requireNonNull(constants$7.vsscanf$MH,"vsscanf"); + } + public static int vsscanf ( Addressable x0, Addressable x1, Addressable x2) { + var mh$ = vsscanf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle getdelim$MH() { + return RuntimeHelper.requireNonNull(constants$7.getdelim$MH,"getdelim"); + } + public static int getdelim ( Addressable x0, Addressable x1, int x2, Addressable x3) { + var mh$ = getdelim$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle getline$MH() { + return RuntimeHelper.requireNonNull(constants$7.getline$MH,"getline"); + } + public static int getline ( Addressable x0, Addressable x1, Addressable x2) { + var mh$ = getline$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fscanf$MH() { + return RuntimeHelper.requireNonNull(constants$8.fscanf$MH,"fscanf"); + } + public static int fscanf ( Addressable x0, Addressable x1, Object... x2) { + var mh$ = fscanf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle scanf$MH() { + return RuntimeHelper.requireNonNull(constants$8.scanf$MH,"scanf"); + } + public static int scanf ( Addressable x0, Object... x1) { + var mh$ = scanf$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle sscanf$MH() { + return RuntimeHelper.requireNonNull(constants$8.sscanf$MH,"sscanf"); + } + public static int sscanf ( Addressable x0, Addressable x1, Object... x2) { + var mh$ = sscanf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fgetc$MH() { + return RuntimeHelper.requireNonNull(constants$8.fgetc$MH,"fgetc"); + } + public static int fgetc ( Addressable x0) { + var mh$ = fgetc$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fgets$MH() { + return RuntimeHelper.requireNonNull(constants$8.fgets$MH,"fgets"); + } + public static MemoryAddress fgets ( Addressable x0, int x1, Addressable x2) { + var mh$ = fgets$MH(); + try { + return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fputc$MH() { + return RuntimeHelper.requireNonNull(constants$8.fputc$MH,"fputc"); + } + public static int fputc ( int x0, Addressable x1) { + var mh$ = fputc$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fputs$MH() { + return RuntimeHelper.requireNonNull(constants$9.fputs$MH,"fputs"); + } + public static int fputs ( Addressable x0, Addressable x1) { + var mh$ = fputs$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle gets$MH() { + return RuntimeHelper.requireNonNull(constants$9.gets$MH,"gets"); + } + public static MemoryAddress gets ( Addressable x0) { + var mh$ = gets$MH(); + try { + return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle puts$MH() { + return RuntimeHelper.requireNonNull(constants$9.puts$MH,"puts"); + } + public static int puts ( Addressable x0) { + var mh$ = puts$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle ungetc$MH() { + return RuntimeHelper.requireNonNull(constants$9.ungetc$MH,"ungetc"); + } + public static int ungetc ( int x0, Addressable x1) { + var mh$ = ungetc$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _filbuf$MH() { + return RuntimeHelper.requireNonNull(constants$9._filbuf$MH,"_filbuf"); + } + public static int _filbuf ( Addressable x0) { + var mh$ = _filbuf$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _flsbuf$MH() { + return RuntimeHelper.requireNonNull(constants$9._flsbuf$MH,"_flsbuf"); + } + public static int _flsbuf ( int x0, Addressable x1) { + var mh$ = _flsbuf$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle getc$MH() { + return RuntimeHelper.requireNonNull(constants$10.getc$MH,"getc"); + } + public static int getc ( Addressable x0) { + var mh$ = getc$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle putc$MH() { + return RuntimeHelper.requireNonNull(constants$10.putc$MH,"putc"); + } + public static int putc ( int x0, Addressable x1) { + var mh$ = putc$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle getchar$MH() { + return RuntimeHelper.requireNonNull(constants$10.getchar$MH,"getchar"); + } + public static int getchar () { + var mh$ = getchar$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle putchar$MH() { + return RuntimeHelper.requireNonNull(constants$10.putchar$MH,"putchar"); + } + public static int putchar ( int x0) { + var mh$ = putchar$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fread$MH() { + return RuntimeHelper.requireNonNull(constants$10.fread$MH,"fread"); + } + public static long fread ( Addressable x0, long x1, long x2, Addressable x3) { + var mh$ = fread$MH(); + try { + return (long)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fwrite$MH() { + return RuntimeHelper.requireNonNull(constants$10.fwrite$MH,"fwrite"); + } + public static long fwrite ( Addressable x0, long x1, long x2, Addressable x3) { + var mh$ = fwrite$MH(); + try { + return (long)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fseek$MH() { + return RuntimeHelper.requireNonNull(constants$11.fseek$MH,"fseek"); + } + public static int fseek ( Addressable x0, int x1, int x2) { + var mh$ = fseek$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle ftell$MH() { + return RuntimeHelper.requireNonNull(constants$11.ftell$MH,"ftell"); + } + public static int ftell ( Addressable x0) { + var mh$ = ftell$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle rewind$MH() { + return RuntimeHelper.requireNonNull(constants$11.rewind$MH,"rewind"); + } + public static void rewind ( Addressable x0) { + var mh$ = rewind$MH(); + try { + mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static OfInt fpos_t = Constants$root.C_LONG$LAYOUT; + public static MethodHandle fgetpos$MH() { + return RuntimeHelper.requireNonNull(constants$11.fgetpos$MH,"fgetpos"); + } + public static int fgetpos ( Addressable x0, Addressable x1) { + var mh$ = fgetpos$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fsetpos$MH() { + return RuntimeHelper.requireNonNull(constants$11.fsetpos$MH,"fsetpos"); + } + public static int fsetpos ( Addressable x0, Addressable x1) { + var mh$ = fsetpos$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle feof$MH() { + return RuntimeHelper.requireNonNull(constants$11.feof$MH,"feof"); + } + public static int feof ( Addressable x0) { + var mh$ = feof$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle ferror$MH() { + return RuntimeHelper.requireNonNull(constants$12.ferror$MH,"ferror"); + } + public static int ferror ( Addressable x0) { + var mh$ = ferror$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle clearerr$MH() { + return RuntimeHelper.requireNonNull(constants$12.clearerr$MH,"clearerr"); + } + public static void clearerr ( Addressable x0) { + var mh$ = clearerr$MH(); + try { + mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle perror$MH() { + return RuntimeHelper.requireNonNull(constants$12.perror$MH,"perror"); + } + public static void perror ( Addressable x0) { + var mh$ = perror$MH(); + try { + mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _popen$MH() { + return RuntimeHelper.requireNonNull(constants$12._popen$MH,"_popen"); + } + public static MemoryAddress _popen ( Addressable x0, Addressable x1) { + var mh$ = _popen$MH(); + try { + return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _pclose$MH() { + return RuntimeHelper.requireNonNull(constants$12._pclose$MH,"_pclose"); + } + public static int _pclose ( Addressable x0) { + var mh$ = _pclose$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle popen$MH() { + return RuntimeHelper.requireNonNull(constants$12.popen$MH,"popen"); + } + public static MemoryAddress popen ( Addressable x0, Addressable x1) { + var mh$ = popen$MH(); + try { + return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle pclose$MH() { + return RuntimeHelper.requireNonNull(constants$13.pclose$MH,"pclose"); + } + public static int pclose ( Addressable x0) { + var mh$ = pclose$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _flushall$MH() { + return RuntimeHelper.requireNonNull(constants$13._flushall$MH,"_flushall"); + } + public static int _flushall () { + var mh$ = _flushall$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _fgetchar$MH() { + return RuntimeHelper.requireNonNull(constants$13._fgetchar$MH,"_fgetchar"); + } + public static int _fgetchar () { + var mh$ = _fgetchar$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _fputchar$MH() { + return RuntimeHelper.requireNonNull(constants$13._fputchar$MH,"_fputchar"); + } + public static int _fputchar ( int x0) { + var mh$ = _fputchar$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _fdopen$MH() { + return RuntimeHelper.requireNonNull(constants$13._fdopen$MH,"_fdopen"); + } + public static MemoryAddress _fdopen ( int x0, Addressable x1) { + var mh$ = _fdopen$MH(); + try { + return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _fileno$MH() { + return RuntimeHelper.requireNonNull(constants$13._fileno$MH,"_fileno"); + } + public static int _fileno ( Addressable x0) { + var mh$ = _fileno$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _fcloseall$MH() { + return RuntimeHelper.requireNonNull(constants$14._fcloseall$MH,"_fcloseall"); + } + public static int _fcloseall () { + var mh$ = _fcloseall$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _fsopen$MH() { + return RuntimeHelper.requireNonNull(constants$14._fsopen$MH,"_fsopen"); + } + public static MemoryAddress _fsopen ( Addressable x0, Addressable x1, int x2) { + var mh$ = _fsopen$MH(); + try { + return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __mingw_get_output_format$MH() { + return RuntimeHelper.requireNonNull(constants$14.__mingw_get_output_format$MH,"__mingw_get_output_format"); + } + public static int __mingw_get_output_format () { + var mh$ = __mingw_get_output_format$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __mingw_set_output_format$MH() { + return RuntimeHelper.requireNonNull(constants$14.__mingw_set_output_format$MH,"__mingw_set_output_format"); + } + public static int __mingw_set_output_format ( int x0) { + var mh$ = __mingw_set_output_format$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __mingw_get_printf_count_output$MH() { + return RuntimeHelper.requireNonNull(constants$14.__mingw_get_printf_count_output$MH,"__mingw_get_printf_count_output"); + } + public static int __mingw_get_printf_count_output () { + var mh$ = __mingw_get_printf_count_output$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle __mingw_set_printf_count_output$MH() { + return RuntimeHelper.requireNonNull(constants$14.__mingw_set_printf_count_output$MH,"__mingw_set_printf_count_output"); + } + public static int __mingw_set_printf_count_output ( int x0) { + var mh$ = __mingw_set_printf_count_output$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _get_output_format$MH() { + return RuntimeHelper.requireNonNull(constants$15._get_output_format$MH,"_get_output_format"); + } + public static int _get_output_format () { + var mh$ = _get_output_format$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _set_output_format$MH() { + return RuntimeHelper.requireNonNull(constants$15._set_output_format$MH,"_set_output_format"); + } + public static int _set_output_format ( int __style) { + var mh$ = _set_output_format$MH(); + try { + return (int)mh$.invokeExact(__style); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _get_printf_count_output$MH() { + return RuntimeHelper.requireNonNull(constants$15._get_printf_count_output$MH,"_get_printf_count_output"); + } + public static int _get_printf_count_output () { + var mh$ = _get_printf_count_output$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _set_printf_count_output$MH() { + return RuntimeHelper.requireNonNull(constants$15._set_printf_count_output$MH,"_set_printf_count_output"); + } + public static int _set_printf_count_output ( int __mode) { + var mh$ = _set_printf_count_output$MH(); + try { + return (int)mh$.invokeExact(__mode); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fgetchar$MH() { + return RuntimeHelper.requireNonNull(constants$15.fgetchar$MH,"fgetchar"); + } + public static int fgetchar () { + var mh$ = fgetchar$MH(); + try { + return (int)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fputchar$MH() { + return RuntimeHelper.requireNonNull(constants$15.fputchar$MH,"fputchar"); + } + public static int fputchar ( int x0) { + var mh$ = fputchar$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fdopen$MH() { + return RuntimeHelper.requireNonNull(constants$16.fdopen$MH,"fdopen"); + } + public static MemoryAddress fdopen ( int x0, Addressable x1) { + var mh$ = fdopen$MH(); + try { + return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fileno$MH() { + return RuntimeHelper.requireNonNull(constants$16.fileno$MH,"fileno"); + } + public static int fileno ( Addressable x0) { + var mh$ = fileno$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fwprintf$MH() { + return RuntimeHelper.requireNonNull(constants$16.fwprintf$MH,"fwprintf"); + } + public static int fwprintf ( Addressable x0, Addressable x1, Object... x2) { + var mh$ = fwprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle wprintf$MH() { + return RuntimeHelper.requireNonNull(constants$16.wprintf$MH,"wprintf"); + } + public static int wprintf ( Addressable x0, Object... x1) { + var mh$ = wprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle vfwprintf$MH() { + return RuntimeHelper.requireNonNull(constants$16.vfwprintf$MH,"vfwprintf"); + } + public static int vfwprintf ( Addressable x0, Addressable x1, Addressable x2) { + var mh$ = vfwprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle vwprintf$MH() { + return RuntimeHelper.requireNonNull(constants$16.vwprintf$MH,"vwprintf"); + } + public static int vwprintf ( Addressable x0, Addressable x1) { + var mh$ = vwprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _snwprintf$MH() { + return RuntimeHelper.requireNonNull(constants$17._snwprintf$MH,"_snwprintf"); + } + public static int _snwprintf ( Addressable x0, long x1, Addressable x2, Object... x3) { + var mh$ = _snwprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _vscwprintf$MH() { + return RuntimeHelper.requireNonNull(constants$17._vscwprintf$MH,"_vscwprintf"); + } + public static int _vscwprintf ( Addressable x0, Addressable x1) { + var mh$ = _vscwprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _vsnwprintf$MH() { + return RuntimeHelper.requireNonNull(constants$17._vsnwprintf$MH,"_vsnwprintf"); + } + public static int _vsnwprintf ( Addressable x0, long x1, Addressable x2, Addressable x3) { + var mh$ = _vsnwprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fwscanf$MH() { + return RuntimeHelper.requireNonNull(constants$17.fwscanf$MH,"fwscanf"); + } + public static int fwscanf ( Addressable x0, Addressable x1, Object... x2) { + var mh$ = fwscanf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle wscanf$MH() { + return RuntimeHelper.requireNonNull(constants$17.wscanf$MH,"wscanf"); + } + public static int wscanf ( Addressable x0, Object... x1) { + var mh$ = wscanf$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle swscanf$MH() { + return RuntimeHelper.requireNonNull(constants$17.swscanf$MH,"swscanf"); + } + public static int swscanf ( Addressable x0, Addressable x1, Object... x2) { + var mh$ = swscanf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fgetwc$MH() { + return RuntimeHelper.requireNonNull(constants$18.fgetwc$MH,"fgetwc"); + } + public static short fgetwc ( Addressable x0) { + var mh$ = fgetwc$MH(); + try { + return (short)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fputwc$MH() { + return RuntimeHelper.requireNonNull(constants$18.fputwc$MH,"fputwc"); + } + public static short fputwc ( short x0, Addressable x1) { + var mh$ = fputwc$MH(); + try { + return (short)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle ungetwc$MH() { + return RuntimeHelper.requireNonNull(constants$18.ungetwc$MH,"ungetwc"); + } + public static short ungetwc ( short x0, Addressable x1) { + var mh$ = ungetwc$MH(); + try { + return (short)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle swprintf$MH() { + return RuntimeHelper.requireNonNull(constants$18.swprintf$MH,"swprintf"); + } + public static int swprintf ( Addressable x0, Addressable x1, Object... x2) { + var mh$ = swprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle vswprintf$MH() { + return RuntimeHelper.requireNonNull(constants$18.vswprintf$MH,"vswprintf"); + } + public static int vswprintf ( Addressable x0, Addressable x1, Addressable x2) { + var mh$ = vswprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle snwprintf$MH() { + return RuntimeHelper.requireNonNull(constants$18.snwprintf$MH,"snwprintf"); + } + public static int snwprintf ( Addressable x0, long x1, Addressable x2, Object... x3) { + var mh$ = snwprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle vsnwprintf$MH() { + return RuntimeHelper.requireNonNull(constants$19.vsnwprintf$MH,"vsnwprintf"); + } + public static int vsnwprintf ( Addressable x0, long x1, Addressable x2, Addressable x3) { + var mh$ = vsnwprintf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2, x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle vwscanf$MH() { + return RuntimeHelper.requireNonNull(constants$19.vwscanf$MH,"vwscanf"); + } + public static int vwscanf ( Addressable x0, Addressable x1) { + var mh$ = vwscanf$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle vfwscanf$MH() { + return RuntimeHelper.requireNonNull(constants$19.vfwscanf$MH,"vfwscanf"); + } + public static int vfwscanf ( Addressable x0, Addressable x1, Addressable x2) { + var mh$ = vfwscanf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle vswscanf$MH() { + return RuntimeHelper.requireNonNull(constants$19.vswscanf$MH,"vswscanf"); + } + public static int vswscanf ( Addressable x0, Addressable x1, Addressable x2) { + var mh$ = vswscanf$MH(); + try { + return (int)mh$.invokeExact(x0, x1, x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _fgetwchar$MH() { + return RuntimeHelper.requireNonNull(constants$19._fgetwchar$MH,"_fgetwchar"); + } + public static short _fgetwchar () { + var mh$ = _fgetwchar$MH(); + try { + return (short)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _fputwchar$MH() { + return RuntimeHelper.requireNonNull(constants$19._fputwchar$MH,"_fputwchar"); + } + public static short _fputwchar ( short x0) { + var mh$ = _fputwchar$MH(); + try { + return (short)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _getw$MH() { + return RuntimeHelper.requireNonNull(constants$20._getw$MH,"_getw"); + } + public static int _getw ( Addressable x0) { + var mh$ = _getw$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle _putw$MH() { + return RuntimeHelper.requireNonNull(constants$20._putw$MH,"_putw"); + } + public static int _putw ( int x0, Addressable x1) { + var mh$ = _putw$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fgetwchar$MH() { + return RuntimeHelper.requireNonNull(constants$20.fgetwchar$MH,"fgetwchar"); + } + public static short fgetwchar () { + var mh$ = fgetwchar$MH(); + try { + return (short)mh$.invokeExact(); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle fputwchar$MH() { + return RuntimeHelper.requireNonNull(constants$20.fputwchar$MH,"fputwchar"); + } + public static short fputwchar ( short x0) { + var mh$ = fputwchar$MH(); + try { + return (short)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle getw$MH() { + return RuntimeHelper.requireNonNull(constants$20.getw$MH,"getw"); + } + public static int getw ( Addressable x0) { + var mh$ = getw$MH(); + try { + return (int)mh$.invokeExact(x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static MethodHandle putw$MH() { + return RuntimeHelper.requireNonNull(constants$20.putw$MH,"putw"); + } + public static int putw ( int x0, Addressable x1) { + var mh$ = putw$MH(); + try { + return (int)mh$.invokeExact(x0, x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + } + public static int __MINGW32_VERSION() { + return (int)5000002L; + } + public static int __MSVCRT_VERSION__() { + return (int)1536L; + } + public static int __W32API_VERSION() { + return (int)5000002L; + } + public static int OSVERSION_MASK() { + return (int)4294901760L; + } + public static int NTDDI_WIN2K() { + return (int)83886080L; + } + public static int NTDDI_WIN2KSP1() { + return (int)83886336L; + } + public static int NTDDI_WIN2KSP2() { + return (int)83886592L; + } + public static int NTDDI_WIN2KSP3() { + return (int)83886848L; + } + public static int NTDDI_WIN2KSP4() { + return (int)83887104L; + } + public static int NTDDI_WINXP() { + return (int)83951616L; + } + public static int NTDDI_WINXPSP1() { + return (int)83951872L; + } + public static int NTDDI_WINXPSP2() { + return (int)83952128L; + } + public static int NTDDI_WINXPSP3() { + return (int)83952384L; + } + public static int NTDDI_WS03() { + return (int)84017152L; + } + public static int NTDDI_WS03SP1() { + return (int)84017408L; + } + public static int NTDDI_WS03SP2() { + return (int)84017664L; + } + public static int NTDDI_VISTA() { + return (int)100663296L; + } + public static int NTDDI_VISTASP1() { + return (int)100663552L; + } + public static int NTDDI_VISTASP2() { + return (int)100663808L; + } + public static int NTDDI_LONGHORN() { + return (int)100663296L; + } + public static int NTDDI_WIN6() { + return (int)100663296L; + } + public static int NTDDI_WIN6SP1() { + return (int)100663552L; + } + public static int NTDDI_WIN6SP2() { + return (int)100663808L; + } + public static int NTDDI_WS08() { + return (int)100663552L; + } + public static int NTDDI_WIN7() { + return (int)100728832L; + } + public static int NTDDI_WIN8() { + return (int)100794368L; + } + public static int NTDDI_WINBLUE() { + return (int)100859904L; + } + public static int _WIN32_WINNT() { + return (int)1280L; + } + public static int WINVER() { + return (int)1280L; + } + public static int NTDDI_VERSION() { + return (int)83886080L; + } + public static int Windows95() { + return (int)1024L; + } + public static int Windows98() { + return (int)1040L; + } + public static int WindowsME() { + return (int)1168L; + } + public static int WindowsNT4() { + return (int)1024L; + } + public static int Windows2000() { + return (int)1280L; + } + public static int WindowsXP() { + return (int)1281L; + } + public static int Windows2003() { + return (int)1282L; + } + public static int WindowsVista() { + return (int)1536L; + } + public static int IE3() { + return (int)768L; + } + public static int IE301() { + return (int)769L; + } + public static int IE302() { + return (int)770L; + } + public static int IE4() { + return (int)1024L; + } + public static int IE401() { + return (int)1025L; + } + public static int IE5() { + return (int)1280L; + } + public static int IE5a() { + return (int)1280L; + } + public static int IE5b() { + return (int)1280L; + } + public static int IE501() { + return (int)1281L; + } + public static int IE55() { + return (int)1360L; + } + public static int IE56() { + return (int)1376L; + } + public static int IE6() { + return (int)1536L; + } + public static int IE601() { + return (int)1537L; + } + public static int IE602() { + return (int)1539L; + } + public static int IE7() { + return (int)1792L; + } + public static byte __CRT_GLOB_ESCAPE_CHAR__() { + return (byte)127L; + } + public static long __MINGW_ANSI_STDIO__() { + return 1L; + } + public static long __MINGW_LC_EXTENSIONS__() { + return 80L; + } + public static long __MINGW_LC_MESSAGES__() { + return 16L; + } + public static long __MINGW_LC_ENVVARS__() { + return 64L; + } + public static int _POSIX_C_SOURCE() { + return (int)200809L; + } + public static MemoryAddress NULL() { + return constants$21.NULL$ADDR; + } + public static int EOF() { + return (int)-1L; + } + public static int FILENAME_MAX() { + return (int)260L; + } + public static int FOPEN_MAX() { + return (int)20L; + } + public static MemorySegment _P_tmpdir() { + return constants$21._P_tmpdir$SEGMENT; + } + public static MemorySegment P_tmpdir() { + return constants$21.P_tmpdir$SEGMENT; + } + public static MemorySegment _wP_tmpdir() { + return constants$21._wP_tmpdir$SEGMENT; + } + public static int L_tmpnam() { + return (int)16L; + } + public static int _MSVC_PRINTF_QUIRKS() { + return (int)256L; + } + public static int _QUERY_MSVC_PRINTF_QUIRKS() { + return (int)4294967295L; + } + public static int _DISABLE_MSVC_PRINTF_QUIRKS() { + return (int)4294967039L; + } + public static int _ENABLE_MSVC_PRINTF_QUIRKS() { + return (int)4294967295L; + } + public static int _EXPONENT_DIGIT_MASK() { + return (int)1L; + } +} + + diff --git a/java-panama/src/main/resources/hello.c b/java-panama/src/main/resources/hello.c new file mode 100644 index 0000000000..3f2d3fce6a --- /dev/null +++ b/java-panama/src/main/resources/hello.c @@ -0,0 +1,5 @@ +#include +int main() { + printf("Hello World from Project Panama Baeldung Article"); + return 0; +} \ No newline at end of file From 4ccb022bad1da8695edca70949b9c0b1d1ed2c6a Mon Sep 17 00:00:00 2001 From: exaucae Date: Sun, 12 Feb 2023 13:05:10 +0000 Subject: [PATCH 4/7] remove generated code --- .../java/panama/jextract/Greetings.java | 6 +- .../main/java/foreign/c/Constants$root.java | 23 - java-panama/src/main/java/foreign/c/FILE.java | 14 - .../main/java/foreign/c/RuntimeHelper.java | 233 -- .../src/main/java/foreign/c/_iobuf.java | 162 -- .../src/main/java/foreign/c/constants$0.java | 52 - .../src/main/java/foreign/c/constants$1.java | 54 - .../src/main/java/foreign/c/constants$10.java | 61 - .../src/main/java/foreign/c/constants$11.java | 60 - .../src/main/java/foreign/c/constants$12.java | 58 - .../src/main/java/foreign/c/constants$13.java | 53 - .../src/main/java/foreign/c/constants$14.java | 52 - .../src/main/java/foreign/c/constants$15.java | 50 - .../src/main/java/foreign/c/constants$16.java | 61 - .../src/main/java/foreign/c/constants$17.java | 64 - .../src/main/java/foreign/c/constants$18.java | 63 - .../src/main/java/foreign/c/constants$19.java | 62 - .../src/main/java/foreign/c/constants$2.java | 60 - .../src/main/java/foreign/c/constants$20.java | 56 - .../src/main/java/foreign/c/constants$21.java | 18 - .../src/main/java/foreign/c/constants$3.java | 64 - .../src/main/java/foreign/c/constants$4.java | 64 - .../src/main/java/foreign/c/constants$5.java | 63 - .../src/main/java/foreign/c/constants$6.java | 67 - .../src/main/java/foreign/c/constants$7.java | 69 - .../src/main/java/foreign/c/constants$8.java | 61 - .../src/main/java/foreign/c/constants$9.java | 59 - .../src/main/java/foreign/c/stdio_h.java | 1881 ----------------- 28 files changed, 4 insertions(+), 3586 deletions(-) delete mode 100644 java-panama/src/main/java/foreign/c/Constants$root.java delete mode 100644 java-panama/src/main/java/foreign/c/FILE.java delete mode 100644 java-panama/src/main/java/foreign/c/RuntimeHelper.java delete mode 100644 java-panama/src/main/java/foreign/c/_iobuf.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$0.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$1.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$10.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$11.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$12.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$13.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$14.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$15.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$16.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$17.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$18.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$19.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$2.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$20.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$21.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$3.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$4.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$5.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$6.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$7.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$8.java delete mode 100644 java-panama/src/main/java/foreign/c/constants$9.java delete mode 100644 java-panama/src/main/java/foreign/c/stdio_h.java diff --git a/java-panama/src/main/java/com/baeldung/java/panama/jextract/Greetings.java b/java-panama/src/main/java/com/baeldung/java/panama/jextract/Greetings.java index 7a22c70fce..90d8e8f253 100644 --- a/java-panama/src/main/java/com/baeldung/java/panama/jextract/Greetings.java +++ b/java-panama/src/main/java/com/baeldung/java/panama/jextract/Greetings.java @@ -2,7 +2,8 @@ package com.baeldung.java.panama.jextract; import java.lang.foreign.MemorySegment; import java.lang.foreign.MemorySession; -import static foreign.c.stdio_h.printf; +// Generate JExtract bingings before uncommenting +// import static foreign.c.stdio_h.printf; public class Greetings { @@ -11,7 +12,8 @@ public class Greetings { try (MemorySession memorySession = MemorySession.openConfined()) { MemorySegment greetingSegment = memorySession.allocateUtf8String(greeting); - printf(greetingSegment); + // Generate JExtract bingings before uncommenting + // printf(greetingSegment); } } } diff --git a/java-panama/src/main/java/foreign/c/Constants$root.java b/java-panama/src/main/java/foreign/c/Constants$root.java deleted file mode 100644 index 2a8f1bad0c..0000000000 --- a/java-panama/src/main/java/foreign/c/Constants$root.java +++ /dev/null @@ -1,23 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -public class Constants$root { - - static final OfBoolean C_BOOL$LAYOUT = JAVA_BOOLEAN; - static final OfByte C_CHAR$LAYOUT = JAVA_BYTE; - static final OfShort C_SHORT$LAYOUT = JAVA_SHORT.withBitAlignment(16); - static final OfInt C_INT$LAYOUT = JAVA_INT.withBitAlignment(32); - static final OfInt C_LONG$LAYOUT = JAVA_INT.withBitAlignment(32); - static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG.withBitAlignment(64); - static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT.withBitAlignment(32); - static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE.withBitAlignment(64); - static final OfAddress C_POINTER$LAYOUT = ADDRESS.withBitAlignment(64); -} - - diff --git a/java-panama/src/main/java/foreign/c/FILE.java b/java-panama/src/main/java/foreign/c/FILE.java deleted file mode 100644 index 1956914637..0000000000 --- a/java-panama/src/main/java/foreign/c/FILE.java +++ /dev/null @@ -1,14 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -public class FILE extends _iobuf { - -} - - diff --git a/java-panama/src/main/java/foreign/c/RuntimeHelper.java b/java-panama/src/main/java/foreign/c/RuntimeHelper.java deleted file mode 100644 index 5fd36bdc7b..0000000000 --- a/java-panama/src/main/java/foreign/c/RuntimeHelper.java +++ /dev/null @@ -1,233 +0,0 @@ -package foreign.c; -// Generated by jextract - -import java.lang.foreign.Addressable; -import java.lang.foreign.Linker; -import java.lang.foreign.FunctionDescriptor; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.SymbolLookup; -import java.lang.foreign.MemoryAddress; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.ValueLayout; -import java.lang.invoke.MethodHandle; -import java.lang.invoke.MethodHandles; -import java.lang.invoke.MethodType; -import java.io.File; -import java.nio.file.Path; -import java.nio.charset.StandardCharsets; -import java.util.Arrays; -import java.util.Optional; -import java.util.stream.Stream; - -import static java.lang.foreign.Linker.*; -import static java.lang.foreign.ValueLayout.*; - -final class RuntimeHelper { - - private RuntimeHelper() {} - private final static Linker LINKER = Linker.nativeLinker(); - private final static ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); - private final static MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); - private final static SymbolLookup SYMBOL_LOOKUP; - - final static SegmentAllocator CONSTANT_ALLOCATOR = - (size, align) -> MemorySegment.allocateNative(size, align, MemorySession.openImplicit()); - - static { - - SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); - SYMBOL_LOOKUP = name -> loaderLookup.lookup(name).or(() -> LINKER.defaultLookup().lookup(name)); - } - - static T requireNonNull(T obj, String symbolName) { - if (obj == null) { - throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); - } - return obj; - } - - private final static SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; - - static final MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { - return SYMBOL_LOOKUP.lookup(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), MemorySession.openShared())).orElse(null); - } - - static final MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { - return SYMBOL_LOOKUP.lookup(name). - map(addr -> LINKER.downcallHandle(addr, fdesc)). - orElse(null); - } - - static final MethodHandle downcallHandle(FunctionDescriptor fdesc) { - return LINKER.downcallHandle(fdesc); - } - - static final MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { - return SYMBOL_LOOKUP.lookup(name). - map(addr -> VarargsInvoker.make(addr, fdesc)). - orElse(null); - } - - static final MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, MemorySession session) { - try { - MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", Linker.upcallType(fdesc)); - handle = handle.bindTo(z); - return LINKER.upcallStub(handle, fdesc, session); - } catch (Throwable ex) { - throw new AssertionError(ex); - } - } - - static MemorySegment asArray(MemoryAddress addr, MemoryLayout layout, int numElements, MemorySession session) { - return MemorySegment.ofAddress(addr, numElements * layout.byteSize(), session); - } - - // Internals only below this point - - private static class VarargsInvoker { - private static final MethodHandle INVOKE_MH; - private final MemorySegment symbol; - private final FunctionDescriptor function; - - private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { - this.symbol = symbol; - this.function = function; - } - - static { - try { - INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); - } catch (ReflectiveOperationException e) { - throw new RuntimeException(e); - } - } - - static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { - VarargsInvoker invoker = new VarargsInvoker(symbol, function); - MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); - MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); - for (MemoryLayout layout : function.argumentLayouts()) { - mtype = mtype.appendParameterTypes(carrier(layout, false)); - } - mtype = mtype.appendParameterTypes(Object[].class); - if (mtype.returnType().equals(MemorySegment.class)) { - mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); - } else { - handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); - } - return handle.asType(mtype); - } - - static Class carrier(MemoryLayout layout, boolean ret) { - if (layout instanceof ValueLayout valueLayout) { - return (ret || valueLayout.carrier() != MemoryAddress.class) ? - valueLayout.carrier() : Addressable.class; - } else if (layout instanceof GroupLayout) { - return MemorySegment.class; - } else { - throw new AssertionError("Cannot get here!"); - } - } - - private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { - // one trailing Object[] - int nNamedArgs = function.argumentLayouts().size(); - assert(args.length == nNamedArgs + 1); - // The last argument is the array of vararg collector - Object[] unnamedArgs = (Object[]) args[args.length - 1]; - - int argsCount = nNamedArgs + unnamedArgs.length; - Class[] argTypes = new Class[argsCount]; - MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; - - int pos = 0; - for (pos = 0; pos < nNamedArgs; pos++) { - argLayouts[pos] = function.argumentLayouts().get(pos); - } - - assert pos == nNamedArgs; - for (Object o: unnamedArgs) { - argLayouts[pos] = variadicLayout(normalize(o.getClass())); - pos++; - } - assert pos == argsCount; - - FunctionDescriptor f = (function.returnLayout().isEmpty()) ? - FunctionDescriptor.ofVoid(argLayouts) : - FunctionDescriptor.of(function.returnLayout().get(), argLayouts); - MethodHandle mh = LINKER.downcallHandle(symbol, f); - if (mh.type().returnType() == MemorySegment.class) { - mh = mh.bindTo(allocator); - } - // flatten argument list so that it can be passed to an asSpreader MH - Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; - System.arraycopy(args, 0, allArgs, 0, nNamedArgs); - System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); - - return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); - } - - private static Class unboxIfNeeded(Class clazz) { - if (clazz == Boolean.class) { - return boolean.class; - } else if (clazz == Void.class) { - return void.class; - } else if (clazz == Byte.class) { - return byte.class; - } else if (clazz == Character.class) { - return char.class; - } else if (clazz == Short.class) { - return short.class; - } else if (clazz == Integer.class) { - return int.class; - } else if (clazz == Long.class) { - return long.class; - } else if (clazz == Float.class) { - return float.class; - } else if (clazz == Double.class) { - return double.class; - } else { - return clazz; - } - } - - private Class promote(Class c) { - if (c == byte.class || c == char.class || c == short.class || c == int.class) { - return long.class; - } else if (c == float.class) { - return double.class; - } else { - return c; - } - } - - private Class normalize(Class c) { - c = unboxIfNeeded(c); - if (c.isPrimitive()) { - return promote(c); - } - if (MemoryAddress.class.isAssignableFrom(c)) { - return MemoryAddress.class; - } - if (MemorySegment.class.isAssignableFrom(c)) { - return MemorySegment.class; - } - throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); - } - - private MemoryLayout variadicLayout(Class c) { - if (c == long.class) { - return JAVA_LONG; - } else if (c == double.class) { - return JAVA_DOUBLE; - } else if (MemoryAddress.class.isAssignableFrom(c)) { - return ADDRESS; - } else { - throw new IllegalArgumentException("Unhandled variadic argument class: " + c); - } - } - } -} diff --git a/java-panama/src/main/java/foreign/c/_iobuf.java b/java-panama/src/main/java/foreign/c/_iobuf.java deleted file mode 100644 index b9f546f634..0000000000 --- a/java-panama/src/main/java/foreign/c/_iobuf.java +++ /dev/null @@ -1,162 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -public class _iobuf { - - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_POINTER$LAYOUT.withName("_ptr"), - Constants$root.C_LONG$LAYOUT.withName("_cnt"), - MemoryLayout.paddingLayout(32), - Constants$root.C_POINTER$LAYOUT.withName("_base"), - Constants$root.C_LONG$LAYOUT.withName("_flag"), - Constants$root.C_LONG$LAYOUT.withName("_file"), - Constants$root.C_LONG$LAYOUT.withName("_charbuf"), - Constants$root.C_LONG$LAYOUT.withName("_bufsiz"), - Constants$root.C_POINTER$LAYOUT.withName("_tmpfname") - ).withName("_iobuf"); - public static MemoryLayout $LAYOUT() { - return _iobuf.$struct$LAYOUT; - } - static final VarHandle _ptr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("_ptr")); - public static VarHandle _ptr$VH() { - return _iobuf._ptr$VH; - } - public static MemoryAddress _ptr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)_iobuf._ptr$VH.get(seg); - } - public static void _ptr$set( MemorySegment seg, MemoryAddress x) { - _iobuf._ptr$VH.set(seg, x); - } - public static MemoryAddress _ptr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)_iobuf._ptr$VH.get(seg.asSlice(index*sizeof())); - } - public static void _ptr$set(MemorySegment seg, long index, MemoryAddress x) { - _iobuf._ptr$VH.set(seg.asSlice(index*sizeof()), x); - } - static final VarHandle _cnt$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("_cnt")); - public static VarHandle _cnt$VH() { - return _iobuf._cnt$VH; - } - public static int _cnt$get(MemorySegment seg) { - return (int)_iobuf._cnt$VH.get(seg); - } - public static void _cnt$set( MemorySegment seg, int x) { - _iobuf._cnt$VH.set(seg, x); - } - public static int _cnt$get(MemorySegment seg, long index) { - return (int)_iobuf._cnt$VH.get(seg.asSlice(index*sizeof())); - } - public static void _cnt$set(MemorySegment seg, long index, int x) { - _iobuf._cnt$VH.set(seg.asSlice(index*sizeof()), x); - } - static final VarHandle _base$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("_base")); - public static VarHandle _base$VH() { - return _iobuf._base$VH; - } - public static MemoryAddress _base$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)_iobuf._base$VH.get(seg); - } - public static void _base$set( MemorySegment seg, MemoryAddress x) { - _iobuf._base$VH.set(seg, x); - } - public static MemoryAddress _base$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)_iobuf._base$VH.get(seg.asSlice(index*sizeof())); - } - public static void _base$set(MemorySegment seg, long index, MemoryAddress x) { - _iobuf._base$VH.set(seg.asSlice(index*sizeof()), x); - } - static final VarHandle _flag$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("_flag")); - public static VarHandle _flag$VH() { - return _iobuf._flag$VH; - } - public static int _flag$get(MemorySegment seg) { - return (int)_iobuf._flag$VH.get(seg); - } - public static void _flag$set( MemorySegment seg, int x) { - _iobuf._flag$VH.set(seg, x); - } - public static int _flag$get(MemorySegment seg, long index) { - return (int)_iobuf._flag$VH.get(seg.asSlice(index*sizeof())); - } - public static void _flag$set(MemorySegment seg, long index, int x) { - _iobuf._flag$VH.set(seg.asSlice(index*sizeof()), x); - } - static final VarHandle _file$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("_file")); - public static VarHandle _file$VH() { - return _iobuf._file$VH; - } - public static int _file$get(MemorySegment seg) { - return (int)_iobuf._file$VH.get(seg); - } - public static void _file$set( MemorySegment seg, int x) { - _iobuf._file$VH.set(seg, x); - } - public static int _file$get(MemorySegment seg, long index) { - return (int)_iobuf._file$VH.get(seg.asSlice(index*sizeof())); - } - public static void _file$set(MemorySegment seg, long index, int x) { - _iobuf._file$VH.set(seg.asSlice(index*sizeof()), x); - } - static final VarHandle _charbuf$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("_charbuf")); - public static VarHandle _charbuf$VH() { - return _iobuf._charbuf$VH; - } - public static int _charbuf$get(MemorySegment seg) { - return (int)_iobuf._charbuf$VH.get(seg); - } - public static void _charbuf$set( MemorySegment seg, int x) { - _iobuf._charbuf$VH.set(seg, x); - } - public static int _charbuf$get(MemorySegment seg, long index) { - return (int)_iobuf._charbuf$VH.get(seg.asSlice(index*sizeof())); - } - public static void _charbuf$set(MemorySegment seg, long index, int x) { - _iobuf._charbuf$VH.set(seg.asSlice(index*sizeof()), x); - } - static final VarHandle _bufsiz$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("_bufsiz")); - public static VarHandle _bufsiz$VH() { - return _iobuf._bufsiz$VH; - } - public static int _bufsiz$get(MemorySegment seg) { - return (int)_iobuf._bufsiz$VH.get(seg); - } - public static void _bufsiz$set( MemorySegment seg, int x) { - _iobuf._bufsiz$VH.set(seg, x); - } - public static int _bufsiz$get(MemorySegment seg, long index) { - return (int)_iobuf._bufsiz$VH.get(seg.asSlice(index*sizeof())); - } - public static void _bufsiz$set(MemorySegment seg, long index, int x) { - _iobuf._bufsiz$VH.set(seg.asSlice(index*sizeof()), x); - } - static final VarHandle _tmpfname$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("_tmpfname")); - public static VarHandle _tmpfname$VH() { - return _iobuf._tmpfname$VH; - } - public static MemoryAddress _tmpfname$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)_iobuf._tmpfname$VH.get(seg); - } - public static void _tmpfname$set( MemorySegment seg, MemoryAddress x) { - _iobuf._tmpfname$VH.set(seg, x); - } - public static MemoryAddress _tmpfname$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)_iobuf._tmpfname$VH.get(seg.asSlice(index*sizeof())); - } - public static void _tmpfname$set(MemorySegment seg, long index, MemoryAddress x) { - _iobuf._tmpfname$VH.set(seg.asSlice(index*sizeof()), x); - } - public static long sizeof() { return $LAYOUT().byteSize(); } - public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); - } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$0.java b/java-panama/src/main/java/foreign/c/constants$0.java deleted file mode 100644 index 4bd3d3fa4b..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$0.java +++ /dev/null @@ -1,52 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$0 { - - static final FunctionDescriptor fopen$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fopen$MH = RuntimeHelper.downcallHandle( - "fopen", - constants$0.fopen$FUNC - ); - static final FunctionDescriptor freopen$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle freopen$MH = RuntimeHelper.downcallHandle( - "freopen", - constants$0.freopen$FUNC - ); - static final FunctionDescriptor fflush$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fflush$MH = RuntimeHelper.downcallHandle( - "fflush", - constants$0.fflush$FUNC - ); - static final FunctionDescriptor fclose$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fclose$MH = RuntimeHelper.downcallHandle( - "fclose", - constants$0.fclose$FUNC - ); - static final FunctionDescriptor remove$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle remove$MH = RuntimeHelper.downcallHandle( - "remove", - constants$0.remove$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$1.java b/java-panama/src/main/java/foreign/c/constants$1.java deleted file mode 100644 index acd4dbf615..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$1.java +++ /dev/null @@ -1,54 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$1 { - - static final FunctionDescriptor rename$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle rename$MH = RuntimeHelper.downcallHandle( - "rename", - constants$1.rename$FUNC - ); - static final FunctionDescriptor tmpfile$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT); - static final MethodHandle tmpfile$MH = RuntimeHelper.downcallHandle( - "tmpfile", - constants$1.tmpfile$FUNC - ); - static final FunctionDescriptor tmpnam$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle tmpnam$MH = RuntimeHelper.downcallHandle( - "tmpnam", - constants$1.tmpnam$FUNC - ); - static final FunctionDescriptor _tempnam$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle _tempnam$MH = RuntimeHelper.downcallHandle( - "_tempnam", - constants$1._tempnam$FUNC - ); - static final FunctionDescriptor _rmtmp$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); - static final MethodHandle _rmtmp$MH = RuntimeHelper.downcallHandle( - "_rmtmp", - constants$1._rmtmp$FUNC - ); - static final FunctionDescriptor _unlink$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle _unlink$MH = RuntimeHelper.downcallHandle( - "_unlink", - constants$1._unlink$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$10.java b/java-panama/src/main/java/foreign/c/constants$10.java deleted file mode 100644 index 5f9cef3d67..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$10.java +++ /dev/null @@ -1,61 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$10 { - - static final FunctionDescriptor getc$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle getc$MH = RuntimeHelper.downcallHandle( - "getc", - constants$10.getc$FUNC - ); - static final FunctionDescriptor putc$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle putc$MH = RuntimeHelper.downcallHandle( - "putc", - constants$10.putc$FUNC - ); - static final FunctionDescriptor getchar$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); - static final MethodHandle getchar$MH = RuntimeHelper.downcallHandle( - "getchar", - constants$10.getchar$FUNC - ); - static final FunctionDescriptor putchar$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle putchar$MH = RuntimeHelper.downcallHandle( - "putchar", - constants$10.putchar$FUNC - ); - static final FunctionDescriptor fread$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fread$MH = RuntimeHelper.downcallHandle( - "fread", - constants$10.fread$FUNC - ); - static final FunctionDescriptor fwrite$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fwrite$MH = RuntimeHelper.downcallHandle( - "fwrite", - constants$10.fwrite$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$11.java b/java-panama/src/main/java/foreign/c/constants$11.java deleted file mode 100644 index c854ef9302..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$11.java +++ /dev/null @@ -1,60 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$11 { - - static final FunctionDescriptor fseek$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle fseek$MH = RuntimeHelper.downcallHandle( - "fseek", - constants$11.fseek$FUNC - ); - static final FunctionDescriptor ftell$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle ftell$MH = RuntimeHelper.downcallHandle( - "ftell", - constants$11.ftell$FUNC - ); - static final FunctionDescriptor rewind$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle rewind$MH = RuntimeHelper.downcallHandle( - "rewind", - constants$11.rewind$FUNC - ); - static final FunctionDescriptor fgetpos$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fgetpos$MH = RuntimeHelper.downcallHandle( - "fgetpos", - constants$11.fgetpos$FUNC - ); - static final FunctionDescriptor fsetpos$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fsetpos$MH = RuntimeHelper.downcallHandle( - "fsetpos", - constants$11.fsetpos$FUNC - ); - static final FunctionDescriptor feof$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle feof$MH = RuntimeHelper.downcallHandle( - "feof", - constants$11.feof$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$12.java b/java-panama/src/main/java/foreign/c/constants$12.java deleted file mode 100644 index db0d19a2b8..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$12.java +++ /dev/null @@ -1,58 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$12 { - - static final FunctionDescriptor ferror$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle ferror$MH = RuntimeHelper.downcallHandle( - "ferror", - constants$12.ferror$FUNC - ); - static final FunctionDescriptor clearerr$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle clearerr$MH = RuntimeHelper.downcallHandle( - "clearerr", - constants$12.clearerr$FUNC - ); - static final FunctionDescriptor perror$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle perror$MH = RuntimeHelper.downcallHandle( - "perror", - constants$12.perror$FUNC - ); - static final FunctionDescriptor _popen$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle _popen$MH = RuntimeHelper.downcallHandle( - "_popen", - constants$12._popen$FUNC - ); - static final FunctionDescriptor _pclose$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle _pclose$MH = RuntimeHelper.downcallHandle( - "_pclose", - constants$12._pclose$FUNC - ); - static final FunctionDescriptor popen$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle popen$MH = RuntimeHelper.downcallHandle( - "popen", - constants$12.popen$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$13.java b/java-panama/src/main/java/foreign/c/constants$13.java deleted file mode 100644 index f71ff564a0..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$13.java +++ /dev/null @@ -1,53 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$13 { - - static final FunctionDescriptor pclose$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle pclose$MH = RuntimeHelper.downcallHandle( - "pclose", - constants$13.pclose$FUNC - ); - static final FunctionDescriptor _flushall$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); - static final MethodHandle _flushall$MH = RuntimeHelper.downcallHandle( - "_flushall", - constants$13._flushall$FUNC - ); - static final FunctionDescriptor _fgetchar$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); - static final MethodHandle _fgetchar$MH = RuntimeHelper.downcallHandle( - "_fgetchar", - constants$13._fgetchar$FUNC - ); - static final FunctionDescriptor _fputchar$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle _fputchar$MH = RuntimeHelper.downcallHandle( - "_fputchar", - constants$13._fputchar$FUNC - ); - static final FunctionDescriptor _fdopen$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle _fdopen$MH = RuntimeHelper.downcallHandle( - "_fdopen", - constants$13._fdopen$FUNC - ); - static final FunctionDescriptor _fileno$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle _fileno$MH = RuntimeHelper.downcallHandle( - "_fileno", - constants$13._fileno$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$14.java b/java-panama/src/main/java/foreign/c/constants$14.java deleted file mode 100644 index d1c82c9abb..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$14.java +++ /dev/null @@ -1,52 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$14 { - - static final FunctionDescriptor _fcloseall$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); - static final MethodHandle _fcloseall$MH = RuntimeHelper.downcallHandle( - "_fcloseall", - constants$14._fcloseall$FUNC - ); - static final FunctionDescriptor _fsopen$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle _fsopen$MH = RuntimeHelper.downcallHandle( - "_fsopen", - constants$14._fsopen$FUNC - ); - static final FunctionDescriptor __mingw_get_output_format$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); - static final MethodHandle __mingw_get_output_format$MH = RuntimeHelper.downcallHandle( - "__mingw_get_output_format", - constants$14.__mingw_get_output_format$FUNC - ); - static final FunctionDescriptor __mingw_set_output_format$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle __mingw_set_output_format$MH = RuntimeHelper.downcallHandle( - "__mingw_set_output_format", - constants$14.__mingw_set_output_format$FUNC - ); - static final FunctionDescriptor __mingw_get_printf_count_output$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); - static final MethodHandle __mingw_get_printf_count_output$MH = RuntimeHelper.downcallHandle( - "__mingw_get_printf_count_output", - constants$14.__mingw_get_printf_count_output$FUNC - ); - static final FunctionDescriptor __mingw_set_printf_count_output$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle __mingw_set_printf_count_output$MH = RuntimeHelper.downcallHandle( - "__mingw_set_printf_count_output", - constants$14.__mingw_set_printf_count_output$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$15.java b/java-panama/src/main/java/foreign/c/constants$15.java deleted file mode 100644 index 426e33db00..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$15.java +++ /dev/null @@ -1,50 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$15 { - - static final FunctionDescriptor _get_output_format$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); - static final MethodHandle _get_output_format$MH = RuntimeHelper.downcallHandle( - "_get_output_format", - constants$15._get_output_format$FUNC - ); - static final FunctionDescriptor _set_output_format$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle _set_output_format$MH = RuntimeHelper.downcallHandle( - "_set_output_format", - constants$15._set_output_format$FUNC - ); - static final FunctionDescriptor _get_printf_count_output$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); - static final MethodHandle _get_printf_count_output$MH = RuntimeHelper.downcallHandle( - "_get_printf_count_output", - constants$15._get_printf_count_output$FUNC - ); - static final FunctionDescriptor _set_printf_count_output$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle _set_printf_count_output$MH = RuntimeHelper.downcallHandle( - "_set_printf_count_output", - constants$15._set_printf_count_output$FUNC - ); - static final FunctionDescriptor fgetchar$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); - static final MethodHandle fgetchar$MH = RuntimeHelper.downcallHandle( - "fgetchar", - constants$15.fgetchar$FUNC - ); - static final FunctionDescriptor fputchar$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle fputchar$MH = RuntimeHelper.downcallHandle( - "fputchar", - constants$15.fputchar$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$16.java b/java-panama/src/main/java/foreign/c/constants$16.java deleted file mode 100644 index 58e06fa164..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$16.java +++ /dev/null @@ -1,61 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$16 { - - static final FunctionDescriptor fdopen$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fdopen$MH = RuntimeHelper.downcallHandle( - "fdopen", - constants$16.fdopen$FUNC - ); - static final FunctionDescriptor fileno$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fileno$MH = RuntimeHelper.downcallHandle( - "fileno", - constants$16.fileno$FUNC - ); - static final FunctionDescriptor fwprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fwprintf$MH = RuntimeHelper.downcallHandleVariadic( - "fwprintf", - constants$16.fwprintf$FUNC - ); - static final FunctionDescriptor wprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle wprintf$MH = RuntimeHelper.downcallHandleVariadic( - "wprintf", - constants$16.wprintf$FUNC - ); - static final FunctionDescriptor vfwprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle vfwprintf$MH = RuntimeHelper.downcallHandle( - "vfwprintf", - constants$16.vfwprintf$FUNC - ); - static final FunctionDescriptor vwprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle vwprintf$MH = RuntimeHelper.downcallHandle( - "vwprintf", - constants$16.vwprintf$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$17.java b/java-panama/src/main/java/foreign/c/constants$17.java deleted file mode 100644 index f58aad6fb6..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$17.java +++ /dev/null @@ -1,64 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$17 { - - static final FunctionDescriptor _snwprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle _snwprintf$MH = RuntimeHelper.downcallHandleVariadic( - "_snwprintf", - constants$17._snwprintf$FUNC - ); - static final FunctionDescriptor _vscwprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle _vscwprintf$MH = RuntimeHelper.downcallHandle( - "_vscwprintf", - constants$17._vscwprintf$FUNC - ); - static final FunctionDescriptor _vsnwprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle _vsnwprintf$MH = RuntimeHelper.downcallHandle( - "_vsnwprintf", - constants$17._vsnwprintf$FUNC - ); - static final FunctionDescriptor fwscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fwscanf$MH = RuntimeHelper.downcallHandleVariadic( - "fwscanf", - constants$17.fwscanf$FUNC - ); - static final FunctionDescriptor wscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle wscanf$MH = RuntimeHelper.downcallHandleVariadic( - "wscanf", - constants$17.wscanf$FUNC - ); - static final FunctionDescriptor swscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle swscanf$MH = RuntimeHelper.downcallHandleVariadic( - "swscanf", - constants$17.swscanf$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$18.java b/java-panama/src/main/java/foreign/c/constants$18.java deleted file mode 100644 index 15af05eb64..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$18.java +++ /dev/null @@ -1,63 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$18 { - - static final FunctionDescriptor fgetwc$FUNC = FunctionDescriptor.of(Constants$root.C_SHORT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fgetwc$MH = RuntimeHelper.downcallHandle( - "fgetwc", - constants$18.fgetwc$FUNC - ); - static final FunctionDescriptor fputwc$FUNC = FunctionDescriptor.of(Constants$root.C_SHORT$LAYOUT, - Constants$root.C_SHORT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fputwc$MH = RuntimeHelper.downcallHandle( - "fputwc", - constants$18.fputwc$FUNC - ); - static final FunctionDescriptor ungetwc$FUNC = FunctionDescriptor.of(Constants$root.C_SHORT$LAYOUT, - Constants$root.C_SHORT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle ungetwc$MH = RuntimeHelper.downcallHandle( - "ungetwc", - constants$18.ungetwc$FUNC - ); - static final FunctionDescriptor swprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle swprintf$MH = RuntimeHelper.downcallHandleVariadic( - "swprintf", - constants$18.swprintf$FUNC - ); - static final FunctionDescriptor vswprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle vswprintf$MH = RuntimeHelper.downcallHandle( - "vswprintf", - constants$18.vswprintf$FUNC - ); - static final FunctionDescriptor snwprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle snwprintf$MH = RuntimeHelper.downcallHandleVariadic( - "snwprintf", - constants$18.snwprintf$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$19.java b/java-panama/src/main/java/foreign/c/constants$19.java deleted file mode 100644 index a9cadf6ddb..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$19.java +++ /dev/null @@ -1,62 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$19 { - - static final FunctionDescriptor vsnwprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle vsnwprintf$MH = RuntimeHelper.downcallHandle( - "vsnwprintf", - constants$19.vsnwprintf$FUNC - ); - static final FunctionDescriptor vwscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle vwscanf$MH = RuntimeHelper.downcallHandle( - "vwscanf", - constants$19.vwscanf$FUNC - ); - static final FunctionDescriptor vfwscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle vfwscanf$MH = RuntimeHelper.downcallHandle( - "vfwscanf", - constants$19.vfwscanf$FUNC - ); - static final FunctionDescriptor vswscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle vswscanf$MH = RuntimeHelper.downcallHandle( - "vswscanf", - constants$19.vswscanf$FUNC - ); - static final FunctionDescriptor _fgetwchar$FUNC = FunctionDescriptor.of(Constants$root.C_SHORT$LAYOUT); - static final MethodHandle _fgetwchar$MH = RuntimeHelper.downcallHandle( - "_fgetwchar", - constants$19._fgetwchar$FUNC - ); - static final FunctionDescriptor _fputwchar$FUNC = FunctionDescriptor.of(Constants$root.C_SHORT$LAYOUT, - Constants$root.C_SHORT$LAYOUT - ); - static final MethodHandle _fputwchar$MH = RuntimeHelper.downcallHandle( - "_fputwchar", - constants$19._fputwchar$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$2.java b/java-panama/src/main/java/foreign/c/constants$2.java deleted file mode 100644 index a522b398aa..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$2.java +++ /dev/null @@ -1,60 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$2 { - - static final FunctionDescriptor tempnam$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle tempnam$MH = RuntimeHelper.downcallHandle( - "tempnam", - constants$2.tempnam$FUNC - ); - static final FunctionDescriptor rmtmp$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT); - static final MethodHandle rmtmp$MH = RuntimeHelper.downcallHandle( - "rmtmp", - constants$2.rmtmp$FUNC - ); - static final FunctionDescriptor unlink$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle unlink$MH = RuntimeHelper.downcallHandle( - "unlink", - constants$2.unlink$FUNC - ); - static final FunctionDescriptor setvbuf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle setvbuf$MH = RuntimeHelper.downcallHandle( - "setvbuf", - constants$2.setvbuf$FUNC - ); - static final FunctionDescriptor setbuf$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle setbuf$MH = RuntimeHelper.downcallHandle( - "setbuf", - constants$2.setbuf$FUNC - ); - static final FunctionDescriptor __mingw_fprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle __mingw_fprintf$MH = RuntimeHelper.downcallHandleVariadic( - "__mingw_fprintf", - constants$2.__mingw_fprintf$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$20.java b/java-panama/src/main/java/foreign/c/constants$20.java deleted file mode 100644 index feec0d4d44..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$20.java +++ /dev/null @@ -1,56 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$20 { - - static final FunctionDescriptor _getw$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle _getw$MH = RuntimeHelper.downcallHandle( - "_getw", - constants$20._getw$FUNC - ); - static final FunctionDescriptor _putw$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle _putw$MH = RuntimeHelper.downcallHandle( - "_putw", - constants$20._putw$FUNC - ); - static final FunctionDescriptor fgetwchar$FUNC = FunctionDescriptor.of(Constants$root.C_SHORT$LAYOUT); - static final MethodHandle fgetwchar$MH = RuntimeHelper.downcallHandle( - "fgetwchar", - constants$20.fgetwchar$FUNC - ); - static final FunctionDescriptor fputwchar$FUNC = FunctionDescriptor.of(Constants$root.C_SHORT$LAYOUT, - Constants$root.C_SHORT$LAYOUT - ); - static final MethodHandle fputwchar$MH = RuntimeHelper.downcallHandle( - "fputwchar", - constants$20.fputwchar$FUNC - ); - static final FunctionDescriptor getw$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle getw$MH = RuntimeHelper.downcallHandle( - "getw", - constants$20.getw$FUNC - ); - static final FunctionDescriptor putw$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle putw$MH = RuntimeHelper.downcallHandle( - "putw", - constants$20.putw$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$21.java b/java-panama/src/main/java/foreign/c/constants$21.java deleted file mode 100644 index ed21424dc5..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$21.java +++ /dev/null @@ -1,18 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$21 { - - static final MemoryAddress NULL$ADDR = MemoryAddress.ofLong(0L); - static final MemorySegment _P_tmpdir$SEGMENT = RuntimeHelper.CONSTANT_ALLOCATOR.allocateUtf8String("\\"); - static final MemorySegment P_tmpdir$SEGMENT = RuntimeHelper.CONSTANT_ALLOCATOR.allocateUtf8String("\\"); - static final MemorySegment _wP_tmpdir$SEGMENT = RuntimeHelper.CONSTANT_ALLOCATOR.allocateUtf8String("\\"); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$3.java b/java-panama/src/main/java/foreign/c/constants$3.java deleted file mode 100644 index 0709e943bd..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$3.java +++ /dev/null @@ -1,64 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$3 { - - static final FunctionDescriptor __mingw_printf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle __mingw_printf$MH = RuntimeHelper.downcallHandleVariadic( - "__mingw_printf", - constants$3.__mingw_printf$FUNC - ); - static final FunctionDescriptor __mingw_sprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle __mingw_sprintf$MH = RuntimeHelper.downcallHandleVariadic( - "__mingw_sprintf", - constants$3.__mingw_sprintf$FUNC - ); - static final FunctionDescriptor __mingw_snprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle __mingw_snprintf$MH = RuntimeHelper.downcallHandleVariadic( - "__mingw_snprintf", - constants$3.__mingw_snprintf$FUNC - ); - static final FunctionDescriptor __mingw_vfprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle __mingw_vfprintf$MH = RuntimeHelper.downcallHandle( - "__mingw_vfprintf", - constants$3.__mingw_vfprintf$FUNC - ); - static final FunctionDescriptor __mingw_vprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle __mingw_vprintf$MH = RuntimeHelper.downcallHandle( - "__mingw_vprintf", - constants$3.__mingw_vprintf$FUNC - ); - static final FunctionDescriptor __mingw_vsprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle __mingw_vsprintf$MH = RuntimeHelper.downcallHandle( - "__mingw_vsprintf", - constants$3.__mingw_vsprintf$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$4.java b/java-panama/src/main/java/foreign/c/constants$4.java deleted file mode 100644 index b5098ce7fd..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$4.java +++ /dev/null @@ -1,64 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$4 { - - static final FunctionDescriptor __mingw_vsnprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle __mingw_vsnprintf$MH = RuntimeHelper.downcallHandle( - "__mingw_vsnprintf", - constants$4.__mingw_vsnprintf$FUNC - ); - static final FunctionDescriptor _mingw_output_format_control$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle _mingw_output_format_control$MH = RuntimeHelper.downcallHandle( - "_mingw_output_format_control", - constants$4._mingw_output_format_control$FUNC - ); - static final FunctionDescriptor fprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fprintf$MH = RuntimeHelper.downcallHandleVariadic( - "fprintf", - constants$4.fprintf$FUNC - ); - static final FunctionDescriptor printf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle printf$MH = RuntimeHelper.downcallHandleVariadic( - "printf", - constants$4.printf$FUNC - ); - static final FunctionDescriptor sprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle sprintf$MH = RuntimeHelper.downcallHandleVariadic( - "sprintf", - constants$4.sprintf$FUNC - ); - static final FunctionDescriptor vfprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle vfprintf$MH = RuntimeHelper.downcallHandle( - "vfprintf", - constants$4.vfprintf$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$5.java b/java-panama/src/main/java/foreign/c/constants$5.java deleted file mode 100644 index 663b2d6143..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$5.java +++ /dev/null @@ -1,63 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$5 { - - static final FunctionDescriptor vprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle vprintf$MH = RuntimeHelper.downcallHandle( - "vprintf", - constants$5.vprintf$FUNC - ); - static final FunctionDescriptor vsprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle vsprintf$MH = RuntimeHelper.downcallHandle( - "vsprintf", - constants$5.vsprintf$FUNC - ); - static final FunctionDescriptor __msvcrt_fprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle __msvcrt_fprintf$MH = RuntimeHelper.downcallHandleVariadic( - "__msvcrt_fprintf", - constants$5.__msvcrt_fprintf$FUNC - ); - static final FunctionDescriptor __msvcrt_printf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle __msvcrt_printf$MH = RuntimeHelper.downcallHandleVariadic( - "__msvcrt_printf", - constants$5.__msvcrt_printf$FUNC - ); - static final FunctionDescriptor __msvcrt_sprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle __msvcrt_sprintf$MH = RuntimeHelper.downcallHandleVariadic( - "__msvcrt_sprintf", - constants$5.__msvcrt_sprintf$FUNC - ); - static final FunctionDescriptor __msvcrt_vfprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle __msvcrt_vfprintf$MH = RuntimeHelper.downcallHandle( - "__msvcrt_vfprintf", - constants$5.__msvcrt_vfprintf$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$6.java b/java-panama/src/main/java/foreign/c/constants$6.java deleted file mode 100644 index c03430d45d..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$6.java +++ /dev/null @@ -1,67 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$6 { - - static final FunctionDescriptor __msvcrt_vprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle __msvcrt_vprintf$MH = RuntimeHelper.downcallHandle( - "__msvcrt_vprintf", - constants$6.__msvcrt_vprintf$FUNC - ); - static final FunctionDescriptor __msvcrt_vsprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle __msvcrt_vsprintf$MH = RuntimeHelper.downcallHandle( - "__msvcrt_vsprintf", - constants$6.__msvcrt_vsprintf$FUNC - ); - static final FunctionDescriptor _snprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle _snprintf$MH = RuntimeHelper.downcallHandleVariadic( - "_snprintf", - constants$6._snprintf$FUNC - ); - static final FunctionDescriptor _vsnprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle _vsnprintf$MH = RuntimeHelper.downcallHandle( - "_vsnprintf", - constants$6._vsnprintf$FUNC - ); - static final FunctionDescriptor _vscprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle _vscprintf$MH = RuntimeHelper.downcallHandle( - "_vscprintf", - constants$6._vscprintf$FUNC - ); - static final FunctionDescriptor snprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle snprintf$MH = RuntimeHelper.downcallHandleVariadic( - "snprintf", - constants$6.snprintf$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$7.java b/java-panama/src/main/java/foreign/c/constants$7.java deleted file mode 100644 index 21676e164a..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$7.java +++ /dev/null @@ -1,69 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$7 { - - static final FunctionDescriptor vsnprintf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle vsnprintf$MH = RuntimeHelper.downcallHandle( - "vsnprintf", - constants$7.vsnprintf$FUNC - ); - static final FunctionDescriptor vscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle vscanf$MH = RuntimeHelper.downcallHandle( - "vscanf", - constants$7.vscanf$FUNC - ); - static final FunctionDescriptor vfscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle vfscanf$MH = RuntimeHelper.downcallHandle( - "vfscanf", - constants$7.vfscanf$FUNC - ); - static final FunctionDescriptor vsscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle vsscanf$MH = RuntimeHelper.downcallHandle( - "vsscanf", - constants$7.vsscanf$FUNC - ); - static final FunctionDescriptor getdelim$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle getdelim$MH = RuntimeHelper.downcallHandle( - "getdelim", - constants$7.getdelim$FUNC - ); - static final FunctionDescriptor getline$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle getline$MH = RuntimeHelper.downcallHandle( - "getline", - constants$7.getline$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$8.java b/java-panama/src/main/java/foreign/c/constants$8.java deleted file mode 100644 index 5fb37ec59e..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$8.java +++ /dev/null @@ -1,61 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$8 { - - static final FunctionDescriptor fscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fscanf$MH = RuntimeHelper.downcallHandleVariadic( - "fscanf", - constants$8.fscanf$FUNC - ); - static final FunctionDescriptor scanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle scanf$MH = RuntimeHelper.downcallHandleVariadic( - "scanf", - constants$8.scanf$FUNC - ); - static final FunctionDescriptor sscanf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle sscanf$MH = RuntimeHelper.downcallHandleVariadic( - "sscanf", - constants$8.sscanf$FUNC - ); - static final FunctionDescriptor fgetc$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fgetc$MH = RuntimeHelper.downcallHandle( - "fgetc", - constants$8.fgetc$FUNC - ); - static final FunctionDescriptor fgets$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fgets$MH = RuntimeHelper.downcallHandle( - "fgets", - constants$8.fgets$FUNC - ); - static final FunctionDescriptor fputc$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fputc$MH = RuntimeHelper.downcallHandle( - "fputc", - constants$8.fputc$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/constants$9.java b/java-panama/src/main/java/foreign/c/constants$9.java deleted file mode 100644 index 1badf27ac5..0000000000 --- a/java-panama/src/main/java/foreign/c/constants$9.java +++ /dev/null @@ -1,59 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -class constants$9 { - - static final FunctionDescriptor fputs$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fputs$MH = RuntimeHelper.downcallHandle( - "fputs", - constants$9.fputs$FUNC - ); - static final FunctionDescriptor gets$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle gets$MH = RuntimeHelper.downcallHandle( - "gets", - constants$9.gets$FUNC - ); - static final FunctionDescriptor puts$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle puts$MH = RuntimeHelper.downcallHandle( - "puts", - constants$9.puts$FUNC - ); - static final FunctionDescriptor ungetc$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle ungetc$MH = RuntimeHelper.downcallHandle( - "ungetc", - constants$9.ungetc$FUNC - ); - static final FunctionDescriptor _filbuf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle _filbuf$MH = RuntimeHelper.downcallHandle( - "_filbuf", - constants$9._filbuf$FUNC - ); - static final FunctionDescriptor _flsbuf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle _flsbuf$MH = RuntimeHelper.downcallHandle( - "_flsbuf", - constants$9._flsbuf$FUNC - ); -} - - diff --git a/java-panama/src/main/java/foreign/c/stdio_h.java b/java-panama/src/main/java/foreign/c/stdio_h.java deleted file mode 100644 index 7aba552771..0000000000 --- a/java-panama/src/main/java/foreign/c/stdio_h.java +++ /dev/null @@ -1,1881 +0,0 @@ -// Generated by jextract - -package foreign.c; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -public class stdio_h { - - /* package-private */ stdio_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_LONG$LAYOUT; - public static OfInt C_LONG = Constants$root.C_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; - public static int __MINGW32_MAJOR_VERSION() { - return (int)5L; - } - public static int __MINGW32_MINOR_VERSION() { - return (int)0L; - } - public static int __MINGW32_PATCHLEVEL() { - return (int)2L; - } - public static int __MSVCR60_DLL() { - return (int)1536L; - } - public static int __MSVCR61_DLL() { - return (int)1537L; - } - public static int __MSVCR70_DLL() { - return (int)1792L; - } - public static int __MSVCR71_DLL() { - return (int)1793L; - } - public static int __MSVCR80_DLL() { - return (int)2048L; - } - public static int __MSVCR90_DLL() { - return (int)2304L; - } - public static int __MSVCR100_DLL() { - return (int)4096L; - } - public static int __MSVCR110_DLL() { - return (int)4352L; - } - public static int __MSVCR120_DLL() { - return (int)4608L; - } - public static int __W32API_MAJOR_VERSION() { - return (int)5L; - } - public static int __W32API_MINOR_VERSION() { - return (int)0L; - } - public static int __W32API_PATCHLEVEL() { - return (int)2L; - } - public static int SPVERSION_MASK() { - return (int)65280L; - } - public static int SUBVERSION_MASK() { - return (int)255L; - } - public static int _WIN32_WINNT_NT4() { - return (int)1024L; - } - public static int _WIN32_WINNT_NT4E() { - return (int)1025L; - } - public static int _WIN32_WINNT_NT4SP3() { - return (int)1027L; - } - public static int _WIN32_WINDOWS_95() { - return (int)1024L; - } - public static int _WIN32_WINDOWS_98() { - return (int)1040L; - } - public static int _WIN32_WINDOWS_ME() { - return (int)1168L; - } - public static int _WIN32_WINNT_WIN2K() { - return (int)1280L; - } - public static int _WIN32_WINNT_WINXP() { - return (int)1281L; - } - public static int _WIN32_WINNT_WS03() { - return (int)1282L; - } - public static int _WIN32_WINNT_WIN6() { - return (int)1536L; - } - public static int _WIN32_WINNT_VISTA() { - return (int)1536L; - } - public static int _WIN32_WINNT_WS08() { - return (int)1536L; - } - public static int _WIN32_WINNT_LONGHORN() { - return (int)1536L; - } - public static int _WIN32_WINNT_WIN7() { - return (int)1537L; - } - public static int _WIN32_WINNT_WIN8() { - return (int)1538L; - } - public static int _WIN32_WINNT_WINBLUE() { - return (int)1539L; - } - public static int _WIN32_IE_IE50() { - return (int)1280L; - } - public static int _WIN32_IE_IE501() { - return (int)1281L; - } - public static int _WIN32_IE_IE55() { - return (int)1360L; - } - public static int _WIN32_IE_IE56() { - return (int)1376L; - } - public static int _WIN32_IE_IE60() { - return (int)1536L; - } - public static int _WIN32_IE_IE60SP1() { - return (int)1537L; - } - public static int _WIN32_IE_IE60SP2() { - return (int)1539L; - } - public static int _WIN32_IE_IE70() { - return (int)1792L; - } - public static int _WIN32_IE_IE80() { - return (int)2048L; - } - public static int _WIN32_IE_IE30() { - return (int)768L; - } - public static int _WIN32_IE_IE301() { - return (int)769L; - } - public static int _WIN32_IE_IE302() { - return (int)770L; - } - public static int _WIN32_IE_IE40() { - return (int)1024L; - } - public static int _WIN32_IE_IE401() { - return (int)1025L; - } - public static int __NTDDI_WIN5() { - return (int)83886080L; - } - public static int __NTDDI_WIN51() { - return (int)83951616L; - } - public static int __NTDDI_WIN52() { - return (int)84017152L; - } - public static int __NTDDI_WIN6() { - return (int)100663296L; - } - public static int __NTDDI_WIN61() { - return (int)100728832L; - } - public static int __NTDDI_WIN62() { - return (int)100794368L; - } - public static int __NTDDI_WIN63() { - return (int)100859904L; - } - public static int __NTDDI_SP0() { - return (int)0L; - } - public static int __NTDDI_SP1() { - return (int)256L; - } - public static int __NTDDI_SP2() { - return (int)512L; - } - public static int __NTDDI_SP3() { - return (int)768L; - } - public static int __NTDDI_SP4() { - return (int)1024L; - } - public static int __CRT_GLOB_USE_MSVCRT__() { - return (int)1L; - } - public static int __CRT_GLOB_USE_MINGW__() { - return (int)2L; - } - public static int __CRT_GLOB_USE_SINGLE_QUOTE__() { - return (int)16L; - } - public static int __CRT_GLOB_BRACKET_GROUPS__() { - return (int)32L; - } - public static int _EMULATE_GLIBC() { - return (int)1L; - } - public static int _ISOC99_SOURCE() { - return (int)7L; - } - public static int _MINGW32_SOURCE_EXTENDED() { - return (int)1L; - } - public static int _IOREAD() { - return (int)1L; - } - public static int _IOWRT() { - return (int)2L; - } - public static int _IORW() { - return (int)128L; - } - public static int STDIN_FILENO() { - return (int)0L; - } - public static int STDOUT_FILENO() { - return (int)1L; - } - public static int STDERR_FILENO() { - return (int)2L; - } - public static int TMP_MAX() { - return (int)32767L; - } - public static int _IOFBF() { - return (int)0L; - } - public static int _IOLBF() { - return (int)64L; - } - public static int _IONBF() { - return (int)4L; - } - public static int _IOMYBUF() { - return (int)8L; - } - public static int _IOEOF() { - return (int)16L; - } - public static int _IOERR() { - return (int)32L; - } - public static int _IOSTRG() { - return (int)64L; - } - public static int BUFSIZ() { - return (int)512L; - } - public static int SEEK_SET() { - return (int)0L; - } - public static int SEEK_CUR() { - return (int)1L; - } - public static int SEEK_END() { - return (int)2L; - } - public static int _TWO_DIGIT_EXPONENT() { - return (int)1L; - } - public static int _THREE_DIGIT_EXPONENT() { - return (int)0L; - } - public static int __USE_MINGW_PRINTF() { - return (int)0L; - } - public static OfInt __off32_t = Constants$root.C_LONG$LAYOUT; - public static OfInt _off_t = Constants$root.C_LONG$LAYOUT; - public static OfInt off_t = Constants$root.C_LONG$LAYOUT; - public static OfInt _ssize_t = Constants$root.C_LONG$LAYOUT; - public static OfInt ssize_t = Constants$root.C_LONG$LAYOUT; - public static MethodHandle fopen$MH() { - return RuntimeHelper.requireNonNull(constants$0.fopen$MH,"fopen"); - } - public static MemoryAddress fopen ( Addressable x0, Addressable x1) { - var mh$ = fopen$MH(); - try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle freopen$MH() { - return RuntimeHelper.requireNonNull(constants$0.freopen$MH,"freopen"); - } - public static MemoryAddress freopen ( Addressable x0, Addressable x1, Addressable x2) { - var mh$ = freopen$MH(); - try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fflush$MH() { - return RuntimeHelper.requireNonNull(constants$0.fflush$MH,"fflush"); - } - public static int fflush ( Addressable x0) { - var mh$ = fflush$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fclose$MH() { - return RuntimeHelper.requireNonNull(constants$0.fclose$MH,"fclose"); - } - public static int fclose ( Addressable x0) { - var mh$ = fclose$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle remove$MH() { - return RuntimeHelper.requireNonNull(constants$0.remove$MH,"remove"); - } - public static int remove ( Addressable x0) { - var mh$ = remove$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle rename$MH() { - return RuntimeHelper.requireNonNull(constants$1.rename$MH,"rename"); - } - public static int rename ( Addressable x0, Addressable x1) { - var mh$ = rename$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle tmpfile$MH() { - return RuntimeHelper.requireNonNull(constants$1.tmpfile$MH,"tmpfile"); - } - public static MemoryAddress tmpfile () { - var mh$ = tmpfile$MH(); - try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle tmpnam$MH() { - return RuntimeHelper.requireNonNull(constants$1.tmpnam$MH,"tmpnam"); - } - public static MemoryAddress tmpnam ( Addressable x0) { - var mh$ = tmpnam$MH(); - try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _tempnam$MH() { - return RuntimeHelper.requireNonNull(constants$1._tempnam$MH,"_tempnam"); - } - public static MemoryAddress _tempnam ( Addressable x0, Addressable x1) { - var mh$ = _tempnam$MH(); - try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _rmtmp$MH() { - return RuntimeHelper.requireNonNull(constants$1._rmtmp$MH,"_rmtmp"); - } - public static int _rmtmp () { - var mh$ = _rmtmp$MH(); - try { - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _unlink$MH() { - return RuntimeHelper.requireNonNull(constants$1._unlink$MH,"_unlink"); - } - public static int _unlink ( Addressable x0) { - var mh$ = _unlink$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle tempnam$MH() { - return RuntimeHelper.requireNonNull(constants$2.tempnam$MH,"tempnam"); - } - public static MemoryAddress tempnam ( Addressable x0, Addressable x1) { - var mh$ = tempnam$MH(); - try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle rmtmp$MH() { - return RuntimeHelper.requireNonNull(constants$2.rmtmp$MH,"rmtmp"); - } - public static int rmtmp () { - var mh$ = rmtmp$MH(); - try { - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle unlink$MH() { - return RuntimeHelper.requireNonNull(constants$2.unlink$MH,"unlink"); - } - public static int unlink ( Addressable x0) { - var mh$ = unlink$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle setvbuf$MH() { - return RuntimeHelper.requireNonNull(constants$2.setvbuf$MH,"setvbuf"); - } - public static int setvbuf ( Addressable x0, Addressable x1, int x2, long x3) { - var mh$ = setvbuf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle setbuf$MH() { - return RuntimeHelper.requireNonNull(constants$2.setbuf$MH,"setbuf"); - } - public static void setbuf ( Addressable x0, Addressable x1) { - var mh$ = setbuf$MH(); - try { - mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __mingw_fprintf$MH() { - return RuntimeHelper.requireNonNull(constants$2.__mingw_fprintf$MH,"__mingw_fprintf"); - } - public static int __mingw_fprintf ( Addressable x0, Addressable x1, Object... x2) { - var mh$ = __mingw_fprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __mingw_printf$MH() { - return RuntimeHelper.requireNonNull(constants$3.__mingw_printf$MH,"__mingw_printf"); - } - public static int __mingw_printf ( Addressable x0, Object... x1) { - var mh$ = __mingw_printf$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __mingw_sprintf$MH() { - return RuntimeHelper.requireNonNull(constants$3.__mingw_sprintf$MH,"__mingw_sprintf"); - } - public static int __mingw_sprintf ( Addressable x0, Addressable x1, Object... x2) { - var mh$ = __mingw_sprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __mingw_snprintf$MH() { - return RuntimeHelper.requireNonNull(constants$3.__mingw_snprintf$MH,"__mingw_snprintf"); - } - public static int __mingw_snprintf ( Addressable x0, long x1, Addressable x2, Object... x3) { - var mh$ = __mingw_snprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __mingw_vfprintf$MH() { - return RuntimeHelper.requireNonNull(constants$3.__mingw_vfprintf$MH,"__mingw_vfprintf"); - } - public static int __mingw_vfprintf ( Addressable x0, Addressable x1, Addressable x2) { - var mh$ = __mingw_vfprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __mingw_vprintf$MH() { - return RuntimeHelper.requireNonNull(constants$3.__mingw_vprintf$MH,"__mingw_vprintf"); - } - public static int __mingw_vprintf ( Addressable x0, Addressable x1) { - var mh$ = __mingw_vprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __mingw_vsprintf$MH() { - return RuntimeHelper.requireNonNull(constants$3.__mingw_vsprintf$MH,"__mingw_vsprintf"); - } - public static int __mingw_vsprintf ( Addressable x0, Addressable x1, Addressable x2) { - var mh$ = __mingw_vsprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __mingw_vsnprintf$MH() { - return RuntimeHelper.requireNonNull(constants$4.__mingw_vsnprintf$MH,"__mingw_vsnprintf"); - } - public static int __mingw_vsnprintf ( Addressable x0, long x1, Addressable x2, Addressable x3) { - var mh$ = __mingw_vsnprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _mingw_output_format_control$MH() { - return RuntimeHelper.requireNonNull(constants$4._mingw_output_format_control$MH,"_mingw_output_format_control"); - } - public static int _mingw_output_format_control ( int x0, int x1) { - var mh$ = _mingw_output_format_control$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fprintf$MH() { - return RuntimeHelper.requireNonNull(constants$4.fprintf$MH,"fprintf"); - } - public static int fprintf ( Addressable x0, Addressable x1, Object... x2) { - var mh$ = fprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle printf$MH() { - return RuntimeHelper.requireNonNull(constants$4.printf$MH,"printf"); - } - public static int printf ( Addressable x0, Object... x1) { - var mh$ = printf$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle sprintf$MH() { - return RuntimeHelper.requireNonNull(constants$4.sprintf$MH,"sprintf"); - } - public static int sprintf ( Addressable x0, Addressable x1, Object... x2) { - var mh$ = sprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle vfprintf$MH() { - return RuntimeHelper.requireNonNull(constants$4.vfprintf$MH,"vfprintf"); - } - public static int vfprintf ( Addressable x0, Addressable x1, Addressable x2) { - var mh$ = vfprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle vprintf$MH() { - return RuntimeHelper.requireNonNull(constants$5.vprintf$MH,"vprintf"); - } - public static int vprintf ( Addressable x0, Addressable x1) { - var mh$ = vprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle vsprintf$MH() { - return RuntimeHelper.requireNonNull(constants$5.vsprintf$MH,"vsprintf"); - } - public static int vsprintf ( Addressable x0, Addressable x1, Addressable x2) { - var mh$ = vsprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __msvcrt_fprintf$MH() { - return RuntimeHelper.requireNonNull(constants$5.__msvcrt_fprintf$MH,"__msvcrt_fprintf"); - } - public static int __msvcrt_fprintf ( Addressable x0, Addressable x1, Object... x2) { - var mh$ = __msvcrt_fprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __msvcrt_printf$MH() { - return RuntimeHelper.requireNonNull(constants$5.__msvcrt_printf$MH,"__msvcrt_printf"); - } - public static int __msvcrt_printf ( Addressable x0, Object... x1) { - var mh$ = __msvcrt_printf$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __msvcrt_sprintf$MH() { - return RuntimeHelper.requireNonNull(constants$5.__msvcrt_sprintf$MH,"__msvcrt_sprintf"); - } - public static int __msvcrt_sprintf ( Addressable x0, Addressable x1, Object... x2) { - var mh$ = __msvcrt_sprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __msvcrt_vfprintf$MH() { - return RuntimeHelper.requireNonNull(constants$5.__msvcrt_vfprintf$MH,"__msvcrt_vfprintf"); - } - public static int __msvcrt_vfprintf ( Addressable x0, Addressable x1, Addressable x2) { - var mh$ = __msvcrt_vfprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __msvcrt_vprintf$MH() { - return RuntimeHelper.requireNonNull(constants$6.__msvcrt_vprintf$MH,"__msvcrt_vprintf"); - } - public static int __msvcrt_vprintf ( Addressable x0, Addressable x1) { - var mh$ = __msvcrt_vprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __msvcrt_vsprintf$MH() { - return RuntimeHelper.requireNonNull(constants$6.__msvcrt_vsprintf$MH,"__msvcrt_vsprintf"); - } - public static int __msvcrt_vsprintf ( Addressable x0, Addressable x1, Addressable x2) { - var mh$ = __msvcrt_vsprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _snprintf$MH() { - return RuntimeHelper.requireNonNull(constants$6._snprintf$MH,"_snprintf"); - } - public static int _snprintf ( Addressable x0, long x1, Addressable x2, Object... x3) { - var mh$ = _snprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _vsnprintf$MH() { - return RuntimeHelper.requireNonNull(constants$6._vsnprintf$MH,"_vsnprintf"); - } - public static int _vsnprintf ( Addressable x0, long x1, Addressable x2, Addressable x3) { - var mh$ = _vsnprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _vscprintf$MH() { - return RuntimeHelper.requireNonNull(constants$6._vscprintf$MH,"_vscprintf"); - } - public static int _vscprintf ( Addressable x0, Addressable x1) { - var mh$ = _vscprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle snprintf$MH() { - return RuntimeHelper.requireNonNull(constants$6.snprintf$MH,"snprintf"); - } - public static int snprintf ( Addressable x0, long x1, Addressable x2, Object... x3) { - var mh$ = snprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle vsnprintf$MH() { - return RuntimeHelper.requireNonNull(constants$7.vsnprintf$MH,"vsnprintf"); - } - public static int vsnprintf ( Addressable x0, long x1, Addressable x2, Addressable x3) { - var mh$ = vsnprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle vscanf$MH() { - return RuntimeHelper.requireNonNull(constants$7.vscanf$MH,"vscanf"); - } - public static int vscanf ( Addressable x0, Addressable x1) { - var mh$ = vscanf$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle vfscanf$MH() { - return RuntimeHelper.requireNonNull(constants$7.vfscanf$MH,"vfscanf"); - } - public static int vfscanf ( Addressable x0, Addressable x1, Addressable x2) { - var mh$ = vfscanf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle vsscanf$MH() { - return RuntimeHelper.requireNonNull(constants$7.vsscanf$MH,"vsscanf"); - } - public static int vsscanf ( Addressable x0, Addressable x1, Addressable x2) { - var mh$ = vsscanf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle getdelim$MH() { - return RuntimeHelper.requireNonNull(constants$7.getdelim$MH,"getdelim"); - } - public static int getdelim ( Addressable x0, Addressable x1, int x2, Addressable x3) { - var mh$ = getdelim$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle getline$MH() { - return RuntimeHelper.requireNonNull(constants$7.getline$MH,"getline"); - } - public static int getline ( Addressable x0, Addressable x1, Addressable x2) { - var mh$ = getline$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fscanf$MH() { - return RuntimeHelper.requireNonNull(constants$8.fscanf$MH,"fscanf"); - } - public static int fscanf ( Addressable x0, Addressable x1, Object... x2) { - var mh$ = fscanf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle scanf$MH() { - return RuntimeHelper.requireNonNull(constants$8.scanf$MH,"scanf"); - } - public static int scanf ( Addressable x0, Object... x1) { - var mh$ = scanf$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle sscanf$MH() { - return RuntimeHelper.requireNonNull(constants$8.sscanf$MH,"sscanf"); - } - public static int sscanf ( Addressable x0, Addressable x1, Object... x2) { - var mh$ = sscanf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fgetc$MH() { - return RuntimeHelper.requireNonNull(constants$8.fgetc$MH,"fgetc"); - } - public static int fgetc ( Addressable x0) { - var mh$ = fgetc$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fgets$MH() { - return RuntimeHelper.requireNonNull(constants$8.fgets$MH,"fgets"); - } - public static MemoryAddress fgets ( Addressable x0, int x1, Addressable x2) { - var mh$ = fgets$MH(); - try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fputc$MH() { - return RuntimeHelper.requireNonNull(constants$8.fputc$MH,"fputc"); - } - public static int fputc ( int x0, Addressable x1) { - var mh$ = fputc$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fputs$MH() { - return RuntimeHelper.requireNonNull(constants$9.fputs$MH,"fputs"); - } - public static int fputs ( Addressable x0, Addressable x1) { - var mh$ = fputs$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle gets$MH() { - return RuntimeHelper.requireNonNull(constants$9.gets$MH,"gets"); - } - public static MemoryAddress gets ( Addressable x0) { - var mh$ = gets$MH(); - try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle puts$MH() { - return RuntimeHelper.requireNonNull(constants$9.puts$MH,"puts"); - } - public static int puts ( Addressable x0) { - var mh$ = puts$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle ungetc$MH() { - return RuntimeHelper.requireNonNull(constants$9.ungetc$MH,"ungetc"); - } - public static int ungetc ( int x0, Addressable x1) { - var mh$ = ungetc$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _filbuf$MH() { - return RuntimeHelper.requireNonNull(constants$9._filbuf$MH,"_filbuf"); - } - public static int _filbuf ( Addressable x0) { - var mh$ = _filbuf$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _flsbuf$MH() { - return RuntimeHelper.requireNonNull(constants$9._flsbuf$MH,"_flsbuf"); - } - public static int _flsbuf ( int x0, Addressable x1) { - var mh$ = _flsbuf$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle getc$MH() { - return RuntimeHelper.requireNonNull(constants$10.getc$MH,"getc"); - } - public static int getc ( Addressable x0) { - var mh$ = getc$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle putc$MH() { - return RuntimeHelper.requireNonNull(constants$10.putc$MH,"putc"); - } - public static int putc ( int x0, Addressable x1) { - var mh$ = putc$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle getchar$MH() { - return RuntimeHelper.requireNonNull(constants$10.getchar$MH,"getchar"); - } - public static int getchar () { - var mh$ = getchar$MH(); - try { - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle putchar$MH() { - return RuntimeHelper.requireNonNull(constants$10.putchar$MH,"putchar"); - } - public static int putchar ( int x0) { - var mh$ = putchar$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fread$MH() { - return RuntimeHelper.requireNonNull(constants$10.fread$MH,"fread"); - } - public static long fread ( Addressable x0, long x1, long x2, Addressable x3) { - var mh$ = fread$MH(); - try { - return (long)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fwrite$MH() { - return RuntimeHelper.requireNonNull(constants$10.fwrite$MH,"fwrite"); - } - public static long fwrite ( Addressable x0, long x1, long x2, Addressable x3) { - var mh$ = fwrite$MH(); - try { - return (long)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fseek$MH() { - return RuntimeHelper.requireNonNull(constants$11.fseek$MH,"fseek"); - } - public static int fseek ( Addressable x0, int x1, int x2) { - var mh$ = fseek$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle ftell$MH() { - return RuntimeHelper.requireNonNull(constants$11.ftell$MH,"ftell"); - } - public static int ftell ( Addressable x0) { - var mh$ = ftell$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle rewind$MH() { - return RuntimeHelper.requireNonNull(constants$11.rewind$MH,"rewind"); - } - public static void rewind ( Addressable x0) { - var mh$ = rewind$MH(); - try { - mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static OfInt fpos_t = Constants$root.C_LONG$LAYOUT; - public static MethodHandle fgetpos$MH() { - return RuntimeHelper.requireNonNull(constants$11.fgetpos$MH,"fgetpos"); - } - public static int fgetpos ( Addressable x0, Addressable x1) { - var mh$ = fgetpos$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fsetpos$MH() { - return RuntimeHelper.requireNonNull(constants$11.fsetpos$MH,"fsetpos"); - } - public static int fsetpos ( Addressable x0, Addressable x1) { - var mh$ = fsetpos$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle feof$MH() { - return RuntimeHelper.requireNonNull(constants$11.feof$MH,"feof"); - } - public static int feof ( Addressable x0) { - var mh$ = feof$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle ferror$MH() { - return RuntimeHelper.requireNonNull(constants$12.ferror$MH,"ferror"); - } - public static int ferror ( Addressable x0) { - var mh$ = ferror$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle clearerr$MH() { - return RuntimeHelper.requireNonNull(constants$12.clearerr$MH,"clearerr"); - } - public static void clearerr ( Addressable x0) { - var mh$ = clearerr$MH(); - try { - mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle perror$MH() { - return RuntimeHelper.requireNonNull(constants$12.perror$MH,"perror"); - } - public static void perror ( Addressable x0) { - var mh$ = perror$MH(); - try { - mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _popen$MH() { - return RuntimeHelper.requireNonNull(constants$12._popen$MH,"_popen"); - } - public static MemoryAddress _popen ( Addressable x0, Addressable x1) { - var mh$ = _popen$MH(); - try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _pclose$MH() { - return RuntimeHelper.requireNonNull(constants$12._pclose$MH,"_pclose"); - } - public static int _pclose ( Addressable x0) { - var mh$ = _pclose$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle popen$MH() { - return RuntimeHelper.requireNonNull(constants$12.popen$MH,"popen"); - } - public static MemoryAddress popen ( Addressable x0, Addressable x1) { - var mh$ = popen$MH(); - try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle pclose$MH() { - return RuntimeHelper.requireNonNull(constants$13.pclose$MH,"pclose"); - } - public static int pclose ( Addressable x0) { - var mh$ = pclose$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _flushall$MH() { - return RuntimeHelper.requireNonNull(constants$13._flushall$MH,"_flushall"); - } - public static int _flushall () { - var mh$ = _flushall$MH(); - try { - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _fgetchar$MH() { - return RuntimeHelper.requireNonNull(constants$13._fgetchar$MH,"_fgetchar"); - } - public static int _fgetchar () { - var mh$ = _fgetchar$MH(); - try { - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _fputchar$MH() { - return RuntimeHelper.requireNonNull(constants$13._fputchar$MH,"_fputchar"); - } - public static int _fputchar ( int x0) { - var mh$ = _fputchar$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _fdopen$MH() { - return RuntimeHelper.requireNonNull(constants$13._fdopen$MH,"_fdopen"); - } - public static MemoryAddress _fdopen ( int x0, Addressable x1) { - var mh$ = _fdopen$MH(); - try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _fileno$MH() { - return RuntimeHelper.requireNonNull(constants$13._fileno$MH,"_fileno"); - } - public static int _fileno ( Addressable x0) { - var mh$ = _fileno$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _fcloseall$MH() { - return RuntimeHelper.requireNonNull(constants$14._fcloseall$MH,"_fcloseall"); - } - public static int _fcloseall () { - var mh$ = _fcloseall$MH(); - try { - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _fsopen$MH() { - return RuntimeHelper.requireNonNull(constants$14._fsopen$MH,"_fsopen"); - } - public static MemoryAddress _fsopen ( Addressable x0, Addressable x1, int x2) { - var mh$ = _fsopen$MH(); - try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __mingw_get_output_format$MH() { - return RuntimeHelper.requireNonNull(constants$14.__mingw_get_output_format$MH,"__mingw_get_output_format"); - } - public static int __mingw_get_output_format () { - var mh$ = __mingw_get_output_format$MH(); - try { - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __mingw_set_output_format$MH() { - return RuntimeHelper.requireNonNull(constants$14.__mingw_set_output_format$MH,"__mingw_set_output_format"); - } - public static int __mingw_set_output_format ( int x0) { - var mh$ = __mingw_set_output_format$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __mingw_get_printf_count_output$MH() { - return RuntimeHelper.requireNonNull(constants$14.__mingw_get_printf_count_output$MH,"__mingw_get_printf_count_output"); - } - public static int __mingw_get_printf_count_output () { - var mh$ = __mingw_get_printf_count_output$MH(); - try { - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle __mingw_set_printf_count_output$MH() { - return RuntimeHelper.requireNonNull(constants$14.__mingw_set_printf_count_output$MH,"__mingw_set_printf_count_output"); - } - public static int __mingw_set_printf_count_output ( int x0) { - var mh$ = __mingw_set_printf_count_output$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _get_output_format$MH() { - return RuntimeHelper.requireNonNull(constants$15._get_output_format$MH,"_get_output_format"); - } - public static int _get_output_format () { - var mh$ = _get_output_format$MH(); - try { - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _set_output_format$MH() { - return RuntimeHelper.requireNonNull(constants$15._set_output_format$MH,"_set_output_format"); - } - public static int _set_output_format ( int __style) { - var mh$ = _set_output_format$MH(); - try { - return (int)mh$.invokeExact(__style); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _get_printf_count_output$MH() { - return RuntimeHelper.requireNonNull(constants$15._get_printf_count_output$MH,"_get_printf_count_output"); - } - public static int _get_printf_count_output () { - var mh$ = _get_printf_count_output$MH(); - try { - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _set_printf_count_output$MH() { - return RuntimeHelper.requireNonNull(constants$15._set_printf_count_output$MH,"_set_printf_count_output"); - } - public static int _set_printf_count_output ( int __mode) { - var mh$ = _set_printf_count_output$MH(); - try { - return (int)mh$.invokeExact(__mode); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fgetchar$MH() { - return RuntimeHelper.requireNonNull(constants$15.fgetchar$MH,"fgetchar"); - } - public static int fgetchar () { - var mh$ = fgetchar$MH(); - try { - return (int)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fputchar$MH() { - return RuntimeHelper.requireNonNull(constants$15.fputchar$MH,"fputchar"); - } - public static int fputchar ( int x0) { - var mh$ = fputchar$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fdopen$MH() { - return RuntimeHelper.requireNonNull(constants$16.fdopen$MH,"fdopen"); - } - public static MemoryAddress fdopen ( int x0, Addressable x1) { - var mh$ = fdopen$MH(); - try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fileno$MH() { - return RuntimeHelper.requireNonNull(constants$16.fileno$MH,"fileno"); - } - public static int fileno ( Addressable x0) { - var mh$ = fileno$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fwprintf$MH() { - return RuntimeHelper.requireNonNull(constants$16.fwprintf$MH,"fwprintf"); - } - public static int fwprintf ( Addressable x0, Addressable x1, Object... x2) { - var mh$ = fwprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle wprintf$MH() { - return RuntimeHelper.requireNonNull(constants$16.wprintf$MH,"wprintf"); - } - public static int wprintf ( Addressable x0, Object... x1) { - var mh$ = wprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle vfwprintf$MH() { - return RuntimeHelper.requireNonNull(constants$16.vfwprintf$MH,"vfwprintf"); - } - public static int vfwprintf ( Addressable x0, Addressable x1, Addressable x2) { - var mh$ = vfwprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle vwprintf$MH() { - return RuntimeHelper.requireNonNull(constants$16.vwprintf$MH,"vwprintf"); - } - public static int vwprintf ( Addressable x0, Addressable x1) { - var mh$ = vwprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _snwprintf$MH() { - return RuntimeHelper.requireNonNull(constants$17._snwprintf$MH,"_snwprintf"); - } - public static int _snwprintf ( Addressable x0, long x1, Addressable x2, Object... x3) { - var mh$ = _snwprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _vscwprintf$MH() { - return RuntimeHelper.requireNonNull(constants$17._vscwprintf$MH,"_vscwprintf"); - } - public static int _vscwprintf ( Addressable x0, Addressable x1) { - var mh$ = _vscwprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _vsnwprintf$MH() { - return RuntimeHelper.requireNonNull(constants$17._vsnwprintf$MH,"_vsnwprintf"); - } - public static int _vsnwprintf ( Addressable x0, long x1, Addressable x2, Addressable x3) { - var mh$ = _vsnwprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fwscanf$MH() { - return RuntimeHelper.requireNonNull(constants$17.fwscanf$MH,"fwscanf"); - } - public static int fwscanf ( Addressable x0, Addressable x1, Object... x2) { - var mh$ = fwscanf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle wscanf$MH() { - return RuntimeHelper.requireNonNull(constants$17.wscanf$MH,"wscanf"); - } - public static int wscanf ( Addressable x0, Object... x1) { - var mh$ = wscanf$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle swscanf$MH() { - return RuntimeHelper.requireNonNull(constants$17.swscanf$MH,"swscanf"); - } - public static int swscanf ( Addressable x0, Addressable x1, Object... x2) { - var mh$ = swscanf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fgetwc$MH() { - return RuntimeHelper.requireNonNull(constants$18.fgetwc$MH,"fgetwc"); - } - public static short fgetwc ( Addressable x0) { - var mh$ = fgetwc$MH(); - try { - return (short)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fputwc$MH() { - return RuntimeHelper.requireNonNull(constants$18.fputwc$MH,"fputwc"); - } - public static short fputwc ( short x0, Addressable x1) { - var mh$ = fputwc$MH(); - try { - return (short)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle ungetwc$MH() { - return RuntimeHelper.requireNonNull(constants$18.ungetwc$MH,"ungetwc"); - } - public static short ungetwc ( short x0, Addressable x1) { - var mh$ = ungetwc$MH(); - try { - return (short)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle swprintf$MH() { - return RuntimeHelper.requireNonNull(constants$18.swprintf$MH,"swprintf"); - } - public static int swprintf ( Addressable x0, Addressable x1, Object... x2) { - var mh$ = swprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle vswprintf$MH() { - return RuntimeHelper.requireNonNull(constants$18.vswprintf$MH,"vswprintf"); - } - public static int vswprintf ( Addressable x0, Addressable x1, Addressable x2) { - var mh$ = vswprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle snwprintf$MH() { - return RuntimeHelper.requireNonNull(constants$18.snwprintf$MH,"snwprintf"); - } - public static int snwprintf ( Addressable x0, long x1, Addressable x2, Object... x3) { - var mh$ = snwprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle vsnwprintf$MH() { - return RuntimeHelper.requireNonNull(constants$19.vsnwprintf$MH,"vsnwprintf"); - } - public static int vsnwprintf ( Addressable x0, long x1, Addressable x2, Addressable x3) { - var mh$ = vsnwprintf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2, x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle vwscanf$MH() { - return RuntimeHelper.requireNonNull(constants$19.vwscanf$MH,"vwscanf"); - } - public static int vwscanf ( Addressable x0, Addressable x1) { - var mh$ = vwscanf$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle vfwscanf$MH() { - return RuntimeHelper.requireNonNull(constants$19.vfwscanf$MH,"vfwscanf"); - } - public static int vfwscanf ( Addressable x0, Addressable x1, Addressable x2) { - var mh$ = vfwscanf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle vswscanf$MH() { - return RuntimeHelper.requireNonNull(constants$19.vswscanf$MH,"vswscanf"); - } - public static int vswscanf ( Addressable x0, Addressable x1, Addressable x2) { - var mh$ = vswscanf$MH(); - try { - return (int)mh$.invokeExact(x0, x1, x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _fgetwchar$MH() { - return RuntimeHelper.requireNonNull(constants$19._fgetwchar$MH,"_fgetwchar"); - } - public static short _fgetwchar () { - var mh$ = _fgetwchar$MH(); - try { - return (short)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _fputwchar$MH() { - return RuntimeHelper.requireNonNull(constants$19._fputwchar$MH,"_fputwchar"); - } - public static short _fputwchar ( short x0) { - var mh$ = _fputwchar$MH(); - try { - return (short)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _getw$MH() { - return RuntimeHelper.requireNonNull(constants$20._getw$MH,"_getw"); - } - public static int _getw ( Addressable x0) { - var mh$ = _getw$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle _putw$MH() { - return RuntimeHelper.requireNonNull(constants$20._putw$MH,"_putw"); - } - public static int _putw ( int x0, Addressable x1) { - var mh$ = _putw$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fgetwchar$MH() { - return RuntimeHelper.requireNonNull(constants$20.fgetwchar$MH,"fgetwchar"); - } - public static short fgetwchar () { - var mh$ = fgetwchar$MH(); - try { - return (short)mh$.invokeExact(); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle fputwchar$MH() { - return RuntimeHelper.requireNonNull(constants$20.fputwchar$MH,"fputwchar"); - } - public static short fputwchar ( short x0) { - var mh$ = fputwchar$MH(); - try { - return (short)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle getw$MH() { - return RuntimeHelper.requireNonNull(constants$20.getw$MH,"getw"); - } - public static int getw ( Addressable x0) { - var mh$ = getw$MH(); - try { - return (int)mh$.invokeExact(x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static MethodHandle putw$MH() { - return RuntimeHelper.requireNonNull(constants$20.putw$MH,"putw"); - } - public static int putw ( int x0, Addressable x1) { - var mh$ = putw$MH(); - try { - return (int)mh$.invokeExact(x0, x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - } - public static int __MINGW32_VERSION() { - return (int)5000002L; - } - public static int __MSVCRT_VERSION__() { - return (int)1536L; - } - public static int __W32API_VERSION() { - return (int)5000002L; - } - public static int OSVERSION_MASK() { - return (int)4294901760L; - } - public static int NTDDI_WIN2K() { - return (int)83886080L; - } - public static int NTDDI_WIN2KSP1() { - return (int)83886336L; - } - public static int NTDDI_WIN2KSP2() { - return (int)83886592L; - } - public static int NTDDI_WIN2KSP3() { - return (int)83886848L; - } - public static int NTDDI_WIN2KSP4() { - return (int)83887104L; - } - public static int NTDDI_WINXP() { - return (int)83951616L; - } - public static int NTDDI_WINXPSP1() { - return (int)83951872L; - } - public static int NTDDI_WINXPSP2() { - return (int)83952128L; - } - public static int NTDDI_WINXPSP3() { - return (int)83952384L; - } - public static int NTDDI_WS03() { - return (int)84017152L; - } - public static int NTDDI_WS03SP1() { - return (int)84017408L; - } - public static int NTDDI_WS03SP2() { - return (int)84017664L; - } - public static int NTDDI_VISTA() { - return (int)100663296L; - } - public static int NTDDI_VISTASP1() { - return (int)100663552L; - } - public static int NTDDI_VISTASP2() { - return (int)100663808L; - } - public static int NTDDI_LONGHORN() { - return (int)100663296L; - } - public static int NTDDI_WIN6() { - return (int)100663296L; - } - public static int NTDDI_WIN6SP1() { - return (int)100663552L; - } - public static int NTDDI_WIN6SP2() { - return (int)100663808L; - } - public static int NTDDI_WS08() { - return (int)100663552L; - } - public static int NTDDI_WIN7() { - return (int)100728832L; - } - public static int NTDDI_WIN8() { - return (int)100794368L; - } - public static int NTDDI_WINBLUE() { - return (int)100859904L; - } - public static int _WIN32_WINNT() { - return (int)1280L; - } - public static int WINVER() { - return (int)1280L; - } - public static int NTDDI_VERSION() { - return (int)83886080L; - } - public static int Windows95() { - return (int)1024L; - } - public static int Windows98() { - return (int)1040L; - } - public static int WindowsME() { - return (int)1168L; - } - public static int WindowsNT4() { - return (int)1024L; - } - public static int Windows2000() { - return (int)1280L; - } - public static int WindowsXP() { - return (int)1281L; - } - public static int Windows2003() { - return (int)1282L; - } - public static int WindowsVista() { - return (int)1536L; - } - public static int IE3() { - return (int)768L; - } - public static int IE301() { - return (int)769L; - } - public static int IE302() { - return (int)770L; - } - public static int IE4() { - return (int)1024L; - } - public static int IE401() { - return (int)1025L; - } - public static int IE5() { - return (int)1280L; - } - public static int IE5a() { - return (int)1280L; - } - public static int IE5b() { - return (int)1280L; - } - public static int IE501() { - return (int)1281L; - } - public static int IE55() { - return (int)1360L; - } - public static int IE56() { - return (int)1376L; - } - public static int IE6() { - return (int)1536L; - } - public static int IE601() { - return (int)1537L; - } - public static int IE602() { - return (int)1539L; - } - public static int IE7() { - return (int)1792L; - } - public static byte __CRT_GLOB_ESCAPE_CHAR__() { - return (byte)127L; - } - public static long __MINGW_ANSI_STDIO__() { - return 1L; - } - public static long __MINGW_LC_EXTENSIONS__() { - return 80L; - } - public static long __MINGW_LC_MESSAGES__() { - return 16L; - } - public static long __MINGW_LC_ENVVARS__() { - return 64L; - } - public static int _POSIX_C_SOURCE() { - return (int)200809L; - } - public static MemoryAddress NULL() { - return constants$21.NULL$ADDR; - } - public static int EOF() { - return (int)-1L; - } - public static int FILENAME_MAX() { - return (int)260L; - } - public static int FOPEN_MAX() { - return (int)20L; - } - public static MemorySegment _P_tmpdir() { - return constants$21._P_tmpdir$SEGMENT; - } - public static MemorySegment P_tmpdir() { - return constants$21.P_tmpdir$SEGMENT; - } - public static MemorySegment _wP_tmpdir() { - return constants$21._wP_tmpdir$SEGMENT; - } - public static int L_tmpnam() { - return (int)16L; - } - public static int _MSVC_PRINTF_QUIRKS() { - return (int)256L; - } - public static int _QUERY_MSVC_PRINTF_QUIRKS() { - return (int)4294967295L; - } - public static int _DISABLE_MSVC_PRINTF_QUIRKS() { - return (int)4294967039L; - } - public static int _ENABLE_MSVC_PRINTF_QUIRKS() { - return (int)4294967295L; - } - public static int _EXPONENT_DIGIT_MASK() { - return (int)1L; - } -} - - From a6330243e7128b640440678ac35ff7fbe2d09eae Mon Sep 17 00:00:00 2001 From: exaucae Date: Fri, 24 Feb 2023 15:49:38 +0000 Subject: [PATCH 5/7] fix: set version properties --- java-panama/pom.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/java-panama/pom.xml b/java-panama/pom.xml index ad711d0718..8453a38abd 100644 --- a/java-panama/pom.xml +++ b/java-panama/pom.xml @@ -1,27 +1,30 @@ - 4.0.0 + ${project.model.version} com.baeldung.java.panama java-panama - 1.0-SNAPSHOT + ${project.version} jar java-panama https://maven.apache.org + 4.0.0 UTF-8 + 1.0 19 19 3.10.1 + 5.9.0 org.junit.jupiter junit-jupiter - 5.9.0 + ${junit.jupiter.version} test From c61004285c24ef0f24e2fe550266abe93c7349f0 Mon Sep 17 00:00:00 2001 From: exaucae Date: Mon, 27 Feb 2023 12:16:25 +0000 Subject: [PATCH 6/7] fix: use baeldung intellij formatter --- .../com/baeldung/java/panama/core/Greetings.java | 13 ++++++------- .../baeldung/java/panama/core/MemoryAllocation.java | 5 +---- .../com/baeldung/java/panama/core/MemoryLayout.java | 9 ++------- .../baeldung/java/panama/jextract/Greetings.java | 6 +++--- 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/java-panama/src/main/java/com/baeldung/java/panama/core/Greetings.java b/java-panama/src/main/java/com/baeldung/java/panama/core/Greetings.java index 7c210f1216..e6d596dbf0 100644 --- a/java-panama/src/main/java/com/baeldung/java/panama/core/Greetings.java +++ b/java-panama/src/main/java/com/baeldung/java/panama/core/Greetings.java @@ -5,7 +5,6 @@ import java.lang.invoke.MethodHandle; import static java.lang.foreign.ValueLayout.*; - public class Greetings { public static void main(String[] args) throws Throwable { @@ -20,14 +19,14 @@ public class Greetings { FunctionDescriptor descriptor = FunctionDescriptor.of(JAVA_INT, ADDRESS); MethodHandle methodHandle = loaderLookup.lookup(symbolName) - .or(() -> stdlibLookup.lookup(symbolName)) - .map(symbolSegment -> nativeLinker.downcallHandle(symbolSegment, descriptor)) - .orElse(null); + .or(() -> stdlibLookup.lookup(symbolName)) + .map(symbolSegment -> nativeLinker.downcallHandle(symbolSegment, descriptor)) + .orElse(null); - - if(methodHandle == null){ + if (methodHandle == null) { throw new NoSuchMethodError("Method Handle was not found"); - }; + } + ; try (MemorySession memorySession = MemorySession.openConfined()) { MemorySegment greetingSegment = memorySession.allocateUtf8String(greeting); diff --git a/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryAllocation.java b/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryAllocation.java index 710f1a1e87..557a0695cc 100644 --- a/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryAllocation.java +++ b/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryAllocation.java @@ -5,15 +5,12 @@ import java.lang.foreign.MemorySession; import java.lang.foreign.ValueLayout; import java.lang.foreign.SegmentAllocator; - - public class MemoryAllocation { public static void main(String[] args) throws Throwable { - try (MemorySession session = MemorySession.openConfined()) { - String[] greetingStrings = {"hello", "world", "panama", "baeldung"}; + String[] greetingStrings = { "hello", "world", "panama", "baeldung" }; SegmentAllocator allocator = SegmentAllocator.implicitAllocator(); MemorySegment offHeapSegment = allocator.allocateArray(ValueLayout.ADDRESS, greetingStrings.length); for (int i = 0; i < greetingStrings.length; i++) { diff --git a/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryLayout.java b/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryLayout.java index 620577f887..647247b54b 100644 --- a/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryLayout.java +++ b/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryLayout.java @@ -10,18 +10,13 @@ import static java.lang.foreign.MemoryLayout.sequenceLayout; import static java.lang.foreign.MemoryLayout.structLayout; import static java.lang.foreign.ValueLayout.*; - public class MemoryLayout { public static void main(String[] args) { - GroupLayout pointLayout = structLayout( - JAVA_DOUBLE.withName("x"), - JAVA_DOUBLE.withName("y") - ); + GroupLayout pointLayout = structLayout(JAVA_DOUBLE.withName("x"), JAVA_DOUBLE.withName("y")); - SequenceLayout ptsLayout = sequenceLayout(10, - pointLayout); + SequenceLayout ptsLayout = sequenceLayout(10, pointLayout); VarHandle xvarHandle = pointLayout.varHandle(PathElement.groupElement("x")); VarHandle yvarHandle = pointLayout.varHandle(PathElement.groupElement("y")); diff --git a/java-panama/src/main/java/com/baeldung/java/panama/jextract/Greetings.java b/java-panama/src/main/java/com/baeldung/java/panama/jextract/Greetings.java index 90d8e8f253..43b575d52a 100644 --- a/java-panama/src/main/java/com/baeldung/java/panama/jextract/Greetings.java +++ b/java-panama/src/main/java/com/baeldung/java/panama/jextract/Greetings.java @@ -2,7 +2,7 @@ package com.baeldung.java.panama.jextract; import java.lang.foreign.MemorySegment; import java.lang.foreign.MemorySession; -// Generate JExtract bingings before uncommenting +// Generate JExtract bindings before uncommenting // import static foreign.c.stdio_h.printf; public class Greetings { @@ -12,8 +12,8 @@ public class Greetings { try (MemorySession memorySession = MemorySession.openConfined()) { MemorySegment greetingSegment = memorySession.allocateUtf8String(greeting); - // Generate JExtract bingings before uncommenting - // printf(greetingSegment); + // Generate JExtract bingings before uncommenting + // printf(greetingSegment); } } } From b74bbc518c471b2545766120044c538f6aae51f9 Mon Sep 17 00:00:00 2001 From: exaucae Date: Mon, 27 Feb 2023 13:44:33 +0000 Subject: [PATCH 7/7] fix: correct imports --- .../com/baeldung/java/panama/core/Greetings.java | 12 ++++++++---- .../baeldung/java/panama/core/MemoryAllocation.java | 2 +- .../com/baeldung/java/panama/core/MemoryLayout.java | 10 ++++++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/java-panama/src/main/java/com/baeldung/java/panama/core/Greetings.java b/java-panama/src/main/java/com/baeldung/java/panama/core/Greetings.java index e6d596dbf0..1937bd65e9 100644 --- a/java-panama/src/main/java/com/baeldung/java/panama/core/Greetings.java +++ b/java-panama/src/main/java/com/baeldung/java/panama/core/Greetings.java @@ -1,9 +1,14 @@ package com.baeldung.java.panama.core; -import java.lang.foreign.*; -import java.lang.invoke.MethodHandle; +import static java.lang.foreign.ValueLayout.ADDRESS; +import static java.lang.foreign.ValueLayout.JAVA_INT; -import static java.lang.foreign.ValueLayout.*; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.Linker; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.MemorySession; +import java.lang.foreign.SymbolLookup; +import java.lang.invoke.MethodHandle; public class Greetings { @@ -26,7 +31,6 @@ public class Greetings { if (methodHandle == null) { throw new NoSuchMethodError("Method Handle was not found"); } - ; try (MemorySession memorySession = MemorySession.openConfined()) { MemorySegment greetingSegment = memorySession.allocateUtf8String(greeting); diff --git a/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryAllocation.java b/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryAllocation.java index 557a0695cc..239b25b69e 100644 --- a/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryAllocation.java +++ b/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryAllocation.java @@ -2,8 +2,8 @@ package com.baeldung.java.panama.core; import java.lang.foreign.MemorySegment; import java.lang.foreign.MemorySession; -import java.lang.foreign.ValueLayout; import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; public class MemoryAllocation { diff --git a/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryLayout.java b/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryLayout.java index 647247b54b..612997e35e 100644 --- a/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryLayout.java +++ b/java-panama/src/main/java/com/baeldung/java/panama/core/MemoryLayout.java @@ -1,15 +1,17 @@ package com.baeldung.java.panama.core; +import static java.lang.foreign.MemoryLayout.sequenceLayout; +import static java.lang.foreign.MemoryLayout.structLayout; +import static java.lang.foreign.ValueLayout.JAVA_DOUBLE; +import static java.lang.foreign.ValueLayout.JAVA_FLOAT; +import static java.lang.foreign.ValueLayout.PathElement; + import java.lang.foreign.GroupLayout; import java.lang.foreign.MemorySegment; import java.lang.foreign.MemorySession; import java.lang.foreign.SequenceLayout; import java.lang.invoke.VarHandle; -import static java.lang.foreign.MemoryLayout.sequenceLayout; -import static java.lang.foreign.MemoryLayout.structLayout; -import static java.lang.foreign.ValueLayout.*; - public class MemoryLayout { public static void main(String[] args) {