s->cache = cache;
s->size = cache->size;
s->ref = 1;
- s->cache_dev = cache_stat->st_dev;
- s->cache_ino = cache_stat->st_ino;
- s->cache_mtime = cache_stat->st_mtime;
+ if (cache_stat)
+ {
+ s->cache_dev = cache_stat->st_dev;
+ s->cache_ino = cache_stat->st_ino;
+ s->cache_mtime = cache_stat->st_mtime;
+ }
+ else
+ {
+ s->cache_dev = 0;
+ s->cache_ino = 0;
+ s->cache_mtime = 0;
+ }
/*
* Insert into all fcCacheChains
update[i] = &next[i];
}
s = next[0];
- assert (s->cache == cache);
for (i = 0; i < fcCacheMaxLevel && *update[i] == s; i++)
*update[i] = s->next[i];
while (fcCacheMaxLevel > 0 && fcCacheChains[fcCacheMaxLevel - 1] == NULL)
if (s->cache_dev == cache_stat->st_dev &&
s->cache_ino == cache_stat->st_ino &&
s->cache_mtime == cache_stat->st_mtime)
+ {
+ s->ref++;
return s->cache;
+ }
return NULL;
}
return cache;
}
+void
+FcDirCacheReference (FcCache *cache, int nref)
+{
+ FcCacheSkip *skip = FcCacheFindByAddr (cache);
+
+ if (skip)
+ skip->ref += nref;
+}
+
void
FcDirCacheUnload (FcCache *cache)
{
FcSerializeDestroy (serialize);
+ FcCacheInsert (cache, NULL);
+
return cache;
bail2:
if (!new)
return NULL;
for (i = 0; i < old->nfont; i++)
- if (!FcFontSetAdd (new, FcFontSetFont (old, i)))
+ {
+ FcPattern *font = FcFontSetFont (old, i);
+
+ FcPatternReference (font);
+ if (!FcFontSetAdd (new, font))
{
FcFontSetDestroy (new);
return NULL;
}
+ }
return new;
}
buf[2] += c;
buf[3] += d;
}
+#define __fccache__
+#include "fcaliastail.h"
+#undef __fccache__