1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
3 "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
5 <!ENTITY % defs SYSTEM "defs.ent"> %defs;
8 <!-- lifted from troff+ms+XMan by doclifter -->
12 <title>XC-MISC Extension</title>
13 <subtitle>X Consortium Standard</subtitle>
16 <firstname>Bob</firstname><surname>Scheifler</surname>
17 <affiliation><orgname>X Consortium</orgname></affiliation>
20 <firstname>David</firstname><othername>P.</othername><surname>Wiggins</surname>
21 <affiliation><orgname>X Consortium</orgname></affiliation>
24 <releaseinfo>X Version 11, Release &fullrelvers;</releaseinfo>
25 <releaseinfo>Version 1.1</releaseinfo>
26 <copyright><year>1994</year><holder>X Consortium</holder></copyright>
30 <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>
32 <para>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</para>
34 <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>
36 <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>
38 <para>X Window System is a trademark of The Open Group.</para>
43 <chapter id='Overview'>
44 <title>Overview</title>
46 <para>When an X client connects to an X server, it receives a fixed range of
47 resource IDs to use to identify the client's resources inside the X
48 server. Xlib hands these out sequentially as needed. When it
49 overruns the end of the range, an IDChoice protocol error results.
50 Long running clients, or clients that use resource IDs at a rapid
51 rate, may encounter this circumstance. When it happens, there are
52 usually many resource IDs available, but Xlib doesn't know about them.</para>
54 <para>One approach to solving this problem would be to have Xlib notice when
55 a resource is freed and recycle its ID for future use. This strategy
56 runs into difficulties because sometimes freeing one resource causes
57 others to be freed (for example, when a window is destroyed, so are
58 its children). To do a complete job, Xlib would have to maintain a
59 large amount of state that currently resides only in the server (the
60 entire window tree in the above example). Even if a less
61 comprehensive strategy was adopted, such as recycling only those IDs
62 that Xlib can identify without maintaining additional state, the
63 additional bookkeeping at resource creation and destruction time
64 would likely introduce unacceptable overhead.</para>
66 <para>To avoid the problems listed above, the server's complete knowledge of
67 all resource IDs in use by a client is leveraged. This extension
68 provides two ways for Xlib to query the server for available resource
69 IDs. Xlib can use these extension requests behind the scenes when it has
70 exhausted its current pool of resource IDs.</para>
73 <chapter id='Requests'>
74 <title>Requests</title>
77 <function>XCMiscGetVersion</function></para>
80 <listitem><para><parameter>client_major_version</parameter>: CARD16</para></listitem>
81 <listitem><para><parameter>client_minor_version</parameter>: CARD16</para></listitem>
85 <listitem><para><parameter>client_major_version</parameter>: CARD16</para></listitem>
86 <listitem><para><parameter>client_minor_version</parameter>: CARD16</para></listitem>
89 <para>If supplied, the <parameter>client_major_version</parameter> and
90 <parameter>client_minor_version</parameter> indicate what version of
91 the protocol the client wants the server to implement. The server version
92 numbers returned indicate the protocol this extension actually supports. This
93 might not equal the version sent by the client. An implementation can
94 (but need not) support more than one version simultaneously. The
95 <parameter>server_major_version</parameter> and the <parameter>server_minor_version</parameter> are a
96 mechanism to support future revisions of the XC-MISC protocol
97 which may be necessary. In general, the major version would increment
98 for incompatible changes, and the minor version would increment for
99 small, upward-compatible changes. Servers that support the protocol
100 defined in this document will return a
101 <parameter>server_major_version</parameter> of one (1), and a
102 <parameter>server_minor_version</parameter> of one (1).</para>
104 <para><function>XCMiscGetXIDRange</function></para>
108 <listitem><para><parameter>start_id</parameter>: XID</para></listitem>
109 <listitem><para><parameter>count</parameter>: CARD32</para></listitem>
112 <para>This request returns a range of available resource IDs for the client
113 issuing the request. <parameter>start_id</parameter> is the first
114 ID in the range. <parameter>count</parameter> is the number of IDs
115 in the range. The returned range may or may not be the largest possible
118 <para><function>XCMiscGetXIDList</function></para>
121 <listitem><para><parameter>count</parameter>: CARD32</para></listitem>
125 <listitem><para><parameter>ids</parameter>: LISTofXID</para></listitem>
128 <para>This request returns the a list of individual resource IDs in
129 <parameter>ids</parameter>.
130 <parameter>count</parameter> is the number of resource IDs requested.
131 The number returned may be smaller than the number requested.</para>
134 <chapter id='Events_and_Errors'>
135 <title>Events and Errors</title>
137 <para>No new events or errors are defined by this extension.</para>
140 <chapter id='Encoding'>
141 <title>Encoding</title>
143 <para>Please refer to the X11 Protocol Encoding document as this document uses
144 conventions established there.</para>
146 <para>The name of this extension is “XC-MISC”.</para>
149 <function>XCMiscGetVersion</function>
153 2 CARD16 client_major_version
154 2 CARD16 client_minor_version
159 2 CARD16 sequence number
161 2 CARD16 server_major_version
162 2 CARD16 server_minor_version
167 <function>XCMiscGetXIDRange</function>
175 2 CARD16 sequence number
184 <function>XCMiscGetXIDList</function>
193 2 CARD16 sequence number
195 4 CARD32 number of XIDs in ids