marlersoft / zigwin32gen

Generates Complete Zig bindings for Win32. See https://github.com/marlersoft/zigwin32 for the bindings themselves.
108 stars 17 forks source link

Filtering Mechanism #37

Open marler8997 opened 3 months ago

marler8997 commented 3 months ago

For use cases like Mach (and maybe std, maybe Bun) it may make sense to add a filtering mechanism to generate subsets of the very substantial API. The bindings are around 72 MB of zig code (more than the zig compiler itself) but many projects only need a very small slice of this (Mach only uses about 172K of Zig bindings). It should be pretty easy to add a filtering mechansim, maybe give a list of DLLS or functions (or both) and only generate those functions, the types for the parameters they use, and the constants whose types are included in those parameter types. This may not cover all constant/types, so maybe allow specifying those.

So the filter is, DLLS, Functions, Types, Constants (where each level will automatically pull in what it needs from the additional level).