* renaming stream functions to the FT_Subject_Action scheme: FT_Seek_Stream => FT_Stream_Seek FT_Skip_Stream => FT_Stream_Skip FT_Read_Stream => FT_Stream_Read FT_Read_Stream_At => FT_Stream_Read_At FT_Access_Frame => FT_Stream_Enter_Frame FT_Forget_Frame => FT_Stream_Exit_Frame FT_Extract_Frame => FT_Stream_Extract_Frame FT_Release_Frame => FT_Stream_Release_Frame FT_Get_XXXX => FT_Stream_Get_XXXX FT_Read_XXXX => FT_Stream_Read_XXXX note also that: FT_New_Stream( filename, stream ) => FT_Stream_Open( stream, filename ) (the function doesn't create the FT_Stream structure, it simply initializes it for reading) FT_New_Memory_Stream( library, FT_Byte* base, size, stream ) => FT_Stream_Open_Memory( stream, const FT_Byte* base, size ) FT_Done_Stream => FT_Stream_Close note that the name of the stream methods, defined in "include/freetype/ftsystem.h" have also been changed without problems: FT_Stream_IO => FT_Stream_IOFunc FT_Stream_Close => FT_Stream_CloseFunc
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
diff --git a/ChangeLog b/ChangeLog
index 0f31ff4..325fabe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,43 @@
2002-02-24 David Turner <david@freetype.org>
+ * renaming stream functions to the FT_Subject_Action scheme:
+
+ FT_Seek_Stream => FT_Stream_Seek
+ FT_Skip_Stream => FT_Stream_Skip
+ FT_Read_Stream => FT_Stream_Read
+ FT_Read_Stream_At => FT_Stream_Read_At
+ FT_Access_Frame => FT_Stream_Enter_Frame
+ FT_Forget_Frame => FT_Stream_Exit_Frame
+ FT_Extract_Frame => FT_Stream_Extract_Frame
+ FT_Release_Frame => FT_Stream_Release_Frame
+ FT_Get_XXXX => FT_Stream_Get_XXXX
+ FT_Read_XXXX => FT_Stream_Read_XXXX
+
+ note also that:
+
+ FT_New_Stream( filename, stream ) =>
+ FT_Stream_Open( stream, filename )
+
+ (the function doesn't create the FT_Stream structure, it simply
+ initializes it for reading)
+
+ FT_New_Memory_Stream( library, FT_Byte* base, size, stream ) =>
+ FT_Stream_Open_Memory( stream, const FT_Byte* base, size )
+
+ FT_Done_Stream => FT_Stream_Close
+
+ note that the name of the stream methods, defined in
+ "include/freetype/ftsystem.h" have also been changed without
+ problems:
+
+ FT_Stream_IO => FT_Stream_IOFunc
+ FT_Stream_Close => FT_Stream_CloseFunc
+
+
+
+ * moving all memory and list management code to "src/base/ftutil.c"
+ (previously in "ftobjs.c" and "ftlist.c" respectively)
+
* moving all code related to glyph loaders to "internal/ftgloadr.h"
and "src/base/ftgloadr.c".
diff --git a/builds/amiga/src/base/ftsystem.c b/builds/amiga/src/base/ftsystem.c
index a1a5802..f5ef85b 100644
--- a/builds/amiga/src/base/ftsystem.c
+++ b/builds/amiga/src/base/ftsystem.c
@@ -307,22 +307,22 @@ void FreeVecPooled(APTR poolHeader, APTR memory)
/* documentation is in ftobjs.h */
FT_EXPORT_DEF( FT_Error )
- FT_New_Stream( const char* filepathname,
- FT_Stream astream )
+ FT_Stream_Open( FT_Stream stream,
+ const char* filepathname )
{
// FILE* file;
BPTR file; // TetiSoft
struct FileInfoBlock *fib; // TetiSoft
- if ( !astream )
+ if ( !stream )
return FT_Err_Invalid_Stream_Handle;
// file = fopen( filepathname, "rb" );
file = Open( filepathname, MODE_OLDFILE ); // TetiSoft
if ( !file )
{
- FT_ERROR(( "FT_New_Stream:" ));
+ FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not open `%s'\n", filepathname ));
return FT_Err_Cannot_Open_Resource;
@@ -335,7 +335,7 @@ void FreeVecPooled(APTR poolHeader, APTR memory)
if ( !fib )
{
Close ( file );
- FT_ERROR(( "FT_New_Stream:" ));
+ FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not open `%s'\n", filepathname ));
return FT_Err_Cannot_Open_Resource;
@@ -344,26 +344,26 @@ void FreeVecPooled(APTR poolHeader, APTR memory)
{
FreeDosObject(DOS_FIB, fib);
Close ( file );
- FT_ERROR(( "FT_New_Stream:" ));
+ FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not open `%s'\n", filepathname ));
return FT_Err_Cannot_Open_Resource;
}
- astream->size = fib->fib_Size;
+ stream->size = fib->fib_Size;
FreeDosObject(DOS_FIB, fib);
-// astream->descriptor.pointer = file;
- astream->descriptor.pointer = (void *)file;
+// stream->descriptor.pointer = file;
+ stream->descriptor.pointer = (void *)file;
- astream->pathname.pointer = (char*)filepathname;
- astream->pos = 0;
+ stream->pathname.pointer = (char*)filepathname;
+ stream->pos = 0;
- astream->read = ft_io_stream;
- astream->close = ft_close_stream;
+ stream->read = ft_io_stream;
+ stream->close = ft_close_stream;
- FT_TRACE1(( "FT_New_Stream:" ));
+ FT_TRACE1(( "FT_Stream_Open:" ));
FT_TRACE1(( " opened `%s' (%d bytes) successfully\n",
- filepathname, astream->size ));
+ filepathname, stream->size ));
return FT_Err_Ok;
}
@@ -374,12 +374,12 @@ void FreeVecPooled(APTR poolHeader, APTR memory)
extern FT_Int
ft_mem_debug_init( FT_Memory memory );
-
+
extern void
ft_mem_debug_done( FT_Memory memory );
-
-#endif
-
+
+#endif
+
/* documentation is in ftobjs.h */
@@ -411,7 +411,7 @@ void FreeVecPooled(APTR poolHeader, APTR memory)
memory->free = ft_free;
#ifdef FT_DEBUG_MEMORY
ft_mem_debug_init( memory );
-#endif
+#endif
}
}
@@ -426,7 +426,7 @@ void FreeVecPooled(APTR poolHeader, APTR memory)
{
#ifdef FT_DEBUG_MEMORY
ft_mem_debug_done( memory );
-#endif
+#endif
#ifdef __GNUC__
DeletePool( memory->user );
diff --git a/builds/unix/ftsystem.c b/builds/unix/ftsystem.c
index d31c6d6..5683993 100644
--- a/builds/unix/ftsystem.c
+++ b/builds/unix/ftsystem.c
@@ -204,8 +204,8 @@
/* documentation is in ftobjs.h */
FT_EXPORT_DEF( FT_Error )
- FT_New_Stream( const char* filepathname,
- FT_Stream stream )
+ FT_Stream_Open( FT_Stream stream,
+ const char* filepathname )
{
int file;
struct stat stat_buf;
@@ -218,7 +218,7 @@
file = open( filepathname, O_RDONLY );
if ( file < 0 )
{
- FT_ERROR(( "FT_New_Stream:" ));
+ FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not open `%s'\n", filepathname ));
return FT_Err_Cannot_Open_Resource;
}
@@ -238,7 +238,7 @@
if ( fstat( file, &stat_buf ) < 0 )
{
- FT_ERROR(( "FT_New_Stream:" ));
+ FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not `fstat' file `%s'\n", filepathname ));
goto Fail_Map;
}
@@ -254,7 +254,7 @@
if ( (long)stream->base == -1 )
{
- FT_ERROR(( "FT_New_Stream:" ));
+ FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not `mmap' file `%s'\n", filepathname ));
goto Fail_Map;
}
@@ -267,7 +267,7 @@
stream->close = ft_close_stream;
stream->read = 0;
- FT_TRACE1(( "FT_New_Stream:" ));
+ FT_TRACE1(( "FT_Stream_Open:" ));
FT_TRACE1(( " opened `%s' (%d bytes) successfully\n",
filepathname, stream->size ));
@@ -288,12 +288,12 @@
extern FT_Int
ft_mem_debug_init( FT_Memory memory );
-
+
extern void
ft_mem_debug_done( FT_Memory memory );
-
-#endif
-
+
+#endif
+
/* documentation is in ftobjs.h */
@@ -312,7 +312,7 @@
memory->free = ft_free;
#ifdef FT_DEBUG_MEMORY
ft_mem_debug_init( memory );
-#endif
+#endif
}
return memory;
@@ -326,7 +326,7 @@
{
#ifdef FT_DEBUG_MEMORY
ft_mem_debug_done( memory );
-#endif
+#endif
memory->free( memory, memory );
}
diff --git a/builds/vms/ftsystem.c b/builds/vms/ftsystem.c
index d58c07c..dcd3185 100644
--- a/builds/vms/ftsystem.c
+++ b/builds/vms/ftsystem.c
@@ -204,8 +204,8 @@
/* documentation is in ftobjs.h */
FT_EXPORT_DEF( FT_Error )
- FT_New_Stream( const char* filepathname,
- FT_Stream stream )
+ FT_Stream_Open( FT_Stream stream,
+ const char* filepathname )
{
int file;
struct stat stat_buf;
@@ -218,14 +218,14 @@
file = open( filepathname, O_RDONLY );
if ( file < 0 )
{
- FT_ERROR(( "FT_New_Stream:" ));
+ FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not open `%s'\n", filepathname ));
return FT_Err_Cannot_Open_Resource;
}
if ( fstat( file, &stat_buf ) < 0 )
{
- FT_ERROR(( "FT_New_Stream:" ));
+ FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not `fstat' file `%s'\n", filepathname ));
goto Fail_Map;
}
@@ -241,7 +241,7 @@
if ( (long)stream->base == -1 )
{
- FT_ERROR(( "FT_New_Stream:" ));
+ FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not `mmap' file `%s'\n", filepathname ));
goto Fail_Map;
}
@@ -254,7 +254,7 @@
stream->close = ft_close_stream;
stream->read = 0;
- FT_TRACE1(( "FT_New_Stream:" ));
+ FT_TRACE1(( "FT_Stream_Open:" ));
FT_TRACE1(( " opened `%s' (%d bytes) successfully\n",
filepathname, stream->size ));
@@ -275,12 +275,12 @@
extern FT_Int
ft_mem_debug_init( FT_Memory memory );
-
+
extern void
ft_mem_debug_done( FT_Memory memory );
-
-#endif
-
+
+#endif
+
/* documentation is in ftobjs.h */
@@ -299,7 +299,7 @@
memory->free = ft_free;
#ifdef FT_DEBUG_MEMORY
ft_mem_debug_init( memory );
-#endif
+#endif
}
return memory;
@@ -313,7 +313,7 @@
{
#ifdef FT_DEBUG_MEMORY
ft_mem_debug_done( memory );
-#endif
+#endif
memory->free( memory, memory );
}
diff --git a/include/freetype/ftsystem.h b/include/freetype/ftsystem.h
index d6fc3e1..665f740 100644
--- a/include/freetype/ftsystem.h
+++ b/include/freetype/ftsystem.h
@@ -197,7 +197,7 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* @functype: */
- /* FT_Stream_IO */
+ /* FT_Stream_IoFunc */
/* */
/* @description: */
/* A function used to seek and read data from a given input stream. */
@@ -219,16 +219,16 @@ FT_BEGIN_HEADER
/* with a `count' of 0. */
/* */
typedef unsigned long
- (*FT_Stream_IO)( FT_Stream stream,
- unsigned long offset,
- unsigned char* buffer,
- unsigned long count );
+ (*FT_Stream_IoFunc)( FT_Stream stream,
+ unsigned long offset,
+ unsigned char* buffer,
+ unsigned long count );
/*************************************************************************/
/* */
/* @functype: */
- /* FT_Stream_Close */
+ /* FT_Stream_CloseFunc */
/* */
/* @description: */
/* A function used to close a given input stream. */
@@ -237,7 +237,7 @@ FT_BEGIN_HEADER
/* stream :: A handle to the target stream. */
/* */
typedef void
- (*FT_Stream_Close)( FT_Stream stream );
+ (*FT_Stream_CloseFunc)( FT_Stream stream );
/*************************************************************************/
@@ -281,18 +281,18 @@ FT_BEGIN_HEADER
/* */
struct FT_StreamRec_
{
- unsigned char* base;
- unsigned long size;
- unsigned long pos;
-
- FT_StreamDesc descriptor;
- FT_StreamDesc pathname;
- FT_Stream_IO read;
- FT_Stream_Close close;
-
- FT_Memory memory;
- unsigned char* cursor;
- unsigned char* limit;
+ unsigned char* base;
+ unsigned long size;
+ unsigned long pos;
+
+ FT_StreamDesc descriptor;
+ FT_StreamDesc pathname;
+ FT_Stream_IoFunc read;
+ FT_Stream_CloseFunc close;
+
+ FT_Memory memory;
+ unsigned char* cursor;
+ unsigned char* limit;
};
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index a6bd132..092ae3f 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -638,43 +638,6 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Function> */
- /* FT_New_Stream */
- /* */
- /* <Description> */
- /* Creates a new stream object. */
- /* */
- /* <Input> */
- /* filepathname :: The name of the stream (usually a file) to be */
- /* opened. */
- /* */
- /* stream :: A pointer to the stream object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- FT_EXPORT( FT_Error )
- FT_New_Stream( const char* filepathname,
- FT_Stream astream );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Stream */
- /* */
- /* <Description> */
- /* Closes and destroys a stream object. */
- /* */
- /* <Input> */
- /* stream :: The stream to be closed and destroyed. */
- /* */
- FT_EXPORT( void )
- FT_Done_Stream( FT_Stream stream );
-
-
- /*************************************************************************/
- /* */
- /* <Function> */
/* FT_New_Memory */
/* */
/* <Description> */
diff --git a/include/freetype/internal/ftstream.h b/include/freetype/internal/ftstream.h
index eee8bd9..e5f029b 100644
--- a/include/freetype/internal/ftstream.h
+++ b/include/freetype/internal/ftstream.h
@@ -27,6 +27,15 @@
FT_BEGIN_HEADER
+
+
+
+
+
+
+
+
+
/* format of an 8-bit frame_op value = [ xxxxx | e | s ] */
/* s is set to 1 if the value is signed, */
/* e is set to 1 if the value is little-endian */
@@ -258,174 +267,234 @@ FT_BEGIN_HEADER
#define GET_Char() FT_GET_MACRO( FT_Get_Char, FT_Char )
#define GET_Byte() FT_GET_MACRO( FT_Get_Char, FT_Byte )
-#define GET_Short() FT_GET_MACRO( FT_Get_Short, FT_Short )
-#define GET_UShort() FT_GET_MACRO( FT_Get_Short, FT_UShort )
-#define GET_Offset() FT_GET_MACRO( FT_Get_Offset, FT_Long )
-#define GET_UOffset() FT_GET_MACRO( FT_Get_Offset, FT_ULong )
-#define GET_Long() FT_GET_MACRO( FT_Get_Long, FT_Long )
-#define GET_ULong() FT_GET_MACRO( FT_Get_Long, FT_ULong )
-#define GET_Tag4() FT_GET_MACRO( FT_Get_Long, FT_ULong )
-
-#define GET_ShortLE() FT_GET_MACRO( FT_Get_ShortLE, FT_Short )
-#define GET_UShortLE() FT_GET_MACRO( FT_Get_ShortLE, FT_UShort )
-#define GET_LongLE() FT_GET_MACRO( FT_Get_LongLE, FT_Long )
-#define GET_ULongLE() FT_GET_MACRO( FT_Get_LongLE, FT_ULong )
+#define GET_Short() FT_GET_MACRO( FT_Stream_Get_Short, FT_Short )
+#define GET_UShort() FT_GET_MACRO( FT_Stream_Get_Short, FT_UShort )
+#define GET_Offset() FT_GET_MACRO( FT_Stream_Get_Offset, FT_Long )
+#define GET_UOffset() FT_GET_MACRO( FT_Stream_Get_Offset, FT_ULong )
+#define GET_Long() FT_GET_MACRO( FT_Stream_Get_Long, FT_Long )
+#define GET_ULong() FT_GET_MACRO( FT_Stream_Get_Long, FT_ULong )
+#define GET_Tag4() FT_GET_MACRO( FT_Stream_Get_Long, FT_ULong )
+
+#define GET_ShortLE() FT_GET_MACRO( FT_Stream_Get_ShortLE, FT_Short )
+#define GET_UShortLE() FT_GET_MACRO( FT_Stream_Get_ShortLE, FT_UShort )
+#define GET_LongLE() FT_GET_MACRO( FT_Stream_Get_LongLE, FT_Long )
+#define GET_ULongLE() FT_GET_MACRO( FT_Stream_Get_LongLE, FT_ULong )
#define FT_READ_MACRO( func, type, var ) \
( var = (type)func( stream, &error ), \
error != FT_Err_Ok )
-#define READ_Byte( var ) FT_READ_MACRO( FT_Read_Char, FT_Byte, var )
-#define READ_Char( var ) FT_READ_MACRO( FT_Read_Char, FT_Char, var )
-#define READ_Short( var ) FT_READ_MACRO( FT_Read_Short, FT_Short, var )
-#define READ_UShort( var ) FT_READ_MACRO( FT_Read_Short, FT_UShort, var )
-#define READ_Offset( var ) FT_READ_MACRO( FT_Read_Offset, FT_Long, var )
-#define READ_UOffset( var ) FT_READ_MACRO( FT_Read_Offset, FT_ULong, var )
-#define READ_Long( var ) FT_READ_MACRO( FT_Read_Long, FT_Long, var )
-#define READ_ULong( var ) FT_READ_MACRO( FT_Read_Long, FT_ULong, var )
+#define READ_Byte( var ) FT_READ_MACRO( FT_Stream_Read_Char, FT_Byte, var )
+#define READ_Char( var ) FT_READ_MACRO( FT_Stream_Read_Char, FT_Char, var )
+#define READ_Short( var ) FT_READ_MACRO( FT_Stream_Read_Short, FT_Short, var )
+#define READ_UShort( var ) FT_READ_MACRO( FT_Stream_Read_Short, FT_UShort, var )
+#define READ_Offset( var ) FT_READ_MACRO( FT_Stream_Read_Offset, FT_Long, var )
+#define READ_UOffset( var ) FT_READ_MACRO( FT_Stream_Read_Offset, FT_ULong, var )
+#define READ_Long( var ) FT_READ_MACRO( FT_Stream_Read_Long, FT_Long, var )
+#define READ_ULong( var ) FT_READ_MACRO( FT_Stream_Read_Long, FT_ULong, var )
+
+#define READ_ShortLE( var ) FT_READ_MACRO( FT_Stream_Read_ShortLE, FT_Short, var )
+#define READ_UShortLE( var ) FT_READ_MACRO( FT_Stream_Read_ShortLE, FT_UShort, var )
+#define READ_LongLE( var ) FT_READ_MACRO( FT_Stream_Read_LongLE, FT_Long, var )
+#define READ_ULongLE( var ) FT_READ_MACRO( FT_Stream_Read_LongLE, FT_ULong, var )
+
-#define READ_ShortLE( var ) FT_READ_MACRO( FT_Read_ShortLE, FT_Short, var )
-#define READ_UShortLE( var ) FT_READ_MACRO( FT_Read_ShortLE, FT_UShort, var )
-#define READ_LongLE( var ) FT_READ_MACRO( FT_Read_LongLE, FT_Long, var )
-#define READ_ULongLE( var ) FT_READ_MACRO( FT_Read_LongLE, FT_ULong, var )
+#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
+
+ /* initialize a stream for reading a regular system stream */
+ FT_EXPORT( FT_Error )
+ FT_Stream_Open( FT_Stream stream,
+ const char* filepathname );
+
+#endif /* FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
+
+
+ /* initialize a stream for reading in-memory data */
+ FT_BASE( void )
+ FT_Stream_Open_Memory( FT_Stream stream,
+ const FT_Byte* base,
+ FT_ULong size );
+
+ /* close a stream (does not destroy the stream structure) */
FT_BASE( void )
- FT_New_Memory_Stream( FT_Library library,
- FT_Byte* base,
- FT_ULong size,
- FT_Stream stream );
+ FT_Stream_Close( FT_Stream stream );
+
+ /* seek within a stream. position is relative to start of stream */
FT_BASE( FT_Error )
- FT_Seek_Stream( FT_Stream stream,
+ FT_Stream_Seek( FT_Stream stream,
FT_ULong pos );
+ /* skip bytes in a stream */
FT_BASE( FT_Error )
- FT_Skip_Stream( FT_Stream stream,
+ FT_Stream_Skip( FT_Stream stream,
FT_Long distance );
+ /* return current stream position */
FT_BASE( FT_Long )
FT_Stream_Pos( FT_Stream stream );
+ /* read bytes from a stream into a user-allocated buffer, returns an */
+ /* error if all bytes could not be read.. */
FT_BASE( FT_Error )
- FT_Read_Stream( FT_Stream stream,
+ FT_Stream_Read( FT_Stream stream,
FT_Byte* buffer,
FT_ULong count );
+ /* read bytes from a stream at a given position */
FT_BASE( FT_Error )
- FT_Read_Stream_At( FT_Stream stream,
+ FT_Stream_Read_At( FT_Stream stream,
FT_ULong pos,
FT_Byte* buffer,
FT_ULong count );
+ /* enter a frame of 'count' consecutive bytes in a stream. returns an */
+ /* error if the frame could not be read/accessed. The caller can use */
+ /* the FT_Stream_Get_XXX function to retrieve frame data without */
+ /* error checks.. */
+ /* */
+ /* you must _always_ call FT_Stream_Exit_Frame once you've entered */
+ /* a stream frame !! */
+ /* */
FT_BASE( FT_Error )
- FT_Access_Frame( FT_Stream stream,
- FT_ULong count );
+ FT_Stream_Enter_Frame( FT_Stream stream,
+ FT_ULong count );
+ /* exit a stream frame.. */
+ /* */
FT_BASE( void )
- FT_Forget_Frame( FT_Stream stream );
-
+ FT_Stream_Exit_Frame( FT_Stream stream );
+
+ /* extract a stream frame. if the stream is disk-based, a heap block */
+ /* is allocated and the frame bytes are read into it. if the stream */
+ /* is memory-based, this function simply set a pointer to the data */
+ /* */
+ /* useful to optimize access to memory-based streams transparently. */
+ /* */
+ /* all extracted frames must be "freed" with a call to the function */
+ /* FT_Stream_Release_Frame */
+ /* */
FT_BASE( FT_Error )
- FT_Extract_Frame( FT_Stream stream,
+ FT_Stream_Extract_Frame( FT_Stream stream,
FT_ULong count,
FT_Byte** pbytes );
+ /* release an extract frame (see FT_Stream_Extract_Frame) */
+ /* */
FT_BASE( void )
- FT_Release_Frame( FT_Stream stream,
+ FT_Stream_Release_Frame( FT_Stream stream,
FT_Byte** pbytes );
+ /* read a byte from an entered frame */
FT_BASE( FT_Char )
- FT_Get_Char( FT_Stream stream );
+ FT_Stream_Get_Char( FT_Stream stream );
+ /* read a 16-bit big-endian integer from an entered frame */
FT_BASE( FT_Short )
- FT_Get_Short( FT_Stream stream );
+ FT_Stream_Get_Short( FT_Stream stream );
+ /* read a 24-bit big-endian integer from an entered frame */
FT_BASE( FT_Long )
- FT_Get_Offset( FT_Stream stream );
+ FT_Stream_Get_Offset( FT_Stream stream );
+ /* read a 32-bit big-endian integer from an entered frame */
FT_BASE( FT_Long )
- FT_Get_Long( FT_Stream stream );
+ FT_Stream_Get_Long( FT_Stream stream );
+ /* read a 16-bit little-endian integer from an entered frame */
FT_BASE( FT_Short )
- FT_Get_ShortLE( FT_Stream stream );
+ FT_Stream_Get_ShortLE( FT_Stream stream );
+ /* read a 32-bit little-endian integer from an entered frame */
FT_BASE( FT_Long )
- FT_Get_LongLE( FT_Stream stream );
+ FT_Stream_Get_LongLE( FT_Stream stream );
+ /* read a byte from a stream */
FT_BASE( FT_Char )
- FT_Read_Char( FT_Stream stream,
- FT_Error* error );
+ FT_Stream_Read_Char( FT_Stream stream,
+ FT_Error* error );
+ /* read a 16-bit big-endian integer from a stream */
FT_BASE( FT_Short )
- FT_Read_Short( FT_Stream stream,
- FT_Error* error );
+ FT_Stream_Read_Short( FT_Stream stream,
+ FT_Error* error );
+ /* read a 24-bit big-endian integer from a stream */
FT_BASE( FT_Long )
- FT_Read_Offset( FT_Stream stream,
- FT_Error* error );
+ FT_Stream_Read_Offset( FT_Stream stream,
+ FT_Error* error );
+ /* read a 32-bit big-endian integer from a stream */
FT_BASE( FT_Long )
- FT_Read_Long( FT_Stream stream,
- FT_Error* error );
+ FT_Stream_Read_Long( FT_Stream stream,
+ FT_Error* error );
+ /* read a 16-bit little-endian integer from a stream */
FT_BASE( FT_Short )
- FT_Read_ShortLE( FT_Stream stream,
- FT_Error* error );
+ FT_Stream_Read_ShortLE( FT_Stream stream,
+ FT_Error* error );
+ /* read a 32-bit little-endian integer from a stream */
FT_BASE( FT_Long )
- FT_Read_LongLE( FT_Stream stream,
- FT_Error* error );
+ FT_Stream_Read_LongLE( FT_Stream stream,
+ FT_Error* error );
+ /* read a structure from a stream. The structure must be described */
+ /* by an array of FT_Frame_Field records.. */
FT_BASE( FT_Error )
- FT_Read_Fields( FT_Stream stream,
- const FT_Frame_Field* fields,
- void* structure );
+ FT_Stream_Read_Fields( FT_Stream stream,
+ const FT_Frame_Field* fields,
+ void* structure );
+
+
#define USE_Stream( resource, stream ) \
FT_SET_ERROR( FT_Open_Stream( resource, stream ) )
#define DONE_Stream( stream ) \
- FT_Done_Stream( stream )
+ FT_Stream_Close( stream )
#define ACCESS_Frame( size ) \
- FT_SET_ERROR( FT_Access_Frame( stream, size ) )
+ FT_SET_ERROR( FT_Stream_Enter_Frame( stream, size ) )
#define FORGET_Frame() \
- FT_Forget_Frame( stream )
+ FT_Stream_Exit_Frame( stream )
#define EXTRACT_Frame( size, bytes ) \
- FT_SET_ERROR( FT_Extract_Frame( stream, size, \
+ FT_SET_ERROR( FT_Stream_Extract_Frame( stream, size, \
(FT_Byte**)&(bytes) ) )
#define RELEASE_Frame( bytes ) \
- FT_Release_Frame( stream, (FT_Byte**)&(bytes) )
+ FT_Stream_Release_Frame( stream, (FT_Byte**)&(bytes) )
#define FILE_Seek( position ) \
- FT_SET_ERROR( FT_Seek_Stream( stream, position ) )
+ FT_SET_ERROR( FT_Stream_Seek( stream, position ) )
#define FILE_Skip( distance ) \
- FT_SET_ERROR( FT_Skip_Stream( stream, distance ) )
+ FT_SET_ERROR( FT_Stream_Skip( stream, distance ) )
#define FILE_Pos() \
FT_Stream_Pos( stream )
#define FILE_Read( buffer, count ) \
- FT_SET_ERROR( FT_Read_Stream( stream, \
+ FT_SET_ERROR( FT_Stream_Read( stream, \
(FT_Byte*)buffer, \
count ) )
#define FILE_Read_At( position, buffer, count ) \
- FT_SET_ERROR( FT_Read_Stream_At( stream, \
+ FT_SET_ERROR( FT_Stream_Read_At( stream, \
position, \
(FT_Byte*)buffer, \
count ) )
#define READ_Fields( fields, object ) \
- ( ( error = FT_Read_Fields( stream, fields, object ) ) != FT_Err_Ok )
+ ( ( error = FT_Stream_Read_Fields( stream, fields, object ) ) != FT_Err_Ok )
FT_END_HEADER
diff --git a/src/base/Jamfile b/src/base/Jamfile
index 3e2ff7e..6b9de21 100644
--- a/src/base/Jamfile
+++ b/src/base/Jamfile
@@ -10,8 +10,8 @@ SubDirHdrs [ FT2_SubDir src base ] ;
if $(FT2_MULTI)
{
- _sources = ftcalc ftgloadr ftlist ftobjs ftstream ftoutln ftnames fttrigon
- ftdbgmem ;
+ _sources = ftutil ftdbgmem ftstream ftcalc fttrigon ftgloadr ftoutln
+ ftobjs ftnames ;
}
else
{
diff --git a/src/base/ftapi.c b/src/base/ftapi.c
index b95c42a..8ae8e81 100644
--- a/src/base/ftapi.c
+++ b/src/base/ftapi.c
@@ -2011,7 +2011,7 @@
FT_BASE_DEF( void )
- FT_New_Memory_Stream( FT_Library library,
+ FT_Stream_OpenMemory( FT_Library library,
FT_Byte* base,
FT_ULong size,
FT_Stream stream )
@@ -2021,7 +2021,7 @@
FT_BASE_DEF( FT_Error )
- FT_Seek_Stream( FT_Stream stream,
+ FT_Stream_Seek( FT_Stream stream,
FT_ULong pos )
{
return FT_Stream_Seek( stream, pos );
@@ -2029,7 +2029,7 @@
FT_BASE_DEF( FT_Error )
- FT_Skip_Stream( FT_Stream stream,
+ FT_Stream_Skip( FT_Stream stream,
FT_Long distance )
{
return FT_Stream_Skip( stream, distance );
@@ -2037,7 +2037,7 @@
FT_BASE_DEF( FT_Error )
- FT_Read_Stream( FT_Stream stream,
+ FT_Stream_Read( FT_Stream stream,
FT_Byte* buffer,
FT_ULong count )
{
@@ -2046,7 +2046,7 @@
FT_BASE_DEF( FT_Error )
- FT_Read_Stream_At( FT_Stream stream,
+ FT_Stream_Read_At( FT_Stream stream,
FT_ULong pos,
FT_Byte* buffer,
FT_ULong count )
@@ -2056,7 +2056,7 @@
FT_BASE_DEF( FT_Error )
- FT_Extract_Frame( FT_Stream stream,
+ FT_Stream_Extract_Frame( FT_Stream stream,
FT_ULong count,
FT_Byte** pbytes )
{
@@ -2065,14 +2065,14 @@
FT_BASE_DEF( void )
- FT_Release_Frame( FT_Stream stream,
+ FT_Stream_Release_Frame( FT_Stream stream,
FT_Byte** pbytes )
{
FT_Stream_Release_Frame( stream, pbytes );
}
FT_BASE_DEF( FT_Error )
- FT_Access_Frame( FT_Stream stream,
+ FT_Stream_Enter_Frame( FT_Stream stream,
FT_ULong count )
{
return FT_Stream_Enter_Frame( stream, count );
@@ -2080,7 +2080,7 @@
FT_BASE_DEF( void )
- FT_Forget_Frame( FT_Stream stream )
+ FT_Stream_Exit_Frame( FT_Stream stream )
{
FT_Stream_Exit_Frame( stream );
}
diff --git a/src/base/ftbase.c b/src/base/ftbase.c
index 83e0ad0..9852d26 100644
--- a/src/base/ftbase.c
+++ b/src/base/ftbase.c
@@ -20,14 +20,14 @@
#define FT_MAKE_OPTION_SINGLE_OBJECT
+#include "ftutil.c"
+#include "ftdbgmem.c"
+#include "ftstream.c"
#include "ftcalc.c"
#include "fttrigon.c"
+#include "ftoutln.c"
#include "ftgloadr.c"
#include "ftobjs.c"
-#include "ftstream.c"
-#include "ftlist.c"
-#include "ftoutln.c"
#include "ftnames.c"
-#include "ftdbgmem.c"
/* END */
diff --git a/src/base/ftmac.c b/src/base/ftmac.c
index 0c96116..5e3ee78 100644
--- a/src/base/ftmac.c
+++ b/src/base/ftmac.c
@@ -465,7 +465,7 @@
if ( ALLOC( stream, sizeof ( *stream ) ) )
goto Exit;
- FT_New_Memory_Stream( library,
+ FT_Stream_OpenMemory( library,
base,
size,
stream );
@@ -518,7 +518,7 @@
(*aface)->face_flags &= ~FT_FACE_FLAG_EXTERNAL_STREAM;
else
{
- FT_Done_Stream( stream );
+ FT_Stream_Close( stream );
FREE( stream );
}
return error;
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 3a7e2b3..5d56b2e 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -33,121 +33,6 @@
/*************************************************************************/
/**** ****/
/**** ****/
- /**** M E M O R Y ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
- /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
- /* messages during execution. */
- /* */
-#undef FT_COMPONENT
-#define FT_COMPONENT trace_memory
-
-
- /* documentation is in ftmemory.h */
-
- FT_BASE_DEF( FT_Error )
- FT_Alloc( FT_Memory memory,
- FT_Long size,
- void* *P )
- {
- FT_ASSERT( P != 0 );
-
- if ( size > 0 )
- {
- *P = memory->alloc( memory, size );
- if ( !*P )
- {
- FT_ERROR(( "FT_Alloc:" ));
- FT_ERROR(( " Out of memory? (%ld requested)\n",
- size ));
-
- return FT_Err_Out_Of_Memory;
- }
- MEM_Set( *P, 0, size );
- }
- else
- *P = NULL;
-
- FT_TRACE7(( "FT_Alloc:" ));
- FT_TRACE7(( " size = %ld, block = 0x%08p, ref = 0x%08p\n",
- size, *P, P ));
-
- return FT_Err_Ok;
- }
-
-
- /* documentation is in ftmemory.h */
-
- FT_BASE_DEF( FT_Error )
- FT_Realloc( FT_Memory memory,
- FT_Long current,
- FT_Long size,
- void** P )
- {
- void* Q;
-
-
- FT_ASSERT( P != 0 );
-
- /* if the original pointer is NULL, call FT_Alloc() */
- if ( !*P )
- return FT_Alloc( memory, size, P );
-
- /* if the new block if zero-sized, clear the current one */
- if ( size <= 0 )
- {
- FT_Free( memory, P );
- return FT_Err_Ok;
- }
-
- Q = memory->realloc( memory, current, size, *P );
- if ( !Q )
- goto Fail;
-
- if ( size > current )
- memset( (char*)Q + current, 0, size - current );
-
- *P = Q;
- return FT_Err_Ok;
-
- Fail:
- FT_ERROR(( "FT_Realloc:" ));
- FT_ERROR(( " Failed (current %ld, requested %ld)\n",
- current, size ));
- return FT_Err_Out_Of_Memory;
- }
-
-
- /* documentation is in ftmemory.h */
-
- FT_BASE_DEF( void )
- FT_Free( FT_Memory memory,
- void** P )
- {
- FT_TRACE7(( "FT_Free:" ));
- FT_TRACE7(( " Freeing block 0x%08p, ref 0x%08p\n",
- P, P ? *P : (void*)0 ));
-
- if ( P && *P )
- {
- memory->free( memory, *P );
- *P = 0;
- }
- }
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
/**** S T R E A M ****/
/**** ****/
/**** ****/
@@ -156,19 +41,10 @@
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ft_new_input_stream */
- /* */
- /* <Description> */
- /* Creates a new input stream object from an FT_Open_Args structure. */
- /* */
- /* <Note> */
- /* The function expects a valid `astream' parameter. */
- /* */
+ /* create a new input stream from a FT_Open_Args structure */
+ /* */
static FT_Error
- ft_new_input_stream( FT_Library library,
+ ft_input_stream_new( FT_Library library,
FT_Open_Args* args,
FT_Stream* astream )
{
@@ -190,22 +66,23 @@
stream->memory = memory;
- /* now, look at the stream flags */
if ( args->flags & ft_open_memory )
{
- error = 0;
- FT_New_Memory_Stream( library,
+ /* create a memory-based stream */
+ FT_Stream_Open_Memory( stream,
(FT_Byte*)args->memory_base,
- args->memory_size,
- stream );
+ args->memory_size );
}
else if ( args->flags & ft_open_pathname )
{
- error = FT_New_Stream( args->pathname, stream );
+ /* create a normal system stream */
+ error = FT_Stream_Open( stream, args->pathname );
stream->pathname.pointer = args->pathname;
}
else if ( ( args->flags & ft_open_stream ) && args->stream )
{
+ /* use an existing, user-provided stream */
+
/* in this case, we do not need to allocate a new stream object */
/* since the caller is responsible for closing it himself */
FREE( stream );
@@ -216,6 +93,8 @@
if ( error )
FREE( stream );
+ else
+ stream->memory = memory; /* just to be certain */
*astream = stream;
@@ -224,37 +103,20 @@
}
- /* documentation is in ftobjs.h */
-
- FT_EXPORT_DEF( void )
- FT_Done_Stream( FT_Stream stream )
- {
- if ( stream && stream->close )
- {
- stream->close( stream );
- stream->close = 0;
- }
- }
-
static void
- ft_done_stream( FT_Stream* astream,
- FT_Int external )
+ ft_input_stream_free( FT_Stream stream,
+ FT_Int external )
{
- FT_Stream stream = *astream;
-
-
- if ( stream->close )
- stream->close( stream );
-
- if ( !external )
+ if ( stream )
{
FT_Memory memory = stream->memory;
+ FT_Stream_Close( stream );
- FREE( stream );
+ if ( !external )
+ FREE( stream );
}
- *astream = 0;
}
@@ -262,346 +124,6 @@
#define FT_COMPONENT trace_objs
-#if 0
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /**** ****/
- /**** ****/
- /**** G L Y P H L O A D E R ****/
- /**** ****/
- /**** ****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-
- /*************************************************************************/
- /* */
- /* The glyph loader is a simple object which is used to load a set of */
- /* glyphs easily. It is critical for the correct loading of composites. */
- /* */
- /* Ideally, one can see it as a stack of abstract `glyph' objects. */
- /* */
- /* loader.base Is really the bottom of the stack. It describes a */
- /* single glyph image made of the juxtaposition of */
- /* several glyphs (those `in the stack'). */
- /* */
- /* loader.current Describes the top of the stack, on which a new */
- /* glyph can be loaded. */
- /* */
- /* Rewind Clears the stack. */
- /* Prepare Set up `loader.current' for addition of a new glyph */
- /* image. */
- /* Add Add the `current' glyph image to the `base' one, */
- /* and prepare for another one. */
- /* */
- /* The glyph loader is now a base object. Each driver used to */
- /* re-implement it in one way or the other, which wasted code and */
- /* energy. */
- /* */
- /*************************************************************************/
-
-
- /* create a new glyph loader */
- FT_BASE_DEF( FT_Error )
- FT_GlyphLoader_New( FT_Memory memory,
- FT_GlyphLoader* *aloader )
- {
- FT_GlyphLoader* loader;
- FT_Error error;
-
-
- if ( !ALLOC( loader, sizeof ( *loader ) ) )
- {
- loader->memory = memory;
- *aloader = loader;
- }
- return error;
- }
-
-
- /* rewind the glyph loader - reset counters to 0 */
- FT_BASE_DEF( void )
- FT_GlyphLoader_Rewind( FT_GlyphLoader* loader )
- {
- FT_GlyphLoad* base = &loader->base;
- FT_GlyphLoad* current = &loader->current;
-
-
- base->outline.n_points = 0;
- base->outline.n_contours = 0;
- base->num_subglyphs = 0;
-
- *current = *base;
- }
-
-
- /* reset the glyph loader, frees all allocated tables */
- /* and starts from zero */
- FT_BASE_DEF( void )
- FT_GlyphLoader_Reset( FT_GlyphLoader* loader )
- {
- FT_Memory memory = loader->memory;
-
-
- FREE( loader->base.outline.points );
- FREE( loader->base.outline.tags );
- FREE( loader->base.outline.contours );
- FREE( loader->base.extra_points );
- FREE( loader->base.subglyphs );
-
- loader->max_points = 0;
- loader->max_contours = 0;
- loader->max_subglyphs = 0;
-
- FT_GlyphLoader_Rewind( loader );
- }
-
-
- /* delete a glyph loader */
- FT_BASE_DEF( void )
- FT_GlyphLoader_Done( FT_GlyphLoader* loader )
- {
- if ( loader )
- {
- FT_Memory memory = loader->memory;
-
-
- FT_GlyphLoader_Reset( loader );
- FREE( loader );
- }
- }
-
-
- /* re-adjust the `current' outline fields */
- static void
- FT_GlyphLoader_Adjust_Points( FT_GlyphLoader* loader )
- {
- FT_Outline* base = &loader->base.outline;
- FT_Outline* current = &loader->current.outline;
-
-
- current->points = base->points + base->n_points;
- current->tags = base->tags + base->n_points;
- current->contours = base->contours + base->n_contours;
-
- /* handle extra points table - if any */
- if ( loader->use_extra )
- loader->current.extra_points =
- loader->base.extra_points + base->n_points;
- }
-
-
- FT_BASE_DEF( FT_Error )
- FT_GlyphLoader_Create_Extra( FT_GlyphLoader* loader )
- {
- FT_Error error;
- FT_Memory memory = loader->memory;
-
-
- if ( !ALLOC_ARRAY( loader->base.extra_points,
- loader->max_points, FT_Vector ) )
- {
- loader->use_extra = 1;
- FT_GlyphLoader_Adjust_Points( loader );
- }
- return error;
- }
-
-
- /* re-adjust the `current' subglyphs field */
- static void
- FT_GlyphLoader_Adjust_Subglyphs( FT_GlyphLoader* loader )
- {
- FT_GlyphLoad* base = &loader->base;
- FT_GlyphLoad* current = &loader->current;
-
-
- current->subglyphs = base->subglyphs + base->num_subglyphs;
- }
-
-
- /* Ensure that we can add `n_points' and `n_contours' to our glyph. this */
- /* function reallocates its outline tables if necessary. Note that it */
- /* DOESN'T change the number of points within the loader! */
- /* */
- FT_BASE_DEF( FT_Error )
- FT_GlyphLoader_Check_Points( FT_GlyphLoader* loader,
- FT_UInt n_points,
- FT_UInt n_contours )
- {
- FT_Memory memory = loader->memory;
- FT_Error error = FT_Err_Ok;
- FT_Outline* base = &loader->base.outline;
- FT_Outline* current = &loader->current.outline;
- FT_Bool adjust = 1;
-
- FT_UInt new_max, old_max;
-
-
- /* check points & tags */
- new_max = base->n_points + current->n_points + n_points;
- old_max = loader->max_points;
-
- if ( new_max > old_max )
- {
- new_max = ( new_max + 7 ) & -8;
-
- if ( REALLOC_ARRAY( base->points, old_max, new_max, FT_Vector ) ||
- REALLOC_ARRAY( base->tags, old_max, new_max, FT_Byte ) )
- goto Exit;
-
- if ( loader->use_extra &&
- REALLOC_ARRAY( loader->base.extra_points, old_max,
- new_max, FT_Vector ) )
- goto Exit;
-
- adjust = 1;
- loader->max_points = new_max;
- }
-
- /* check contours */
- old_max = loader->max_contours;
- new_max = base->n_contours + current->n_contours +
- n_contours;
- if ( new_max > old_max )
- {
- new_max = ( new_max + 3 ) & -4;
- if ( REALLOC_ARRAY( base->contours, old_max, new_max, FT_Short ) )
- goto Exit;
-
- adjust = 1;
- loader->max_contours = new_max;
- }
-
- if ( adjust )
- FT_GlyphLoader_Adjust_Points( loader );
-
- Exit:
- return error;
- }
-
-
- /* Ensure that we can add `n_subglyphs' to our glyph. this function */
- /* reallocates its subglyphs table if necessary. Note that it DOES */
- /* NOT change the number of subglyphs within the loader! */
- /* */
- FT_BASE_DEF( FT_Error )
- FT_GlyphLoader_Check_Subglyphs( FT_GlyphLoader* loader,
- FT_UInt n_subs )
- {
- FT_Memory memory = loader->memory;
- FT_Error error = FT_Err_Ok;
- FT_UInt new_max, old_max;
-
- FT_GlyphLoad* base = &loader->base;
- FT_GlyphLoad* current = &loader->current;
-
-
- new_max = base->num_subglyphs + current->num_subglyphs + n_subs;
- old_max = loader->max_subglyphs;
- if ( new_max > old_max )
- {
- new_max = ( new_max + 1 ) & -2;
- if ( REALLOC_ARRAY( base->subglyphs, old_max, new_max, FT_SubGlyph ) )
- goto Exit;
-
- loader->max_subglyphs = new_max;
-
- FT_GlyphLoader_Adjust_Subglyphs( loader );
- }
-
- Exit:
- return error;
- }
-
-
- /* prepare loader for the addition of a new glyph on top of the base one */
- FT_BASE_DEF( void )
- FT_GlyphLoader_Prepare( FT_GlyphLoader* loader )
- {
- FT_GlyphLoad* current = &loader->current;
-
-
- current->outline.n_points = 0;
- current->outline.n_contours = 0;
- current->num_subglyphs = 0;
-
- FT_GlyphLoader_Adjust_Points ( loader );
- FT_GlyphLoader_Adjust_Subglyphs( loader );
- }
-
-
- /* add current glyph to the base image - and prepare for another */
- FT_BASE_DEF( void )
- FT_GlyphLoader_Add( FT_GlyphLoader* loader )
- {
- FT_GlyphLoad* base = &loader->base;
- FT_GlyphLoad* current = &loader->current;
-
- FT_UInt n_curr_contours = current->outline.n_contours;
- FT_UInt n_base_points = base->outline.n_points;
- FT_UInt n;
-
-
- base->outline.n_points =
- (short)( base->outline.n_points + current->outline.n_points );
- base->outline.n_contours =
- (short)( base->outline.n_contours + current->outline.n_contours );
-
- base->num_subglyphs += current->num_subglyphs;
-
- /* adjust contours count in newest outline */
- for ( n = 0; n < n_curr_contours; n++ )
- current->outline.contours[n] =
- (short)( current->outline.contours[n] + n_base_points );
-
- /* prepare for another new glyph image */
- FT_GlyphLoader_Prepare( loader );
- }
-
-
- FT_BASE_DEF( FT_Error )
- FT_GlyphLoader_Copy_Points( FT_GlyphLoader* target,
- FT_GlyphLoader* source )
- {
- FT_Error error;
- FT_UInt num_points = source->base.outline.n_points;
- FT_UInt num_contours = source->base.outline.n_contours;
-
-
- error = FT_GlyphLoader_Check_Points( target, num_points, num_contours );
- if ( !error )
- {
- FT_Outline* out = &target->base.outline;
- FT_Outline* in = &source->base.outline;
-
-
- MEM_Copy( out->points, in->points,
- num_points * sizeof ( FT_Vector ) );
- MEM_Copy( out->tags, in->tags,
- num_points * sizeof ( char ) );
- MEM_Copy( out->contours, in->contours,
- num_contours * sizeof ( short ) );
-
- /* do we need to copy the extra points? */
- if ( target->use_extra && source->use_extra )
- MEM_Copy( target->base.extra_points, source->base.extra_points,
- num_points * sizeof ( FT_Vector ) );
-
- out->n_points = (short)num_points;
- out->n_contours = (short)num_contours;
-
- FT_GlyphLoader_Adjust_Points( target );
- }
-
- return error;
- }
-
-#endif
-
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@@ -1064,10 +586,11 @@
clazz->done_face( face );
/* close the stream for this face if needed */
- ft_done_stream(
- &face->stream,
+ ft_input_stream_free( face->stream,
( face->face_flags & FT_FACE_FLAG_EXTERNAL_STREAM ) != 0 );
+ face->stream = 0;
+
/* get rid of it */
if ( face->internal )
{
@@ -1225,7 +748,7 @@
/* test for valid `library' delayed to */
- /* ft_new_input_stream() */
+ /* ft_input_stream_new() */
if ( !aface || !args )
return FT_Err_Invalid_Argument;
@@ -1236,7 +759,7 @@
args->stream );
/* create input stream */
- error = ft_new_input_stream( library, args, &stream );
+ error = ft_input_stream_new( library, args, &stream );
if ( error )
goto Exit;
@@ -1269,7 +792,7 @@
else
error = FT_Err_Invalid_Handle;
- ft_done_stream( &stream, external_stream );
+ ft_input_stream_free( stream, external_stream );
goto Fail;
}
else
@@ -1310,7 +833,7 @@
error = FT_Err_Unknown_File_Format;
Fail2:
- ft_done_stream( &stream, external_stream );
+ ft_input_stream_free( stream, external_stream );
goto Fail;
}
@@ -1419,7 +942,7 @@
FT_Driver_Class* clazz;
- /* test for valid `parameters' delayed to ft_new_input_stream() */
+ /* test for valid `parameters' delayed to ft_input_stream_new() */
if ( !face )
return FT_Err_Invalid_Face_Handle;
@@ -1428,7 +951,7 @@
if ( !driver )
return FT_Err_Invalid_Driver_Handle;
- error = ft_new_input_stream( driver->root.library, parameters, &stream );
+ error = ft_input_stream_new( driver->root.library, parameters, &stream );
if ( error )
goto Exit;
@@ -1441,7 +964,7 @@
error = clazz->attach_file( face, stream );
/* close the attached stream */
- ft_done_stream( &stream,
+ ft_input_stream_free( stream,
(FT_Bool)( parameters->stream &&
( parameters->flags & ft_open_stream ) ) );
@@ -2636,6 +2159,9 @@
if ( !memory )
return FT_Err_Invalid_Argument;
+ /* init debugging support */
+ ft_debug_init();
+
/* first of all, allocate the library object */
if ( ALLOC( library, sizeof ( *library ) ) )
return error;
diff --git a/src/base/ftstream.c b/src/base/ftstream.c
index 3fc40f9..459bf83 100644
--- a/src/base/ftstream.c
+++ b/src/base/ftstream.c
@@ -32,13 +32,11 @@
FT_BASE_DEF( void )
- FT_New_Memory_Stream( FT_Library library,
- FT_Byte* base,
- FT_ULong size,
- FT_Stream stream )
+ FT_Stream_Open_Memory( FT_Stream stream,
+ const FT_Byte* base,
+ FT_ULong size )
{
- stream->memory = library->memory;
- stream->base = base;
+ stream->base = (FT_Byte*) base;
stream->size = size;
stream->pos = 0;
stream->cursor = 0;
@@ -47,8 +45,19 @@
}
+ FT_BASE_DEF( void )
+ FT_Stream_Close( FT_Stream stream )
+ {
+ if ( stream && stream->close )
+ {
+ stream->close( stream );
+ stream->close = NULL;
+ }
+ }
+
+
FT_BASE_DEF( FT_Error )
- FT_Seek_Stream( FT_Stream stream,
+ FT_Stream_Seek( FT_Stream stream,
FT_ULong pos )
{
FT_Error error;
@@ -60,7 +69,7 @@
{
if ( stream->read( stream, pos, 0, 0 ) )
{
- FT_ERROR(( "FT_Seek_Stream:" ));
+ FT_ERROR(( "FT_Stream_Seek:" ));
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
pos, stream->size ));
@@ -72,7 +81,7 @@
/* note that seeking to the first position after the file is valid */
else if ( pos > stream->size )
{
- FT_ERROR(( "FT_Seek_Stream:" ));
+ FT_ERROR(( "FT_Stream_Seek:" ));
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
pos, stream->size ));
@@ -87,10 +96,10 @@
FT_BASE_DEF( FT_Error )
- FT_Skip_Stream( FT_Stream stream,
+ FT_Stream_Skip( FT_Stream stream,
FT_Long distance )
{
- return FT_Seek_Stream( stream, (FT_ULong)( stream->pos + distance ) );
+ return FT_Stream_Seek( stream, (FT_ULong)( stream->pos + distance ) );
}
@@ -102,16 +111,16 @@
FT_BASE_DEF( FT_Error )
- FT_Read_Stream( FT_Stream stream,
+ FT_Stream_Read( FT_Stream stream,
FT_Byte* buffer,
FT_ULong count )
{
- return FT_Read_Stream_At( stream, stream->pos, buffer, count );
+ return FT_Stream_Read_At( stream, stream->pos, buffer, count );
}
FT_BASE_DEF( FT_Error )
- FT_Read_Stream_At( FT_Stream stream,
+ FT_Stream_Read_At( FT_Stream stream,
FT_ULong pos,
FT_Byte* buffer,
FT_ULong count )
@@ -122,7 +131,7 @@
if ( pos >= stream->size )
{
- FT_ERROR(( "FT_Read_Stream_At:" ));
+ FT_ERROR(( "FT_Stream_Read_At:" ));
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
pos, stream->size ));
@@ -144,7 +153,7 @@
if ( read_bytes < count )
{
- FT_ERROR(( "FT_Read_Stream_At:" ));
+ FT_ERROR(( "FT_Stream_Read_At:" ));
FT_ERROR(( " invalid read; expected %lu bytes, got %lu\n",
count, read_bytes ));
@@ -156,19 +165,19 @@
FT_BASE_DEF( FT_Error )
- FT_Extract_Frame( FT_Stream stream,
+ FT_Stream_Extract_Frame( FT_Stream stream,
FT_ULong count,
FT_Byte** pbytes )
{
FT_Error error;
- error = FT_Access_Frame( stream, count );
+ error = FT_Stream_Enter_Frame( stream, count );
if ( !error )
{
*pbytes = (FT_Byte*)stream->cursor;
- /* equivalent to FT_Forget_Frame(), with no memory block release */
+ /* equivalent to FT_Stream_Exit_Frame(), with no memory block release */
stream->cursor = 0;
stream->limit = 0;
}
@@ -178,7 +187,7 @@
FT_BASE_DEF( void )
- FT_Release_Frame( FT_Stream stream,
+ FT_Stream_Release_Frame( FT_Stream stream,
FT_Byte** pbytes )
{
if ( stream->read )
@@ -193,7 +202,7 @@
FT_BASE_DEF( FT_Error )
- FT_Access_Frame( FT_Stream stream,
+ FT_Stream_Enter_Frame( FT_Stream stream,
FT_ULong count )
{
FT_Error error = FT_Err_Ok;
@@ -217,7 +226,7 @@
stream->base, count );
if ( read_bytes < count )
{
- FT_ERROR(( "FT_Access_Frame:" ));
+ FT_ERROR(( "FT_Stream_Enter_Frame:" ));
FT_ERROR(( " invalid read; expected %lu bytes, got %lu\n",
count, read_bytes ));
@@ -234,7 +243,7 @@
if ( stream->pos >= stream->size ||
stream->pos + count > stream->size )
{
- FT_ERROR(( "FT_Access_Frame:" ));
+ FT_ERROR(( "FT_Stream_Enter_Frame:" ));
FT_ERROR(( " invalid i/o; pos = 0x%lx, count = %lu, size = 0x%lx\n",
stream->pos, count, stream->size ));
@@ -254,7 +263,7 @@
FT_BASE_DEF( void )
- FT_Forget_Frame( FT_Stream stream )
+ FT_Stream_Exit_Frame( FT_Stream stream )
{
/* IMPORTANT: The assertion stream->cursor != 0 was removed, given */
/* that it is possible to access a frame of length 0 in */
@@ -263,7 +272,7 @@
/* */
/* In this case, the loader code handles the 0-length table */
/* gracefully; however, stream.cursor is really set to 0 by the */
- /* FT_Access_Frame() call, and this is not an error. */
+ /* FT_Stream_Enter_Frame() call, and this is not an error. */
/* */
FT_ASSERT( stream );
@@ -296,7 +305,7 @@
FT_BASE_DEF( FT_Short )
- FT_Get_Short( FT_Stream stream )
+ FT_Stream_Get_Short( FT_Stream stream )
{
FT_Byte* p;
FT_Short result;
@@ -315,7 +324,7 @@
FT_BASE_DEF( FT_Short )
- FT_Get_ShortLE( FT_Stream stream )
+ FT_Stream_Get_ShortLE( FT_Stream stream )
{
FT_Byte* p;
FT_Short result;
@@ -334,7 +343,7 @@
FT_BASE_DEF( FT_Long )
- FT_Get_Offset( FT_Stream stream )
+ FT_Stream_Get_Offset( FT_Stream stream )
{
FT_Byte* p;
FT_Long result;
@@ -352,7 +361,7 @@
FT_BASE_DEF( FT_Long )
- FT_Get_Long( FT_Stream stream )
+ FT_Stream_Get_Long( FT_Stream stream )
{
FT_Byte* p;
FT_Long result;
@@ -370,7 +379,7 @@
FT_BASE_DEF( FT_Long )
- FT_Get_LongLE( FT_Stream stream )
+ FT_Stream_Get_LongLE( FT_Stream stream )
{
FT_Byte* p;
FT_Long result;
@@ -388,7 +397,7 @@
FT_BASE_DEF( FT_Char )
- FT_Read_Char( FT_Stream stream,
+ FT_Stream_Read_Char( FT_Stream stream,
FT_Error* error )
{
FT_Byte result = 0;
@@ -416,7 +425,7 @@
Fail:
*error = FT_Err_Invalid_Stream_Operation;
- FT_ERROR(( "FT_Read_Char:" ));
+ FT_ERROR(( "FT_Stream_Read_Char:" ));
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
stream->pos, stream->size ));
@@ -425,8 +434,8 @@
FT_BASE_DEF( FT_Short )
- FT_Read_Short( FT_Stream stream,
- FT_Error* error )
+ FT_Stream_Read_Short( FT_Stream stream,
+ FT_Error* error )
{
FT_Byte reads[2];
FT_Byte* p = 0;
@@ -463,7 +472,7 @@
Fail:
*error = FT_Err_Invalid_Stream_Operation;
- FT_ERROR(( "FT_Read_Short:" ));
+ FT_ERROR(( "FT_Stream_Read_Short:" ));
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
stream->pos, stream->size ));
@@ -472,7 +481,7 @@
FT_BASE_DEF( FT_Short )
- FT_Read_ShortLE( FT_Stream stream,
+ FT_Stream_Read_ShortLE( FT_Stream stream,
FT_Error* error )
{
FT_Byte reads[2];
@@ -510,7 +519,7 @@
Fail:
*error = FT_Err_Invalid_Stream_Operation;
- FT_ERROR(( "FT_Read_Short:" ));
+ FT_ERROR(( "FT_Stream_Read_Short:" ));
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
stream->pos, stream->size ));
@@ -519,7 +528,7 @@
FT_BASE_DEF( FT_Long )
- FT_Read_Offset( FT_Stream stream,
+ FT_Stream_Read_Offset( FT_Stream stream,
FT_Error* error )
{
FT_Byte reads[3];
@@ -557,7 +566,7 @@
Fail:
*error = FT_Err_Invalid_Stream_Operation;
- FT_ERROR(( "FT_Read_Offset:" ));
+ FT_ERROR(( "FT_Stream_Read_Offset:" ));
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
stream->pos, stream->size ));
@@ -566,7 +575,7 @@
FT_BASE_DEF( FT_Long )
- FT_Read_Long( FT_Stream stream,
+ FT_Stream_Read_Long( FT_Stream stream,
FT_Error* error )
{
FT_Byte reads[4];
@@ -603,7 +612,7 @@
return result;
Fail:
- FT_ERROR(( "FT_Read_Long:" ));
+ FT_ERROR(( "FT_Stream_Read_Long:" ));
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
stream->pos, stream->size ));
*error = FT_Err_Invalid_Stream_Operation;
@@ -613,7 +622,7 @@
FT_BASE_DEF( FT_Long )
- FT_Read_LongLE( FT_Stream stream,
+ FT_Stream_Read_LongLE( FT_Stream stream,
FT_Error* error )
{
FT_Byte reads[4];
@@ -650,7 +659,7 @@
return result;
Fail:
- FT_ERROR(( "FT_Read_Long:" ));
+ FT_ERROR(( "FT_Stream_Read_Long:" ));
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
stream->pos, stream->size ));
*error = FT_Err_Invalid_Stream_Operation;
@@ -660,9 +669,9 @@
FT_BASE_DEF( FT_Error )
- FT_Read_Fields( FT_Stream stream,
- const FT_Frame_Field* fields,
- void* structure )
+ FT_Stream_Read_Fields( FT_Stream stream,
+ const FT_Frame_Field* fields,
+ void* structure )
{
FT_Error error;
FT_Bool frame_accessed = 0;
@@ -683,7 +692,7 @@
switch ( fields->value )
{
case ft_frame_start: /* access a new frame */
- error = FT_Access_Frame( stream, fields->offset );
+ error = FT_Stream_Enter_Frame( stream, fields->offset );
if ( error )
goto Exit;
@@ -795,7 +804,7 @@
Exit:
/* close the frame if it was opened by this read */
if ( frame_accessed )
- FT_Forget_Frame( stream );
+ FT_Stream_Exit_Frame( stream );
return error;
}
diff --git a/src/base/ftsystem.c b/src/base/ftsystem.c
index fca525c..499d309 100644
--- a/src/base/ftsystem.c
+++ b/src/base/ftsystem.c
@@ -158,7 +158,7 @@
/*************************************************************************/
/* */
/* <Function> */
- /* ft_close_stream */
+ /* ft_ansi_stream_close */
/* */
/* <Description> */
/* The function to close a stream. */
@@ -167,7 +167,7 @@
/* stream :: A pointer to the stream object. */
/* */
FT_CALLBACK_DEF( void )
- ft_close_stream( FT_Stream stream )
+ ft_ansi_stream_close( FT_Stream stream )
{
fclose( STREAM_FILE( stream ) );
@@ -180,7 +180,7 @@
/*************************************************************************/
/* */
/* <Function> */
- /* ft_io_stream */
+ /* ft_ansi_stream_io */
/* */
/* <Description> */
/* The function to open a stream. */
@@ -198,10 +198,10 @@
/* The number of bytes actually read. */
/* */
FT_CALLBACK_DEF( unsigned long )
- ft_io_stream( FT_Stream stream,
- unsigned long offset,
- unsigned char* buffer,
- unsigned long count )
+ ft_ansi_stream_io( FT_Stream stream,
+ unsigned long offset,
+ unsigned char* buffer,
+ unsigned long count )
{
FILE* file;
@@ -217,38 +217,38 @@
/* documentation is in ftobjs.h */
FT_EXPORT_DEF( FT_Error )
- FT_New_Stream( const char* filepathname,
- FT_Stream astream )
+ FT_Stream_Open( FT_Stream stream,
+ const char* filepathname )
{
FILE* file;
- if ( !astream )
+ if ( !stream )
return FT_Err_Invalid_Stream_Handle;
file = fopen( filepathname, "rb" );
if ( !file )
{
- FT_ERROR(( "FT_New_Stream:" ));
+ FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not open `%s'\n", filepathname ));
return FT_Err_Cannot_Open_Resource;
}
fseek( file, 0, SEEK_END );
- astream->size = ftell( file );
+ stream->size = ftell( file );
fseek( file, 0, SEEK_SET );
- astream->descriptor.pointer = file;
- astream->pathname.pointer = (char*)filepathname;
- astream->pos = 0;
+ stream->descriptor.pointer = file;
+ stream->pathname.pointer = (char*)filepathname;
+ stream->pos = 0;
- astream->read = ft_io_stream;
- astream->close = ft_close_stream;
+ stream->read = ft_ansi_stream_io;
+ stream->close = ft_ansi_stream_close;
- FT_TRACE1(( "FT_New_Stream:" ));
+ FT_TRACE1(( "FT_Stream_Open:" ));
FT_TRACE1(( " opened `%s' (%d bytes) successfully\n",
- filepathname, astream->size ));
+ filepathname, stream->size ));
return FT_Err_Ok;
}
@@ -259,13 +259,13 @@
extern FT_Int
ft_mem_debug_init( FT_Memory memory );
-
+
extern void
ft_mem_debug_done( FT_Memory memory );
-
-#endif
-
-
+
+#endif
+
+
/* documentation is in ftobjs.h */
FT_EXPORT_DEF( FT_Memory )
@@ -283,7 +283,7 @@
memory->free = ft_free;
#ifdef FT_DEBUG_MEMORY
ft_mem_debug_init( memory );
-#endif
+#endif
}
return memory;
@@ -297,7 +297,7 @@
{
#ifdef FT_DEBUG_MEMORY
ft_mem_debug_done( memory );
-#endif
+#endif
memory->free( memory, memory );
}
diff --git a/src/base/ftutil.c b/src/base/ftutil.c
index 8987297..f30ca42 100644
--- a/src/base/ftutil.c
+++ b/src/base/ftutil.c
@@ -1,6 +1,7 @@
#include <ft2build.h>
#include FT_INTERNAL_DEBUG_H
-#include FT_INTERNAL_UTIL_H
+#include FT_INTERNAL_MEMORY_H
+#include FT_LIST_H
/*************************************************************************/
@@ -32,7 +33,7 @@
FT_Long size,
void* *P )
{
- FT_Assert( P != 0 );
+ FT_ASSERT( P != 0 );
if ( size > 0 )
{
@@ -69,7 +70,7 @@
void* Q;
- FT_Assert( P != 0 );
+ FT_ASSERT( P != 0 );
/* if the original pointer is NULL, call FT_Alloc() */
if ( !*P )
@@ -308,455 +309,3 @@
}
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** *****/
- /***** G L Y P H L O A D E R *****/
- /***** *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
- /*************************************************************************/
- /* */
- /* The glyph loader is a simple object which is used to load a set of */
- /* glyphs easily. It is critical for the correct loading of composites. */
- /* */
- /* Ideally, one can see it as a stack of abstract `glyph' objects. */
- /* */
- /* loader.base Is really the bottom of the stack. It describes a */
- /* single glyph image made of the juxtaposition of */
- /* several glyphs (those `in the stack'). */
- /* */
- /* loader.current Describes the top of the stack, on which a new */
- /* glyph can be loaded. */
- /* */
- /* Rewind Clears the stack. */
- /* Prepare Set up `loader.current' for addition of a new glyph */
- /* image. */
- /* Add Add the `current' glyph image to the `base' one, */
- /* and prepare for another one. */
- /* */
- /* The glyph loader is now a base object. Each driver used to */
- /* re-implement it in one way or the other, which wasted code and */
- /* energy. */
- /* */
- /*************************************************************************/
-
-
- /* create a new glyph loader */
- FT_BASE_DEF( FT_Error )
- FT_GlyphLoader _New( FT_Memory memory,
- FT_GlyphLoader *aloader )
- {
- FT_GlyphLoader loader;
- FT_Error error;
-
-
- if ( !ALLOC( loader, sizeof ( *loader ) ) )
- {
- loader->memory = memory;
- *aloader = loader;
- }
- return error;
- }
-
-
- /* rewind the glyph loader - reset counters to 0 */
- FT_BASE_DEF( void )
- FT_GlyphLoader _Rewind( FT_GlyphLoader loader )
- {
- FT_GlyphLoad* base = &loader->base;
- FT_GlyphLoad* current = &loader->current;
-
-
- base->outline.n_points = 0;
- base->outline.n_contours = 0;
- base->num_subglyphs = 0;
-
- *current = *base;
- }
-
-
- /* reset the glyph loader, frees all allocated tables */
- /* and starts from zero */
- FT_BASE_DEF( void )
- FT_GlyphLoader _Reset( FT_GlyphLoader loader )
- {
- FT_Memory memory = loader->memory;
-
-
- FREE( loader->base.outline.points );
- FREE( loader->base.outline.tags );
- FREE( loader->base.outline.contours );
- FREE( loader->base.extra_points );
- FREE( loader->base.subglyphs );
-
- loader->max_points = 0;
- loader->max_contours = 0;
- loader->max_subglyphs = 0;
-
- FT_GlyphLoader _Rewind( loader );
- }
-
-
- /* delete a glyph loader */
- FT_BASE_DEF( void )
- FT_GlyphLoader _Done( FT_GlyphLoader loader )
- {
- if ( loader )
- {
- FT_Memory memory = loader->memory;
-
-
- FT_GlyphLoader _Reset( loader );
- FREE( loader );
- }
- }
-
-
- /* re-adjust the `current' outline fields */
- static void
- FT_GlyphLoader _Adjust_Points( FT_GlyphLoader loader )
- {
- FT_Outline* base = &loader->base.outline;
- FT_Outline* current = &loader->current.outline;
-
-
- current->points = base->points + base->n_points;
- current->tags = base->tags + base->n_points;
- current->contours = base->contours + base->n_contours;
-
- /* handle extra points table - if any */
- if ( loader->use_extra )
- loader->current.extra_points =
- loader->base.extra_points + base->n_points;
- }
-
-
- FT_BASE_DEF( FT_Error )
- FT_GlyphLoader _Create_Extra( FT_GlyphLoader loader )
- {
- FT_Error error;
- FT_Memory memory = loader->memory;
-
-
- if ( !ALLOC_ARRAY( loader->base.extra_points,
- loader->max_points, FT_Vector ) )
- {
- loader->use_extra = 1;
- FT_GlyphLoader _Adjust_Points( loader );
- }
- return error;
- }
-
-
- /* re-adjust the `current' subglyphs field */
- static void
- FT_GlyphLoader _Adjust_Subglyphs( FT_GlyphLoader loader )
- {
- FT_GlyphLoad* base = &loader->base;
- FT_GlyphLoad* current = &loader->current;
-
-
- current->subglyphs = base->subglyphs + base->num_subglyphs;
- }
-
-
- /* Ensure that we can add `n_points' and `n_contours' to our glyph. this */
- /* function reallocates its outline tables if necessary. Note that it */
- /* DOESN'T change the number of points within the loader! */
- /* */
- FT_BASE_DEF( FT_Error )
- FT_GlyphLoader _Check_Points( FT_GlyphLoader loader,
- FT_UInt n_points,
- FT_UInt n_contours )
- {
- FT_Memory memory = loader->memory;
- FT_Error error = FT_Err_Ok;
- FT_Outline* base = &loader->base.outline;
- FT_Outline* current = &loader->current.outline;
- FT_Bool adjust = 1;
-
- FT_UInt new_max, old_max;
-
-
- /* check points & tags */
- new_max = base->n_points + current->n_points + n_points;
- old_max = loader->max_points;
-
- if ( new_max > old_max )
- {
- new_max = ( new_max + 7 ) & -8;
-
- if ( REALLOC_ARRAY( base->points, old_max, new_max, FT_Vector ) ||
- REALLOC_ARRAY( base->tags, old_max, new_max, FT_Byte ) )
- goto Exit;
-
- if ( loader->use_extra &&
- REALLOC_ARRAY( loader->base.extra_points, old_max,
- new_max, FT_Vector ) )
- goto Exit;
-
- adjust = 1;
- loader->max_points = new_max;
- }
-
- /* check contours */
- old_max = loader->max_contours;
- new_max = base->n_contours + current->n_contours +
- n_contours;
- if ( new_max > old_max )
- {
- new_max = ( new_max + 3 ) & -4;
- if ( REALLOC_ARRAY( base->contours, old_max, new_max, FT_Short ) )
- goto Exit;
-
- adjust = 1;
- loader->max_contours = new_max;
- }
-
- if ( adjust )
- FT_GlyphLoader _Adjust_Points( loader );
-
- Exit:
- return error;
- }
-
-
- /* Ensure that we can add `n_subglyphs' to our glyph. this function */
- /* reallocates its subglyphs table if necessary. Note that it DOES */
- /* NOT change the number of subglyphs within the loader! */
- /* */
- FT_BASE_DEF( FT_Error )
- FT_GlyphLoader _Check_Subglyphs( FT_GlyphLoader loader,
- FT_UInt n_subs )
- {
- FT_Memory memory = loader->memory;
- FT_Error error = FT_Err_Ok;
- FT_UInt new_max, old_max;
-
- FT_GlyphLoad* base = &loader->base;
- FT_GlyphLoad* current = &loader->current;
-
-
- new_max = base->num_subglyphs + current->num_subglyphs + n_subs;
- old_max = loader->max_subglyphs;
- if ( new_max > old_max )
- {
- new_max = ( new_max + 1 ) & -2;
- if ( REALLOC_ARRAY( base->subglyphs, old_max, new_max, FT_SubGlyph ) )
- goto Exit;
-
- loader->max_subglyphs = new_max;
-
- FT_GlyphLoader _Adjust_Subglyphs( loader );
- }
-
- Exit:
- return error;
- }
-
-
- /* prepare loader for the addition of a new glyph on top of the base one */
- FT_BASE_DEF( void )
- FT_GlyphLoader _Prepare( FT_GlyphLoader loader )
- {
- FT_GlyphLoad* current = &loader->current;
-
-
- current->outline.n_points = 0;
- current->outline.n_contours = 0;
- current->num_subglyphs = 0;
-
- FT_GlyphLoader _Adjust_Points ( loader );
- FT_GlyphLoader _Adjust_Subglyphs( loader );
- }
-
-
- /* add current glyph to the base image - and prepare for another */
- FT_BASE_DEF( void )
- FT_GlyphLoader _Add( FT_GlyphLoader loader )
- {
- FT_GlyphLoad* base = &loader->base;
- FT_GlyphLoad* current = &loader->current;
-
- FT_UInt n_curr_contours = current->outline.n_contours;
- FT_UInt n_base_points = base->outline.n_points;
- FT_UInt n;
-
-
- base->outline.n_points =
- (short)( base->outline.n_points + current->outline.n_points );
- base->outline.n_contours =
- (short)( base->outline.n_contours + current->outline.n_contours );
-
- base->num_subglyphs += current->num_subglyphs;
-
- /* adjust contours count in newest outline */
- for ( n = 0; n < n_curr_contours; n++ )
- current->outline.contours[n] =
- (short)( current->outline.contours[n] + n_base_points );
-
- /* prepare for another new glyph image */
- FT_GlyphLoader _Prepare( loader );
- }
-
-
- FT_BASE_DEF( FT_Error )
- FT_GlyphLoader _Copy_Points( FT_GlyphLoader target,
- FT_GlyphLoader source )
- {
- FT_Error error;
- FT_UInt num_points = source->base.outline.n_points;
- FT_UInt num_contours = source->base.outline.n_contours;
-
-
- error = FT_GlyphLoader _Check_Points( target, num_points, num_contours );
- if ( !error )
- {
- FT_Outline* out = &target->base.outline;
- FT_Outline* in = &source->base.outline;
-
-
- MEM_Copy( out->points, in->points,
- num_points * sizeof ( FT_Vector ) );
- MEM_Copy( out->tags, in->tags,
- num_points * sizeof ( char ) );
- MEM_Copy( out->contours, in->contours,
- num_contours * sizeof ( short ) );
-
- /* do we need to copy the extra points? */
- if ( target->use_extra && source->use_extra )
- MEM_Copy( target->base.extra_points, source->base.extra_points,
- num_points * sizeof ( FT_Vector ) );
-
- out->n_points = (short)num_points;
- out->n_contours = (short)num_contours;
-
- FT_GlyphLoader _Adjust_Points( target );
- }
-
- return error;
- }
-
-
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
- /***** *****/
- /***** *****/
- /***** S T R E A M S *****/
- /***** *****/
- /***** *****/
- /*************************************************************************/
- /*************************************************************************/
- /*************************************************************************/
-
-#undef FT_COMPONENT
-#define FT_COMPONENT trace_stream
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* ft_new_input_stream */
- /* */
- /* <Description> */
- /* Creates a new input stream object from an FT_Open_Args structure. */
- /* */
- /* <Note> */
- /* The function expects a valid `astream' parameter. */
- /* */
- FT_EXPORT_DEF( FT_Error )
- FT_Stream_Open( FT_Library library,
- FT_Open_Args* args,
- FT_Stream* astream )
- {
- FT_Error error;
- FT_Memory memory;
- FT_Stream stream;
-
-
- if ( !library )
- return FT_Err_Invalid_Library_Handle;
-
- if ( !args )
- return FT_Err_Invalid_Argument;
-
- *astream = 0;
- memory = library->memory;
- if ( ALLOC( stream, sizeof ( *stream ) ) )
- goto Exit;
-
- stream->memory = memory;
-
- /* now, look at the stream flags */
- if ( args->flags & ft_open_memory )
- {
- error = 0;
- FT_New_Memory_Stream( library,
- (FT_Byte*)args->memory_base,
- args->memory_size,
- stream );
- }
- else if ( args->flags & ft_open_pathname )
- {
- error = FT_Stream_New( args->pathname, stream );
- stream->pathname.pointer = args->pathname;
- }
- else if ( ( args->flags & ft_open_stream ) && args->stream )
- {
- /* in this case, we do not need to allocate a new stream object */
- /* since the caller is responsible for closing it himself */
- FREE( stream );
- stream = args->stream;
- }
- else
- error = FT_Err_Invalid_Argument;
-
- if ( error )
- FREE( stream );
-
- *astream = stream;
-
- Exit:
- return error;
- }
-
-
- /* documentation is in ftobjs.h */
-
- FT_EXPORT_DEF( void )
- FT_Stream_Done( FT_Stream stream )
- {
- if ( stream && stream->close )
- {
- stream->close( stream );
- stream->close = 0;
- }
- }
-
-
- static void
- ft_done_stream( FT_Stream* astream,
- FT_Int external )
- {
- FT_Stream stream = *astream;
-
-
- if ( stream->close )
- stream->close( stream );
-
- if ( !external )
- {
- FT_Memory memory = stream->memory;
-
-
- FREE( stream );
- }
- *astream = 0;
- }
-
diff --git a/src/base/rules.mk b/src/base/rules.mk
index 2da51b3..0fe1881 100644
--- a/src/base/rules.mk
+++ b/src/base/rules.mk
@@ -34,11 +34,11 @@ BASE_COMPILE := $(FT_COMPILE) $I$(SRC_)base
#
BASE_SRC := $(BASE_)ftcalc.c \
$(BASE_)fttrigon.c \
- $(BASE_)ftgloadr.c \
- $(BASE_)ftlist.c \
- $(BASE_)ftobjs.c \
+ $(BASE_)ftutil.c \
$(BASE_)ftstream.c \
+ $(BASE_)ftgloadr.c \
$(BASE_)ftoutln.c \
+ $(BASE_)ftobjs.c \
$(BASE_)ftnames.c \
$(BASE_)ftdbgmem.c
diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c
index 272b467..e9979d8 100644
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -408,7 +408,7 @@ THE SOFTWARE.
if ( nprops & 3 )
{
i = 4 - ( nprops & 3 );
- FT_Skip_Stream( stream, i );
+ FT_Stream_Skip( stream, i );
}
if ( PCF_BYTE_ORDER( format ) == MSBFirst )
@@ -423,7 +423,7 @@ THE SOFTWARE.
if ( ALLOC( strings, string_size * sizeof ( char ) ) )
goto Bail;
- error = FT_Read_Stream( stream, (FT_Byte*)strings, string_size );
+ error = FT_Stream_Read( stream, (FT_Byte*)strings, string_size );
if ( error )
goto Bail;
@@ -568,7 +568,7 @@ THE SOFTWARE.
if ( error )
return error;
- error = FT_Access_Frame( stream, 8 );
+ error = FT_Stream_Enter_Frame( stream, 8 );
if ( error )
return error;
@@ -578,7 +578,7 @@ THE SOFTWARE.
else
nbitmaps = GET_ULongLE();
- FT_Forget_Frame( stream );
+ FT_Stream_Exit_Frame( stream );
if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
return PCF_Err_Invalid_File_Format;
@@ -660,7 +660,7 @@ THE SOFTWARE.
if ( error )
return error;
- error = FT_Access_Frame( stream, 14 );
+ error = FT_Stream_Enter_Frame( stream, 14 );
if ( error )
return error;
@@ -683,7 +683,7 @@ THE SOFTWARE.
face->defaultChar = GET_ShortLE();
}
- FT_Forget_Frame( stream );
+ FT_Stream_Exit_Frame( stream );
if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
return PCF_Err_Invalid_File_Format;
@@ -696,7 +696,7 @@ THE SOFTWARE.
if ( ALLOC( tmpEncoding, nencoding * sizeof ( PCF_EncodingRec ) ) )
return PCF_Err_Out_Of_Memory;
- error = FT_Access_Frame( stream, 2 * nencoding );
+ error = FT_Stream_Enter_Frame( stream, 2 * nencoding );
if ( error )
goto Bail;
@@ -721,7 +721,7 @@ THE SOFTWARE.
FT_TRACE4(( "enc n. %d ; Uni %ld ; Glyph %d\n",
i, tmpEncoding[j - 1].enc, encodingOffset ));
}
- FT_Forget_Frame( stream );
+ FT_Stream_Exit_Frame( stream );
if ( ALLOC( encoding, (--j) * sizeof ( PCF_EncodingRec ) ) )
goto Bail;
diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c
index a925cf0..645d99e 100644
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -1285,7 +1285,7 @@
range->image_format, metrics, stream );
case 8: /* compound format */
- FT_Skip_Stream( stream, 1L );
+ FT_Stream_Skip( stream, 1L );
/* fallthrough */
case 9: