csbindgen/dotnet-sandbox/method_call.cs

108 lines
4.6 KiB
C#
Raw Normal View History

2023-02-28 05:49:04 +00:00
// <auto-generated>
// This code is generated by csbindgen.
// DON'T CHANGE THIS DIRECTLY.
// </auto-generated>
using System;
using System.Runtime.InteropServices;
namespace CsBindgen
{
2023-02-28 10:24:11 +00:00
internal static unsafe partial class LibRust
2023-02-28 05:49:04 +00:00
{
const string __DllName = "csbindgen_tests";
2023-03-05 06:30:41 +00:00
[DllImport(__DllName, EntryPoint = "callback_test", CallingConvention = CallingConvention.Cdecl)]
public static extern int callback_test(delegate* unmanaged[Cdecl]<int, int> cb);
[DllImport(__DllName, EntryPoint = "nullable_callback_test", CallingConvention = CallingConvention.Cdecl)]
public static extern int nullable_callback_test(delegate* unmanaged[Cdecl]<int, int> cb);
[DllImport(__DllName, EntryPoint = "callback_test2", CallingConvention = CallingConvention.Cdecl)]
public static extern delegate* unmanaged[Cdecl]<int, int> callback_test2();
[DllImport(__DllName, EntryPoint = "callback", CallingConvention = CallingConvention.Cdecl)]
public static extern int callback(int a);
2023-03-05 08:18:52 +00:00
[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();
2023-02-28 05:49:04 +00:00
[DllImport(__DllName, EntryPoint = "my_add", CallingConvention = CallingConvention.Cdecl)]
public static extern int my_add(int x, int y);
2023-03-04 16:03:33 +00:00
[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);
2023-03-04 05:39:45 +00:00
[DllImport(__DllName, EntryPoint = "alloc_i32_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern ByteBuffer* alloc_i32_buffer();
2023-03-04 05:39:45 +00:00
[DllImport(__DllName, EntryPoint = "free_i32_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern void free_i32_buffer(ByteBuffer* buffer);
2023-03-04 05:39:45 +00:00
2023-03-04 05:54:48 +00:00
[DllImport(__DllName, EntryPoint = "create_context", CallingConvention = CallingConvention.Cdecl)]
public static extern Context* create_context();
2023-02-28 05:49:04 +00:00
2023-03-04 05:54:48 +00:00
[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();
2023-03-04 05:54:48 +00:00
}
[StructLayout(LayoutKind.Sequential)]
internal unsafe partial struct Context
2023-03-04 05:54:48 +00:00
{
[MarshalAs(UnmanagedType.U1)] public bool foo;
2023-02-28 05:49:04 +00:00
}
[StructLayout(LayoutKind.Sequential)]
internal unsafe partial struct ByteBuffer
{
public byte* ptr;
public int length;
public int capacity;
}
2023-03-05 08:18:52 +00:00
internal enum IntEnumTest : byte
{
A = 1,
B = 2,
C = 10,
}
2023-02-28 05:49:04 +00:00
}