v1 complete

This commit is contained in:
neuecc 2023-03-07 05:00:14 +09:00
parent 3344361ea2
commit 6e723f4a86
59 changed files with 9122 additions and 407 deletions

10
.gitignore vendored
View File

@ -4,5 +4,13 @@
.vs/ .vs/
dotnet-sandbox/obj/ dotnet-sandbox/obj/
dotnet-sandbox/bin/ dotnet-sandbox/bin/
unity-sandbox/obj/
unity-sandbox/bin/
unity-sandbox/Temp/
unity-sandbox/*.csproj
unity-sandbox/*.csproj.user
unity-sandbox/*.sln
unity-sandbox/Library
csbindgen/cargo
unity-sandbox/Logs/

775
README.md
View File

@ -3,101 +3,28 @@
Generate C# FFI from Rust for automatically brings native code and C native library to .NET and Unity. Generate C# FFI from Rust for automatically brings native code and C native library to .NET and Unity.
Automatically generates C# `DllImport` code from Rust `extern "C" fn` code. Whereas DllImport defaults to the Windows calling convention and requires a lot of configuration for C calls, csbindgen generates code optimized for "Cdecl" calls. Also .NET and Unity have different callback invocation methods (.NET uses function pointers, while Unity uses MonoPInvokeCallback), but you can output code for either by configuration.
When used with Rust's excellent C integration, you can also bring C libraries into C#.
There are usually many pains involved in using the C Library with C#. Not only is it difficult to create bindings, but cross-platform builds are very difficult. In this day and age, you have to build for multiple platforms and architectures, windows, osx, linux, android, ios, each with x64, x86, arm. There are usually many pains involved in using the C Library with C#. Not only is it difficult to create bindings, but cross-platform builds are very difficult. In this day and age, you have to build for multiple platforms and architectures, windows, osx, linux, android, ios, each with x64, x86, arm.
[Rust](https://www.rust-lang.org/) has an excellent toolchain for cross-platform builds, as well as [cc crate](https://crates.io/crates/cc), [cmake crate](https://crates.io/crates/cmake) allow C source code to be integrated into the build. And [rust-bindgen](https://crates.io/crates/bindgen), which generates bindings from `.h`, is highly functional and very stable. [Rust](https://www.rust-lang.org/) has an excellent toolchain for cross-platform builds, as well as [cc crate](https://crates.io/crates/cc), [cmake crate](https://crates.io/crates/cmake) allow C source code to be integrated into the build. And [rust-bindgen](https://crates.io/crates/bindgen), which generates bindings from `.h`, is highly functional and very stable.
csbindgen can easily bring native C libraries into C# through Rust. csbindgen generates Rust extern code and C# DllImport code to work with C# from code generated from C by bindgen. With cc crate or cmake crate, C code is linked to the single rust native library. csbindgen can easily bring native C libraries into C# through Rust. csbindgen generates Rust extern code and C# DllImport code to work with C# from code generated from C by bindgen. With cc crate or cmake crate, C code is linked to the single rust native library.
Of course, you can also output pure FFI Rust code (or a wrapper layer to make it easier to bring C, C++ libraries into C#) to C#.
Getting Started Getting Started
--- ---
Install on `Cargo.toml` as `build-dependencies` and set up `bindgen::Builder` on `build.rs`. Install on `Cargo.toml` as `build-dependencies` and set up `bindgen::Builder` on `build.rs`.
```toml ```toml
[build-dependencies] [build-dependencies]
csbindgen = "0.1.1" csbindgen = "1.0.0"
```
### C (to Rust) to C#
For example, build [lz4](https://github.com/lz4/lz4) compression library.
```rust
// using bindgen, generate binding code
bindgen::Builder::default()
.header("c/lz4/lz4.h")
.generate().unwrap()
.write_to_file("lz4.rs").unwrap();
// using cc, build and link c code
cc::Build::new().file("lz4.c").compile("lz4");
// csbindgen code, generate both rust ffi and C# dll import
csbindgen::Builder::default()
.input_bindgen_file("lz4.rs") // read from bindgen generated code
.csharp_dll_name("liblz4")
.generate_to_file("lz4_ffi.rs", "../dotnet/NativeMethods.lz4.g.cs")
.unwrap();
```
It will generates like these code.
```rust
// lz4_ffi.rs
#[allow(unused)]
use ::std::os::raw::*;
use super::lz4;
#[no_mangle]
pub extern "C" fn csbindgen_LZ4_compress_default(src: *const c_char, dst: *mut c_char, srcSize: c_int, dstCapacity: c_int) -> c_int
{
unsafe {
return lz4::LZ4_compress_default(src, dst, srcSize, dstCapacity);
}
}
```
```csharp
// NativeMethods.lz4.g.cs
using System;
using System.Runtime.InteropServices;
namespace CsBindgen
{
internal static unsafe partial class NativeMethods
{
const string __DllName = "liblz4";
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4_compress_default", CallingConvention = CallingConvention.Cdecl)]
public static extern int LZ4_compress_default(byte* src, byte* dst, int srcSize, int dstCapacity);
}
}
```
Finally import generated module on `lib.rs`.
```rust
// lib.rs, import generated codes.
#[allow(dead_code)]
#[allow(non_snake_case)]
#[allow(non_camel_case_types)]
#[allow(non_upper_case_globals)]
mod lz4;
#[allow(dead_code)]
#[allow(non_snake_case)]
#[allow(non_camel_case_types)]
mod lz4_ffi;
``` ```
### Rust to C#. ### Rust to C#.
You can bring simple Rust FFI code to C#. You can bring Rust FFI code to C#.
```rust ```rust
// lib.rs, simple FFI code // lib.rs, simple FFI code
@ -136,47 +63,104 @@ namespace CsBindgen
} }
``` ```
Builder options(configure template) ### C (to Rust) to C#
---
`input_bindgen_file` -> setup options -> `generate_to_file` to use C to C# workflow. Here are full option guide. For example, build [lz4](https://github.com/lz4/lz4) compression library.
```rust ```rust
// using bindgen, generate binding code
bindgen::Builder::default()
.header("c/lz4/lz4.h")
.generate().unwrap()
.write_to_file("lz4.rs").unwrap();
// using cc, build and link c code
cc::Build::new().file("lz4.c").compile("lz4");
// csbindgen code, generate both rust ffi and C# dll import
csbindgen::Builder::default() csbindgen::Builder::default()
.input_bindgen_file("src/lz4.rs") .input_bindgen_file("lz4.rs") // read from bindgen generated code
.method_filter(|x| { x.starts_with("LZ4") } ) .csharp_dll_name("liblz4")
.rust_method_prefix("csbindgen_") .generate_to_file("lz4_ffi.rs", "../dotnet/NativeMethods.lz4.g.cs")
.rust_file_header("use super::lz4;")
.rust_method_type_path("lz4")
.csharp_class_name("LibLz4")
.csharp_class_accessibility("public")
.csharp_namespace("CsBindgen")
.csharp_dll_name("csbindgen_tests")
.csharp_dll_name_if("UNITY_IOS && !UNITY_EDITOR", "__Internal")
.csharp_entry_point_prefix("csbindgen_")
.csharp_method_prefix("")
.csharp_c_long_convert("int")
.csharp_c_ulong_convert("uint")
.generate_to_file("src/lz4_ffi.rs", "../dotnet-sandbox/lz4_bindgen.cs")
.unwrap(); .unwrap();
``` ```
It will be embedded in the placeholder of the output file. It will generates like these code.
```rust ```rust
// lz4_ffi.rs
#[allow(unused)] #[allow(unused)]
use ::std::os::raw::*; use ::std::os::raw::*;
{rust_file_header} use super::lz4;
#[no_mangle] #[no_mangle]
pub extern "C" fn {rust_method_prefix}LZ4_versionNumber() -> c_int pub unsafe extern "C" fn csbindgen_LZ4_compress_default(src: *const c_char, dst: *mut c_char, srcSize: c_int, dstCapacity: c_int) -> c_int
{ {
unsafe { lz4::LZ4_compress_default(src, dst, srcSize, dstCapacity)
return {rust_method_type_path}::LZ4_versionNumber() }
```
```csharp
// NativeMethods.lz4.g.cs
using System;
using System.Runtime.InteropServices;
namespace CsBindgen
{
internal static unsafe partial class NativeMethods
{
const string __DllName = "liblz4";
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4_compress_default", CallingConvention = CallingConvention.Cdecl)]
public static extern int LZ4_compress_default(byte* src, byte* dst, int srcSize, int dstCapacity);
} }
} }
``` ```
Finally import generated module on `lib.rs`.
```rust
// lib.rs, import generated codes.
#[allow(dead_code)]
#[allow(non_snake_case)]
#[allow(non_camel_case_types)]
#[allow(non_upper_case_globals)]
mod lz4;
#[allow(dead_code)]
#[allow(non_snake_case)]
#[allow(non_camel_case_types)]
mod lz4_ffi;
```
## Builder options(configure template)
### Builder options: Rust to C#
Rust to C#, use the `input_extern_file` -> setup options -> `generate_csharp_file`.
```rust
csbindgen::Builder::default()
.input_extern_file("src/lib.rs") // required
.csharp_dll_name("mynativelib") // required
.csharp_class_name("NativeMethods") // optional, default: NativeMethods
.csharp_namespace("CsBindgen") // optional, default: CsBindgen
.csharp_class_accessibility("internal") // optional, default: internal
.csharp_entry_point_prefix("") // optional, default: ""
.csharp_method_prefix("") // optional, default: ""
.csharp_use_function_pointer(true) // optional, default: true
.csharp_dll_name_if("UNITY_IOS && !UNITY_EDITOR", "__Internal") // optional, default: ""
.generate_csharp_file("../dotnet-sandbox/NativeMethods.cs") // required
.unwrap();
```
`csharp_*` configuration will be embedded in the placeholder of the output file.
```csharp ```csharp
using System; using System;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
@ -197,14 +181,86 @@ namespace {csharp_namespace}
} }
``` ```
`csharp_dll_name_if` is optional. If specified, `#if` allows two DllName to be specified, which is useful if the name must be `__Internal` at iOS build.
### Unity Callback
`csharp_use_function_pointer` configures how generate function pointer. The default is to generate a `delegate*`, but Unity does not support it; setting it to `false` will generate a `Func/Action` that can be used with `MonoPInvokeCallback`.
```csharp
// true(default) generates delegate*
[DllImport(__DllName, EntryPoint = "callback_test", CallingConvention = CallingConvention.Cdecl)]
public static extern int callback_test(delegate* unmanaged[Cdecl]<int, int> cb);
// You can define like this callback method.
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvCdecl) })]
static int Method(int x) => x * x;
// And use it.
callback_test(&Method);
// ---
// false will generates Action/Func, it is useful for Unity
[DllImport(__DllName, EntryPoint = "callback_test", CallingConvention = CallingConvention.Cdecl)]
public static extern int callback_test(Func<int, int> cb);
// Unity can define callback method as MonoPInvokeCallback
[MonoPInvokeCallback(typeof(Func<int, int>))]
static int Method(int x) => x * x;
// And use it.
callback_test(Method);
```
### Builder options: C (to Rust) to C#
`input_bindgen_file` -> setup options -> `generate_to_file` to use C to C# workflow.
```rust
csbindgen::Builder::default()
.input_bindgen_file("src/lz4.rs") // required
.method_filter(|x| { x.starts_with("LZ4") } ) // optional, default: |x| !x.starts_with('_')
.rust_method_prefix("csbindgen_") // optional, default: "csbindgen_"
.rust_file_header("use super::lz4;") // optional, default: ""
.rust_method_type_path("lz4") // optional, default: ""
.csharp_dll_name("lz4") // required
.csharp_class_name("NativeMethods") // optional, default: NativeMethods
.csharp_namespace("CsBindgen") // optional, default: CsBindgen
.csharp_class_accessibility("internal") // optional, default: internal
.csharp_entry_point_prefix("csbindgen_") // required, you must set same as rust_method_prefix
.csharp_method_prefix("") // optional, default: ""
.csharp_use_function_pointer(true) // optional, default: true
.csharp_dll_name_if("UNITY_IOS && !UNITY_EDITOR", "__Internal") // optional, default: ""
.generate_to_file("src/lz4_ffi.rs", "../dotnet-sandbox/lz4_bindgen.cs") // required
.unwrap();
```
It will be embedded in the placeholder of the output file.
```rust
#[allow(unused)]
use ::std::os::raw::*;
{rust_file_header}
#[no_mangle]
pub unsafe extern "C" fn {rust_method_prefix}LZ4_versionNumber() -> c_int
{
{rust_method_type_path}::LZ4_versionNumber()
}
```
`csharp_*` option template is same as Rust to C#, see above documentation.
Adjust `rust_file_header` and `rust_method_type_path` to match your module configuration. Adjust `rust_file_header` and `rust_method_type_path` to match your module configuration.
`method_filter` allows you to specify which methods to exclude; if unspecified, methods prefixed with `_` are excluded by default. `method_filter` allows you to specify which methods to exclude; if unspecified, methods prefixed with `_` are excluded by default. C libraries are usually published with a specific prefix. For example, [LZ4](https://github.com/lz4/lz4) is `LZ4`, [ZStandard](https://github.com/facebook/zstd) is `ZSTD_`, [quiche](https://github.com/cloudflare/quiche) is `quiche_`, [Bullet Physics SDK](https://github.com/bulletphysics/bullet3) is `b3`.
`rust_method_prefix` and `csharp_method_prefix` or `csharp_entry_point_prefix` must be adjusted to match the method name to be called. `rust_method_prefix` and `csharp_method_prefix` or `csharp_entry_point_prefix` must be adjusted to match the method name to be called.
`csharp_dll_name_if` is optional. If specified, `#if` allows two DllName to be specified, which is useful if the name must be `__Internal` at iOS build. Library Loading
---
If the file path to be loaded needs to be changed depending on the operating system, the following load code can be used. If the file path to be loaded needs to be changed depending on the operating system, the following load code can be used.
```csharp ```csharp
@ -214,7 +270,6 @@ internal static unsafe partial class NativeMethods
// Library path will search // Library path will search
// win => __DllName, __DllName.dll // win => __DllName, __DllName.dll
// linux, osx => __DllName.so, __DllName.dylib // linux, osx => __DllName.so, __DllName.dylib
// __DllName
static NativeMethods() static NativeMethods()
{ {
@ -263,22 +318,508 @@ internal static unsafe partial class NativeMethods
} }
``` ```
`csharp_c_long_convert` and `csharp_c_ulong_convert` configure how handles `c_long` and `c_ulong` to C# type. default is to `int` and `uint` because `LLP64` is 32bit representation but you can change it to 64bit or use [CLong](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.clong)/CULong struct after .NET 6. If Unity, configure Platform settings in each native library's inspector.
## Builder options: Rust to C#
Rust to C# is similar workflow as C to C#, use the `input_extern_file` -> setup options -> `generate_csharp_file`. Type Marshalling
---
Rust types will map these C# types.
```rust | Rust | C# |
csbindgen::Builder::default() | ---- | -- |
.input_extern_file("src/lib.rs") | `c_char` | `byte` |
.csharp_class_name("LibRust") | `c_schar` | `sbyte` |
.csharp_dll_name("csbindgen_tests") | `c_uchar` | `byte` |
.generate_csharp_file("../dotnet-sandbox/NativeMethods.cs") | `c_short` | `short` |
.unwrap(); | `c_ushort` | `ushort` |
| `c_int` | `int` |
| `c_uint` | `uint` |
| `c_long` | `CLong` |
| `c_ulong` | `CULong` |
| `c_longlong` | `long` |
| `c_ulonglong` | `ulong` |
| `c_float` | `float` |
| `c_double` | `double` |
| `c_void` | `void` |
| `CString` | `sbyte` |
| `i8` | `sbyte` |
| `i16` | `short` |
| `i32` | `int` |
| `i64` | `long` |
| `i128` | `Int128` |
| `isize` | `nint` |
| `u8` | `byte` |
| `u16` | `ushort` |
| `u32` | `uint` |
| `u64` | `ulong` |
| `u128` | `UInt128` |
| `f32` | `float` |
| `f64` | `double` |
| `bool` | `[MarshalAs(UnmanagedType.U1)]bool` |
| `usize` | `nuint` |
| `()` | `void` |
| `#[repr(C)]Struct` | `[StructLayout(LayoutKind.Sequential)]Struct` |
| `#[repr(C)]Union` | `[StructLayout(LayoutKind.Explicit)]Struct` |
| `#[repr(u*/i*)]Enum` | `Enum` |
| `extern "C" fn` | `delegate* unmanaged[Cdecl]<>` or `Func<>/Action<>` |
| `Option<extern "C" fn>` | `delegate* unmanaged[Cdecl]<>` or `Func<>/Action<>` |
| `*mut T` | `T*` |
| `*const T` | `T*` |
| `*mut *mut T` | `T**` |
| `*const *const T` | `T**` |
csbindgen is designed to return primitives that do not cause marshalling. It is better to convert from pointers to Span yourself than to do the conversion implicitly and in a black box. This is a recent trend, such as the addition of [DisableRuntimeMarshalling](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.disableruntimemarshallingattribute) from .NET 7.
`c_long` and `c_ulong` will convert to [CLong](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.clong), [CULong](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.culong) struct after .NET 6. If you want to convert in Unity, you will need Shim.
```csharp
// Currently Unity is .NET Standard 2.1 so does not exist CLong and CULong
namespace System.Runtime.InteropServices
{
internal struct CLong
{
public int Value; // #if Windows = int, Unix x32 = int, Unix x64 = long
}
internal struct CULong
{
public uint Value; // #if Windows = uint, Unix x32 = uint, Unix x64 = ulong
}
}
``` ```
`generate_csharp_file` does not generate Rust file so no need to use `rust_` option. ### Struct
csbindgen supports `Struct`, you can define `#[repr(C)]` struct on method parameter or return value.
```rust
// If you define this struct...
#[repr(C)]
pub struct MyVector3 {
pub x: f32,
pub y: f32,
pub z: f32,
}
#[no_mangle]
pub extern "C" fn pass_vector3(v3: MyVector3) {
println!("{}, {}, {}", v3.x, v3.y, v3.z);
}
```
```csharp
// csbindgen generates this C# struct
[StructLayout(LayoutKind.Sequential)]
internal unsafe partial struct MyVector3
{
public float x;
public float y;
public float z;
}
```
### Union
`Union` will generate `[FieldOffset(0)]` struct.
```rust
#[repr(C)]
pub union MyUnion {
pub foo: i32,
pub bar: i64,
}
#[no_mangle]
pub extern "C" fn return_union() -> MyUnion {
MyUnion { bar: 53 }
}
```
```csharp
[StructLayout(LayoutKind.Explicit)]
internal unsafe partial struct MyUnion
{
[FieldOffset(0)]
public int foo;
[FieldOffset(0)]
public long bar;
}
```
### Enum
`#[repr(i*)]` or `#[repr(u*)]` defined `Enum` is supported.
```rust
#[repr(u8)]
pub enum ByteEnum {
A = 1,
B = 2,
C = 10,
}
```
```csharp
internal enum ByteTest : byte
{
A = 1,
B = 2,
C = 10,
}
```
### Function
You can receive, return function to/from C#.
```rust
#[no_mangle]
pub extern "C" fn csharp_to_rust(cb: extern "C" fn(x: i32, y: i32) -> i32) {
let sum = cb(10, 20); // invoke C# method
println!("{sum}");
}
#[no_mangle]
pub extern "C" fn rust_to_csharp() -> extern fn(x: i32, y: i32) -> i32 {
sum // return rust method
}
extern "C" fn sum(x:i32, y:i32) -> i32 {
x + y
}
```
In default, csbindgen generates `extern "C" fn` as `delegate* unmanaged[Cdecl]<>`.
```csharp
[DllImport(__DllName, EntryPoint = "csharp_to_rust", CallingConvention = CallingConvention.Cdecl)]
public static extern void csharp_to_rust(delegate* unmanaged[Cdecl]<int, int, int> cb);
[DllImport(__DllName, EntryPoint = "rust_to_csharp", CallingConvention = CallingConvention.Cdecl)]
public static extern delegate* unmanaged[Cdecl]<int, int, int> rust_to_csharp();
```
It can use in C# like this.
```csharp
// C# -> Rust, pass static UnmanagedCallersOnly method with `&`
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvCdecl) })]
static int Sum(int x, int y) => x + y;
NativeMethods.csharp_to_rust(&Sum);
// Rust -> C#, get typed delegate*
var f = NativeMethods.rust_to_csharp();
var v = f(20, 30);
Console.WriteLine(v); // 50
```
> Unity can not use C# 9.0 function pointer, csbindgen has to use `MonoPInvokeCallback` options. see: [Unity Callback](#unity-callback) section.
Rust FFI suppots `Option<fn>`, it can receive null pointer.
```rust
#[no_mangle]
pub extern "C" fn nullable_callback_test(cb: Option<extern "C" fn(a: i32) -> i32>) -> i32 {
match cb {
Some(f) => f(100),
None => -1,
}
}
```
```csharp
var v = NativeMethods.nullable_callback_test(null); // -1
```
### Pointer
Allocated Rust memory in heap can send to C# via pointer and `Box::into_raw` and `Box::from_raw`.
```rust
#[no_mangle]
pub extern "C" fn create_context() -> *mut Context {
let ctx = Box::new(Context { foo: true });
Box::into_raw(ctx)
}
#[no_mangle]
pub extern "C" fn delete_context(context: *mut Context) {
unsafe { Box::from_raw(context) };
}
#[repr(C)]
pub struct Context {
pub foo: bool,
pub bar: i32,
pub baz: u64
}
```
```csharp
var context = LibRust.create_context();
// do anything...
LibRust.delete_context(context);
```
You can also pass memory allocated by C# to Rust (use `fixed` or `GCHandle.Alloc(Pinned)`). The important thing is that memory allocated in Rust must release in Rust and memory allocated in C# must release in C#.
If you want to pass a non FFI Safe struct, cast it to `*mut c_void`. Then C# will treat it as a `void*`. csbindgen does not support Opaque Type.
```rust
#[no_mangle]
pub extern "C" fn create_counter_context() -> *mut c_void {
let ctx = Box::new(CounterContext {
set: HashSet::new(),
});
Box::into_raw(ctx) as *mut c_void
}
#[no_mangle]
pub unsafe extern "C" fn insert_counter_context(context: *mut c_void, value: i32) {
let mut counter = Box::from_raw(context as *mut CounterContext);
counter.set.insert(value);
Box::into_raw(counter);
}
#[no_mangle]
pub unsafe extern "C" fn delete_counter_context(context: *mut c_void) {
let counter = Box::from_raw(context as *mut CounterContext);
for value in counter.set.iter() {
println!("counter value: {}", value)
}
}
#[repr(C)]
pub struct CounterContext {
pub set: HashSet<i32>,
}
```
```csharp
// in C#, ctx = void*
var ctx = LibRust.create_counter_context();
LibRust.insert_counter_context(ctx, 10);
LibRust.insert_counter_context(ctx, 20);
LibRust.delete_counter_context(ctx);
```
### String and Array(Span)
Rust's String, Array(Vec) and C#'s String, Array is different thing. Since it cannot be shared, pass it with a pointer and handle it with slice(Span) or materialize it if necessary.
`CString` is null-terminated string. It can send by `*mut c_char` and received as `byte*` in C#.
```rust
#[no_mangle]
pub extern "C" fn alloc_c_string() -> *mut c_char {
let str = CString::new("foo bar baz").unwrap();
str.into_raw()
}
#[no_mangle]
pub unsafe extern "C" fn free_c_string(str: *mut c_char) {
unsafe { CString::from_raw(str) };
}
```
```csharp
// null-terminated `byte*` or sbyte* can materialize by new String()
var cString = NativeMethods.alloc_c_string();
var str = new String((sbyte*)cString);
NativeMethods.free_c_string(cString);
```
Rust's String is UTF-8(`Vec<u8>`) but C# String is UTF-16. Andalso, `Vec<>` can not send to C# so require to convert pointer and control memory manually. Here is the buffer manager for FFI.
```rust
#[repr(C)]
pub struct ByteBuffer {
ptr: *mut u8,
length: i32,
capacity: i32,
}
impl ByteBuffer {
pub fn len(&self) -> usize {
self.length
.try_into()
.expect("buffer length negative or overflowed")
}
pub fn from_vec(bytes: Vec<u8>) -> Self {
let length = i32::try_from(bytes.len()).expect("buffer length cannot fit into a i32.");
let capacity =
i32::try_from(bytes.capacity()).expect("buffer capacity cannot fit into a i32.");
// keep memory until call delete
let mut v = std::mem::ManuallyDrop::new(bytes);
Self {
ptr: v.as_mut_ptr(),
length,
capacity,
}
}
pub fn from_vec_struct<T: Sized>(bytes: Vec<T>) -> Self {
let element_size = std::mem::size_of::<T>() as i32;
let length = (bytes.len() as i32) * element_size;
let capacity = (bytes.capacity() as i32) * element_size;
let mut v = std::mem::ManuallyDrop::new(bytes);
Self {
ptr: v.as_mut_ptr() as *mut u8,
length,
capacity,
}
}
pub fn destroy_into_vec(self) -> Vec<u8> {
if self.ptr.is_null() {
vec![]
} else {
let capacity: usize = self
.capacity
.try_into()
.expect("buffer capacity negative or overflowed");
let length: usize = self
.length
.try_into()
.expect("buffer length negative or overflowed");
unsafe { Vec::from_raw_parts(self.ptr, length, capacity) }
}
}
pub fn destroy_into_vec_struct<T: Sized>(self) -> Vec<T> {
if self.ptr.is_null() {
vec![]
} else {
let element_size = std::mem::size_of::<T>() as i32;
let length = (self.length * element_size) as usize;
let capacity = (self.capacity * element_size) as usize;
unsafe { Vec::from_raw_parts(self.ptr as *mut T, length, capacity) }
}
}
pub fn destroy(self) {
drop(self.destroy_into_vec());
}
}
```
```csharp
// C# side span utility
partial struct ByteBuffer
{
public unsafe Span<byte> AsSpan()
{
return new Span<byte>(ptr, length);
}
public unsafe Span<T> AsSpan<T>()
{
return MemoryMarshal.CreateSpan(ref Unsafe.AsRef<T>(ptr), length / Unsafe.SizeOf<T>());
}
}
```
With `ByteBuffer`, you can send `Vec<>` to C#. the pattern for `String`, `Vec<u8>`, `Vec<i32>`, Rust -> C# is as follows.
```rust
#[no_mangle]
pub extern "C" fn alloc_u8_string() -> *mut ByteBuffer {
let str = format!("foo bar baz");
let buf = ByteBuffer::from_vec(str.into_bytes());
Box::into_raw(Box::new(buf))
}
#[no_mangle]
pub unsafe extern "C" fn free_u8_string(buffer: *mut ByteBuffer) {
let buf = Box::from_raw(buffer);
// drop inner buffer, if you need String, use String::from_utf8_unchecked(buf.destroy_into_vec()) instead.
buf.destroy();
}
#[no_mangle]
pub extern "C" fn alloc_u8_buffer() -> *mut ByteBuffer {
let vec: Vec<u8> = vec![1, 10, 100];
let buf = ByteBuffer::from_vec(vec);
Box::into_raw(Box::new(buf))
}
#[no_mangle]
pub unsafe extern "C" fn free_u8_buffer(buffer: *mut ByteBuffer) {
let buf = Box::from_raw(buffer);
// drop inner buffer, if you need Vec<u8>, use buf.destroy_into_vec() instead.
buf.destroy();
}
#[no_mangle]
pub extern "C" fn alloc_i32_buffer() -> *mut ByteBuffer {
let vec: Vec<i32> = vec![1, 10, 100, 1000, 10000];
let buf = ByteBuffer::from_vec_struct(vec);
Box::into_raw(Box::new(buf))
}
#[no_mangle]
pub unsafe extern "C" fn free_i32_buffer(buffer: *mut ByteBuffer) {
let buf = Box::from_raw(buffer);
// drop inner buffer, if you need Vec<i32>, use buf.destroy_into_vec_struct::<i32>() instead.
buf.destroy();
}
```
```csharp
var u8String = NativeMethods.alloc_u8_string();
var u8Buffer = NativeMethods.alloc_u8_buffer();
var i32Buffer = NativeMethods.alloc_i32_buffer();
try
{
var str = Encoding.UTF8.GetString(u8String->AsSpan());
Console.WriteLine(str);
Console.WriteLine("----");
var buffer = u8Buffer->AsSpan();
foreach (var item in buffer)
{
Console.WriteLine(item);
}
Console.WriteLine("----");
var i32Span = i32Buffer->AsSpan<int>();
foreach (var item in i32Span)
{
Console.WriteLine(item);
}
}
finally
{
NativeMethods.free_u8_string(u8String);
NativeMethods.free_u8_buffer(u8Buffer);
NativeMethods.free_i32_buffer(i32Buffer);
}
```
C# to Rust would be a bit simpler to send, just pass byte* and length. In Rust, use `std::slice::from_raw_parts` to create slice. Again, the important thing is that memory allocated in Rust must release in Rust and memory allocated in C# must release in C#.
Build Tracing
---
csbindgen silently skips over any method with a non-generatable type. If you build with `cargo build -vv`, you will get thse message if not geneated.
* `csbindgen can't handle this parameter type so ignore generate, method_name: {} parameter_name: {}`
* `csbindgen can't handle this return type so ignore generate, method_name: {}`
License License
--- ---

View File

