8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/***********************************************************
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncCopyright 1987, 1989, 1998 The Open Group
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncPermission to use, copy, modify, distribute, and sell this software and its
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncdocumentation for any purpose is hereby granted without fee, provided that
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncthe above copyright notice appear in all copies and that both that
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsynccopyright notice and this permission notice appear in supporting
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncdocumentation.
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncThe above copyright notice and this permission notice shall be included in
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncall copies or substantial portions of the Software.
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncExcept as contained in this notice, the name of The Open Group shall not be
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncused in advertising or otherwise to promote the sale, use or other dealings
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncin this Software without prior written authorization from The Open Group.
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncCopyright 1987, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync All Rights Reserved
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncPermission to use, copy, modify, and distribute this software and its
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncdocumentation for any purpose and without fee is hereby granted,
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncprovided that the above copyright notice appear in all copies and that
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncboth that copyright notice and this permission notice appear in
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncsupporting documentation, and that the name of Digital not be
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncused in advertising or publicity pertaining to distribution of the
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncsoftware without specific, written prior permission.
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync******************************************************************/
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/*****************************************************************
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * STUFF FOR RESOURCES
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync *****************************************************************/
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/* classes for Resource routines */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/* Use class RC_NEVERRETAIN for resources that should not be retained
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * regardless of the close down mode when the client dies. (A client's
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * event selections on objects that it doesn't own are good candidates.)
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * Extensions can use this too!
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/* types for Resource routines */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/* bits and fields within a resource id */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync#define RESOURCE_AND_CLIENT_COUNT 29 /* 29 bits for XIDs */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/* client field offset */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync#define CLIENTOFFSET (RESOURCE_AND_CLIENT_COUNT - RESOURCE_CLIENT_BITS)
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/* resource field */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/* client field */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync#define RESOURCE_CLIENT_MASK (((1 << RESOURCE_CLIENT_BITS) - 1) << CLIENTOFFSET)
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/* extract the client mask from an XID */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync#define CLIENT_BITS(id) ((id) & RESOURCE_CLIENT_MASK)
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/* extract the client id from an XID */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync#define CLIENT_ID(id) ((int)(CLIENT_BITS(id) >> CLIENTOFFSET))
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync#define SERVER_BIT (Mask)0x40000000 /* use illegal bit */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/* Invalid resource id */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync#define rClient(obj) (clients[CLIENT_ID((obj)->resource)])
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/* Resource state callback */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncextern _X_EXPORT CallbackListPtr ResourceStateCallback;
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsynctypedef struct {
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncextern _X_EXPORT RESTYPE CreateNewResourceClass(void);
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync int /*client*/);
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/* Quartz support on Mac OS X uses the CarbonCore
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync framework whose AddResource function conflicts here. */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncextern _X_EXPORT void FreeClientNeverRetainResources(
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsyncextern _X_EXPORT pointer LookupClientResourceComplex(
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync int /*client*/,
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync unsigned int /*count*/,
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * These are deprecated compatibility functions and will be removed soon!
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync * Please use the noted replacements instead.
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/* replaced by dixLookupResourceByType */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/* replaced by dixLookupResourceByClass */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/* replaced by dixLookupResourceByType */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync/* replaced by dixLookupResourceByClass */
8c3d541c7ee7442f570b22eca3d82808b35b0385vboxsync#endif /* RESOURCE_H */