diff --git a/crates/servicepoint_binding_cs/ServicePoint/BindGen/BitVecNative.g.cs b/crates/servicepoint_binding_cs/ServicePoint/BindGen/BitVecNative.g.cs
index 9728486..b43ba3e 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/BindGen/BitVecNative.g.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/BindGen/BitVecNative.g.cs
@@ -37,7 +37,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_bitvec_free`.
///
[DllImport(__DllName, EntryPoint = "sp_bitvec_new", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPBitVec* sp_bitvec_new(nuint size);
+ public static extern BitVec* sp_bitvec_new(nuint size);
///
/// Interpret the data as a series of bits and load then into a new [SPBitVec] instance.
@@ -58,7 +58,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_bitvec_free`.
///
[DllImport(__DllName, EntryPoint = "sp_bitvec_load", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPBitVec* sp_bitvec_load(byte* data, nuint data_length);
+ public static extern BitVec* sp_bitvec_load(byte* data, nuint data_length);
///
/// Clones a [SPBitVec].
@@ -79,7 +79,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_bitvec_free`.
///
[DllImport(__DllName, EntryPoint = "sp_bitvec_clone", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPBitVec* sp_bitvec_clone(SPBitVec* bit_vec);
+ public static extern BitVec* sp_bitvec_clone(BitVec* bit_vec);
///
/// Deallocates a [SPBitVec].
@@ -97,7 +97,7 @@ namespace ServicePoint.BindGen
/// - `bit_vec` was not passed to another consuming function, e.g. to create a [SPCommand]
///
[DllImport(__DllName, EntryPoint = "sp_bitvec_free", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern void sp_bitvec_free(SPBitVec* bit_vec);
+ public static extern void sp_bitvec_free(BitVec* bit_vec);
///
/// Gets the value of a bit from the [SPBitVec].
@@ -123,7 +123,7 @@ namespace ServicePoint.BindGen
///
[DllImport(__DllName, EntryPoint = "sp_bitvec_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.U1)]
- public static extern bool sp_bitvec_get(SPBitVec* bit_vec, nuint index);
+ public static extern bool sp_bitvec_get(BitVec* bit_vec, nuint index);
///
/// Sets the value of a bit in the [SPBitVec].
@@ -147,7 +147,7 @@ namespace ServicePoint.BindGen
/// - `bit_vec` is not written to or read from concurrently
///
[DllImport(__DllName, EntryPoint = "sp_bitvec_set", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern void sp_bitvec_set(SPBitVec* bit_vec, nuint index, [MarshalAs(UnmanagedType.U1)] bool value);
+ public static extern void sp_bitvec_set(BitVec* bit_vec, nuint index, [MarshalAs(UnmanagedType.U1)] bool value);
///
/// Sets the value of all bits in the [SPBitVec].
@@ -169,7 +169,7 @@ namespace ServicePoint.BindGen
/// - `bit_vec` is not written to or read from concurrently
///
[DllImport(__DllName, EntryPoint = "sp_bitvec_fill", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern void sp_bitvec_fill(SPBitVec* bit_vec, [MarshalAs(UnmanagedType.U1)] bool value);
+ public static extern void sp_bitvec_fill(BitVec* bit_vec, [MarshalAs(UnmanagedType.U1)] bool value);
///
/// Gets the length of the [SPBitVec] in bits.
@@ -189,7 +189,7 @@ namespace ServicePoint.BindGen
/// - `bit_vec` points to a valid [SPBitVec]
///
[DllImport(__DllName, EntryPoint = "sp_bitvec_len", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern nuint sp_bitvec_len(SPBitVec* bit_vec);
+ public static extern nuint sp_bitvec_len(BitVec* bit_vec);
///
/// Returns true if length is 0.
@@ -210,7 +210,7 @@ namespace ServicePoint.BindGen
///
[DllImport(__DllName, EntryPoint = "sp_bitvec_is_empty", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.U1)]
- public static extern bool sp_bitvec_is_empty(SPBitVec* bit_vec);
+ public static extern bool sp_bitvec_is_empty(BitVec* bit_vec);
///
/// Gets an unsafe reference to the data of the [SPBitVec] instance.
@@ -232,13 +232,13 @@ namespace ServicePoint.BindGen
/// - the returned memory range is never accessed concurrently, either via the [SPBitVec] or directly
///
[DllImport(__DllName, EntryPoint = "sp_bitvec_unsafe_data_ref", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPByteSlice sp_bitvec_unsafe_data_ref(SPBitVec* bit_vec);
+ public static extern ByteSlice sp_bitvec_unsafe_data_ref(BitVec* bit_vec);
}
[StructLayout(LayoutKind.Sequential)]
- public unsafe partial struct SPBitVec
+ public unsafe partial struct BitVec
{
}
diff --git a/crates/servicepoint_binding_cs/ServicePoint/BindGen/BitmapNative.g.cs b/crates/servicepoint_binding_cs/ServicePoint/BindGen/BitmapNative.g.cs
index 6a23f1a..9d8c1ac 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/BindGen/BitmapNative.g.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/BindGen/BitmapNative.g.cs
@@ -38,7 +38,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_bitmap_free`.
///
[DllImport(__DllName, EntryPoint = "sp_bitmap_new", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPBitmap* sp_bitmap_new(nuint width, nuint height);
+ public static extern Bitmap* sp_bitmap_new(nuint width, nuint height);
///
/// Loads a [SPBitmap] with the specified dimensions from the provided data.
@@ -65,7 +65,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_bitmap_free`.
///
[DllImport(__DllName, EntryPoint = "sp_bitmap_load", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPBitmap* sp_bitmap_load(nuint width, nuint height, byte* data, nuint data_length);
+ public static extern Bitmap* sp_bitmap_load(nuint width, nuint height, byte* data, nuint data_length);
///
/// Clones a [SPBitmap].
@@ -86,7 +86,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_bitmap_free`.
///
[DllImport(__DllName, EntryPoint = "sp_bitmap_clone", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPBitmap* sp_bitmap_clone(SPBitmap* bitmap);
+ public static extern Bitmap* sp_bitmap_clone(Bitmap* bitmap);
///
/// Deallocates a [SPBitmap].
@@ -104,7 +104,7 @@ namespace ServicePoint.BindGen
/// - `bitmap` was not passed to another consuming function, e.g. to create a [SPCommand]
///
[DllImport(__DllName, EntryPoint = "sp_bitmap_free", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern void sp_bitmap_free(SPBitmap* bitmap);
+ public static extern void sp_bitmap_free(Bitmap* bitmap);
///
/// Gets the current value at the specified position in the [SPBitmap].
@@ -128,7 +128,7 @@ namespace ServicePoint.BindGen
///
[DllImport(__DllName, EntryPoint = "sp_bitmap_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.U1)]
- public static extern bool sp_bitmap_get(SPBitmap* bitmap, nuint x, nuint y);
+ public static extern bool sp_bitmap_get(Bitmap* bitmap, nuint x, nuint y);
///
/// Sets the value of the specified position in the [SPBitmap].
@@ -154,7 +154,7 @@ namespace ServicePoint.BindGen
/// - `bitmap` is not written to or read from concurrently
///
[DllImport(__DllName, EntryPoint = "sp_bitmap_set", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern void sp_bitmap_set(SPBitmap* bitmap, nuint x, nuint y, [MarshalAs(UnmanagedType.U1)] bool value);
+ public static extern void sp_bitmap_set(Bitmap* bitmap, nuint x, nuint y, [MarshalAs(UnmanagedType.U1)] bool value);
///
/// Sets the state of all pixels in the [SPBitmap].
@@ -176,7 +176,7 @@ namespace ServicePoint.BindGen
/// - `bitmap` is not written to or read from concurrently
///
[DllImport(__DllName, EntryPoint = "sp_bitmap_fill", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern void sp_bitmap_fill(SPBitmap* bitmap, [MarshalAs(UnmanagedType.U1)] bool value);
+ public static extern void sp_bitmap_fill(Bitmap* bitmap, [MarshalAs(UnmanagedType.U1)] bool value);
///
/// Gets the width in pixels of the [SPBitmap] instance.
@@ -196,7 +196,7 @@ namespace ServicePoint.BindGen
/// - `bitmap` points to a valid [SPBitmap]
///
[DllImport(__DllName, EntryPoint = "sp_bitmap_width", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern nuint sp_bitmap_width(SPBitmap* bitmap);
+ public static extern nuint sp_bitmap_width(Bitmap* bitmap);
///
/// Gets the height in pixels of the [SPBitmap] instance.
@@ -216,7 +216,7 @@ namespace ServicePoint.BindGen
/// - `bitmap` points to a valid [SPBitmap]
///
[DllImport(__DllName, EntryPoint = "sp_bitmap_height", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern nuint sp_bitmap_height(SPBitmap* bitmap);
+ public static extern nuint sp_bitmap_height(Bitmap* bitmap);
///
/// Gets an unsafe reference to the data of the [SPBitmap] instance.
@@ -234,13 +234,13 @@ namespace ServicePoint.BindGen
/// - the returned memory range is never accessed concurrently, either via the [SPBitmap] or directly
///
[DllImport(__DllName, EntryPoint = "sp_bitmap_unsafe_data_ref", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPByteSlice sp_bitmap_unsafe_data_ref(SPBitmap* bitmap);
+ public static extern ByteSlice sp_bitmap_unsafe_data_ref(Bitmap* bitmap);
}
[StructLayout(LayoutKind.Sequential)]
- public unsafe partial struct SPBitmap
+ public unsafe partial struct Bitmap
{
}
diff --git a/crates/servicepoint_binding_cs/ServicePoint/BindGen/BrightnessGridNative.g.cs b/crates/servicepoint_binding_cs/ServicePoint/BindGen/BrightnessGridNative.g.cs
index 9b8e942..9c9586f 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/BindGen/BrightnessGridNative.g.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/BindGen/BrightnessGridNative.g.cs
@@ -32,7 +32,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_brightness_grid_free`.
///
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_new", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPBrightnessGrid* sp_brightness_grid_new(nuint width, nuint height);
+ public static extern BrightnessGrid* sp_brightness_grid_new(nuint width, nuint height);
///
/// Loads a [SPBrightnessGrid] with the specified dimensions from the provided data.
@@ -54,7 +54,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_brightness_grid_free`.
///
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_load", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPBrightnessGrid* sp_brightness_grid_load(nuint width, nuint height, byte* data, nuint data_length);
+ public static extern BrightnessGrid* sp_brightness_grid_load(nuint width, nuint height, byte* data, nuint data_length);
///
/// Clones a [SPBrightnessGrid].
@@ -79,7 +79,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_brightness_grid_free`.
///
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_clone", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPBrightnessGrid* sp_brightness_grid_clone(SPBrightnessGrid* brightness_grid);
+ public static extern BrightnessGrid* sp_brightness_grid_clone(BrightnessGrid* brightness_grid);
///
/// Deallocates a [SPBrightnessGrid].
@@ -101,7 +101,7 @@ namespace ServicePoint.BindGen
/// - `brightness_grid` was not passed to another consuming function, e.g. to create a [SPCommand]
///
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_free", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern void sp_brightness_grid_free(SPBrightnessGrid* brightness_grid);
+ public static extern void sp_brightness_grid_free(BrightnessGrid* brightness_grid);
///
/// Gets the current value at the specified position.
@@ -126,7 +126,7 @@ namespace ServicePoint.BindGen
/// - `brightness_grid` is not written to concurrently
///
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern byte sp_brightness_grid_get(SPBrightnessGrid* brightness_grid, nuint x, nuint y);
+ public static extern byte sp_brightness_grid_get(BrightnessGrid* brightness_grid, nuint x, nuint y);
///
/// Sets the value of the specified position in the [SPBrightnessGrid].
@@ -153,7 +153,7 @@ namespace ServicePoint.BindGen
/// - `brightness_grid` is not written to or read from concurrently
///
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_set", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern void sp_brightness_grid_set(SPBrightnessGrid* brightness_grid, nuint x, nuint y, byte value);
+ public static extern void sp_brightness_grid_set(BrightnessGrid* brightness_grid, nuint x, nuint y, byte value);
///
/// Sets the value of all cells in the [SPBrightnessGrid].
@@ -176,7 +176,7 @@ namespace ServicePoint.BindGen
/// - `brightness_grid` is not written to or read from concurrently
///
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_fill", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern void sp_brightness_grid_fill(SPBrightnessGrid* brightness_grid, byte value);
+ public static extern void sp_brightness_grid_fill(BrightnessGrid* brightness_grid, byte value);
///
/// Gets the width of the [SPBrightnessGrid] instance.
@@ -198,7 +198,7 @@ namespace ServicePoint.BindGen
/// - `brightness_grid` points to a valid [SPBrightnessGrid]
///
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_width", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern nuint sp_brightness_grid_width(SPBrightnessGrid* brightness_grid);
+ public static extern nuint sp_brightness_grid_width(BrightnessGrid* brightness_grid);
///
/// Gets the height of the [SPBrightnessGrid] instance.
@@ -220,7 +220,7 @@ namespace ServicePoint.BindGen
/// - `brightness_grid` points to a valid [SPBrightnessGrid]
///
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_height", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern nuint sp_brightness_grid_height(SPBrightnessGrid* brightness_grid);
+ public static extern nuint sp_brightness_grid_height(BrightnessGrid* brightness_grid);
///
/// Gets an unsafe reference to the data of the [SPBrightnessGrid] instance.
@@ -244,13 +244,13 @@ namespace ServicePoint.BindGen
/// - the returned memory range is never accessed concurrently, either via the [SPBrightnessGrid] or directly
///
[DllImport(__DllName, EntryPoint = "sp_brightness_grid_unsafe_data_ref", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPByteSlice sp_brightness_grid_unsafe_data_ref(SPBrightnessGrid* brightness_grid);
+ public static extern ByteSlice sp_brightness_grid_unsafe_data_ref(BrightnessGrid* brightness_grid);
}
[StructLayout(LayoutKind.Sequential)]
- public unsafe partial struct SPBrightnessGrid
+ public unsafe partial struct BrightnessGrid
{
}
diff --git a/crates/servicepoint_binding_cs/ServicePoint/BindGen/ByteSliceNative.g.cs b/crates/servicepoint_binding_cs/ServicePoint/BindGen/ByteSliceNative.g.cs
index 76bcc6f..017b58f 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/BindGen/ByteSliceNative.g.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/BindGen/ByteSliceNative.g.cs
@@ -13,7 +13,7 @@ namespace ServicePoint.BindGen
[StructLayout(LayoutKind.Sequential)]
- public unsafe partial struct SPByteSlice
+ public unsafe partial struct ByteSlice
{
public byte* start;
public nuint length;
diff --git a/crates/servicepoint_binding_cs/ServicePoint/BindGen/CommandNative.g.cs b/crates/servicepoint_binding_cs/ServicePoint/BindGen/CommandNative.g.cs
index 4227659..eb9eb25 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/BindGen/CommandNative.g.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/BindGen/CommandNative.g.cs
@@ -38,7 +38,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_command_free`.
///
[DllImport(__DllName, EntryPoint = "sp_command_try_from_packet", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPCommand* sp_command_try_from_packet(SPPacket* packet);
+ public static extern Command* sp_command_try_from_packet(Packet* packet);
///
/// Clones a [SPCommand] instance.
@@ -59,7 +59,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_command_free`.
///
[DllImport(__DllName, EntryPoint = "sp_command_clone", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPCommand* sp_command_clone(SPCommand* command);
+ public static extern Command* sp_command_clone(Command* command);
///
/// Set all pixels to the off state.
@@ -82,7 +82,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_command_free`.
///
[DllImport(__DllName, EntryPoint = "sp_command_clear", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPCommand* sp_command_clear();
+ public static extern Command* sp_command_clear();
///
/// Kills the udp daemon on the display, which usually results in a restart.
@@ -99,7 +99,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_command_free`.
///
[DllImport(__DllName, EntryPoint = "sp_command_hard_reset", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPCommand* sp_command_hard_reset();
+ public static extern Command* sp_command_hard_reset();
///
/// A yet-to-be-tested command.
@@ -114,7 +114,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_command_free`.
///
[DllImport(__DllName, EntryPoint = "sp_command_fade_out", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPCommand* sp_command_fade_out();
+ public static extern Command* sp_command_fade_out();
///
/// Set the brightness of all tiles to the same value.
@@ -133,7 +133,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_command_free`.
///
[DllImport(__DllName, EntryPoint = "sp_command_brightness", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPCommand* sp_command_brightness(byte brightness);
+ public static extern Command* sp_command_brightness(byte brightness);
///
/// Set the brightness of individual tiles in a rectangular area of the display.
@@ -156,7 +156,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_command_free`.
///
[DllImport(__DllName, EntryPoint = "sp_command_char_brightness", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPCommand* sp_command_char_brightness(nuint x, nuint y, SPBrightnessGrid* grid);
+ public static extern Command* sp_command_char_brightness(nuint x, nuint y, BrightnessGrid* grid);
///
/// Set pixel data starting at the pixel offset on screen.
@@ -186,7 +186,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_command_free`.
///
[DllImport(__DllName, EntryPoint = "sp_command_bitmap_linear", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPCommand* sp_command_bitmap_linear(nuint offset, SPBitVec* bit_vec, SPCompressionCode compression);
+ public static extern Command* sp_command_bitmap_linear(nuint offset, BitVec* bit_vec, CompressionCode compression);
///
/// Set pixel data according to an and-mask starting at the offset.
@@ -216,7 +216,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_command_free`.
///
[DllImport(__DllName, EntryPoint = "sp_command_bitmap_linear_and", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPCommand* sp_command_bitmap_linear_and(nuint offset, SPBitVec* bit_vec, SPCompressionCode compression);
+ public static extern Command* sp_command_bitmap_linear_and(nuint offset, BitVec* bit_vec, CompressionCode compression);
///
/// Set pixel data according to an or-mask starting at the offset.
@@ -246,7 +246,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_command_free`.
///
[DllImport(__DllName, EntryPoint = "sp_command_bitmap_linear_or", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPCommand* sp_command_bitmap_linear_or(nuint offset, SPBitVec* bit_vec, SPCompressionCode compression);
+ public static extern Command* sp_command_bitmap_linear_or(nuint offset, BitVec* bit_vec, CompressionCode compression);
///
/// Set pixel data according to a xor-mask starting at the offset.
@@ -276,7 +276,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_command_free`.
///
[DllImport(__DllName, EntryPoint = "sp_command_bitmap_linear_xor", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPCommand* sp_command_bitmap_linear_xor(nuint offset, SPBitVec* bit_vec, SPCompressionCode compression);
+ public static extern Command* sp_command_bitmap_linear_xor(nuint offset, BitVec* bit_vec, CompressionCode compression);
///
/// Show text on the screen.
@@ -299,7 +299,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_command_free`.
///
[DllImport(__DllName, EntryPoint = "sp_command_cp437_data", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPCommand* sp_command_cp437_data(nuint x, nuint y, SPCp437Grid* grid);
+ public static extern Command* sp_command_cp437_data(nuint x, nuint y, Cp437Grid* grid);
///
/// Sets a window of pixels to the specified values.
@@ -324,7 +324,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_command_free`.
///
[DllImport(__DllName, EntryPoint = "sp_command_bitmap_linear_win", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPCommand* sp_command_bitmap_linear_win(nuint x, nuint y, SPBitmap* bitmap, SPCompressionCode compression_code);
+ public static extern Command* sp_command_bitmap_linear_win(nuint x, nuint y, Bitmap* bitmap, CompressionCode compression_code);
///
/// Deallocates a [SPCommand].
@@ -349,13 +349,13 @@ namespace ServicePoint.BindGen
/// - `command` was not passed to another consuming function, e.g. to create a [SPPacket]
///
[DllImport(__DllName, EntryPoint = "sp_command_free", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern void sp_command_free(SPCommand* command);
+ public static extern void sp_command_free(Command* command);
}
[StructLayout(LayoutKind.Sequential)]
- public unsafe partial struct SPCommand
+ public unsafe partial struct Command
{
}
diff --git a/crates/servicepoint_binding_cs/ServicePoint/BindGen/ConnectionNative.g.cs b/crates/servicepoint_binding_cs/ServicePoint/BindGen/ConnectionNative.g.cs
index e4cdc1f..4ce780b 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/BindGen/ConnectionNative.g.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/BindGen/ConnectionNative.g.cs
@@ -33,7 +33,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_connection_free`.
///
[DllImport(__DllName, EntryPoint = "sp_connection_open", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPConnection* sp_connection_open(byte* host);
+ public static extern Connection* sp_connection_open(byte* host);
///
/// Sends a [SPPacket] to the display using the [SPConnection].
@@ -57,7 +57,7 @@ namespace ServicePoint.BindGen
///
[DllImport(__DllName, EntryPoint = "sp_connection_send_packet", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.U1)]
- public static extern bool sp_connection_send_packet(SPConnection* connection, SPPacket* packet);
+ public static extern bool sp_connection_send_packet(Connection* connection, Packet* packet);
///
/// Sends a [SPCommand] to the display using the [SPConnection].
@@ -81,7 +81,7 @@ namespace ServicePoint.BindGen
///
[DllImport(__DllName, EntryPoint = "sp_connection_send_command", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
[return: MarshalAs(UnmanagedType.U1)]
- public static extern bool sp_connection_send_command(SPConnection* connection, SPCommand* command);
+ public static extern bool sp_connection_send_command(Connection* connection, Command* command);
///
/// Closes and deallocates a [SPConnection].
@@ -98,13 +98,13 @@ namespace ServicePoint.BindGen
/// - `connection` is not used concurrently or after this call
///
[DllImport(__DllName, EntryPoint = "sp_connection_free", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern void sp_connection_free(SPConnection* connection);
+ public static extern void sp_connection_free(Connection* connection);
}
[StructLayout(LayoutKind.Sequential)]
- public unsafe partial struct SPConnection
+ public unsafe partial struct Connection
{
}
diff --git a/crates/servicepoint_binding_cs/ServicePoint/BindGen/ConstantsNative.g.cs b/crates/servicepoint_binding_cs/ServicePoint/BindGen/ConstantsNative.g.cs
index f4b50fb..da06983 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/BindGen/ConstantsNative.g.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/BindGen/ConstantsNative.g.cs
@@ -23,7 +23,7 @@ namespace ServicePoint.BindGen
}
- public enum SPCompressionCode : ushort
+ public enum CompressionCode : ushort
{
Uncompressed = 0,
Zlib = 26490,
diff --git a/crates/servicepoint_binding_cs/ServicePoint/BindGen/Cp437GridNative.g.cs b/crates/servicepoint_binding_cs/ServicePoint/BindGen/Cp437GridNative.g.cs
index b654544..41f3aee 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/BindGen/Cp437GridNative.g.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/BindGen/Cp437GridNative.g.cs
@@ -29,7 +29,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_cp437_grid_free`.
///
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_new", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPCp437Grid* sp_cp437_grid_new(nuint width, nuint height);
+ public static extern Cp437Grid* sp_cp437_grid_new(nuint width, nuint height);
///
/// Loads a [SPCp437Grid] with the specified dimensions from the provided data.
@@ -51,7 +51,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_cp437_grid_free`.
///
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_load", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPCp437Grid* sp_cp437_grid_load(nuint width, nuint height, byte* data, nuint data_length);
+ public static extern Cp437Grid* sp_cp437_grid_load(nuint width, nuint height, byte* data, nuint data_length);
///
/// Clones a [SPCp437Grid].
@@ -72,7 +72,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_cp437_grid_free`.
///
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_clone", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPCp437Grid* sp_cp437_grid_clone(SPCp437Grid* cp437_grid);
+ public static extern Cp437Grid* sp_cp437_grid_clone(Cp437Grid* cp437_grid);
///
/// Deallocates a [SPCp437Grid].
@@ -90,7 +90,7 @@ namespace ServicePoint.BindGen
/// - `cp437_grid` was not passed to another consuming function, e.g. to create a [SPCommand]
///
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_free", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern void sp_cp437_grid_free(SPCp437Grid* cp437_grid);
+ public static extern void sp_cp437_grid_free(Cp437Grid* cp437_grid);
///
/// Gets the current value at the specified position.
@@ -113,7 +113,7 @@ namespace ServicePoint.BindGen
/// - `cp437_grid` is not written to concurrently
///
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern byte sp_cp437_grid_get(SPCp437Grid* cp437_grid, nuint x, nuint y);
+ public static extern byte sp_cp437_grid_get(Cp437Grid* cp437_grid, nuint x, nuint y);
///
/// Sets the value of the specified position in the [SPCp437Grid].
@@ -139,7 +139,7 @@ namespace ServicePoint.BindGen
/// - `cp437_grid` is not written to or read from concurrently
///
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_set", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern void sp_cp437_grid_set(SPCp437Grid* cp437_grid, nuint x, nuint y, byte value);
+ public static extern void sp_cp437_grid_set(Cp437Grid* cp437_grid, nuint x, nuint y, byte value);
///
/// Sets the value of all cells in the [SPCp437Grid].
@@ -161,7 +161,7 @@ namespace ServicePoint.BindGen
/// - `cp437_grid` is not written to or read from concurrently
///
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_fill", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern void sp_cp437_grid_fill(SPCp437Grid* cp437_grid, byte value);
+ public static extern void sp_cp437_grid_fill(Cp437Grid* cp437_grid, byte value);
///
/// Gets the width of the [SPCp437Grid] instance.
@@ -181,7 +181,7 @@ namespace ServicePoint.BindGen
/// - `cp437_grid` points to a valid [SPCp437Grid]
///
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_width", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern nuint sp_cp437_grid_width(SPCp437Grid* cp437_grid);
+ public static extern nuint sp_cp437_grid_width(Cp437Grid* cp437_grid);
///
/// Gets the height of the [SPCp437Grid] instance.
@@ -201,7 +201,7 @@ namespace ServicePoint.BindGen
/// - `cp437_grid` points to a valid [SPCp437Grid]
///
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_height", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern nuint sp_cp437_grid_height(SPCp437Grid* cp437_grid);
+ public static extern nuint sp_cp437_grid_height(Cp437Grid* cp437_grid);
///
/// Gets an unsafe reference to the data of the [SPCp437Grid] instance.
@@ -221,13 +221,13 @@ namespace ServicePoint.BindGen
/// - the returned memory range is never accessed concurrently, either via the [SPCp437Grid] or directly
///
[DllImport(__DllName, EntryPoint = "sp_cp437_grid_unsafe_data_ref", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPByteSlice sp_cp437_grid_unsafe_data_ref(SPCp437Grid* cp437_grid);
+ public static extern ByteSlice sp_cp437_grid_unsafe_data_ref(Cp437Grid* cp437_grid);
}
[StructLayout(LayoutKind.Sequential)]
- public unsafe partial struct SPCp437Grid
+ public unsafe partial struct Cp437Grid
{
}
diff --git a/crates/servicepoint_binding_cs/ServicePoint/BindGen/Extensions.cs b/crates/servicepoint_binding_cs/ServicePoint/BindGen/Extensions.cs
new file mode 100644
index 0000000..20f9436
--- /dev/null
+++ b/crates/servicepoint_binding_cs/ServicePoint/BindGen/Extensions.cs
@@ -0,0 +1,49 @@
+using GroupedNativeMethodsGenerator;
+
+namespace ServicePoint.BindGen;
+
+[GroupedNativeMethods(removePrefix: "sp_bitmap_")]
+public static unsafe partial class BitmapNative
+{
+}
+
+[GroupedNativeMethods(removePrefix: "sp_bitvec_")]
+public static unsafe partial class BitVecNative
+{
+}
+
+[GroupedNativeMethods(removePrefix: "sp_brightness_grid")]
+public static unsafe partial class BrightnessGridNative
+{
+}
+
+[GroupedNativeMethods(removePrefix: "sp_byte_slice")]
+public static unsafe partial class ByteSliceNative
+{
+}
+
+[GroupedNativeMethods(removePrefix: "sp_command_")]
+public static unsafe partial class CommandNative
+{
+}
+
+[GroupedNativeMethods(removePrefix: "sp_connection_")]
+public static unsafe partial class ConnectionNative
+{
+}
+
+[GroupedNativeMethods(removePrefix: "sp_constants_")]
+public static unsafe partial class ConstantsNative
+{
+}
+
+
+[GroupedNativeMethods(removePrefix: "sp_cp437_grid_")]
+public static unsafe partial class Cp437GridNative
+{
+}
+
+[GroupedNativeMethods(removePrefix: "sp_packet_")]
+public static unsafe partial class PacketNative
+{
+}
diff --git a/crates/servicepoint_binding_cs/ServicePoint/BindGen/LibNative.g.cs b/crates/servicepoint_binding_cs/ServicePoint/BindGen/LibNative.g.cs
deleted file mode 100644
index f385863..0000000
--- a/crates/servicepoint_binding_cs/ServicePoint/BindGen/LibNative.g.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// This code is generated by csbindgen.
-// DON'T CHANGE THIS DIRECTLY.
-//
-#pragma warning disable CS8500
-#pragma warning disable CS8981
-using System;
-using System.Runtime.InteropServices;
-
-
-namespace ServicePoint.BindGen
-{
-
-
-
-
-}
diff --git a/crates/servicepoint_binding_cs/ServicePoint/BindGen/PacketNative.g.cs b/crates/servicepoint_binding_cs/ServicePoint/BindGen/PacketNative.g.cs
index 6e639e8..e805c6a 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/BindGen/PacketNative.g.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/BindGen/PacketNative.g.cs
@@ -36,7 +36,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_packet_free`.
///
[DllImport(__DllName, EntryPoint = "sp_packet_from_command", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPPacket* sp_packet_from_command(SPCommand* command);
+ public static extern Packet* sp_packet_from_command(Command* command);
///
/// Tries to load a [SPPacket] from the passed array with the specified length.
@@ -57,7 +57,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_packet_free`.
///
[DllImport(__DllName, EntryPoint = "sp_packet_try_load", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPPacket* sp_packet_try_load(byte* data, nuint length);
+ public static extern Packet* sp_packet_try_load(byte* data, nuint length);
///
/// Clones a [SPPacket].
@@ -78,7 +78,7 @@ namespace ServicePoint.BindGen
/// by explicitly calling `sp_packet_free`.
///
[DllImport(__DllName, EntryPoint = "sp_packet_clone", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern SPPacket* sp_packet_clone(SPPacket* packet);
+ public static extern Packet* sp_packet_clone(Packet* packet);
///
/// Deallocates a [SPPacket].
@@ -95,13 +95,13 @@ namespace ServicePoint.BindGen
/// - `packet` is not used concurrently or after this call
///
[DllImport(__DllName, EntryPoint = "sp_packet_free", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true)]
- public static extern void sp_packet_free(SPPacket* packet);
+ public static extern void sp_packet_free(Packet* packet);
}
[StructLayout(LayoutKind.Sequential)]
- public unsafe partial struct SPPacket
+ public unsafe partial struct Packet
{
}
diff --git a/crates/servicepoint_binding_cs/ServicePoint/BitVec.cs b/crates/servicepoint_binding_cs/ServicePoint/BitVec.cs
index 48d7ab4..c086f75 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/BitVec.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/BitVec.cs
@@ -2,7 +2,7 @@ using ServicePoint.BindGen;
namespace ServicePoint;
-public sealed class BitVec : SpNativeInstance
+public sealed class BitVec : SpNativeInstance
{
public static BitVec New(nuint size)
{
@@ -27,7 +27,7 @@ public sealed class BitVec : SpNativeInstance
{
unsafe
{
- return new BitVec(BitVecNative.sp_bitvec_clone(Instance));
+ return new BitVec(Instance->Clone());
}
}
@@ -37,14 +37,14 @@ public sealed class BitVec : SpNativeInstance
{
unsafe
{
- return BitVecNative.sp_bitvec_get(Instance, index);
+ return Instance->Get(index);
}
}
set
{
unsafe
{
- BitVecNative.sp_bitvec_set(Instance, index, value);
+ Instance->Set(index, value);
}
}
}
@@ -53,7 +53,7 @@ public sealed class BitVec : SpNativeInstance
{
unsafe
{
- BitVecNative.sp_bitvec_fill(Instance, value);
+ Instance->Fill(value);
}
}
@@ -63,7 +63,7 @@ public sealed class BitVec : SpNativeInstance
{
unsafe
{
- return BitVecNative.sp_bitvec_len(Instance);
+ return Instance->Len();
}
}
}
@@ -74,15 +74,14 @@ public sealed class BitVec : SpNativeInstance
{
unsafe
{
- var slice = BitVecNative.sp_bitvec_unsafe_data_ref(Instance);
- return new Span(slice.start, (int)slice.length);
+ return Instance->UnsafeDataRef().AsSpan();
}
}
}
- private unsafe BitVec(SPBitVec* instance) : base(instance)
+ private unsafe BitVec(BindGen.BitVec* instance) : base(instance)
{
}
- private protected override unsafe void Free() => BitVecNative.sp_bitvec_free(Instance);
+ private protected override unsafe void Free() => Instance->Free();
}
diff --git a/crates/servicepoint_binding_cs/ServicePoint/Bitmap.cs b/crates/servicepoint_binding_cs/ServicePoint/Bitmap.cs
index f81b542..1f39689 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/Bitmap.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/Bitmap.cs
@@ -2,7 +2,7 @@ using ServicePoint.BindGen;
namespace ServicePoint;
-public sealed class Bitmap : SpNativeInstance
+public sealed class Bitmap : SpNativeInstance
{
public static Bitmap New(nuint width, nuint height)
{
@@ -28,7 +28,7 @@ public sealed class Bitmap : SpNativeInstance
{
unsafe
{
- return new Bitmap(BitmapNative.sp_bitmap_clone(Instance));
+ return new Bitmap(Instance->Clone());
}
}
@@ -38,14 +38,14 @@ public sealed class Bitmap : SpNativeInstance
{
unsafe
{
- return BitmapNative.sp_bitmap_get(Instance, x, y);
+ return Instance->Get(x, y);
}
}
set
{
unsafe
{
- BitmapNative.sp_bitmap_set(Instance, x, y, value);
+ Instance->Set(x, y, value);
}
}
}
@@ -54,7 +54,7 @@ public sealed class Bitmap : SpNativeInstance
{
unsafe
{
- BitmapNative.sp_bitmap_fill(Instance, value);
+ Instance->Fill(value);
}
}
@@ -64,7 +64,7 @@ public sealed class Bitmap : SpNativeInstance
{
unsafe
{
- return BitmapNative.sp_bitmap_width(Instance);
+ return Instance->Width();
}
}
}
@@ -75,7 +75,7 @@ public sealed class Bitmap : SpNativeInstance
{
unsafe
{
- return BitmapNative.sp_bitmap_height(Instance);
+ return Instance->Height();
}
}
}
@@ -86,15 +86,15 @@ public sealed class Bitmap : SpNativeInstance
{
unsafe
{
- var slice = BitmapNative.sp_bitmap_unsafe_data_ref(Instance);
+ var slice = Instance->UnsafeDataRef();
return new Span(slice.start, (int)slice.length);
}
}
}
- private unsafe Bitmap(SPBitmap* instance) : base(instance)
+ private unsafe Bitmap(BindGen.Bitmap* instance) : base(instance)
{
}
- private protected override unsafe void Free() => BitmapNative.sp_bitmap_free(Instance);
+ private protected override unsafe void Free() => Instance->Free();
}
diff --git a/crates/servicepoint_binding_cs/ServicePoint/BrightnessGrid.cs b/crates/servicepoint_binding_cs/ServicePoint/BrightnessGrid.cs
index e1931c7..efe3c0f 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/BrightnessGrid.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/BrightnessGrid.cs
@@ -2,7 +2,7 @@ using ServicePoint.BindGen;
namespace ServicePoint;
-public sealed class BrightnessGrid : SpNativeInstance
+public sealed class BrightnessGrid : SpNativeInstance
{
public static BrightnessGrid New(nuint width, nuint height)
{
@@ -28,7 +28,7 @@ public sealed class BrightnessGrid : SpNativeInstance
{
unsafe
{
- return new BrightnessGrid(BrightnessGridNative.sp_brightness_grid_clone(Instance));
+ return new BrightnessGrid(Instance->Clone());
}
}
@@ -38,14 +38,14 @@ public sealed class BrightnessGrid : SpNativeInstance
{
unsafe
{
- return BrightnessGridNative.sp_brightness_grid_get(Instance, x, y);
+ return Instance->Get(x, y);
}
}
set
{
unsafe
{
- BrightnessGridNative.sp_brightness_grid_set(Instance, x, y, value);
+ Instance->Set(x, y, value);
}
}
}
@@ -54,7 +54,7 @@ public sealed class BrightnessGrid : SpNativeInstance
{
unsafe
{
- BrightnessGridNative.sp_brightness_grid_fill(Instance, value);
+ Instance->Fill(value);
}
}
@@ -64,7 +64,7 @@ public sealed class BrightnessGrid : SpNativeInstance
{
unsafe
{
- return BrightnessGridNative.sp_brightness_grid_width(Instance);
+ return Instance->Width();
}
}
}
@@ -75,7 +75,7 @@ public sealed class BrightnessGrid : SpNativeInstance
{
unsafe
{
- return BrightnessGridNative.sp_brightness_grid_height(Instance);
+ return Instance->Height();
}
}
}
@@ -86,15 +86,14 @@ public sealed class BrightnessGrid : SpNativeInstance
{
unsafe
{
- var slice = BrightnessGridNative.sp_brightness_grid_unsafe_data_ref(Instance);
- return new Span(slice.start, (int)slice.length);
+ return Instance->UnsafeDataRef().AsSpan();
}
}
}
- private unsafe BrightnessGrid(SPBrightnessGrid* instance) : base(instance)
+ private unsafe BrightnessGrid(BindGen.BrightnessGrid* instance) : base(instance)
{
}
- private protected override unsafe void Free() => BrightnessGridNative.sp_brightness_grid_free(Instance);
+ private protected override unsafe void Free() => Instance->Free();
}
diff --git a/crates/servicepoint_binding_cs/ServicePoint/Command.cs b/crates/servicepoint_binding_cs/ServicePoint/Command.cs
index dd4ccc1..53ac982 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/Command.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/Command.cs
@@ -3,7 +3,7 @@ using ServicePoint.BindGen;
namespace ServicePoint;
-public sealed class Command : SpNativeInstance
+public sealed class Command : SpNativeInstance
{
public static bool TryFromPacket(Packet packet, [MaybeNullWhen(false)] out Command command)
{
@@ -25,7 +25,7 @@ public sealed class Command : SpNativeInstance
{
unsafe
{
- return new Command(CommandNative.sp_command_clone(Instance));
+ return new Command(Instance->Clone());
}
}
@@ -121,9 +121,9 @@ public sealed class Command : SpNativeInstance
}
}
- private unsafe Command(SPCommand* instance) : base(instance)
+ private unsafe Command(BindGen.Command* instance) : base(instance)
{
}
- private protected override unsafe void Free() => CommandNative.sp_command_free(Instance);
+ private protected override unsafe void Free() => Instance->Free();
}
diff --git a/crates/servicepoint_binding_cs/ServicePoint/Connection.cs b/crates/servicepoint_binding_cs/ServicePoint/Connection.cs
index 2eb4c60..120ae6f 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/Connection.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/Connection.cs
@@ -3,7 +3,7 @@ using ServicePoint.BindGen;
namespace ServicePoint;
-public sealed class Connection : SpNativeInstance
+public sealed class Connection : SpNativeInstance
{
public static Connection Open(string host)
{
@@ -20,7 +20,7 @@ public sealed class Connection : SpNativeInstance
{
unsafe
{
- return ConnectionNative.sp_connection_send_packet(Instance, packet.Into());
+ return Instance->SendPacket(packet.Into());
}
}
@@ -28,13 +28,13 @@ public sealed class Connection : SpNativeInstance
{
unsafe
{
- return ConnectionNative.sp_connection_send_command(Instance, command.Into());
+ return Instance->SendCommand(command.Into());
}
}
- private protected override unsafe void Free() => ConnectionNative.sp_connection_free(Instance);
+ private protected override unsafe void Free() => Instance->Free();
- private unsafe Connection(SPConnection* instance) : base(instance)
+ private unsafe Connection(BindGen.Connection* instance) : base(instance)
{
}
}
diff --git a/crates/servicepoint_binding_cs/ServicePoint/Cp437Grid.cs b/crates/servicepoint_binding_cs/ServicePoint/Cp437Grid.cs
index 4193c03..6b45147 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/Cp437Grid.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/Cp437Grid.cs
@@ -3,23 +3,23 @@ using ServicePoint.BindGen;
namespace ServicePoint;
-public sealed class Cp437Grid : SpNativeInstance
+public sealed class Cp437Grid : SpNativeInstance
{
- public static Cp437Grid New(int width, int height)
+ public static Cp437Grid New(nuint width, nuint height)
{
unsafe
{
- return new Cp437Grid(Cp437GridNative.sp_cp437_grid_new((nuint)width, (nuint)height));
+ return new Cp437Grid(Cp437GridNative.sp_cp437_grid_new(width, height));
}
}
- public static Cp437Grid Load(int width, int height, Span bytes)
+ public static Cp437Grid Load(nuint width, nuint height, Span bytes)
{
unsafe
{
fixed (byte* bytesPtr = bytes)
{
- return new Cp437Grid(Cp437GridNative.sp_cp437_grid_load((nuint)width, (nuint)height, bytesPtr,
+ return new Cp437Grid(Cp437GridNative.sp_cp437_grid_load(width, height, bytesPtr,
(nuint)bytes.Length));
}
}
@@ -29,38 +29,38 @@ public sealed class Cp437Grid : SpNativeInstance
{
unsafe
{
- return new Cp437Grid(Cp437GridNative.sp_cp437_grid_clone(Instance));
+ return new Cp437Grid(Instance->Clone());
}
}
- public byte this[int x, int y]
+ public byte this[nuint x, nuint y]
{
get
{
unsafe
{
- return Cp437GridNative.sp_cp437_grid_get(Instance, (nuint)x, (nuint)y);
+ return Instance->Get(x, y);
}
}
set
{
unsafe
{
- Cp437GridNative.sp_cp437_grid_set(Instance, (nuint)x, (nuint)y, value);
+ Instance->Set(x, y, value);
}
}
}
- public string this[int y]
+ public string this[nuint y]
{
set
{
var width = Width;
- ArgumentOutOfRangeException.ThrowIfGreaterThan(value.Length, width);
+ ArgumentOutOfRangeException.ThrowIfGreaterThan((nuint)value.Length, width);
- var x = 0;
- for (; x < value.Length; x++)
- this[x, y] = (byte)value[x];
+ nuint x = 0;
+ for (; x < (nuint)value.Length; x++)
+ this[x, y] = (byte)value[(int)x];
for (; x < width; x++)
this[x, y] = 0;
@@ -69,7 +69,7 @@ public sealed class Cp437Grid : SpNativeInstance
get
{
var sb = new StringBuilder();
- for (int x = 0; x < Width; x++)
+ for (nuint x = 0; x < Width; x++)
{
var val = this[x, y];
if (val == 0)
@@ -85,28 +85,28 @@ public sealed class Cp437Grid : SpNativeInstance
{
unsafe
{
- Cp437GridNative.sp_cp437_grid_fill(Instance, value);
+ Instance->Fill(value);
}
}
- public int Width
+ public nuint Width
{
get
{
unsafe
{
- return (int)Cp437GridNative.sp_cp437_grid_width(Instance);
+ return Instance->Width();
}
}
}
- public int Height
+ public nuint Height
{
get
{
unsafe
{
- return (int)Cp437GridNative.sp_cp437_grid_height(Instance);
+ return Instance->Height();
}
}
}
@@ -117,15 +117,14 @@ public sealed class Cp437Grid : SpNativeInstance
{
unsafe
{
- var slice = Cp437GridNative.sp_cp437_grid_unsafe_data_ref(Instance);
- return new Span(slice.start, (int)slice.length);
+ return Instance->UnsafeDataRef().AsSpan();
}
}
}
- private unsafe Cp437Grid(SPCp437Grid* instance) : base(instance)
+ private unsafe Cp437Grid(BindGen.Cp437Grid* instance) : base(instance)
{
}
- private protected override unsafe void Free() => Cp437GridNative.sp_cp437_grid_free(Instance);
+ private protected override unsafe void Free() => Instance->Free();
}
diff --git a/crates/servicepoint_binding_cs/ServicePoint/GlobalUsings.cs b/crates/servicepoint_binding_cs/ServicePoint/GlobalUsings.cs
index 3c8a504..871318d 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/GlobalUsings.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/GlobalUsings.cs
@@ -1,2 +1 @@
global using System;
-global using CompressionCode = ServicePoint.BindGen.SPCompressionCode;
diff --git a/crates/servicepoint_binding_cs/ServicePoint/Packet.cs b/crates/servicepoint_binding_cs/ServicePoint/Packet.cs
index 55569b8..1eb0a41 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/Packet.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/Packet.cs
@@ -3,7 +3,7 @@ using ServicePoint.BindGen;
namespace ServicePoint;
-public sealed class Packet : SpNativeInstance
+public sealed class Packet : SpNativeInstance
{
public static Packet FromCommand(Command command)
{
@@ -28,9 +28,9 @@ public sealed class Packet : SpNativeInstance
}
}
- private unsafe Packet(SPPacket* instance) : base(instance)
+ private unsafe Packet(BindGen.Packet* instance) : base(instance)
{
}
- private protected override unsafe void Free() => PacketNative.sp_packet_free(Instance);
+ private protected override unsafe void Free() => Instance->Free();
}
diff --git a/crates/servicepoint_binding_cs/ServicePoint/ServicePoint.csproj b/crates/servicepoint_binding_cs/ServicePoint/ServicePoint.csproj
index e051607..1e5fecd 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/ServicePoint.csproj
+++ b/crates/servicepoint_binding_cs/ServicePoint/ServicePoint.csproj
@@ -9,6 +9,11 @@
true
+
+ true
+
+
+
ServicePoint
0.10.0
@@ -47,6 +52,11 @@
+
+
+
+
+
diff --git a/crates/servicepoint_binding_cs/ServicePoint/ServicePointExtensions.cs b/crates/servicepoint_binding_cs/ServicePoint/ServicePointExtensions.cs
index 0e569ff..07ce28a 100644
--- a/crates/servicepoint_binding_cs/ServicePoint/ServicePointExtensions.cs
+++ b/crates/servicepoint_binding_cs/ServicePoint/ServicePointExtensions.cs
@@ -1,4 +1,5 @@
using System.Diagnostics.CodeAnalysis;
+using ServicePoint.BindGen;
namespace ServicePoint;
@@ -13,4 +14,9 @@ public static class ServicePointExtensions
{
return Command.TryFromPacket(packet, out command);
}
+
+ public unsafe static Span AsSpan(this ByteSlice slice)
+ {
+ return new Span(slice.start, (int)slice.length);
+ }
}
diff --git a/crates/servicepoint_binding_cs/build.rs b/crates/servicepoint_binding_cs/build.rs
index 4ea4337..bd49a78 100644
--- a/crates/servicepoint_binding_cs/build.rs
+++ b/crates/servicepoint_binding_cs/build.rs
@@ -16,8 +16,12 @@ fn main() {
for path in &paths {
println!("cargo:rerun-if-changed={}", path.display());
- let class = Path::new(path).file_stem().unwrap().to_str().unwrap();
- let class = class.to_case(Case::UpperCamel) + "Native";
+ let file: &str = Path::new(path).file_stem().unwrap().to_str().unwrap();
+ if file == "lib"{
+ continue;
+ }
+
+ let class = file.to_case(Case::UpperCamel) + "Native";
csbindgen::Builder::default()
.input_extern_file(path)
.csharp_class_name(&class)
@@ -27,6 +31,16 @@ fn main() {
.csharp_class_accessibility("public")
.csharp_generate_const_filter(|_| true)
.always_included_types(["SPByteSlice", "SPCompressionCode"])
+ .csharp_type_rename(move |name| {
+ if name.len() > 2
+ && name.starts_with("SP")
+ && name.chars().nth(2).unwrap().is_uppercase()
+ {
+ name[2..].to_string()
+ } else {
+ name
+ }
+ })
.generate_csharp_file(format!("ServicePoint/BindGen/{}.g.cs", &class))
.unwrap();
}
diff --git a/crates/servicepoint_binding_cs/examples/lang_cs/Program.cs b/crates/servicepoint_binding_cs/examples/lang_cs/Program.cs
index cdccc93..a1ff7fe 100644
--- a/crates/servicepoint_binding_cs/examples/lang_cs/Program.cs
+++ b/crates/servicepoint_binding_cs/examples/lang_cs/Program.cs
@@ -1,6 +1,5 @@
using ServicePoint;
-
-using CompressionCode = ServicePoint.BindGen.SPCompressionCode;
+using CompressionCode = ServicePoint.BindGen.CompressionCode;
using var connection = Connection.Open("127.0.0.1:2342");