Lines Matching refs:cache
64 /* Empty cache (for rehash) */
66 EmptyFontPatternCache (FontPatternCachePtr cache)
71 cache->buckets[i] = 0;
74 cache->entries[i].next = &cache->entries[i+1];
75 cache->entries[i].prev = 0;
76 cache->entries[i].pFont = 0;
77 free ((void *) cache->entries[i].pattern);
78 cache->entries[i].pattern = 0;
79 cache->entries[i].patlen = 0;
81 cache->free = &cache->entries[0];
82 cache->entries[NENTRIES - 1].next = 0;
85 /* Create and initialize cache */
89 FontPatternCachePtr cache;
91 cache = malloc (sizeof *cache);
92 if (!cache)
95 cache->entries[i].patlen = 0;
96 cache->entries[i].pattern = 0;
97 cache->entries[i].pFont = 0;
99 EmptyFontPatternCache (cache);
100 return cache;
103 /* toss cache */
105 FreeFontPatternCache (FontPatternCachePtr cache)
110 free ((void *) cache->entries[i].pattern);
111 free (cache);
130 CacheFontPattern (FontPatternCachePtr cache,
142 if (cache->free)
144 e = cache->free;
145 cache->free = e->next;
153 e = &cache->entries[i];
166 e->next = cache->buckets[i];
169 cache->buckets[i] = e;
170 e->prev = &(cache->buckets[i]);
176 FindCachedFontPattern (FontPatternCachePtr cache,
186 for (e = cache->buckets[i]; e; e = e->next)
198 RemoveCachedFontPattern (FontPatternCachePtr cache,
206 if ((e = &cache->entries[i])->pFont == pFont)
212 e->next = cache->free;
213 cache->free = e;