1
/* $Xorg: cache.h,v 1.4 2001/02/09 02:05:32 xorgcvs Exp $ */
3
Copyright 1994, 1998 The Open Group
5
Permission to use, copy, modify, distribute, and sell this software and its
6
documentation for any purpose is hereby granted without fee, provided that
7
the above copyright notice appear in all copies and that both that
8
copyright notice and this permission notice appear in supporting
11
The above copyright notice and this permission notice shall be
12
included in all copies or substantial portions of the Software.
14
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
18
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20
OTHER DEALINGS IN THE SOFTWARE.
22
Except as contained in this notice, the name of The Open Group shall
23
not be used in advertising or otherwise to promote the sale, use or
24
other dealings in this Software without prior written authorization
29
* Copyright 1990, 1991 Network Computing Devices;
30
* Portions Copyright 1987 by Digital Equipment Corporation
32
* Permission to use, copy, modify, distribute, and sell this software and its
33
* documentation for any purpose is hereby granted without fee, provided that
34
* the above copyright notice appear in all copies and that both that
35
* copyright notice and this permission notice appear in supporting
36
* documentation, and that the names of Network Computing Devices
37
* or Digital not be used in advertising or
38
* publicity pertaining to distribution of the software without specific,
39
* written prior permission. Network Computing Devices and Digital
40
* make no representations about the
41
* suitability of this software for any purpose. It is provided "as is"
42
* without express or implied warranty.
44
* NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH
45
* REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
46
* AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES OR DIGITAL BE
47
* LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
48
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
49
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
50
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
57
#define CacheWasReset 1
58
#define CacheEntryFreed 2
59
#define CacheEntryOld 3
61
#define MAX_NUM_CACHES 2
63
typedef unsigned long CacheID;
64
typedef unsigned long Cache;
65
typedef void (*CacheFree) ();
67
typedef struct _cache *CachePtr;
69
extern Cache CacheInit(
70
#if NeedFunctionPrototypes
71
XServerPtr /*server*/,
72
unsigned long /*maxsize*/
76
extern void CacheFreeCache(
77
#if NeedFunctionPrototypes
78
XServerPtr /*server*/,
83
extern Bool CacheTrimNeeded(
84
#if NeedFunctionPrototypes
85
XServerPtr /*server*/,
90
extern void CacheTrim(
91
#if NeedFunctionPrototypes
92
XServerPtr /*server*/,
97
extern Bool CacheStoreMemory(
98
#if NeedFunctionPrototypes
99
XServerPtr /*server*/,
103
unsigned long /*size*/,
104
CacheFree /*free_func*/,
109
extern pointer CacheFetchMemory(
110
#if NeedFunctionPrototypes
111
XServerPtr /*server*/,
118
extern void CacheFreeMemory(
119
#if NeedFunctionPrototypes
120
XServerPtr /*server*/,
127
#endif /* _CACHE_H_ */