fortify/xcb/export.go
Ophestra Umiker c2b178e626
All checks were successful
Tests / Go tests (push) Successful in 45s
Nix / NixOS tests (push) Successful in 5m2s
xcb: refactor and clean up
No clean way to write Go tests for this package. Will rely on NixOS tests for now.

Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-12-17 12:46:36 +09:00

23 lines
418 B
Go

// Package xcb implements X11 ChangeHosts via libxcb.
package xcb
import (
"errors"
)
var ErrChangeHosts = errors.New("xcb_change_hosts() failed")
func ChangeHosts(mode HostMode, family Family, address string) error {
var conn *connection
if c, err := connect(); err != nil {
c.disconnect()
return err
} else {
defer c.disconnect()
conn = c
}
return conn.changeHostsChecked(mode, family, address)
}