1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
package ge
import "github.com/linuxdeepin/go-x11-client"
// #WREQ
func encodeQueryVersion(majorVersion, minorVersion uint16) (b x.RequestBody) {
b.AddBlock(1).
Write2b(majorVersion).
Write2b(minorVersion).
End()
return
}
type QueryVersionReply struct {
MajorVersion uint16
MinorVersion uint16
}
func readQueryVersionReply(r *x.Reader, v *QueryVersionReply) error {
if !r.RemainAtLeast4b(3) {
return x.ErrDataLenShort
}
r.ReadPad(8)
v.MajorVersion = r.Read2b()
v.MinorVersion = r.Read2b() // 3
return nil
}
|