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" />
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" />
46 <!-- Type for fields or parameters with attributes "name" and "type" -->
47 <xsd:complexType name="var">
48 <xsd:attribute name="name" type="xsd:string" />
49 <xsd:attribute name="type" type="xsd:string" />
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">
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" />
94 <!-- Fields in requests that are calculated from other information, not
95 supplied by the caller. -->
96 <xsd:element name="exprfield" >
99 <xsd:extension base="var">
100 <xsd:group ref="expression" />
102 </xsd:complexContent>
106 <!-- BITMASK/LISTofVALUE parameter pairs. -->
107 <xsd:element name="valueparam">
109 <xsd:attribute name="value-mask-type" type="xsd:string" />
110 <xsd:attribute name="value-mask-name" type="xsd:string" />
111 <xsd:attribute name="value-list-name" type="xsd:string" />
115 <xsd:group name="fields">
117 <xsd:element ref="pad" />
118 <xsd:element ref="field" />
119 <xsd:element ref="list" />
123 <!-- Type for a structure -->
124 <xsd:complexType name="struct">
125 <xsd:group ref="fields" minOccurs="1" maxOccurs="unbounded" />
126 <xsd:attribute name="name" type="xsd:string" />
129 <!-- Type for a packet structure -->
130 <xsd:complexType name="packet-struct">
131 <xsd:group ref="fields" minOccurs="0" maxOccurs="unbounded" />
132 <xsd:attribute name="name" type="xsd:string" />
133 <xsd:attribute name="number" type="xsd:integer" />
136 <!-- Type for a packet structure copy -->
137 <xsd:complexType name="packet-struct-copy">
138 <xsd:attribute name="name" type="xsd:string" />
139 <xsd:attribute name="number" type="xsd:integer" />
140 <xsd:attribute name="ref" type="xsd:string" />
143 <!-- Type for hex integers -->
144 <xsd:simpleType name="hex-integer">
145 <xsd:restriction base="xsd:string">
146 <xsd:pattern value="0x[0-9a-fA-F]+" />
150 <!-- Type for integers in either decimal or hex -->
151 <xsd:simpleType name="dec-or-hex-integer">
152 <xsd:union memberTypes="xsd:integer hex-integer" />
155 <xsd:group name="macro">
157 <xsd:element name="request">
160 <xsd:choice minOccurs="0" maxOccurs="unbounded">
161 <xsd:group ref="fields" />
162 <xsd:element ref="localfield" />
163 <xsd:element ref="exprfield" />
164 <xsd:element ref="valueparam" />
166 <xsd:element name="reply" minOccurs="0" maxOccurs="1">
168 <xsd:group ref="fields" minOccurs="1" maxOccurs="unbounded" />
172 <xsd:attribute name="name" type="xsd:string" />
173 <xsd:attribute name="opcode" type="xsd:integer" />
174 <xsd:attribute name="combine-adjacent" type="xsd:boolean" />
177 <xsd:element name="event">
180 <xsd:extension base="packet-struct">
181 <xsd:attribute name="no-sequence-number" type="xsd:boolean" />
183 </xsd:complexContent>
186 <xsd:element name="eventcopy" type="packet-struct-copy" />
187 <xsd:element name="error" type="packet-struct" />
188 <xsd:element name="errorcopy" type="packet-struct-copy" />
189 <xsd:element name="struct" type="struct" />
190 <xsd:element name="union" type="struct" />
191 <xsd:element name="xidtype">
193 <xsd:attribute name="name" type="xsd:string" />
196 <xsd:element name="enum">
198 <xsd:sequence minOccurs="1" maxOccurs="unbounded">
199 <xsd:element name="item">
201 <xsd:group ref="expression" minOccurs="0" maxOccurs="1" />
202 <xsd:attribute name="name" type="xsd:string" />
206 <xsd:attribute name="name" type="xsd:string" />
209 <xsd:element name="typedef">
211 <xsd:attribute name="oldname" type="xsd:string" />
212 <xsd:attribute name="newname" type="xsd:string" />
215 <!-- The import element allows a protocol description to reference the
216 declarations of another protocol description. -->
217 <xsd:element name="import" type="xsd:string" />