diff options
author | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-11 23:58:52 -0400 |
---|---|---|
committer | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-11 23:58:52 -0400 |
commit | 29942bf078c92fea681e42ca5029592526f00718 (patch) | |
tree | cee802ebe16e0b118c9be0f6265e26d31e8a5845 /nexgb/xcmisc | |
parent | fb3128ed2a83a0f644661cedebbe5bfda3f4951e (diff) | |
download | haven-29942bf078c92fea681e42ca5029592526f00718.tar.gz haven-29942bf078c92fea681e42ca5029592526f00718.tar.xz haven-29942bf078c92fea681e42ca5029592526f00718.zip |
panic when an extension request is issued before an extension has been initialized. but give a nice error message for the happy people.
Diffstat (limited to 'nexgb/xcmisc')
-rw-r--r-- | nexgb/xcmisc/xcmisc.go | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/nexgb/xcmisc/xcmisc.go b/nexgb/xcmisc/xcmisc.go index 7171969..0a4b4ce 100644 --- a/nexgb/xcmisc/xcmisc.go +++ b/nexgb/xcmisc/xcmisc.go @@ -2,7 +2,7 @@ package xcmisc /* - This file was generated by xc_misc.xml on May 11 2012 1:58:36am EDT. + This file was generated by xc_misc.xml on May 11 2012 11:57:19pm EDT. This file is automatically generated. Edit at your peril! */ @@ -40,18 +40,6 @@ func init() { xgb.NewExtErrorFuncs["XC-MISC"] = make(map[int]xgb.NewErrorFun) } -// Skipping definition for base type 'Float' - -// Skipping definition for base type 'Card8' - -// Skipping definition for base type 'Int16' - -// Skipping definition for base type 'Int32' - -// Skipping definition for base type 'Void' - -// Skipping definition for base type 'Byte' - // Skipping definition for base type 'Int8' // Skipping definition for base type 'Card16' @@ -64,6 +52,18 @@ func init() { // Skipping definition for base type 'Bool' +// Skipping definition for base type 'Float' + +// Skipping definition for base type 'Card8' + +// Skipping definition for base type 'Int16' + +// Skipping definition for base type 'Int32' + +// Skipping definition for base type 'Void' + +// Skipping definition for base type 'Byte' + // GetVersionCookie is a cookie used only for GetVersion requests. type GetVersionCookie struct { *xgb.Cookie @@ -72,6 +72,9 @@ type GetVersionCookie struct { // GetVersion sends a checked request. // If an error occurs, it will be returned with the reply by calling GetVersionCookie.Reply() func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { + if _, ok := c.Extensions["XC-MISC"]; !ok { + panic("Cannot issue request 'GetVersion' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return GetVersionCookie{cookie} @@ -80,6 +83,9 @@ func GetVersion(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint1 // GetVersionUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetVersionUnchecked(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) GetVersionCookie { + if _, ok := c.Extensions["XC-MISC"]; !ok { + panic("Cannot issue request 'GetVersion' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie) return GetVersionCookie{cookie} @@ -161,6 +167,9 @@ type GetXIDRangeCookie struct { // GetXIDRange sends a checked request. // If an error occurs, it will be returned with the reply by calling GetXIDRangeCookie.Reply() func GetXIDRange(c *xgb.Conn) GetXIDRangeCookie { + if _, ok := c.Extensions["XC-MISC"]; !ok { + panic("Cannot issue request 'GetXIDRange' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getXIDRangeRequest(c), cookie) return GetXIDRangeCookie{cookie} @@ -169,6 +178,9 @@ func GetXIDRange(c *xgb.Conn) GetXIDRangeCookie { // GetXIDRangeUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetXIDRangeUnchecked(c *xgb.Conn) GetXIDRangeCookie { + if _, ok := c.Extensions["XC-MISC"]; !ok { + panic("Cannot issue request 'GetXIDRange' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getXIDRangeRequest(c), cookie) return GetXIDRangeCookie{cookie} @@ -244,6 +256,9 @@ type GetXIDListCookie struct { // GetXIDList sends a checked request. // If an error occurs, it will be returned with the reply by calling GetXIDListCookie.Reply() func GetXIDList(c *xgb.Conn, Count uint32) GetXIDListCookie { + if _, ok := c.Extensions["XC-MISC"]; !ok { + panic("Cannot issue request 'GetXIDList' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") + } cookie := c.NewCookie(true, true) c.NewRequest(getXIDListRequest(c, Count), cookie) return GetXIDListCookie{cookie} @@ -252,6 +267,9 @@ func GetXIDList(c *xgb.Conn, Count uint32) GetXIDListCookie { // GetXIDListUnchecked sends an unchecked request. // If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent. func GetXIDListUnchecked(c *xgb.Conn, Count uint32) GetXIDListCookie { + if _, ok := c.Extensions["XC-MISC"]; !ok { + panic("Cannot issue request 'GetXIDList' using the uninitialized extension 'XC-MISC'. xcmisc.Init(connObj) must be called first.") + } cookie := c.NewCookie(false, true) c.NewRequest(getXIDListRequest(c, Count), cookie) return GetXIDListCookie{cookie} |