summaryrefslogtreecommitdiff
path: root/xgbgen/protocol.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/protocol.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/protocol.go')
-rw-r--r--xgbgen/protocol.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/xgbgen/protocol.go b/xgbgen/protocol.go
index d56663d..433f4e2 100644
--- a/xgbgen/protocol.go
+++ b/xgbgen/protocol.go
@@ -22,6 +22,12 @@ type Protocol struct {
Requests []*Request
}
+type Protocols []*Protocol
+
+func (ps Protocols) Len() int { return len(ps) }
+func (ps Protocols) Swap(i, j int) { ps[i], ps[j] = ps[j], ps[i] }
+func (ps Protocols) Less(i, j int) bool { return ps[i].ExtName < ps[j].ExtName }
+
// Initialize traverses all structures, looks for 'Translation' type,
// and looks up the real type in the namespace. It also sets the source
// name for all relevant fields/structures.