diff options
author | Přemysl Janouch <p@janouch.name> | 2018-09-29 21:42:23 +0200 |
---|---|---|
committer | Přemysl Janouch <p@janouch.name> | 2018-09-30 17:34:26 +0200 |
commit | 3e9ed4eac6a953b2616bcf129b515a857271acdc (patch) | |
tree | b7e674aa21fe3044eec6071e0d990c3933ba5f0d /nexgb/xgbgen/xml.go | |
parent | 0056720d05d72d7b3a1b3cbdae5b5c5d80e167d3 (diff) | |
download | haven-3e9ed4eac6a953b2616bcf129b515a857271acdc.tar.gz haven-3e9ed4eac6a953b2616bcf129b515a857271acdc.tar.xz haven-3e9ed4eac6a953b2616bcf129b515a857271acdc.zip |
xgbgen: process <doc> elements
Most of XCB documentation now ends up in Go sources,
although the end result is of mixed quality.
Diffstat (limited to 'nexgb/xgbgen/xml.go')
-rw-r--r-- | nexgb/xgbgen/xml.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/nexgb/xgbgen/xml.go b/nexgb/xgbgen/xml.go index 440d0a8..fc3cf5a 100644 --- a/nexgb/xgbgen/xml.go +++ b/nexgb/xgbgen/xml.go @@ -92,6 +92,24 @@ type XMLErrorCopy struct { Ref string `xml:"ref,attr"` } +type XMLDocField struct { + Name string `xml:"name,attr"` + Description string `xml:",chardata"` +} + +type XMLDocError struct { + Type string `xml:"type,attr"` + Description string `xml:",chardata"` +} + +type XMLDoc struct { + Brief string `xml:"brief"` + Description string `xml:"description"` + Example string `xml:"example"` + Fields []*XMLDocField `xml:"field"` + Errors []*XMLDocError `xml:"error"` +} + type XMLStruct struct { Name string `xml:"name,attr"` Fields []*XMLField `xml:",any"` @@ -108,10 +126,12 @@ type XMLRequest struct { Combine bool `xml:"combine-adjacent,attr"` Fields []*XMLField `xml:",any"` Reply *XMLReply `xml:"reply"` + Doc *XMLDoc `xml:"doc"` } type XMLReply struct { Fields []*XMLField `xml:",any"` + Doc *XMLDoc `xml:"doc"` } type XMLEvent struct { @@ -119,6 +139,7 @@ type XMLEvent struct { Number int `xml:"number,attr"` NoSequence bool `xml:"no-sequence-number,attr"` Fields []*XMLField `xml:",any"` + Doc *XMLDoc `xml:"doc"` } type XMLError struct { |