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

@@ -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) {