debug msg in FcPatternPrint.
reviewed by: plam
+2005-11-24 Dirk Mueller <dmueller@suse.com>
+ reviewed by: plam
+
+ * src/fcdbg.c (FcDebug, FcDebugInit, FcPatternPrint):
+ * src/fcinit.c (FcInitLoadConfig, FcInitLoadConfigAndFonts):
+ * src/fcint.h (FcDebug):
+
+ Inline FcDebug invocations and only initialize once, in FcInit*.
+ Improve debug msg in FcPatternPrint.
+
2005-11-23 Frederic Crozat <fcrozat@mandriva.com>:
reviewed by: plam
printf ("Null pattern\n");
return;
}
- printf ("Pattern %d of %d\n", p->num, p->size);
+ printf ("Pattern has %d elts (size %d)\n", p->num, p->size);
for (i = 0; i < p->num; i++)
{
e = FcPatternEltU(p->elts) + i;
}
}
-int
-FcDebug (void)
+int FcDebugVal;
+
+void
+FcInitDebug (void)
{
- static int initialized;
- static int debug;
+ char *e;
- if (!initialized)
+ e = getenv ("FC_DEBUG");
+ if (e)
{
- char *e;
-
- initialized = 1;
- e = getenv ("FC_DEBUG");
- if (e)
- {
- printf ("FC_DEBUG=%s\n", e);
- debug = atoi (e);
- if (debug < 0)
- debug = 0;
- }
+ printf ("FC_DEBUG=%s\n", e);
+ FcDebugVal = atoi (e);
+ if (FcDebugVal < 0)
+ FcDebugVal = 0;
}
- return debug;
}
{
FcConfig *config;
+ FcInitDebug ();
config = FcConfigCreate ();
if (!config)
return FcFalse;
{
FcConfig *config = FcInitLoadConfig ();
+ FcInitDebug ();
if (!config)
return 0;
if (!FcConfigBuildFonts (config))
void
FcSubstPrint (const FcSubst *subst);
-int
-FcDebug (void);
+extern int FcDebugVal;
+
+static __inline__ int
+FcDebug (void) { return FcDebugVal; }
+
+void
+FcInitDebug (void);
/* fcdefault.c */
FcChar8 *