xcb.xsd revision d4401354
1d4401354Smrg<?xml version="1.0" encoding="utf-8"?>
2d4401354Smrg<!--
3d4401354SmrgCopyright (C) 2004 Josh Triplett.  All Rights Reserved.
4d4401354Smrg
5d4401354SmrgPermission is hereby granted, free of charge, to any person obtaining a copy
6d4401354Smrgof this software and associated documentation files (the "Software"), to deal
7d4401354Smrgin the Software without restriction, including without limitation the rights
8d4401354Smrgto use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9d4401354Smrgcopies of the Software, and to permit persons to whom the Software is
10d4401354Smrgfurnished to do so, subject to the following conditions:
11d4401354Smrg
12d4401354SmrgThe above copyright notice and this permission notice shall be included in all
13d4401354Smrgcopies or substantial portions of the Software.
14d4401354Smrg
15d4401354SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16d4401354SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17d4401354SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18d4401354SmrgAUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19d4401354SmrgACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20d4401354SmrgWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21d4401354Smrg
22d4401354SmrgExcept as contained in this notice, the names of the authors or their
23d4401354Smrginstitutions shall not be used in advertising or otherwise to promote the
24d4401354Smrgsale, use or other dealings in this Software without prior written
25d4401354Smrgauthorization from the authors.
26d4401354Smrg-->
27d4401354Smrg<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
28d4401354Smrg
29d4401354Smrg  <!-- The root element -->
30d4401354Smrg  <xsd:element name="xcb">
31d4401354Smrg    <xsd:complexType>
32d4401354Smrg      <xsd:group ref="macro" minOccurs="0" maxOccurs="unbounded" />
33d4401354Smrg      <xsd:attribute name="header" type="xsd:string" use="required" />
34d4401354Smrg      <xsd:attribute name="extension-xname" type="xsd:string" use="optional" />
35d4401354Smrg      <xsd:attribute name="extension-name"  type="xsd:string" use="optional" />
36d4401354Smrg      <xsd:attribute name="extension-multiword" type="xsd:boolean" use="optional" default="false" />
37d4401354Smrg      <xsd:attribute name="major-version"   type="xsd:integer" use="optional" />
38d4401354Smrg      <xsd:attribute name="minor-version"   type="xsd:integer" use="optional" />
39d4401354Smrg    </xsd:complexType>
40d4401354Smrg  </xsd:element>
41d4401354Smrg
42d4401354Smrg  <!-- Padding -->
43d4401354Smrg  <xsd:element name="pad">
44d4401354Smrg    <xsd:complexType>
45d4401354Smrg      <xsd:attribute name="bytes" type="xsd:integer" use="required" />
46d4401354Smrg    </xsd:complexType>
47d4401354Smrg  </xsd:element>
48d4401354Smrg
49d4401354Smrg  <!-- Type for fields or parameters with attributes "name" and "type" -->
50d4401354Smrg  <xsd:complexType name="var">
51d4401354Smrg    <xsd:attribute name="name" type="xsd:string" use="required" />
52d4401354Smrg    <xsd:attribute name="type" type="xsd:string" use="required" />
53d4401354Smrg    <xsd:attribute name="enum" type="xsd:string" use="optional" />
54d4401354Smrg    <xsd:attribute name="altenum" type="xsd:string" use="optional" />
55d4401354Smrg    <xsd:attribute name="mask" type="xsd:string" use="optional" />
56d4401354Smrg  </xsd:complexType>
57d4401354Smrg
58d4401354Smrg  <!-- field replaces FIELD, PARAM, and REPLY. -->
59d4401354Smrg  <xsd:element name="field" type="var" />
60d4401354Smrg
61d4401354Smrg  <!-- list replaces ARRAYFIELD, LISTPARAM, and ARRAYREPLY.  The name and type
62d4401354Smrg       are specified as attributes.  The content is an expression giving the
63d4401354Smrg       length. -->
64d4401354Smrg  <xsd:element name="list">
65d4401354Smrg    <xsd:complexType>
66d4401354Smrg      <xsd:complexContent>
67d4401354Smrg        <xsd:extension base="var">
68d4401354Smrg          <xsd:group ref="expression" minOccurs="0" maxOccurs="1" />
69d4401354Smrg        </xsd:extension>
70d4401354Smrg      </xsd:complexContent>
71d4401354Smrg    </xsd:complexType>
72d4401354Smrg  </xsd:element>
73d4401354Smrg
74d4401354Smrg  <!-- Expressions -->
75d4401354Smrg  <xsd:group name="expression">
76d4401354Smrg    <xsd:choice>
77d4401354Smrg      <xsd:element name="op">
78d4401354Smrg        <xsd:complexType>
79d4401354Smrg          <xsd:sequence>
80d4401354Smrg            <xsd:group ref="expression" />
81d4401354Smrg            <xsd:group ref="expression" />
82d4401354Smrg          </xsd:sequence>
83d4401354Smrg          <xsd:attribute name="op" use="required">
84d4401354Smrg            <xsd:simpleType>
85d4401354Smrg              <xsd:restriction base="xsd:string">
86d4401354Smrg                <xsd:pattern value="\+|-|\*|/|&amp;|&lt;&lt;" />
87d4401354Smrg              </xsd:restriction>
88d4401354Smrg            </xsd:simpleType>
89d4401354Smrg          </xsd:attribute>
90d4401354Smrg        </xsd:complexType>
91d4401354Smrg      </xsd:element>
92d4401354Smrg      <xsd:element name="fieldref" type="xsd:string" />
93d4401354Smrg      <xsd:element name="value" type="dec-or-hex-integer" />
94d4401354Smrg      <xsd:element name="bit" type="xsd:integer" />
95d4401354Smrg    </xsd:choice>
96d4401354Smrg  </xsd:group>
97d4401354Smrg  
98d4401354Smrg  <!-- Fields in requests that are calculated from other information, not
99d4401354Smrg       supplied by the caller. -->
100d4401354Smrg  <xsd:element name="exprfield" >
101d4401354Smrg    <xsd:complexType>
102d4401354Smrg      <xsd:complexContent>
103d4401354Smrg        <xsd:extension base="var">
104d4401354Smrg          <xsd:group ref="expression" />
105d4401354Smrg        </xsd:extension>
106d4401354Smrg      </xsd:complexContent>
107d4401354Smrg    </xsd:complexType>
108d4401354Smrg  </xsd:element>
109d4401354Smrg
110d4401354Smrg  <!-- BITMASK/LISTofVALUE parameter pairs. -->
111d4401354Smrg  <xsd:element name="valueparam">
112d4401354Smrg    <xsd:complexType>
113d4401354Smrg      <xsd:attribute name="value-mask-type" type="xsd:string" use="required" />
114d4401354Smrg      <xsd:attribute name="value-mask-name" type="xsd:string" use="required" />
115d4401354Smrg      <xsd:attribute name="value-list-name" type="xsd:string" use="required" />
116d4401354Smrg    </xsd:complexType>
117d4401354Smrg  </xsd:element>
118d4401354Smrg
119d4401354Smrg  <xsd:group name="fields">
120d4401354Smrg    <xsd:choice>
121d4401354Smrg      <xsd:element ref="pad" />
122d4401354Smrg      <xsd:element ref="field" />
123d4401354Smrg      <xsd:element ref="list" />
124d4401354Smrg    </xsd:choice>
125d4401354Smrg  </xsd:group>
126d4401354Smrg
127d4401354Smrg  <!-- Type for a structure -->
128d4401354Smrg  <xsd:complexType name="struct">
129d4401354Smrg    <xsd:group ref="fields" minOccurs="1" maxOccurs="unbounded" />
130d4401354Smrg    <xsd:attribute name="name" type="xsd:string" use="required" />
131d4401354Smrg  </xsd:complexType>
132d4401354Smrg
133d4401354Smrg  <!-- Type for a packet structure -->
134d4401354Smrg  <xsd:complexType name="packet-struct">
135d4401354Smrg    <xsd:group ref="fields" minOccurs="0" maxOccurs="unbounded" />
136d4401354Smrg    <xsd:attribute name="name" type="xsd:string" use="required" />
137d4401354Smrg    <xsd:attribute name="number" type="xsd:integer" use="required" />
138d4401354Smrg  </xsd:complexType>
139d4401354Smrg
140d4401354Smrg  <!-- Type for a packet structure copy -->
141d4401354Smrg  <xsd:complexType name="packet-struct-copy">
142d4401354Smrg    <xsd:attribute name="name" type="xsd:string" use="required" />
143d4401354Smrg    <xsd:attribute name="number" type="xsd:integer" use="required" />
144d4401354Smrg    <xsd:attribute name="ref" type="xsd:string" use="required" />
145d4401354Smrg  </xsd:complexType>
146d4401354Smrg
147d4401354Smrg  <!-- Type for hex integers -->
148d4401354Smrg  <xsd:simpleType name="hex-integer">
149d4401354Smrg    <xsd:restriction base="xsd:string">
150d4401354Smrg      <xsd:pattern value="0x[0-9a-fA-F]+" />
151d4401354Smrg    </xsd:restriction>
152d4401354Smrg  </xsd:simpleType>
153d4401354Smrg
154d4401354Smrg  <!-- Type for integers in either decimal or hex -->
155d4401354Smrg  <xsd:simpleType name="dec-or-hex-integer">
156d4401354Smrg    <xsd:union memberTypes="xsd:integer hex-integer" />
157d4401354Smrg  </xsd:simpleType>
158d4401354Smrg
159d4401354Smrg  <xsd:group name="macro">
160d4401354Smrg    <xsd:choice>
161d4401354Smrg      <xsd:element name="request">
162d4401354Smrg        <xsd:complexType>
163d4401354Smrg          <xsd:sequence>
164d4401354Smrg            <xsd:choice minOccurs="0" maxOccurs="unbounded">
165d4401354Smrg              <xsd:group ref="fields" />
166d4401354Smrg              <xsd:element ref="exprfield" />
167d4401354Smrg              <xsd:element ref="valueparam" />
168d4401354Smrg            </xsd:choice>
169d4401354Smrg            <xsd:element name="reply" minOccurs="0" maxOccurs="1">
170d4401354Smrg              <xsd:complexType>
171d4401354Smrg                <xsd:choice minOccurs="1" maxOccurs="unbounded">
172d4401354Smrg                  <xsd:group ref="fields" />
173d4401354Smrg                  <xsd:element ref="valueparam" />
174d4401354Smrg                </xsd:choice>
175d4401354Smrg              </xsd:complexType>
176d4401354Smrg            </xsd:element>
177d4401354Smrg          </xsd:sequence>
178d4401354Smrg          <xsd:attribute name="name" type="xsd:string" use="required" />
179d4401354Smrg          <xsd:attribute name="opcode" type="xsd:integer" use="required" />
180d4401354Smrg          <xsd:attribute name="combine-adjacent" type="xsd:boolean"
181d4401354Smrg                         use="optional"/>
182d4401354Smrg        </xsd:complexType>
183d4401354Smrg      </xsd:element>
184d4401354Smrg      <xsd:element name="event">
185d4401354Smrg        <xsd:complexType>
186d4401354Smrg          <xsd:complexContent>
187d4401354Smrg            <xsd:extension base="packet-struct">
188d4401354Smrg              <xsd:attribute name="no-sequence-number" type="xsd:boolean"
189d4401354Smrg                             use="optional" />
190d4401354Smrg            </xsd:extension>
191d4401354Smrg          </xsd:complexContent>
192d4401354Smrg        </xsd:complexType>
193d4401354Smrg      </xsd:element>
194d4401354Smrg      <xsd:element name="eventcopy" type="packet-struct-copy" />
195d4401354Smrg      <xsd:element name="error" type="packet-struct" />
196d4401354Smrg      <xsd:element name="errorcopy" type="packet-struct-copy" />
197d4401354Smrg      <xsd:element name="struct" type="struct" />
198d4401354Smrg      <xsd:element name="union" type="struct" />
199d4401354Smrg      <xsd:element name="xidtype">
200d4401354Smrg        <xsd:complexType>
201d4401354Smrg          <xsd:attribute name="name" type="xsd:string" use="required" />
202d4401354Smrg        </xsd:complexType>
203d4401354Smrg      </xsd:element>
204d4401354Smrg      <xsd:element name="xidunion">
205d4401354Smrg        <xsd:complexType>
206d4401354Smrg          <xsd:sequence>
207d4401354Smrg            <xsd:element name="type" type="xsd:string"
208d4401354Smrg                         minOccurs="1" maxOccurs="unbounded" />
209d4401354Smrg          </xsd:sequence>
210d4401354Smrg          <xsd:attribute name="name" type="xsd:string" use="required" />
211d4401354Smrg        </xsd:complexType>
212d4401354Smrg      </xsd:element>
213d4401354Smrg      <xsd:element name="enum">
214d4401354Smrg        <xsd:complexType>
215d4401354Smrg          <xsd:sequence minOccurs="1" maxOccurs="unbounded">
216d4401354Smrg            <xsd:element name="item">
217d4401354Smrg              <xsd:complexType>
218d4401354Smrg                <xsd:group ref="expression" minOccurs="0" maxOccurs="1" />
219d4401354Smrg                <xsd:attribute name="name" type="xsd:string" use="required" />
220d4401354Smrg              </xsd:complexType>
221d4401354Smrg            </xsd:element>
222d4401354Smrg          </xsd:sequence>
223d4401354Smrg          <xsd:attribute name="name" type="xsd:string" use="required" />
224d4401354Smrg        </xsd:complexType>
225d4401354Smrg      </xsd:element>
226d4401354Smrg      <xsd:element name="typedef">
227d4401354Smrg        <xsd:complexType>
228d4401354Smrg          <xsd:attribute name="oldname" type="xsd:string" use="required" />
229d4401354Smrg          <xsd:attribute name="newname" type="xsd:string" use="required" />
230d4401354Smrg        </xsd:complexType>
231d4401354Smrg      </xsd:element>
232d4401354Smrg      <!-- The import element allows a protocol description to reference the
233d4401354Smrg           declarations of another protocol description. -->
234d4401354Smrg      <xsd:element name="import" type="xsd:string" />
235d4401354Smrg    </xsd:choice>
236d4401354Smrg  </xsd:group>
237d4401354Smrg</xsd:schema>
238