]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcxml.c
[xml] Mark more symbols static
[fontconfig.git] / src / fcxml.c
index 886413bae1ead213474b8fb38f6340590b2fb2b6..32b8be12cf009b3f05a14f9556a01dcd1b065fec 100644 (file)
@@ -58,6 +58,8 @@
 #undef STRICT
 #endif
 
+static void
+FcExprDestroy (FcExpr *e);
 
 void
 FcTestDestroy (FcTest *test)
@@ -69,81 +71,81 @@ FcTestDestroy (FcTest *test)
     free (test);
 }
 
-FcExpr *
-FcExprCreateInteger (int i)
+static FcExpr *
+FcExprAlloc (void)
 {
     FcExpr *e = (FcExpr *) malloc (sizeof (FcExpr));
 
+    if (e)
+      FcMemAlloc (FC_MEM_EXPR, sizeof (FcExpr));
+
+    return e;
+}
+
+static FcExpr *
+FcExprCreateInteger (int i)
+{
+    FcExpr *e = FcExprAlloc ();
     if (e)
     {
-       FcMemAlloc (FC_MEM_EXPR, sizeof (FcExpr));
        e->op = FcOpInteger;
        e->u.ival = i;
     }
     return e;
 }
 
-FcExpr *
+static FcExpr *
 FcExprCreateDouble (double d)
 {
-    FcExpr *e = (FcExpr *) malloc (sizeof (FcExpr));
-
+    FcExpr *e = FcExprAlloc ();
     if (e)
     {
-       FcMemAlloc (FC_MEM_EXPR, sizeof (FcExpr));
        e->op = FcOpDouble;
        e->u.dval = d;
     }
     return e;
 }
 
-FcExpr *
+static FcExpr *
 FcExprCreateString (const FcChar8 *s)
 {
-    FcExpr *e = (FcExpr *) malloc (sizeof (FcExpr));
-
+    FcExpr *e = FcExprAlloc ();
     if (e)
     {
-       FcMemAlloc (FC_MEM_EXPR, sizeof (FcExpr));
        e->op = FcOpString;
        e->u.sval = FcStrCopy (s);
     }
     return e;
 }
 
-FcExpr *
+static FcExpr *
 FcExprCreateMatrix (const FcMatrix *m)
 {
-    FcExpr *e = (FcExpr *) malloc (sizeof (FcExpr));
-
+    FcExpr *e = FcExprAlloc ();
     if (e)
     {
-       FcMemAlloc (FC_MEM_EXPR, sizeof (FcExpr));
        e->op = FcOpMatrix;
        e->u.mval = FcMatrixCopy (m);
     }
     return e;
 }
 
-FcExpr *
+static FcExpr *
 FcExprCreateBool (FcBool b)
 {
-    FcExpr *e = (FcExpr *) malloc (sizeof (FcExpr));
-
+    FcExpr *e = FcExprAlloc ();
     if (e)
     {
-       FcMemAlloc (FC_MEM_EXPR, sizeof (FcExpr));
        e->op = FcOpBool;
        e->u.bval = b;
     }
     return e;
 }
 
-FcExpr *
+static FcExpr *
 FcExprCreateNil (void)
 {
-    FcExpr *e = (FcExpr *) malloc (sizeof (FcExpr));
-
+    FcExpr *e = FcExprAlloc ();
     if (e)
     {
        FcMemAlloc (FC_MEM_EXPR, sizeof (FcExpr));
@@ -152,42 +154,36 @@ FcExprCreateNil (void)
     return e;
 }
 
-FcExpr *
+static FcExpr *
 FcExprCreateField (const char *field)
 {
-    FcExpr *e = (FcExpr *) malloc (sizeof (FcExpr));
-
+    FcExpr *e = FcExprAlloc ();
     if (e)
     {
-       FcMemAlloc (FC_MEM_EXPR, sizeof (FcExpr));
        e->op = FcOpField;
        e->u.object = FcObjectFromName (field);
     }
     return e;
 }
 
-FcExpr *
+static FcExpr *
 FcExprCreateConst (const FcChar8 *constant)
 {
-    FcExpr *e = (FcExpr *) malloc (sizeof (FcExpr));
-
+    FcExpr *e = FcExprAlloc ();
     if (e)
     {
-       FcMemAlloc (FC_MEM_EXPR, sizeof (FcExpr));
        e->op = FcOpConst;
        e->u.constant = FcStrCopy (constant);
     }
     return e;
 }
 
-FcExpr *
+static FcExpr *
 FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right)
 {
-    FcExpr *e = (FcExpr *) malloc (sizeof (FcExpr));
-
+    FcExpr *e = FcExprAlloc ();
     if (e)
     {
-       FcMemAlloc (FC_MEM_EXPR, sizeof (FcExpr));
        e->op = op;
        e->u.tree.left = left;
        e->u.tree.right = right;
@@ -195,7 +191,7 @@ FcExprCreateOp (FcExpr *left, FcOp op, FcExpr *right)
     return e;
 }
 
-void
+static void
 FcExprDestroy (FcExpr *e)
 {
     if (!e)
@@ -272,12 +268,6 @@ FcEditDestroy (FcEdit *e)
     free (e);
 }
 
-char *
-FcConfigSaveField (const char *field)
-{
-    return (char *) FcStrCopy ((FcChar8 *) field);
-}
-
 typedef enum _FcElement {
     FcElementNone,
     FcElementFontconfig,