Skip to content

Commit

Permalink
Next iteration for flibitBounties 2024/4/29 (#162)
Browse files Browse the repository at this point in the history
* Remove branding/namespace of bottlenoselabs for bindgen runtime

* Use C# raw strings introduced in C# 11

* Rename `options` -> `input`
  • Loading branch information
lithiumtoast authored Apr 30, 2024
1 parent 5a9a557 commit 8bf03b3
Show file tree
Hide file tree
Showing 15 changed files with 174 additions and 129 deletions.
2 changes: 1 addition & 1 deletion src/cs/C2CS.sln
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "helloworld-compile-c-librar
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "C2CS.Tool", "production\C2CS.Tool\C2CS.Tool.csproj", "{1B67F4A2-24E6-43A6-A031-918DD44CD991}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "C2CS.Runtime", "production\C2CS.Runtime\C2CS.Runtime.csproj", "{DB492E65-25D9-44A0-86F4-ABB07283BEE7}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bindgen.Runtime", "production\Bindgen.Runtime\Bindgen.Runtime.csproj", "{DB492E65-25D9-44A0-86F4-ABB07283BEE7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "helloworld-app", "examples\helloworld\helloworld-app\helloworld-app.csproj", "{EA3E3362-32A5-4395-BF56-39BDBE2B7CC9}"
EndProject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RootNamespace>bottlenoselabs.C2CS.Runtime</RootNamespace>
<RootNamespace>Bindgen.Runtime</RootNamespace>
<AssemblyName>Bindgen.Runtime</AssemblyName>
</PropertyGroup>

<!-- NuGet -->
<PropertyGroup>
<IsPackable>true</IsPackable>
<PackageOutputPath>$(GitRepositoryPath)/nupkg</PackageOutputPath>
<RepositoryUrl>https://github.com/bottlenoselabs/c2cs</RepositoryUrl>
<PackageId>bottlenoselabs.C2CS.Runtime</PackageId>
<PackageDescription>C# glue for bindings generated by C2CS.</PackageDescription>
<ToolCommandName>c2cs</ToolCommandName>
<PackageId>bottlenoselabs.Bindgen.Runtime</PackageId>
<PackageDescription>C# runtime glue for bindings generated by C2CS.</PackageDescription>
<NoWarn>$(NoWarn);NU5104</NoWarn>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.Runtime.InteropServices;

namespace bottlenoselabs.C2CS.Runtime;
namespace Bindgen.Runtime;

/// <summary>
/// A boolean value type with the same memory layout as a <see cref="byte" /> in both managed and unmanaged contexts;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Globalization;
using System.Runtime.InteropServices;

namespace bottlenoselabs.C2CS.Runtime;
namespace Bindgen.Runtime;

/// <summary>
/// A value type with the same memory layout as a <see cref="byte" /> in a managed context and <c>char</c> in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.Runtime.InteropServices;

namespace bottlenoselabs.C2CS.Runtime;
namespace Bindgen.Runtime;

/// <summary>
/// A pointer value type of bytes that represent a string; the C type `char*`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.Runtime.InteropServices;

namespace bottlenoselabs.C2CS.Runtime;
namespace Bindgen.Runtime;

/// <summary>
/// A pointer value type that represents a wide string; C type `wchar_t*`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System;
using System.Runtime.InteropServices;

namespace bottlenoselabs.C2CS.Runtime;
namespace Bindgen.Runtime;

/// <summary>
/// Utility methods for interoperability with C style strings in C#.
Expand Down Expand Up @@ -36,7 +36,7 @@ public static unsafe class CStrings

/// <summary>
/// Converts an array of strings to an array of C strings of type `wchar_t` (multi-dimensional array of one
/// dimensional ushort arrays each terminated by a <c>0x0</c>) by allocating and copying if not already cached.
/// dimensional ushort arrays each terminated by a <c>0x0</c>) by allocating and copying.
/// </summary>
/// <remarks>
/// <para>Calls <see cref="CString" />.</para>
Expand Down
6 changes: 3 additions & 3 deletions src/cs/production/C2CS.Tool/C2CS.Tool.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@

<!-- Project references -->
<ItemGroup>
<ProjectReference Include="..\C2CS.Runtime\C2CS.Runtime.csproj" />
<ProjectReference Include="..\Bindgen.Runtime\Bindgen.Runtime.csproj" />
</ItemGroup>

<!-- Configuration settings -->
<ItemGroup>
<EmbeddedResource Include="appsettings.json" />
</ItemGroup>

<!-- C2CS.Runtime -->
<!-- Bindgen.Runtime -->
<ItemGroup>
<EmbeddedResource Include="..\C2CS.Runtime\**\*.cs">
<EmbeddedResource Include="..\Bindgen.Runtime\**\*.cs">
<Visible>false</Visible>
</EmbeddedResource>
</ItemGroup>
Expand Down
Loading

0 comments on commit 8bf03b3

Please sign in to comment.