aboutsummaryrefslogtreecommitdiff
path: root/nexgb/xgbgen/go_reply.go
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-02 01:46:30 -0400
committerAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-02 01:46:30 -0400
commit39507f86ab0468292c24081a80f41c1799d6b477 (patch)
tree002668a66ec90c71b3bbd05141b378d0b2218d58 /nexgb/xgbgen/go_reply.go
parentf48b6fafc6d96527a554876e13fc5a0b548005af (diff)
downloadhaven-39507f86ab0468292c24081a80f41c1799d6b477.tar.gz
haven-39507f86ab0468292c24081a80f41c1799d6b477.tar.xz
haven-39507f86ab0468292c24081a80f41c1799d6b477.zip
finally starting on the crescendo: requests and replies.
Diffstat (limited to 'nexgb/xgbgen/go_reply.go')
-rw-r--r--nexgb/xgbgen/go_reply.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/nexgb/xgbgen/go_reply.go b/nexgb/xgbgen/go_reply.go
new file mode 100644
index 0000000..e561d9c
--- /dev/null
+++ b/nexgb/xgbgen/go_reply.go
@@ -0,0 +1,19 @@
+package main
+
+func (r *Request) Define(c *Context) {
+ c.Putln("// Request %s", r.SrcName())
+ c.Putln("// size: %s", r.Size(c))
+ c.Putln("")
+ if r.Reply != nil {
+ c.Putln("// Request reply for %s", r.SrcName())
+ c.Putln("// size: %s", r.Reply.Size())
+ c.Putln("type %s struct {", r.ReplyName())
+ c.Putln("Sequence uint16")
+ for _, field := range r.Reply.Fields {
+ field.Define(c)
+ }
+ c.Putln("}")
+ c.Putln("")
+ }
+}
+