v0.2.0 4c97002

README.md RawHistoryFolder

pipewiregen

The pipewiregen tool generates Go bindings for PipeWire and SPA libraries from JSON model files.

Usage

Generate bindings from checked-in models

go run ./cmd/pipewiregen

This currently reads gen/pipewire.json and emits:

  • internal/capi/*_gen.go — raw function types and registration helpers
  • internal/ports/out/*_gen.go — outbound port interfaces

Sync headers from system includes (maintainers)

This workflow is planned but not implemented yet in cmd/pipewiregen. The helper script exists as a placeholder so the intended maintainer flow is documented.

./scripts/sync-headers.sh

Planned direct invocation:

go run ./cmd/pipewiregen --sync-headers \
    --pipewire-include /usr/include/pipewire-0.3 \
    --spa-include /usr/include/spa-0.2 \
    --out-dir gen

Model format

The JSON model files follow this structure:

{
  "libraries": [
    {"name": "pipewire", "soname": "libpipewire-0.3.so.0"}
  ],
  "groups": [
    {"name": "init", "interface": "InitAPI", "package": "out", "symbols": ["pw_init", "pw_deinit"]}
  ],
  "symbols": [
    {"name": "pw_init", "library": "pipewire", "group": "init", "signature": "func(argc *int32, argv ***byte)"}
  ]
}
  • libraries: Shared libraries to load
  • groups: Symbol groupings that become Go interfaces
  • symbols: Individual function symbols with their Go signatures

Architecture

The generator follows a pipeline design:

  1. parser: Loads and validates JSON model files
  2. model: Core data structures for libraries, groups, and symbols
  3. normalize: PipeWire-specific naming conventions
  4. emitter: Renders Go code from templates

See the individual package directories for implementation details.

source
1# pipewiregen
2
3The `pipewiregen` tool generates Go bindings for PipeWire and SPA libraries from JSON model files.
4
5## Usage
6
7### Generate bindings from checked-in models
8
9    go run ./cmd/pipewiregen
10
11This currently reads `gen/pipewire.json` and emits:
12- `internal/capi/*_gen.go` — raw function types and registration helpers
13- `internal/ports/out/*_gen.go` — outbound port interfaces
14
15### Sync headers from system includes (maintainers)
16
17This workflow is planned but not implemented yet in `cmd/pipewiregen`.
18The helper script exists as a placeholder so the intended maintainer flow is documented.
19
20    ./scripts/sync-headers.sh
21
22Planned direct invocation:
23
24    go run ./cmd/pipewiregen --sync-headers \
25        --pipewire-include /usr/include/pipewire-0.3 \
26        --spa-include /usr/include/spa-0.2 \
27        --out-dir gen
28
29## Model format
30
31The JSON model files follow this structure:
32
33```json
34{
35  "libraries": [
36    {"name": "pipewire", "soname": "libpipewire-0.3.so.0"}
37  ],
38  "groups": [
39    {"name": "init", "interface": "InitAPI", "package": "out", "symbols": ["pw_init", "pw_deinit"]}
40  ],
41  "symbols": [
42    {"name": "pw_init", "library": "pipewire", "group": "init", "signature": "func(argc *int32, argv ***byte)"}
43  ]
44}
45```
46
47- `libraries`: Shared libraries to load
48- `groups`: Symbol groupings that become Go interfaces
49- `symbols`: Individual function symbols with their Go signatures
50
51## Architecture
52
53The generator follows a pipeline design:
54
551. **parser**: Loads and validates JSON model files
562. **model**: Core data structures for libraries, groups, and symbols
573. **normalize**: PipeWire-specific naming conventions
584. **emitter**: Renders Go code from templates
59
60See the individual package directories for implementation details.

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 8

↑↓ moveenter openesc close