]> git.wh0rd.org - fontconfig.git/blobdiff - fc-lang/fc-lang.c
Include more stub definitions to make HP-UX's C compiler happy.
[fontconfig.git] / fc-lang / fc-lang.c
index 97ffa6515e96d7af71b7688c899e4ce07953eec8..6a863e4e6dea689d1fbb01f5ccbfa5d3e08ff23d 100644 (file)
@@ -53,6 +53,9 @@ FcMemFree (int kind, int size)
 
 int* _fcBankId = 0;
 int* _fcBankIdx = 0;
+FcValueList ** _fcValueLists = 0;
+FcPatternElt ** _fcPatternElts = 0;
+int FcDebugVal = 0;
 
 int
 FcCacheBankToIndexMTF (int bank)
@@ -80,18 +83,24 @@ static char *
 get_line (FILE *f, char *line, int *lineno)
 {
     char    *hash;
+    int            end;
     if (!fgets (line, 1024, f))
        return 0;
     ++(*lineno);
     hash = strchr (line, '#');
     if (hash)
        *hash = '\0';
+
+    end = strlen (line);
+    while (end > 0 && isspace (line[end-1]))
+      line[--end] = '\0';
+
     if (line[0] == '\0' || line[0] == '\n' || line[0] == '\032' || line[0] == '\r')
        return get_line (f, line, lineno);
     return line;
 }
 
-char   *dir = 0;
+static char    *dir = 0;
 
 static FILE *
 scanopen (char *file)
@@ -134,11 +143,8 @@ scan (FILE *f, char *file)
        if (!strncmp (line, "include", 7))
        {
            file = strchr (line, ' ');
-           while (*file == ' ')
+           while (isspace(*file))
                file++;
-           end = strlen (file);
-           if (file[end-1] == '\n')
-               file[end-1] = '\0';
            f = scanopen (file);
            if (!f)
                fatal (file, 0, "can't open");
@@ -227,13 +233,13 @@ static int compare (const void *a, const void *b)
 int
 main (int argc, char **argv)
 {
-    char       *files[MAX_LANG];
-    FcCharSet  *sets[MAX_LANG];
-    int                duplicate[MAX_LANG];
-    int                offsets[MAX_LANG];
-    int                country[MAX_LANG];
-    char       *names[MAX_LANG];
-    char       *langs[MAX_LANG];
+    static char                *files[MAX_LANG];
+    static FcCharSet   *sets[MAX_LANG];
+    static int         duplicate[MAX_LANG];
+    static int         offsets[MAX_LANG];
+    static int         country[MAX_LANG];
+    static char                *names[MAX_LANG];
+    static char                *langs[MAX_LANG];
     FILE       *f;
     int         offset = 0;
     int                ncountry = 0;
@@ -243,9 +249,8 @@ main (int argc, char **argv)
     int                total_leaves = 0;
     int                offset_count = 0;
     int                l, sl, tl;
-    int                c;
-    char       line[1024];
-    FcChar32   map[MAX_LANG_SET_MAP];
+    static char                line[1024];
+    static FcChar32    map[MAX_LANG_SET_MAP];
     int                num_lang_set_map;
     int                setRangeStart[26];
     int                setRangeEnd[26];
@@ -447,7 +452,7 @@ main (int argc, char **argv)
 
        printf ("    { (FcChar8 *) \"%s\",\n"
                "      { FC_REF_CONSTANT, %d, FC_BANK_LANGS, "
-               "{ .stat = { %d, %d } } } }, /* %d */\n",
+               "{ { %d, %d } } } }, /* %d */\n",
                langs[i],
                sets[j]->num, offsets[j], offsets[j], j);
     }
@@ -460,6 +465,7 @@ main (int argc, char **argv)
      */
     if (ncountry)
     {
+       int     c;
        int     ncountry_ent = 0;
        printf ("\n");
        printf ("static const FcChar32 fcLangCountrySets[][NUM_LANG_SET_MAP] = {\n");
@@ -468,7 +474,7 @@ main (int argc, char **argv)
            i = country[c];
            if (i >= 0)
            {
-               int l = strchr (langs[i], '-') - langs[i];
+               int lang = strchr (langs[i], '-') - langs[i];
                int d, k;
 
                for (k = 0; k < num_lang_set_map; k++)
@@ -488,7 +494,7 @@ main (int argc, char **argv)
                for (k = 0; k < num_lang_set_map; k++)
                    printf (" 0x%08x,", map[k]);
                printf (" }, /* %*.*s */\n",
-                       l, l, langs[i]);
+                       lang, lang, langs[i]);
                ++ncountry_ent;
            }
        }