+ }
+ printf ("},\n");
+
+ /* langIndices */
+ printf ("{\n");
+ for (i = 0; sets[i]; i++)
+ {
+ printf (" %d, /* %s */\n", entries[i].id, names[i]);
+ }
+ printf ("},\n");
+
+ /* langIndicesInv */
+ printf ("{\n");
+ {
+ static int entries_inv[MAX_LANG];
+ for (i = 0; sets[i]; i++)
+ entries_inv[entries[i].id] = i;
+ for (i = 0; sets[i]; i++)
+ printf (" %d, /* %s */\n", entries_inv[i], names[entries_inv[i]]);
+ }
+ printf ("}\n");
+
+ printf ("};\n\n");
+
+ printf ("#define NUM_LANG_CHAR_SET %d\n", i);
+ num_lang_set_map = (i + 31) / 32;
+ printf ("#define NUM_LANG_SET_MAP %d\n", num_lang_set_map);
+ /*
+ * Dump indices with country codes
+ */
+ if (ncountry)
+ {
+ int c;
+ int ncountry_ent = 0;
+ printf ("\n");
+ printf ("static const FcChar32 fcLangCountrySets[][NUM_LANG_SET_MAP] = {\n");
+ for (c = 0; c < ncountry; c++)
+ {
+ i = country[c];
+ if (i >= 0)
+ {
+ int lang = strchr (langs[i], '-') - langs[i];
+ int d, k;
+
+ for (k = 0; k < num_lang_set_map; k++)
+ map[k] = 0;
+
+ BitSet (map, i);
+ for (d = c + 1; d < ncountry; d++)
+ {
+ int j = country[d];
+ if (j >= 0 && !strncmp (langs[j], langs[i], lang + 1))
+ {
+ BitSet(map, j);
+ country[d] = -1;
+ }
+ }
+ printf (" {");
+ for (k = 0; k < num_lang_set_map; k++)
+ printf (" 0x%08x,", map[k]);
+ printf (" }, /* %*.*s */\n",
+ lang, lang, langs[i]);
+ ++ncountry_ent;
+ }
+ }