@ -21,24 +21,24 @@ fn main() -> Result<(), Box<dyn Error>> {
]) ])
.compile("lz4"); .compile("lz4");
bindgen::Builder::default() // bindgen::Builder::default()
.header("c/zstd/zstd.h") // .header("c/zstd/zstd.h")
.generate()? // .generate()?
.write_to_file("src/zstd.rs")?; // .write_to_file("src/zstd.rs")?;
bindgen::Builder::default() // bindgen::Builder::default()
.header("c/quiche/quiche.h") // .header("c/quiche/quiche.h")
.generate()? // .generate()?
.write_to_file("src/quiche.rs")?; // .write_to_file("src/quiche.rs")?;
bindgen::Builder::default() // bindgen::Builder::default()
.header("c/bullet3/PhysicsClientC_API.h") // .header("c/bullet3/PhysicsClientC_API.h")
.header("c/bullet3/PhysicsClientSharedMemory_C_API.h") // .header("c/bullet3/PhysicsClientSharedMemory_C_API.h")
.header("c/bullet3/PhysicsClientSharedMemory2_C_API.h") // .header("c/bullet3/PhysicsClientSharedMemory2_C_API.h")
.header("c/bullet3/PhysicsDirectC_API.h") // .header("c/bullet3/PhysicsDirectC_API.h")
.header("c/bullet3/SharedMemoryPublic.h") // .header("c/bullet3/SharedMemoryPublic.h")
.generate()? // .generate()?
.write_to_file("src/bullet3.rs")?; // .write_to_file("src/bullet3.rs")?;
csbindgen::Builder::default() csbindgen::Builder::default()
.input_bindgen_file("src/lz4.rs") .input_bindgen_file("src/lz4.rs")
@ -53,8 +53,9 @@ fn main() -> Result<(), Box<dyn Error>> {
.csharp_entry_point_prefix("csbindgen_") .csharp_entry_point_prefix("csbindgen_")
.csharp_method_prefix("") .csharp_method_prefix("")
.csharp_class_accessibility("public") .csharp_class_accessibility("public")
.csharp_c_long_convert("int") //.csharp_c_long_convert("int")
.csharp_c_ulong_convert("uint") //.csharp_c_ulong_convert("uint")
// .csharp_use_function_pointer(true)
.generate_to_file("src/lz4_ffi.rs", "../dotnet-sandbox/lz4_bindgen.cs") .generate_to_file("src/lz4_ffi.rs", "../dotnet-sandbox/lz4_bindgen.cs")
.unwrap(); .unwrap();
@ -62,32 +63,33 @@ fn main() -> Result<(), Box<dyn Error>> {
.input_extern_file("src/lib.rs") .input_extern_file("src/lib.rs")
.csharp_class_name("LibRust") .csharp_class_name("LibRust")
.csharp_dll_name("csbindgen_tests") .csharp_dll_name("csbindgen_tests")
.csharp_use_function_pointer(true)
.generate_csharp_file("../dotnet-sandbox/method_call.cs") .generate_csharp_file("../dotnet-sandbox/method_call.cs")
.unwrap(); .unwrap();
csbindgen::Builder::new() // csbindgen::Builder::new()
.input_bindgen_file("src/zstd.rs") // .input_bindgen_file("src/zstd.rs")
.method_filter(|x| x.starts_with("ZSTD_")) // .method_filter(|x| x.starts_with("ZSTD_"))
.rust_method_prefix("csbindgen_zstd_") // .rust_method_prefix("csbindgen_zstd_")
.csharp_class_name("LibZstd") // .csharp_class_name("LibZstd")
.csharp_dll_name("libzsd") // .csharp_dll_name("libzsd")
.generate_to_file("src/zstd_ffi.rs", "../dotnet-sandbox/zstd_bindgen.cs")?; // .generate_to_file("src/zstd_ffi.rs", "../dotnet-sandbox/zstd_bindgen.cs")?;
csbindgen::Builder::new() // csbindgen::Builder::new()
.input_bindgen_file("src/quiche.rs") // .input_bindgen_file("src/quiche.rs")
.method_filter(|x| x.starts_with("quiche_")) // .method_filter(|x| x.starts_with("quiche_"))
.rust_method_prefix("csbindgen_quiche_") // .rust_method_prefix("csbindgen_quiche_")
.csharp_class_name("LibQuiche") // .csharp_class_name("LibQuiche")
.csharp_dll_name("libquiche") // .csharp_dll_name("libquiche")
.generate_to_file("src/quiche_ffi.rs", "../dotnet-sandbox/quiche_bindgen.cs")?; // .generate_to_file("src/quiche_ffi.rs", "../dotnet-sandbox/quiche_bindgen.cs")?;
csbindgen::Builder::new() // csbindgen::Builder::new()
.input_bindgen_file("src/bullet3.rs") // .input_bindgen_file("src/bullet3.rs")
.method_filter(|x| x.starts_with("b3")) // .method_filter(|x| x.starts_with("b3"))
.rust_method_prefix("csbindgen_bullet3_") // .rust_method_prefix("csbindgen_bullet3_")
.csharp_class_name("LibBullet3") // .csharp_class_name("LibBullet3")
.csharp_dll_name("libbullet3") // .csharp_dll_name("libbullet3")
.generate_to_file("src/bullet3_ffi.rs", "../dotnet-sandbox/bullet3_bindgen.cs")?; // .generate_to_file("src/bullet3_ffi.rs", "../dotnet-sandbox/bullet3_bindgen.cs")?;
Ok(()) Ok(())
} }

View File

@ -1,6 +1,6 @@
use std::{ use std::{
collections::HashSet, collections::HashSet,
ffi::{c_char, c_void, CString}, ffi::{c_char, c_long, c_ulong, c_void, CString},
}; };
#[allow(dead_code)] #[allow(dead_code)]
@ -39,6 +39,24 @@ pub extern "C" fn callback_test(cb: extern "C" fn(a: i32) -> i32) -> i32 {
cb(100) cb(100)
} }
#[no_mangle]
pub extern "C" fn csharp_to_rust(cb: extern "C" fn(x: i32, y: i32) -> i32) {
let sum = cb(10, 20); // invoke C# method
println!("{sum}");
}
#[no_mangle]
pub extern "C" fn rust_to_csharp() -> extern fn(x: i32, y: i32) -> i32 {
sum // return rust method
}
extern "C" fn sum(x:i32, y:i32) -> i32 {
x + y
}
#[no_mangle]
pub extern "C" fn cbt(_cb: CallbackTable) {}
#[no_mangle] #[no_mangle]
pub extern "C" fn nullable_callback_test(cb: Option<extern "C" fn(a: i32) -> i32>) -> i32 { pub extern "C" fn nullable_callback_test(cb: Option<extern "C" fn(a: i32) -> i32>) -> i32 {
match cb { match cb {
@ -47,6 +65,9 @@ pub extern "C" fn nullable_callback_test(cb: Option<extern "C" fn(a: i32) -> i32
} }
} }
#[no_mangle]
pub extern "C" fn types_iroiro(_i: isize, _u: usize, _cl: c_long, _cul: c_ulong) {}
#[no_mangle] #[no_mangle]
pub extern "C" fn callback_test2() -> extern "C" fn(a: i32) -> i32 { pub extern "C" fn callback_test2() -> extern "C" fn(a: i32) -> i32 {
callback callback
@ -61,7 +82,7 @@ pub extern "C" fn enum_test(i: IntEnumTest) -> i32 {
i as i32 i as i32
} }
#[repr(u8)] #[repr(i8)]
pub enum IntEnumTest { pub enum IntEnumTest {
A = 1, A = 1,
B = 2, B = 2,
@ -108,6 +129,29 @@ pub unsafe extern "C" fn delete_counter_context(context: *mut c_void) {
} }
} }
#[no_mangle]
pub extern "C" fn pass_vector3(v3: MyVector3) {
println!("{}, {}, {}", v3.x, v3.y, v3.z);
}
#[no_mangle]
pub extern "C" fn return_union() -> MyUnion {
MyUnion { bar: 53 }
}
#[repr(C)]
pub union MyUnion {
pub foo: i32,
pub bar: i64,
}
#[repr(C)]
pub struct MyVector3 {
pub x: f32,
pub y: f32,
pub z: f32,
}
#[repr(C)] #[repr(C)]
pub struct CounterContext { pub struct CounterContext {
pub set: HashSet<i32>, pub set: HashSet<i32>,
@ -138,7 +182,7 @@ pub extern "C" fn alloc_c_string() -> *mut c_char {
} }
#[no_mangle] #[no_mangle]
pub extern "C" fn free_c_string(str: *mut c_char) { pub unsafe extern "C" fn free_c_string(str: *mut c_char) {
unsafe { CString::from_raw(str) }; unsafe { CString::from_raw(str) };
} }
@ -330,6 +374,8 @@ impl ByteBuffer {
} }
} }
trait Ex {} #[repr(C)]
pub struct CallbackTable {
impl Ex for i32 {} pub foo: extern "C" fn(),
pub foobar: extern "C" fn(i: i32) -> i32,
}

View File

