aboutsummaryrefslogtreecommitdiff
path: root/nexgb/bigreq
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/bigreq
parenta3363755cdfdafdf02d5a772bd47a462e99af057 (diff)
downloadhaven-c00652934e4ec68016a152b9bea10273b0be8726.tar.gz
haven-c00652934e4ec68016a152b9bea10273b0be8726.tar.xz
haven-c00652934e4ec68016a152b9bea10273b0be8726.zip
better docs
Diffstat (limited to 'nexgb/bigreq')
-rw-r--r--nexgb/bigreq/bigreq.go25
1 files changed, 14 insertions, 11 deletions
diff --git a/nexgb/bigreq/bigreq.go b/nexgb/bigreq/bigreq.go
index c2263a0..3913c5f 100644
--- a/nexgb/bigreq/bigreq.go
+++ b/nexgb/bigreq/bigreq.go
@@ -2,7 +2,7 @@
package bigreq
/*
- This file was generated by bigreq.xml on May 10 2012 8:04:31pm EDT.
+ This file was generated by bigreq.xml on May 10 2012 11:56:18pm EDT.
This file is automatically generated. Edit at your peril!
*/
@@ -40,6 +40,8 @@ func init() {
xgb.NewExtErrorFuncs["BIG-REQUESTS"] = make(map[int]xgb.NewErrorFun)
}
+// Skipping definition for base type 'Float'
+
// Skipping definition for base type 'Card8'
// Skipping definition for base type 'Int16'
@@ -62,36 +64,36 @@ func init() {
// Skipping definition for base type 'Bool'
-// Skipping definition for base type 'Float'
-
-// Request Enable
-// size: 4
+// EnableCookie is a cookie used only for Enable requests.
type EnableCookie struct {
*xgb.Cookie
}
+// Enable sends a checked request.
+// If an error occurs, it will be returned with the reply by calling EnableCookie.Reply()
func Enable(c *xgb.Conn) EnableCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(enableRequest(c), cookie)
return EnableCookie{cookie}
}
+// EnableUnchecked sends an unchecked request.
+// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func EnableUnchecked(c *xgb.Conn) EnableCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(enableRequest(c), cookie)
return EnableCookie{cookie}
}
-// Request reply for Enable
-// size: 12
+// EnableReply represents the data returned from a Enable request.
type EnableReply 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
MaximumRequestLength uint32
}
-// Waits and reads reply data from request Enable
+// Reply blocks and returns the reply data for a Enable request.
func (cook EnableCookie) Reply() (*EnableReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@@ -103,7 +105,7 @@ func (cook EnableCookie) Reply() (*EnableReply, error) {
return enableReply(buf), nil
}
-// Read reply into structure from buffer for Enable
+// enableReply reads a byte slice into a EnableReply value.
func enableReply(buf []byte) *EnableReply {
v := new(EnableReply)
b := 1 // skip reply determinant
@@ -123,6 +125,7 @@ func enableReply(buf []byte) *EnableReply {
}
// Write request to wire for Enable
+// enableRequest writes a Enable request to a byte slice.
func enableRequest(c *xgb.Conn) []byte {
size := 4
b := 0