aboutsummaryrefslogtreecommitdiff
path: root/nexgb/xgbgen/request_reply.go
diff options
context:
space:
mode:
authorAndrew Gallant <jamslam@gmail.com>2013-08-11 20:42:36 -0400
committerPřemysl Janouch <p@janouch.name>2018-09-08 16:49:17 +0200
commit4b20ffaf4f4cc756832a6d064d5dfe182f16b0e9 (patch)
tree9a82c9bbd56ffdf5892070ba477692ae168ebd8e /nexgb/xgbgen/request_reply.go
parent5d96993ee16d821b9448f4532328cb7caad223c9 (diff)
downloadhaven-4b20ffaf4f4cc756832a6d064d5dfe182f16b0e9.tar.gz
haven-4b20ffaf4f4cc756832a6d064d5dfe182f16b0e9.tar.xz
haven-4b20ffaf4f4cc756832a6d064d5dfe182f16b0e9.zip
Updated to work with new xproto XML files.
Namely, the "doc" element is ignored. Also, I've sorted everything before output so that diff isn't completely useless.
Diffstat (limited to 'nexgb/xgbgen/request_reply.go')
-rw-r--r--nexgb/xgbgen/request_reply.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/nexgb/xgbgen/request_reply.go b/nexgb/xgbgen/request_reply.go
index b8afe48..11a4e44 100644
--- a/nexgb/xgbgen/request_reply.go
+++ b/nexgb/xgbgen/request_reply.go
@@ -17,6 +17,12 @@ type Request struct {
Reply *Reply // A reply, if one exists for this request.
}
+type Requests []*Request
+
+func (rs Requests) Len() int { return len(rs) }
+func (rs Requests) Swap(i, j int) { rs[i], rs[j] = rs[j], rs[i] }
+func (rs Requests) Less(i, j int) bool { return rs[i].xmlName < rs[j].xmlName }
+
// Initialize creates the proper Go source name for this request.
// It also initializes the reply if one exists, and all fields in this request.
func (r *Request) Initialize(p *Protocol) {