1
/* $Xorg: resource.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */
5
Copyright 1995, 1998 The Open Group
7
Permission to use, copy, modify, distribute, and sell this software and its
8
documentation for any purpose is hereby granted without fee, provided that
9
the above copyright notice appear in all copies and that both that
10
copyright notice and this permission notice appear in supporting
13
The above copyright notice and this permission notice shall be
14
included in all copies or substantial portions of the Software.
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
OTHER DEALINGS IN THE SOFTWARE.
24
Except as contained in this notice, the name of The Open Group shall
25
not be used in advertising or otherwise to promote the sale, use or
26
other dealings in this Software without prior written authorization
34
#define RT_COLORMAP ((RESTYPE)1)
35
#define RT_CMAPENTRY ((RESTYPE)2)
36
#define RT_LASTPREDEF ((RESTYPE)2)
37
#define RT_NONE ((RESTYPE)0)
39
#define RC_NEVERRETAIN ((RESTYPE)1<<29)
40
#define RC_LASTPREDEF RC_NEVERRETAIN
41
#define RC_ANY (~(RESTYPE)0)
43
typedef unsigned long RESTYPE;
45
typedef struct _Resource {
46
struct _Resource *next;
50
} ResourceRec, *ResourcePtr;
51
#define NullResource ((ResourcePtr)NULL)
53
typedef struct _ClientResource {
54
ResourcePtr *resources;
57
int hashsize; /* log(2)(buckets) */
63
/* bits and fields within a resource id */
64
#define PROXY_BIT 0x40000000 /* use illegal bit */
66
typedef int (*DeleteType)(
67
#if NeedNestedPrototypes
74
extern Bool InitDeleteFuncs(
75
#if NeedFunctionPrototypes
80
extern Bool InitClientResources(
81
#if NeedFunctionPrototypes
86
extern void FinishInitClientResources(
87
#if NeedFunctionPrototypes
94
extern XID FakeClientID(
95
#if NeedFunctionPrototypes
100
extern Bool AddResource(
101
#if NeedFunctionPrototypes
102
ClientPtr /*client*/,
109
extern void FreeResource(
110
#if NeedFunctionPrototypes
111
ClientPtr /*client*/,
113
RESTYPE /*skipDeleteFuncType*/
117
extern void FreeClientResources(
118
#if NeedFunctionPrototypes
123
extern void FreeAllResources(
124
#if NeedFunctionPrototypes
129
extern pointer LookupIDByType(
130
#if NeedFunctionPrototypes
131
ClientPtr /*client*/,