From 5cdae5950c357564300c0ee3fb4dc9e7bbf4946b Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Thu, 3 May 2012 01:00:01 -0400 Subject: holy toldeo... things might actually be working --- nexgb/xgbgen/type.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'nexgb/xgbgen/type.go') diff --git a/nexgb/xgbgen/type.go b/nexgb/xgbgen/type.go index d8e76a2..3498463 100644 --- a/nexgb/xgbgen/type.go +++ b/nexgb/xgbgen/type.go @@ -334,6 +334,18 @@ func (s *Struct) Initialize(p *Protocol) { } } +// HasList returns whether there is a field in this struct that is a list. +// When true, a more involved calculation is necessary to compute this struct's +// size. +func (s *Struct) HasList() bool { + for _, field := range s.Fields { + if _, ok := field.(*ListField); ok { + return true + } + } + return false +} + type Union struct { srcName string xmlName string -- cgit v1.2.3-70-g09d2