1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
5 <!-- lifted from troff+ms+XMan by doclifter -->
9 <title>XC-MISC Extension</title>
10 <subtitle>X Consortium Standard</subtitle>
11 <releaseinfo>X Version 11, Release 6.9/7.0</releaseinfo>
14 <firstname>Bob</firstname><surname>Scheifler</surname>
17 <firstname>David</firstname><surname>Wiggins</surname>
19 <corpauthor>X Consortium</corpauthor>
21 <copyright><year>1994</year><holder>X Consortium</holder></copyright>
22 <releaseinfo>Version 1.1</releaseinfo>
23 <affiliation><orgname>X Consortium</orgname></affiliation>
24 <productnumber>X Version 11, Release 6.9/7.0</productnumber>
28 <para>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</para>
30 <para>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</para>
32 <para>THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</para>
34 <para>Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from the X Consortium.</para>
36 <para>X Window System is a trademark of The Open Group.</para>
41 <chapter id='overview'>
42 <title>Overview</title>
44 <para>When an X client connects to an X server, it receives a fixed range of
45 resource IDs to use to identify the client's resources inside the X
46 server. Xlib hands these out sequentially as needed. When it
47 overruns the end of the range, an IDChoice protocol error results.
48 Long running clients, or clients that use resource IDs at a rapid
49 rate, may encounter this circumstance. When it happens, there are
50 usually many resource IDs available, but Xlib doesn't know about them.</para>
52 <para>One approach to solving this problem would be to have Xlib notice when
53 a resource is freed and recycle its ID for future use. This strategy
54 runs into difficulties because sometimes freeing one resource causes
55 others to be freed (for example, when a window is destroyed, so are
56 its children). To do a complete job, Xlib would have to maintain a
57 large amount of state that currently resides only in the server (the
58 entire window tree in the above example). Even if a less
59 comprehensive strategy was adopted, such as recycling only those IDs
60 that Xlib can identify without maintaining additional state, the
61 additional bookkeeping at resource creation and destruction time
62 would likely introduce unacceptable overhead.</para>
64 <para>To avoid the problems listed above, the server's complete knowledge of
65 all resource IDs in use by a client is leveraged. This extension
66 provides two ways for Xlib to query the server for available resource
67 IDs. Xlib can use these extension requests behind the scenes when it has
68 exhausted its current pool of resource IDs.</para>
71 <chapter id='requests'>
72 <title>Requests</title>
75 <function>XCMiscGetVersion</function></para>
78 <listitem><para><parameter>client_major_version</parameter>: CARD16</para></listitem>
79 <listitem><para><parameter>client_minor_version</parameter>: CARD16</para></listitem>
83 <listitem><para><parameter>client_major_version</parameter>: CARD16</para></listitem>
84 <listitem><para><parameter>client_minor_version</parameter>: CARD16</para></listitem>
87 <para>If supplied, the <parameter>client_major_version</parameter> and
88 <parameter>client_minor_version</parameter> indicate what version of
89 the protocol the client wants the server to implement. The server version
90 numbers returned indicate the protocol this extension actually supports. This
91 might not equal the version sent by the client. An implementation can
92 (but need not) support more than one version simultaneously. The
93 <parameter>server_major_version</parameter> and the <parameter>server_minor_version</parameter> are a
94 mechanism to support future revisions of the XC-MISC protocol
95 which may be necessary. In general, the major version would increment
96 for incompatible changes, and the minor version would increment for
97 small, upward-compatible changes. Servers that support the protocol
98 defined in this document will return a
99 <parameter>server_major_version</parameter> of one (1), and a
100 <parameter>server_minor_version</parameter> of one (1).</para>
102 <para><function>XCMiscGetXIDRange</function></para>
106 <listitem><para><parameter>start_id</parameter>: XID</para></listitem>
107 <listitem><para><parameter>count</parameter>: CARD32</para></listitem>
110 <para>This request returns a range of available resource IDs for the client
111 issuing the request. <parameter>start_id</parameter> is the first
112 ID in the range. <parameter>count</parameter> is the number of IDs
113 in the range. The returned range may or may not be the largest possible
116 <para><function>XCMiscGetXIDList</function></para>
119 <listitem><para><parameter>count</parameter>: CARD32</para></listitem>
123 <listitem><para><parameter>ids</parameter>: LISTofXID</para></listitem>
126 <para>This request returns the a list of individual resource IDs in
127 <parameter>ids</parameter>.
128 <parameter>count</parameter> is the number of resource IDs requested.
129 The number returned may be smaller than the number requested.</para>
132 <chapter id='events_and_errors'>
133 <title>Events and Errors</title>
135 <para>No new events or errors are defined by this extension.</para>
138 <chapter id='encoding'>
139 <title>Encoding</title>
141 <para>Please refer to the X11 Protocol Encoding document as this document uses
142 conventions established there.</para>
144 <para>The name of this extension is “XC-MISC”.</para>
147 <function>XCMiscGetVersion</function>
151 2 CARD16 client_major_version
152 2 CARD16 client_minor_version
157 2 CARD16 sequence number
159 2 CARD16 server_major_version
160 2 CARD16 server_minor_version
165 <function>XCMiscGetXIDRange</function>
173 2 CARD16 sequence number
182 <function>XCMiscGetXIDList</function>
191 2 CARD16 sequence number
193 4 CARD32 number of XIDs in ids