aboutsummaryrefslogtreecommitdiff
path: root/nexgb/xgbgen/xml.go
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-04-30 02:44:31 -0400
committerAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-04-30 02:44:31 -0400
commit2a2d8653b3a7918dfb00dcca8937b0e878279c70 (patch)
tree39505670885d7ae838f9c306070336db4685e078 /nexgb/xgbgen/xml.go
parent05d8ec6a16acf88c5ae7521d86131f5ea7f9b4e4 (diff)
downloadhaven-2a2d8653b3a7918dfb00dcca8937b0e878279c70.tar.gz
haven-2a2d8653b3a7918dfb00dcca8937b0e878279c70.tar.xz
haven-2a2d8653b3a7918dfb00dcca8937b0e878279c70.zip
gofmt
Diffstat (limited to 'nexgb/xgbgen/xml.go')
-rw-r--r--nexgb/xgbgen/xml.go81
1 files changed, 40 insertions, 41 deletions
diff --git a/nexgb/xgbgen/xml.go b/nexgb/xgbgen/xml.go
index 7e50831..f219c2d 100644
--- a/nexgb/xgbgen/xml.go
+++ b/nexgb/xgbgen/xml.go
@@ -8,29 +8,29 @@ import (
type XML struct {
// Root 'xcb' element properties.
- XMLName xml.Name `xml:"xcb"`
- Header string `xml:"header,attr"`
- ExtensionXName string `xml:"extension-xname,attr"`
- ExtensionName string `xml:"extension-name,attr"`
- MajorVersion string `xml:"major-version,attr"`
- MinorVersion string `xml:"minor-version,attr"`
+ XMLName xml.Name `xml:"xcb"`
+ Header string `xml:"header,attr"`
+ ExtensionXName string `xml:"extension-xname,attr"`
+ ExtensionName string `xml:"extension-name,attr"`
+ MajorVersion string `xml:"major-version,attr"`
+ MinorVersion string `xml:"minor-version,attr"`
// Types for all top-level elements.
// First are the simple ones.
- Imports XMLImports `xml:"import"`
- Enums XMLEnums `xml:"enum"`
- Xids XMLXids `xml:"xidtype"`
- XidUnions XMLXids `xml:"xidunion"`
- TypeDefs XMLTypeDefs `xml:"typedef"`
+ Imports XMLImports `xml:"import"`
+ Enums XMLEnums `xml:"enum"`
+ Xids XMLXids `xml:"xidtype"`
+ XidUnions XMLXids `xml:"xidunion"`
+ TypeDefs XMLTypeDefs `xml:"typedef"`
EventCopies XMLEventCopies `xml:"eventcopy"`
ErrorCopies XMLErrorCopies `xml:"errorcopy"`
// Here are the complex ones, i.e., anything with "structure contents"
- Structs XMLStructs `xml:"struct"`
- Unions XMLUnions `xml:"union"`
+ Structs XMLStructs `xml:"struct"`
+ Unions XMLUnions `xml:"union"`
Requests XMLRequests `xml:"request"`
- Events XMLEvents `xml:"event"`
- Errors XMLErrors `xml:"error"`
+ Events XMLEvents `xml:"event"`
+ Errors XMLErrors `xml:"error"`
}
type XMLImports []*XMLImport
@@ -39,14 +39,14 @@ func (imports XMLImports) Eval() {
for _, imp := range imports {
xmlBytes, err := ioutil.ReadFile(*protoPath + "/" + imp.Name + ".xml")
if err != nil {
- log.Fatalf("Could not read X protocol description for import " +
+ log.Fatalf("Could not read X protocol description for import "+
"'%s' because: %s", imp.Name, err)
}
imp.xml = &XML{}
err = xml.Unmarshal(xmlBytes, imp.xml)
if err != nil {
- log.Fatal("Could not parse X protocol description for import " +
+ log.Fatal("Could not parse X protocol description for import "+
"'%s' because: %s", imp.Name, err)
}
@@ -57,18 +57,18 @@ func (imports XMLImports) Eval() {
type XMLImport struct {
Name string `xml:",chardata"`
- xml *XML `xml:"-"`
+ xml *XML `xml:"-"`
}
type XMLEnums []XMLEnum
type XMLEnum struct {
- Name string `xml:"name,attr"`
+ Name string `xml:"name,attr"`
Items []*XMLEnumItem `xml:"item"`
}
type XMLEnumItem struct {
- Name string `xml:"name,attr"`
+ Name string `xml:"name,attr"`
Expr *XMLExpression `xml:",any"`
}
@@ -76,7 +76,7 @@ type XMLXids []*XMLXid
type XMLXid struct {
XMLName xml.Name
- Name string `xml:"name,attr"`
+ Name string `xml:"name,attr"`
}
type XMLTypeDefs []*XMLTypeDef
@@ -89,41 +89,41 @@ type XMLTypeDef struct {
type XMLEventCopies []*XMLEventCopy
type XMLEventCopy struct {
- Name string `xml:"name,attr"`
- Number int `xml:"number,attr"`
- Ref string `xml:"ref,attr"`
+ Name string `xml:"name,attr"`
+ Number int `xml:"number,attr"`
+ Ref string `xml:"ref,attr"`
}
type XMLErrorCopies []*XMLErrorCopy
type XMLErrorCopy struct {
- Name string `xml:"name,attr"`
- Number int `xml:"number,attr"`
- Ref string `xml:"ref,attr"`
+ Name string `xml:"name,attr"`
+ Number int `xml:"number,attr"`
+ Ref string `xml:"ref,attr"`
}
type XMLStructs []*XMLStruct
type XMLStruct struct {
- Name string `xml:"name,attr"`
+ Name string `xml:"name,attr"`
Fields XMLFields `xml:",any"`
}
type XMLUnions []*XMLUnion
type XMLUnion struct {
- Name string `xml:"name,attr"`
+ Name string `xml:"name,attr"`
Fields XMLFields `xml:",any"`
}
type XMLRequests []*XMLRequest
type XMLRequest struct {
- Name string `xml:"name,attr"`
- Opcode int `xml:"opcode,attr"`
- Combine bool `xml:"combine-adjacent,attr"`
- Fields XMLFields `xml:",any"`
- Reply *XMLReply `xml:"reply"`
+ Name string `xml:"name,attr"`
+ Opcode int `xml:"opcode,attr"`
+ Combine bool `xml:"combine-adjacent,attr"`
+ Fields XMLFields `xml:",any"`
+ Reply *XMLReply `xml:"reply"`
}
type XMLReply struct {
@@ -133,17 +133,16 @@ type XMLReply struct {
type XMLEvents []*XMLEvent
type XMLEvent struct {
- Name string `xml:"name,attr"`
- Number int `xml:"number,attr"`
- NoSequence bool `xml:"no-sequence-number,true"`
- Fields XMLFields `xml:",any"`
+ Name string `xml:"name,attr"`
+ Number int `xml:"number,attr"`
+ NoSequence bool `xml:"no-sequence-number,true"`
+ Fields XMLFields `xml:",any"`
}
type XMLErrors []*XMLError
type XMLError struct {
- Name string `xml:"name,attr"`
- Number int `xml:"number,attr"`
+ Name string `xml:"name,attr"`
+ Number int `xml:"number,attr"`
Fields XMLFields `xml:",any"`
}
-