summaryrefslogtreecommitdiff
path: root/xgbgen/request_reply.go
diff options
context:
space:
mode:
authorAndrew Gallant <[email protected]>2013-08-11 20:42:36 -0400
committerAndrew Gallant <[email protected]>2013-08-11 20:42:36 -0400
commita95df029067fedc05cb914b883b1752ce1d57974 (patch)
treead873cd533d1b7f34311caa21c770af501989f45 /xgbgen/request_reply.go
parent7725850c7d1f4eb39864f8c8b16c249e385bb2a0 (diff)
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 'xgbgen/request_reply.go')
-rw-r--r--xgbgen/request_reply.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/xgbgen/request_reply.go b/xgbgen/request_reply.go
index b8afe48..11a4e44 100644
--- a/xgbgen/request_reply.go
+++ b/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) {