FcStrBuf str;
FcChar8 *attr_buf_static[16];
} FcPStack;
-
+
typedef enum _FcVStackTag {
FcVStackNone,
FcVStackConstant,
FcVStackGlob,
FcVStackPattern,
-
+
FcVStackPrefer,
FcVStackAccept,
FcVStackDefault,
-
+
FcVStackInteger,
FcVStackDouble,
FcVStackMatrix,
FcVStackBool,
-
+
FcVStackTest,
FcVStackExpr,
FcVStackEdit
{
const FcObjectType *o;
const FcConstant *c;
-
+
/* If parsing the expression failed, some nodes may be NULL */
if (!expr)
return;
if (o)
FcTypecheckValue (parse, o->type, type);
}
- else
- FcConfigMessage (parse, FcSevereWarning,
+ else
+ FcConfigMessage (parse, FcSevereWarning,
"invalid constant used : %s",
expr->u.constant);
break;
static FcTest *
FcTestCreate (FcConfigParse *parse,
- FcMatchKind kind,
+ FcMatchKind kind,
FcQual qual,
const FcChar8 *field,
FcOp compare,
FcVStackPopAndDestroy (FcConfigParse *parse)
{
FcVStack *vstack = parse->vstack;
-
+
if (!vstack || vstack->pstack != parse->pstack)
return;
FcPStackPop (FcConfigParse *parse)
{
FcPStack *old;
-
- if (!parse->pstack)
+
+ if (!parse->pstack)
{
FcConfigMessage (parse, FcSevereError, "mismatching element");
return FcFalse;
{
FcConfigParse *parse = userData;
FcElement element;
-
+
element = FcElementMap (name);
if (element == FcElementUnknown)
FcConfigMessage (parse, FcSevereWarning, "unknown element \"%s\"", name);
-
+
if (!FcPStackPush (parse, element, attr))
{
FcConfigMessage (parse, FcSevereError, "out of memory");
{
FcChar8 *s, *end;
int l;
-
+
if (!parse->pstack)
return;
s = FcStrBufDoneStatic (&parse->pstack->str);
}
/*
- * idea copied from glib g_ascii_strtod with
- * permission of the author (Alexander Larsson)
+ * idea copied from glib g_ascii_strtod with
+ * permission of the author (Alexander Larsson)
*/
#include <locale.h>
-static double
+static double
FcStrtod (char *s, char **end)
{
struct lconv *locale_data;
{
FcChar8 *s, *end;
double d;
-
+
if (!parse->pstack)
return;
s = FcStrBufDoneStatic (&parse->pstack->str);
FcParseString (FcConfigParse *parse, FcVStackTag tag)
{
FcChar8 *s;
-
+
if (!parse->pstack)
return;
s = FcStrBufDone (&parse->pstack->str);
FcVStack *vstack;
enum { m_done, m_xx, m_xy, m_yx, m_yy } matrix_state = m_yy;
FcMatrix m;
-
+
while ((vstack = FcVStackPeek (parse)))
{
double v;
FcValueBinding *binding_ret)
{
FcValueBinding binding;
-
+
if (!binding_string)
binding = FcValueBindingWeak;
else
}
if (prefer)
{
- edit = FcEditCreate (parse,
+ edit = FcEditCreate (parse,
FC_FAMILY_OBJECT,
FcOpPrepend,
prefer,
FcChar8 *s;
const FcChar8 *i;
FcBool ignore_missing = FcFalse;
-
+
s = FcStrBufDoneStatic (&parse->pstack->str);
if (!s)
{
int i;
for (i = 0; i < nmap; i++)
- if (!strcmp ((char *) op, map[i].name))
+ if (!strcmp ((char *) op, map[i].name))
return map[i].op;
return FcOpInvalid;
}
vstack->tag = FcVStackNone;
if (kind == FcMatchScan && edit->object > FC_MAX_BASE_OBJECT)
{
- FcConfigMessage (parse, FcSevereError,
+ FcConfigMessage (parse, FcSevereError,
"<match target=\"scan\"> cannot edit user-defined object \"%s\"",
FcObjectName(edit->object));
}
{
switch (vstack->tag) {
case FcVStackGlob:
- if (!FcConfigGlobAdd (parse->config,
+ if (!FcConfigGlobAdd (parse->config,
vstack->u.string,
element == FcElementAcceptfont))
{
{
FcVStack *vstack = FcVStackPeek (parse);
FcValue value;
-
+
value.type = FcTypeVoid;
-
+
if (!vstack)
return value;
-
+
switch (vstack->tag) {
case FcVStackString:
value.u.s = FcStrStaticName (vstack->u.string);
value.type = FcTypeBool;
break;
default:
- FcConfigMessage (parse, FcSevereWarning, "unknown pattern element %d",
+ FcConfigMessage (parse, FcSevereWarning, "unknown pattern element %d",
vstack->tag);
break;
}
FcVStackPopAndDestroy (parse);
-
+
return value;
}
FcPatternDestroy (pattern);
return;
}
-
+
for (;;)
{
value = FcPopValue (parse);
FcCharacterData (void *userData, const XML_Char *s, int len)
{
FcConfigParse *parse = userData;
-
+
if (!parse->pstack)
return;
if (!FcStrBufData (&parse->pstack->str, (FcChar8 *) s, len))
ret = FcFalse;
goto bail1;
}
-
+
strcpy ((char *) file, (char *) dir);
strcat ((char *) file, "/");
base = file + strlen ((char *) file);
-
+
files = FcStrSetCreate ();
if (!files)
{
ret = FcFalse;
goto bail2;
}
-
+
if (FcDebug () & FC_DBG_CONFIG)
printf ("\tScanning config dir %s\n", dir);
if (ret)
{
int i;
- qsort (files->strs, files->num, sizeof (FcChar8 *),
+ qsort (files->strs, files->num, sizeof (FcChar8 *),
(int (*)(const void *, const void *)) FcSortCmpStr);
for (i = 0; ret && i < files->num; i++)
ret = FcConfigParseAndLoad (config, files->strs[i], complain);
int len;
FcConfigParse parse;
FcBool error = FcTrue;
-
+
#ifdef ENABLE_LIBXML2
xmlSAXHandler sax;
char buf[BUFSIZ];
#else
void *buf;
#endif
-
+
filename = FcConfigFilename (name);
if (!filename)
goto bail0;
-
+
if (FcStrSetMember (config->configFiles, filename))
{
FcStrFree (filename);
printf ("\tLoading config file %s\n", filename);
fd = open ((char *) filename, O_RDONLY);
- if (fd == -1) {
+ if (fd == -1) {
FcStrFree (filename);
goto bail0;
}
-
+
#ifdef ENABLE_LIBXML2
memset(&sax, 0, sizeof(sax));
#ifndef ENABLE_LIBXML2
XML_SetUserData (p, &parse);
-
+
XML_SetDoctypeDeclHandler (p, FcStartDoctypeDecl, FcEndDoctypeDecl);
XML_SetElementHandler (p, FcStartElement, FcEndElement);
XML_SetCharacterDataHandler (p, FcCharacterData);
if (!XML_ParseBuffer (p, len, len == 0))
#endif
{
- FcConfigMessage (&parse, FcSevereError, "%s",
+ FcConfigMessage (&parse, FcSevereError, "%s",
XML_ErrorString (XML_GetErrorCode (p)));
goto bail3;
}