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