summaryrefslogtreecommitdiff
path: root/src/fcfs.c
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2013-12-05 19:15:47 +0900
committerAkira TAGOH <akira@tagoh.org>2013-12-20 11:57:16 +0900
commit7a6622f25cdfab5ab775324bef1833b67109801b (patch)
treeb86ccd5635d4171da698caf3d7c47fed5d10cc36 /src/fcfs.c
parent5c725f2f5829238d16116f782d00d8bb0defaf08 (diff)
downloadfontconfig-7a6622f25cdfab5ab775324bef1833b67109801b.tar.gz
Improve the performance issue on rescanning directories
Diffstat (limited to 'src/fcfs.c')
-rw-r--r--src/fcfs.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/fcfs.c b/src/fcfs.c
index 941abba..21c6c7c 100644
--- a/src/fcfs.c
+++ b/src/fcfs.c
@@ -122,6 +122,28 @@ FcFontSetSerialize (FcSerialize *serialize, const FcFontSet * s)
return s_serialize;
}
+
+FcFontSet *
+FcFontSetDeserialize (const FcFontSet *set)
+{
+ int i;
+ FcFontSet *new = FcFontSetCreate ();
+
+ if (!new)
+ return NULL;
+ for (i = 0; i < set->nfont; i++)
+ {
+ if (!FcFontSetAdd (new, FcPatternDuplicate (FcFontSetFont (set, i))))
+ goto bail;
+ }
+
+ return new;
+bail:
+ FcFontSetDestroy (new);
+
+ return NULL;
+}
+
#define __fcfs__
#include "fcaliastail.h"
#undef __fcfs__