Skip to content

Commit 0db2813

Browse files
committed
Add project files.
1 parent bfb7d8b commit 0db2813

File tree

21 files changed

+10150
-0
lines changed

21 files changed

+10150
-0
lines changed

Generator/Generator.csproj

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net9.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="HexaGen" Version="1.1.15-rc30" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<None Update="generator.json">
16+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
17+
</None>
18+
<None Update="include\zconf.h">
19+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
20+
</None>
21+
<None Update="include\zlib.h">
22+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
23+
</None>
24+
</ItemGroup>
25+
26+
</Project>

Generator/Program.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// See https://aka.ms/new-console-template for more information
2+
using HexaGen;
3+
using HexaGen.Patching;
4+
5+
List<string> headers = ["include/zconf.h", "include/zlib.h"];
6+
7+
BatchGenerator batch = new();
8+
batch
9+
.Setup<CsCodeGenerator>("generator.json")
10+
.AddPrePatch(new NamingPatch(["Gz", "Zlib"], NamingPatchOptions.None))
11+
.Generate(headers, "../../../../Hexa.NET.ZLib/Generated");

Generator/generator.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"Namespace": "Hexa.NET.ZLib",
3+
"ApiName": "ZLib",
4+
"LibName": "ZLib",
5+
"Usings": [ "System.Numerics" ],
6+
"ImportType": "FunctionTable",
7+
"EnableExperimentalOptions": true,
8+
"GenerateConstructorsForStructs": true,
9+
"GenerateSizeOfStructs": false,
10+
"GenerateDelegates": true,
11+
"GenerateMetadata": false,
12+
"GenerateExtensions": true,
13+
"DelegatesAsVoidPointer": true,
14+
"BoolType": 0,
15+
"IgnoredConstants": [ "PNG_HEADER_VERSION_STRING" ],
16+
"IgnoredFunctions": [ "gzvprintf" ],
17+
"IgnoredTypedefs": [
18+
"gz_headerp",
19+
"gzFilep",
20+
21+
"voidp",
22+
"voidpc",
23+
"voidpf",
24+
25+
"z_streamp"
26+
],
27+
"TypeMappings": {
28+
"va_list": "nuint",
29+
"time_t": "long",
30+
"FILE": "FILE",
31+
"png_FILE_p": "FILE*",
32+
33+
"gz_header_s": "GZHeader",
34+
"gz_headerp": "GZHeader*",
35+
"gzFile_s": "GZFile",
36+
"gzFilep": "GZFile*",
37+
38+
"voidp": "void*",
39+
"voidpc": "void*",
40+
"voidpf": "void*",
41+
42+
"z_stream_s": "ZStream",
43+
"z_streamp": "ZStream*",
44+
"z_size_t": "nint",
45+
"uLongf": "uint",
46+
47+
"Bytef": "byte"
48+
}
49+
}

0 commit comments

Comments
 (0)