aboutsummaryrefslogtreecommitdiff
path: root/nexgb/xcmisc/xcmisc.go
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-10 23:57:34 -0400
committerAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-10 23:57:34 -0400
commitc00652934e4ec68016a152b9bea10273b0be8726 (patch)
tree069dc287fa76dcec2d6240e1afdfe5652118a88a /nexgb/xcmisc/xcmisc.go
parenta3363755cdfdafdf02d5a772bd47a462e99af057 (diff)
downloadhaven-c00652934e4ec68016a152b9bea10273b0be8726.tar.gz
haven-c00652934e4ec68016a152b9bea10273b0be8726.tar.xz
haven-c00652934e4ec68016a152b9bea10273b0be8726.zip
better docs
Diffstat (limited to 'nexgb/xcmisc/xcmisc.go')
-rw-r--r--nexgb/xcmisc/xcmisc.go59
1 files changed, 34 insertions, 25 deletions
diff --git a/nexgb/xcmisc/xcmisc.go b/nexgb/xcmisc/xcmisc.go
index d4f7b0d..5157119 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 10 2012 8:04:32pm EDT.
+ This file was generated by xc_misc.xml on May 10 2012 11:56:19pm EDT.
This file is automatically generated. Edit at your peril!
*/
@@ -64,35 +64,37 @@ func init() {
// Skipping definition for base type 'Bool'
-// Request GetVersion
-// size: 8
+// GetVersionCookie is a cookie used only for GetVersion requests.
type GetVersionCookie struct {
*xgb.Cookie
}
+// 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 {
cookie := c.NewCookie(true, true)
c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return GetVersionCookie{cookie}
}
+// 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 {
cookie := c.NewCookie(false, true)
c.NewRequest(getVersionRequest(c, ClientMajorVersion, ClientMinorVersion), cookie)
return GetVersionCookie{cookie}
}
-// Request reply for GetVersion
-// size: 12
+// GetVersionReply represents the data returned from a GetVersion request.
type GetVersionReply struct {
- Sequence uint16
- Length uint32
+ Sequence uint16 // sequence number of the request for this reply
+ Length uint32 // number of bytes in this reply
// padding: 1 bytes
ServerMajorVersion uint16
ServerMinorVersion uint16
}
-// Waits and reads reply data from request GetVersion
+// Reply blocks and returns the reply data for a GetVersion request.
func (cook GetVersionCookie) Reply() (*GetVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@@ -104,7 +106,7 @@ func (cook GetVersionCookie) Reply() (*GetVersionReply, error) {
return getVersionReply(buf), nil
}
-// Read reply into structure from buffer for GetVersion
+// getVersionReply reads a byte slice into a GetVersionReply value.
func getVersionReply(buf []byte) *GetVersionReply {
v := new(GetVersionReply)
b := 1 // skip reply determinant
@@ -127,6 +129,7 @@ func getVersionReply(buf []byte) *GetVersionReply {
}
// Write request to wire for GetVersion
+// getVersionRequest writes a GetVersion request to a byte slice.
func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersion uint16) []byte {
size := 8
b := 0
@@ -150,35 +153,37 @@ func getVersionRequest(c *xgb.Conn, ClientMajorVersion uint16, ClientMinorVersio
return buf
}
-// Request GetXIDRange
-// size: 4
+// GetXIDRangeCookie is a cookie used only for GetXIDRange requests.
type GetXIDRangeCookie struct {
*xgb.Cookie
}
+// 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 {
cookie := c.NewCookie(true, true)
c.NewRequest(getXIDRangeRequest(c), cookie)
return GetXIDRangeCookie{cookie}
}
+// 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 {
cookie := c.NewCookie(false, true)
c.NewRequest(getXIDRangeRequest(c), cookie)
return GetXIDRangeCookie{cookie}
}
-// Request reply for GetXIDRange
-// size: 16
+// GetXIDRangeReply represents the data returned from a GetXIDRange request.
type GetXIDRangeReply struct {
- Sequence uint16
- Length uint32
+ Sequence uint16 // sequence number of the request for this reply
+ Length uint32 // number of bytes in this reply
// padding: 1 bytes
StartId uint32
Count uint32
}
-// Waits and reads reply data from request GetXIDRange
+// Reply blocks and returns the reply data for a GetXIDRange request.
func (cook GetXIDRangeCookie) Reply() (*GetXIDRangeReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@@ -190,7 +195,7 @@ func (cook GetXIDRangeCookie) Reply() (*GetXIDRangeReply, error) {
return getXIDRangeReply(buf), nil
}
-// Read reply into structure from buffer for GetXIDRange
+// getXIDRangeReply reads a byte slice into a GetXIDRangeReply value.
func getXIDRangeReply(buf []byte) *GetXIDRangeReply {
v := new(GetXIDRangeReply)
b := 1 // skip reply determinant
@@ -213,6 +218,7 @@ func getXIDRangeReply(buf []byte) *GetXIDRangeReply {
}
// Write request to wire for GetXIDRange
+// getXIDRangeRequest writes a GetXIDRange request to a byte slice.
func getXIDRangeRequest(c *xgb.Conn) []byte {
size := 4
b := 0
@@ -230,36 +236,38 @@ func getXIDRangeRequest(c *xgb.Conn) []byte {
return buf
}
-// Request GetXIDList
-// size: 8
+// GetXIDListCookie is a cookie used only for GetXIDList requests.
type GetXIDListCookie struct {
*xgb.Cookie
}
+// 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 {
cookie := c.NewCookie(true, true)
c.NewRequest(getXIDListRequest(c, Count), cookie)
return GetXIDListCookie{cookie}
}
+// 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 {
cookie := c.NewCookie(false, true)
c.NewRequest(getXIDListRequest(c, Count), cookie)
return GetXIDListCookie{cookie}
}
-// Request reply for GetXIDList
-// size: (32 + xgb.Pad((int(IdsLen) * 4)))
+// GetXIDListReply represents the data returned from a GetXIDList request.
type GetXIDListReply struct {
- Sequence uint16
- Length uint32
+ Sequence uint16 // sequence number of the request for this reply
+ Length uint32 // number of bytes in this reply
// padding: 1 bytes
IdsLen uint32
// padding: 20 bytes
Ids []uint32 // size: xgb.Pad((int(IdsLen) * 4))
}
-// Waits and reads reply data from request GetXIDList
+// Reply blocks and returns the reply data for a GetXIDList request.
func (cook GetXIDListCookie) Reply() (*GetXIDListReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@@ -271,7 +279,7 @@ func (cook GetXIDListCookie) Reply() (*GetXIDListReply, error) {
return getXIDListReply(buf), nil
}
-// Read reply into structure from buffer for GetXIDList
+// getXIDListReply reads a byte slice into a GetXIDListReply value.
func getXIDListReply(buf []byte) *GetXIDListReply {
v := new(GetXIDListReply)
b := 1 // skip reply determinant
@@ -300,6 +308,7 @@ func getXIDListReply(buf []byte) *GetXIDListReply {
}
// Write request to wire for GetXIDList
+// getXIDListRequest writes a GetXIDList request to a byte slice.
func getXIDListRequest(c *xgb.Conn, Count uint32) []byte {
size := 8
b := 0