bindgen-binding

Generate Go bindings from C headers with DLL unit tests.

85|13|Updated Jul 14, 2022
One-click install
npx skills add https://github.com/HyperDbg/gui --skill bindgen-binding
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bindgen-binding
Source: https://github.com/HyperDbg/gui/tree/main/.trae/skills/bindgen-binding
Command: npx skills add https://github.com/HyperDbg/gui --skill bindgen-binding

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generates Go bindings from C headers and creates DLL bindings with unit tests to streamline binding native libraries for Go projects.

Core Features & Use Cases

  • End-to-end bindgen workflow: configure header sources, output directory, package name, and optional DLL bindings, then generate Go bindings and unit tests.
  • Supports binding of popular libraries (e.g., WinDivert, Everything-SDK, zydis, keystone) and regenerating bindings with TestGenerate when sources change.
  • Provides guidance for MSVC-based environments, header order, and test scaffolding to ensure ABI compatibility and correct type mappings.

Quick Start

Run the bindgen workflow to generate and validate Go bindings for a new C library by editing dep/bindgen/generate_test.go and running the test pipeline to regenerate code and execute tests.

Frequently Asked Questions about bindgen-binding

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Go bindings from C headers for a native library?

The bindgen workflow handles header ordering, predefined macros, and MSVC environment setup to ensure correct ABI compatibility and type mappings when generating Go bindings from C headers.

What is the best way to create DLL bindings with unit tests in Go?

Yes, bindgen supports generating bindings for popular libraries like WinDivert, Everything-SDK, zydis, and keystone by configuring the specific C header sources and running the generation pipeline.

How do I regenerate Go bindings and tests when C library sources change?

Yes, bindgen provides specific guidance for MSVC-based environments, covering header order and predefined macros to ensure accurate type mapping and ABI compatibility during the binding generation process.

Do I need MSVC to generate Go bindings from C headers?

Edit the generate_test.go file to specify your header sources, output directory, and package name, then execute the test pipeline to generate the Go bindings and run validation tests.