summaryrefslogtreecommitdiff
path: root/xgbgen/context.go
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <[email protected]>2012-05-07 21:58:33 -0400
committerAndrew Gallant (Ocelot) <[email protected]>2012-05-07 21:58:33 -0400
commiteeb7fd0d1ed91c8f8e62572b1b5e9ef0648bffd0 (patch)
tree000fcee1a7741ba6c5f799732b083049ff054070 /xgbgen/context.go
parentd16723697e0450c3d410a5637eec40242c45b4f8 (diff)
more clean up. use log instead of fmt.Print to stderr. bug fix for event blocking (a hack fix for now).
Diffstat (limited to 'xgbgen/context.go')
-rw-r--r--xgbgen/context.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/xgbgen/context.go b/xgbgen/context.go
index f1762d3..a7a1d1d 100644
--- a/xgbgen/context.go
+++ b/xgbgen/context.go
@@ -86,7 +86,7 @@ func (c *Context) Morph(xmlBytes []byte) {
c.Putln("case err != nil:")
c.Putln("return err")
c.Putln("case !reply.Present:")
- c.Putln("return newError(\"No extension named %s could be found on "+
+ c.Putln("return errorf(\"No extension named %s could be found on "+
"on the server.\")", xname)
c.Putln("}")
c.Putln("")
@@ -95,6 +95,9 @@ func (c *Context) Morph(xmlBytes []byte) {
c.Putln("for evNum, fun := range newExtEventFuncs[\"%s\"] {", xname)
c.Putln("newEventFuncs[int(reply.FirstEvent) + evNum] = fun")
c.Putln("}")
+ c.Putln("for errNum, fun := range newExtErrorFuncs[\"%s\"] {", xname)
+ c.Putln("newErrorFuncs[int(reply.FirstError) + errNum] = fun")
+ c.Putln("}")
c.Putln("c.extLock.Unlock()")
c.Putln("")
c.Putln("return nil")
@@ -102,8 +105,10 @@ func (c *Context) Morph(xmlBytes []byte) {
c.Putln("")
// Make sure newExtEventFuncs["EXT_NAME"] map is initialized.
+ // Same deal for newExtErrorFuncs["EXT_NAME"]
c.Putln("func init() {")
c.Putln("newExtEventFuncs[\"%s\"] = make(map[int]newEventFun)", xname)
+ c.Putln("newExtErrorFuncs[\"%s\"] = make(map[int]newErrorFun)", xname)
c.Putln("}")
c.Putln("")
}