From 4b20ffaf4f4cc756832a6d064d5dfe182f16b0e9 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sun, 11 Aug 2013 20:42:36 -0400 Subject: 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. --- nexgb/xgbgen/protocol.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'nexgb/xgbgen/protocol.go') diff --git a/nexgb/xgbgen/protocol.go b/nexgb/xgbgen/protocol.go index d56663d..433f4e2 100644 --- a/nexgb/xgbgen/protocol.go +++ b/nexgb/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. -- cgit v1.2.3-70-g09d2