1 <?xml version="1.0" encoding="utf-8"?>
3 Copyright (C) 2004 Josh Triplett. All Rights Reserved.
5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the "Software"), to deal
7 in the Software without restriction, including without limitation the rights
8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions:
12 The above copyright notice and this permission notice shall be included in all
13 copies or substantial portions of the Software.
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 Except as contained in this notice, the names of the authors or their
23 institutions shall not be used in advertising or otherwise to promote the
24 sale, use or other dealings in this Software without prior written
25 authorization from the authors.
27 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
29 <!-- The root element -->
30 <xsd:element name="xcb">
32 <xsd:group ref="macro" minOccurs="0" maxOccurs="unbounded" />
33 <xsd:attribute name="header" type="xsd:string" use="required" />
34 <xsd:attribute name="extension-xname" type="xsd:string" use="optional" />
35 <xsd:attribute name="extension-name" type="xsd:string" use="optional" />
40 <xsd:element name="pad">
42 <xsd:attribute name="bytes" type="xsd:integer" use="required" />
46 <!-- Type for fields or parameters with attributes "name" and "type" -->
47 <xsd:complexType name="var">
48 <xsd:attribute name="name" type="xsd:string" use="required" />
49 <xsd:attribute name="type" type="xsd:string" use="required" />
52 <!-- field replaces FIELD, PARAM, and REPLY. -->
53 <xsd:element name="field" type="var" />
55 <!-- list replaces ARRAYFIELD, LISTPARAM, and ARRAYREPLY. The name and type
56 are specified as attributes. The content is an expression giving the
58 <xsd:element name="list">
61 <xsd:extension base="var">
62 <xsd:group ref="expression" minOccurs="0" maxOccurs="1" />
68 <!-- Parameters in requests that are not sent with the request. -->
69 <xsd:element name="localfield" type="var" />
72 <xsd:group name="expression">
74 <xsd:element name="op">
77 <xsd:group ref="expression" />
78 <xsd:group ref="expression" />
80 <xsd:attribute name="op" use="required">
82 <xsd:restriction base="xsd:string">
83 <xsd:pattern value="\+|-|\*|/|&|<<" />
89 <xsd:element name="fieldref" type="xsd:string" />
90 <xsd:element name="value" type="dec-or-hex-integer" />
91 <xsd:element name="bit" type="xsd:integer" />
95 <!-- Fields in requests that are calculated from other information, not
96 supplied by the caller. -->
97 <xsd:element name="exprfield" >
100 <xsd:extension base="var">
101 <xsd:group ref="expression" />
103 </xsd:complexContent>
107 <!-- BITMASK/LISTofVALUE parameter pairs. -->
108 <xsd:element name="valueparam">
110 <xsd:attribute name="value-mask-type" type="xsd:string" use="required" />
111 <xsd:attribute name="value-mask-name" type="xsd:string" use="required" />
112 <xsd:attribute name="value-list-name" type="xsd:string" use="required" />
116 <xsd:group name="fields">
118 <xsd:element ref="pad" />
119 <xsd:element ref="field" />
120 <xsd:element ref="list" />
124 <!-- Type for a structure -->
125 <xsd:complexType name="struct">
126 <xsd:group ref="fields" minOccurs="1" maxOccurs="unbounded" />
127 <xsd:attribute name="name" type="xsd:string" use="required" />
130 <!-- Type for a packet structure -->
131 <xsd:complexType name="packet-struct">
132 <xsd:group ref="fields" minOccurs="0" maxOccurs="unbounded" />
133 <xsd:attribute name="name" type="xsd:string" use="required" />
134 <xsd:attribute name="number" type="xsd:integer" use="required" />
137 <!-- Type for a packet structure copy -->
138 <xsd:complexType name="packet-struct-copy">
139 <xsd:attribute name="name" type="xsd:string" use="required" />
140 <xsd:attribute name="number" type="xsd:integer" use="required" />
141 <xsd:attribute name="ref" type="xsd:string" use="required" />
144 <!-- Type for hex integers -->
145 <xsd:simpleType name="hex-integer">
146 <xsd:restriction base="xsd:string">
147 <xsd:pattern value="0x[0-9a-fA-F]+" />
151 <!-- Type for integers in either decimal or hex -->
152 <xsd:simpleType name="dec-or-hex-integer">
153 <xsd:union memberTypes="xsd:integer hex-integer" />
156 <xsd:group name="macro">
158 <xsd:element name="request">
161 <xsd:choice minOccurs="0" maxOccurs="unbounded">
162 <xsd:group ref="fields" />
163 <xsd:element ref="localfield" />
164 <xsd:element ref="exprfield" />
165 <xsd:element ref="valueparam" />
167 <xsd:element name="reply" minOccurs="0" maxOccurs="1">
169 <xsd:choice minOccurs="1" maxOccurs="unbounded">
170 <xsd:group ref="fields" />
171 <xsd:element ref="valueparam" />
176 <xsd:attribute name="name" type="xsd:string" use="required" />
177 <xsd:attribute name="opcode" type="xsd:integer" use="required" />
178 <xsd:attribute name="combine-adjacent" type="xsd:boolean"
182 <xsd:element name="event">
185 <xsd:extension base="packet-struct">
186 <xsd:attribute name="no-sequence-number" type="xsd:boolean"
189 </xsd:complexContent>
192 <xsd:element name="eventcopy" type="packet-struct-copy" />
193 <xsd:element name="error" type="packet-struct" />
194 <xsd:element name="errorcopy" type="packet-struct-copy" />
195 <xsd:element name="struct" type="struct" />
196 <xsd:element name="union" type="struct" />
197 <xsd:element name="xidtype">
199 <xsd:attribute name="name" type="xsd:string" use="required" />
202 <xsd:element name="xidunion">
205 <xsd:element name="type" type="xsd:string"
206 minOccurs="1" maxOccurs="unbounded" />
208 <xsd:attribute name="name" type="xsd:string" use="required" />
211 <xsd:element name="enum">
213 <xsd:sequence minOccurs="1" maxOccurs="unbounded">
214 <xsd:element name="item">
216 <xsd:group ref="expression" minOccurs="0" maxOccurs="1" />
217 <xsd:attribute name="name" type="xsd:string" use="required" />
221 <xsd:attribute name="name" type="xsd:string" use="required" />
224 <xsd:element name="typedef">
226 <xsd:attribute name="oldname" type="xsd:string" use="required" />
227 <xsd:attribute name="newname" type="xsd:string" use="required" />
230 <!-- The import element allows a protocol description to reference the
231 declarations of another protocol description. -->
232 <xsd:element name="import" type="xsd:string" />