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.
This commit is contained in:
Andrew Gallant
2013-08-11 20:42:36 -04:00
committed by Přemysl Janouch
parent 5d96993ee1
commit 4b20ffaf4f
5 changed files with 45 additions and 10 deletions

View File

@@ -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.