@ -26,7 +26,7 @@ impl AliasMap {
// currently multiple pointer alias not supported, only one layer. // currently multiple pointer alias not supported, only one layer.
if let TypeKind::Pointer(_) = &x.type_kind { if let TypeKind::Pointer(_) = &x.type_kind {
return Some(RustType { return Some(RustType {
type_name: x2.type_name.clone(), type_name: x2.type_name,
type_kind: x.type_kind.clone(), type_kind: x.type_kind.clone(),
}); });
} }

View File

@ -24,10 +24,9 @@ pub struct BindgenOptions {
pub csharp_class_accessibility: String, pub csharp_class_accessibility: String,
pub csharp_entry_point_prefix: String, pub csharp_entry_point_prefix: String,
pub csharp_method_prefix: String, pub csharp_method_prefix: String,
pub csharp_c_long_convert: String,
pub csharp_c_ulong_convert: String,
pub csharp_if_symbol: String, pub csharp_if_symbol: String,
pub csharp_if_dll_name: String, pub csharp_if_dll_name: String,
pub csharp_use_function_pointer: bool,
} }
impl Default for Builder { impl Default for Builder {
@ -46,10 +45,9 @@ impl Default for Builder {
csharp_entry_point_prefix: "".to_string(), csharp_entry_point_prefix: "".to_string(),
csharp_method_prefix: "".to_string(), csharp_method_prefix: "".to_string(),
csharp_class_accessibility: "internal".to_string(), csharp_class_accessibility: "internal".to_string(),
csharp_c_long_convert: "int".to_string(),
csharp_c_ulong_convert: "uint".to_string(),
csharp_if_symbol: "".to_string(), csharp_if_symbol: "".to_string(),
csharp_if_dll_name: "".to_string(), csharp_if_dll_name: "".to_string(),
csharp_use_function_pointer: true
}, },
} }
} }
@ -144,26 +142,20 @@ impl Builder {
self self
} }
/// configure c_long to {csharp_c_long_convert} type, /// configure add C# dll name if directive,
/// default is `int`. /// #if {if_symbol} __DllName = {if_dll_name}
pub fn csharp_c_long_convert<T: Into<String>>(mut self, csharp_c_long_convert: T) -> Builder {
self.options.csharp_c_long_convert = csharp_c_long_convert.into();
self
}
/// configure c_ulong to {csharp_c_ulong_convert} type,
/// default is `uint`.
pub fn csharp_c_ulong_convert<T: Into<String>>(mut self, csharp_c_ulong_convert: T) -> Builder {
self.options.csharp_c_ulong_convert = csharp_c_ulong_convert.into();
self
}
pub fn csharp_dll_name_if<T: Into<String>>(mut self, if_symbol: T, if_dll_name: T) -> Builder { pub fn csharp_dll_name_if<T: Into<String>>(mut self, if_symbol: T, if_dll_name: T) -> Builder {
self.options.csharp_if_symbol = if_symbol.into(); self.options.csharp_if_symbol = if_symbol.into();
self.options.csharp_if_dll_name = if_dll_name.into(); self.options.csharp_if_dll_name = if_dll_name.into();
self self
} }
/// conifure C# generate function pointer as delegate* or Func/Action, default is true(generate delegate*)
pub fn csharp_use_function_pointer(mut self, csharp_use_function_pointer: bool) -> Builder {
self.options.csharp_use_function_pointer = csharp_use_function_pointer;
self
}
pub fn generate_csharp_file<P: AsRef<Path>>( pub fn generate_csharp_file<P: AsRef<Path>>(
&self, &self,
csharp_output_path: P, csharp_output_path: P,

View File

@ -113,7 +113,7 @@ pub fn emit_csharp(
x => format!("{x}{method_name}"), x => format!("{x}{method_name}"),
}; };
let return_type = match &item.return_type { let return_type = match &item.return_type {
Some(x) => x.to_csharp_string(options, aliases), Some(x) => x.to_csharp_string(options, aliases, false),
None => "void".to_string(), None => "void".to_string(),
}; };
@ -121,7 +121,7 @@ pub fn emit_csharp(
.parameters .parameters
.iter() .iter()
.map(|p| { .map(|p| {
let mut type_name = p.rust_type.to_csharp_string(options, aliases); let mut type_name = p.rust_type.to_csharp_string(options, aliases, false);
if type_name == "bool" { if type_name == "bool" {
type_name = "[MarshalAs(UnmanagedType.U1)] bool".to_string(); type_name = "[MarshalAs(UnmanagedType.U1)] bool".to_string();
} }
@ -132,7 +132,8 @@ pub fn emit_csharp(
.join(", "); .join(", ");
if let Some(x) = item.escape_doc_comment() { if let Some(x) = item.escape_doc_comment() {
method_list_string.push_str_ln(format!(" /// <summary>{}</summary>", x).as_str()); method_list_string
.push_str_ln(format!(" /// <summary>{}</summary>", x).as_str());
} }
method_list_string.push_str_ln( method_list_string.push_str_ln(
@ -166,7 +167,7 @@ pub fn emit_csharp(
structs_string.push_str_ln(" [FieldOffset(0)]"); structs_string.push_str_ln(" [FieldOffset(0)]");
} }
let type_name = field.rust_type.to_csharp_string(options, aliases); let type_name = field.rust_type.to_csharp_string(options, aliases, true);
let attr = if type_name == "bool" { let attr = if type_name == "bool" {
"[MarshalAs(UnmanagedType.U1)] ".to_string() "[MarshalAs(UnmanagedType.U1)] ".to_string()
} else { } else {
@ -236,16 +237,16 @@ namespace {namespace}
result result
} }
fn convert_token_enum_repr(repr: &String) -> String { fn convert_token_enum_repr(repr: &str) -> &str {
match repr.as_str() { match repr {
"(u8)" => "byte".to_string(), "(u8)" => "byte",
"(u16)" => "ushort".to_string(), "(u16)" => "ushort",
"(u32)" => "uint".to_string(), "(u32)" => "uint",
"(u64)" => "ulong".to_string(), "(u64)" => "ulong",
"(i8)" => "sbyte".to_string(), "(i8)" => "sbyte",
"(i16)" => "short".to_string(), "(i16)" => "short",
"(i32)" => "int".to_string(), "(i32)" => "int",
"(i64)" => "long".to_string(), "(i64)" => "long",
x => x.to_string(), x => x,
} }
} }

View File

@ -75,18 +75,18 @@ pub(crate) fn generate(
Ok((rust, csharp)) Ok((rust, csharp))
} }
#[test] // #[test]
fn test() { // fn test() {
let path = std::env::current_dir().unwrap(); // let path = std::env::current_dir().unwrap();
println!("starting dir: {}", path.display()); // csbindgen/csbindgen // println!("starting dir: {}", path.display()); // csbindgen/csbindgen
Builder::new() // Builder::new()
.input_bindgen_file("csbindgen-tests/src/lz4.rs") // .input_bindgen_file("csbindgen-tests/src/lz4.rs")
.csharp_class_name("LibLz4") // .csharp_class_name("LibLz4")
.csharp_dll_name("csbindgen_tests") // .csharp_dll_name("csbindgen_tests")
.generate_to_file( // .generate_to_file(
"csbindgen-tests/src/lz4_ffi.rs", // "csbindgen-tests/src/lz4_ffi.rs",
"dotnet-sandbox/lz4_bindgen.cs", // "dotnet-sandbox/lz4_bindgen.cs",
) // )
.unwrap(); // .unwrap();
} // }

View File

@ -31,7 +31,7 @@ pub fn collect_extern_method(ast: &syn::File, options: &BindgenOptions) -> Vec<E
for item in ast.items.iter() { for item in ast.items.iter() {
if let Item::Fn(m) = item { if let Item::Fn(m) = item {
if let Some(_) = &m.sig.abi { if m.sig.abi.is_some() {
// has extern // has extern
let method = parse_method(FnItem::Item(m.clone()), options); let method = parse_method(FnItem::Item(m.clone()), options);
if let Some(x) = method { if let Some(x) = method {
@ -66,7 +66,7 @@ fn parse_method(item: FnItem, options: &BindgenOptions) -> Option<ExternMethod>
let rust_type = parse_type(&t.ty); let rust_type = parse_type(&t.ty);
if rust_type.type_name.is_empty() { if rust_type.type_name.is_empty() {
println!("Csbindgen can't handle this parameter type so ignore generate, method_name: {} parameter_name: {}", method_name, parameter_name); println!("csbindgen can't handle this parameter type so ignore generate, method_name: {} parameter_name: {}", method_name, parameter_name);
return None; return None;
} }
@ -82,7 +82,7 @@ fn parse_method(item: FnItem, options: &BindgenOptions) -> Option<ExternMethod>
let rust_type = parse_type(b); let rust_type = parse_type(b);
if rust_type.type_name.is_empty() { if rust_type.type_name.is_empty() {
println!( println!(
"Csbindgen can't handle this return type so ignore generate, method_name: {}", "csbindgen can't handle this return type so ignore generate, method_name: {}",
method_name method_name
); );
return None; return None;
@ -95,7 +95,7 @@ fn parse_method(item: FnItem, options: &BindgenOptions) -> Option<ExternMethod>
let mut doc_comment = None; let mut doc_comment = None;
for attr in attrs { for attr in attrs {
let last_segment = attr.path.segments.last().unwrap(); let last_segment = attr.path.segments.last().unwrap();
if last_segment.ident.to_string() == "doc" { if last_segment.ident == "doc" {
doc_comment = Some(attr.tokens.to_string()); doc_comment = Some(attr.tokens.to_string());
} }
} }
@ -193,7 +193,7 @@ pub fn collect_enum(ast: &syn::File) -> Vec<RustEnum> {
let mut repr = None; let mut repr = None;
for attr in &t.attrs { for attr in &t.attrs {
let last_segment = attr.path.segments.last().unwrap(); let last_segment = attr.path.segments.last().unwrap();
if last_segment.ident.to_string() == "repr" { if last_segment.ident == "repr" {
repr = Some(attr.tokens.to_string()); repr = Some(attr.tokens.to_string());
} }
} }
@ -204,13 +204,11 @@ pub fn collect_enum(ast: &syn::File) -> Vec<RustEnum> {
for v in &t.variants { for v in &t.variants {
let name = v.ident.to_string(); let name = v.ident.to_string();
let mut value = None; let mut value = None;
if let Some((_, expr)) = &v.discriminant { if let Some((_, syn::Expr::Lit(x))) = &v.discriminant {
if let syn::Expr::Lit(x) = expr { if let syn::Lit::Int(x) = &x.lit {
if let syn::Lit::Int(x) = &x.lit { let digits = x.base10_digits().to_string();
let digits = x.base10_digits().to_string(); value = Some(digits);
value = Some(digits); }
}
};
} }
fields.push((name, value)); fields.push((name, value));
@ -289,15 +287,13 @@ fn parse_type(t: &syn::Type) -> RustType {
let last_segment = t.path.segments.last().unwrap(); let last_segment = t.path.segments.last().unwrap();
if let syn::PathArguments::AngleBracketed(x) = &last_segment.arguments { if let syn::PathArguments::AngleBracketed(x) = &last_segment.arguments {
// generics, only supports Option<> for null function pointer // generics, only supports Option<> for null function pointer
if last_segment.ident.to_string() == "Option" { if last_segment.ident == "Option" {
if let Some(x) = x.args.first() { if let Some(syn::GenericArgument::Type(t)) = x.args.first() {
if let syn::GenericArgument::Type(t) = x { let rust_type = parse_type(t);
let rust_type = parse_type(t); return RustType {
return RustType { type_name: "Option".to_string(),
type_name: "Option".to_string(), type_kind: TypeKind::Option(Box::new(rust_type)),
type_kind: TypeKind::Option(Box::new(rust_type)), };
};
}
} }
} }
} else { } else {

View File

@ -1,4 +1,4 @@
use crate::{builder::BindgenOptions, alias_map::AliasMap}; use crate::{alias_map::AliasMap, builder::BindgenOptions};
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub struct Parameter { pub struct Parameter {
@ -176,8 +176,9 @@ impl RustType {
&self, &self,
options: &BindgenOptions, options: &BindgenOptions,
alias_map: &AliasMap, alias_map: &AliasMap,
emit_from_struct: bool,
) -> String { ) -> String {
fn convert_type_name(type_name: &str, options: &BindgenOptions) -> String { fn convert_type_name(type_name: &str) -> &str {
let name = match type_name { let name = match type_name {
// std::os::raw https://doc.rust-lang.org/std/os/raw/index.html // std::os::raw https://doc.rust-lang.org/std/os/raw/index.html
// std::ffi::raw https://doc.rust-lang.org/core/ffi/index.html // std::ffi::raw https://doc.rust-lang.org/core/ffi/index.html
@ -188,8 +189,8 @@ impl RustType {
"c_ushort" => "ushort", "c_ushort" => "ushort",
"c_int" => "int", "c_int" => "int",
"c_uint" => "uint", "c_uint" => "uint",
"c_long" => &options.csharp_c_long_convert, "c_long" => "CLong", // .NET 6
"c_ulong" => &options.csharp_c_ulong_convert, "c_ulong" => "CULong", // .NET 6
"c_longlong" => "long", "c_longlong" => "long",
"c_ulonglong" => "ulong", "c_ulonglong" => "ulong",
"c_float" => "float", "c_float" => "float",
@ -202,7 +203,7 @@ impl RustType {
"i32" => "int", "i32" => "int",
"i64" => "long", "i64" => "long",
"i128" => "Int128", // .NET 7 "i128" => "Int128", // .NET 7
"isize" => "IntPtr", "isize" => "nint", // C# 9.0
"u8" => "byte", "u8" => "byte",
"u16" => "ushort", "u16" => "ushort",
"u32" => "uint", "u32" => "uint",
@ -211,11 +212,11 @@ impl RustType {
"f32" => "float", "f32" => "float",
"f64" => "double", "f64" => "double",
"bool" => "bool", "bool" => "bool",
"usize" => "UIntPtr", "usize" => "nuint", // C# 9.0
"()" => "void", "()" => "void",
_ => type_name, // as is _ => type_name, // as is
}; };
name.to_string() name
} }
// resolve alias // resolve alias
@ -230,39 +231,78 @@ impl RustType {
TypeKind::FixedArray(_, _) => { TypeKind::FixedArray(_, _) => {
sb.push_str("fixed "); sb.push_str("fixed ");
let type_name = convert_type_name(use_type.type_name.as_str(), options); let type_name = convert_type_name(use_type.type_name.as_str());
let type_name = match type_name.as_str() { let type_name = match type_name {
// C# fixed allow types // C# fixed allow types
"bool" | "byte" | "short" | "int" | "long" | "char" | "sbyte" | "ushort" "bool" | "byte" | "short" | "int" | "long" | "char" | "sbyte" | "ushort"
| "uint" | "ulong" | "float" | "double" => type_name, | "uint" | "ulong" | "float" | "double" => type_name.to_owned(),
_ => format!("byte/* {}, this length is invalid so must keep pointer and can't edit from C# */", type_name) _ => format!("byte/* {}, this length is invalid so must keep pointer and can't edit from C# */", type_name)
}; };
sb.push_str(type_name.as_str()); sb.push_str(type_name.as_str());
} }
TypeKind::Function(parameters, return_type) => { TypeKind::Function(parameters, return_type) => {
sb.push_str("delegate* unmanaged[Cdecl]"); if emit_from_struct && !options.csharp_use_function_pointer {
sb.push('<'); sb.push_str("void*");
for p in parameters { } else if options.csharp_use_function_pointer {
sb.push_str(&p.rust_type.to_csharp_string(options, alias_map)); sb.push_str("delegate* unmanaged[Cdecl]");
sb.push_str(", "); sb.push('<');
for p in parameters {
sb.push_str(&p.rust_type.to_csharp_string(
options,
alias_map,
emit_from_struct,
));
sb.push_str(", ");
}
match return_type {
Some(x) => {
sb.push_str(&x.to_csharp_string(options, alias_map, emit_from_struct));
}
None => {
sb.push_str("void");
}
};
sb.push('>');
} else {
if return_type.is_some() {
sb.push_str("Func<")
} else {
sb.push_str("Action<")
}
let joined_param = parameters
.iter()
.map(|p| {
p.rust_type
.to_csharp_string(options, alias_map, emit_from_struct)
})
.collect::<Vec<_>>()
.join(", ");
sb.push_str(joined_param.as_str());
match return_type {
Some(x) => {
if !parameters.is_empty() {
sb.push_str(", ");
}
sb.push_str(&x.to_csharp_string(options, alias_map, emit_from_struct));
}
None => {}
};
sb.push('>');
} }
match return_type {
Some(x) => {
sb.push_str(&x.to_csharp_string(options, alias_map));
}
None => {
sb.push_str("void");
}
};
sb.push('>');
} }
TypeKind::Option(inner) => { TypeKind::Option(inner) => {
// function pointer can not annotate ? so emit inner only // function pointer can not annotate ? so emit inner only
sb.push_str(inner.to_csharp_string(options, alias_map).as_str()); sb.push_str(
inner
.to_csharp_string(options, alias_map, emit_from_struct)
.as_str(),
);
} }
_ => { _ => {
sb.push_str(convert_type_name(use_type.type_name.as_str(), options).as_str()); sb.push_str(convert_type_name(use_type.type_name.as_str()));
if use_alias { if use_alias {
if let TypeKind::Pointer(p) = &use_type.type_kind { if let TypeKind::Pointer(p) = &use_type.type_kind {

View File

@ -20,31 +20,54 @@ unsafe
//LibRust.call_bindgen_lz4(); //LibRust.call_bindgen_lz4();
// C# -> Rust, pass static UnmanagedCallersOnly method with `&`
[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvCdecl) })] [UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvCdecl) })]
static int Method(int x) => x * x; static int Sum(int x, int y) => x + y;
var tako = LibRust.callback_test(&Method); LibRust.csharp_to_rust(&Sum);
// Rust -> C#, get typed delegate*
var f = LibRust.rust_to_csharp();
var n = LibRust.nullable_callback_test(null); var v = f(20, 30);
Console.WriteLine(v); // 50
var cc = LibRust.enum_test(IntEnumTest.C);
Console.WriteLine(cc);
Console.WriteLine(n);
//var ctx = LibRust.create_counter_context();
//LibRust.insert_counter_context(ctx, 10); // var tako = LibRust.callback_test(&Method);
//LibRust.insert_counter_context(ctx, 20);
//var tako = LibRust.callback_test(&Method);
//Console.WriteLine(tako);
//var cc = LibRust.enum_test(IntEnumTest.C);
//Console.WriteLine(cc);
var context = LibRust.create_context();
// do anything...
LibRust.delete_context(context);
var ctx = LibRust.create_counter_context(); // ctx = void*
LibRust.insert_counter_context(ctx, 10);
LibRust.insert_counter_context(ctx, 20);
LibRust.delete_counter_context(ctx);
//LibRust.insert_counter_context(ctx, 20); //LibRust.insert_counter_context(ctx, 20);
//LibRust.insert_counter_context(ctx, 30); //LibRust.insert_counter_context(ctx, 30);
//LibRust.insert_counter_context(ctx, 99); //LibRust.insert_counter_context(ctx, 99);
//LibRust.delete_counter_context(ctx); //LibRust.delete_counter_context(ctx);
//var cString = LibRust.alloc_c_string(); // var cString = LibRust.alloc_c_string();
//var u8String = LibRust.alloc_u8_string(); //var u8String = LibRust.alloc_u8_string();
//var u8Buffer = LibRust.alloc_u8_buffer(); //var u8Buffer = LibRust.alloc_u8_buffer();
//var i32Buffer = LibRust.alloc_i32_buffer(); //var i32Buffer = LibRust.alloc_i32_buffer();
@ -89,7 +112,7 @@ unsafe
// var span = buf->AsSpan(); // var span = buf->AsSpan();
@ -123,11 +146,18 @@ public static unsafe partial class LibraryImportNativeMethods
[LibraryImport(__DllName)] //[LibraryImport(__DllName)]
public static partial void foo(Foo f); //public static partial void foo(Foo f);
[LibraryImport(__DllName, EntryPoint = "nullable_callback_test")]
public static partial int nullable_callback_test([MarshalAs(UnmanagedType.FunctionPtr)] Func<int, int> cb);
[LibraryImport(__DllName, EntryPoint = "nullable_callback_test")]
public static partial int nullable_callback_test2(delegate* unmanaged[Cdecl]<int, int> cb);
} }
public struct Foo public struct Foo

View File

@ -1,3 +1,3 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
[assembly:DisableRuntimeMarshalling()] // [assembly:DisableRuntimeMarshalling()]

View File

@ -104,7 +104,7 @@ namespace CsBindgen
/// <summary>LZ4_initStream() : v1.9.0+ An LZ4_stream_t structure must be initialized at least once. This is automatically done when invoking LZ4_createStream(), but it's not when the structure is simply declared on stack (for example). Use LZ4_initStream() to properly initialize a newly declared LZ4_stream_t. It can also initialize any arbitrary buffer of sufficient size, and will @return a pointer of proper type upon initialization. Note : initialization fails if size and alignment conditions are not respected. In which case, the function will @return NULL. Note2: An LZ4_stream_t structure guarantees correct alignment and size. Note3: Before v1.9.0, use LZ4_resetStream() instead</summary> /// <summary>LZ4_initStream() : v1.9.0+ An LZ4_stream_t structure must be initialized at least once. This is automatically done when invoking LZ4_createStream(), but it's not when the structure is simply declared on stack (for example). Use LZ4_initStream() to properly initialize a newly declared LZ4_stream_t. It can also initialize any arbitrary buffer of sufficient size, and will @return a pointer of proper type upon initialization. Note : initialization fails if size and alignment conditions are not respected. In which case, the function will @return NULL. Note2: An LZ4_stream_t structure guarantees correct alignment and size. Note3: Before v1.9.0, use LZ4_resetStream() instead</summary>
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4_initStream", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4_initStream", CallingConvention = CallingConvention.Cdecl)]
public static extern LZ4_stream_u* LZ4_initStream(void* buffer, UIntPtr size); public static extern LZ4_stream_u* LZ4_initStream(void* buffer, nuint size);
/// <summary>Obsolete compression functions (since v1.7.3)</summary> /// <summary>Obsolete compression functions (since v1.7.3)</summary>
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4_compress", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4_compress", CallingConvention = CallingConvention.Cdecl)]
@ -204,7 +204,7 @@ namespace CsBindgen
public static extern int LZ4_saveDictHC(LZ4_streamHC_u* streamHCPtr, byte* safeBuffer, int maxDictSize); public static extern int LZ4_saveDictHC(LZ4_streamHC_u* streamHCPtr, byte* safeBuffer, int maxDictSize);
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4_initStreamHC", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4_initStreamHC", CallingConvention = CallingConvention.Cdecl)]
public static extern LZ4_streamHC_u* LZ4_initStreamHC(void* buffer, UIntPtr size); public static extern LZ4_streamHC_u* LZ4_initStreamHC(void* buffer, nuint size);
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4_compressHC", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4_compressHC", CallingConvention = CallingConvention.Cdecl)]
public static extern int LZ4_compressHC(byte* source, byte* dest, int inputSize); public static extern int LZ4_compressHC(byte* source, byte* dest, int inputSize);
@ -261,70 +261,70 @@ namespace CsBindgen
public static extern void LZ4_resetStreamHC(LZ4_streamHC_u* streamHCPtr, int compressionLevel); public static extern void LZ4_resetStreamHC(LZ4_streamHC_u* streamHCPtr, int compressionLevel);
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_isError", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_isError", CallingConvention = CallingConvention.Cdecl)]
public static extern uint LZ4F_isError(UIntPtr code); public static extern uint LZ4F_isError(nuint code);
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_getErrorName", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_getErrorName", CallingConvention = CallingConvention.Cdecl)]
public static extern byte* LZ4F_getErrorName(UIntPtr code); public static extern byte* LZ4F_getErrorName(nuint code);
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_compressionLevel_max", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_compressionLevel_max", CallingConvention = CallingConvention.Cdecl)]
public static extern int LZ4F_compressionLevel_max(); public static extern int LZ4F_compressionLevel_max();
/// <summary>LZ4F_compressFrameBound() : Returns the maximum possible compressed size with LZ4F_compressFrame() given srcSize and preferences. `preferencesPtr` is optional. It can be replaced by NULL, in which case, the function will assume default preferences. Note : this result is only usable with LZ4F_compressFrame(). It may also be relevant to LZ4F_compressUpdate() _only if_ no flush() operation is ever performed.</summary> /// <summary>LZ4F_compressFrameBound() : Returns the maximum possible compressed size with LZ4F_compressFrame() given srcSize and preferences. `preferencesPtr` is optional. It can be replaced by NULL, in which case, the function will assume default preferences. Note : this result is only usable with LZ4F_compressFrame(). It may also be relevant to LZ4F_compressUpdate() _only if_ no flush() operation is ever performed.</summary>
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_compressFrameBound", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_compressFrameBound", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr LZ4F_compressFrameBound(UIntPtr srcSize, LZ4F_preferences_t* preferencesPtr); public static extern nuint LZ4F_compressFrameBound(nuint srcSize, LZ4F_preferences_t* preferencesPtr);
/// <summary>LZ4F_compressFrame() : Compress srcBuffer content into an LZ4-compressed frame. It's a one shot operation, all input content is consumed, and all output is generated. Note : it's a stateless operation (no LZ4F_cctx state needed). In order to reduce load on the allocator, LZ4F_compressFrame(), by default, uses the stack to allocate space for the compression state and some table. If this usage of the stack is too much for your application, consider compiling `lz4frame.c` with compile-time macro LZ4F_HEAPMODE set to 1 instead. All state allocations will use the Heap. It also means each invocation of LZ4F_compressFrame() will trigger several internal alloc/free invocations. @dstCapacity MUST be &gt;= LZ4F_compressFrameBound(srcSize, preferencesPtr). @preferencesPtr is optional : one can provide NULL, in which case all preferences are set to default. @return : number of bytes written into dstBuffer. or an error code if it fails (can be tested using LZ4F_isError())</summary> /// <summary>LZ4F_compressFrame() : Compress srcBuffer content into an LZ4-compressed frame. It's a one shot operation, all input content is consumed, and all output is generated. Note : it's a stateless operation (no LZ4F_cctx state needed). In order to reduce load on the allocator, LZ4F_compressFrame(), by default, uses the stack to allocate space for the compression state and some table. If this usage of the stack is too much for your application, consider compiling `lz4frame.c` with compile-time macro LZ4F_HEAPMODE set to 1 instead. All state allocations will use the Heap. It also means each invocation of LZ4F_compressFrame() will trigger several internal alloc/free invocations. @dstCapacity MUST be &gt;= LZ4F_compressFrameBound(srcSize, preferencesPtr). @preferencesPtr is optional : one can provide NULL, in which case all preferences are set to default. @return : number of bytes written into dstBuffer. or an error code if it fails (can be tested using LZ4F_isError())</summary>
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_compressFrame", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_compressFrame", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr LZ4F_compressFrame(void* dstBuffer, UIntPtr dstCapacity, void* srcBuffer, UIntPtr srcSize, LZ4F_preferences_t* preferencesPtr); public static extern nuint LZ4F_compressFrame(void* dstBuffer, nuint dstCapacity, void* srcBuffer, nuint srcSize, LZ4F_preferences_t* preferencesPtr);
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_getVersion", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_getVersion", CallingConvention = CallingConvention.Cdecl)]
public static extern uint LZ4F_getVersion(); public static extern uint LZ4F_getVersion();
/// <summary>LZ4F_createCompressionContext() : The first thing to do is to create a compressionContext object, which will keep track of operation state during streaming compression. This is achieved using LZ4F_createCompressionContext(), which takes as argument a version, and a pointer to LZ4F_cctx*, to write the resulting pointer into. @version provided MUST be LZ4F_VERSION. It is intended to track potential version mismatch, notably when using DLL. The function provides a pointer to a fully allocated LZ4F_cctx object. @cctxPtr MUST be != NULL. If @return != zero, context creation failed. A created compression context can be employed multiple times for consecutive streaming operations. Once all streaming compression jobs are completed, the state object can be released using LZ4F_freeCompressionContext(). Note1 : LZ4F_freeCompressionContext() is always successful. Its return value can be ignored. Note2 : LZ4F_freeCompressionContext() works fine with NULL input pointers (do nothing).</summary> /// <summary>LZ4F_createCompressionContext() : The first thing to do is to create a compressionContext object, which will keep track of operation state during streaming compression. This is achieved using LZ4F_createCompressionContext(), which takes as argument a version, and a pointer to LZ4F_cctx*, to write the resulting pointer into. @version provided MUST be LZ4F_VERSION. It is intended to track potential version mismatch, notably when using DLL. The function provides a pointer to a fully allocated LZ4F_cctx object. @cctxPtr MUST be != NULL. If @return != zero, context creation failed. A created compression context can be employed multiple times for consecutive streaming operations. Once all streaming compression jobs are completed, the state object can be released using LZ4F_freeCompressionContext(). Note1 : LZ4F_freeCompressionContext() is always successful. Its return value can be ignored. Note2 : LZ4F_freeCompressionContext() works fine with NULL input pointers (do nothing).</summary>
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_createCompressionContext", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_createCompressionContext", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr LZ4F_createCompressionContext(LZ4F_cctx_s** cctxPtr, uint version); public static extern nuint LZ4F_createCompressionContext(LZ4F_cctx_s** cctxPtr, uint version);
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_freeCompressionContext", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_freeCompressionContext", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr LZ4F_freeCompressionContext(LZ4F_cctx_s* cctx); public static extern nuint LZ4F_freeCompressionContext(LZ4F_cctx_s* cctx);
/// <summary>LZ4F_compressBegin() : will write the frame header into dstBuffer. dstCapacity must be &gt;= LZ4F_HEADER_SIZE_MAX bytes. `prefsPtr` is optional : NULL can be provided to set all preferences to default. @return : number of bytes written into dstBuffer for the header or an error code (which can be tested using LZ4F_isError())</summary> /// <summary>LZ4F_compressBegin() : will write the frame header into dstBuffer. dstCapacity must be &gt;= LZ4F_HEADER_SIZE_MAX bytes. `prefsPtr` is optional : NULL can be provided to set all preferences to default. @return : number of bytes written into dstBuffer for the header or an error code (which can be tested using LZ4F_isError())</summary>
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_compressBegin", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_compressBegin", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr LZ4F_compressBegin(LZ4F_cctx_s* cctx, void* dstBuffer, UIntPtr dstCapacity, LZ4F_preferences_t* prefsPtr); public static extern nuint LZ4F_compressBegin(LZ4F_cctx_s* cctx, void* dstBuffer, nuint dstCapacity, LZ4F_preferences_t* prefsPtr);
/// <summary>LZ4F_compressBound() : Provides minimum dstCapacity required to guarantee success of LZ4F_compressUpdate(), given a srcSize and preferences, for a worst case scenario. When srcSize==0, LZ4F_compressBound() provides an upper bound for LZ4F_flush() and LZ4F_compressEnd() instead. Note that the result is only valid for a single invocation of LZ4F_compressUpdate(). When invoking LZ4F_compressUpdate() multiple times, if the output buffer is gradually filled up instead of emptied and re-used from its start, one must check if there is enough remaining capacity before each invocation, using LZ4F_compressBound(). @return is always the same for a srcSize and prefsPtr. prefsPtr is optional : when NULL is provided, preferences will be set to cover worst case scenario. tech details : @return if automatic flushing is not enabled, includes the possibility that internal buffer might already be filled by up to (blockSize-1) bytes. It also includes frame footer (ending + checksum), since it might be generated by LZ4F_compressEnd(). @return doesn't include frame header, as it was already generated by LZ4F_compressBegin().</summary> /// <summary>LZ4F_compressBound() : Provides minimum dstCapacity required to guarantee success of LZ4F_compressUpdate(), given a srcSize and preferences, for a worst case scenario. When srcSize==0, LZ4F_compressBound() provides an upper bound for LZ4F_flush() and LZ4F_compressEnd() instead. Note that the result is only valid for a single invocation of LZ4F_compressUpdate(). When invoking LZ4F_compressUpdate() multiple times, if the output buffer is gradually filled up instead of emptied and re-used from its start, one must check if there is enough remaining capacity before each invocation, using LZ4F_compressBound(). @return is always the same for a srcSize and prefsPtr. prefsPtr is optional : when NULL is provided, preferences will be set to cover worst case scenario. tech details : @return if automatic flushing is not enabled, includes the possibility that internal buffer might already be filled by up to (blockSize-1) bytes. It also includes frame footer (ending + checksum), since it might be generated by LZ4F_compressEnd(). @return doesn't include frame header, as it was already generated by LZ4F_compressBegin().</summary>
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_compressBound", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_compressBound", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr LZ4F_compressBound(UIntPtr srcSize, LZ4F_preferences_t* prefsPtr); public static extern nuint LZ4F_compressBound(nuint srcSize, LZ4F_preferences_t* prefsPtr);
/// <summary>LZ4F_compressUpdate() : LZ4F_compressUpdate() can be called repetitively to compress as much data as necessary. Important rule: dstCapacity MUST be large enough to ensure operation success even in worst case situations. This value is provided by LZ4F_compressBound(). If this condition is not respected, LZ4F_compress() will fail (result is an errorCode). After an error, the state is left in a UB state, and must be re-initialized or freed. If previously an uncompressed block was written, buffered data is flushed before appending compressed data is continued. `cOptPtr` is optional : NULL can be provided, in which case all options are set to default. @return : number of bytes written into `dstBuffer` (it can be zero, meaning input data was just buffered). or an error code if it fails (which can be tested using LZ4F_isError())</summary> /// <summary>LZ4F_compressUpdate() : LZ4F_compressUpdate() can be called repetitively to compress as much data as necessary. Important rule: dstCapacity MUST be large enough to ensure operation success even in worst case situations. This value is provided by LZ4F_compressBound(). If this condition is not respected, LZ4F_compress() will fail (result is an errorCode). After an error, the state is left in a UB state, and must be re-initialized or freed. If previously an uncompressed block was written, buffered data is flushed before appending compressed data is continued. `cOptPtr` is optional : NULL can be provided, in which case all options are set to default. @return : number of bytes written into `dstBuffer` (it can be zero, meaning input data was just buffered). or an error code if it fails (which can be tested using LZ4F_isError())</summary>
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_compressUpdate", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_compressUpdate", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr LZ4F_compressUpdate(LZ4F_cctx_s* cctx, void* dstBuffer, UIntPtr dstCapacity, void* srcBuffer, UIntPtr srcSize, LZ4F_compressOptions_t* cOptPtr); public static extern nuint LZ4F_compressUpdate(LZ4F_cctx_s* cctx, void* dstBuffer, nuint dstCapacity, void* srcBuffer, nuint srcSize, LZ4F_compressOptions_t* cOptPtr);
/// <summary>LZ4F_flush() : When data must be generated and sent immediately, without waiting for a block to be completely filled, it's possible to call LZ4_flush(). It will immediately compress any data buffered within cctx. `dstCapacity` must be large enough to ensure the operation will be successful. `cOptPtr` is optional : it's possible to provide NULL, all options will be set to default. @return : nb of bytes written into dstBuffer (can be zero, when there is no data stored within cctx) or an error code if it fails (which can be tested using LZ4F_isError()) Note : LZ4F_flush() is guaranteed to be successful when dstCapacity &gt;= LZ4F_compressBound(0, prefsPtr).</summary> /// <summary>LZ4F_flush() : When data must be generated and sent immediately, without waiting for a block to be completely filled, it's possible to call LZ4_flush(). It will immediately compress any data buffered within cctx. `dstCapacity` must be large enough to ensure the operation will be successful. `cOptPtr` is optional : it's possible to provide NULL, all options will be set to default. @return : nb of bytes written into dstBuffer (can be zero, when there is no data stored within cctx) or an error code if it fails (which can be tested using LZ4F_isError()) Note : LZ4F_flush() is guaranteed to be successful when dstCapacity &gt;= LZ4F_compressBound(0, prefsPtr).</summary>
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_flush", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_flush", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr LZ4F_flush(LZ4F_cctx_s* cctx, void* dstBuffer, UIntPtr dstCapacity, LZ4F_compressOptions_t* cOptPtr); public static extern nuint LZ4F_flush(LZ4F_cctx_s* cctx, void* dstBuffer, nuint dstCapacity, LZ4F_compressOptions_t* cOptPtr);
/// <summary>LZ4F_compressEnd() : To properly finish an LZ4 frame, invoke LZ4F_compressEnd(). It will flush whatever data remained within `cctx` (like LZ4_flush()) and properly finalize the frame, with an endMark and a checksum. `cOptPtr` is optional : NULL can be provided, in which case all options will be set to default. @return : nb of bytes written into dstBuffer, necessarily &gt;= 4 (endMark), or an error code if it fails (which can be tested using LZ4F_isError()) Note : LZ4F_compressEnd() is guaranteed to be successful when dstCapacity &gt;= LZ4F_compressBound(0, prefsPtr). A successful call to LZ4F_compressEnd() makes `cctx` available again for another compression task.</summary> /// <summary>LZ4F_compressEnd() : To properly finish an LZ4 frame, invoke LZ4F_compressEnd(). It will flush whatever data remained within `cctx` (like LZ4_flush()) and properly finalize the frame, with an endMark and a checksum. `cOptPtr` is optional : NULL can be provided, in which case all options will be set to default. @return : nb of bytes written into dstBuffer, necessarily &gt;= 4 (endMark), or an error code if it fails (which can be tested using LZ4F_isError()) Note : LZ4F_compressEnd() is guaranteed to be successful when dstCapacity &gt;= LZ4F_compressBound(0, prefsPtr). A successful call to LZ4F_compressEnd() makes `cctx` available again for another compression task.</summary>
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_compressEnd", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_compressEnd", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr LZ4F_compressEnd(LZ4F_cctx_s* cctx, void* dstBuffer, UIntPtr dstCapacity, LZ4F_compressOptions_t* cOptPtr); public static extern nuint LZ4F_compressEnd(LZ4F_cctx_s* cctx, void* dstBuffer, nuint dstCapacity, LZ4F_compressOptions_t* cOptPtr);
/// <summary>LZ4F_createDecompressionContext() : Create an LZ4F_dctx object, to track all decompression operations. @version provided MUST be LZ4F_VERSION. @dctxPtr MUST be valid. The function fills @dctxPtr with the value of a pointer to an allocated and initialized LZ4F_dctx object. The @return is an errorCode, which can be tested using LZ4F_isError(). dctx memory can be released using LZ4F_freeDecompressionContext(); Result of LZ4F_freeDecompressionContext() indicates current state of decompressionContext when being released. That is, it should be == 0 if decompression has been completed fully and correctly.</summary> /// <summary>LZ4F_createDecompressionContext() : Create an LZ4F_dctx object, to track all decompression operations. @version provided MUST be LZ4F_VERSION. @dctxPtr MUST be valid. The function fills @dctxPtr with the value of a pointer to an allocated and initialized LZ4F_dctx object. The @return is an errorCode, which can be tested using LZ4F_isError(). dctx memory can be released using LZ4F_freeDecompressionContext(); Result of LZ4F_freeDecompressionContext() indicates current state of decompressionContext when being released. That is, it should be == 0 if decompression has been completed fully and correctly.</summary>
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_createDecompressionContext", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_createDecompressionContext", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr LZ4F_createDecompressionContext(LZ4F_dctx_s** dctxPtr, uint version); public static extern nuint LZ4F_createDecompressionContext(LZ4F_dctx_s** dctxPtr, uint version);
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_freeDecompressionContext", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_freeDecompressionContext", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr LZ4F_freeDecompressionContext(LZ4F_dctx_s* dctx); public static extern nuint LZ4F_freeDecompressionContext(LZ4F_dctx_s* dctx);
/// <summary>LZ4F_headerSize() : v1.9.0+ Provide the header size of a frame starting at `src`. `srcSize` must be &gt;= LZ4F_MIN_SIZE_TO_KNOW_HEADER_LENGTH, which is enough to decode the header length. @return : size of frame header or an error code, which can be tested using LZ4F_isError() note : Frame header size is variable, but is guaranteed to be &gt;= LZ4F_HEADER_SIZE_MIN bytes, and &lt;= LZ4F_HEADER_SIZE_MAX bytes.</summary> /// <summary>LZ4F_headerSize() : v1.9.0+ Provide the header size of a frame starting at `src`. `srcSize` must be &gt;= LZ4F_MIN_SIZE_TO_KNOW_HEADER_LENGTH, which is enough to decode the header length. @return : size of frame header or an error code, which can be tested using LZ4F_isError() note : Frame header size is variable, but is guaranteed to be &gt;= LZ4F_HEADER_SIZE_MIN bytes, and &lt;= LZ4F_HEADER_SIZE_MAX bytes.</summary>
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_headerSize", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_headerSize", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr LZ4F_headerSize(void* src, UIntPtr srcSize); public static extern nuint LZ4F_headerSize(void* src, nuint srcSize);
/// <summary>LZ4F_getFrameInfo() : This function extracts frame parameters (max blockSize, dictID, etc.). Its usage is optional: user can also invoke LZ4F_decompress() directly. Extracted information will fill an existing LZ4F_frameInfo_t structure. This can be useful for allocation and dictionary identification purposes. LZ4F_getFrameInfo() can work in the following situations : 1) At the beginning of a new frame, before any invocation of LZ4F_decompress(). It will decode header from `srcBuffer`, consuming the header and starting the decoding process. Input size must be large enough to contain the full frame header. Frame header size can be known beforehand by LZ4F_headerSize(). Frame header size is variable, but is guaranteed to be &gt;= LZ4F_HEADER_SIZE_MIN bytes, and not more than &lt;= LZ4F_HEADER_SIZE_MAX bytes. Hence, blindly providing LZ4F_HEADER_SIZE_MAX bytes or more will always work. It's allowed to provide more input data than the header size, LZ4F_getFrameInfo() will only consume the header. If input size is not large enough, aka if it's smaller than header size, function will fail and return an error code. 2) After decoding has been started, it's possible to invoke LZ4F_getFrameInfo() anytime to extract already decoded frame parameters stored within dctx. Note that, if decoding has barely started, and not yet read enough information to decode the header, LZ4F_getFrameInfo() will fail. The number of bytes consumed from srcBuffer will be updated in *srcSizePtr (necessarily &lt;= original value). LZ4F_getFrameInfo() only consumes bytes when decoding has not yet started, and when decoding the header has been successful. Decompression must then resume from (srcBuffer + *srcSizePtr). @return : a hint about how many srcSize bytes LZ4F_decompress() expects for next call, or an error code which can be tested using LZ4F_isError(). note 1 : in case of error, dctx is not modified. Decoding operation can resume from beginning safely. note 2 : frame parameters are *copied into* an already allocated LZ4F_frameInfo_t structure.</summary> /// <summary>LZ4F_getFrameInfo() : This function extracts frame parameters (max blockSize, dictID, etc.). Its usage is optional: user can also invoke LZ4F_decompress() directly. Extracted information will fill an existing LZ4F_frameInfo_t structure. This can be useful for allocation and dictionary identification purposes. LZ4F_getFrameInfo() can work in the following situations : 1) At the beginning of a new frame, before any invocation of LZ4F_decompress(). It will decode header from `srcBuffer`, consuming the header and starting the decoding process. Input size must be large enough to contain the full frame header. Frame header size can be known beforehand by LZ4F_headerSize(). Frame header size is variable, but is guaranteed to be &gt;= LZ4F_HEADER_SIZE_MIN bytes, and not more than &lt;= LZ4F_HEADER_SIZE_MAX bytes. Hence, blindly providing LZ4F_HEADER_SIZE_MAX bytes or more will always work. It's allowed to provide more input data than the header size, LZ4F_getFrameInfo() will only consume the header. If input size is not large enough, aka if it's smaller than header size, function will fail and return an error code. 2) After decoding has been started, it's possible to invoke LZ4F_getFrameInfo() anytime to extract already decoded frame parameters stored within dctx. Note that, if decoding has barely started, and not yet read enough information to decode the header, LZ4F_getFrameInfo() will fail. The number of bytes consumed from srcBuffer will be updated in *srcSizePtr (necessarily &lt;= original value). LZ4F_getFrameInfo() only consumes bytes when decoding has not yet started, and when decoding the header has been successful. Decompression must then resume from (srcBuffer + *srcSizePtr). @return : a hint about how many srcSize bytes LZ4F_decompress() expects for next call, or an error code which can be tested using LZ4F_isError(). note 1 : in case of error, dctx is not modified. Decoding operation can resume from beginning safely. note 2 : frame parameters are *copied into* an already allocated LZ4F_frameInfo_t structure.</summary>
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_getFrameInfo", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_getFrameInfo", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr LZ4F_getFrameInfo(LZ4F_dctx_s* dctx, LZ4F_frameInfo_t* frameInfoPtr, void* srcBuffer, UIntPtr* srcSizePtr); public static extern nuint LZ4F_getFrameInfo(LZ4F_dctx_s* dctx, LZ4F_frameInfo_t* frameInfoPtr, void* srcBuffer, nuint* srcSizePtr);
/// <summary>LZ4F_decompress() : Call this function repetitively to regenerate data compressed in `srcBuffer`. The function requires a valid dctx state. It will read up to *srcSizePtr bytes from srcBuffer, and decompress data into dstBuffer, of capacity *dstSizePtr. The nb of bytes consumed from srcBuffer will be written into *srcSizePtr (necessarily &lt;= original value). The nb of bytes decompressed into dstBuffer will be written into *dstSizePtr (necessarily &lt;= original value). The function does not necessarily read all input bytes, so always check value in *srcSizePtr. Unconsumed source data must be presented again in subsequent invocations. `dstBuffer` can freely change between each consecutive function invocation. `dstBuffer` content will be overwritten. Note: if `LZ4F_getFrameInfo()` is called before `LZ4F_decompress()`, srcBuffer must be updated to reflect the number of bytes consumed after reading the frame header. Failure to update srcBuffer before calling `LZ4F_decompress()` will cause decompression failure or, even worse, successful but incorrect decompression. See the `LZ4F_getFrameInfo()` docs for details. @return : an hint of how many `srcSize` bytes LZ4F_decompress() expects for next call. Schematically, it's the size of the current (or remaining) compressed block + header of next block. Respecting the hint provides some small speed benefit, because it skips intermediate buffers. This is just a hint though, it's always possible to provide any srcSize. When a frame is fully decoded, @return will be 0 (no more data expected). When provided with more bytes than necessary to decode a frame, LZ4F_decompress() will stop reading exactly at end of current frame, and @return 0. If decompression failed, @return is an error code, which can be tested using LZ4F_isError(). After a decompression error, the `dctx` context is not resumable. Use LZ4F_resetDecompressionContext() to return to clean state. After a frame is fully decoded, dctx can be used again to decompress another frame.</summary> /// <summary>LZ4F_decompress() : Call this function repetitively to regenerate data compressed in `srcBuffer`. The function requires a valid dctx state. It will read up to *srcSizePtr bytes from srcBuffer, and decompress data into dstBuffer, of capacity *dstSizePtr. The nb of bytes consumed from srcBuffer will be written into *srcSizePtr (necessarily &lt;= original value). The nb of bytes decompressed into dstBuffer will be written into *dstSizePtr (necessarily &lt;= original value). The function does not necessarily read all input bytes, so always check value in *srcSizePtr. Unconsumed source data must be presented again in subsequent invocations. `dstBuffer` can freely change between each consecutive function invocation. `dstBuffer` content will be overwritten. Note: if `LZ4F_getFrameInfo()` is called before `LZ4F_decompress()`, srcBuffer must be updated to reflect the number of bytes consumed after reading the frame header. Failure to update srcBuffer before calling `LZ4F_decompress()` will cause decompression failure or, even worse, successful but incorrect decompression. See the `LZ4F_getFrameInfo()` docs for details. @return : an hint of how many `srcSize` bytes LZ4F_decompress() expects for next call. Schematically, it's the size of the current (or remaining) compressed block + header of next block. Respecting the hint provides some small speed benefit, because it skips intermediate buffers. This is just a hint though, it's always possible to provide any srcSize. When a frame is fully decoded, @return will be 0 (no more data expected). When provided with more bytes than necessary to decode a frame, LZ4F_decompress() will stop reading exactly at end of current frame, and @return 0. If decompression failed, @return is an error code, which can be tested using LZ4F_isError(). After a decompression error, the `dctx` context is not resumable. Use LZ4F_resetDecompressionContext() to return to clean state. After a frame is fully decoded, dctx can be used again to decompress another frame.</summary>
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_decompress", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_decompress", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr LZ4F_decompress(LZ4F_dctx_s* dctx, void* dstBuffer, UIntPtr* dstSizePtr, void* srcBuffer, UIntPtr* srcSizePtr, LZ4F_decompressOptions_t* dOptPtr); public static extern nuint LZ4F_decompress(LZ4F_dctx_s* dctx, void* dstBuffer, nuint* dstSizePtr, void* srcBuffer, nuint* srcSizePtr, LZ4F_decompressOptions_t* dOptPtr);
/// <summary>LZ4F_resetDecompressionContext() : added in v1.8.0 In case of an error, the context is left in \"undefined\" state. In which case, it's necessary to reset it, before re-using it. This method can also be used to abruptly stop any unfinished decompression, and start a new one using same context resources.</summary> /// <summary>LZ4F_resetDecompressionContext() : added in v1.8.0 In case of an error, the context is left in \"undefined\" state. In which case, it's necessary to reset it, before re-using it. This method can also be used to abruptly stop any unfinished decompression, and start a new one using same context resources.</summary>
[DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_resetDecompressionContext", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "csbindgen_LZ4F_resetDecompressionContext", CallingConvention = CallingConvention.Cdecl)]
@ -358,8 +358,8 @@ namespace CsBindgen
{ {
public byte* externalDict; public byte* externalDict;
public byte* prefixEnd; public byte* prefixEnd;
public UIntPtr extDictSize; public nuint extDictSize;
public UIntPtr prefixSize; public nuint prefixSize;
} }
[StructLayout(LayoutKind.Explicit)] [StructLayout(LayoutKind.Explicit)]

View File

@ -18,12 +18,30 @@ namespace CsBindgen
[DllImport(__DllName, EntryPoint = "alias_test2", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "alias_test2", CallingConvention = CallingConvention.Cdecl)]
public static extern void alias_test2(long _b); public static extern void alias_test2(long _b);
[DllImport(__DllName, EntryPoint = "nullpointer_test", CallingConvention = CallingConvention.Cdecl)]
public static extern void nullpointer_test(byte* p);
[DllImport(__DllName, EntryPoint = "callback_test", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "callback_test", CallingConvention = CallingConvention.Cdecl)]
public static extern int callback_test(delegate* unmanaged[Cdecl]<int, int> cb); public static extern int callback_test(delegate* unmanaged[Cdecl]<int, int> cb);
[DllImport(__DllName, EntryPoint = "csharp_to_rust", CallingConvention = CallingConvention.Cdecl)]
public static extern void csharp_to_rust(delegate* unmanaged[Cdecl]<int, int, int> cb);
[DllImport(__DllName, EntryPoint = "rust_to_csharp", CallingConvention = CallingConvention.Cdecl)]
public static extern delegate* unmanaged[Cdecl]<int, int, int> rust_to_csharp();
[DllImport(__DllName, EntryPoint = "sum", CallingConvention = CallingConvention.Cdecl)]
public static extern int sum(int x, int y);
[DllImport(__DllName, EntryPoint = "cbt", CallingConvention = CallingConvention.Cdecl)]
public static extern void cbt(CallbackTable _cb);
[DllImport(__DllName, EntryPoint = "nullable_callback_test", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "nullable_callback_test", CallingConvention = CallingConvention.Cdecl)]
public static extern int nullable_callback_test(delegate* unmanaged[Cdecl]<int, int> cb); public static extern int nullable_callback_test(delegate* unmanaged[Cdecl]<int, int> cb);
[DllImport(__DllName, EntryPoint = "types_iroiro", CallingConvention = CallingConvention.Cdecl)]
public static extern void types_iroiro(nint _i, nuint _u, CLong _cl, CULong _cul);
[DllImport(__DllName, EntryPoint = "callback_test2", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "callback_test2", CallingConvention = CallingConvention.Cdecl)]
public static extern delegate* unmanaged[Cdecl]<int, int> callback_test2(); public static extern delegate* unmanaged[Cdecl]<int, int> callback_test2();
@ -48,6 +66,12 @@ namespace CsBindgen
[DllImport(__DllName, EntryPoint = "delete_counter_context", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "delete_counter_context", CallingConvention = CallingConvention.Cdecl)]
public static extern void delete_counter_context(void* context); public static extern void delete_counter_context(void* context);
[DllImport(__DllName, EntryPoint = "pass_vector3", CallingConvention = CallingConvention.Cdecl)]
public static extern void pass_vector3(MyVector3 v3);
[DllImport(__DllName, EntryPoint = "return_union", CallingConvention = CallingConvention.Cdecl)]
public static extern MyUnion return_union();
[DllImport(__DllName, EntryPoint = "my_bool", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "my_bool", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.U1)] [return: MarshalAs(UnmanagedType.U1)]
public static extern bool my_bool([MarshalAs(UnmanagedType.U1)] bool x, [MarshalAs(UnmanagedType.U1)] bool y, [MarshalAs(UnmanagedType.U1)] bool z, bool* xr, bool* yr, bool* zr); public static extern bool my_bool([MarshalAs(UnmanagedType.U1)] bool x, [MarshalAs(UnmanagedType.U1)] bool y, [MarshalAs(UnmanagedType.U1)] bool z, bool* xr, bool* yr, bool* zr);
@ -91,6 +115,23 @@ namespace CsBindgen
} }
[StructLayout(LayoutKind.Explicit)]
internal unsafe partial struct MyUnion
{
[FieldOffset(0)]
public int foo;
[FieldOffset(0)]
public long bar;
}
[StructLayout(LayoutKind.Sequential)]
internal unsafe partial struct MyVector3
{
public float x;
public float y;
public float z;
}
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
internal unsafe partial struct Context internal unsafe partial struct Context
{ {
@ -105,8 +146,15 @@ namespace CsBindgen
public int capacity; public int capacity;
} }
[StructLayout(LayoutKind.Sequential)]
internal unsafe partial struct CallbackTable
{
public delegate* unmanaged[Cdecl]<void> foo;
public delegate* unmanaged[Cdecl]<int, int> foobar;
}
internal enum IntEnumTest : byte
internal enum IntEnumTest : sbyte
{ {
A = 1, A = 1,
B = 2, B = 2,

View File

@ -46,16 +46,16 @@ namespace CsBindgen
public static extern void quiche_config_enable_early_data(quiche_config* config); public static extern void quiche_config_enable_early_data(quiche_config* config);
[DllImport(__DllName, EntryPoint = "quiche_config_set_application_protos", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_config_set_application_protos", CallingConvention = CallingConvention.Cdecl)]
public static extern int quiche_config_set_application_protos(quiche_config* config, byte* protos, UIntPtr protos_len); public static extern int quiche_config_set_application_protos(quiche_config* config, byte* protos, nuint protos_len);
[DllImport(__DllName, EntryPoint = "quiche_config_set_max_idle_timeout", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_config_set_max_idle_timeout", CallingConvention = CallingConvention.Cdecl)]
public static extern void quiche_config_set_max_idle_timeout(quiche_config* config, ulong v); public static extern void quiche_config_set_max_idle_timeout(quiche_config* config, ulong v);
[DllImport(__DllName, EntryPoint = "quiche_config_set_max_recv_udp_payload_size", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_config_set_max_recv_udp_payload_size", CallingConvention = CallingConvention.Cdecl)]
public static extern void quiche_config_set_max_recv_udp_payload_size(quiche_config* config, UIntPtr v); public static extern void quiche_config_set_max_recv_udp_payload_size(quiche_config* config, nuint v);
[DllImport(__DllName, EntryPoint = "quiche_config_set_max_send_udp_payload_size", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_config_set_max_send_udp_payload_size", CallingConvention = CallingConvention.Cdecl)]
public static extern void quiche_config_set_max_send_udp_payload_size(quiche_config* config, UIntPtr v); public static extern void quiche_config_set_max_send_udp_payload_size(quiche_config* config, nuint v);
[DllImport(__DllName, EntryPoint = "quiche_config_set_initial_max_data", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_config_set_initial_max_data", CallingConvention = CallingConvention.Cdecl)]
public static extern void quiche_config_set_initial_max_data(quiche_config* config, ulong v); public static extern void quiche_config_set_initial_max_data(quiche_config* config, ulong v);
@ -94,7 +94,7 @@ namespace CsBindgen
public static extern void quiche_config_enable_pacing(quiche_config* config, [MarshalAs(UnmanagedType.U1)] bool v); public static extern void quiche_config_enable_pacing(quiche_config* config, [MarshalAs(UnmanagedType.U1)] bool v);
[DllImport(__DllName, EntryPoint = "quiche_config_enable_dgram", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_config_enable_dgram", CallingConvention = CallingConvention.Cdecl)]
public static extern void quiche_config_enable_dgram(quiche_config* config, [MarshalAs(UnmanagedType.U1)] bool enabled, UIntPtr recv_queue_len, UIntPtr send_queue_len); public static extern void quiche_config_enable_dgram(quiche_config* config, [MarshalAs(UnmanagedType.U1)] bool enabled, nuint recv_queue_len, nuint send_queue_len);
[DllImport(__DllName, EntryPoint = "quiche_config_set_max_connection_window", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_config_set_max_connection_window", CallingConvention = CallingConvention.Cdecl)]
public static extern void quiche_config_set_max_connection_window(quiche_config* config, ulong v); public static extern void quiche_config_set_max_connection_window(quiche_config* config, ulong v);
@ -112,26 +112,26 @@ namespace CsBindgen
public static extern void quiche_config_free(quiche_config* config); public static extern void quiche_config_free(quiche_config* config);
[DllImport(__DllName, EntryPoint = "quiche_header_info", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_header_info", CallingConvention = CallingConvention.Cdecl)]
public static extern int quiche_header_info(byte* buf, UIntPtr buf_len, UIntPtr dcil, uint* version, byte* type_, byte* scid, UIntPtr* scid_len, byte* dcid, UIntPtr* dcid_len, byte* token, UIntPtr* token_len); public static extern int quiche_header_info(byte* buf, nuint buf_len, nuint dcil, uint* version, byte* type_, byte* scid, nuint* scid_len, byte* dcid, nuint* dcid_len, byte* token, nuint* token_len);
[DllImport(__DllName, EntryPoint = "quiche_accept", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_accept", CallingConvention = CallingConvention.Cdecl)]
public static extern quiche_conn* quiche_accept(byte* scid, UIntPtr scid_len, byte* odcid, UIntPtr odcid_len, sockaddr* local, UIntPtr local_len, sockaddr* peer, UIntPtr peer_len, quiche_config* config); public static extern quiche_conn* quiche_accept(byte* scid, nuint scid_len, byte* odcid, nuint odcid_len, sockaddr* local, nuint local_len, sockaddr* peer, nuint peer_len, quiche_config* config);
[DllImport(__DllName, EntryPoint = "quiche_connect", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_connect", CallingConvention = CallingConvention.Cdecl)]
public static extern quiche_conn* quiche_connect(byte* server_name, byte* scid, UIntPtr scid_len, sockaddr* local, UIntPtr local_len, sockaddr* peer, UIntPtr peer_len, quiche_config* config); public static extern quiche_conn* quiche_connect(byte* server_name, byte* scid, nuint scid_len, sockaddr* local, nuint local_len, sockaddr* peer, nuint peer_len, quiche_config* config);
[DllImport(__DllName, EntryPoint = "quiche_negotiate_version", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_negotiate_version", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_negotiate_version(byte* scid, UIntPtr scid_len, byte* dcid, UIntPtr dcid_len, byte* @out, UIntPtr out_len); public static extern long quiche_negotiate_version(byte* scid, nuint scid_len, byte* dcid, nuint dcid_len, byte* @out, nuint out_len);
[DllImport(__DllName, EntryPoint = "quiche_retry", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_retry", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_retry(byte* scid, UIntPtr scid_len, byte* dcid, UIntPtr dcid_len, byte* new_scid, UIntPtr new_scid_len, byte* token, UIntPtr token_len, uint version, byte* @out, UIntPtr out_len); public static extern long quiche_retry(byte* scid, nuint scid_len, byte* dcid, nuint dcid_len, byte* new_scid, nuint new_scid_len, byte* token, nuint token_len, uint version, byte* @out, nuint out_len);
[DllImport(__DllName, EntryPoint = "quiche_version_is_supported", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_version_is_supported", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.U1)] [return: MarshalAs(UnmanagedType.U1)]
public static extern bool quiche_version_is_supported(uint version); public static extern bool quiche_version_is_supported(uint version);
[DllImport(__DllName, EntryPoint = "quiche_conn_new_with_tls", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_new_with_tls", CallingConvention = CallingConvention.Cdecl)]
public static extern quiche_conn* quiche_conn_new_with_tls(byte* scid, UIntPtr scid_len, byte* odcid, UIntPtr odcid_len, sockaddr* local, UIntPtr local_len, sockaddr* peer, UIntPtr peer_len, quiche_config* config, void* ssl, [MarshalAs(UnmanagedType.U1)] bool is_server); public static extern quiche_conn* quiche_conn_new_with_tls(byte* scid, nuint scid_len, byte* odcid, nuint odcid_len, sockaddr* local, nuint local_len, sockaddr* peer, nuint peer_len, quiche_config* config, void* ssl, [MarshalAs(UnmanagedType.U1)] bool is_server);
[DllImport(__DllName, EntryPoint = "quiche_conn_set_keylog_path", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_set_keylog_path", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.U1)] [return: MarshalAs(UnmanagedType.U1)]
@ -148,22 +148,22 @@ namespace CsBindgen
public static extern void quiche_conn_set_qlog_fd(quiche_conn* conn, int fd, byte* log_title, byte* log_desc); public static extern void quiche_conn_set_qlog_fd(quiche_conn* conn, int fd, byte* log_title, byte* log_desc);
[DllImport(__DllName, EntryPoint = "quiche_conn_set_session", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_set_session", CallingConvention = CallingConvention.Cdecl)]
public static extern int quiche_conn_set_session(quiche_conn* conn, byte* buf, UIntPtr buf_len); public static extern int quiche_conn_set_session(quiche_conn* conn, byte* buf, nuint buf_len);
[DllImport(__DllName, EntryPoint = "quiche_conn_recv", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_recv", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_conn_recv(quiche_conn* conn, byte* buf, UIntPtr buf_len, quiche_recv_info* info); public static extern long quiche_conn_recv(quiche_conn* conn, byte* buf, nuint buf_len, quiche_recv_info* info);
[DllImport(__DllName, EntryPoint = "quiche_conn_send", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_send", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_conn_send(quiche_conn* conn, byte* @out, UIntPtr out_len, quiche_send_info* out_info); public static extern long quiche_conn_send(quiche_conn* conn, byte* @out, nuint out_len, quiche_send_info* out_info);
[DllImport(__DllName, EntryPoint = "quiche_conn_send_quantum", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_send_quantum", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr quiche_conn_send_quantum(quiche_conn* conn); public static extern nuint quiche_conn_send_quantum(quiche_conn* conn);
[DllImport(__DllName, EntryPoint = "quiche_conn_stream_recv", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_stream_recv", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_conn_stream_recv(quiche_conn* conn, ulong stream_id, byte* @out, UIntPtr buf_len, bool* fin); public static extern long quiche_conn_stream_recv(quiche_conn* conn, ulong stream_id, byte* @out, nuint buf_len, bool* fin);
[DllImport(__DllName, EntryPoint = "quiche_conn_stream_send", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_stream_send", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_conn_stream_send(quiche_conn* conn, ulong stream_id, byte* buf, UIntPtr buf_len, [MarshalAs(UnmanagedType.U1)] bool fin); public static extern long quiche_conn_stream_send(quiche_conn* conn, ulong stream_id, byte* buf, nuint buf_len, [MarshalAs(UnmanagedType.U1)] bool fin);
[DllImport(__DllName, EntryPoint = "quiche_conn_stream_priority", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_stream_priority", CallingConvention = CallingConvention.Cdecl)]
public static extern int quiche_conn_stream_priority(quiche_conn* conn, ulong stream_id, byte urgency, [MarshalAs(UnmanagedType.U1)] bool incremental); public static extern int quiche_conn_stream_priority(quiche_conn* conn, ulong stream_id, byte urgency, [MarshalAs(UnmanagedType.U1)] bool incremental);
@ -182,7 +182,7 @@ namespace CsBindgen
public static extern long quiche_conn_stream_readable_next(quiche_conn* conn); public static extern long quiche_conn_stream_readable_next(quiche_conn* conn);
[DllImport(__DllName, EntryPoint = "quiche_conn_stream_writable", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_stream_writable", CallingConvention = CallingConvention.Cdecl)]
public static extern int quiche_conn_stream_writable(quiche_conn* conn, ulong stream_id, UIntPtr len); public static extern int quiche_conn_stream_writable(quiche_conn* conn, ulong stream_id, nuint len);
[DllImport(__DllName, EntryPoint = "quiche_conn_stream_writable_next", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_stream_writable_next", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_conn_stream_writable_next(quiche_conn* conn); public static extern long quiche_conn_stream_writable_next(quiche_conn* conn);
@ -198,7 +198,7 @@ namespace CsBindgen
public static extern quiche_stream_iter* quiche_conn_writable(quiche_conn* conn); public static extern quiche_stream_iter* quiche_conn_writable(quiche_conn* conn);
[DllImport(__DllName, EntryPoint = "quiche_conn_max_send_udp_payload_size", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_max_send_udp_payload_size", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr quiche_conn_max_send_udp_payload_size(quiche_conn* conn); public static extern nuint quiche_conn_max_send_udp_payload_size(quiche_conn* conn);
[DllImport(__DllName, EntryPoint = "quiche_conn_timeout_as_nanos", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_timeout_as_nanos", CallingConvention = CallingConvention.Cdecl)]
public static extern ulong quiche_conn_timeout_as_nanos(quiche_conn* conn); public static extern ulong quiche_conn_timeout_as_nanos(quiche_conn* conn);
@ -210,25 +210,25 @@ namespace CsBindgen
public static extern void quiche_conn_on_timeout(quiche_conn* conn); public static extern void quiche_conn_on_timeout(quiche_conn* conn);
[DllImport(__DllName, EntryPoint = "quiche_conn_close", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_close", CallingConvention = CallingConvention.Cdecl)]
public static extern int quiche_conn_close(quiche_conn* conn, [MarshalAs(UnmanagedType.U1)] bool app, ulong err, byte* reason, UIntPtr reason_len); public static extern int quiche_conn_close(quiche_conn* conn, [MarshalAs(UnmanagedType.U1)] bool app, ulong err, byte* reason, nuint reason_len);
[DllImport(__DllName, EntryPoint = "quiche_conn_trace_id", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_trace_id", CallingConvention = CallingConvention.Cdecl)]
public static extern void quiche_conn_trace_id(quiche_conn* conn, byte** @out, UIntPtr* out_len); public static extern void quiche_conn_trace_id(quiche_conn* conn, byte** @out, nuint* out_len);
[DllImport(__DllName, EntryPoint = "quiche_conn_source_id", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_source_id", CallingConvention = CallingConvention.Cdecl)]
public static extern void quiche_conn_source_id(quiche_conn* conn, byte** @out, UIntPtr* out_len); public static extern void quiche_conn_source_id(quiche_conn* conn, byte** @out, nuint* out_len);
[DllImport(__DllName, EntryPoint = "quiche_conn_destination_id", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_destination_id", CallingConvention = CallingConvention.Cdecl)]
public static extern void quiche_conn_destination_id(quiche_conn* conn, byte** @out, UIntPtr* out_len); public static extern void quiche_conn_destination_id(quiche_conn* conn, byte** @out, nuint* out_len);
[DllImport(__DllName, EntryPoint = "quiche_conn_application_proto", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_application_proto", CallingConvention = CallingConvention.Cdecl)]
public static extern void quiche_conn_application_proto(quiche_conn* conn, byte** @out, UIntPtr* out_len); public static extern void quiche_conn_application_proto(quiche_conn* conn, byte** @out, nuint* out_len);
[DllImport(__DllName, EntryPoint = "quiche_conn_peer_cert", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_peer_cert", CallingConvention = CallingConvention.Cdecl)]
public static extern void quiche_conn_peer_cert(quiche_conn* conn, byte** @out, UIntPtr* out_len); public static extern void quiche_conn_peer_cert(quiche_conn* conn, byte** @out, nuint* out_len);
[DllImport(__DllName, EntryPoint = "quiche_conn_session", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_session", CallingConvention = CallingConvention.Cdecl)]
public static extern void quiche_conn_session(quiche_conn* conn, byte** @out, UIntPtr* out_len); public static extern void quiche_conn_session(quiche_conn* conn, byte** @out, nuint* out_len);
[DllImport(__DllName, EntryPoint = "quiche_conn_is_established", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_is_established", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.U1)] [return: MarshalAs(UnmanagedType.U1)]
@ -262,11 +262,11 @@ namespace CsBindgen
[DllImport(__DllName, EntryPoint = "quiche_conn_peer_error", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_peer_error", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.U1)] [return: MarshalAs(UnmanagedType.U1)]
public static extern bool quiche_conn_peer_error(quiche_conn* conn, bool* is_app, ulong* error_code, byte** reason, UIntPtr* reason_len); public static extern bool quiche_conn_peer_error(quiche_conn* conn, bool* is_app, ulong* error_code, byte** reason, nuint* reason_len);
[DllImport(__DllName, EntryPoint = "quiche_conn_local_error", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_local_error", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.U1)] [return: MarshalAs(UnmanagedType.U1)]
public static extern bool quiche_conn_local_error(quiche_conn* conn, bool* is_app, ulong* error_code, byte** reason, UIntPtr* reason_len); public static extern bool quiche_conn_local_error(quiche_conn* conn, bool* is_app, ulong* error_code, byte** reason, nuint* reason_len);
[DllImport(__DllName, EntryPoint = "quiche_conn_stream_init_application_data", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_stream_init_application_data", CallingConvention = CallingConvention.Cdecl)]
public static extern int quiche_conn_stream_init_application_data(quiche_conn* conn, ulong stream_id, void* data); public static extern int quiche_conn_stream_init_application_data(quiche_conn* conn, ulong stream_id, void* data);
@ -285,7 +285,7 @@ namespace CsBindgen
public static extern void quiche_conn_stats(quiche_conn* conn, quiche_stats* @out); public static extern void quiche_conn_stats(quiche_conn* conn, quiche_stats* @out);
[DllImport(__DllName, EntryPoint = "quiche_conn_path_stats", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_path_stats", CallingConvention = CallingConvention.Cdecl)]
public static extern int quiche_conn_path_stats(quiche_conn* conn, UIntPtr idx, quiche_path_stats* @out); public static extern int quiche_conn_path_stats(quiche_conn* conn, nuint idx, quiche_path_stats* @out);
[DllImport(__DllName, EntryPoint = "quiche_conn_dgram_max_writable_len", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_dgram_max_writable_len", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_conn_dgram_max_writable_len(quiche_conn* conn); public static extern long quiche_conn_dgram_max_writable_len(quiche_conn* conn);
@ -306,19 +306,19 @@ namespace CsBindgen
public static extern long quiche_conn_dgram_send_queue_byte_size(quiche_conn* conn); public static extern long quiche_conn_dgram_send_queue_byte_size(quiche_conn* conn);
[DllImport(__DllName, EntryPoint = "quiche_conn_dgram_recv", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_dgram_recv", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_conn_dgram_recv(quiche_conn* conn, byte* buf, UIntPtr buf_len); public static extern long quiche_conn_dgram_recv(quiche_conn* conn, byte* buf, nuint buf_len);
[DllImport(__DllName, EntryPoint = "quiche_conn_dgram_send", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_dgram_send", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_conn_dgram_send(quiche_conn* conn, byte* buf, UIntPtr buf_len); public static extern long quiche_conn_dgram_send(quiche_conn* conn, byte* buf, nuint buf_len);
[DllImport(__DllName, EntryPoint = "quiche_conn_dgram_purge_outgoing", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_dgram_purge_outgoing", CallingConvention = CallingConvention.Cdecl)]
public static extern void quiche_conn_dgram_purge_outgoing(quiche_conn* conn, delegate* unmanaged[Cdecl]<byte*, UIntPtr, bool> f); public static extern void quiche_conn_dgram_purge_outgoing(quiche_conn* conn, delegate* unmanaged[Cdecl]<byte*, nuint, bool> f);
[DllImport(__DllName, EntryPoint = "quiche_conn_send_ack_eliciting", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_send_ack_eliciting", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_conn_send_ack_eliciting(quiche_conn* conn); public static extern long quiche_conn_send_ack_eliciting(quiche_conn* conn);
[DllImport(__DllName, EntryPoint = "quiche_conn_send_ack_eliciting_on_path", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_send_ack_eliciting_on_path", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_conn_send_ack_eliciting_on_path(quiche_conn* conn, sockaddr* local, UIntPtr local_len, sockaddr* peer, UIntPtr peer_len); public static extern long quiche_conn_send_ack_eliciting_on_path(quiche_conn* conn, sockaddr* local, nuint local_len, sockaddr* peer, nuint peer_len);
[DllImport(__DllName, EntryPoint = "quiche_conn_free", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_conn_free", CallingConvention = CallingConvention.Cdecl)]
public static extern void quiche_conn_free(quiche_conn* conn); public static extern void quiche_conn_free(quiche_conn* conn);
@ -354,7 +354,7 @@ namespace CsBindgen
public static extern int quiche_h3_event_type(quiche_h3_event* ev); public static extern int quiche_h3_event_type(quiche_h3_event* ev);
[DllImport(__DllName, EntryPoint = "quiche_h3_event_for_each_header", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_h3_event_for_each_header", CallingConvention = CallingConvention.Cdecl)]
public static extern int quiche_h3_event_for_each_header(quiche_h3_event* ev, delegate* unmanaged[Cdecl]<byte*, UIntPtr, byte*, UIntPtr, void*, int> cb, void* argp); public static extern int quiche_h3_event_for_each_header(quiche_h3_event* ev, delegate* unmanaged[Cdecl]<byte*, nuint, byte*, nuint, void*, int> cb, void* argp);
[DllImport(__DllName, EntryPoint = "quiche_h3_for_each_setting", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_h3_for_each_setting", CallingConvention = CallingConvention.Cdecl)]
public static extern int quiche_h3_for_each_setting(quiche_h3_conn* conn, delegate* unmanaged[Cdecl]<ulong, ulong, void*, int> cb, void* argp); public static extern int quiche_h3_for_each_setting(quiche_h3_conn* conn, delegate* unmanaged[Cdecl]<ulong, ulong, void*, int> cb, void* argp);
@ -371,22 +371,22 @@ namespace CsBindgen
public static extern void quiche_h3_event_free(quiche_h3_event* ev); public static extern void quiche_h3_event_free(quiche_h3_event* ev);
[DllImport(__DllName, EntryPoint = "quiche_h3_send_request", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_h3_send_request", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_h3_send_request(quiche_h3_conn* conn, quiche_conn* quic_conn, quiche_h3_header* headers, UIntPtr headers_len, [MarshalAs(UnmanagedType.U1)] bool fin); public static extern long quiche_h3_send_request(quiche_h3_conn* conn, quiche_conn* quic_conn, quiche_h3_header* headers, nuint headers_len, [MarshalAs(UnmanagedType.U1)] bool fin);
[DllImport(__DllName, EntryPoint = "quiche_h3_send_response", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_h3_send_response", CallingConvention = CallingConvention.Cdecl)]
public static extern int quiche_h3_send_response(quiche_h3_conn* conn, quiche_conn* quic_conn, ulong stream_id, quiche_h3_header* headers, UIntPtr headers_len, [MarshalAs(UnmanagedType.U1)] bool fin); public static extern int quiche_h3_send_response(quiche_h3_conn* conn, quiche_conn* quic_conn, ulong stream_id, quiche_h3_header* headers, nuint headers_len, [MarshalAs(UnmanagedType.U1)] bool fin);
[DllImport(__DllName, EntryPoint = "quiche_h3_send_response_with_priority", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_h3_send_response_with_priority", CallingConvention = CallingConvention.Cdecl)]
public static extern int quiche_h3_send_response_with_priority(quiche_h3_conn* conn, quiche_conn* quic_conn, ulong stream_id, quiche_h3_header* headers, UIntPtr headers_len, quiche_h3_priority* priority, [MarshalAs(UnmanagedType.U1)] bool fin); public static extern int quiche_h3_send_response_with_priority(quiche_h3_conn* conn, quiche_conn* quic_conn, ulong stream_id, quiche_h3_header* headers, nuint headers_len, quiche_h3_priority* priority, [MarshalAs(UnmanagedType.U1)] bool fin);
[DllImport(__DllName, EntryPoint = "quiche_h3_send_body", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_h3_send_body", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_h3_send_body(quiche_h3_conn* conn, quiche_conn* quic_conn, ulong stream_id, byte* body, UIntPtr body_len, [MarshalAs(UnmanagedType.U1)] bool fin); public static extern long quiche_h3_send_body(quiche_h3_conn* conn, quiche_conn* quic_conn, ulong stream_id, byte* body, nuint body_len, [MarshalAs(UnmanagedType.U1)] bool fin);
[DllImport(__DllName, EntryPoint = "quiche_h3_recv_body", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_h3_recv_body", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_h3_recv_body(quiche_h3_conn* conn, quiche_conn* quic_conn, ulong stream_id, byte* @out, UIntPtr out_len); public static extern long quiche_h3_recv_body(quiche_h3_conn* conn, quiche_conn* quic_conn, ulong stream_id, byte* @out, nuint out_len);
[DllImport(__DllName, EntryPoint = "quiche_h3_parse_extensible_priority", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_h3_parse_extensible_priority", CallingConvention = CallingConvention.Cdecl)]
public static extern int quiche_h3_parse_extensible_priority(byte* priority, UIntPtr priority_len, quiche_h3_priority* parsed); public static extern int quiche_h3_parse_extensible_priority(byte* priority, nuint priority_len, quiche_h3_priority* parsed);
/// <summary>Sends a PRIORITY_UPDATE frame on the control stream with specified request stream ID and priority.</summary> /// <summary>Sends a PRIORITY_UPDATE frame on the control stream with specified request stream ID and priority.</summary>
[DllImport(__DllName, EntryPoint = "quiche_h3_send_priority_update_for_request", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_h3_send_priority_update_for_request", CallingConvention = CallingConvention.Cdecl)]
@ -400,10 +400,10 @@ namespace CsBindgen
public static extern bool quiche_h3_dgram_enabled_by_peer(quiche_h3_conn* conn, quiche_conn* quic_conn); public static extern bool quiche_h3_dgram_enabled_by_peer(quiche_h3_conn* conn, quiche_conn* quic_conn);
[DllImport(__DllName, EntryPoint = "quiche_h3_send_dgram", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_h3_send_dgram", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_h3_send_dgram(quiche_h3_conn* conn, quiche_conn* quic_conn, ulong flow_id, byte* data, UIntPtr data_len); public static extern long quiche_h3_send_dgram(quiche_h3_conn* conn, quiche_conn* quic_conn, ulong flow_id, byte* data, nuint data_len);
[DllImport(__DllName, EntryPoint = "quiche_h3_recv_dgram", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_h3_recv_dgram", CallingConvention = CallingConvention.Cdecl)]
public static extern long quiche_h3_recv_dgram(quiche_h3_conn* conn, quiche_conn* quic_conn, ulong* flow_id, UIntPtr* flow_id_len, byte* @out, UIntPtr out_len); public static extern long quiche_h3_recv_dgram(quiche_h3_conn* conn, quiche_conn* quic_conn, ulong* flow_id, nuint* flow_id_len, byte* @out, nuint out_len);
[DllImport(__DllName, EntryPoint = "quiche_h3_conn_free", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "quiche_h3_conn_free", CallingConvention = CallingConvention.Cdecl)]
public static extern void quiche_h3_conn_free(quiche_h3_conn* conn); public static extern void quiche_h3_conn_free(quiche_h3_conn* conn);
@ -431,7 +431,7 @@ namespace CsBindgen
internal unsafe partial struct timespec internal unsafe partial struct timespec
{ {
public long tv_sec; public long tv_sec;
public int tv_nsec; public CLong tv_nsec;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
@ -474,15 +474,15 @@ namespace CsBindgen
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
internal unsafe partial struct quiche_stats internal unsafe partial struct quiche_stats
{ {
public UIntPtr recv; public nuint recv;
public UIntPtr sent; public nuint sent;
public UIntPtr lost; public nuint lost;
public UIntPtr retrans; public nuint retrans;
public ulong sent_bytes; public ulong sent_bytes;
public ulong recv_bytes; public ulong recv_bytes;
public ulong lost_bytes; public ulong lost_bytes;
public ulong stream_retrans_bytes; public ulong stream_retrans_bytes;
public UIntPtr paths_count; public nuint paths_count;
public ulong peer_max_idle_timeout; public ulong peer_max_idle_timeout;
public ulong peer_max_udp_payload_size; public ulong peer_max_udp_payload_size;
public ulong peer_initial_max_data; public ulong peer_initial_max_data;
@ -507,17 +507,17 @@ namespace CsBindgen
public int peer_addr_len; public int peer_addr_len;
public long validation_state; public long validation_state;
[MarshalAs(UnmanagedType.U1)] public bool active; [MarshalAs(UnmanagedType.U1)] public bool active;
public UIntPtr recv; public nuint recv;
public UIntPtr sent; public nuint sent;
public UIntPtr lost; public nuint lost;
public UIntPtr retrans; public nuint retrans;
public ulong rtt; public ulong rtt;
public UIntPtr cwnd; public nuint cwnd;
public ulong sent_bytes; public ulong sent_bytes;
public ulong recv_bytes; public ulong recv_bytes;
public ulong lost_bytes; public ulong lost_bytes;
public ulong stream_retrans_bytes; public ulong stream_retrans_bytes;
public UIntPtr pmtu; public nuint pmtu;
public ulong delivery_rate; public ulong delivery_rate;
} }
@ -543,9 +543,9 @@ namespace CsBindgen
internal unsafe partial struct quiche_h3_header internal unsafe partial struct quiche_h3_header
{ {
public byte* name; public byte* name;
public UIntPtr name_len; public nuint name_len;
public byte* value; public byte* value;
public UIntPtr value_len; public nuint value_len;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]

View File

@ -22,31 +22,31 @@ namespace CsBindgen
/// <summary>Simple API//*! ZSTD_compress() : Compresses `src` content as a single zstd compressed frame into already allocated `dst`. Hint : compression runs faster if `dstCapacity` &gt;= `ZSTD_compressBound(srcSize)`. @return : compressed size written into `dst` (&lt;= `dstCapacity), or an error code if it fails (which can be tested using ZSTD_isError()).</summary> /// <summary>Simple API//*! ZSTD_compress() : Compresses `src` content as a single zstd compressed frame into already allocated `dst`. Hint : compression runs faster if `dstCapacity` &gt;= `ZSTD_compressBound(srcSize)`. @return : compressed size written into `dst` (&lt;= `dstCapacity), or an error code if it fails (which can be tested using ZSTD_isError()).</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_compress", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_compress", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_compress(void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, int compressionLevel); public static extern nuint ZSTD_compress(void* dst, nuint dstCapacity, void* src, nuint srcSize, int compressionLevel);
/// <summary>ZSTD_decompress() : `compressedSize` : must be the _exact_ size of some number of compressed and/or skippable frames. `dstCapacity` is an upper bound of originalSize to regenerate. If user cannot imply a maximum upper bound, it's better to use streaming mode to decompress data. @return : the number of bytes decompressed into `dst` (&lt;= `dstCapacity`), or an errorCode if it fails (which can be tested using ZSTD_isError()).</summary> /// <summary>ZSTD_decompress() : `compressedSize` : must be the _exact_ size of some number of compressed and/or skippable frames. `dstCapacity` is an upper bound of originalSize to regenerate. If user cannot imply a maximum upper bound, it's better to use streaming mode to decompress data. @return : the number of bytes decompressed into `dst` (&lt;= `dstCapacity`), or an errorCode if it fails (which can be tested using ZSTD_isError()).</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_decompress", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_decompress", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_decompress(void* dst, UIntPtr dstCapacity, void* src, UIntPtr compressedSize); public static extern nuint ZSTD_decompress(void* dst, nuint dstCapacity, void* src, nuint compressedSize);
[DllImport(__DllName, EntryPoint = "ZSTD_getFrameContentSize", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_getFrameContentSize", CallingConvention = CallingConvention.Cdecl)]
public static extern ulong ZSTD_getFrameContentSize(void* src, UIntPtr srcSize); public static extern ulong ZSTD_getFrameContentSize(void* src, nuint srcSize);
/// <summary>ZSTD_getDecompressedSize() : NOTE: This function is now obsolete, in favor of ZSTD_getFrameContentSize(). Both functions work the same way, but ZSTD_getDecompressedSize() blends \"empty\", \"unknown\" and \"error\" results to the same return value (0), while ZSTD_getFrameContentSize() gives them separate return values. @return : decompressed size of `src` frame content _if known and not empty_, 0 otherwise.</summary> /// <summary>ZSTD_getDecompressedSize() : NOTE: This function is now obsolete, in favor of ZSTD_getFrameContentSize(). Both functions work the same way, but ZSTD_getDecompressedSize() blends \"empty\", \"unknown\" and \"error\" results to the same return value (0), while ZSTD_getFrameContentSize() gives them separate return values. @return : decompressed size of `src` frame content _if known and not empty_, 0 otherwise.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_getDecompressedSize", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_getDecompressedSize", CallingConvention = CallingConvention.Cdecl)]
public static extern ulong ZSTD_getDecompressedSize(void* src, UIntPtr srcSize); public static extern ulong ZSTD_getDecompressedSize(void* src, nuint srcSize);
/// <summary>ZSTD_findFrameCompressedSize() : Requires v1.4.0+ `src` should point to the start of a ZSTD frame or skippable frame. `srcSize` must be &gt;= first frame size @return : the compressed size of the first frame starting at `src`, suitable to pass as `srcSize` to `ZSTD_decompress` or similar, or an error code if input is invalid</summary> /// <summary>ZSTD_findFrameCompressedSize() : Requires v1.4.0+ `src` should point to the start of a ZSTD frame or skippable frame. `srcSize` must be &gt;= first frame size @return : the compressed size of the first frame starting at `src`, suitable to pass as `srcSize` to `ZSTD_decompress` or similar, or an error code if input is invalid</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_findFrameCompressedSize", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_findFrameCompressedSize", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_findFrameCompressedSize(void* src, UIntPtr srcSize); public static extern nuint ZSTD_findFrameCompressedSize(void* src, nuint srcSize);
[DllImport(__DllName, EntryPoint = "ZSTD_compressBound", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_compressBound", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_compressBound(UIntPtr srcSize); public static extern nuint ZSTD_compressBound(nuint srcSize);
[DllImport(__DllName, EntryPoint = "ZSTD_isError", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_isError", CallingConvention = CallingConvention.Cdecl)]
public static extern uint ZSTD_isError(UIntPtr code); public static extern uint ZSTD_isError(nuint code);
[DllImport(__DllName, EntryPoint = "ZSTD_getErrorName", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_getErrorName", CallingConvention = CallingConvention.Cdecl)]
public static extern byte* ZSTD_getErrorName(UIntPtr code); public static extern byte* ZSTD_getErrorName(nuint code);
[DllImport(__DllName, EntryPoint = "ZSTD_minCLevel", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_minCLevel", CallingConvention = CallingConvention.Cdecl)]
public static extern int ZSTD_minCLevel(); public static extern int ZSTD_minCLevel();
@ -61,21 +61,21 @@ namespace CsBindgen
public static extern ZSTD_CCtx_s* ZSTD_createCCtx(); public static extern ZSTD_CCtx_s* ZSTD_createCCtx();
[DllImport(__DllName, EntryPoint = "ZSTD_freeCCtx", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_freeCCtx", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_freeCCtx(ZSTD_CCtx_s* cctx); public static extern nuint ZSTD_freeCCtx(ZSTD_CCtx_s* cctx);
/// <summary>ZSTD_compressCCtx() : Same as ZSTD_compress(), using an explicit ZSTD_CCtx. Important : in order to behave similarly to `ZSTD_compress()`, this function compresses at requested compression level, __ignoring any other parameter__ . If any advanced parameter was set using the advanced API, they will all be reset. Only `compressionLevel` remains.</summary> /// <summary>ZSTD_compressCCtx() : Same as ZSTD_compress(), using an explicit ZSTD_CCtx. Important : in order to behave similarly to `ZSTD_compress()`, this function compresses at requested compression level, __ignoring any other parameter__ . If any advanced parameter was set using the advanced API, they will all be reset. Only `compressionLevel` remains.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_compressCCtx", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_compressCCtx", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_compressCCtx(ZSTD_CCtx_s* cctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, int compressionLevel); public static extern nuint ZSTD_compressCCtx(ZSTD_CCtx_s* cctx, void* dst, nuint dstCapacity, void* src, nuint srcSize, int compressionLevel);
[DllImport(__DllName, EntryPoint = "ZSTD_createDCtx", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_createDCtx", CallingConvention = CallingConvention.Cdecl)]
public static extern ZSTD_DCtx_s* ZSTD_createDCtx(); public static extern ZSTD_DCtx_s* ZSTD_createDCtx();
[DllImport(__DllName, EntryPoint = "ZSTD_freeDCtx", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_freeDCtx", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_freeDCtx(ZSTD_DCtx_s* dctx); public static extern nuint ZSTD_freeDCtx(ZSTD_DCtx_s* dctx);
/// <summary>ZSTD_decompressDCtx() : Same as ZSTD_decompress(), requires an allocated ZSTD_DCtx. Compatible with sticky parameters.</summary> /// <summary>ZSTD_decompressDCtx() : Same as ZSTD_decompress(), requires an allocated ZSTD_DCtx. Compatible with sticky parameters.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_decompressDCtx", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_decompressDCtx", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_decompressDCtx(ZSTD_DCtx_s* dctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize); public static extern nuint ZSTD_decompressDCtx(ZSTD_DCtx_s* dctx, void* dst, nuint dstCapacity, void* src, nuint srcSize);
/// <summary>ZSTD_cParam_getBounds() : All parameters must belong to an interval with lower and upper bounds, otherwise they will either trigger an error or be automatically clamped. @return : a structure, ZSTD_bounds, which contains - an error status field, which must be tested using ZSTD_isError() - lower and upper bounds, both inclusive</summary> /// <summary>ZSTD_cParam_getBounds() : All parameters must belong to an interval with lower and upper bounds, otherwise they will either trigger an error or be automatically clamped. @return : a structure, ZSTD_bounds, which contains - an error status field, which must be tested using ZSTD_isError() - lower and upper bounds, both inclusive</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_cParam_getBounds", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_cParam_getBounds", CallingConvention = CallingConvention.Cdecl)]
@ -83,19 +83,19 @@ namespace CsBindgen
/// <summary>ZSTD_CCtx_setParameter() : Set one compression parameter, selected by enum ZSTD_cParameter. All parameters have valid bounds. Bounds can be queried using ZSTD_cParam_getBounds(). Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter). Setting a parameter is generally only possible during frame initialization (before starting compression). Exception : when using multi-threading mode (nbWorkers &gt;= 1), the following parameters can be updated _during_ compression (within same frame): =&gt; compressionLevel, hashLog, chainLog, searchLog, minMatch, targetLength and strategy. new parameters will be active for next job only (after a flush()). @return : an error code (which can be tested using ZSTD_isError()).</summary> /// <summary>ZSTD_CCtx_setParameter() : Set one compression parameter, selected by enum ZSTD_cParameter. All parameters have valid bounds. Bounds can be queried using ZSTD_cParam_getBounds(). Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter). Setting a parameter is generally only possible during frame initialization (before starting compression). Exception : when using multi-threading mode (nbWorkers &gt;= 1), the following parameters can be updated _during_ compression (within same frame): =&gt; compressionLevel, hashLog, chainLog, searchLog, minMatch, targetLength and strategy. new parameters will be active for next job only (after a flush()). @return : an error code (which can be tested using ZSTD_isError()).</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_CCtx_setParameter", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_CCtx_setParameter", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_CCtx_setParameter(ZSTD_CCtx_s* cctx, int param, int value); public static extern nuint ZSTD_CCtx_setParameter(ZSTD_CCtx_s* cctx, int param, int value);
/// <summary>ZSTD_CCtx_setPledgedSrcSize() : Total input data size to be compressed as a single frame. Value will be written in frame header, unless if explicitly forbidden using ZSTD_c_contentSizeFlag. This value will also be controlled at end of frame, and trigger an error if not respected. @result : 0, or an error code (which can be tested with ZSTD_isError()). Note 1 : pledgedSrcSize==0 actually means zero, aka an empty frame. In order to mean \"unknown content size\", pass constant ZSTD_CONTENTSIZE_UNKNOWN. ZSTD_CONTENTSIZE_UNKNOWN is default value for any new frame. Note 2 : pledgedSrcSize is only valid once, for the next frame. It's discarded at the end of the frame, and replaced by ZSTD_CONTENTSIZE_UNKNOWN. Note 3 : Whenever all input data is provided and consumed in a single round, for example with ZSTD_compress2(), or invoking immediately ZSTD_compressStream2(,,,ZSTD_e_end), this value is automatically overridden by srcSize instead.</summary> /// <summary>ZSTD_CCtx_setPledgedSrcSize() : Total input data size to be compressed as a single frame. Value will be written in frame header, unless if explicitly forbidden using ZSTD_c_contentSizeFlag. This value will also be controlled at end of frame, and trigger an error if not respected. @result : 0, or an error code (which can be tested with ZSTD_isError()). Note 1 : pledgedSrcSize==0 actually means zero, aka an empty frame. In order to mean \"unknown content size\", pass constant ZSTD_CONTENTSIZE_UNKNOWN. ZSTD_CONTENTSIZE_UNKNOWN is default value for any new frame. Note 2 : pledgedSrcSize is only valid once, for the next frame. It's discarded at the end of the frame, and replaced by ZSTD_CONTENTSIZE_UNKNOWN. Note 3 : Whenever all input data is provided and consumed in a single round, for example with ZSTD_compress2(), or invoking immediately ZSTD_compressStream2(,,,ZSTD_e_end), this value is automatically overridden by srcSize instead.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_CCtx_setPledgedSrcSize", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_CCtx_setPledgedSrcSize", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx_s* cctx, ulong pledgedSrcSize); public static extern nuint ZSTD_CCtx_setPledgedSrcSize(ZSTD_CCtx_s* cctx, ulong pledgedSrcSize);
/// <summary>ZSTD_CCtx_reset() : There are 2 different things that can be reset, independently or jointly : - The session : will stop compressing current frame, and make CCtx ready to start a new one. Useful after an error, or to interrupt any ongoing compression. Any internal data not yet flushed is cancelled. Compression parameters and dictionary remain unchanged. They will be used to compress next frame. Resetting session never fails. - The parameters : changes all parameters back to \"default\". This also removes any reference to any dictionary or external sequence producer. Parameters can only be changed between 2 sessions (i.e. no compression is currently ongoing) otherwise the reset fails, and function returns an error value (which can be tested using ZSTD_isError()) - Both : similar to resetting the session, followed by resetting parameters.</summary> /// <summary>ZSTD_CCtx_reset() : There are 2 different things that can be reset, independently or jointly : - The session : will stop compressing current frame, and make CCtx ready to start a new one. Useful after an error, or to interrupt any ongoing compression. Any internal data not yet flushed is cancelled. Compression parameters and dictionary remain unchanged. They will be used to compress next frame. Resetting session never fails. - The parameters : changes all parameters back to \"default\". This also removes any reference to any dictionary or external sequence producer. Parameters can only be changed between 2 sessions (i.e. no compression is currently ongoing) otherwise the reset fails, and function returns an error value (which can be tested using ZSTD_isError()) - Both : similar to resetting the session, followed by resetting parameters.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_CCtx_reset", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_CCtx_reset", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_CCtx_reset(ZSTD_CCtx_s* cctx, int reset); public static extern nuint ZSTD_CCtx_reset(ZSTD_CCtx_s* cctx, int reset);
/// <summary>ZSTD_compress2() : Behave the same as ZSTD_compressCCtx(), but compression parameters are set using the advanced API. ZSTD_compress2() always starts a new frame. Should cctx hold data from a previously unfinished frame, everything about it is forgotten. - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*() - The function is always blocking, returns when compression is completed. Hint : compression runs faster if `dstCapacity` &gt;= `ZSTD_compressBound(srcSize)`. @return : compressed size written into `dst` (&lt;= `dstCapacity), or an error code if it fails (which can be tested using ZSTD_isError()).</summary> /// <summary>ZSTD_compress2() : Behave the same as ZSTD_compressCCtx(), but compression parameters are set using the advanced API. ZSTD_compress2() always starts a new frame. Should cctx hold data from a previously unfinished frame, everything about it is forgotten. - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*() - The function is always blocking, returns when compression is completed. Hint : compression runs faster if `dstCapacity` &gt;= `ZSTD_compressBound(srcSize)`. @return : compressed size written into `dst` (&lt;= `dstCapacity), or an error code if it fails (which can be tested using ZSTD_isError()).</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_compress2", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_compress2", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_compress2(ZSTD_CCtx_s* cctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize); public static extern nuint ZSTD_compress2(ZSTD_CCtx_s* cctx, void* dst, nuint dstCapacity, void* src, nuint srcSize);
/// <summary>ZSTD_dParam_getBounds() : All parameters must belong to an interval with lower and upper bounds, otherwise they will either trigger an error or be automatically clamped. @return : a structure, ZSTD_bounds, which contains - an error status field, which must be tested using ZSTD_isError() - both lower and upper bounds, inclusive</summary> /// <summary>ZSTD_dParam_getBounds() : All parameters must belong to an interval with lower and upper bounds, otherwise they will either trigger an error or be automatically clamped. @return : a structure, ZSTD_bounds, which contains - an error status field, which must be tested using ZSTD_isError() - both lower and upper bounds, inclusive</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_dParam_getBounds", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_dParam_getBounds", CallingConvention = CallingConvention.Cdecl)]
@ -103,99 +103,99 @@ namespace CsBindgen
/// <summary>ZSTD_DCtx_setParameter() : Set one compression parameter, selected by enum ZSTD_dParameter. All parameters have valid bounds. Bounds can be queried using ZSTD_dParam_getBounds(). Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter). Setting a parameter is only possible during frame initialization (before starting decompression). @return : 0, or an error code (which can be tested using ZSTD_isError()).</summary> /// <summary>ZSTD_DCtx_setParameter() : Set one compression parameter, selected by enum ZSTD_dParameter. All parameters have valid bounds. Bounds can be queried using ZSTD_dParam_getBounds(). Providing a value beyond bound will either clamp it, or trigger an error (depending on parameter). Setting a parameter is only possible during frame initialization (before starting decompression). @return : 0, or an error code (which can be tested using ZSTD_isError()).</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_DCtx_setParameter", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_DCtx_setParameter", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_DCtx_setParameter(ZSTD_DCtx_s* dctx, int param, int value); public static extern nuint ZSTD_DCtx_setParameter(ZSTD_DCtx_s* dctx, int param, int value);
/// <summary>ZSTD_DCtx_reset() : Return a DCtx to clean state. Session and parameters can be reset jointly or separately. Parameters can only be reset when no active frame is being decompressed. @return : 0, or an error code, which can be tested with ZSTD_isError()</summary> /// <summary>ZSTD_DCtx_reset() : Return a DCtx to clean state. Session and parameters can be reset jointly or separately. Parameters can only be reset when no active frame is being decompressed. @return : 0, or an error code, which can be tested with ZSTD_isError()</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_DCtx_reset", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_DCtx_reset", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_DCtx_reset(ZSTD_DCtx_s* dctx, int reset); public static extern nuint ZSTD_DCtx_reset(ZSTD_DCtx_s* dctx, int reset);
[DllImport(__DllName, EntryPoint = "ZSTD_createCStream", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_createCStream", CallingConvention = CallingConvention.Cdecl)]
public static extern ZSTD_CCtx_s* ZSTD_createCStream(); public static extern ZSTD_CCtx_s* ZSTD_createCStream();
[DllImport(__DllName, EntryPoint = "ZSTD_freeCStream", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_freeCStream", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_freeCStream(ZSTD_CCtx_s* zcs); public static extern nuint ZSTD_freeCStream(ZSTD_CCtx_s* zcs);
/// <summary>ZSTD_compressStream2() : Requires v1.4.0+ Behaves about the same as ZSTD_compressStream, with additional control on end directive. - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*() - Compression parameters cannot be changed once compression is started (save a list of exceptions in multi-threading mode) - output-&gt;pos must be &lt;= dstCapacity, input-&gt;pos must be &lt;= srcSize - output-&gt;pos and input-&gt;pos will be updated. They are guaranteed to remain below their respective limit. - endOp must be a valid directive - When nbWorkers==0 (default), function is blocking : it completes its job before returning to caller. - When nbWorkers&gt;=1, function is non-blocking : it copies a portion of input, distributes jobs to internal worker threads, flush to output whatever is available, and then immediately returns, just indicating that there is some data remaining to be flushed. The function nonetheless guarantees forward progress : it will return only after it reads or write at least 1+ byte. - Exception : if the first call requests a ZSTD_e_end directive and provides enough dstCapacity, the function delegates to ZSTD_compress2() which is always blocking. - @return provides a minimum amount of data remaining to be flushed from internal buffers or an error code, which can be tested using ZSTD_isError(). if @return != 0, flush is not fully completed, there is still some data left within internal buffers. This is useful for ZSTD_e_flush, since in this case more flushes are necessary to empty all buffers. For ZSTD_e_end, @return == 0 when internal buffers are fully flushed and frame is completed. - after a ZSTD_e_end directive, if internal buffer is not fully flushed (@return != 0), only ZSTD_e_end or ZSTD_e_flush operations are allowed. Before starting a new compression job, or changing compression parameters, it is required to fully flush internal buffers.</summary> /// <summary>ZSTD_compressStream2() : Requires v1.4.0+ Behaves about the same as ZSTD_compressStream, with additional control on end directive. - Compression parameters are pushed into CCtx before starting compression, using ZSTD_CCtx_set*() - Compression parameters cannot be changed once compression is started (save a list of exceptions in multi-threading mode) - output-&gt;pos must be &lt;= dstCapacity, input-&gt;pos must be &lt;= srcSize - output-&gt;pos and input-&gt;pos will be updated. They are guaranteed to remain below their respective limit. - endOp must be a valid directive - When nbWorkers==0 (default), function is blocking : it completes its job before returning to caller. - When nbWorkers&gt;=1, function is non-blocking : it copies a portion of input, distributes jobs to internal worker threads, flush to output whatever is available, and then immediately returns, just indicating that there is some data remaining to be flushed. The function nonetheless guarantees forward progress : it will return only after it reads or write at least 1+ byte. - Exception : if the first call requests a ZSTD_e_end directive and provides enough dstCapacity, the function delegates to ZSTD_compress2() which is always blocking. - @return provides a minimum amount of data remaining to be flushed from internal buffers or an error code, which can be tested using ZSTD_isError(). if @return != 0, flush is not fully completed, there is still some data left within internal buffers. This is useful for ZSTD_e_flush, since in this case more flushes are necessary to empty all buffers. For ZSTD_e_end, @return == 0 when internal buffers are fully flushed and frame is completed. - after a ZSTD_e_end directive, if internal buffer is not fully flushed (@return != 0), only ZSTD_e_end or ZSTD_e_flush operations are allowed. Before starting a new compression job, or changing compression parameters, it is required to fully flush internal buffers.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_compressStream2", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_compressStream2", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_compressStream2(ZSTD_CCtx_s* cctx, ZSTD_outBuffer_s* output, ZSTD_inBuffer_s* input, int endOp); public static extern nuint ZSTD_compressStream2(ZSTD_CCtx_s* cctx, ZSTD_outBuffer_s* output, ZSTD_inBuffer_s* input, int endOp);
[DllImport(__DllName, EntryPoint = "ZSTD_CStreamInSize", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_CStreamInSize", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_CStreamInSize(); public static extern nuint ZSTD_CStreamInSize();
[DllImport(__DllName, EntryPoint = "ZSTD_CStreamOutSize", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_CStreamOutSize", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_CStreamOutSize(); public static extern nuint ZSTD_CStreamOutSize();
/// <summary>Equivalent to: ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any) ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel); Note that ZSTD_initCStream() clears any previously set dictionary. Use the new API to compress with a dictionary.</summary> /// <summary>Equivalent to: ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); ZSTD_CCtx_refCDict(zcs, NULL); // clear the dictionary (if any) ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel); Note that ZSTD_initCStream() clears any previously set dictionary. Use the new API to compress with a dictionary.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_initCStream", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_initCStream", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_initCStream(ZSTD_CCtx_s* zcs, int compressionLevel); public static extern nuint ZSTD_initCStream(ZSTD_CCtx_s* zcs, int compressionLevel);
/// <summary>Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue). NOTE: The return value is different. ZSTD_compressStream() returns a hint for the next read size (if non-zero and not an error). ZSTD_compressStream2() returns the minimum nb of bytes left to flush (if non-zero and not an error).</summary> /// <summary>Alternative for ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue). NOTE: The return value is different. ZSTD_compressStream() returns a hint for the next read size (if non-zero and not an error). ZSTD_compressStream2() returns the minimum nb of bytes left to flush (if non-zero and not an error).</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_compressStream", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_compressStream", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_compressStream(ZSTD_CCtx_s* zcs, ZSTD_outBuffer_s* output, ZSTD_inBuffer_s* input); public static extern nuint ZSTD_compressStream(ZSTD_CCtx_s* zcs, ZSTD_outBuffer_s* output, ZSTD_inBuffer_s* input);
/// <summary>Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush).</summary> /// <summary>Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_flush).</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_flushStream", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_flushStream", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_flushStream(ZSTD_CCtx_s* zcs, ZSTD_outBuffer_s* output); public static extern nuint ZSTD_flushStream(ZSTD_CCtx_s* zcs, ZSTD_outBuffer_s* output);
/// <summary>Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end).</summary> /// <summary>Equivalent to ZSTD_compressStream2(zcs, output, &emptyInput, ZSTD_e_end).</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_endStream", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_endStream", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_endStream(ZSTD_CCtx_s* zcs, ZSTD_outBuffer_s* output); public static extern nuint ZSTD_endStream(ZSTD_CCtx_s* zcs, ZSTD_outBuffer_s* output);
[DllImport(__DllName, EntryPoint = "ZSTD_createDStream", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_createDStream", CallingConvention = CallingConvention.Cdecl)]
public static extern ZSTD_DCtx_s* ZSTD_createDStream(); public static extern ZSTD_DCtx_s* ZSTD_createDStream();
[DllImport(__DllName, EntryPoint = "ZSTD_freeDStream", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_freeDStream", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_freeDStream(ZSTD_DCtx_s* zds); public static extern nuint ZSTD_freeDStream(ZSTD_DCtx_s* zds);
/// <summary>ZSTD_initDStream() : Initialize/reset DStream state for new decompression operation. Call before new decompression operation using same DStream. Note : This function is redundant with the advanced API and equivalent to: ZSTD_DCtx_reset(zds, ZSTD_reset_session_only); ZSTD_DCtx_refDDict(zds, NULL);</summary> /// <summary>ZSTD_initDStream() : Initialize/reset DStream state for new decompression operation. Call before new decompression operation using same DStream. Note : This function is redundant with the advanced API and equivalent to: ZSTD_DCtx_reset(zds, ZSTD_reset_session_only); ZSTD_DCtx_refDDict(zds, NULL);</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_initDStream", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_initDStream", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_initDStream(ZSTD_DCtx_s* zds); public static extern nuint ZSTD_initDStream(ZSTD_DCtx_s* zds);
/// <summary>ZSTD_decompressStream() : Streaming decompression function. Call repetitively to consume full input updating it as necessary. Function will update both input and output `pos` fields exposing current state via these fields: - `input.pos &lt; input.size`, some input remaining and caller should provide remaining input on the next call. - `output.pos &lt; output.size`, decoder finished and flushed all remaining buffers. - `output.pos == output.size`, potentially uncflushed data present in the internal buffers, call ZSTD_decompressStream() again to flush remaining data to output. Note : with no additional input, amount of data flushed &lt;= ZSTD_BLOCKSIZE_MAX. @return : 0 when a frame is completely decoded and fully flushed, or an error code, which can be tested using ZSTD_isError(), or any other value &gt; 0, which means there is some decoding or flushing to do to complete current frame.</summary> /// <summary>ZSTD_decompressStream() : Streaming decompression function. Call repetitively to consume full input updating it as necessary. Function will update both input and output `pos` fields exposing current state via these fields: - `input.pos &lt; input.size`, some input remaining and caller should provide remaining input on the next call. - `output.pos &lt; output.size`, decoder finished and flushed all remaining buffers. - `output.pos == output.size`, potentially uncflushed data present in the internal buffers, call ZSTD_decompressStream() again to flush remaining data to output. Note : with no additional input, amount of data flushed &lt;= ZSTD_BLOCKSIZE_MAX. @return : 0 when a frame is completely decoded and fully flushed, or an error code, which can be tested using ZSTD_isError(), or any other value &gt; 0, which means there is some decoding or flushing to do to complete current frame.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_decompressStream", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_decompressStream", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_decompressStream(ZSTD_DCtx_s* zds, ZSTD_outBuffer_s* output, ZSTD_inBuffer_s* input); public static extern nuint ZSTD_decompressStream(ZSTD_DCtx_s* zds, ZSTD_outBuffer_s* output, ZSTD_inBuffer_s* input);
[DllImport(__DllName, EntryPoint = "ZSTD_DStreamInSize", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_DStreamInSize", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_DStreamInSize(); public static extern nuint ZSTD_DStreamInSize();
[DllImport(__DllName, EntryPoint = "ZSTD_DStreamOutSize", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_DStreamOutSize", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_DStreamOutSize(); public static extern nuint ZSTD_DStreamOutSize();
/// <summary>Simple dictionary API//*! ZSTD_compress_usingDict() : Compression at an explicit compression level using a Dictionary. A dictionary can be any arbitrary data segment (also called a prefix), or a buffer with specified information (see zdict.h). Note : This function loads the dictionary, resulting in significant startup delay. It's intended for a dictionary used only once. Note 2 : When `dict == NULL || dictSize &lt; 8` no dictionary is used.</summary> /// <summary>Simple dictionary API//*! ZSTD_compress_usingDict() : Compression at an explicit compression level using a Dictionary. A dictionary can be any arbitrary data segment (also called a prefix), or a buffer with specified information (see zdict.h). Note : This function loads the dictionary, resulting in significant startup delay. It's intended for a dictionary used only once. Note 2 : When `dict == NULL || dictSize &lt; 8` no dictionary is used.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_compress_usingDict", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_compress_usingDict", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_compress_usingDict(ZSTD_CCtx_s* ctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, void* dict, UIntPtr dictSize, int compressionLevel); public static extern nuint ZSTD_compress_usingDict(ZSTD_CCtx_s* ctx, void* dst, nuint dstCapacity, void* src, nuint srcSize, void* dict, nuint dictSize, int compressionLevel);
/// <summary>ZSTD_decompress_usingDict() : Decompression using a known Dictionary. Dictionary must be identical to the one used during compression. Note : This function loads the dictionary, resulting in significant startup delay. It's intended for a dictionary used only once. Note : When `dict == NULL || dictSize &lt; 8` no dictionary is used.</summary> /// <summary>ZSTD_decompress_usingDict() : Decompression using a known Dictionary. Dictionary must be identical to the one used during compression. Note : This function loads the dictionary, resulting in significant startup delay. It's intended for a dictionary used only once. Note : When `dict == NULL || dictSize &lt; 8` no dictionary is used.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_decompress_usingDict", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_decompress_usingDict", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_decompress_usingDict(ZSTD_DCtx_s* dctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, void* dict, UIntPtr dictSize); public static extern nuint ZSTD_decompress_usingDict(ZSTD_DCtx_s* dctx, void* dst, nuint dstCapacity, void* src, nuint srcSize, void* dict, nuint dictSize);
/// <summary>ZSTD_createCDict() : When compressing multiple messages or blocks using the same dictionary, it's recommended to digest the dictionary only once, since it's a costly operation. ZSTD_createCDict() will create a state from digesting a dictionary. The resulting state can be used for future compression operations with very limited startup cost. ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only. @dictBuffer can be released after ZSTD_CDict creation, because its content is copied within CDict. Note 1 : Consider experimental function `ZSTD_createCDict_byReference()` if you prefer to not duplicate @dictBuffer content. Note 2 : A ZSTD_CDict can be created from an empty @dictBuffer, in which case the only thing that it transports is the @compressionLevel. This can be useful in a pipeline featuring ZSTD_compress_usingCDict() exclusively, expecting a ZSTD_CDict parameter with any data, including those without a known dictionary.</summary> /// <summary>ZSTD_createCDict() : When compressing multiple messages or blocks using the same dictionary, it's recommended to digest the dictionary only once, since it's a costly operation. ZSTD_createCDict() will create a state from digesting a dictionary. The resulting state can be used for future compression operations with very limited startup cost. ZSTD_CDict can be created once and shared by multiple threads concurrently, since its usage is read-only. @dictBuffer can be released after ZSTD_CDict creation, because its content is copied within CDict. Note 1 : Consider experimental function `ZSTD_createCDict_byReference()` if you prefer to not duplicate @dictBuffer content. Note 2 : A ZSTD_CDict can be created from an empty @dictBuffer, in which case the only thing that it transports is the @compressionLevel. This can be useful in a pipeline featuring ZSTD_compress_usingCDict() exclusively, expecting a ZSTD_CDict parameter with any data, including those without a known dictionary.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_createCDict", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_createCDict", CallingConvention = CallingConvention.Cdecl)]
public static extern ZSTD_CDict_s* ZSTD_createCDict(void* dictBuffer, UIntPtr dictSize, int compressionLevel); public static extern ZSTD_CDict_s* ZSTD_createCDict(void* dictBuffer, nuint dictSize, int compressionLevel);
/// <summary>ZSTD_freeCDict() : Function frees memory allocated by ZSTD_createCDict(). If a NULL pointer is passed, no operation is performed.</summary> /// <summary>ZSTD_freeCDict() : Function frees memory allocated by ZSTD_createCDict(). If a NULL pointer is passed, no operation is performed.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_freeCDict", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_freeCDict", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_freeCDict(ZSTD_CDict_s* CDict); public static extern nuint ZSTD_freeCDict(ZSTD_CDict_s* CDict);
/// <summary>ZSTD_compress_usingCDict() : Compression using a digested Dictionary. Recommended when same dictionary is used multiple times. Note : compression level is _decided at dictionary creation time_, and frame parameters are hardcoded (dictID=yes, contentSize=yes, checksum=no)</summary> /// <summary>ZSTD_compress_usingCDict() : Compression using a digested Dictionary. Recommended when same dictionary is used multiple times. Note : compression level is _decided at dictionary creation time_, and frame parameters are hardcoded (dictID=yes, contentSize=yes, checksum=no)</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_compress_usingCDict", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_compress_usingCDict", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_compress_usingCDict(ZSTD_CCtx_s* cctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, ZSTD_CDict_s* cdict); public static extern nuint ZSTD_compress_usingCDict(ZSTD_CCtx_s* cctx, void* dst, nuint dstCapacity, void* src, nuint srcSize, ZSTD_CDict_s* cdict);
/// <summary>ZSTD_createDDict() : Create a digested dictionary, ready to start decompression operation without startup delay. dictBuffer can be released after DDict creation, as its content is copied inside DDict.</summary> /// <summary>ZSTD_createDDict() : Create a digested dictionary, ready to start decompression operation without startup delay. dictBuffer can be released after DDict creation, as its content is copied inside DDict.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_createDDict", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_createDDict", CallingConvention = CallingConvention.Cdecl)]
public static extern ZSTD_DDict_s* ZSTD_createDDict(void* dictBuffer, UIntPtr dictSize); public static extern ZSTD_DDict_s* ZSTD_createDDict(void* dictBuffer, nuint dictSize);
/// <summary>ZSTD_freeDDict() : Function frees memory allocated with ZSTD_createDDict() If a NULL pointer is passed, no operation is performed.</summary> /// <summary>ZSTD_freeDDict() : Function frees memory allocated with ZSTD_createDDict() If a NULL pointer is passed, no operation is performed.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_freeDDict", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_freeDDict", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_freeDDict(ZSTD_DDict_s* ddict); public static extern nuint ZSTD_freeDDict(ZSTD_DDict_s* ddict);
/// <summary>ZSTD_decompress_usingDDict() : Decompression using a digested Dictionary. Recommended when same dictionary is used multiple times.</summary> /// <summary>ZSTD_decompress_usingDDict() : Decompression using a digested Dictionary. Recommended when same dictionary is used multiple times.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_decompress_usingDDict", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_decompress_usingDDict", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_decompress_usingDDict(ZSTD_DCtx_s* dctx, void* dst, UIntPtr dstCapacity, void* src, UIntPtr srcSize, ZSTD_DDict_s* ddict); public static extern nuint ZSTD_decompress_usingDDict(ZSTD_DCtx_s* dctx, void* dst, nuint dstCapacity, void* src, nuint srcSize, ZSTD_DDict_s* ddict);
/// <summary>ZSTD_getDictID_fromDict() : Requires v1.4.0+ Provides the dictID stored within dictionary. if @return == 0, the dictionary is not conformant with Zstandard specification. It can still be loaded, but as a content-only dictionary.</summary> /// <summary>ZSTD_getDictID_fromDict() : Requires v1.4.0+ Provides the dictID stored within dictionary. if @return == 0, the dictionary is not conformant with Zstandard specification. It can still be loaded, but as a content-only dictionary.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_getDictID_fromDict", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_getDictID_fromDict", CallingConvention = CallingConvention.Cdecl)]
public static extern uint ZSTD_getDictID_fromDict(void* dict, UIntPtr dictSize); public static extern uint ZSTD_getDictID_fromDict(void* dict, nuint dictSize);
/// <summary>ZSTD_getDictID_fromCDict() : Requires v1.5.0+ Provides the dictID of the dictionary loaded into `cdict`. If @return == 0, the dictionary is not conformant to Zstandard specification, or empty. Non-conformant dictionaries can still be loaded, but as content-only dictionaries.</summary> /// <summary>ZSTD_getDictID_fromCDict() : Requires v1.5.0+ Provides the dictID of the dictionary loaded into `cdict`. If @return == 0, the dictionary is not conformant to Zstandard specification, or empty. Non-conformant dictionaries can still be loaded, but as content-only dictionaries.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_getDictID_fromCDict", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_getDictID_fromCDict", CallingConvention = CallingConvention.Cdecl)]
@ -207,50 +207,50 @@ namespace CsBindgen
/// <summary>ZSTD_getDictID_fromFrame() : Requires v1.4.0+ Provides the dictID required to decompressed the frame stored within `src`. If @return == 0, the dictID could not be decoded. This could for one of the following reasons : - The frame does not require a dictionary to be decoded (most common case). - The frame was built with dictID intentionally removed. Whatever dictionary is necessary is a hidden piece of information. Note : this use case also happens when using a non-conformant dictionary. - `srcSize` is too small, and as a result, the frame header could not be decoded (only possible if `srcSize &lt; ZSTD_FRAMEHEADERSIZE_MAX`). - This is not a Zstandard frame. When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code.</summary> /// <summary>ZSTD_getDictID_fromFrame() : Requires v1.4.0+ Provides the dictID required to decompressed the frame stored within `src`. If @return == 0, the dictID could not be decoded. This could for one of the following reasons : - The frame does not require a dictionary to be decoded (most common case). - The frame was built with dictID intentionally removed. Whatever dictionary is necessary is a hidden piece of information. Note : this use case also happens when using a non-conformant dictionary. - `srcSize` is too small, and as a result, the frame header could not be decoded (only possible if `srcSize &lt; ZSTD_FRAMEHEADERSIZE_MAX`). - This is not a Zstandard frame. When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_getDictID_fromFrame", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_getDictID_fromFrame", CallingConvention = CallingConvention.Cdecl)]
public static extern uint ZSTD_getDictID_fromFrame(void* src, UIntPtr srcSize); public static extern uint ZSTD_getDictID_fromFrame(void* src, nuint srcSize);
/// <summary>ZSTD_CCtx_loadDictionary() : Requires v1.4.0+ Create an internal CDict from `dict` buffer. Decompression will have to use same dictionary. @result : 0, or an error code (which can be tested with ZSTD_isError()). Special: Loading a NULL (or 0-size) dictionary invalidates previous dictionary, meaning \"return to no-dictionary mode\". Note 1 : Dictionary is sticky, it will be used for all future compressed frames, until parameters are reset, a new dictionary is loaded, or the dictionary is explicitly invalidated by loading a NULL dictionary. Note 2 : Loading a dictionary involves building tables. It's also a CPU consuming operation, with non-negligible impact on latency. Tables are dependent on compression parameters, and for this reason, compression parameters can no longer be changed after loading a dictionary. Note 3 :`dict` content will be copied internally. Use experimental ZSTD_CCtx_loadDictionary_byReference() to reference content instead. In such a case, dictionary buffer must outlive its users. Note 4 : Use ZSTD_CCtx_loadDictionary_advanced() to precisely select how dictionary content must be interpreted.</summary> /// <summary>ZSTD_CCtx_loadDictionary() : Requires v1.4.0+ Create an internal CDict from `dict` buffer. Decompression will have to use same dictionary. @result : 0, or an error code (which can be tested with ZSTD_isError()). Special: Loading a NULL (or 0-size) dictionary invalidates previous dictionary, meaning \"return to no-dictionary mode\". Note 1 : Dictionary is sticky, it will be used for all future compressed frames, until parameters are reset, a new dictionary is loaded, or the dictionary is explicitly invalidated by loading a NULL dictionary. Note 2 : Loading a dictionary involves building tables. It's also a CPU consuming operation, with non-negligible impact on latency. Tables are dependent on compression parameters, and for this reason, compression parameters can no longer be changed after loading a dictionary. Note 3 :`dict` content will be copied internally. Use experimental ZSTD_CCtx_loadDictionary_byReference() to reference content instead. In such a case, dictionary buffer must outlive its users. Note 4 : Use ZSTD_CCtx_loadDictionary_advanced() to precisely select how dictionary content must be interpreted.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_CCtx_loadDictionary", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_CCtx_loadDictionary", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_CCtx_loadDictionary(ZSTD_CCtx_s* cctx, void* dict, UIntPtr dictSize); public static extern nuint ZSTD_CCtx_loadDictionary(ZSTD_CCtx_s* cctx, void* dict, nuint dictSize);
/// <summary>ZSTD_CCtx_refCDict() : Requires v1.4.0+ Reference a prepared dictionary, to be used for all future compressed frames. Note that compression parameters are enforced from within CDict, and supersede any compression parameter previously set within CCtx. The parameters ignored are labelled as \"superseded-by-cdict\" in the ZSTD_cParameter enum docs. The ignored parameters will be used again if the CCtx is returned to no-dictionary mode. The dictionary will remain valid for future compressed frames using same CCtx. @result : 0, or an error code (which can be tested with ZSTD_isError()). Special : Referencing a NULL CDict means \"return to no-dictionary mode\". Note 1 : Currently, only one dictionary can be managed. Referencing a new dictionary effectively \"discards\" any previous one. Note 2 : CDict is just referenced, its lifetime must outlive its usage within CCtx.</summary> /// <summary>ZSTD_CCtx_refCDict() : Requires v1.4.0+ Reference a prepared dictionary, to be used for all future compressed frames. Note that compression parameters are enforced from within CDict, and supersede any compression parameter previously set within CCtx. The parameters ignored are labelled as \"superseded-by-cdict\" in the ZSTD_cParameter enum docs. The ignored parameters will be used again if the CCtx is returned to no-dictionary mode. The dictionary will remain valid for future compressed frames using same CCtx. @result : 0, or an error code (which can be tested with ZSTD_isError()). Special : Referencing a NULL CDict means \"return to no-dictionary mode\". Note 1 : Currently, only one dictionary can be managed. Referencing a new dictionary effectively \"discards\" any previous one. Note 2 : CDict is just referenced, its lifetime must outlive its usage within CCtx.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_CCtx_refCDict", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_CCtx_refCDict", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_CCtx_refCDict(ZSTD_CCtx_s* cctx, ZSTD_CDict_s* cdict); public static extern nuint ZSTD_CCtx_refCDict(ZSTD_CCtx_s* cctx, ZSTD_CDict_s* cdict);
/// <summary>ZSTD_CCtx_refPrefix() : Requires v1.4.0+ Reference a prefix (single-usage dictionary) for next compressed frame. A prefix is **only used once**. Tables are discarded at end of frame (ZSTD_e_end). Decompression will need same prefix to properly regenerate data. Compressing with a prefix is similar in outcome as performing a diff and compressing it, but performs much faster, especially during decompression (compression speed is tunable with compression level). @result : 0, or an error code (which can be tested with ZSTD_isError()). Special: Adding any prefix (including NULL) invalidates any previous prefix or dictionary Note 1 : Prefix buffer is referenced. It **must** outlive compression. Its content must remain unmodified during compression. Note 2 : If the intention is to diff some large src data blob with some prior version of itself, ensure that the window size is large enough to contain the entire source. See ZSTD_c_windowLog. Note 3 : Referencing a prefix involves building tables, which are dependent on compression parameters. It's a CPU consuming operation, with non-negligible impact on latency. If there is a need to use the same prefix multiple times, consider loadDictionary instead. Note 4 : By default, the prefix is interpreted as raw content (ZSTD_dct_rawContent). Use experimental ZSTD_CCtx_refPrefix_advanced() to alter dictionary interpretation.</summary> /// <summary>ZSTD_CCtx_refPrefix() : Requires v1.4.0+ Reference a prefix (single-usage dictionary) for next compressed frame. A prefix is **only used once**. Tables are discarded at end of frame (ZSTD_e_end). Decompression will need same prefix to properly regenerate data. Compressing with a prefix is similar in outcome as performing a diff and compressing it, but performs much faster, especially during decompression (compression speed is tunable with compression level). @result : 0, or an error code (which can be tested with ZSTD_isError()). Special: Adding any prefix (including NULL) invalidates any previous prefix or dictionary Note 1 : Prefix buffer is referenced. It **must** outlive compression. Its content must remain unmodified during compression. Note 2 : If the intention is to diff some large src data blob with some prior version of itself, ensure that the window size is large enough to contain the entire source. See ZSTD_c_windowLog. Note 3 : Referencing a prefix involves building tables, which are dependent on compression parameters. It's a CPU consuming operation, with non-negligible impact on latency. If there is a need to use the same prefix multiple times, consider loadDictionary instead. Note 4 : By default, the prefix is interpreted as raw content (ZSTD_dct_rawContent). Use experimental ZSTD_CCtx_refPrefix_advanced() to alter dictionary interpretation.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_CCtx_refPrefix", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_CCtx_refPrefix", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_CCtx_refPrefix(ZSTD_CCtx_s* cctx, void* prefix, UIntPtr prefixSize); public static extern nuint ZSTD_CCtx_refPrefix(ZSTD_CCtx_s* cctx, void* prefix, nuint prefixSize);
/// <summary>ZSTD_DCtx_loadDictionary() : Requires v1.4.0+ Create an internal DDict from dict buffer, to be used to decompress all future frames. The dictionary remains valid for all future frames, until explicitly invalidated, or a new dictionary is loaded. @result : 0, or an error code (which can be tested with ZSTD_isError()). Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary, meaning \"return to no-dictionary mode\". Note 1 : Loading a dictionary involves building tables, which has a non-negligible impact on CPU usage and latency. It's recommended to \"load once, use many times\", to amortize the cost Note 2 :`dict` content will be copied internally, so `dict` can be released after loading. Use ZSTD_DCtx_loadDictionary_byReference() to reference dictionary content instead. Note 3 : Use ZSTD_DCtx_loadDictionary_advanced() to take control of how dictionary content is loaded and interpreted.</summary> /// <summary>ZSTD_DCtx_loadDictionary() : Requires v1.4.0+ Create an internal DDict from dict buffer, to be used to decompress all future frames. The dictionary remains valid for all future frames, until explicitly invalidated, or a new dictionary is loaded. @result : 0, or an error code (which can be tested with ZSTD_isError()). Special : Adding a NULL (or 0-size) dictionary invalidates any previous dictionary, meaning \"return to no-dictionary mode\". Note 1 : Loading a dictionary involves building tables, which has a non-negligible impact on CPU usage and latency. It's recommended to \"load once, use many times\", to amortize the cost Note 2 :`dict` content will be copied internally, so `dict` can be released after loading. Use ZSTD_DCtx_loadDictionary_byReference() to reference dictionary content instead. Note 3 : Use ZSTD_DCtx_loadDictionary_advanced() to take control of how dictionary content is loaded and interpreted.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_DCtx_loadDictionary", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_DCtx_loadDictionary", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_DCtx_loadDictionary(ZSTD_DCtx_s* dctx, void* dict, UIntPtr dictSize); public static extern nuint ZSTD_DCtx_loadDictionary(ZSTD_DCtx_s* dctx, void* dict, nuint dictSize);
/// <summary>ZSTD_DCtx_refDDict() : Requires v1.4.0+ Reference a prepared dictionary, to be used to decompress next frames. The dictionary remains active for decompression of future frames using same DCtx. If called with ZSTD_d_refMultipleDDicts enabled, repeated calls of this function will store the DDict references in a table, and the DDict used for decompression will be determined at decompression time, as per the dict ID in the frame. The memory for the table is allocated on the first call to refDDict, and can be freed with ZSTD_freeDCtx(). If called with ZSTD_d_refMultipleDDicts disabled (the default), only one dictionary will be managed, and referencing a dictionary effectively \"discards\" any previous one. @result : 0, or an error code (which can be tested with ZSTD_isError()). Special: referencing a NULL DDict means \"return to no-dictionary mode\". Note 2 : DDict is just referenced, its lifetime must outlive its usage from DCtx.</summary> /// <summary>ZSTD_DCtx_refDDict() : Requires v1.4.0+ Reference a prepared dictionary, to be used to decompress next frames. The dictionary remains active for decompression of future frames using same DCtx. If called with ZSTD_d_refMultipleDDicts enabled, repeated calls of this function will store the DDict references in a table, and the DDict used for decompression will be determined at decompression time, as per the dict ID in the frame. The memory for the table is allocated on the first call to refDDict, and can be freed with ZSTD_freeDCtx(). If called with ZSTD_d_refMultipleDDicts disabled (the default), only one dictionary will be managed, and referencing a dictionary effectively \"discards\" any previous one. @result : 0, or an error code (which can be tested with ZSTD_isError()). Special: referencing a NULL DDict means \"return to no-dictionary mode\". Note 2 : DDict is just referenced, its lifetime must outlive its usage from DCtx.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_DCtx_refDDict", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_DCtx_refDDict", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_DCtx_refDDict(ZSTD_DCtx_s* dctx, ZSTD_DDict_s* ddict); public static extern nuint ZSTD_DCtx_refDDict(ZSTD_DCtx_s* dctx, ZSTD_DDict_s* ddict);
/// <summary>ZSTD_DCtx_refPrefix() : Requires v1.4.0+ Reference a prefix (single-usage dictionary) to decompress next frame. This is the reverse operation of ZSTD_CCtx_refPrefix(), and must use the same prefix as the one used during compression. Prefix is **only used once**. Reference is discarded at end of frame. End of frame is reached when ZSTD_decompressStream() returns 0. @result : 0, or an error code (which can be tested with ZSTD_isError()). Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary Note 2 : Prefix buffer is referenced. It **must** outlive decompression. Prefix buffer must remain unmodified up to the end of frame, reached when ZSTD_decompressStream() returns 0. Note 3 : By default, the prefix is treated as raw content (ZSTD_dct_rawContent). Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode (Experimental section) Note 4 : Referencing a raw content prefix has almost no cpu nor memory cost. A full dictionary is more costly, as it requires building tables.</summary> /// <summary>ZSTD_DCtx_refPrefix() : Requires v1.4.0+ Reference a prefix (single-usage dictionary) to decompress next frame. This is the reverse operation of ZSTD_CCtx_refPrefix(), and must use the same prefix as the one used during compression. Prefix is **only used once**. Reference is discarded at end of frame. End of frame is reached when ZSTD_decompressStream() returns 0. @result : 0, or an error code (which can be tested with ZSTD_isError()). Note 1 : Adding any prefix (including NULL) invalidates any previously set prefix or dictionary Note 2 : Prefix buffer is referenced. It **must** outlive decompression. Prefix buffer must remain unmodified up to the end of frame, reached when ZSTD_decompressStream() returns 0. Note 3 : By default, the prefix is treated as raw content (ZSTD_dct_rawContent). Use ZSTD_CCtx_refPrefix_advanced() to alter dictMode (Experimental section) Note 4 : Referencing a raw content prefix has almost no cpu nor memory cost. A full dictionary is more costly, as it requires building tables.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_DCtx_refPrefix", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_DCtx_refPrefix", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_DCtx_refPrefix(ZSTD_DCtx_s* dctx, void* prefix, UIntPtr prefixSize); public static extern nuint ZSTD_DCtx_refPrefix(ZSTD_DCtx_s* dctx, void* prefix, nuint prefixSize);
/// <summary>ZSTD_sizeof_*() : Requires v1.4.0+ These functions give the _current_ memory usage of selected object. Note that object memory usage can evolve (increase or decrease) over time.</summary> /// <summary>ZSTD_sizeof_*() : Requires v1.4.0+ These functions give the _current_ memory usage of selected object. Note that object memory usage can evolve (increase or decrease) over time.</summary>
[DllImport(__DllName, EntryPoint = "ZSTD_sizeof_CCtx", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_sizeof_CCtx", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_sizeof_CCtx(ZSTD_CCtx_s* cctx); public static extern nuint ZSTD_sizeof_CCtx(ZSTD_CCtx_s* cctx);
[DllImport(__DllName, EntryPoint = "ZSTD_sizeof_DCtx", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_sizeof_DCtx", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_sizeof_DCtx(ZSTD_DCtx_s* dctx); public static extern nuint ZSTD_sizeof_DCtx(ZSTD_DCtx_s* dctx);
[DllImport(__DllName, EntryPoint = "ZSTD_sizeof_CStream", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_sizeof_CStream", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_sizeof_CStream(ZSTD_CCtx_s* zcs); public static extern nuint ZSTD_sizeof_CStream(ZSTD_CCtx_s* zcs);
[DllImport(__DllName, EntryPoint = "ZSTD_sizeof_DStream", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_sizeof_DStream", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_sizeof_DStream(ZSTD_DCtx_s* zds); public static extern nuint ZSTD_sizeof_DStream(ZSTD_DCtx_s* zds);
[DllImport(__DllName, EntryPoint = "ZSTD_sizeof_CDict", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_sizeof_CDict", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_sizeof_CDict(ZSTD_CDict_s* cdict); public static extern nuint ZSTD_sizeof_CDict(ZSTD_CDict_s* cdict);
[DllImport(__DllName, EntryPoint = "ZSTD_sizeof_DDict", CallingConvention = CallingConvention.Cdecl)] [DllImport(__DllName, EntryPoint = "ZSTD_sizeof_DDict", CallingConvention = CallingConvention.Cdecl)]
public static extern UIntPtr ZSTD_sizeof_DDict(ZSTD_DDict_s* ddict); public static extern nuint ZSTD_sizeof_DDict(ZSTD_DDict_s* ddict);
} }
@ -270,7 +270,7 @@ namespace CsBindgen
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
internal unsafe partial struct ZSTD_bounds internal unsafe partial struct ZSTD_bounds
{ {
public UIntPtr error; public nuint error;
public int lowerBound; public int lowerBound;
public int upperBound; public int upperBound;
} }
@ -279,16 +279,16 @@ namespace CsBindgen
internal unsafe partial struct ZSTD_inBuffer_s internal unsafe partial struct ZSTD_inBuffer_s
{ {
public void* src; public void* src;
public UIntPtr size; public nuint size;
public UIntPtr pos; public nuint pos;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
internal unsafe partial struct ZSTD_outBuffer_s internal unsafe partial struct ZSTD_outBuffer_s
{ {
public void* dst; public void* dst;
public UIntPtr size; public nuint size;
public UIntPtr pos; public nuint pos;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]

6
unity-sandbox/.vsconfig Normal file
View File

@ -0,0 +1,6 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}

View File

@ -0,0 +1,194 @@
using AOT;
using CsBindgen;
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using UnityEngine;
using UnityEngine.UI;
using static CsBindgen.LibRust;
public class NewBehaviourScript : MonoBehaviour
{
public Text text;
// Start is called before the first frame update
unsafe void Start()
{
try
{
var v = LibRust.my_add(10, 20);
UnityEngine.Debug.Log("Native value: " + v);
[MonoPInvokeCallback(typeof(Func<int, int>))]
static int Method(int x) => x * x;
// var tako = LibRust.callback_test(&Method);
var a = LibRust.callback_test(Method);
//var tako = LibRust.callback_test(&Method);
//var a = LibRust.callback_test((delegate* unmanaged[Cdecl]<int, int>)callback);
//var a = LibRust.nullable_callback_test((nullable_callback_test_cb_delegate)null);
// var a = LibRust.callback_test(null);
//var a = LibRust.callback_test((void*)callback);
text.text = "Native Callback Return:" + a;
UnityEngine.Debug.Log(a);
}
catch (Exception ex)
{
text.text = "Exception:" + ex.ToString();
}
}
//[UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvCdecl) })]
static int Method(int x) => x * x;
[MonoPInvokeCallback(typeof(Func<int, int>))]
static int Callback(int x)
{
Debug.Log("Callback!");
return x * x;
}
}
namespace System.Runtime.InteropServices
{
internal struct CLong
{
public int Value; // Windows = int, Unix x32 = int, Unix x64 = long
}
internal struct CULong
{
public uint Value; // Windows = uint, Unix x32 = uint, Unix x64 = ulong
}
}
namespace CsBindgen
{
internal static unsafe partial class LibRust
{
const string __DllName = "csbindgen_tests";
[DllImport(__DllName, EntryPoint = "alias_test1", CallingConvention = CallingConvention.Cdecl)]
public static extern void alias_test1(long* _a);
[DllImport(__DllName, EntryPoint = "alias_test2", CallingConvention = CallingConvention.Cdecl)]
public static extern void alias_test2(long _b);
[DllImport(__DllName, EntryPoint = "nullpointer_test", CallingConvention = CallingConvention.Cdecl)]
public static extern void nullpointer_test(byte* p);
[DllImport(__DllName, EntryPoint = "callback_test", CallingConvention = CallingConvention.Cdecl)]
public static extern int callback_test(Func<int, int> cb);
[DllImport(__DllName, EntryPoint = "nullable_callback_test", CallingConvention = CallingConvention.Cdecl)]
public static extern int nullable_callback_test(Func<int, int> cb);
[DllImport(__DllName, EntryPoint = "types_iroiro", CallingConvention = CallingConvention.Cdecl)]
public static extern void types_iroiro(nint _i, nuint _u, CLong _cl, CULong _cul);
[DllImport(__DllName, EntryPoint = "callback_test2", CallingConvention = CallingConvention.Cdecl)]
public static extern Func<int, int> callback_test2();
[DllImport(__DllName, EntryPoint = "callback", CallingConvention = CallingConvention.Cdecl)]
public static extern int callback(int a);
[DllImport(__DllName, EntryPoint = "enum_test", CallingConvention = CallingConvention.Cdecl)]
public static extern int enum_test(IntEnumTest i);
[DllImport(__DllName, EntryPoint = "nop", CallingConvention = CallingConvention.Cdecl)]
public static extern void nop();
[DllImport(__DllName, EntryPoint = "my_add", CallingConvention = CallingConvention.Cdecl)]
public static extern int my_add(int x, int y);
[DllImport(__DllName, EntryPoint = "create_counter_context", CallingConvention = CallingConvention.Cdecl)]
public static extern void* create_counter_context();
[DllImport(__DllName, EntryPoint = "insert_counter_context", CallingConvention = CallingConvention.Cdecl)]
public static extern void insert_counter_context(void* context, int value);
[DllImport(__DllName, EntryPoint = "delete_counter_context", CallingConvention = CallingConvention.Cdecl)]
public static extern void delete_counter_context(void* context);
[DllImport(__DllName, EntryPoint = "my_bool", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.U1)]
public static extern bool my_bool([MarshalAs(UnmanagedType.U1)] bool x, [MarshalAs(UnmanagedType.U1)] bool y, [MarshalAs(UnmanagedType.U1)] bool z, bool* xr, bool* yr, bool* zr);
[DllImport(__DllName, EntryPoint = "alloc_c_string", CallingConvention = CallingConvention.Cdecl)]
public static extern byte* alloc_c_string();
[DllImport(__DllName, EntryPoint = "free_c_string", CallingConvention = CallingConvention.Cdecl)]
public static extern void free_c_string(byte* str);
[DllImport(__DllName, EntryPoint = "alloc_u8_string", CallingConvention = CallingConvention.Cdecl)]
public static extern ByteBuffer* alloc_u8_string();
[DllImport(__DllName, EntryPoint = "free_u8_string", CallingConvention = CallingConvention.Cdecl)]
public static extern void free_u8_string(ByteBuffer* buffer);
[DllImport(__DllName, EntryPoint = "alloc_u8_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern ByteBuffer* alloc_u8_buffer();
[DllImport(__DllName, EntryPoint = "free_u8_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern void free_u8_buffer(ByteBuffer* buffer);
[DllImport(__DllName, EntryPoint = "alloc_i32_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern ByteBuffer* alloc_i32_buffer();
[DllImport(__DllName, EntryPoint = "free_i32_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern void free_i32_buffer(ByteBuffer* buffer);
[DllImport(__DllName, EntryPoint = "create_context", CallingConvention = CallingConvention.Cdecl)]
public static extern Context* create_context();
[DllImport(__DllName, EntryPoint = "delete_context", CallingConvention = CallingConvention.Cdecl)]
public static extern void delete_context(Context* context);
[DllImport(__DllName, EntryPoint = "call_bindgen", CallingConvention = CallingConvention.Cdecl)]
public static extern void call_bindgen();
[DllImport(__DllName, EntryPoint = "call_bindgen_lz4", CallingConvention = CallingConvention.Cdecl)]
public static extern void call_bindgen_lz4();
}
[StructLayout(LayoutKind.Sequential)]
internal unsafe partial struct Context
{
[MarshalAs(UnmanagedType.U1)] public bool foo;
}
[StructLayout(LayoutKind.Sequential)]
internal unsafe partial struct ByteBuffer
{
public byte* ptr;
public int length;
public int capacity;
}
internal enum IntEnumTest : byte
{
A = 1,
B = 2,
C = 10,
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3409aec8b4900474bb632c05b659f25b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 131a6b21c8605f84396be9f6751fb6e3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,472 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 500
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 500
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 2
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 0
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &519420028
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 519420032}
- component: {fileID: 519420031}
- component: {fileID: 519420029}
- component: {fileID: 519420033}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &519420029
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_Enabled: 1
--- !u!20 &519420031
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 1
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 0
m_HDR: 1
m_AllowMSAA: 0
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 0
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &519420032
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &519420033
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3409aec8b4900474bb632c05b659f25b, type: 3}
m_Name:
m_EditorClassIdentifier:
text: {fileID: 1666458937}
--- !u!1 &856940829
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 856940832}
- component: {fileID: 856940831}
- component: {fileID: 856940830}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &856940830
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 856940829}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SendPointerHoverToParent: 1
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &856940831
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 856940829}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!4 &856940832
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 856940829}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1033774970
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1033774974}
- component: {fileID: 1033774973}
- component: {fileID: 1033774972}
- component: {fileID: 1033774971}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1033774971
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1033774970}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &1033774972
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1033774970}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 0
--- !u!223 &1033774973
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1033774970}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &1033774974
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1033774970}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1666458936}
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1 &1666458935
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1666458936}
- component: {fileID: 1666458938}
- component: {fileID: 1666458937}
m_Layer: 5
m_Name: Text (Legacy)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1666458936
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1666458935}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1033774974}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -1.7283, y: 12.4206}
m_SizeDelta: {x: 965.1995, y: 576.9679}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1666458937
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1666458935}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 0.42591774, b: 0.06132078, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 34
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 0
m_MaxSize: 48
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: New Text
--- !u!222 &1666458938
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1666458935}
m_CullTransparentMesh: 1

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2cda990e2423bbf4892e6590ba056729
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,27 @@
fileFormatVersion: 2
guid: e870802d65a961c438afc7830b93de61
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,46 @@
=== Mon Mar 6 23:29:18 2023
Packages were changed.
Update Mode: mergeDefaultDependencies
The following packages were added:
com.unity.modules.ai@1.0.0
com.unity.modules.androidjni@1.0.0
com.unity.modules.animation@1.0.0
com.unity.modules.assetbundle@1.0.0
com.unity.modules.audio@1.0.0
com.unity.modules.cloth@1.0.0
com.unity.modules.director@1.0.0
com.unity.modules.imageconversion@1.0.0
com.unity.modules.imgui@1.0.0
com.unity.modules.jsonserialize@1.0.0
com.unity.modules.particlesystem@1.0.0
com.unity.modules.physics@1.0.0
com.unity.modules.physics2d@1.0.0
com.unity.modules.screencapture@1.0.0
com.unity.modules.terrain@1.0.0
com.unity.modules.terrainphysics@1.0.0
com.unity.modules.tilemap@1.0.0
com.unity.modules.ui@1.0.0
com.unity.modules.uielements@1.0.0
com.unity.modules.umbra@1.0.0
com.unity.modules.unityanalytics@1.0.0
com.unity.modules.unitywebrequest@1.0.0
com.unity.modules.unitywebrequestassetbundle@1.0.0
com.unity.modules.unitywebrequestaudio@1.0.0
com.unity.modules.unitywebrequesttexture@1.0.0
com.unity.modules.unitywebrequestwww@1.0.0
com.unity.modules.vehicles@1.0.0
com.unity.modules.video@1.0.0
com.unity.modules.vr@1.0.0
com.unity.modules.wind@1.0.0
com.unity.modules.xr@1.0.0
The following packages were updated:
com.unity.collab-proxy from version 1.9.0 to 1.17.2
com.unity.ide.rider from version 3.0.7 to 3.0.15
com.unity.ide.visualstudio from version 2.0.11 to 2.0.16
com.unity.ide.vscode from version 1.2.4 to 1.2.5
com.unity.test-framework from version 1.1.29 to 1.1.31
com.unity.timeline from version 1.6.2 to 1.6.4
com.unity.visualscripting from version 1.7.2 to 1.7.8

View File

@ -0,0 +1,3 @@
Base path: 'C:/Program Files/Unity/2021.3.11f1/Editor/Data', plugins path 'C:/Program Files/Unity/2021.3.11f1/Editor/Data/PlaybackEngines'
Cmd: initializeCompiler

View File

@ -0,0 +1,45 @@
{
"dependencies": {
"com.unity.collab-proxy": "1.17.2",
"com.unity.feature.2d": "1.0.0",
"com.unity.ide.rider": "3.0.15",
"com.unity.ide.visualstudio": "2.0.16",
"com.unity.ide.vscode": "1.2.5",
"com.unity.test-framework": "1.1.31",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.6.4",
"com.unity.ugui": "1.0.0",
"com.unity.visualscripting": "1.7.8",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.cloth": "1.0.0",
"com.unity.modules.director": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.physics2d": "1.0.0",
"com.unity.modules.screencapture": "1.0.0",
"com.unity.modules.terrain": "1.0.0",
"com.unity.modules.terrainphysics": "1.0.0",
"com.unity.modules.tilemap": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.uielements": "1.0.0",
"com.unity.modules.umbra": "1.0.0",
"com.unity.modules.unityanalytics": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.unitywebrequesttexture": "1.0.0",
"com.unity.modules.unitywebrequestwww": "1.0.0",
"com.unity.modules.vehicles": "1.0.0",
"com.unity.modules.video": "1.0.0",
"com.unity.modules.vr": "1.0.0",
"com.unity.modules.wind": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
}

View File

@ -0,0 +1,483 @@
{
"dependencies": {
"com.unity.2d.animation": {
"version": "7.0.7",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.2d.common": "6.0.4",
"com.unity.2d.sprite": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.uielements": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.2d.common": {
"version": "6.0.4",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.2d.sprite": "1.0.0",
"com.unity.mathematics": "1.1.0",
"com.unity.modules.uielements": "1.0.0",
"com.unity.burst": "1.5.1"
},
"url": "https://packages.unity.com"
},
"com.unity.2d.path": {
"version": "5.0.2",
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.2d.pixel-perfect": {
"version": "5.0.1",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.2d.psdimporter": {
"version": "6.0.5",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.2d.animation": "7.0.7",
"com.unity.2d.common": "6.0.4",
"com.unity.2d.sprite": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.2d.sprite": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {}
},
"com.unity.2d.spriteshape": {
"version": "7.0.6",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.mathematics": "1.1.0",
"com.unity.2d.common": "6.0.4",
"com.unity.2d.path": "5.0.2",
"com.unity.modules.physics2d": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.2d.tilemap": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {}
},
"com.unity.2d.tilemap.extras": {
"version": "2.2.3",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.modules.tilemap": "1.0.0",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.ugui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.burst": {
"version": "1.6.6",
"depth": 3,
"source": "registry",
"dependencies": {
"com.unity.mathematics": "1.2.1"
},
"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "1.17.2",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.services.core": "1.0.1"
},
"url": "https://packages.unity.com"
},
"com.unity.ext.nunit": {
"version": "1.0.6",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.feature.2d": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.2d.animation": "7.0.7",
"com.unity.2d.pixel-perfect": "5.0.1",
"com.unity.2d.psdimporter": "6.0.5",
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.spriteshape": "7.0.6",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.2d.tilemap.extras": "2.2.3"
}
},
"com.unity.ide.rider": {
"version": "3.0.15",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.6"
},
"url": "https://packages.unity.com"
},
"com.unity.ide.visualstudio": {
"version": "2.0.16",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.1.9"
},
"url": "https://packages.unity.com"
},
"com.unity.ide.vscode": {
"version": "1.2.5",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.mathematics": {
"version": "1.2.6",
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.nuget.newtonsoft-json": {
"version": "3.0.2",
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.services.core": {
"version": "1.4.2",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.nuget.newtonsoft-json": "3.0.2",
"com.unity.modules.androidjni": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.31",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.6",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.textmeshpro": {
"version": "3.0.6",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.6.4",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.modules.director": "1.0.0",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.ugui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0"
}
},
"com.unity.visualscripting": {
"version": "1.7.8",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ugui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.modules.ai": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.androidjni": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.animation": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.assetbundle": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.audio": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.cloth": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0"
}
},
"com.unity.modules.director": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.animation": "1.0.0"
}
},
"com.unity.modules.imageconversion": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.imgui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.jsonserialize": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.particlesystem": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.physics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.physics2d": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.screencapture": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.subsystems": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.terrain": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.terrainphysics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.terrain": "1.0.0"
}
},
"com.unity.modules.tilemap": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics2d": "1.0.0"
}
},
"com.unity.modules.ui": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.uielements": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.uielementsnative": "1.0.0"
}
},
"com.unity.modules.uielementsnative": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.umbra": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.unityanalytics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
}
},
"com.unity.modules.unitywebrequest": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.unitywebrequestassetbundle": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0"
}
},
"com.unity.modules.unitywebrequestaudio": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.audio": "1.0.0"
}
},
"com.unity.modules.unitywebrequesttexture": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.unitywebrequestwww": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0",
"com.unity.modules.unitywebrequestaudio": "1.0.0",
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0"
}
},
"com.unity.modules.vehicles": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0"
}
},
"com.unity.modules.video": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.audio": "1.0.0",
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0"
}
},
"com.unity.modules.vr": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.xr": "1.0.0"
}
},
"com.unity.modules.wind": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.xr": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.subsystems": "1.0.0"
}
}
}
}

View File

@ -0,0 +1,19 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!11 &1
AudioManager:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Volume: 1
Rolloff Scale: 1
Doppler Factor: 1
Default Speaker Mode: 2
m_SampleRate: 0
m_DSPBufferSize: 1024
m_VirtualVoiceCount: 512
m_RealVoiceCount: 32
m_SpatializerPlugin:
m_AmbisonicDecoderPlugin:
m_DisableAudio: 0
m_VirtualizeEffects: 1
m_RequestedDSPBufferSize: 0

View File

@ -0,0 +1,17 @@
{
"MonoBehaviour": {
"Version": 4,
"EnableBurstCompilation": true,
"EnableOptimisations": true,
"EnableSafetyChecks": false,
"EnableDebugInAllBuilds": false,
"UsePlatformSDKLinker": false,
"CpuMinTargetX32": 0,
"CpuMaxTargetX32": 0,
"CpuMinTargetX64": 0,
"CpuMaxTargetX64": 0,
"CpuTargetsX32": 6,
"CpuTargetsX64": 72,
"OptimizeFor": 0
}
}

View File

@ -0,0 +1,6 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!236 &1
ClusterInputManager:
m_ObjectHideFlags: 0
m_Inputs: []

View File

@ -0,0 +1,6 @@
{
"MonoBehaviour": {
"Version": 4,
"DisabledWarnings": ""
}
}

View File

@ -0,0 +1,37 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!55 &1
PhysicsManager:
m_ObjectHideFlags: 0
serializedVersion: 13
m_Gravity: {x: 0, y: -9.81, z: 0}
m_DefaultMaterial: {fileID: 0}
m_BounceThreshold: 2
m_DefaultMaxDepenetrationVelocity: 10
m_SleepThreshold: 0.005
m_DefaultContactOffset: 0.01
m_DefaultSolverIterations: 6
m_DefaultSolverVelocityIterations: 1
m_QueriesHitBackfaces: 0
m_QueriesHitTriggers: 1
m_EnableAdaptiveForce: 0
m_ClothInterCollisionDistance: 0.1
m_ClothInterCollisionStiffness: 0.2
m_ContactsGeneration: 1
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_AutoSimulation: 1
m_AutoSyncTransforms: 0
m_ReuseCollisionCallbacks: 1
m_ClothInterCollisionSettingsToggle: 0
m_ClothGravity: {x: 0, y: -9.81, z: 0}
m_ContactPairsMode: 0
m_BroadphaseType: 0
m_WorldBounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 250, y: 250, z: 250}
m_WorldSubdivisions: 8
m_FrictionType: 0
m_EnableEnhancedDeterminism: 0
m_EnableUnifiedHeightmaps: 1
m_SolverType: 0
m_DefaultMaxAngularSpeed: 50

View File

@ -0,0 +1,11 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1045 &1
EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 1
path: Assets/Scenes/SampleScene.unity
guid: 2cda990e2423bbf4892e6590ba056729
m_configObjects: {}

View File

@ -0,0 +1,40 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!159 &1
EditorSettings:
m_ObjectHideFlags: 0
serializedVersion: 11
m_SerializationMode: 2
m_LineEndingsForNewScripts: 0
m_DefaultBehaviorMode: 1
m_PrefabRegularEnvironment: {fileID: 0}
m_PrefabUIEnvironment: {fileID: 0}
m_SpritePackerMode: 4
m_SpritePackerPaddingPower: 1
m_EtcTextureCompressorBehavior: 1
m_EtcTextureFastCompressor: 1
m_EtcTextureNormalCompressor: 2
m_EtcTextureBestCompressor: 4
m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;asmref;rsp
m_ProjectGenerationRootNamespace:
m_EnableTextureStreamingInEditMode: 1
m_EnableTextureStreamingInPlayMode: 1
m_AsyncShaderCompilation: 1
m_CachingShaderPreprocessor: 1
m_PrefabModeAllowAutoSave: 1
m_EnterPlayModeOptionsEnabled: 0
m_EnterPlayModeOptions: 3
m_GameObjectNamingDigits: 1
m_GameObjectNamingScheme: 0
m_AssetNamingUsesSpace: 1
m_UseLegacyProbeSampleCount: 0
m_SerializeInlineMappingsOnOneLine: 1
m_DisableCookiesInLightmapper: 1
m_AssetPipelineMode: 1
m_CacheServerMode: 0
m_CacheServerEndpoint:
m_CacheServerNamespacePrefix: default
m_CacheServerEnableDownload: 1
m_CacheServerEnableUpload: 1
m_CacheServerEnableAuth: 0
m_CacheServerEnableTls: 0

View File

@ -0,0 +1,64 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!30 &1
GraphicsSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_Deferred:
m_Mode: 1
m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0}
m_DeferredReflections:
m_Mode: 1
m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0}
m_ScreenSpaceShadows:
m_Mode: 1
m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0}
m_LegacyDeferred:
m_Mode: 1
m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0}
m_DepthNormals:
m_Mode: 1
m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0}
m_MotionVectors:
m_Mode: 1
m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0}
m_LightHalo:
m_Mode: 1
m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0}
m_LensFlare:
m_Mode: 1
m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0}
m_VideoShadersIncludeMode: 2
m_AlwaysIncludedShaders:
- {fileID: 7, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10783, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_CustomRenderPipeline: {fileID: 0}
m_TransparencySortMode: 0
m_TransparencySortAxis: {x: 0, y: 0, z: 1}
m_DefaultRenderingPath: 1
m_DefaultMobileRenderingPath: 1
m_TierSettings: []
m_LightmapStripping: 0
m_FogStripping: 0
m_InstancingStripping: 0
m_LightmapKeepPlain: 1
m_LightmapKeepDirCombined: 1
m_LightmapKeepDynamicPlain: 1
m_LightmapKeepDynamicDirCombined: 1
m_LightmapKeepShadowMask: 1
m_LightmapKeepSubtractive: 1
m_FogKeepLinear: 1
m_FogKeepExp: 1
m_FogKeepExp2: 1
m_AlbedoSwatchInfos: []
m_LightsUseLinearIntensity: 0
m_LightsUseColorTemperature: 0
m_DefaultRenderingLayerMask: 1
m_LogWhenShaderIsCompiled: 0

View File

@ -0,0 +1,487 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!13 &1
InputManager:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Axes:
- serializedVersion: 3
m_Name: Horizontal
descriptiveName:
descriptiveNegativeName:
negativeButton: left
positiveButton: right
altNegativeButton: a
altPositiveButton: d
gravity: 3
dead: 0.001
sensitivity: 3
snap: 1
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Vertical
descriptiveName:
descriptiveNegativeName:
negativeButton: down
positiveButton: up
altNegativeButton: s
altPositiveButton: w
gravity: 3
dead: 0.001
sensitivity: 3
snap: 1
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire1
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left ctrl
altNegativeButton:
altPositiveButton: mouse 0
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire2
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left alt
altNegativeButton:
altPositiveButton: mouse 1
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire3
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left shift
altNegativeButton:
altPositiveButton: mouse 2
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Jump
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: space
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Mouse X
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0
sensitivity: 0.1
snap: 0
invert: 0
type: 1
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Mouse Y
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0
sensitivity: 0.1
snap: 0
invert: 0
type: 1
axis: 1
joyNum: 0
- serializedVersion: 3
m_Name: Mouse ScrollWheel
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0
sensitivity: 0.1
snap: 0
invert: 0
type: 1
axis: 2
joyNum: 0
- serializedVersion: 3
m_Name: Horizontal
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0.19
sensitivity: 1
snap: 0
invert: 0
type: 2
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Vertical
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton:
altNegativeButton:
altPositiveButton:
gravity: 0
dead: 0.19
sensitivity: 1
snap: 0
invert: 1
type: 2
axis: 1
joyNum: 0
- serializedVersion: 3
m_Name: Fire1
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 0
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire2
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 1
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire3
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 2
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Jump
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: joystick button 3
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Submit
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: return
altNegativeButton:
altPositiveButton: joystick button 0
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Submit
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: enter
altNegativeButton:
altPositiveButton: space
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Cancel
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: escape
altNegativeButton:
altPositiveButton: joystick button 1
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Enable Debug Button 1
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left ctrl
altNegativeButton:
altPositiveButton: joystick button 8
gravity: 0
dead: 0
sensitivity: 0
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Enable Debug Button 2
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: backspace
altNegativeButton:
altPositiveButton: joystick button 9
gravity: 0
dead: 0
sensitivity: 0
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Reset
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left alt
altNegativeButton:
altPositiveButton: joystick button 1
gravity: 0
dead: 0
sensitivity: 0
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Next
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: page down
altNegativeButton:
altPositiveButton: joystick button 5
gravity: 0
dead: 0
sensitivity: 0
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Previous
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: page up
altNegativeButton:
altPositiveButton: joystick button 4
gravity: 0
dead: 0
sensitivity: 0
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Validate
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: return
altNegativeButton:
altPositiveButton: joystick button 0
gravity: 0
dead: 0
sensitivity: 0
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Persistent
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: right shift
altNegativeButton:
altPositiveButton: joystick button 2
gravity: 0
dead: 0
sensitivity: 0
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Multiplier
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left shift
altNegativeButton:
altPositiveButton: joystick button 3
gravity: 0
dead: 0
sensitivity: 0
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Horizontal
descriptiveName:
descriptiveNegativeName:
negativeButton: left
positiveButton: right
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Vertical
descriptiveName:
descriptiveNegativeName:
negativeButton: down
positiveButton: up
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 0
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Debug Vertical
descriptiveName:
descriptiveNegativeName:
negativeButton: down
positiveButton: up
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 2
axis: 6
joyNum: 0
- serializedVersion: 3
m_Name: Debug Horizontal
descriptiveName:
descriptiveNegativeName:
negativeButton: left
positiveButton: right
altNegativeButton:
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
snap: 0
invert: 0
type: 2
axis: 5
joyNum: 0

View File

@ -0,0 +1,35 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!387306366 &1
MemorySettings:
m_ObjectHideFlags: 0
m_EditorMemorySettings:
m_MainAllocatorBlockSize: -1
m_ThreadAllocatorBlockSize: -1
m_MainGfxBlockSize: -1
m_ThreadGfxBlockSize: -1
m_CacheBlockSize: -1
m_TypetreeBlockSize: -1
m_ProfilerBlockSize: -1
m_ProfilerEditorBlockSize: -1
m_BucketAllocatorGranularity: -1
m_BucketAllocatorBucketsCount: -1
m_BucketAllocatorBlockSize: -1
m_BucketAllocatorBlockCount: -1
m_ProfilerBucketAllocatorGranularity: -1
m_ProfilerBucketAllocatorBucketsCount: -1
m_ProfilerBucketAllocatorBlockSize: -1
m_ProfilerBucketAllocatorBlockCount: -1
m_TempAllocatorSizeMain: -1
m_JobTempAllocatorBlockSize: -1
m_BackgroundJobTempAllocatorBlockSize: -1
m_JobTempAllocatorReducedBlockSize: -1
m_TempAllocatorSizeGIBakingWorker: -1
m_TempAllocatorSizeNavMeshWorker: -1
m_TempAllocatorSizeAudioWorker: -1
m_TempAllocatorSizeCloudWorker: -1
m_TempAllocatorSizeGfx: -1
m_TempAllocatorSizeJobWorker: -1
m_TempAllocatorSizeBackgroundWorker: -1
m_TempAllocatorSizePreloadManager: -1
m_PlatformMemorySettings: {}

View File

@ -0,0 +1,93 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!126 &1
NavMeshProjectSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
areas:
- name: Walkable
cost: 1
- name: Not Walkable
cost: 1
- name: Jump
cost: 2
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
- name:
cost: 1
m_LastAgentTypeID: -887442657
m_Settings:
- serializedVersion: 2
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.75
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
accuratePlacement: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_SettingNames:
- Humanoid

View File

@ -0,0 +1,8 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!149 &1
NetworkManager:
m_ObjectHideFlags: 0
m_DebugLevel: 0
m_Sendrate: 15
m_AssetToPrefab: {}

View File

@ -0,0 +1,44 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &1
MonoBehaviour:
m_ObjectHideFlags: 61
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0}
m_Name:
m_EditorClassIdentifier:
m_EnablePreReleasePackages: 0
m_EnablePackageDependencies: 0
m_AdvancedSettingsExpanded: 1
m_ScopedRegistriesSettingsExpanded: 1
m_SeeAllPackageVersions: 0
oneTimeWarningShown: 0
m_Registries:
- m_Id: main
m_Name:
m_Url: https://packages.unity.com
m_Scopes: []
m_IsDefault: 1
m_Capabilities: 7
m_UserSelectedRegistryName:
m_UserAddingNewScopedRegistry: 0
m_RegistryInfoDraft:
m_ErrorMessage:
m_Original:
m_Id:
m_Name:
m_Url:
m_Scopes: []
m_IsDefault: 0
m_Capabilities: 0
m_Modified: 0
m_Name:
m_Url:
m_Scopes:
-
m_SelectedScopeIndex: 0

View File

@ -0,0 +1,56 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!19 &1
Physics2DSettings:
m_ObjectHideFlags: 0
serializedVersion: 5
m_Gravity: {x: 0, y: -9.81}
m_DefaultMaterial: {fileID: 0}
m_VelocityIterations: 8
m_PositionIterations: 3
m_VelocityThreshold: 1
m_MaxLinearCorrection: 0.2
m_MaxAngularCorrection: 8
m_MaxTranslationSpeed: 100
m_MaxRotationSpeed: 360
m_BaumgarteScale: 0.2
m_BaumgarteTimeOfImpactScale: 0.75
m_TimeToSleep: 0.5
m_LinearSleepTolerance: 0.01
m_AngularSleepTolerance: 2
m_DefaultContactOffset: 0.01
m_JobOptions:
serializedVersion: 2
useMultithreading: 0
useConsistencySorting: 0
m_InterpolationPosesPerJob: 100
m_NewContactsPerJob: 30
m_CollideContactsPerJob: 100
m_ClearFlagsPerJob: 200
m_ClearBodyForcesPerJob: 200
m_SyncDiscreteFixturesPerJob: 50
m_SyncContinuousFixturesPerJob: 50
m_FindNearestContactsPerJob: 100
m_UpdateTriggerContactsPerJob: 100
m_IslandSolverCostThreshold: 100
m_IslandSolverBodyCostScale: 1
m_IslandSolverContactCostScale: 10
m_IslandSolverJointCostScale: 10
m_IslandSolverBodiesPerJob: 50
m_IslandSolverContactsPerJob: 50
m_SimulationMode: 0
m_QueriesHitTriggers: 1
m_QueriesStartInColliders: 1
m_CallbacksOnDisable: 1
m_ReuseCollisionCallbacks: 1
m_AutoSyncTransforms: 0
m_AlwaysShowColliders: 0
m_ShowColliderSleep: 1
m_ShowColliderContacts: 0
m_ShowColliderAABB: 0
m_ContactArrowScale: 0.2
m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412}
m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

View File

@ -0,0 +1,7 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1386491679 &1
PresetManager:
m_ObjectHideFlags: 0
serializedVersion: 2
m_DefaultPresets: {}

View File

@ -0,0 +1,670 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!129 &1
PlayerSettings:
m_ObjectHideFlags: 0
serializedVersion: 23
productGUID: 1750c79f972a201448f86b9f7394d104
AndroidProfiler: 0
AndroidFilterTouchesWhenObscured: 0
AndroidEnableSustainedPerformanceMode: 0
defaultScreenOrientation: 4
targetDevice: 2
useOnDemandResources: 0
accelerometerFrequency: 60
companyName: DefaultCompany
productName: unity-sandbox
defaultCursor: {fileID: 0}
cursorHotspot: {x: 0, y: 0}
m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1}
m_ShowUnitySplashScreen: 1
m_ShowUnitySplashLogo: 1
m_SplashScreenOverlayOpacity: 1
m_SplashScreenAnimation: 1
m_SplashScreenLogoStyle: 1
m_SplashScreenDrawMode: 0
m_SplashScreenBackgroundAnimationZoom: 1
m_SplashScreenLogoAnimationZoom: 1
m_SplashScreenBackgroundLandscapeAspect: 1
m_SplashScreenBackgroundPortraitAspect: 1
m_SplashScreenBackgroundLandscapeUvs:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
m_SplashScreenBackgroundPortraitUvs:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
m_SplashScreenLogos: []
m_VirtualRealitySplashScreen: {fileID: 0}
m_HolographicTrackingLossScreen: {fileID: 0}
defaultScreenWidth: 1920
defaultScreenHeight: 1080
defaultScreenWidthWeb: 960
defaultScreenHeightWeb: 600
m_StereoRenderingPath: 0
m_ActiveColorSpace: 0
m_MTRendering: 1
mipStripping: 0
numberOfMipsStripped: 0
m_StackTraceTypes: 010000000100000001000000010000000100000001000000
iosShowActivityIndicatorOnLoading: -1
androidShowActivityIndicatorOnLoading: -1
iosUseCustomAppBackgroundBehavior: 0
iosAllowHTTPDownload: 1
allowedAutorotateToPortrait: 1
allowedAutorotateToPortraitUpsideDown: 1
allowedAutorotateToLandscapeRight: 1
allowedAutorotateToLandscapeLeft: 1
useOSAutorotation: 1
use32BitDisplayBuffer: 1
preserveFramebufferAlpha: 0
disableDepthAndStencilBuffers: 0
androidStartInFullscreen: 1
androidRenderOutsideSafeArea: 1
androidUseSwappy: 1
androidBlitType: 0
androidResizableWindow: 0
androidDefaultWindowWidth: 1920
androidDefaultWindowHeight: 1080
androidMinimumWindowWidth: 400
androidMinimumWindowHeight: 300
androidFullscreenMode: 1
defaultIsNativeResolution: 1
macRetinaSupport: 1
runInBackground: 0
captureSingleScreen: 0
muteOtherAudioSources: 0
Prepare IOS For Recording: 0
Force IOS Speakers When Recording: 0
deferSystemGesturesMode: 0
hideHomeButton: 0
submitAnalytics: 1
usePlayerLog: 1
bakeCollisionMeshes: 0
forceSingleInstance: 0
useFlipModelSwapchain: 1
resizableWindow: 0
useMacAppStoreValidation: 0
macAppStoreCategory: public.app-category.games
gpuSkinning: 0
xboxPIXTextureCapture: 0
xboxEnableAvatar: 0
xboxEnableKinect: 0
xboxEnableKinectAutoTracking: 0
xboxEnableFitness: 0
visibleInBackground: 1
allowFullscreenSwitch: 1
fullscreenMode: 3
xboxSpeechDB: 0
xboxEnableHeadOrientation: 0
xboxEnableGuest: 0
xboxEnablePIXSampling: 0
metalFramebufferOnly: 0
xboxOneResolution: 0
xboxOneSResolution: 0
xboxOneXResolution: 3
xboxOneMonoLoggingLevel: 0
xboxOneLoggingLevel: 1
xboxOneDisableEsram: 0
xboxOneEnableTypeOptimization: 0
xboxOnePresentImmediateThreshold: 0
switchQueueCommandMemory: 1048576
switchQueueControlMemory: 16384
switchQueueComputeMemory: 262144
switchNVNShaderPoolsGranularity: 33554432
switchNVNDefaultPoolsGranularity: 16777216
switchNVNOtherPoolsGranularity: 16777216
switchNVNMaxPublicTextureIDCount: 0
switchNVNMaxPublicSamplerIDCount: 0
stadiaPresentMode: 0
stadiaTargetFramerate: 0
vulkanNumSwapchainBuffers: 3
vulkanEnableSetSRGBWrite: 0
vulkanEnablePreTransform: 0
vulkanEnableLateAcquireNextImage: 0
vulkanEnableCommandBufferRecycling: 1
m_SupportedAspectRatios:
4:3: 1
5:4: 1
16:10: 1
16:9: 1
Others: 1
bundleVersion: 1.0
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
m_HolographicPauseOnTrackingLoss: 1
xboxOneDisableKinectGpuReservation: 1
xboxOneEnable7thCore: 1
vrSettings:
enable360StereoCapture: 0
isWsaHolographicRemotingEnabled: 0
enableFrameTimingStats: 0
enableOpenGLProfilerGPURecorders: 1
useHDRDisplay: 0
D3DHDRBitDepth: 0
m_ColorGamuts: 00000000
targetPixelDensity: 30
resolutionScalingMode: 0
resetResolutionOnWindowResize: 0
androidSupportedAspectRatio: 1
androidMaxAspectRatio: 2.1
applicationIdentifier:
Standalone: com.DefaultCompany.2DProject
buildNumber:
Standalone: 0
iPhone: 0
tvOS: 0
overrideDefaultApplicationIdentifier: 1
AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 22
AndroidTargetSdkVersion: 0
AndroidPreferredInstallLocation: 1
aotOptions:
stripEngineCode: 1
iPhoneStrippingLevel: 0
iPhoneScriptCallOptimization: 0
ForceInternetPermission: 0
ForceSDCardPermission: 0
CreateWallpaper: 0
APKExpansionFiles: 0
keepLoadedShadersAlive: 0
StripUnusedMeshComponents: 0
VertexChannelCompressionMask: 4054
iPhoneSdkVersion: 988
iOSTargetOSVersionString: 11.0
tvOSSdkVersion: 0
tvOSRequireExtendedGameController: 0
tvOSTargetOSVersionString: 11.0
uIPrerenderedIcon: 0
uIRequiresPersistentWiFi: 0
uIRequiresFullScreen: 1
uIStatusBarHidden: 1
uIExitOnSuspend: 0
uIStatusBarStyle: 0
appleTVSplashScreen: {fileID: 0}
appleTVSplashScreen2x: {fileID: 0}
tvOSSmallIconLayers: []
tvOSSmallIconLayers2x: []
tvOSLargeIconLayers: []
tvOSLargeIconLayers2x: []
tvOSTopShelfImageLayers: []
tvOSTopShelfImageLayers2x: []
tvOSTopShelfImageWideLayers: []
tvOSTopShelfImageWideLayers2x: []
iOSLaunchScreenType: 0
iOSLaunchScreenPortrait: {fileID: 0}
iOSLaunchScreenLandscape: {fileID: 0}
iOSLaunchScreenBackgroundColor:
serializedVersion: 2
rgba: 0
iOSLaunchScreenFillPct: 100
iOSLaunchScreenSize: 100
iOSLaunchScreenCustomXibPath:
iOSLaunchScreeniPadType: 0
iOSLaunchScreeniPadImage: {fileID: 0}
iOSLaunchScreeniPadBackgroundColor:
serializedVersion: 2
rgba: 0
iOSLaunchScreeniPadFillPct: 100
iOSLaunchScreeniPadSize: 100
iOSLaunchScreeniPadCustomXibPath:
iOSLaunchScreenCustomStoryboardPath:
iOSLaunchScreeniPadCustomStoryboardPath:
iOSDeviceRequirements: []
iOSURLSchemes: []
macOSURLSchemes: []
iOSBackgroundModes: 0
iOSMetalForceHardShadows: 0
metalEditorSupport: 1
metalAPIValidation: 1
iOSRenderExtraFrameOnPause: 0
iosCopyPluginsCodeInsteadOfSymlink: 0
appleDeveloperTeamID:
iOSManualSigningProvisioningProfileID:
tvOSManualSigningProvisioningProfileID:
iOSManualSigningProvisioningProfileType: 0
tvOSManualSigningProvisioningProfileType: 0
appleEnableAutomaticSigning: 0
iOSRequireARKit: 0
iOSAutomaticallyDetectAndAddCapabilities: 1
appleEnableProMotion: 0
shaderPrecisionModel: 0
clonedFromGUID: 10ad67313f4034357812315f3c407484
templatePackageId: com.unity.template.2d@6.1.1
templateDefaultScene: Assets/Scenes/SampleScene.unity
useCustomMainManifest: 0
useCustomLauncherManifest: 0
useCustomMainGradleTemplate: 0
useCustomLauncherGradleManifest: 0
useCustomBaseGradleTemplate: 0
useCustomGradlePropertiesTemplate: 0
useCustomProguardFile: 0
AndroidTargetArchitectures: 1
AndroidTargetDevices: 0
AndroidSplashScreenScale: 0
androidSplashScreen: {fileID: 0}
AndroidKeystoreName:
AndroidKeyaliasName:
AndroidBuildApkPerCpuArchitecture: 0
AndroidTVCompatibility: 0
AndroidIsGame: 1
AndroidEnableTango: 0
androidEnableBanner: 1
androidUseLowAccuracyLocation: 0
androidUseCustomKeystore: 0
m_AndroidBanners:
- width: 320
height: 180
banner: {fileID: 0}
androidGamepadSupportLevel: 0
chromeosInputEmulation: 1
AndroidMinifyWithR8: 0
AndroidMinifyRelease: 0
AndroidMinifyDebug: 0
AndroidValidateAppBundleSize: 1
AndroidAppBundleSizeToValidate: 150
m_BuildTargetIcons: []
m_BuildTargetPlatformIcons: []
m_BuildTargetBatching: []
m_BuildTargetGraphicsJobs:
- m_BuildTarget: MacStandaloneSupport
m_GraphicsJobs: 0
- m_BuildTarget: Switch
m_GraphicsJobs: 0
- m_BuildTarget: MetroSupport
m_GraphicsJobs: 0
- m_BuildTarget: AppleTVSupport
m_GraphicsJobs: 0
- m_BuildTarget: BJMSupport
m_GraphicsJobs: 0
- m_BuildTarget: LinuxStandaloneSupport
m_GraphicsJobs: 0
- m_BuildTarget: PS4Player
m_GraphicsJobs: 0
- m_BuildTarget: iOSSupport
m_GraphicsJobs: 0
- m_BuildTarget: WindowsStandaloneSupport
m_GraphicsJobs: 0
- m_BuildTarget: XboxOnePlayer
m_GraphicsJobs: 0
- m_BuildTarget: LuminSupport
m_GraphicsJobs: 0
- m_BuildTarget: AndroidPlayer
m_GraphicsJobs: 0
- m_BuildTarget: WebGLSupport
m_GraphicsJobs: 0
m_BuildTargetGraphicsJobMode: []
m_BuildTargetGraphicsAPIs:
- m_BuildTarget: AndroidPlayer
m_APIs: 150000000b000000
m_Automatic: 1
- m_BuildTarget: iOSSupport
m_APIs: 10000000
m_Automatic: 1
m_BuildTargetVRSettings: []
openGLRequireES31: 0
openGLRequireES31AEP: 0
openGLRequireES32: 0
m_TemplateCustomTags: {}
mobileMTRendering:
Android: 1
iPhone: 1
tvOS: 1
m_BuildTargetGroupLightmapEncodingQuality: []
m_BuildTargetGroupLightmapSettings: []
m_BuildTargetNormalMapEncoding: []
m_BuildTargetDefaultTextureCompressionFormat:
- m_BuildTarget: Android
m_Format: 3
playModeTestRunnerEnabled: 0
runPlayModeTestAsEditModeTest: 0
actionOnDotNetUnhandledException: 1
enableInternalProfiler: 0
logObjCUncaughtExceptions: 1
enableCrashReportAPI: 0
cameraUsageDescription:
locationUsageDescription:
microphoneUsageDescription:
bluetoothUsageDescription:
switchNMETAOverride:
switchNetLibKey:
switchSocketMemoryPoolSize: 6144
switchSocketAllocatorPoolSize: 128
switchSocketConcurrencyLimit: 14
switchScreenResolutionBehavior: 2
switchUseCPUProfiler: 0
switchUseGOLDLinker: 0
switchLTOSetting: 0
switchApplicationID: 0x01004b9000490000
switchNSODependencies:
switchTitleNames_0:
switchTitleNames_1:
switchTitleNames_2:
switchTitleNames_3:
switchTitleNames_4:
switchTitleNames_5:
switchTitleNames_6:
switchTitleNames_7:
switchTitleNames_8:
switchTitleNames_9:
switchTitleNames_10:
switchTitleNames_11:
switchTitleNames_12:
switchTitleNames_13:
switchTitleNames_14:
switchTitleNames_15:
switchPublisherNames_0:
switchPublisherNames_1:
switchPublisherNames_2:
switchPublisherNames_3:
switchPublisherNames_4:
switchPublisherNames_5:
switchPublisherNames_6:
switchPublisherNames_7:
switchPublisherNames_8:
switchPublisherNames_9:
switchPublisherNames_10:
switchPublisherNames_11:
switchPublisherNames_12:
switchPublisherNames_13:
switchPublisherNames_14:
switchPublisherNames_15:
switchIcons_0: {fileID: 0}
switchIcons_1: {fileID: 0}
switchIcons_2: {fileID: 0}
switchIcons_3: {fileID: 0}
switchIcons_4: {fileID: 0}
switchIcons_5: {fileID: 0}
switchIcons_6: {fileID: 0}
switchIcons_7: {fileID: 0}
switchIcons_8: {fileID: 0}
switchIcons_9: {fileID: 0}
switchIcons_10: {fileID: 0}
switchIcons_11: {fileID: 0}
switchIcons_12: {fileID: 0}
switchIcons_13: {fileID: 0}
switchIcons_14: {fileID: 0}
switchIcons_15: {fileID: 0}
switchSmallIcons_0: {fileID: 0}
switchSmallIcons_1: {fileID: 0}
switchSmallIcons_2: {fileID: 0}
switchSmallIcons_3: {fileID: 0}
switchSmallIcons_4: {fileID: 0}
switchSmallIcons_5: {fileID: 0}
switchSmallIcons_6: {fileID: 0}
switchSmallIcons_7: {fileID: 0}
switchSmallIcons_8: {fileID: 0}
switchSmallIcons_9: {fileID: 0}
switchSmallIcons_10: {fileID: 0}
switchSmallIcons_11: {fileID: 0}
switchSmallIcons_12: {fileID: 0}
switchSmallIcons_13: {fileID: 0}
switchSmallIcons_14: {fileID: 0}
switchSmallIcons_15: {fileID: 0}
switchManualHTML:
switchAccessibleURLs:
switchLegalInformation:
switchMainThreadStackSize: 1048576
switchPresenceGroupId:
switchLogoHandling: 0
switchReleaseVersion: 0
switchDisplayVersion: 1.0.0
switchStartupUserAccount: 0
switchTouchScreenUsage: 0
switchSupportedLanguagesMask: 0
switchLogoType: 0
switchApplicationErrorCodeCategory:
switchUserAccountSaveDataSize: 0
switchUserAccountSaveDataJournalSize: 0
switchApplicationAttribute: 0
switchCardSpecSize: -1
switchCardSpecClock: -1
switchRatingsMask: 0
switchRatingsInt_0: 0
switchRatingsInt_1: 0
switchRatingsInt_2: 0
switchRatingsInt_3: 0
switchRatingsInt_4: 0
switchRatingsInt_5: 0
switchRatingsInt_6: 0
switchRatingsInt_7: 0
switchRatingsInt_8: 0
switchRatingsInt_9: 0
switchRatingsInt_10: 0
switchRatingsInt_11: 0
switchRatingsInt_12: 0
switchLocalCommunicationIds_0:
switchLocalCommunicationIds_1:
switchLocalCommunicationIds_2:
switchLocalCommunicationIds_3:
switchLocalCommunicationIds_4:
switchLocalCommunicationIds_5:
switchLocalCommunicationIds_6:
switchLocalCommunicationIds_7:
switchParentalControl: 0
switchAllowsScreenshot: 1
switchAllowsVideoCapturing: 1
switchAllowsRuntimeAddOnContentInstall: 0
switchDataLossConfirmation: 0
switchUserAccountLockEnabled: 0
switchSystemResourceMemory: 16777216
switchSupportedNpadStyles: 22
switchNativeFsCacheSize: 32
switchIsHoldTypeHorizontal: 0
switchSupportedNpadCount: 8
switchSocketConfigEnabled: 0
switchTcpInitialSendBufferSize: 32
switchTcpInitialReceiveBufferSize: 64
switchTcpAutoSendBufferSizeMax: 256
switchTcpAutoReceiveBufferSizeMax: 256
switchUdpSendBufferSize: 9
switchUdpReceiveBufferSize: 42
switchSocketBufferEfficiency: 4
switchSocketInitializeEnabled: 1
switchNetworkInterfaceManagerInitializeEnabled: 1
switchPlayerConnectionEnabled: 1
switchUseNewStyleFilepaths: 0
switchUseMicroSleepForYield: 1
switchEnableRamDiskSupport: 0
switchMicroSleepForYieldTime: 25
switchRamDiskSpaceSize: 12
ps4NPAgeRating: 12
ps4NPTitleSecret:
ps4NPTrophyPackPath:
ps4ParentalLevel: 11
ps4ContentID: ED1633-NPXX51362_00-0000000000000000
ps4Category: 0
ps4MasterVersion: 01.00
ps4AppVersion: 01.00
ps4AppType: 0
ps4ParamSfxPath:
ps4VideoOutPixelFormat: 0
ps4VideoOutInitialWidth: 1920
ps4VideoOutBaseModeInitialWidth: 1920
ps4VideoOutReprojectionRate: 60
ps4PronunciationXMLPath:
ps4PronunciationSIGPath:
ps4BackgroundImagePath:
ps4StartupImagePath:
ps4StartupImagesFolder:
ps4IconImagesFolder:
ps4SaveDataImagePath:
ps4SdkOverride:
ps4BGMPath:
ps4ShareFilePath:
ps4ShareOverlayImagePath:
ps4PrivacyGuardImagePath:
ps4ExtraSceSysFile:
ps4NPtitleDatPath:
ps4RemotePlayKeyAssignment: -1
ps4RemotePlayKeyMappingDir:
ps4PlayTogetherPlayerCount: 0
ps4EnterButtonAssignment: 2
ps4ApplicationParam1: 0
ps4ApplicationParam2: 0
ps4ApplicationParam3: 0
ps4ApplicationParam4: 0
ps4DownloadDataSize: 0
ps4GarlicHeapSize: 2048
ps4ProGarlicHeapSize: 2560
playerPrefsMaxSize: 32768
ps4Passcode: bi9UOuSpM2Tlh01vOzwvSikHFswuzleh
ps4pnSessions: 1
ps4pnPresence: 1
ps4pnFriends: 1
ps4pnGameCustomData: 1
playerPrefsSupport: 0
enableApplicationExit: 0
resetTempFolder: 1
restrictedAudioUsageRights: 0
ps4UseResolutionFallback: 0
ps4ReprojectionSupport: 0
ps4UseAudio3dBackend: 0
ps4UseLowGarlicFragmentationMode: 1
ps4SocialScreenEnabled: 0
ps4ScriptOptimizationLevel: 2
ps4Audio3dVirtualSpeakerCount: 14
ps4attribCpuUsage: 0
ps4PatchPkgPath:
ps4PatchLatestPkgPath:
ps4PatchChangeinfoPath:
ps4PatchDayOne: 0
ps4attribUserManagement: 0
ps4attribMoveSupport: 0
ps4attrib3DSupport: 0
ps4attribShareSupport: 0
ps4attribExclusiveVR: 0
ps4disableAutoHideSplash: 0
ps4videoRecordingFeaturesUsed: 0
ps4contentSearchFeaturesUsed: 0
ps4CompatibilityPS5: 0
ps4AllowPS5Detection: 0
ps4GPU800MHz: 1
ps4attribEyeToEyeDistanceSettingVR: 0
ps4IncludedModules: []
ps4attribVROutputEnabled: 0
monoEnv:
splashScreenBackgroundSourceLandscape: {fileID: 0}
splashScreenBackgroundSourcePortrait: {fileID: 0}
blurSplashScreenBackground: 1
spritePackerPolicy:
webGLMemorySize: 32
webGLExceptionSupport: 1
webGLNameFilesAsHashes: 0
webGLDataCaching: 1
webGLDebugSymbols: 0
webGLEmscriptenArgs:
webGLModulesDirectory:
webGLTemplate: APPLICATION:Default
webGLAnalyzeBuildSize: 0
webGLUseEmbeddedResources: 0
webGLCompressionFormat: 0
webGLWasmArithmeticExceptions: 0
webGLLinkerTarget: 1
webGLThreadsSupport: 0
webGLDecompressionFallback: 0
scriptingDefineSymbols: {}
additionalCompilerArguments: {}
platformArchitecture: {}
scriptingBackend:
Standalone: 1
il2cppCompilerConfiguration: {}
managedStrippingLevel: {}
incrementalIl2cppBuild: {}
suppressCommonWarnings: 1
allowUnsafeCode: 1
useDeterministicCompilation: 1
enableRoslynAnalyzers: 1
additionalIl2CppArgs:
scriptingRuntimeVersion: 1
gcIncremental: 1
assemblyVersionValidation: 1
gcWBarrierValidation: 0
apiCompatibilityLevelPerPlatform: {}
m_RenderingPath: 1
m_MobileRenderingPath: 1
metroPackageName: 2D_BuiltInRenderer
metroPackageVersion:
metroCertificatePath:
metroCertificatePassword:
metroCertificateSubject:
metroCertificateIssuer:
metroCertificateNotAfter: 0000000000000000
metroApplicationDescription: 2D_BuiltInRenderer
wsaImages: {}
metroTileShortName:
metroTileShowName: 0
metroMediumTileShowName: 0
metroLargeTileShowName: 0
metroWideTileShowName: 0
metroSupportStreamingInstall: 0
metroLastRequiredScene: 0
metroDefaultTileSize: 1
metroTileForegroundText: 2
metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0}
metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, a: 1}
metroSplashScreenUseBackgroundColor: 0
platformCapabilities: {}
metroTargetDeviceFamilies: {}
metroFTAName:
metroFTAFileTypes: []
metroProtocolName:
vcxProjDefaultLanguage:
XboxOneProductId:
XboxOneUpdateKey:
XboxOneSandboxId:
XboxOneContentId:
XboxOneTitleId:
XboxOneSCId:
XboxOneGameOsOverridePath:
XboxOnePackagingOverridePath:
XboxOneAppManifestOverridePath:
XboxOneVersion: 1.0.0.0
XboxOnePackageEncryption: 0
XboxOnePackageUpdateGranularity: 2
XboxOneDescription:
XboxOneLanguage:
- enus
XboxOneCapability: []
XboxOneGameRating: {}
XboxOneIsContentPackage: 0
XboxOneEnhancedXboxCompatibilityMode: 0
XboxOneEnableGPUVariability: 1
XboxOneSockets: {}
XboxOneSplashScreen: {fileID: 0}
XboxOneAllowedProductIds: []
XboxOnePersistentLocalStorageSize: 0
XboxOneXTitleMemory: 8
XboxOneOverrideIdentityName:
XboxOneOverrideIdentityPublisher:
vrEditorSettings: {}
cloudServicesEnabled: {}
luminIcon:
m_Name:
m_ModelFolderPath:
m_PortalFolderPath:
luminCert:
m_CertPath:
m_SignPackage: 1
luminIsChannelApp: 0
luminVersion:
m_VersionCode: 1
m_VersionName:
apiCompatibilityLevel: 6
activeInputHandler: 0
cloudProjectId:
framebufferDepthMemorylessMode: 0
qualitySettingsNames: []
projectName:
organizationId:
cloudEnabled: 0
legacyClampBlendShapeWeights: 0
playerDataPath:
forceSRGBBlit: 1
virtualTexturingSupportEnabled: 0

View File

@ -0,0 +1,2 @@
m_EditorVersion: 2021.3.11f1
m_EditorVersionWithRevision: 2021.3.11f1 (0a5ca18544bf)

View File

@ -0,0 +1,239 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!47 &1
QualitySettings:
m_ObjectHideFlags: 0
serializedVersion: 5
m_CurrentQuality: 5
m_QualitySettings:
- serializedVersion: 2
name: Very Low
pixelLightCount: 0
shadows: 0
shadowResolution: 0
shadowProjection: 1
shadowCascades: 1
shadowDistance: 15
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
shadowmaskMode: 0
skinWeights: 1
textureQuality: 1
anisotropicTextures: 0
antiAliasing: 0
softParticles: 0
softVegetation: 0
realtimeReflectionProbes: 0
billboardsFaceCameraPosition: 0
vSyncCount: 0
lodBias: 0.3
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 4
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
customRenderPipeline: {fileID: 0}
excludedTargetPlatforms: []
- serializedVersion: 2
name: Low
pixelLightCount: 0
shadows: 0
shadowResolution: 0
shadowProjection: 1
shadowCascades: 1
shadowDistance: 20
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
shadowmaskMode: 0
skinWeights: 2
textureQuality: 0
anisotropicTextures: 0
antiAliasing: 0
softParticles: 0
softVegetation: 0
realtimeReflectionProbes: 0
billboardsFaceCameraPosition: 0
vSyncCount: 0
lodBias: 0.4
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 16
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
customRenderPipeline: {fileID: 0}
excludedTargetPlatforms: []
- serializedVersion: 2
name: Medium
pixelLightCount: 1
shadows: 1
shadowResolution: 0
shadowProjection: 1
shadowCascades: 1
shadowDistance: 20
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
shadowmaskMode: 0
skinWeights: 2
textureQuality: 0
anisotropicTextures: 1
antiAliasing: 0
softParticles: 0
softVegetation: 0
realtimeReflectionProbes: 0
billboardsFaceCameraPosition: 0
vSyncCount: 1
lodBias: 0.7
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 64
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
customRenderPipeline: {fileID: 0}
excludedTargetPlatforms: []
- serializedVersion: 2
name: High
pixelLightCount: 2
shadows: 2
shadowResolution: 1
shadowProjection: 1
shadowCascades: 2
shadowDistance: 40
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
shadowmaskMode: 1
skinWeights: 2
textureQuality: 0
anisotropicTextures: 1
antiAliasing: 0
softParticles: 0
softVegetation: 1
realtimeReflectionProbes: 1
billboardsFaceCameraPosition: 1
vSyncCount: 1
lodBias: 1
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 256
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
customRenderPipeline: {fileID: 0}
excludedTargetPlatforms: []
- serializedVersion: 2
name: Very High
pixelLightCount: 3
shadows: 2
shadowResolution: 2
shadowProjection: 1
shadowCascades: 2
shadowDistance: 70
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
shadowmaskMode: 1
skinWeights: 4
textureQuality: 0
anisotropicTextures: 2
antiAliasing: 2
softParticles: 1
softVegetation: 1
realtimeReflectionProbes: 1
billboardsFaceCameraPosition: 1
vSyncCount: 1
lodBias: 1.5
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 1024
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
customRenderPipeline: {fileID: 0}
excludedTargetPlatforms: []
- serializedVersion: 2
name: Ultra
pixelLightCount: 4
shadows: 2
shadowResolution: 2
shadowProjection: 1
shadowCascades: 4
shadowDistance: 150
shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667}
shadowmaskMode: 1
skinWeights: 255
textureQuality: 0
anisotropicTextures: 2
antiAliasing: 2
softParticles: 1
softVegetation: 1
realtimeReflectionProbes: 1
billboardsFaceCameraPosition: 1
vSyncCount: 1
lodBias: 2
maximumLODLevel: 0
streamingMipmapsActive: 0
streamingMipmapsAddAllCameras: 1
streamingMipmapsMemoryBudget: 512
streamingMipmapsRenderersPerFrame: 512
streamingMipmapsMaxLevelReduction: 2
streamingMipmapsMaxFileIORequests: 1024
particleRaycastBudget: 4096
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 16
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
customRenderPipeline: {fileID: 0}
excludedTargetPlatforms: []
m_PerPlatformDefaultQuality:
Android: 2
Lumin: 5
GameCoreScarlett: 5
GameCoreXboxOne: 5
Nintendo Switch: 5
PS4: 5
PS5: 5
Stadia: 5
Standalone: 5
WebGL: 3
Windows Store Apps: 5
XboxOne: 5
iPhone: 2
tvOS: 2

View File

@ -0,0 +1,167 @@
{
"templatePinStates": [],
"dependencyTypeInfos": [
{
"userAdded": false,
"type": "UnityEngine.AnimationClip",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEditor.Animations.AnimatorController",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.AnimatorOverrideController",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEditor.Audio.AudioMixerController",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.ComputeShader",
"ignore": true,
"defaultInstantiationMode": 1,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.Cubemap",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.GameObject",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEditor.LightingDataAsset",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": false
},
{
"userAdded": false,
"type": "UnityEngine.LightingSettings",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.Material",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEditor.MonoScript",
"ignore": true,
"defaultInstantiationMode": 1,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.PhysicMaterial",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.PhysicsMaterial2D",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.Rendering.PostProcessing.PostProcessProfile",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.Rendering.PostProcessing.PostProcessResources",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.Rendering.VolumeProfile",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEditor.SceneAsset",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": false
},
{
"userAdded": false,
"type": "UnityEngine.Shader",
"ignore": true,
"defaultInstantiationMode": 1,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.ShaderVariantCollection",
"ignore": true,
"defaultInstantiationMode": 1,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.Texture",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.Texture2D",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
},
{
"userAdded": false,
"type": "UnityEngine.Timeline.TimelineAsset",
"ignore": false,
"defaultInstantiationMode": 0,
"supportsModification": true
}
],
"defaultDependencyTypeInfo": {
"userAdded": false,
"type": "<default_scene_template_dependencies>",
"ignore": false,
"defaultInstantiationMode": 1,
"supportsModification": true
},
"newSceneOverride": 0
}

View File

@ -0,0 +1,43 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!78 &1
TagManager:
serializedVersion: 2
tags: []
layers:
- Default
- TransparentFX
- Ignore Raycast
-
- Water
- UI
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
m_SortingLayers:
- name: Default
uniqueID: 0
locked: 0

View File

@ -0,0 +1,9 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!5 &1
TimeManager:
m_ObjectHideFlags: 0
Fixed Timestep: 0.02
Maximum Allowed Timestep: 0.33333334
m_TimeScale: 1
Maximum Particle Timestep: 0.03

View File

@ -0,0 +1,35 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!310 &1
UnityConnectSettings:
m_ObjectHideFlags: 0
serializedVersion: 1
m_Enabled: 0
m_TestMode: 0
m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events
m_EventUrl: https://cdp.cloud.unity3d.com/v1/events
m_ConfigUrl: https://config.uca.cloud.unity3d.com
m_DashboardUrl: https://dashboard.unity3d.com
m_TestInitMode: 0
CrashReportingSettings:
m_EventUrl: https://perf-events.cloud.unity3d.com
m_Enabled: 0
m_LogBufferSize: 10
m_CaptureEditorExceptions: 1
UnityPurchasingSettings:
m_Enabled: 0
m_TestMode: 0
UnityAnalyticsSettings:
m_Enabled: 0
m_TestMode: 0
m_InitializeOnStartup: 1
UnityAdsSettings:
m_Enabled: 0
m_InitializeOnStartup: 1
m_TestMode: 0
m_IosGameId:
m_AndroidGameId:
m_GameIds: {}
m_GameId:
PerformanceReportingSettings:
m_Enabled: 0

View File

@ -0,0 +1,14 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!937362698 &1
VFXManager:
m_ObjectHideFlags: 0
m_IndirectShader: {fileID: 0}
m_CopyBufferShader: {fileID: 0}
m_SortShader: {fileID: 0}
m_StripUpdateShader: {fileID: 0}
m_RenderPipeSettingsPath:
m_FixedTimeStep: 0.016666668
m_MaxDeltaTime: 0.05
m_CompiledVersion: 0
m_RuntimeVersion: 0

View File

@ -0,0 +1,8 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!890905787 &1
VersionControlSettings:
m_ObjectHideFlags: 0
m_Mode: Visible Meta Files
m_CollabEditorSettings:
inProgressEnabled: 1

View File

@ -0,0 +1,10 @@
{
"m_SettingKeys": [
"VR Device Disabled",
"VR Device User Alert"
],
"m_SettingValues": [
"False",
"False"
]
}

View File

@ -0,0 +1,28 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!162 &1
EditorUserSettings:
m_ObjectHideFlags: 0
serializedVersion: 4
m_ConfigSettings:
RecentlyUsedSceneGuid-0:
value: 515250075c0c595e5f5a5e71122159444e4e4a2f7a7d7f602f284d66b4b76661
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650
flags: 0
m_VCAutomaticAdd: 1
m_VCDebugCom: 0
m_VCDebugCmd: 0
m_VCDebugOut: 0
m_SemanticMergeMode: 2
m_DesiredImportWorkerCount: 8
m_StandbyImportWorkerCount: 2
m_IdleImportWorkerShutdownDelay: 60000
m_VCShowFailedCheckout: 1
m_VCOverwriteFailedCheckoutAssets: 1
m_VCProjectOverlayIcons: 1
m_VCHierarchyOverlayIcons: 1
m_VCOtherOverlayIcons: 1
m_VCAllowAsyncUpdate: 1
m_ArtifactGarbageCollection: 1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
{}