DeafMan1983.Conversion
2.0.0
See the version list below for details.
dotnet add package DeafMan1983.Conversion --version 2.0.0
NuGet\Install-Package DeafMan1983.Conversion -Version 2.0.0
<PackageReference Include="DeafMan1983.Conversion" Version="2.0.0" />
paket add DeafMan1983.Conversion --version 2.0.0
#r "nuget: DeafMan1983.Conversion, 2.0.0"
// Install DeafMan1983.Conversion as a Cake Addin #addin nuget:?package=DeafMan1983.Conversion&version=2.0.0 // Install DeafMan1983.Conversion as a Cake Tool #tool nuget:?package=DeafMan1983.Conversion&version=2.0.0
ConversionFunctions
New 2.0.0 ConversionFunction
Changes & fixes:
- Replaced: StringFromCharPtr to SBytePointerWithStringForAdvanced StringFromHeap to SBytePointerWithString CharPtrToString to StringwithSBytePointer
- Added: new functions for sbyte ** and string[] SByteDoublePointersWithStringArray ( Fixed and add NativeMemory, Thanks Jan Kotas!!! ) StringArrayWithSByteDoublePointers
- Updated to 2.0.0
How does it work?
If you use sbyte*
for string
like example in X11's XOpenDisplay()
or SDL_SetWindowTitle()
For X11 from TerraFX.Interop.Xlib
....
Display *display = XOpenDisplay(SBytePointerWithString(string.Empty));
....
Or for SDL3 from DeafMan1983.Interop.SDL3
....
SDL_SetWindowTitle(window, SBytePointerWithString("Hello SDL3 Window"));
....
For string
for sbyte *
like example X11's XDisplayString()
or SDL3's SDL_GetWindowTitle()
....
string d_str = StringWithSBytePointer(XDisplayString(display));
....
or SDL3
....
string title_str = StringWithSBytePointer(SDL_GetWindowTitle(window));
....
And new more functions:
For string[]
for sbyte **
like you use delegate *unmanaged[Cdecl]<sbyte **, int, void>
or delegate *unmanaged[Cdecl]<sbyte **, int, int>
and It works for Game, Application they can load external native library but I have tested with Console.WriteLine()
It is successfully. But I never did other like Winfows.Forms or Xlib, SDL3 I will see how does it work for external native libraries.
....
string[] args = StringArrayWithSByteDoublePointers(sArrays, array_length);
....
Warning It is important for [UnmanagedCallerOnly]
and it uses sbyte **
and int
for array_length
If you pass string[] args
from Program.cs then you need add SByteDoublePointersWithStringArray
Example:
sbyte **sArrays = SByteDoublePointersWithStringArray(args);
pfnMainFunc(sArrays, args.length);
....
And I have updated already in Nuget.org
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.