aboutsummaryrefslogtreecommitdiff
path: root/nexgb/xgbgen/protocol.go
diff options
context:
space:
mode:
Diffstat (limited to 'nexgb/xgbgen/protocol.go')
-rw-r--r--nexgb/xgbgen/protocol.go6
1 files changed, 6 insertions, 0 deletions
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.