generated from Over-Run/project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
771 additions
and
218 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
// This file is auto-generated. DO NOT EDIT! | ||
package overrungl.gen; | ||
import java.lang.foreign.Linker; | ||
import java.lang.foreign.MemorySegment; | ||
import java.lang.foreign.ValueLayout; | ||
import java.lang.invoke.MethodHandles; | ||
import overrun.marshal.LayoutBuilder; | ||
import overrun.marshal.Unmarshal; | ||
import overrun.marshal.gen.CType; | ||
import overrun.marshal.gen.CanonicalType; | ||
import overrun.marshal.struct.Struct; | ||
import overrun.marshal.struct.StructAllocator; | ||
|
||
/// ## Members | ||
/// | ||
/// ### Int | ||
/// | ||
/// [Getter](#Int()) - [Setter](#Int(int)) | ||
/// | ||
/// ### Address | ||
/// | ||
/// [Getter](#Address()) - [Setter](#Address(java.lang.foreign.MemorySegment)) | ||
/// | ||
/// ### VoidPointer | ||
/// | ||
/// [Getter](#VoidPointer()) - [Setter](#VoidPointer(java.lang.foreign.MemorySegment)) | ||
/// | ||
/// A `void*` member. | ||
/// | ||
/// ### CInt | ||
/// | ||
/// [Getter](#CInt()) - [Setter](#CInt(int)) | ||
/// | ||
/// ### String | ||
/// | ||
/// [Getter](#String()) - [Setter](#String(java.lang.foreign.MemorySegment)) | ||
/// | ||
/// ### ConstCharPointer | ||
/// | ||
/// [Getter](#ConstCharPointer()) - [Setter](#ConstCharPointer(java.lang.foreign.MemorySegment)) | ||
/// | ||
/// A `const char*` member. | ||
/// | ||
/// ### SizeT | ||
/// | ||
/// [Getter](#SizeT()) - [Setter](#SizeT(long)) | ||
/// | ||
/// ## Layout | ||
/// | ||
/// ``` | ||
/// typedef struct mystruct { | ||
/// int Int; | ||
/// MemorySegment Address; | ||
/// void* VoidPointer; | ||
/// int CInt; | ||
/// String String; | ||
/// const char* ConstCharPointer; | ||
/// size_t SizeT; | ||
/// } MyStruct; | ||
/// ``` | ||
/// | ||
public interface MyStruct extends Struct<MyStruct> { | ||
/// The struct allocator. | ||
StructAllocator<MyStruct> OF = new StructAllocator<>(MethodHandles.lookup(), LayoutBuilder.struct() | ||
.add(ValueLayout.JAVA_INT, "Int") | ||
.add(ValueLayout.ADDRESS, "Address") | ||
.add(ValueLayout.ADDRESS, "VoidPointer") | ||
.add(ValueLayout.JAVA_INT, "CInt") | ||
.add(Unmarshal.STR_LAYOUT, "String") | ||
.add(Unmarshal.STR_LAYOUT, "ConstCharPointer") | ||
.add(Linker.nativeLinker().canonicalLayouts().get("size_t"), "SizeT") | ||
.build()); | ||
|
||
@Override | ||
MyStruct slice(long index, long count); | ||
|
||
@Override | ||
MyStruct slice(long index); | ||
|
||
/// {@return `Int`} | ||
int Int(); | ||
|
||
/// Sets `Int` with the given value. | ||
/// @param Int the value | ||
/// @return `this` | ||
MyStruct Int(int Int); | ||
|
||
/// {@return `Address`} | ||
MemorySegment Address(); | ||
|
||
/// Sets `Address` with the given value. | ||
/// @param Address the value | ||
/// @return `this` | ||
MyStruct Address(MemorySegment Address); | ||
|
||
/// {@return `VoidPointer`} | ||
@CType("void*") | ||
MemorySegment VoidPointer(); | ||
|
||
/// Sets `VoidPointer` with the given value. | ||
/// @param VoidPointer the value | ||
/// @return `this` | ||
MyStruct VoidPointer(@CType("void*") MemorySegment VoidPointer); | ||
|
||
/// {@return `CInt`} | ||
@CType("int") | ||
@CanonicalType("int") | ||
int CInt(); | ||
|
||
/// Sets `CInt` with the given value. | ||
/// @param CInt the value | ||
/// @return `this` | ||
MyStruct CInt(@CType("int") @CanonicalType("int") int CInt); | ||
|
||
/// {@return `String`} | ||
MemorySegment String(); | ||
|
||
/// Sets `String` with the given value. | ||
/// @param String the value | ||
/// @return `this` | ||
MyStruct String(MemorySegment String); | ||
|
||
/// {@return `ConstCharPointer`} | ||
@CType("const char*") | ||
MemorySegment ConstCharPointer(); | ||
|
||
/// Sets `ConstCharPointer` with the given value. | ||
/// @param ConstCharPointer the value | ||
/// @return `this` | ||
MyStruct ConstCharPointer(@CType("const char*") MemorySegment ConstCharPointer); | ||
|
||
/// {@return `SizeT`} | ||
@CType("size_t") | ||
@CanonicalType("size_t") | ||
long SizeT(); | ||
|
||
/// Sets `SizeT` with the given value. | ||
/// @param SizeT the value | ||
/// @return `this` | ||
MyStruct SizeT(@CType("size_t") @CanonicalType("size_t") long SizeT); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// This file is auto-generated. DO NOT EDIT! | ||
package overrungl.gen; | ||
import java.lang.foreign.MemorySegment; | ||
import java.lang.invoke.MethodHandles; | ||
import overrun.marshal.LayoutBuilder; | ||
import overrun.marshal.gen.CType; | ||
import overrun.marshal.struct.Struct; | ||
import overrun.marshal.struct.StructAllocator; | ||
import overrungl.gen.MyStruct; | ||
|
||
/// Javadoc | ||
/// | ||
/// ## Members | ||
/// | ||
/// ### MyStruct | ||
/// | ||
/// [Getter](#MyStruct()) - [Setter](#MyStruct(java.lang.foreign.MemorySegment)) | ||
/// | ||
/// ## Layout | ||
/// | ||
/// ``` | ||
/// typedef struct { | ||
/// mystruct MyStruct; | ||
/// } MyStruct2; | ||
/// ``` | ||
/// | ||
public interface MyStruct2 extends Struct<MyStruct2> { | ||
/// The struct allocator. | ||
StructAllocator<MyStruct2> OF = new StructAllocator<>(MethodHandles.lookup(), LayoutBuilder.struct() | ||
.add(MyStruct.OF.layout(), "MyStruct") | ||
.build()); | ||
|
||
@Override | ||
MyStruct2 slice(long index, long count); | ||
|
||
@Override | ||
MyStruct2 slice(long index); | ||
|
||
/// {@return `MyStruct`} | ||
@CType("mystruct") | ||
MemorySegment MyStruct(); | ||
|
||
/// Sets `MyStruct` with the given value. | ||
/// @param MyStruct the value | ||
/// @return `this` | ||
MyStruct2 MyStruct(@CType("mystruct") MemorySegment MyStruct); | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
generated/src/main/java/overrungl/gen/MyStructRegistration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// This file is auto-generated. DO NOT EDIT! | ||
package overrungl.gen; | ||
import static overrun.marshal.gen.processor.ProcessorTypes.registerStruct; | ||
final class MyStructRegistration { | ||
private MyStructRegistration() { } | ||
static void registerAll() { | ||
registerStruct(MyStruct.class, MyStruct.OF); | ||
registerStruct(MyStruct2.class, MyStruct2.OF); | ||
} | ||
} |
Oops, something went wrong.