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