aboutsummaryrefslogtreecommitdiff
path: root/nexgb/xgbgen/context.go
diff options
context:
space:
mode:
authorPřemysl Janouch <p@janouch.name>2018-09-21 08:37:21 +0200
committerPřemysl Janouch <p@janouch.name>2018-09-30 17:34:25 +0200
commit28a511253284a7be082d6c41e40aa2172b675263 (patch)
tree97d1a231febd3723df23cc704202fcaab8760ec1 /nexgb/xgbgen/context.go
parent1a53c005e95c6db33160da9cddae2bde88c8d1ca (diff)
downloadhaven-28a511253284a7be082d6c41e40aa2172b675263.tar.gz
haven-28a511253284a7be082d6c41e40aa2172b675263.tar.xz
haven-28a511253284a7be082d6c41e40aa2172b675263.zip
nexgb: export {Major,Minor}Version for extensions
Diffstat (limited to 'nexgb/xgbgen/context.go')
-rw-r--r--nexgb/xgbgen/context.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go
index 579c480..32dee58 100644
--- a/nexgb/xgbgen/context.go
+++ b/nexgb/xgbgen/context.go
@@ -101,6 +101,12 @@ func (c *Context) Morph(xmlBytes []byte) {
if c.protocol.isExt() {
xname := c.protocol.ExtXName
+ c.Putln("const (")
+ c.Putln("MajorVersion = %s", c.protocol.MajorVersion)
+ c.Putln("MinorVersion = %s", c.protocol.MinorVersion)
+ c.Putln(")")
+ c.Putln("")
+
c.Putln("// Init must be called before using the %s extension.",
xname)
c.Putln("func Init(c *xgb.Conn) error {")