Ophestra Umiker
c2b178e626
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>
23 lines
418 B
Go
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)
|
|
}
|