Dead code removal and static markup Signed-off-by: Adam Jackson <ajax@redhat.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702
diff --git a/src/alloc.c b/src/alloc.c
index 91b0b59..a1b4d01 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -86,7 +86,7 @@ XkbcAllocCompatMap(struct xkb_desc * xkb, unsigned which, unsigned nSI)
}
-void
+static void
XkbcFreeCompatMap(struct xkb_desc * xkb, unsigned which, Bool freeMap)
{
struct xkb_compat_map * compat;
@@ -203,7 +203,7 @@ XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalRG, int nTotalAl
return Success;
}
-void
+static void
XkbcFreeNames(struct xkb_desc * xkb, unsigned which, Bool freeMap)
{
struct xkb_names * names;
@@ -270,7 +270,7 @@ XkbcAllocControls(struct xkb_desc * xkb, unsigned which)
return Success;
}
-void
+static void
XkbcFreeControls(struct xkb_desc * xkb, unsigned which, Bool freeMap)
{
if (freeMap && xkb && xkb->ctrls) {
@@ -294,7 +294,7 @@ XkbcAllocIndicatorMaps(struct xkb_desc * xkb)
return Success;
}
-void
+static void
XkbcFreeIndicatorMaps(struct xkb_desc * xkb)
{
if (xkb && xkb->indicators) {
diff --git a/src/atom.c b/src/atom.c
index 194768a..fb3cae4 100644
--- a/src/atom.c
+++ b/src/atom.c
@@ -92,8 +92,8 @@ static uint32_t lastAtom = None;
static NodePtr atomRoot = NULL;
static unsigned long tableLength;
static NodePtr *nodeTable = NULL;
-InternAtomFuncPtr do_intern_atom = NULL;
-GetAtomValueFuncPtr do_get_atom_value = NULL;
+static InternAtomFuncPtr do_intern_atom = NULL;
+static GetAtomValueFuncPtr do_get_atom_value = NULL;
void
xkb_init_atoms(InternAtomFuncPtr intern, GetAtomValueFuncPtr get_atom_value)
diff --git a/src/galloc.c b/src/galloc.c
index 88d11b4..4aed144 100644
--- a/src/galloc.c
+++ b/src/galloc.c
@@ -127,7 +127,7 @@ _XkbClearProperty(char *prop_in)
}
}
-void
+static void
XkbcFreeGeomProperties(struct xkb_geometry * geom, int first, int count, Bool freeAll)
{
_XkbFreeGeomNonLeafElems(freeAll, first, count,
@@ -137,7 +137,7 @@ XkbcFreeGeomProperties(struct xkb_geometry * geom, int first, int count, Bool fr
_XkbClearProperty);
}
-void
+static void
XkbcFreeGeomKeyAliases(struct xkb_geometry * geom, int first, int count, Bool freeAll)
{
_XkbFreeGeomLeafElems(freeAll, first, count,
@@ -155,7 +155,7 @@ _XkbClearColor(char *color_in)
free(color->spec);
}
-void
+static void
XkbcFreeGeomColors(struct xkb_geometry * geom, int first, int count, Bool freeAll)
{
_XkbFreeGeomNonLeafElems(freeAll, first, count,
@@ -164,7 +164,7 @@ XkbcFreeGeomColors(struct xkb_geometry * geom, int first, int count, Bool freeAl
_XkbClearColor);
}
-void
+static void
XkbcFreeGeomPoints(struct xkb_outline * outline, int first, int count, Bool freeAll)
{
_XkbFreeGeomLeafElems(freeAll, first, count,
@@ -181,7 +181,7 @@ _XkbClearOutline(char *outline_in)
XkbcFreeGeomPoints(outline, 0, outline->num_points, True);
}
-void
+static void
XkbcFreeGeomOutlines(struct xkb_shape * shape, int first, int count, Bool freeAll)
{
_XkbFreeGeomNonLeafElems(freeAll, first, count,
@@ -199,7 +199,7 @@ _XkbClearShape(char *shape_in)
XkbcFreeGeomOutlines(shape, 0, shape->num_outlines, True);
}
-void
+static void
XkbcFreeGeomShapes(struct xkb_geometry * geom, int first, int count, Bool freeAll)
{
_XkbFreeGeomNonLeafElems(freeAll, first, count,
@@ -208,58 +208,7 @@ XkbcFreeGeomShapes(struct xkb_geometry * geom, int first, int count, Bool freeAl
_XkbClearShape);
}
-void
-XkbcFreeGeomOverlayKeys(struct xkb_overlay_row * row, int first, int count,
- Bool freeAll)
-{
- _XkbFreeGeomLeafElems(freeAll, first, count,
- &row->num_keys, &row->sz_keys,
- (char **)&row->keys, sizeof(struct xkb_overlay_key));
-}
-
-
-static void
-_XkbClearOverlayRow(char *row_in)
-{
- struct xkb_overlay_row * row = (struct xkb_overlay_row *)row_in;
-
- if (row->keys)
- XkbcFreeGeomOverlayKeys(row, 0, row->num_keys, True);
-}
-
-void
-XkbcFreeGeomOverlayRows(struct xkb_overlay * overlay, int first, int count,
- Bool freeAll)
-{
- _XkbFreeGeomNonLeafElems(freeAll, first, count,
- &overlay->num_rows, &overlay->sz_rows,
- (char **)&overlay->rows,
- sizeof(struct xkb_overlay_row),
- _XkbClearOverlayRow);
-}
-
-
static void
-_XkbClearOverlay(char *overlay_in)
-{
- struct xkb_overlay * overlay = (struct xkb_overlay *)overlay_in;
-
- if (overlay->rows)
- XkbcFreeGeomOverlayRows(overlay, 0, overlay->num_rows, True);
-}
-
-void
-XkbcFreeGeomOverlays(struct xkb_section * section, int first, int count, Bool freeAll)
-{
- _XkbFreeGeomNonLeafElems(freeAll, first, count,
- §ion->num_overlays, §ion->sz_overlays,
- (char **)§ion->overlays,
- sizeof(struct xkb_overlay),
- _XkbClearOverlay);
-}
-
-
-void
XkbcFreeGeomKeys(struct xkb_row * row, int first, int count, Bool freeAll)
{
_XkbFreeGeomLeafElems(freeAll, first, count,
@@ -267,7 +216,6 @@ XkbcFreeGeomKeys(struct xkb_row * row, int first, int count, Bool freeAll)
(char **)&row->keys, sizeof(struct xkb_key));
}
-
static void
_XkbClearRow(char *row_in)
{
@@ -277,7 +225,7 @@ _XkbClearRow(char *row_in)
XkbcFreeGeomKeys(row, 0, row->num_keys, True);
}
-void
+static void
XkbcFreeGeomRows(struct xkb_section * section, int first, int count, Bool freeAll)
{
_XkbFreeGeomNonLeafElems(freeAll, first, count,
@@ -287,28 +235,6 @@ XkbcFreeGeomRows(struct xkb_section * section, int first, int count, Bool freeAl
}
-static void
-_XkbClearSection(char *section_in)
-{
- struct xkb_section * section = (struct xkb_section *)section_in;
-
- if (section->rows)
- XkbcFreeGeomRows(section, 0, section->num_rows, True);
- if (section->doodads) {
- XkbcFreeGeomDoodads(section->doodads, section->num_doodads, True);
- section->doodads = NULL;
- }
-}
-
-void
-XkbcFreeGeomSections(struct xkb_geometry * geom, int first, int count, Bool freeAll)
-{
- _XkbFreeGeomNonLeafElems(freeAll, first, count,
- &geom->num_sections, &geom->sz_sections,
- (char **)&geom->sections, sizeof(struct xkb_section),
- _XkbClearSection);
-}
-
static void
_XkbClearDoodad(char *doodad_in)
@@ -336,7 +262,7 @@ _XkbClearDoodad(char *doodad_in)
}
}
-void
+static void
XkbcFreeGeomDoodads(union xkb_doodad * doodads, int nDoodads, Bool freeAll)
{
int i;
@@ -350,6 +276,28 @@ XkbcFreeGeomDoodads(union xkb_doodad * doodads, int nDoodads, Bool freeAll)
}
}
+static void
+_XkbClearSection(char *section_in)
+{
+ struct xkb_section * section = (struct xkb_section *)section_in;
+
+ if (section->rows)
+ XkbcFreeGeomRows(section, 0, section->num_rows, True);
+ if (section->doodads) {
+ XkbcFreeGeomDoodads(section->doodads, section->num_doodads, True);
+ section->doodads = NULL;
+ }
+}
+
+static void
+XkbcFreeGeomSections(struct xkb_geometry * geom, int first, int count, Bool freeAll)
+{
+ _XkbFreeGeomNonLeafElems(freeAll, first, count,
+ &geom->num_sections, &geom->sz_sections,
+ (char **)&geom->sections, sizeof(struct xkb_section),
+ _XkbClearSection);
+}
+
void
XkbcFreeGeometry(struct xkb_geometry * geom, unsigned which, Bool freeMap)
{
@@ -476,92 +424,12 @@ _XkbGeomAlloc(char **old, unsigned short *num, unsigned short *total,
(n), sizeof(struct xkb_overlay_key))
int
-XkbcAllocGeomProps(struct xkb_geometry * geom, int nProps)
-{
- return _XkbAllocProps(geom, nProps);
-}
-
-int
-XkbcAllocGeomColors(struct xkb_geometry * geom, int nColors)
-{
- return _XkbAllocColors(geom, nColors);
-}
-
-int
XkbcAllocGeomKeyAliases(struct xkb_geometry * geom, int nKeyAliases)
{
return _XkbAllocKeyAliases(geom, nKeyAliases);
}
int
-XkbcAllocGeomShapes(struct xkb_geometry * geom, int nShapes)
-{
- return _XkbAllocShapes(geom, nShapes);
-}
-
-int
-XkbcAllocGeomSections(struct xkb_geometry * geom, int nSections)
-{
- return _XkbAllocSections(geom, nSections);
-}
-
-int
-XkbcAllocGeomOverlays(struct xkb_section * section, int nOverlays)
-{
- return _XkbAllocOverlays(section, nOverlays);
-}
-
-int
-XkbcAllocGeomOverlayRows(struct xkb_overlay * overlay, int nRows)
-{
- return _XkbAllocOverlayRows(overlay, nRows);
-}
-
-int
-XkbcAllocGeomOverlayKeys(struct xkb_overlay_row * row, int nKeys)
-{
- return _XkbAllocOverlayKeys(row, nKeys);
-}
-
-int
-XkbcAllocGeomDoodads(struct xkb_geometry * geom, int nDoodads)
-{
- return _XkbAllocDoodads(geom, nDoodads);
-}
-
-int
-XkbcAllocGeomSectionDoodads(struct xkb_section * section, int nDoodads)
-{
- return _XkbAllocDoodads(section, nDoodads);
-}
-
-int
-XkbcAllocGeomOutlines(struct xkb_shape * shape, int nOL)
-{
- return _XkbAllocOutlines(shape, nOL);
-}
-
-int
-XkbcAllocGeomRows(struct xkb_section * section, int nRows)
-{
- return _XkbAllocRows(section, nRows);
-}
-
-int
-XkbcAllocGeomPoints(struct xkb_outline * ol, int nPts)
-{
- return _XkbAllocPoints(ol, nPts);
-}
-
-int
-XkbcAllocGeomKeys(struct xkb_row * row, int nKeys)
-{
- int ret = _XkbAllocKeys(row, nKeys);
- fprintf(stderr, "!!! allocated %d keys at %p\n", nKeys, row->keys);
- return ret;
-}
-
-int
XkbcAllocGeometry(struct xkb_desc * xkb, struct xkb_geometry_sizes * sizes)
{
struct xkb_geometry * geom;
@@ -643,33 +511,6 @@ register struct xkb_property * prop;
return prop;
}
-struct xkb_key_alias *
-XkbcAddGeomKeyAlias(struct xkb_geometry * geom,const char *aliasStr,const char *realStr)
-{
-register int i;
-register struct xkb_key_alias * alias;
-
- if ((!geom)||(!aliasStr)||(!realStr)||(!aliasStr[0])||(!realStr[0]))
- return NULL;
- for (i=0,alias=geom->key_aliases;i<geom->num_key_aliases;i++,alias++) {
- if (strncmp(alias->alias,aliasStr,XkbKeyNameLength)==0) {
- bzero(alias->real,XkbKeyNameLength);
- strncpy(alias->real,realStr,XkbKeyNameLength);
- return alias;
- }
- }
- if ((geom->num_key_aliases>=geom->sz_key_aliases)&&
- (_XkbAllocKeyAliases(geom,1)!=Success)) {
- return NULL;
- }
- alias= &geom->key_aliases[geom->num_key_aliases];
- bzero(alias,sizeof(struct xkb_key_alias));
- strncpy(alias->alias,aliasStr,XkbKeyNameLength);
- strncpy(alias->real,realStr,XkbKeyNameLength);
- geom->num_key_aliases++;
- return alias;
-}
-
struct xkb_color *
XkbcAddGeomColor(struct xkb_geometry * geom,const char *spec,unsigned int pixel)
{
@@ -853,41 +694,6 @@ register int i,nDoodads;
return doodad;
}
-struct xkb_overlay_key *
-XkbcAddGeomOverlayKey( struct xkb_overlay * overlay,
- struct xkb_overlay_row * row,
- const char * over,
- const char * under)
-{
-register int i;
-struct xkb_overlay_key * key;
-struct xkb_section * section;
-struct xkb_row * row_under;
-Bool found;
-
- if ((!overlay)||(!row)||(!over)||(!under))
- return NULL;
- section= overlay->section_under;
- if (row->row_under>=section->num_rows)
- return NULL;
- row_under= §ion->rows[row->row_under];
- for (i=0,found=False;i<row_under->num_keys;i++) {
- if (strncmp(under,row_under->keys[i].name.name,XkbKeyNameLength)==0) {
- found= True;
- break;
- }
- }
- if (!found)
- return NULL;
- if ((row->num_keys>=row->sz_keys)&&(_XkbAllocOverlayKeys(row,1)!=Success))
- return NULL;
- key= &row->keys[row->num_keys];
- strncpy(key->under.name,under,XkbKeyNameLength);
- strncpy(key->over.name,over,XkbKeyNameLength);
- row->num_keys++;
- return key;
-}
-
struct xkb_overlay_row *
XkbcAddGeomOverlayRow(struct xkb_overlay * overlay,int row_under,int sz_keys)
{
diff --git a/src/geom.c b/src/geom.c
index 6a40026..f2a29d1 100644
--- a/src/geom.c
+++ b/src/geom.c
@@ -76,37 +76,7 @@ XkbcComputeShapeBounds(struct xkb_shape * shape)
return True;
}
-Bool
-XkbcComputeShapeTop(struct xkb_shape * shape, struct xkb_bounds * bounds)
-{
- int p;
- struct xkb_outline * outline;
- struct xkb_point * pt;
-
- if ((!shape) || (shape->num_outlines < 1))
- return False;
-
- if (shape->approx)
- outline = shape->approx;
- else
- outline = &shape->outlines[shape->num_outlines - 1];
-
- if (outline->num_points < 2) {
- bounds->x1 = bounds->y1 = 0;
- bounds->x2 = bounds->y2 = 0;
- }
- else {
- bounds->x1 = bounds->y1 = MAXSHORT;
- bounds->x2 = bounds->y2 = MINSHORT;
- }
-
- for (pt = outline->points, p = 0; p < outline->num_points; p++, pt++)
- _XkbCheckBounds(bounds, pt->x, pt->y);
-
- return True;
-}
-
-Bool
+static Bool
XkbcComputeRowBounds(struct xkb_geometry * geom, struct xkb_section * section, struct xkb_row * row)
{
int k, pos;
diff --git a/src/makekeys/makekeys.c b/src/makekeys/makekeys.c
index 5e21964..c4142ec 100644
--- a/src/makekeys/makekeys.c
+++ b/src/makekeys/makekeys.c
@@ -273,7 +273,7 @@ next1: ;
z = best_z;
printf("#ifndef KS_TABLES_H\n");
printf("#define KS_TABLES_H\n\n");
- printf("const unsigned char _XkeyTable[] = {\n");
+ printf("static const unsigned char _XkeyTable[] = {\n");
printf("0,\n");
k = 1;
for (i = 0; i < ksnum; i++) {
diff --git a/src/malloc.c b/src/malloc.c
index 5abdfb5..3a9d773 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -278,241 +278,6 @@ XkbcCopyKeyType(struct xkb_key_type * from, struct xkb_key_type * into)
return Success;
}
-int
-XkbcCopyKeyTypes(struct xkb_key_type * from, struct xkb_key_type * into, int num_types)
-{
- int i, rtrn;
-
- if (!from || !into || (num_types < 0))
- return BadMatch;
-
- for (i = 0; i < num_types; i++) {
- if ((rtrn = XkbcCopyKeyType(from++, into++)) != Success)
- return rtrn;
- }
-
- return Success;
-}
-
-int
-XkbcResizeKeyType(struct xkb_desc * xkb, int type_ndx, int map_count,
- Bool want_preserve, int new_num_lvls)
-{
- struct xkb_key_type * type;
- KeyCode matchingKeys[XkbMaxKeyCount], nMatchingKeys;
-
- if ((type_ndx < 0) || (type_ndx >= xkb->map->num_types) ||
- (map_count < 0)|| (new_num_lvls < 1))
- return BadValue;
-
- switch (type_ndx) {
- case XkbOneLevelIndex:
- if (new_num_lvls != 1)
- return BadMatch;
- case XkbTwoLevelIndex:
- case XkbAlphabeticIndex:
- case XkbKeypadIndex:
- if (new_num_lvls != 2)
- return BadMatch;
- }
-
- type = &xkb->map->types[type_ndx];
-
- if (map_count == 0) {
- if (type->map)
- free(type->map);
- type->map = NULL;
-
- if (type->preserve)
- free(type->preserve);
- type->preserve = NULL;
-
- type->map_count = 0;
- }
- else {
- struct xkb_kt_map_entry *prev_map = type->map;
-
- if ((map_count > type->map_count) || !type->map)
- type->map = _XkbTypedRealloc(type->map, map_count,
- struct xkb_kt_map_entry);
- if (!type->map) {
- if (prev_map)
- free(prev_map);
- return BadAlloc;
- }
-
- if (want_preserve) {
- struct xkb_mods *prev_preserve = type->preserve;
-
- if ((map_count > type->map_count) || !type->preserve)
- type->preserve = _XkbTypedRealloc(type->preserve, map_count,
- struct xkb_mods);
- if (!type->preserve) {
- if (prev_preserve)
- free(prev_preserve);
- return BadAlloc;
- }
- }
- else if (type->preserve) {
- free(type->preserve);
- type->preserve = NULL;
- }
-
- type->map_count = map_count;
- }
-
- if ((new_num_lvls > type->num_levels) || !type->level_names) {
- uint32_t *prev_level_names = type->level_names;
-
- type->level_names = _XkbTypedRealloc(type->level_names, new_num_lvls,
- uint32_t);
- if (!type->level_names) {
- if (prev_level_names)
- free(prev_level_names);
- return BadAlloc;
- }
- }
-
- /*
- * Here's the theory:
- * If the width of the type changed, we might have to resize the symbol
- * maps for any keys that use the type for one or more groups. This is
- * expensive, so we'll try to cull out any keys that are obviously okay:
- * In any case:
- * - keys that have a group width <= the old width are okay (because
- * they could not possibly have been associated with the old type)
- * If the key type increased in size:
- * - keys that already have a group width >= to the new width are okay
- * + keys that have a group width >= the old width but < the new width
- * might have to be enlarged.
- * If the key type decreased in size:
- * - keys that have a group width > the old width don't have to be
- * resized (because they must have some other wider type associated
- * with some group).
- * + keys that have a group width == the old width might have to be
- * shrunk.
- * The possibilities marked with '+' require us to examine the key types
- * associated with each group for the key.
- */
- bzero(matchingKeys, XkbMaxKeyCount * sizeof(KeyCode));
- nMatchingKeys = 0;
- if (new_num_lvls > type->num_levels) {
- int nTotal;
- uint32_t *newSyms;
- int width, match, nResize = 0;
- int i, g, nSyms;
-
- for (nTotal = 1, i = xkb->min_key_code; i <= xkb->max_key_code; i++) {
- width = XkbKeyGroupsWidth(xkb, i);
- if (width < type->num_levels)
- continue;
-
- for (match = 0, g = XkbKeyNumGroups(xkb, i) - 1;
- (g >= 0) && !match; g--) {
- if (XkbKeyKeyTypeIndex(xkb, i, g) == type_ndx) {
- matchingKeys[nMatchingKeys++] = i;
- match = 1;
- }
- }
-
- if (!match || (width >= new_num_lvls))
- nTotal += XkbKeyNumSyms(xkb, i);
- else {
- nTotal += XkbKeyNumGroups(xkb, i) * new_num_lvls;
- nResize++;
- }
- }
-
- if (nResize > 0) {
- int nextMatch;
-
- xkb->map->size_syms = (nTotal * 12) / 10;
- newSyms = _XkbTypedCalloc(xkb->map->size_syms, uint32_t);
- if (!newSyms)
- return BadAlloc;
- nextMatch = 0;
- nSyms = 1;
-
- for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) {
- if (matchingKeys[nextMatch] == i) {
- uint32_t *pOld;
-
- nextMatch++;
- width = XkbKeyGroupsWidth(xkb, i);
- pOld = XkbKeySymsPtr(xkb, i);
- for (g = XkbKeyNumGroups(xkb, i) - 1; g >= 0; g--)
- memcpy(&newSyms[nSyms+(new_num_lvls * g)],
- &pOld[width * g], width * sizeof(uint32_t));
- xkb->map->key_sym_map[i].offset = nSyms;
- nSyms += XkbKeyNumGroups(xkb, i) * new_num_lvls;
- }
- else {
- memcpy(&newSyms[nSyms], XkbKeySymsPtr(xkb, i),
- XkbKeyNumSyms(xkb, i) * sizeof(uint32_t));
- xkb->map->key_sym_map[i].offset = nSyms;
- nSyms += XkbKeyNumSyms(xkb,i);
- }
- }
-
- type->num_levels = new_num_lvls;
- free(xkb->map->syms);
- xkb->map->syms = newSyms;
- xkb->map->num_syms = nSyms;
-
- return Success;
- }
- }
- else if (new_num_lvls < type->num_levels) {
- int width,match;
- int g, i;
-
- for (i = xkb->min_key_code; i <= xkb->max_key_code; i++) {
- width = XkbKeyGroupsWidth(xkb, i);
- if (width < type->num_levels)
- continue;
-
- for (match = 0, g = XkbKeyNumGroups(xkb, i) - 1;
- (g >= 0) && !match; g--) {
- if (XkbKeyKeyTypeIndex(xkb, i, g) == type_ndx) {
- matchingKeys[nMatchingKeys++] = i;
- match = 1;
- }
- }
- }
- }
-
- if (nMatchingKeys > 0) {
- int key, firstClear;
- int i, g;
-
- if (new_num_lvls > type->num_levels)
- firstClear = type->num_levels;
- else
- firstClear = new_num_lvls;
-
- for (i = 0; i < nMatchingKeys; i++) {
- uint32_t *pSyms;
- int width, nClear;
-
- key = matchingKeys[i];
- width = XkbKeyGroupsWidth(xkb, key);
- nClear = width - firstClear;
- pSyms = XkbKeySymsPtr(xkb, key);
- for (g = XkbKeyNumGroups(xkb, key) - 1; g >= 0; g--) {
- if (XkbKeyKeyTypeIndex(xkb, key, g) == type_ndx) {
- if (nClear>0)
- bzero(&pSyms[g * width + firstClear],
- nClear * sizeof(uint32_t));
- }
- }
- }
- }
-
- type->num_levels = new_num_lvls;
-
- return Success;
-}
-
uint32_t *
XkbcResizeKeySyms(struct xkb_desc * xkb, int key, int needed)
{
@@ -577,244 +342,6 @@ XkbcResizeKeySyms(struct xkb_desc * xkb, int key, int needed)
return &xkb->map->syms[xkb->map->key_sym_map[key].offset];
}
-static unsigned
-_ExtendRange(unsigned int old_flags, unsigned int flag, KeyCode newKC,
- KeyCode *old_min, unsigned char *old_num)
-{
- if ((old_flags & flag) == 0) {
- old_flags |= flag;
- *old_min = newKC;
- *old_num = 1;
- }
- else {
- int last = (*old_min) + (*old_num) - 1;
-
- if (newKC < *old_min) {
- *old_min = newKC;
- *old_num = last - newKC + 1;
- }
- else if (newKC > last) {
- *old_num = newKC - (*old_min) + 1;
- }
- }
-
- return old_flags;
-}
-
-int
-XkbcChangeKeycodeRange(struct xkb_desc * xkb, int minKC, int maxKC,
- struct xkb_changes * changes)
-{
- int tmp;
-
- if (!xkb || (minKC < XkbMinLegalKeyCode) || (maxKC > XkbMaxLegalKeyCode))
- return BadValue;
-
- if (minKC > maxKC)
- return BadMatch;
-
- if (minKC < xkb->min_key_code) {
- if (changes)
- changes->map.min_key_code = minKC;
- tmp = xkb->min_key_code - minKC;
-
- if (xkb->map) {
- if (xkb->map->key_sym_map) {
- bzero(&xkb->map->key_sym_map[minKC],
- tmp * sizeof(struct xkb_sym_map));
- if (changes)
- changes->map.changed = _ExtendRange(changes->map.changed,
- XkbKeySymsMask, minKC,
- &changes->map.first_key_sym,
- &changes->map.num_key_syms);
- }
-
- if (xkb->map->modmap) {
- bzero(&xkb->map->modmap[minKC], tmp);
- if (changes)
- changes->map.changed = _ExtendRange(changes->map.changed,
- XkbModifierMapMask, minKC,
- &changes->map.first_modmap_key,
- &changes->map.num_modmap_keys);
- }
- }
-
- if (xkb->server) {
- if (xkb->server->behaviors) {
- bzero(&xkb->server->behaviors[minKC],
- tmp * sizeof(struct xkb_behavior));
- if (changes)
- changes->map.changed = _ExtendRange(changes->map.changed,
- XkbKeyBehaviorsMask, minKC,
- &changes->map.first_key_behavior,
- &changes->map.num_key_behaviors);
- }
-
- if (xkb->server->key_acts) {
- bzero(&xkb->server->key_acts[minKC],
- tmp * sizeof(unsigned short));
- if (changes)
- changes->map.changed = _ExtendRange(changes->map.changed,
- XkbKeyActionsMask, minKC,
- &changes->map.first_key_act,
- &changes->map.num_key_acts);
- }
-
- if (xkb->server->vmodmap) {
- bzero(&xkb->server->vmodmap[minKC],
- tmp * sizeof(uint32_t));
- if (changes)
- changes->map.changed = _ExtendRange(changes->map.changed,
- XkbVirtualModMapMask, minKC,
- &changes->map.first_modmap_key,
- &changes->map.num_vmodmap_keys);
- }
- }
-
- if (xkb->names && xkb->names->keys) {
- bzero(&xkb->names->keys[minKC], tmp * sizeof(struct xkb_key_name));
- if (changes)
- changes->names.changed = _ExtendRange(changes->names.changed,
- XkbKeyNamesMask, minKC,
- &changes->names.first_key,
- &changes->names.num_keys);
- }
-
- xkb->min_key_code = minKC;
- }
-
- if (maxKC > xkb->max_key_code) {
- if (changes)
- changes->map.max_key_code = maxKC;
- tmp = maxKC-xkb->max_key_code;
-
- if (xkb->map) {
- if (xkb->map->key_sym_map) {
- struct xkb_sym_map *prev_key_sym_map = xkb->map->key_sym_map;
-
- xkb->map->key_sym_map = _XkbTypedRealloc(xkb->map->key_sym_map,
- maxKC + 1,
- struct xkb_sym_map);
- if (!xkb->map->key_sym_map) {
- free(prev_key_sym_map);
- return BadAlloc;
- }
-
- bzero(&xkb->map->key_sym_map[xkb->max_key_code],
- tmp * sizeof(struct xkb_sym_map));
- if (changes)
- changes->map.changed = _ExtendRange(changes->map.changed,
- XkbKeySymsMask, maxKC,
- &changes->map.first_key_sym,
- &changes->map.num_key_syms);
- }
-
- if (xkb->map->modmap) {
- unsigned char *prev_modmap = xkb->map->modmap;
-
- xkb->map->modmap = _XkbTypedRealloc(xkb->map->modmap,
- maxKC + 1, unsigned char);
- if (!xkb->map->modmap) {
- free(prev_modmap);
- return BadAlloc;
- }
-
- bzero(&xkb->map->modmap[xkb->max_key_code], tmp);
- if (changes)
- changes->map.changed = _ExtendRange(changes->map.changed,
- XkbModifierMapMask, maxKC,
- &changes->map.first_modmap_key,
- &changes->map.num_modmap_keys);
- }
- }
-
- if (xkb->server) {
- if (xkb->server->behaviors) {
- struct xkb_behavior *prev_behaviors = xkb->server->behaviors;
-
- xkb->server->behaviors = _XkbTypedRealloc(xkb->server->behaviors,
- maxKC + 1,
- struct xkb_behavior);
- if (!xkb->server->behaviors) {
- free(prev_behaviors);
- return BadAlloc;
- }
-
- bzero(&xkb->server->behaviors[xkb->max_key_code],
- tmp * sizeof(struct xkb_behavior));
- if (changes)
- changes->map.changed = _ExtendRange(changes->map.changed,
- XkbKeyBehaviorsMask, maxKC,
- &changes->map.first_key_behavior,
- &changes->map.num_key_behaviors);
- }
-
- if (xkb->server->key_acts) {
- unsigned short *prev_key_acts = xkb->server->key_acts;
-
- xkb->server->key_acts = _XkbTypedRealloc(xkb->server->key_acts,
- maxKC + 1,
- unsigned short);
- if (!xkb->server->key_acts) {
- free(prev_key_acts);
- return BadAlloc;
- }
-
- bzero(&xkb->server->key_acts[xkb->max_key_code],
- tmp * sizeof(unsigned short));
- if (changes)
- changes->map.changed = _ExtendRange(changes->map.changed,
- XkbKeyActionsMask, maxKC,
- &changes->map.first_key_act,
- &changes->map.num_key_acts);
- }
-
- if (xkb->server->vmodmap) {
- uint32_t *prev_vmodmap = xkb->server->vmodmap;
-
- xkb->server->vmodmap = _XkbTypedRealloc(xkb->server->vmodmap,
- maxKC + 1,
- uint32_t);
- if (!xkb->server->vmodmap) {
- free(prev_vmodmap);
- return BadAlloc;
- }
-
- bzero(&xkb->server->vmodmap[xkb->max_key_code],
- tmp * sizeof(uint32_t));
- if (changes)
- changes->map.changed = _ExtendRange(changes->map.changed,
- XkbVirtualModMapMask, maxKC,
- &changes->map.first_modmap_key,
- &changes->map.num_vmodmap_keys);
- }
- }
-
- if (xkb->names && xkb->names->keys ) {
- struct xkb_key_name *prev_keys = xkb->names->keys;
-
- xkb->names->keys = _XkbTypedRealloc(xkb->names->keys, maxKC + 1,
- struct xkb_key_name);
- if (!xkb->names->keys) {
- free(prev_keys);
- return BadAlloc;
- }
-
- bzero(&xkb->names->keys[xkb->max_key_code],
- tmp * sizeof(struct xkb_key_name));
- if (changes)
- changes->names.changed = _ExtendRange(changes->names.changed,
- XkbKeyNamesMask, maxKC,
- &changes->names.first_key,
- &changes->names.num_keys);
- }
-
- xkb->max_key_code = maxKC;
- }
-
- return Success;
-}
-
union xkb_action *
XkbcResizeKeyActions(struct xkb_desc * xkb, int key, int needed)
{
diff --git a/src/maprules.c b/src/maprules.c
index e60f30a..183010c 100644
--- a/src/maprules.c
+++ b/src/maprules.c
@@ -889,7 +889,7 @@ XkbcRF_GetComponents( XkbRF_RulesPtr rules,
names->compat && names->geometry ) || names->keymap;
}
-XkbRF_RulePtr
+static XkbRF_RulePtr
XkbcRF_AddRule(XkbRF_RulesPtr rules)
{
if (rules->sz_rules<1) {
@@ -913,7 +913,7 @@ XkbcRF_AddRule(XkbRF_RulesPtr rules)
return &rules->rules[rules->num_rules++];
}
-XkbRF_GroupPtr
+static XkbRF_GroupPtr
XkbcRF_AddGroup(XkbRF_RulesPtr rules)
{
if (rules->sz_groups<1) {
@@ -968,290 +968,6 @@ XkbRF_GroupRec tgroup,*group;
return True;
}
-Bool
-XkbcRF_LoadRulesByName(char *base,char *locale,XkbRF_RulesPtr rules)
-{
-FILE * file;
-char buf[PATH_MAX];
-Bool ok;
-
- if ((!base)||(!rules))
- return False;
- if (locale) {
- if (strlen(base)+strlen(locale)+2 > PATH_MAX)
- return False;
- sprintf(buf,"%s-%s", base, locale);
- }
- else {
- if (strlen(base)+1 > PATH_MAX)
- return False;
- strcpy(buf,base);
- }
-
- file= fopen(buf, "r");
- if ((!file)&&(locale)) { /* fallback if locale was specified */
- strcpy(buf,base);
- file= fopen(buf, "r");
- }
- if (!file)
- return False;
- ok= XkbcRF_LoadRules(file,rules);
- fclose(file);
- return ok;
-}
-
-/***====================================================================***/
-
-#define HEAD_NONE 0
-#define HEAD_MODEL 1
-#define HEAD_LAYOUT 2
-#define HEAD_VARIANT 3
-#define HEAD_OPTION 4
-#define HEAD_EXTRA 5
-
-XkbRF_VarDescPtr
-XkbcRF_AddVarDesc(XkbRF_DescribeVarsPtr vars)
-{
- if (vars->sz_desc<1) {
- vars->sz_desc= 16;
- vars->num_desc= 0;
- vars->desc= _XkbTypedCalloc(vars->sz_desc,XkbRF_VarDescRec);
- }
- else if (vars->num_desc>=vars->sz_desc) {
- vars->sz_desc*= 2;
- vars->desc= _XkbTypedRealloc(vars->desc,vars->sz_desc,XkbRF_VarDescRec);
- }
- if (!vars->desc) {
- vars->sz_desc= vars->num_desc= 0;
- PR_DEBUG("Allocation failure in XkbcRF_AddVarDesc\n");
- return NULL;
- }
- vars->desc[vars->num_desc].name= NULL;
- vars->desc[vars->num_desc].desc= NULL;
- return &vars->desc[vars->num_desc++];
-}
-
-XkbRF_VarDescPtr
-XkbcRF_AddVarDescCopy(XkbRF_DescribeVarsPtr vars,XkbRF_VarDescPtr from)
-{
-XkbRF_VarDescPtr nd;
-
- if ((nd=XkbcRF_AddVarDesc(vars))!=NULL) {
- nd->name= _XkbDupString(from->name);
- nd->desc= _XkbDupString(from->desc);
- }
- return nd;
-}
-
-XkbRF_DescribeVarsPtr
-XkbcRF_AddVarToDescribe(XkbRF_RulesPtr rules,char *name)
-{
- if (rules->sz_extra<1) {
- rules->num_extra= 0;
- rules->sz_extra= 1;
- rules->extra_names= _XkbTypedCalloc(rules->sz_extra,char *);
- rules->extra= _XkbTypedCalloc(rules->sz_extra, XkbRF_DescribeVarsRec);
- }
- else if (rules->num_extra>=rules->sz_extra) {
- rules->sz_extra*= 2;
- rules->extra_names= _XkbTypedRealloc(rules->extra_names,rules->sz_extra,
- char *);
- rules->extra=_XkbTypedRealloc(rules->extra, rules->sz_extra,
- XkbRF_DescribeVarsRec);
- }
- if ((!rules->extra_names)||(!rules->extra)) {
- PR_DEBUG("allocation error in extra parts\n");
- rules->sz_extra= rules->num_extra= 0;
- rules->extra_names= NULL;
- rules->extra= NULL;
- return NULL;
- }
- rules->extra_names[rules->num_extra]= _XkbDupString(name);
- bzero(&rules->extra[rules->num_extra],sizeof(XkbRF_DescribeVarsRec));
- return &rules->extra[rules->num_extra++];
-}
-
-Bool
-XkbcRF_LoadDescriptions(FILE *file,XkbRF_RulesPtr rules)
-{
-InputLine line;
-XkbRF_VarDescRec tmp;
-char *tok;
-int len,headingtype,extra_ndx = 0;
-
- bzero((char *)&tmp, sizeof(XkbRF_VarDescRec));
- headingtype = HEAD_NONE;
- InitInputLine(&line);
- for ( ; GetInputLine(file,&line,False); line.num_line= 0) {
- if (line.line[0]=='!') {
- tok = strtok(&(line.line[1]), " \t");
- if (strcmp(tok,"model") == 0)
- headingtype = HEAD_MODEL;
- else if (_XkbStrCaseCmp(tok,"layout") == 0)
- headingtype = HEAD_LAYOUT;
- else if (_XkbStrCaseCmp(tok,"variant") == 0)
- headingtype = HEAD_VARIANT;
- else if (_XkbStrCaseCmp(tok,"option") == 0)
- headingtype = HEAD_OPTION;
- else {
- int i;
- headingtype = HEAD_EXTRA;
- extra_ndx= -1;
- for (i=0;(i<rules->num_extra)&&(extra_ndx<0);i++) {
- if (_XkbStrCaseCmp(tok,rules->extra_names[i]))
- extra_ndx= i;
- }
- if (extra_ndx<0) {
- XkbRF_DescribeVarsPtr var;
- PR_DEBUG1("Extra heading \"%s\" encountered\n",tok);
- var= XkbcRF_AddVarToDescribe(rules,tok);
- if (var)
- extra_ndx= var-rules->extra;
- else headingtype= HEAD_NONE;
- }
- }
- continue;
- }
-
- if (headingtype == HEAD_NONE) {
- PR_DEBUG("Must have a heading before first line of data\n");
- PR_DEBUG("Illegal line of data ignored\n");
- continue;
- }
-
- len = strlen(line.line);
- if ((tmp.name= strtok(line.line, " \t")) == NULL) {
- PR_DEBUG("Huh? No token on line\n");
- PR_DEBUG("Illegal line of data ignored\n");
- continue;
- }
- if (strlen(tmp.name) == len) {
- PR_DEBUG("No description found\n");
- PR_DEBUG("Illegal line of data ignored\n");
- continue;
- }
-
- tok = line.line + strlen(tmp.name) + 1;
- while ((*tok!='\n')&&isspace(*tok))
- tok++;
- if (*tok == '\0') {
- PR_DEBUG("No description found\n");
- PR_DEBUG("Illegal line of data ignored\n");
- continue;
- }
- tmp.desc= tok;
- switch (headingtype) {
- case HEAD_MODEL:
- XkbcRF_AddVarDescCopy(&rules->models,&tmp);
- break;
- case HEAD_LAYOUT:
- XkbcRF_AddVarDescCopy(&rules->layouts,&tmp);
- break;
- case HEAD_VARIANT:
- XkbcRF_AddVarDescCopy(&rules->variants,&tmp);
- break;
- case HEAD_OPTION:
- XkbcRF_AddVarDescCopy(&rules->options,&tmp);
- break;
- case HEAD_EXTRA:
- XkbcRF_AddVarDescCopy(&rules->extra[extra_ndx],&tmp);
- break;
- }
- }
- FreeInputLine(&line);
- if ((rules->models.num_desc==0) && (rules->layouts.num_desc==0) &&
- (rules->variants.num_desc==0) && (rules->options.num_desc==0) &&
- (rules->num_extra==0)) {
- return False;
- }
- return True;
-}
-
-Bool
-XkbcRF_LoadDescriptionsByName(char *base,char *locale,XkbRF_RulesPtr rules)
-{
-FILE * file;
-char buf[PATH_MAX];
-Bool ok;
-
- if ((!base)||(!rules))
- return False;
- if (locale) {
- if (strlen(base)+strlen(locale)+6 > PATH_MAX)
- return False;
- sprintf(buf,"%s-%s.lst", base, locale);
- }
- else {
- if (strlen(base)+5 > PATH_MAX)
- return False;
- sprintf(buf,"%s.lst", base);
- }
-
- file= fopen(buf, "r");
- if ((!file)&&(locale)) { /* fallback if locale was specified */
- sprintf(buf,"%s.lst", base);
-
- file= fopen(buf, "r");
- }
- if (!file)
- return False;
- ok= XkbcRF_LoadDescriptions(file,rules);
- fclose(file);
- return ok;
-}
-
-/***====================================================================***/
-
-XkbRF_RulesPtr
-XkbcRF_Load(char *base,char *locale,Bool wantDesc,Bool wantRules)
-{
-XkbRF_RulesPtr rules;
-
- if ((!base)||((!wantDesc)&&(!wantRules)))
- return NULL;
- if ((rules=_XkbTypedCalloc(1,XkbRF_RulesRec))==NULL)
- return NULL;
- if (wantDesc&&(!XkbcRF_LoadDescriptionsByName(base,locale,rules))) {
- XkbcRF_Free(rules,True);
- return NULL;
- }
- if (wantRules&&(!XkbcRF_LoadRulesByName(base,locale,rules))) {
- XkbcRF_Free(rules,True);
- return NULL;
- }
- return rules;
-}
-
-XkbRF_RulesPtr
-XkbcRF_Create(int szRules,int szExtra)
-{
-XkbRF_RulesPtr rules;
-
- if ((rules=_XkbTypedCalloc(1,XkbRF_RulesRec))==NULL)
- return NULL;
- if (szRules>0) {
- rules->sz_rules= szRules;
- rules->rules= _XkbTypedCalloc(rules->sz_rules,XkbRF_RuleRec);
- if (!rules->rules) {
- free(rules);
- return NULL;
- }
- }
- if (szExtra>0) {
- rules->sz_extra= szExtra;
- rules->extra= _XkbTypedCalloc(rules->sz_extra,XkbRF_DescribeVarsRec);
- if (!rules->extra) {
- if (rules->rules)
- free(rules->rules);
- free(rules);
- return NULL;
- }
- }
- return rules;
-}
-
-/***====================================================================***/
-
static void
XkbRF_ClearVarDescriptions(XkbRF_DescribeVarsPtr var)
{
diff --git a/src/text.c b/src/text.c
index c51f127..fc3cc45 100644
--- a/src/text.c
+++ b/src/text.c
@@ -55,7 +55,7 @@ tbGetBuffer(unsigned int size)
return rtrn;
}
-char *
+static char *
XkbcVModIndexText(struct xkb_desc * xkb, unsigned ndx)
{
int len;
diff --git a/src/xkballoc.h b/src/xkballoc.h
index 84f7718..4210559 100644
--- a/src/xkballoc.h
+++ b/src/xkballoc.h
@@ -34,28 +34,16 @@ authorization from the authors.
extern int
XkbcAllocCompatMap(struct xkb_desc * xkb, unsigned which, unsigned nSI);
-extern void
-XkbcFreeCompatMap(struct xkb_desc * xkb, unsigned which, Bool freeMap);
-
extern int
XkbcAllocNames(struct xkb_desc * xkb, unsigned which, int nTotalRG,
int nTotalAliases);
-extern void
-XkbcFreeNames(struct xkb_desc * xkb, unsigned which, Bool freeMap);
-
extern int
XkbcAllocControls(struct xkb_desc * xkb, unsigned which);
-extern void
-XkbcFreeControls(struct xkb_desc * xkb, unsigned which, Bool freeMap);
-
extern int
XkbcAllocIndicatorMaps(struct xkb_desc * xkb);
-extern void
-XkbcFreeIndicatorMaps(struct xkb_desc * xkb);
-
extern struct xkb_desc *
XkbcAllocKeyboard(void);
@@ -73,20 +61,9 @@ XkbcAllocServerMap(struct xkb_desc * xkb, unsigned which, unsigned nNewActions);
extern int
XkbcCopyKeyType(struct xkb_key_type * from, struct xkb_key_type *into);
-extern int
-XkbcCopyKeyTypes(struct xkb_key_type * from, struct xkb_key_type *into, int num_types);
-
-extern int
-XkbcResizeKeyType(struct xkb_desc * xkb, int type_ndx, int map_count,
- Bool want_preserve, int new_num_lvls);
-
extern uint32_t *
XkbcResizeKeySyms(struct xkb_desc * xkb, int key, int needed);
-extern int
-XkbcChangeKeycodeRange(struct xkb_desc * xkb, int minKC, int maxKC,
- struct xkb_changes * changes);
-
extern union xkb_action *
XkbcResizeKeyActions(struct xkb_desc * xkb, int key, int needed);
diff --git a/src/xkbcomp/action.c b/src/xkbcomp/action.c
index 2f37f90..fa6a80c 100644
--- a/src/xkbcomp/action.c
+++ b/src/xkbcomp/action.c
@@ -1286,6 +1286,8 @@ ApplyActionFactoryDefaults(union xkb_action * action)
return;
}
+static void
+ActionsInit(void);
int
HandleActionDef(ExprDef * def,
@@ -1448,7 +1450,7 @@ SetActionField(struct xkb_desc * xkb,
/***====================================================================***/
-void
+static void
ActionsInit(void)
{
if (!actionsInitialized)
diff --git a/src/xkbcomp/action.h b/src/xkbcomp/action.h
index b2ca873..8d52d29 100644
--- a/src/xkbcomp/action.h
+++ b/src/xkbcomp/action.h
@@ -79,8 +79,6 @@ extern int SetActionField(struct xkb_desc * /* xkb */ ,
ActionInfo ** /* info_rtrn */
);
-extern void ActionsInit(void);
-
extern LookupEntry ctrlNames[];
#endif /* ACTION_H */
diff --git a/src/xkbcomp/expr.c b/src/xkbcomp/expr.c
index 1f255c5..0900352 100644
--- a/src/xkbcomp/expr.c
+++ b/src/xkbcomp/expr.c
@@ -95,7 +95,7 @@ exprOpText(unsigned type)
return buf;
}
-char *
+static char *
exprTypeText(unsigned type)
{
static char buf[20];
@@ -210,32 +210,6 @@ RadioLookup(char * priv,
return True;
}
-int
-TableLookup(char * priv,
- uint32_t elem, uint32_t field, unsigned type, ExprResult * val_rtrn)
-{
- LookupTable *tbl = (LookupTable *) priv;
- const char *str;
-
- if ((priv == NULL) || (field == None) || (type != TypeInt))
- return False;
- str = XkbcAtomText(elem);
- while (tbl)
- {
- if (((str == NULL) && (tbl->element == NULL)) ||
- ((str != NULL) && (tbl->element != NULL) &&
- (uStrCaseCmp(str, tbl->element) == 0)))
- {
- break;
- }
- tbl = tbl->nextElement;
- }
- if (tbl == NULL) /* didn't find a matching element */
- return False;
- priv = (char *) tbl->entries;
- return SimpleLookup(priv, (uint32_t) None, field, type, val_rtrn);
-}
-
static LookupEntry modIndexNames[] = {
{"shift", ShiftMapIndex},
{"control", ControlMapIndex},
@@ -257,7 +231,7 @@ LookupModIndex(char * priv,
val_rtrn);
}
-int
+static int
LookupModMask(char * priv,
uint32_t elem, uint32_t field, unsigned type, ExprResult * val_rtrn)
{
@@ -290,83 +264,6 @@ LookupModMask(char * priv,
}
int
-ExprResolveModIndex(ExprDef * expr,
- ExprResult * val_rtrn,
- IdentLookupFunc lookup, char * lookupPriv)
-{
- int ok = 0;
- char *bogus = NULL;
-
- switch (expr->op)
- {
- case ExprValue:
- if (expr->type != TypeInt)
- {
- ERROR
- ("Found constant of type %s where a modifier mask was expected\n",
- exprTypeText(expr->type));
- return False;
- }
- else if ((expr->value.ival >= XkbNumModifiers)
- || (expr->value.ival < 0))
- {
- ERROR("Illegal modifier index (%d, must be 0..%d)\n",
- expr->value.ival, XkbNumModifiers - 1);
- return False;
- }
- val_rtrn->ival = expr->value.ival;
- return True;
- case ExprIdent:
- if (LookupModIndex(lookupPriv, (uint32_t) None, expr->value.str,
- (unsigned) TypeInt, val_rtrn))
- {
- return True;
- }
- if (lookup)
- {
- ok = (*lookup) (lookupPriv,
- None, expr->value.str, TypeInt, val_rtrn);
- }
- if (!ok)
- ERROR("Cannot determine modifier index for \"%s\"\n",
- XkbcAtomText(expr->value.str));
- break;
- case ExprFieldRef:
- bogus = "field reference";
- break;
- case ExprArrayRef:
- bogus = "array reference";
- break;
- case ExprActionDecl:
- bogus = "function";
- break;
- case OpAdd:
- case OpSubtract:
- case OpMultiply:
- case OpDivide:
- case OpInvert:
- case OpNegate:
- case OpNot:
- case OpUnaryPlus:
- bogus = "arithmetic operations";
- break;
- case OpAssign:
- bogus = "assignment";
- break;
- default:
- WSGO("Unknown operator %d in ResolveModIndex\n", expr->op);
- return False;
- }
- if (bogus)
- {
- ERROR("Modifier index must be a name or number, %s ignored\n",
- bogus);
- return False;
- }
- return ok;
-}
-
-int
ExprResolveModMask(ExprDef * expr,
ExprResult * val_rtrn,
IdentLookupFunc lookup, char * lookupPriv)
diff --git a/src/xkbcomp/expr.h b/src/xkbcomp/expr.h
index 1fa9f76..c93ac08 100644
--- a/src/xkbcomp/expr.h
+++ b/src/xkbcomp/expr.h
@@ -42,9 +42,6 @@ typedef Bool(*IdentLookupFunc) (char * /* priv */ ,
ExprResult * /* val_rtrn */
);
-extern char *exprTypeText(unsigned /* type */
- );
-
extern int ExprResolveLhs(ExprDef * /* expr */ ,
ExprResult * /* elem_rtrn */ ,
ExprResult * /* field_rtrn */ ,
@@ -89,13 +86,6 @@ extern int SimpleLookup(char * /* priv */ ,
ExprResult * /* val_rtrn */
);
-extern int TableLookup(char * /* priv */ ,
- uint32_t /* elem */ ,
- uint32_t /* field */ ,
- unsigned /* type */ ,
- ExprResult * /* val_rtrn */
- );
-
extern int LookupModIndex(char * /* priv */ ,
uint32_t /* elem */ ,
uint32_t /* field */ ,
@@ -103,19 +93,6 @@ extern int LookupModIndex(char * /* priv */ ,
ExprResult * /* val_rtrn */
);
-extern int LookupModMask(char * /* priv */ ,
- uint32_t /* elem */ ,
- uint32_t /* field */ ,
- unsigned /* type */ ,
- ExprResult * /* val_rtrn */
- );
-
-extern int ExprResolveModIndex(ExprDef * /* expr */ ,
- ExprResult * /* val_rtrn */ ,
- IdentLookupFunc /* lookup */ ,
- char * /* lookupPriv */
- );
-
extern int ExprResolveModMask(ExprDef * /* expr */ ,
ExprResult * /* val_rtrn */ ,
IdentLookupFunc /* lookup */ ,
diff --git a/src/xkbcomp/keycodes.c b/src/xkbcomp/keycodes.c
index da6580f..6aba4c6 100644
--- a/src/xkbcomp/keycodes.c
+++ b/src/xkbcomp/keycodes.c
@@ -846,13 +846,9 @@ CompileKeycodes(XkbFile *file, struct xkb_desc * xkb, unsigned merge)
{
register int i;
xkb->names->keycodes = XkbcInternAtom(info.name, False);
- uDEBUG2(1, "key range: %d..%d\n", xkb->min_key_code,
- xkb->max_key_code);
for (i = info.computedMin; i <= info.computedMax; i++)
{
LongToKeyName(info.names[i], xkb->names->keys[i].name);
- uDEBUG2(2, "key %d = %s\n", i,
- XkbcKeyNameText(xkb->names->keys[i].name));
}
}
else
diff --git a/src/xkbcomp/keytypes.c b/src/xkbcomp/keytypes.c
index 2ad8693..846dba5 100644
--- a/src/xkbcomp/keytypes.c
+++ b/src/xkbcomp/keytypes.c
@@ -80,7 +80,7 @@ typedef struct _KeyTypesInfo
uint32_t tok_ONE_LEVEL;
uint32_t tok_TWO_LEVEL;
-uint32_t tok_ALPHABETIC;
+static uint32_t tok_ALPHABETIC;
uint32_t tok_KEYPAD;
/***====================================================================***/
@@ -92,27 +92,6 @@ uint32_t tok_KEYPAD;
/***====================================================================***/
-extern Bool AddMapEntry(struct xkb_desc * /* xkb */ ,
- KeyTypeInfo * /* type */ ,
- struct xkb_kt_map_entry * /* new */ ,
- Bool /* clobber */ ,
- Bool /* report */
- );
-
-extern Bool AddPreserve(struct xkb_desc * /* xkb */ ,
- KeyTypeInfo * /* type */ ,
- PreserveInfo * /* new */ ,
- Bool /* clobber */ ,
- Bool /* report */
- );
-
-extern Bool AddLevelName(KeyTypeInfo * /* type */ ,
- unsigned /* level */ ,
- uint32_t /* name */ ,
- Bool /* clobber */ ,
- Bool /* report */
- );
-
#define MapEntryTxt(x, e) \
XkbcVModMaskText((x), (e)->mods.real_mods, (e)->mods.vmods)
#define PreserveIndexTxt(x, p) \
@@ -540,7 +519,7 @@ NextMapEntry(KeyTypeInfo * type)
return &type->entries[type->nEntries++];
}
-Bool
+static Bool
AddPreserve(struct xkb_desc * xkb,
KeyTypeInfo * type, PreserveInfo * new, Bool clobber, Bool report)
{
@@ -612,7 +591,7 @@ AddPreserve(struct xkb_desc * xkb,
* @param clobber Overwrite existing entry.
* @param report True if a warning is to be printed on.
*/
-Bool
+static Bool
AddMapEntry(struct xkb_desc * xkb,
KeyTypeInfo * type,
struct xkb_kt_map_entry * new, Bool clobber, Bool report)
@@ -781,7 +760,7 @@ SetPreserve(KeyTypeInfo * type,
/***====================================================================***/
-Bool
+static Bool
AddLevelName(KeyTypeInfo * type,
unsigned level, uint32_t name, Bool clobber, Bool report)
{
diff --git a/src/xkbcomp/listing.c b/src/xkbcomp/listing.c
index c438e5a..479af3f 100644
--- a/src/xkbcomp/listing.c
+++ b/src/xkbcomp/listing.c
@@ -80,7 +80,6 @@ SOFTWARE.
#include <malloc.h>
#endif
-#define DEBUG_VAR listingDebug
#include "xkbcomp.h"
#include <stdlib.h>
@@ -127,8 +126,6 @@ SOFTWARE.
#define DFLT_XKB_CONFIG_ROOT "/usr/share/X11/xkb"
#endif
-unsigned int listingDebug;
-
typedef struct _CompPair {
int num;
int sz;
diff --git a/src/xkbcomp/misc.c b/src/xkbcomp/misc.c
index 1de6319..0c06715 100644
--- a/src/xkbcomp/misc.c
+++ b/src/xkbcomp/misc.c
@@ -151,15 +151,6 @@ ReportBadType(const char *type, const char *field,
}
int
-ReportBadIndexType(const char *type, const char *field,
- const char *name, const char *wanted)
-{
- ERROR("Index for the %s %s field must be a %s\n", type, field, wanted);
- ACTION("Ignoring assignment to illegal field in %s\n", name);
- return False;
-}
-
-int
ReportBadField(const char *type, const char *field, const char *name)
{
ERROR("Unknown %s field %s in %s\n", type, field, name);
@@ -167,14 +158,6 @@ ReportBadField(const char *type, const char *field, const char *name)
return False;
}
-int
-ReportMultipleDefs(const char *type, const char *field, const char *name)
-{
- WARN("Multiple definitions of %s in %s \"%s\"\n", field, type, name);
- ACTION("Using last definition\n");
- return False;
-}
-
/***====================================================================***/
Bool
@@ -202,23 +185,6 @@ UseNewField(unsigned field,
return useNew;
}
-Bool
-MergeNewField(unsigned field,
- CommonInfo * oldDefs, CommonInfo * newDefs, unsigned *pCollide)
-{
- if ((oldDefs->defined & field) && (newDefs->defined & field))
- {
- if (((oldDefs->fileID == newDefs->fileID) && (warningLevel > 0)) ||
- (warningLevel > 9))
- {
- *pCollide |= field;
- }
- if (newDefs->merge == MergeAugment)
- return True;
- }
- return False;
-}
-
char *
ClearCommonInfo(CommonInfo * cmn)
{
@@ -263,189 +229,6 @@ typedef struct _KeyNameDesc
Bool used;
} KeyNameDesc;
-static KeyNameDesc dfltKeys[] = {
- {XK_Escape, NoSymbol, "ESC\0"},
- {XK_quoteleft, XK_asciitilde, "TLDE"},
- {XK_1, XK_exclam, "AE01"},
- {XK_2, XK_at, "AE02"},
- {XK_3, XK_numbersign, "AE03"},
- {XK_4, XK_dollar, "AE04"},
- {XK_5, XK_percent, "AE05"},
- {XK_6, XK_asciicircum, "AE06"},
- {XK_7, XK_ampersand, "AE07"},
- {XK_8, XK_asterisk, "AE08"},
- {XK_9, XK_parenleft, "AE09"},
- {XK_0, XK_parenright, "AE10"},
- {XK_minus, XK_underscore, "AE11"},
- {XK_equal, XK_plus, "AE12"},
- {XK_BackSpace, NoSymbol, "BKSP"},
- {XK_Tab, NoSymbol, "TAB\0"},
- {XK_q, XK_Q, "AD01"},
- {XK_w, XK_W, "AD02"},
- {XK_e, XK_E, "AD03"},
- {XK_r, XK_R, "AD04"},
- {XK_t, XK_T, "AD05"},
- {XK_y, XK_Y, "AD06"},
- {XK_u, XK_U, "AD07"},
- {XK_i, XK_I, "AD08"},
- {XK_o, XK_O, "AD09"},
- {XK_p, XK_P, "AD10"},
- {XK_bracketleft, XK_braceleft, "AD11"},
- {XK_bracketright, XK_braceright, "AD12"},
- {XK_Return, NoSymbol, "RTRN"},
- {XK_Caps_Lock, NoSymbol, "CAPS"},
- {XK_a, XK_A, "AC01"},
- {XK_s, XK_S, "AC02"},
- {XK_d, XK_D, "AC03"},
- {XK_f, XK_F, "AC04"},
- {XK_g, XK_G, "AC05"},
- {XK_h, XK_H, "AC06"},
- {XK_j, XK_J, "AC07"},
- {XK_k, XK_K, "AC08"},
- {XK_l, XK_L, "AC09"},
- {XK_semicolon, XK_colon, "AC10"},
- {XK_quoteright, XK_quotedbl, "AC11"},
- {XK_Shift_L, NoSymbol, "LFSH"},
- {XK_z, XK_Z, "AB01"},
- {XK_x, XK_X, "AB02"},
- {XK_c, XK_C, "AB03"},
- {XK_v, XK_V, "AB04"},
- {XK_b, XK_B, "AB05"},
- {XK_n, XK_N, "AB06"},
- {XK_m, XK_M, "AB07"},
- {XK_comma, XK_less, "AB08"},
- {XK_period, XK_greater, "AB09"},
- {XK_slash, XK_question, "AB10"},
- {XK_backslash, XK_bar, "BKSL"},
- {XK_Control_L, NoSymbol, "LCTL"},
- {XK_space, NoSymbol, "SPCE"},
- {XK_Shift_R, NoSymbol, "RTSH"},
- {XK_Alt_L, NoSymbol, "LALT"},
- {XK_space, NoSymbol, "SPCE"},
- {XK_Control_R, NoSymbol, "RCTL"},
- {XK_Alt_R, NoSymbol, "RALT"},
- {XK_F1, NoSymbol, "FK01"},
- {XK_F2, NoSymbol, "FK02"},
- {XK_F3, NoSymbol, "FK03"},
- {XK_F4, NoSymbol, "FK04"},
- {XK_F5, NoSymbol, "FK05"},
- {XK_F6, NoSymbol, "FK06"},
- {XK_F7, NoSymbol, "FK07"},
- {XK_F8, NoSymbol, "FK08"},
- {XK_F9, NoSymbol, "FK09"},
- {XK_F10, NoSymbol, "FK10"},
- {XK_F11, NoSymbol, "FK11"},
- {XK_F12, NoSymbol, "FK12"},
- {XK_Print, NoSymbol, "PRSC"},
- {XK_Scroll_Lock, NoSymbol, "SCLK"},
- {XK_Pause, NoSymbol, "PAUS"},
- {XK_Insert, NoSymbol, "INS\0"},
- {XK_Home, NoSymbol, "HOME"},
- {XK_Prior, NoSymbol, "PGUP"},
- {XK_Delete, NoSymbol, "DELE"},
- {XK_End, NoSymbol, "END"},
- {XK_Next, NoSymbol, "PGDN"},
- {XK_Up, NoSymbol, "UP\0\0"},
- {XK_Left, NoSymbol, "LEFT"},
- {XK_Down, NoSymbol, "DOWN"},
- {XK_Right, NoSymbol, "RGHT"},
- {XK_Num_Lock, NoSymbol, "NMLK"},
- {XK_KP_Divide, NoSymbol, "KPDV"},
- {XK_KP_Multiply, NoSymbol, "KPMU"},
- {XK_KP_Subtract, NoSymbol, "KPSU"},
- {NoSymbol, XK_KP_7, "KP7\0"},
- {NoSymbol, XK_KP_8, "KP8\0"},
- {NoSymbol, XK_KP_9, "KP9\0"},
- {XK_KP_Add, NoSymbol, "KPAD"},
- {NoSymbol, XK_KP_4, "KP4\0"},
- {NoSymbol, XK_KP_5, "KP5\0"},
- {NoSymbol, XK_KP_6, "KP6\0"},
- {NoSymbol, XK_KP_1, "KP1\0"},
- {NoSymbol, XK_KP_2, "KP2\0"},
- {NoSymbol, XK_KP_3, "KP3\0"},
- {XK_KP_Enter, NoSymbol, "KPEN"},
- {NoSymbol, XK_KP_0, "KP0\0"},
- {XK_KP_Delete, NoSymbol, "KPDL"},
- {XK_less, XK_greater, "LSGT"},
- {XK_KP_Separator, NoSymbol, "KPCO"},
- {XK_Find, NoSymbol, "FIND"},
- {NoSymbol, NoSymbol, "\0\0\0\0"}
-};
-
-int
-ComputeKbdDefaults(struct xkb_desc * xkb)
-{
- int rtrn;
- register int i, tmp, nUnknown;
- KeyNameDesc *name;
- uint32_t *syms;
-
- if ((xkb->names == NULL) || (xkb->names->keys == NULL))
- {
- if ((rtrn = XkbcAllocNames(xkb, XkbKeyNamesMask, 0, 0)) != Success)
- return rtrn;
- }
- for (name = dfltKeys; (name->name[0] != '\0'); name++)
- {
- name->used = False;
- }
- nUnknown = 0;
- for (i = xkb->min_key_code; i <= xkb->max_key_code; i++)
- {
- tmp = XkbKeyNumSyms(xkb, i);
- if ((xkb->names->keys[i].name[0] == '\0') && (tmp > 0))
- {
- tmp = XkbKeyGroupsWidth(xkb, i);
- syms = XkbKeySymsPtr(xkb, i);
- for (name = dfltKeys; (name->name[0] != '\0'); name++)
- {
- Bool match = True;
- if (((name->level1 != syms[0])
- && (name->level1 != NoSymbol))
- || ((name->level2 != NoSymbol) && (tmp < 2))
- || ((name->level2 != syms[1])
- && (name->level2 != NoSymbol)))
- {
- match = False;
- }
- if (match)
- {
- if (!name->used)
- {
- memcpy(xkb->names->keys[i].name, name->name,
- XkbKeyNameLength);
- name->used = True;
- }
- else
- {
- if (warningLevel > 2)
- {
- WARN
- ("Several keys match pattern for %s\n",
- XkbcKeyNameText(name->name));
- ACTION("Using <U%03d> for key %d\n",
- nUnknown, i);
- }
- sprintf(xkb->names->keys[i].name, "U%03d",
- nUnknown++);
- }
- break;
- }
- }
- if (xkb->names->keys[i].name[0] == '\0')
- {
- if (warningLevel > 2)
- {
- WARN("Key %d does not match any defaults\n", i);
- ACTION("Using name <U%03d>\n", nUnknown);
- sprintf(xkb->names->keys[i].name, "U%03d", nUnknown++);
- }
- }
- }
- }
- return Success;
-}
-
/**
* Find the key with the given name and return its keycode in kc_rtrn.
*
diff --git a/src/xkbcomp/misc.h b/src/xkbcomp/misc.h
index 513b089..4314134 100644
--- a/src/xkbcomp/misc.h
+++ b/src/xkbcomp/misc.h
@@ -41,12 +41,6 @@ extern Bool UseNewField(unsigned /* field */ ,
unsigned * /* pCollide */
);
-extern Bool MergeNewField(unsigned /* field */ ,
- CommonInfo * /* oldDefs */ ,
- CommonInfo * /* newDefs */ ,
- unsigned * /* pCollide */
- );
-
extern char * ClearCommonInfo(CommonInfo * /* cmn */
);
@@ -70,31 +64,17 @@ extern int ReportBadType(const char * /* type */ ,
const char * /* wanted */
);
-extern int ReportBadIndexType(const char * /* type */ ,
- const char * /* field */ ,
- const char * /* name */ ,
- const char * /* wanted */
- );
-
extern int ReportBadField(const char * /* type */ ,
const char * /* field */ ,
const char * /* name */
);
-extern int ReportMultipleDefs(const char * /* type */ ,
- const char * /* field */ ,
- const char * /* which */
- );
-
extern Bool ProcessIncludeFile(IncludeStmt * /* stmt */ ,
unsigned /* file_type */ ,
XkbFile ** /* file_rtrn */ ,
unsigned * /* merge_rtrn */
);
-extern int ComputeKbdDefaults(struct xkb_desc * /* xkb */
- );
-
extern Bool FindNamedKey(struct xkb_desc * /* xkb */ ,
unsigned long /* name */ ,
unsigned int * /* kc_rtrn */ ,
diff --git a/src/xkbcomp/parseutils.c b/src/xkbcomp/parseutils.c
index 33ec7a7..65b66a9 100644
--- a/src/xkbcomp/parseutils.c
+++ b/src/xkbcomp/parseutils.c
@@ -24,7 +24,6 @@
********************************************************/
-#define DEBUG_VAR parseDebug
#include "parseutils.h"
#include "xkbmisc.h"
#include "xkbpath.h"
@@ -482,16 +481,6 @@ KeyDeclCreate(char *name, ExprDef * expr)
return key;
}
-KeyDef *
-KeyDeclMerge(KeyDef * into, KeyDef * from)
-{
- into->expr =
- (ExprDef *) AppendStmt(&into->expr->common, &from->expr->common);
- from->expr = NULL;
- free(from);
- return into;
-}
-
RowDef *
RowDeclCreate(KeyDef * keys)
{
diff --git a/src/xkbcomp/parseutils.h b/src/xkbcomp/parseutils.h
index e9206a7..861ec61 100644
--- a/src/xkbcomp/parseutils.h
+++ b/src/xkbcomp/parseutils.h
@@ -27,10 +27,6 @@
#ifndef XKBPARSE_H
#define XKBPARSE_H 1
-#ifndef DEBUG_VAR
-#define DEBUG_VAR parseDebug
-#endif
-
#include "xkbcomp.h"
extern char scanBuf[1024];
@@ -136,10 +132,6 @@ extern KeyDef *KeyDeclCreate(char * /* name */ ,
ExprDef * /* expr */
);
-extern KeyDef *KeyDeclMerge(KeyDef * /* into */ ,
- KeyDef * /* from */
- );
-
extern RowDef *RowDeclCreate(KeyDef * /* keys */
);
diff --git a/src/xkbcomp/tokens.h b/src/xkbcomp/tokens.h
index 442e166..c936c01 100644
--- a/src/xkbcomp/tokens.h
+++ b/src/xkbcomp/tokens.h
@@ -100,7 +100,6 @@
extern uint32_t tok_ONE_LEVEL;
extern uint32_t tok_TWO_LEVEL;
-extern uint32_t tok_ALPHABETIC;
extern uint32_t tok_KEYPAD;
#endif
diff --git a/src/xkbcomp/utils.c b/src/xkbcomp/utils.c
index 8249806..2309857 100644
--- a/src/xkbcomp/utils.c
+++ b/src/xkbcomp/utils.c
@@ -48,138 +48,9 @@ recalloc(void * old, unsigned nOld, unsigned nNew, unsigned itemSize)
return (void *) rtrn;
}
-/***====================================================================***/
-/*** FUNCTION ENTRY TRACKING ***/
-/***====================================================================***/
-
-static FILE *entryFile = NULL;
-int uEntryLevel;
-
-Boolean
-uSetEntryFile(char *name)
-{
- if ((entryFile != NULL) && (entryFile != stderr))
- {
- fprintf(entryFile, "switching to %s\n", name ? name : "stderr");
- fclose(entryFile);
- }
- if (name != NullString)
- entryFile = fopen(name, "w");
- else
- entryFile = stderr;
- if (entryFile == NULL)
- {
- entryFile = stderr;
- return (False);
- }
- return (True);
-}
-
-void
-uEntry(int l, char *s, ...)
-{
- int i;
- va_list args;
-
- if (!entryFile)
- return;
-
- for (i = 0; i < uEntryLevel; i++)
- {
- putc(' ', entryFile);
- }
- va_start(args, s);
- vfprintf(entryFile, s, args);
- va_end(args);
- uEntryLevel += l;
-}
-
-void
-uExit(int l, char *rtVal)
-{
- int i;
-
- if (!entryFile)
- return;
-
- uEntryLevel -= l;
- if (uEntryLevel < 0)
- uEntryLevel = 0;
- for (i = 0; i < uEntryLevel; i++)
- {
- putc(' ', entryFile);
- }
- fprintf(entryFile, "---> %p\n", rtVal);
- return;
-}
-
-/***====================================================================***/
-/*** PRINT FUNCTIONS ***/
-/***====================================================================***/
-
-FILE *uDebugFile = NULL;
-int uDebugIndentLevel = 0;
-int uDebugIndentSize = 4;
-
-Boolean
-uSetDebugFile(char *name)
-{
- if ((uDebugFile != NULL) && (uDebugFile != stderr))
- {
- fprintf(uDebugFile, "switching to %s\n", name ? name : "stderr");
- fclose(uDebugFile);
- }
- if (name != NullString)
- uDebugFile = fopen(name, "w");
- else
- uDebugFile = stderr;
- if (uDebugFile == NULL)
- {
- uDebugFile = stderr;
- return (False);
- }
- return (True);
-}
-
-void
-uDebug(char *s, ...)
-{
- int i;
- va_list args;
-
- if (!uDebugFile)
- return;
-
- for (i = (uDebugIndentLevel * uDebugIndentSize); i > 0; i--)
- {
- putc(' ', uDebugFile);
- }
- va_start(args, s);
- vfprintf(uDebugFile, s, args);
- va_end(args);
- fflush(uDebugFile);
-}
-
-void
-uDebugNOI(char *s, ...)
-{
- va_list args;
-
- if (!uDebugFile)
- return;
-
- va_start(args, s);
- vfprintf(uDebugFile, s, args);
- va_end(args);
- fflush(uDebugFile);
-}
-
-/***====================================================================***/
-
static FILE *errorFile = NULL;
static int outCount = 0;
static char *preMsg = NULL;
-static char *postMsg = NULL;
static char *prefix = NULL;
Boolean
@@ -326,36 +197,6 @@ uInternalError(const char *s, ...)
outCount++;
}
-void
-uSetPreErrorMessage(char *msg)
-{
- outCount = 0;
- preMsg = msg;
- return;
-}
-
-void
-uSetPostErrorMessage(char *msg)
-{
- postMsg = msg;
- return;
-}
-
-void
-uSetErrorPrefix(char *pre)
-{
- prefix = pre;
- return;
-}
-
-void
-uFinishUp(void)
-{
- if (errorFile && (outCount > 0) && (postMsg != NULL))
- fprintf(errorFile, "%s\n", postMsg);
- return;
-}
-
/***====================================================================***/
#ifndef HAVE_STRCASECMP
diff --git a/src/xkbcomp/utils.h b/src/xkbcomp/utils.h
index 50c1e14..24bcd6f 100644
--- a/src/xkbcomp/utils.h
+++ b/src/xkbcomp/utils.h
@@ -123,19 +123,6 @@ uFatalError(const char *s, ...);
extern __ATTR_PRINTF(1, 2) void
uInternalError(const char *s, ...);
-extern void
-uSetPreErrorMessage(char *msg);
-
-extern void
-uSetPostErrorMessage(char *msg);
-
-extern void
-uSetErrorPrefix(char *pre);
-
-extern void
-uFinishUp(void);
-
-
/***====================================================================***/
#define NullString ((char *)NULL)
@@ -173,109 +160,4 @@ uStrCasePrefix(const char *p, char *str);
extern unsigned int DEBUG_VAR;
-extern __ATTR_PRINTF(1, 2) void
-uDebug(char *s, ...);
-
-extern __ATTR_PRINTF(1, 2) void
-uDebugNOI(char *s, ...);
-
-extern Boolean
-uSetDebugFile(char *name);
-
-extern FILE *uDebugFile;
-extern int uDebugIndentLevel;
-extern int uDebugIndentSize;
-
-#define uDebugIndent(l) (uDebugIndentLevel+=(l))
-#define uDebugOutdent(l) (uDebugIndentLevel-=(l))
-#ifdef DEBUG_ON
-#define uDEBUG(f,s) { if (DEBUG_VAR&(f)) uDebug(s);}
-#define uDEBUG1(f,s,a) { if (DEBUG_VAR&(f)) uDebug(s,a);}
-#define uDEBUG2(f,s,a,b) { if (DEBUG_VAR&(f)) uDebug(s,a,b);}
-#define uDEBUG3(f,s,a,b,c) { if (DEBUG_VAR&(f)) uDebug(s,a,b,c);}
-#define uDEBUG4(f,s,a,b,c,d) { if (DEBUG_VAR&(f)) uDebug(s,a,b,c,d);}
-#define uDEBUG5(f,s,a,b,c,d,e) { if (DEBUG_VAR&(f)) uDebug(s,a,b,c,d,e);}
-#define uDEBUG_NOI(f,s) { if (DEBUG_VAR&(f)) uDebug(s);}
-#define uDEBUG_NOI1(f,s,a) { if (DEBUG_VAR&(f)) uDebugNOI(s,a);}
-#define uDEBUG_NOI2(f,s,a,b) { if (DEBUG_VAR&(f)) uDebugNOI(s,a,b);}
-#define uDEBUG_NOI3(f,s,a,b,c) { if (DEBUG_VAR&(f)) uDebugNOI(s,a,b,c);}
-#define uDEBUG_NOI4(f,s,a,b,c,d) { if (DEBUG_VAR&(f)) uDebugNOI(s,a,b,c,d);}
-#define uDEBUG_NOI5(f,s,a,b,c,d,e) { if (DEBUG_VAR&(f)) uDebugNOI(s,a,b,c,d,e);}
-#else
-#define uDEBUG(f,s)
-#define uDEBUG1(f,s,a)
-#define uDEBUG2(f,s,a,b)
-#define uDEBUG3(f,s,a,b,c)
-#define uDEBUG4(f,s,a,b,c,d)
-#define uDEBUG5(f,s,a,b,c,d,e)
-#define uDEBUG_NOI(f,s)
-#define uDEBUG_NOI1(f,s,a)
-#define uDEBUG_NOI2(f,s,a,b)
-#define uDEBUG_NOI3(f,s,a,b,c)
-#define uDEBUG_NOI4(f,s,a,b,c,d)
-#define uDEBUG_NOI5(f,s,a,b,c,d,e)
-#endif
-
-extern Boolean
-uSetEntryFile(char *name);
-
-extern __ATTR_PRINTF(2, 3) void
-uEntry(int l, char *s, ...);
-
-extern void
-uExit(int l, char *rtVal);
-
-#ifdef ENTRY_TRACKING_ON
-#define ENTRY_BIT 0x10
-#define LOW_ENTRY_BIT 0x1000
-#define ENTER (DEBUG_VAR&ENTRY_BIT)
-#define FLAG(fLag) (DEBUG_VAR&(fLag))
-
-extern int uEntryLevel;
-
-#define uENTRY(s) { if (ENTER) uEntry(1,s);}
-#define uENTRY1(s,a) { if (ENTER) uEntry(1,s,a);}
-#define uENTRY2(s,a,b) { if (ENTER) uEntry(1,s,a,b);}
-#define uENTRY3(s,a,b,c) { if (ENTER) uEntry(1,s,a,b,c);}
-#define uENTRY4(s,a,b,c,d) { if (ENTER) uEntry(1,s,a,b,c,d);}
-#define uENTRY5(s,a,b,c,d,e) { if (ENTER) uEntry(1,s,a,b,c,d,e);}
-#define uENTRY6(s,a,b,c,d,e,f) { if (ENTER) uEntry(1,s,a,b,c,d,e,f);}
-#define uENTRY7(s,a,b,c,d,e,f,g) { if (ENTER) uEntry(1,s,a,b,c,d,e,f,g);}
-#define uRETURN(v) { if (ENTER) uEntryLevel--; return(v); }
-#define uVOIDRETURN { if (ENTER) uEntryLevel--; return; }
-
-#define uFLAG_ENTRY(w,s) { if (FLAG(w)) uEntry(0,s);}
-#define uFLAG_ENTRY1(w,s,a) { if (FLAG(w)) uEntry(0,s,a);}
-#define uFLAG_ENTRY2(w,s,a,b) { if (FLAG(w)) uEntry(0,s,a,b);}
-#define uFLAG_ENTRY3(w,s,a,b,c) { if (FLAG(w)) uEntry(0,s,a,b,c);}
-#define uFLAG_ENTRY4(w,s,a,b,c,d) { if (FLAG(w)) uEntry(0,s,a,b,c,d);}
-#define uFLAG_ENTRY5(w,s,a,b,c,d,e) { if (FLAG(w)) uEntry(0,s,a,b,c,d,e);}
-#define uFLAG_ENTRY6(w,s,a,b,c,d,e,f) { if (FLAG(w)) uEntry(0,s,a,b,c,d,e,f);}
-#define uFLAG_ENTRY7(w,s,a,b,c,d,e,f,g) { if(FLAG(w))uEntry(0,s,a,b,c,d,e,f,g);}
-#define uFLAG_RETURN(v) { return(v);}
-#define uFLAG_VOIDRETURN { return; }
-#else
-#define uENTRY(s)
-#define uENTRY1(s,a)
-#define uENTRY2(s,a1,a2)
-#define uENTRY3(s,a1,a2,a3)
-#define uENTRY4(s,a1,a2,a3,a4)
-#define uENTRY5(s,a1,a2,a3,a4,a5)
-#define uENTRY6(s,a1,a2,a3,a4,a5,a6)
-#define uENTRY7(s,a1,a2,a3,a4,a5,a6,a7)
-#define uRETURN(v) { return(v); }
-#define uVOIDRETURN { return; }
-
-#define uFLAG_ENTRY(f,s)
-#define uFLAG_ENTRY1(f,s,a)
-#define uFLAG_ENTRY2(f,s,a,b)
-#define uFLAG_ENTRY3(f,s,a,b,c)
-#define uFLAG_ENTRY4(f,s,a,b,c,d)
-#define uFLAG_ENTRY5(f,s,a,b,c,d,e)
-#define uFLAG_ENTRY6(f,s,a,b,c,d,e,g)
-#define uFLAG_ENTRY7(f,s,a,b,c,d,e,g,h)
-#define uFLAG_RETURN(v) { return(v);}
-#define uFLAG_VOIDRETURN { return; }
-#endif
-
#endif /* UTILS_H */
diff --git a/src/xkbcomp/vmod.c b/src/xkbcomp/vmod.c
index 63fc560..2c8ac02 100644
--- a/src/xkbcomp/vmod.c
+++ b/src/xkbcomp/vmod.c
@@ -161,7 +161,7 @@ HandleVModDef(VModDef * stmt, unsigned mergeMode, VModInfo * info)
* @return True on success, False otherwise. If False is returned, val_rtrn is
* undefined.
*/
-int
+static int
LookupVModIndex(char * priv,
uint32_t elem, uint32_t field, unsigned type, ExprResult * val_rtrn)
{
diff --git a/src/xkbcomp/vmod.h b/src/xkbcomp/vmod.h
index 13bd50c..e8833fc 100644
--- a/src/xkbcomp/vmod.h
+++ b/src/xkbcomp/vmod.h
@@ -53,13 +53,6 @@ extern Bool ApplyVModDefs(VModInfo * /* info */ ,
struct xkb_desc * /* xkb */
);
-extern int LookupVModIndex(char * /* priv */ ,
- uint32_t /* elem */ ,
- uint32_t /* field */ ,
- unsigned /* type */ ,
- ExprResult * /* val_rtrn */
- );
-
extern int LookupVModMask(char * /* priv */ ,
uint32_t /* elem */ ,
uint32_t /* field */ ,
diff --git a/src/xkbcomp/xkbparse.y b/src/xkbcomp/xkbparse.y
index ae37f7a..713cc1d 100644
--- a/src/xkbcomp/xkbparse.y
+++ b/src/xkbcomp/xkbparse.y
@@ -92,15 +92,12 @@
#ifdef DEBUG
#define YYDEBUG 1
#endif
-#define DEBUG_VAR parseDebug
#include "parseutils.h"
#include "xkbmisc.h"
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include <stdlib.h>
-unsigned int parseDebug;
-
%}
%right EQUALS
%left PLUS MINUS
diff --git a/src/xkbcomp/xkbpath.c b/src/xkbcomp/xkbpath.c
index 64048db..6b7bf21 100644
--- a/src/xkbcomp/xkbpath.c
+++ b/src/xkbcomp/xkbpath.c
@@ -157,10 +157,13 @@ XkbParseIncludeMap(char **str_inout, char **file_rtrn, char **map_rtrn,
return True;
}
+static void
+XkbAddDefaultDirectoriesToPath(void);
+
/**
* Init memory for include paths.
*/
-Bool
+static Bool
XkbInitIncludePath(void)
{
if (includePath)
@@ -175,20 +178,10 @@ XkbInitIncludePath(void)
return True;
}
-void
-XkbAddDefaultDirectoriesToPath(void)
-{
- if (!XkbInitIncludePath())
- return;
- if (noDefaultPath)
- return;
- XkbAddDirectoryToPath(DFLT_XKB_CONFIG_ROOT);
-}
-
/**
* Remove all entries from the global includePath.
*/
-void
+static void
XkbClearIncludePath(void)
{
register int i;
@@ -213,7 +206,7 @@ XkbClearIncludePath(void)
* Add the given path to the global includePath variable.
* If dir is NULL, the includePath is emptied.
*/
-Bool
+static Bool
XkbAddDirectoryToPath(const char *dir)
{
int len;
@@ -256,6 +249,16 @@ XkbAddDirectoryToPath(const char *dir)
return True;
}
+static void
+XkbAddDefaultDirectoriesToPath(void)
+{
+ if (!XkbInitIncludePath())
+ return;
+ if (noDefaultPath)
+ return;
+ XkbAddDirectoryToPath(DFLT_XKB_CONFIG_ROOT);
+}
+
/***====================================================================***/
/**
diff --git a/src/xkbcomp/xkbpath.h b/src/xkbcomp/xkbpath.h
index 3cf582e..ca818a5 100644
--- a/src/xkbcomp/xkbpath.h
+++ b/src/xkbcomp/xkbpath.h
@@ -31,15 +31,6 @@
#include <X11/X.h>
#include <X11/Xdefs.h>
-extern Bool XkbInitIncludePath(void);
-
-extern void XkbClearIncludePath(void);
-
-extern void XkbAddDefaultDirectoriesToPath(void);
-
-extern Bool XkbAddDirectoryToPath(const char * /* dir */
- );
-
extern char *XkbDirectoryForInclude(unsigned /* type */
);
diff --git a/src/xkbcomp/xkbscan.c b/src/xkbcomp/xkbscan.c
index e03813c..4f8f9e6 100644
--- a/src/xkbcomp/xkbscan.c
+++ b/src/xkbcomp/xkbscan.c
@@ -29,12 +29,9 @@
#include <X11/Xos.h>
#include "tokens.h"
-#define DEBUG_VAR scanDebug
#include "utils.h"
#include "parseutils.h"
-unsigned int scanDebug;
-
FILE *yyin = NULL;
static char scanFileBuf[1024] = {0};
diff --git a/src/xkbgeom.h b/src/xkbgeom.h
index 3ab4311..1e42830 100644
--- a/src/xkbgeom.h
+++ b/src/xkbgeom.h
@@ -32,100 +32,17 @@ authorization from the authors.
#include "X11/extensions/XKBcommon.h"
extern void
-XkbcFreeGeomProperties(struct xkb_geometry * geom, int first, int count, Bool freeAll);
-
-extern void
-XkbcFreeGeomKeyAliases(struct xkb_geometry * geom, int first, int count, Bool freeAll);
-
-extern void
-XkbcFreeGeomColors(struct xkb_geometry * geom, int first, int count, Bool freeAll);
-
-extern void
-XkbcFreeGeomPoints(struct xkb_outline * outline, int first, int count, Bool freeAll);
-
-extern void
-XkbcFreeGeomOutlines(struct xkb_shape * shape, int first, int count, Bool freeAll);
-
-extern void
-XkbcFreeGeomShapes(struct xkb_geometry * geom, int first, int count, Bool freeAll);
-
-extern void
-XkbcFreeGeomOverlayKeys(struct xkb_overlay_row * row, int first, int count,
- Bool freeAll);
-
-extern void
-XkbcFreeGeomOverlayRows(struct xkb_overlay * overlay, int first, int count,
- Bool freeAll);
-
-extern void
-XkbcFreeGeomOverlays(struct xkb_section * section, int first, int count, Bool freeAll);
-
-extern void
-XkbcFreeGeomKeys(struct xkb_row * row, int first, int count, Bool freeAll);
-
-extern void
-XkbcFreeGeomRows(struct xkb_section * section, int first, int count, Bool freeAll);
-
-extern void
-XkbcFreeGeomSections(struct xkb_geometry * geom, int first, int count, Bool freeAll);
-
-extern void
-XkbcFreeGeomDoodads(union xkb_doodad * doodads, int nDoodads, Bool freeAll);
-
-extern void
XkbcFreeGeometry(struct xkb_geometry * geom, unsigned which, Bool freeMap);
extern int
-XkbcAllocGeomProps(struct xkb_geometry * geom, int nProps);
-
-extern int
-XkbcAllocGeomColors(struct xkb_geometry * geom, int nColors);
-
-extern int
XkbcAllocGeomKeyAliases(struct xkb_geometry * geom, int nKeyAliases);
extern int
-XkbcAllocGeomShapes(struct xkb_geometry * geom, int nShapes);
-
-extern int
-XkbcAllocGeomSections(struct xkb_geometry * geom, int nSections);
-
-extern int
-XkbcAllocGeomOverlays(struct xkb_section * section, int nOverlays);
-
-extern int
-XkbcAllocGeomOverlayRows(struct xkb_overlay * overlay, int nRows);
-
-extern int
-XkbcAllocGeomOverlayKeys(struct xkb_overlay_row * row, int nKeys);
-
-extern int
-XkbcAllocGeomDoodads(struct xkb_geometry * geom, int nDoodads);
-
-extern int
-XkbcAllocGeomSectionDoodads(struct xkb_section * section, int nDoodads);
-
-extern int
-XkbcAllocGeomOutlines(struct xkb_shape * shape, int nOL);
-
-extern int
-XkbcAllocGeomRows(struct xkb_section * section, int nRows);
-
-extern int
-XkbcAllocGeomPoints(struct xkb_outline * ol, int nPts);
-
-extern int
-XkbcAllocGeomKeys(struct xkb_row * row, int nKeys);
-
-extern int
XkbcAllocGeometry(struct xkb_desc * xkb, struct xkb_geometry_sizes * sizes);
extern struct xkb_property *
XkbcAddGeomProperty(struct xkb_geometry * geom, const char *name, const char *value);
-extern struct xkb_key_alias *
-XkbcAddGeomKeyAlias(struct xkb_geometry * geom, const char *aliasStr, const char *realStr);
-
extern struct xkb_color *
XkbcAddGeomColor(struct xkb_geometry * geom, const char *spec, unsigned int pixel);
@@ -148,10 +65,6 @@ XkbcAddGeomSection(struct xkb_geometry * geom, uint32_t name,
extern union xkb_doodad *
XkbcAddGeomDoodad(struct xkb_geometry * geom, struct xkb_section * section, uint32_t name);
-extern struct xkb_overlay_key *
-XkbcAddGeomOverlayKey(struct xkb_overlay * overlay, struct xkb_overlay_row * row,
- const char *over, const char *under);
-
extern struct xkb_overlay_row *
XkbcAddGeomOverlayRow(struct xkb_overlay * overlay, int row_under, int sz_keys);
@@ -164,12 +77,6 @@ extern Bool
XkbcComputeShapeBounds(struct xkb_shape * shape);
extern Bool
-XkbcComputeShapeTop(struct xkb_shape * shape, struct xkb_bounds * bounds);
-
-extern Bool
-XkbcComputeRowBounds(struct xkb_geometry * geom, struct xkb_section * section, struct xkb_row * row);
-
-extern Bool
XkbcComputeSectionBounds(struct xkb_geometry * geom, struct xkb_section * section);
#endif /* _XKBGEOM_H_ */
diff --git a/src/xkbmisc.h b/src/xkbmisc.h
index dcb53b7..2cc7cf0 100644
--- a/src/xkbmisc.h
+++ b/src/xkbmisc.h
@@ -79,9 +79,6 @@ extern const char *
XkbcAtomText(uint32_t atm);
extern char *
-XkbcVModIndexText(struct xkb_desc * xkb, unsigned ndx);
-
-extern char *
XkbcVModMaskText(struct xkb_desc * xkb, unsigned modMask, unsigned mask);
extern char *
diff --git a/src/xkbrules.h b/src/xkbrules.h
index cc54c9a..ce3e1a3 100644
--- a/src/xkbrules.h
+++ b/src/xkbrules.h
@@ -152,39 +152,9 @@ extern Bool
XkbcRF_GetComponents(XkbRF_RulesPtr rules, XkbRF_VarDefsPtr defs,
struct xkb_component_names * names);
-extern XkbRF_RulePtr
-XkbcRF_AddRule(XkbRF_RulesPtr rules);
-
-extern XkbRF_GroupPtr
-XkbcRF_AddGroup(XkbRF_RulesPtr rules);
-
extern Bool
XkbcRF_LoadRules(FILE *file, XkbRF_RulesPtr rules);
-extern Bool
-XkbcRF_LoadRulesByName(char *base, char *locale, XkbRF_RulesPtr rules);
-
-extern XkbRF_VarDescPtr
-XkbcRF_AddVarDesc(XkbRF_DescribeVarsPtr vars);
-
-extern XkbRF_VarDescPtr
-XkbcRF_AddVarDescCopy(XkbRF_DescribeVarsPtr vars, XkbRF_VarDescPtr from);
-
-extern XkbRF_DescribeVarsPtr
-XkbcRF_AddVarToDescribe(XkbRF_RulesPtr rules, char *name);
-
-extern Bool
-XkbcRF_LoadDescriptions(FILE *file, XkbRF_RulesPtr rules);
-
-extern Bool
-XkbcRF_LoadDescriptionsByName(char *base, char *locale, XkbRF_RulesPtr rules);
-
-extern XkbRF_RulesPtr
-XkbcRF_Load(char *base, char *locale, Bool wantDesc, Bool wantRules);
-
-extern XkbRF_RulesPtr
-XkbcRF_Create(int szRules, int szExtra);
-
extern void
XkbcRF_Free(XkbRF_RulesPtr rules, Bool freeRules);