{
}
+int FcDebugVal;
+
FcChar8 *
FcConfigHome (void)
{
* Comments begin with '#'
*/
-static FcCharSet *
-scan (FILE *f, char *file)
+static const FcCharSet *
+scan (FILE *f, char *file, FcCharSetFreezer *freezer)
{
- FcCharSet *c = 0;
- FcCharSet *n;
- int start, end, ucs4;
- char line[1024];
- int lineno = 0;
+ FcCharSet *c = 0;
+ const FcCharSet *n;
+ int start, end, ucs4;
+ char line[1024];
+ int lineno = 0;
while (get_line (f, line, &lineno))
{
f = scanopen (file);
if (!f)
fatal (file, 0, "can't open");
- c = scan (f, file);
+ n = scan (f, file, freezer);
fclose (f);
- return c;
+ return n;
}
if (strchr (line, '-'))
{
fatal (file, lineno, "out of memory");
}
}
- n = FcCharSetFreeze (c);
+ n = FcCharSetFreeze (freezer, c);
FcCharSetDestroy (c);
return n;
}
main (int argc, char **argv)
{
static char *files[MAX_LANG];
- static FcCharSet *sets[MAX_LANG];
+ static const FcCharSet *sets[MAX_LANG];
static int duplicate[MAX_LANG];
static int country[MAX_LANG];
static char *names[MAX_LANG];
int setRangeStart[26];
int setRangeEnd[26];
FcChar8 setRangeChar;
+ FcCharSetFreezer *freezer;
+ freezer = FcCharSetFreezerCreate ();
+ if (!freezer)
+ fatal (argv[0], 0, "out of memory");
argi = 1;
while (argv[argi])
{
f = scanopen (files[i]);
if (!f)
fatal (files[i], 0, strerror (errno));
- sets[i] = scan (f, files[i]);
+ sets[i] = scan (f, files[i], freezer);
names[i] = get_name (files[i]);
langs[i] = get_lang(names[i]);
if (strchr (langs[i], '-'))
return NULL;
}
-static const FcCharSet *
+const FcCharSet *
FcCharSetFreeze (FcCharSetFreezer *freezer, const FcCharSet *fcs)
{
FcCharSet *b;
FcCharLeaf *l;
int i;
- n = FcCharSetFindFrozen (freezer, fcs);
- if (n)
- return n;
-
b = FcCharSetCreate ();
if (!b)
goto bail0;
return n;
}
-static FcCharSetFreezer *
+FcCharSetFreezer *
FcCharSetFreezerCreate (void)
{
FcCharSetFreezer *freezer;
if (!serialize->cs_freezer)
return FcFalse;
}
+ if (FcCharSetFindFrozen (serialize->cs_freezer, cs))
+ return FcTrue;
+
cs = FcCharSetFreeze (serialize->cs_freezer, cs);
}