From ddb003e39b64c2417cabc291383d99b4ad64ac8f Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 30 Aug 2025 20:02:18 +0900 Subject: system/internal/xcb: refactor and clean up This package still does not deserve to be out of internal, but at least it is less haunting now. I am still not handling the xcb error though, the struct is almost entirely undocumented and the implementation is unreadable. Not even going to try. Signed-off-by: Ophestra --- system/internal/xcb/changehosts.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 system/internal/xcb/changehosts.go (limited to 'system/internal/xcb/changehosts.go') diff --git a/system/internal/xcb/changehosts.go b/system/internal/xcb/changehosts.go new file mode 100644 index 00000000..8b05614b --- /dev/null +++ b/system/internal/xcb/changehosts.go @@ -0,0 +1,17 @@ +package xcb + +import "errors" + +var ErrChangeHosts = errors.New("xcb_change_hosts() failed") + +func ChangeHosts(mode HostMode, family Family, address string) error { + conn := new(connection) + if err := conn.connect(); err != nil { + conn.disconnect() + return err + } else { + defer conn.disconnect() + } + + return conn.changeHostsChecked(mode, family, address) +} -- cgit v1.3.1