Commit 256de4b18f556b963597f171a217c0c1ed045993

David Turner 2006-03-20T12:10:24

* include/freetype/cache/ftccache.h, include/freetype/cache/ftccmap.h, include/freetype/cache/ftcglyph.h include/freetype/cache/ftcimage.h include/freetype/cache/ftcmanag.h include/freetype/cache/ftcmru.h include/freetype/cache/ftcsbits.h: removing these header files from the public include directory. * include/freetype/config/ftheader.h: changing the definition of FT_CACHE_INTERNAL_XXX_H macros to redirect to FT_CACHE_H instead * src/cache/ftcbasic.c, src/cache/ftccache.c, src/cache/ftccache.h, src/cache/ftccback.h, src/cache/ftccmap.c, src/cache/ftcglyph.c, src/cache/ftcglyph.h, src/cache/ftcimage.c, src/cache/ftcimage.h, src/cache/ftcmanag.c, src/cache/ftcmanag.h, src/cache/ftcmru.c, src/cache/ftcmru.h, src/cache/ftcsbits.c, src/cache/ftcsbits.h: modifications to prevent using the FT_CACHE_INTERNAL_XXX_H macros, and grab the headers in 'src/cache' instead (see below).

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
diff --git a/ChangeLog b/ChangeLog
index 6d39bdc..06c78a0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,26 @@
 2006-03-20 David Turner  <david@freetype.org>
 
+    * include/freetype/cache/ftccache.h,
+    include/freetype/cache/ftccmap.h,
+    include/freetype/cache/ftcglyph.h
+    include/freetype/cache/ftcimage.h
+    include/freetype/cache/ftcmanag.h
+    include/freetype/cache/ftcmru.h
+    include/freetype/cache/ftcsbits.h:
+      removing these header files from the public include directory.
+
+    * include/freetype/config/ftheader.h:
+      changing the definition of FT_CACHE_INTERNAL_XXX_H macros to
+      redirect to FT_CACHE_H instead
+
+    * src/cache/ftcbasic.c, src/cache/ftccache.c, src/cache/ftccache.h,
+    src/cache/ftccback.h, src/cache/ftccmap.c, src/cache/ftcglyph.c,
+    src/cache/ftcglyph.h, src/cache/ftcimage.c, src/cache/ftcimage.h,
+    src/cache/ftcmanag.c, src/cache/ftcmanag.h, src/cache/ftcmru.c,
+    src/cache/ftcmru.h, src/cache/ftcsbits.c, src/cache/ftcsbits.h:
+      modifications to prevent using the FT_CACHE_INTERNAL_XXX_H macros,
+      and grab the headers in 'src/cache' instead (see below).
+
     * src/cache/ftccache.h, src/cache/ftcglyph.h, src/cache/ftcimage.h,
     src/cache/ftcsbits.h, src/cache/ftcmanag.h, src/cache/ftccmap.h,
     src/cache/ftcmru.h: copying the cache's internal header files which
diff --git a/include/freetype/cache/ftccache.h b/include/freetype/cache/ftccache.h
deleted file mode 100644
index 7d35456..0000000
--- a/include/freetype/cache/ftccache.h
+++ /dev/null
@@ -1,326 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ftccache.h                                                             */
-/*                                                                         */
-/*    FreeType internal cache interface (specification).                   */
-/*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006 by                   */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
-/*                                                                         */
-/*  This file is part of the FreeType project, and may only be used,       */
-/*  modified, and distributed under the terms of the FreeType project      */
-/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#ifndef __FTCCACHE_H__
-#define __FTCCACHE_H__
-
-
-#include FT_CACHE_INTERNAL_MRU_H
-
-FT_BEGIN_HEADER
-
-  /* handle to cache object */
-  typedef struct FTC_CacheRec_*  FTC_Cache;
-
-  /* handle to cache class */
-  typedef const struct FTC_CacheClassRec_*  FTC_CacheClass;
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /*****                                                               *****/
-  /*****                   CACHE NODE DEFINITIONS                      *****/
-  /*****                                                               *****/
-  /*************************************************************************/
-  /*************************************************************************/
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Each cache controls one or more cache nodes.  Each node is part of    */
-  /* the global_lru list of the manager.  Its `data' field however is used */
-  /* as a reference count for now.                                         */
-  /*                                                                       */
-  /* A node can be anything, depending on the type of information held by  */
-  /* the cache.  It can be an individual glyph image, a set of bitmaps     */
-  /* glyphs for a given size, some metrics, etc.                           */
-  /*                                                                       */
-  /*************************************************************************/
-
-  /* structure size should be 20 bytes on 32-bits machines */
-  typedef struct  FTC_NodeRec_
-  {
-    FTC_MruNodeRec  mru;          /* circular mru list pointer           */
-    FTC_Node        link;         /* used for hashing                    */
-    FT_UInt32       hash;         /* used for hashing too                */
-    FT_UShort       cache_index;  /* index of cache the node belongs to  */
-    FT_Short        ref_count;    /* reference count for this node       */
-
-  } FTC_NodeRec;
-
-
-#define FTC_NODE( x )    ( (FTC_Node)(x) )
-#define FTC_NODE_P( x )  ( (FTC_Node*)(x) )
-
-#define FTC_NODE__NEXT(x)  FTC_NODE( (x)->mru.next )
-#define FTC_NODE__PREV(x)  FTC_NODE( (x)->mru.prev )
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* These functions are exported so that they can be called from          */
-  /* user-provided cache classes; otherwise, they are really part of the   */
-  /* cache sub-system internals.                                           */
-  /*                                                                       */
-
-  /* reserved for manager's use */
-  FT_EXPORT( void )
-  FTC_Node_Destroy( FTC_Node     node,
-                    FTC_Manager  manager );
-
-
-#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
-  FT_BASE( void )
-  ftc_node_destroy( FTC_Node     node,
-                    FTC_Manager  manager );
-#endif
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /*****                                                               *****/
-  /*****                       CACHE DEFINITIONS                       *****/
-  /*****                                                               *****/
-  /*************************************************************************/
-  /*************************************************************************/
-
-  /* initialize a new cache node */
-  typedef FT_Error
-  (*FTC_Node_NewFunc)( FTC_Node    *pnode,
-                       FT_Pointer   query,
-                       FTC_Cache    cache );
-
-  typedef FT_ULong
-  (*FTC_Node_WeightFunc)( FTC_Node   node,
-                          FTC_Cache  cache );
-
-  /* compare a node to a given key pair */
-  typedef FT_Bool
-  (*FTC_Node_CompareFunc)( FTC_Node    node,
-                           FT_Pointer  key,
-                           FTC_Cache   cache );
-
-
-  typedef void
-  (*FTC_Node_FreeFunc)( FTC_Node   node,
-                        FTC_Cache  cache );
-
-  typedef FT_Error
-  (*FTC_Cache_InitFunc)( FTC_Cache  cache );
-
-  typedef void
-  (*FTC_Cache_DoneFunc)( FTC_Cache  cache );
-
-
-  typedef struct  FTC_CacheClassRec_
-  {
-    FTC_Node_NewFunc      node_new;
-    FTC_Node_WeightFunc   node_weight;
-    FTC_Node_CompareFunc  node_compare;
-    FTC_Node_CompareFunc  node_remove_faceid;
-    FTC_Node_FreeFunc     node_free;
-
-    FT_UInt               cache_size;
-    FTC_Cache_InitFunc    cache_init;
-    FTC_Cache_DoneFunc    cache_done;
-
-  } FTC_CacheClassRec;
-
-
-  /* each cache really implements a dynamic hash table to manage its nodes */
-  typedef struct  FTC_CacheRec_
-  {
-    FT_UFast           p;
-    FT_UFast           mask;
-    FT_Long            slack;
-    FTC_Node*          buckets;
-
-    FTC_CacheClassRec  clazz;       /* local copy, for speed  */
-
-    FTC_Manager        manager;
-    FT_Memory          memory;
-    FT_UInt            index;       /* in manager's table     */
-
-    FTC_CacheClass     org_class;   /* original class pointer */
-
-  } FTC_CacheRec;
-
-
-#define FTC_CACHE( x )    ( (FTC_Cache)(x) )
-#define FTC_CACHE_P( x )  ( (FTC_Cache*)(x) )
-
-
-  /* default cache initialize */
-  FT_EXPORT( FT_Error )
-  FTC_Cache_Init( FTC_Cache  cache );
-
-  /* default cache finalizer */
-  FT_EXPORT( void )
-  FTC_Cache_Done( FTC_Cache  cache );
-
-  /* Call this function to lookup the cache.  If no corresponding
-   * node is found, a new one is automatically created.  This function
-   * is capable of flushing the cache adequately to make room for the
-   * new cache object.
-   */
-  FT_EXPORT( FT_Error )
-  FTC_Cache_Lookup( FTC_Cache   cache,
-                    FT_UInt32   hash,
-                    FT_Pointer  query,
-                    FTC_Node   *anode );
-
-  FT_EXPORT( FT_Error )
-  FTC_Cache_NewNode( FTC_Cache   cache,
-                     FT_UInt32   hash,
-                     FT_Pointer  query,
-                     FTC_Node   *anode );
-
-  /* Remove all nodes that relate to a given face_id.  This is useful
-   * when un-installing fonts.  Note that if a cache node relates to
-   * the face_id, but is locked (i.e., has 'ref_count > 0'), the node
-   * will _not_ be destroyed, but its internal face_id reference will
-   * be modified.
-   *
-   * The final result will be that the node will never come back
-   * in further lookup requests, and will be flushed on demand from
-   * the cache normally when its reference count reaches 0.
-   */
-  FT_EXPORT( void )
-  FTC_Cache_RemoveFaceID( FTC_Cache   cache,
-                          FTC_FaceID  face_id );
-
-
-#ifdef FTC_INLINE
-
-#define FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ) \
-  FT_BEGIN_STMNT                                                         \
-    FTC_Node             *_bucket, *_pnode, _node;                       \
-    FTC_Cache             _cache   = FTC_CACHE(cache);                   \
-    FT_UInt32             _hash    = (FT_UInt32)(hash);                  \
-    FTC_Node_CompareFunc  _nodcomp = (FTC_Node_CompareFunc)(nodecmp);    \
-    FT_UInt               _idx;                                          \
-                                                                         \
-                                                                         \
-    error = 0;                                                           \
-    node  = NULL;                                                        \
-    _idx  = _hash & _cache->mask;                                        \
-    if ( _idx < _cache->p )                                              \
-      _idx = _hash & ( _cache->mask*2 + 1 );                             \
-                                                                         \
-    _bucket = _pnode = _cache->buckets + _idx;                           \
-    for (;;)                                                             \
-    {                                                                    \
-      _node = *_pnode;                                                   \
-      if ( _node == NULL )                                               \
-        goto _NewNode;                                                   \
-                                                                         \
-      if ( _node->hash == _hash && _nodcomp( _node, query, _cache ) )    \
-        break;                                                           \
-                                                                         \
-      _pnode = &_node->link;                                             \
-    }                                                                    \
-                                                                         \
-    if ( _node != *_bucket )                                             \
-    {                                                                    \
-      *_pnode     = _node->link;                                         \
-      _node->link = *_bucket;                                            \
-      *_bucket    = _node;                                               \
-    }                                                                    \
-                                                                         \
-    {                                                                    \
-      FTC_Manager  _manager = _cache->manager;                           \
-                                                                         \
-                                                                         \
-      if ( _node != _manager->nodes_list )                               \
-        FTC_MruNode_Up( (FTC_MruNode*)&_manager->nodes_list,             \
-                        (FTC_MruNode)_node );                            \
-    }                                                                    \
-    goto _Ok;                                                            \
-                                                                         \
-  _NewNode:                                                              \
-    error = FTC_Cache_NewNode( _cache, _hash, query, &_node );           \
-                                                                         \
-  _Ok:                                                                   \
-    _pnode = (FTC_Node*)(void*)&(node);                                  \
-    *_pnode = _node;                                                     \
-  FT_END_STMNT
-
-#else /* !FTC_INLINE */
-
-#define FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error ) \
-  FT_BEGIN_STMNT                                                         \
-    error = FTC_Cache_Lookup( FTC_CACHE( cache ), hash, query,           \
-                              (FTC_Node*)&(node) );                      \
-  FT_END_STMNT
-
-#endif /* !FTC_INLINE */
-
-
-  /*
-   * This macro, together with FTC_CACHE_TRYLOOP_END, defines a retry
-   * loop to flush the cache repeatedly in case of memory overflows.
-   *
-   * It is used when creating a new cache node, or within a lookup
-   * that needs to allocate data (e.g., the sbit cache lookup).
-   * 
-   * Example:
-   *
-   *   {
-   *     FTC_CACHE_TRYLOOP( cache )
-   *       error = load_data( ... );
-   *     FTC_CACHE_TRYLOOP_END()
-   *   }
-   *
-   */
-#define FTC_CACHE_TRYLOOP( cache )                           \
-  {                                                          \
-    FTC_Manager  _try_manager = FTC_CACHE( cache )->manager; \
-    FT_UInt      _try_count   = 4;                           \
-                                                             \
-                                                             \
-    for (;;)                                                 \
-    {                                                        \
-      FT_UInt  _try_done;
-
-
-#define FTC_CACHE_TRYLOOP_END()                                   \
-      if ( !error || error != FT_Err_Out_Of_Memory )              \
-        break;                                                    \
-                                                                  \
-      _try_done = FTC_Manager_FlushN( _try_manager, _try_count ); \
-      if ( _try_done == 0 )                                       \
-        break;                                                    \
-                                                                  \
-      if ( _try_done == _try_count )                              \
-      {                                                           \
-        _try_count *= 2;                                          \
-        if ( _try_count < _try_done              ||               \
-            _try_count > _try_manager->num_nodes )                \
-          _try_count = _try_manager->num_nodes;                   \
-      }                                                           \
-    }                                                             \
-  }
-
- /* */
-
-FT_END_HEADER
-
-
-#endif /* __FTCCACHE_H__ */
-
-
-/* END */
diff --git a/include/freetype/cache/ftccmap.h b/include/freetype/cache/ftccmap.h
deleted file mode 100644
index 638dc4b..0000000
--- a/include/freetype/cache/ftccmap.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ftccmap.h                                                              */
-/*                                                                         */
-/*    FreeType charmap cache (specification).                              */
-/*                                                                         */
-/*  Copyright 2000-2001, 2003, 2005, 2006 by                               */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
-/*                                                                         */
-/*  This file is part of the FreeType project, and may only be used,       */
-/*  modified, and distributed under the terms of the FreeType project      */
-/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#ifndef __FTCCMAP_H__
-#define __FTCCMAP_H__
-
-#include <ft2build.h>
-#include FT_CACHE_H
-
-
-FT_BEGIN_HEADER
-
-
-  /*
-   *  The FreeType 2.1.7 Charmap cache interface.
-   *
-   *  Unfortunately, it is not possible to implement it in later versions,
-   *  since some function signatures changed too significantly to do that.
-   *
-   */
-
-#if 0
-
-  typedef enum  FTC_CMapType_
-  {
-    FTC_CMAP_BY_INDEX    = 0,
-    FTC_CMAP_BY_ENCODING = 1,
-    FTC_CMAP_BY_ID       = 2
-
-  } FTC_CMapType;
-
-
-  typedef struct  FTC_CMapIdRec_
-  {
-    FT_UInt  platform;
-    FT_UInt  encoding;
-
-  } FTC_CMapIdRec;
-
-
-  typedef struct  FTC_CMapDescRec_
-  {
-    FTC_FaceID    face_id;
-    FTC_CMapType  type;
-
-    union
-    {
-      FT_UInt        index;
-      FT_Encoding    encoding;
-      FTC_CMapIdRec  id;
-
-    } u;
-
-  } FTC_CMapDescRec, *FTC_CMapDesc;
-
-
-  FT_EXPORT( FT_Error )
-  FTC_CMapCache_New( FTC_Manager     manager,
-                     FTC_CMapCache  *acache );
-
-
-  FT_EXPORT( FT_UInt )
-  FTC_CMapCache_Lookup( FTC_CMapCache  cache,
-                        FTC_CMapDesc   cmap_desc,
-                        FT_UInt32      char_code );
-                        
-#endif /* 0 */
-
-  /* */
-
-
-FT_END_HEADER
-
-
-#endif /* __FTCCMAP_H__ */
-
-
-/* END */
diff --git a/include/freetype/cache/ftcglyph.h b/include/freetype/cache/ftcglyph.h
deleted file mode 100644
index 3f8301a..0000000
--- a/include/freetype/cache/ftcglyph.h
+++ /dev/null
@@ -1,313 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ftcglyph.h                                                             */
-/*                                                                         */
-/*    FreeType abstract glyph cache (specification).                       */
-/*                                                                         */
-/*  Copyright 2000-2001, 2003, 2004 by                                     */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
-/*                                                                         */
-/*  This file is part of the FreeType project, and may only be used,       */
-/*  modified, and distributed under the terms of the FreeType project      */
-/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
-  /*
-   *
-   *  FTC_GCache is an _abstract_ cache object optimized to store glyph
-   *  data.  It works as follows:
-   *
-   *   - It manages FTC_GNode objects. Each one of them can hold one or more
-   *     glyph `items'.  Item types are not specified in the FTC_GCache but
-   *     in classes that extend it.
-   *
-   *   - Glyph attributes, like face ID, character size, render mode, etc.,
-   *     can be grouped into abstract `glyph families'.  This avoids storing
-   *     the attributes within the FTC_GCache, since it is likely that many
-   *     FTC_GNodes will belong to the same family in typical uses.
-   *
-   *   - Each FTC_GNode is thus an FTC_Node with two additional fields:
-   *
-   *       * gindex: A glyph index, or the first index in a glyph range.
-   *       * family: A pointer to a glyph `family'.
-   *
-   *   - Family types are not fully specific in the FTC_Family type, but
-   *     by classes that extend it.
-   *
-   *  Note that both FTC_ImageCache and FTC_SBitCache extend FTC_GCache.
-   *  They share an FTC_Family sub-class called FTC_BasicFamily which is
-   *  used to store the following data: face ID, pixel/point sizes, load
-   *  flags.  For more details see the file `src/cache/ftcbasic.c'.
-   *
-   *  Client applications can extend FTC_GNode with their own FTC_GNode
-   *  and FTC_Family sub-classes to implement more complex caches (e.g.,
-   *  handling automatic synthesis, like obliquing & emboldening, colored
-   *  glyphs, etc.).
-   *
-   *  See also the FTC_ICache & FTC_SCache classes in `ftcimage.h' and
-   *  `ftcsbits.h', which both extend FTC_GCache with additional
-   *  optimizations.
-   *
-   *  A typical FTC_GCache implementation must provide at least the
-   *  following:
-   *
-   *  - FTC_GNode sub-class, e.g. MyNode, with relevant methods:
-   *        my_node_new            (must call FTC_GNode_Init)
-   *        my_node_free           (must call FTC_GNode_Done)
-   *        my_node_compare        (must call FTC_GNode_Compare)
-   *        my_node_remove_faceid  (must call ftc_gnode_unselect in case
-   *                                of match)
-   *
-   *  - FTC_Family sub-class, e.g. MyFamily, with relevant methods:
-   *        my_family_compare
-   *        my_family_init
-   *        my_family_reset (optional)
-   *        my_family_done
-   *
-   *  - FTC_GQuery sub-class, e.g. MyQuery, to hold cache-specific query
-   *    data.
-   *
-   *  - Constant structures for a FTC_GNodeClass.
-   *
-   *  - MyCacheNew() can be implemented easily as a call to the convenience
-   *    function FTC_GCache_New.
-   *
-   *  - MyCacheLookup with a call to FTC_GCache_Lookup.  This function will
-   *    automatically:
-   *
-   *    - Search for the corresponding family in the cache, or create
-   *      a new one if necessary.  Put it in FTC_GQUERY(myquery).family
-   *
-   *    - Call FTC_Cache_Lookup.
-   *
-   *    If it returns NULL, you should create a new node, then call
-   *    ftc_cache_add as usual.
-   */
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Important: The functions defined in this file are only used to        */
-  /*            implement an abstract glyph cache class.  You need to      */
-  /*            provide additional logic to implement a complete cache.    */
-  /*                                                                       */
-  /*************************************************************************/
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*********                                                       *********/
-  /*********             WARNING, THIS IS BETA CODE.               *********/
-  /*********                                                       *********/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-
-
-#ifndef __FTCGLYPH_H__
-#define __FTCGLYPH_H__
-
-
-#include <ft2build.h>
-#include FT_CACHE_INTERNAL_MANAGER_H
-
-
-FT_BEGIN_HEADER
-
-
- /*
-  *  We can group glyphs into `families'.  Each family correspond to a
-  *  given face ID, character size, transform, etc.
-  *
-  *  Families are implemented as MRU list nodes.  They are
-  *  reference-counted.
-  */
-
-  typedef struct  FTC_FamilyRec_
-  {
-    FTC_MruNodeRec    mrunode;
-    FT_UInt           num_nodes; /* current number of nodes in this family */
-    FTC_Cache         cache;
-    FTC_MruListClass  clazz;
-
-  } FTC_FamilyRec, *FTC_Family;
-
-#define  FTC_FAMILY(x)    ( (FTC_Family)(x) )
-#define  FTC_FAMILY_P(x)  ( (FTC_Family*)(x) )
-
-
-  typedef struct  FTC_GNodeRec_
-  {
-    FTC_NodeRec      node;
-    FTC_Family       family;
-    FT_UInt          gindex;
-
-  } FTC_GNodeRec, *FTC_GNode;
-
-#define FTC_GNODE( x )    ( (FTC_GNode)(x) )
-#define FTC_GNODE_P( x )  ( (FTC_GNode*)(x) )
-
-
-  typedef struct  FTC_GQueryRec_
-  {
-    FT_UInt      gindex;
-    FTC_Family   family;
-
-  } FTC_GQueryRec, *FTC_GQuery;
-
-#define FTC_GQUERY( x )  ( (FTC_GQuery)(x) )
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* These functions are exported so that they can be called from          */
-  /* user-provided cache classes; otherwise, they are really part of the   */
-  /* cache sub-system internals.                                           */
-  /*                                                                       */
-
-  /* must be called by derived FTC_Node_InitFunc routines */
-  FT_EXPORT( void )
-  FTC_GNode_Init( FTC_GNode   node,
-                  FT_UInt     gindex,  /* glyph index for node */
-                  FTC_Family  family );
-
-  /* returns TRUE iff the query's glyph index correspond to the node;  */
-  /* this assumes that the "family" and "hash" fields of the query are */
-  /* already correctly set                                             */
-  FT_EXPORT( FT_Bool )
-  FTC_GNode_Compare( FTC_GNode   gnode,
-                     FTC_GQuery  gquery );
-
-  /* call this function to clear a node's family -- this is necessary */
-  /* to implement the `node_remove_faceid' cache method correctly     */
-  FT_EXPORT( void )
-  FTC_GNode_UnselectFamily( FTC_GNode  gnode,
-                            FTC_Cache  cache );
-
-  /* must be called by derived FTC_Node_DoneFunc routines */
-  FT_EXPORT( void )
-  FTC_GNode_Done( FTC_GNode  node,
-                  FTC_Cache  cache );
-
-
-  FT_EXPORT( void )
-  FTC_Family_Init( FTC_Family  family,
-                   FTC_Cache   cache );
-
-  typedef struct FTC_GCacheRec_
-  {
-    FTC_CacheRec    cache;
-    FTC_MruListRec  families;
-
-  } FTC_GCacheRec, *FTC_GCache;
-
-#define FTC_GCACHE( x )  ((FTC_GCache)(x))
-
-
-  /* can be used as @FTC_Cache_InitFunc */
-  FT_EXPORT( FT_Error )
-  FTC_GCache_Init( FTC_GCache  cache );
-
-
-  /* can be used as @FTC_Cache_DoneFunc */
-  FT_EXPORT( void )
-  FTC_GCache_Done( FTC_GCache  cache );
-
-
-  /* the glyph cache class adds fields for the family implementation */
-  typedef struct  FTC_GCacheClassRec_
-  {
-    FTC_CacheClassRec  clazz;
-    FTC_MruListClass   family_class;
-
-  } FTC_GCacheClassRec;
-
-  typedef const FTC_GCacheClassRec*   FTC_GCacheClass;
-
-#define FTC_GCACHE_CLASS( x )  ((FTC_GCacheClass)(x))
-
-#define FTC_CACHE__GCACHE_CLASS( x ) \
-          FTC_GCACHE_CLASS( FTC_CACHE(x)->org_class )
-#define FTC_CACHE__FAMILY_CLASS( x ) \
-          ( (FTC_MruListClass)FTC_CACHE__GCACHE_CLASS( x )->family_class )
-
-
-  /* convenience function; use it instead of FTC_Manager_Register_Cache */
-  FT_EXPORT( FT_Error )
-  FTC_GCache_New( FTC_Manager       manager,
-                  FTC_GCacheClass   clazz,
-                  FTC_GCache       *acache );
-
-  FT_EXPORT( FT_Error )
-  FTC_GCache_Lookup( FTC_GCache   cache,
-                     FT_UInt32    hash,
-                     FT_UInt      gindex,
-                     FTC_GQuery   query,
-                     FTC_Node    *anode );
-
-
-  /* */
-
-
-#define FTC_FAMILY_FREE( family, cache )                      \
-          FTC_MruList_Remove( &FTC_GCACHE((cache))->families, \
-                              (FTC_MruNode)(family) )
-
-
-#ifdef FTC_INLINE
-
-#define FTC_GCACHE_LOOKUP_CMP( cache, famcmp, nodecmp, hash,                \
-                               gindex, query, node, error )                 \
-  FT_BEGIN_STMNT                                                            \
-    FTC_GCache               _gcache   = FTC_GCACHE( cache );               \
-    FTC_GQuery               _gquery   = (FTC_GQuery)( query );             \
-    FTC_MruNode_CompareFunc  _fcompare = (FTC_MruNode_CompareFunc)(famcmp); \
-                                                                            \
-                                                                            \
-    _gquery->gindex = (gindex);                                             \
-                                                                            \
-    FTC_MRULIST_LOOKUP_CMP( &_gcache->families, _gquery, _fcompare,         \
-                            _gquery->family, error );                       \
-    if ( !error )                                                           \
-    {                                                                       \
-      FTC_Family  _gqfamily = _gquery->family;                              \
-                                                                            \
-                                                                            \
-      _gqfamily->num_nodes++;                                               \
-                                                                            \
-      FTC_CACHE_LOOKUP_CMP( cache, nodecmp, hash, query, node, error );     \
-                                                                            \
-      if ( --_gqfamily->num_nodes == 0 )                                    \
-        FTC_FAMILY_FREE( _gqfamily, _gcache );                              \
-    }                                                                       \
-  FT_END_STMNT
-  /* */
-
-#else /* !FTC_INLINE */
-
-#define FTC_GCACHE_LOOKUP_CMP( cache, famcmp, nodecmp, hash,               \
-                               gindex, query, node, error )                \
-   FT_BEGIN_STMNT                                                          \
-     error = FTC_GCache_Lookup( FTC_GCACHE( cache ), hash, gindex,         \
-                                FTC_GQUERY( query ), (FTC_Node*)&(node) ); \
-   FT_END_STMNT
-
-#endif /* !FTC_INLINE */
-
-
-FT_END_HEADER
-
-
-#endif /* __FTCGLYPH_H__ */
-
-
-/* END */
diff --git a/include/freetype/cache/ftcimage.h b/include/freetype/cache/ftcimage.h
deleted file mode 100644
index 1bf12db..0000000
--- a/include/freetype/cache/ftcimage.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ftcimage.h                                                             */
-/*                                                                         */
-/*    FreeType Generic Image cache (specification)                         */
-/*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003 by                                     */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
-/*                                                                         */
-/*  This file is part of the FreeType project, and may only be used,       */
-/*  modified, and distributed under the terms of the FreeType project      */
-/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
- /*
-  *  FTC_ICache is an _abstract_ cache used to store a single FT_Glyph
-  *  image per cache node.
-  *
-  *  FTC_ICache extends FTC_GCache.  For an implementation example,
-  *  see FTC_ImageCache in `src/cache/ftbasic.c'.
-  */
-  
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* Each image cache really manages FT_Glyph objects.                     */
-  /*                                                                       */
-  /*************************************************************************/
-
-
-#ifndef __FTCIMAGE_H__
-#define __FTCIMAGE_H__
-
-
-#include <ft2build.h>
-#include FT_CACHE_H
-#include FT_CACHE_INTERNAL_GLYPH_H
-
-FT_BEGIN_HEADER
-
-
-  /* the FT_Glyph image node type - we store only 1 glyph per node */
-  typedef struct  FTC_INodeRec_
-  {
-    FTC_GNodeRec  gnode;
-    FT_Glyph      glyph;
-
-  } FTC_INodeRec, *FTC_INode;
-
-#define FTC_INODE( x )         ( (FTC_INode)( x ) )
-#define FTC_INODE_GINDEX( x )  FTC_GNODE(x)->gindex
-#define FTC_INODE_FAMILY( x )  FTC_GNODE(x)->family
-
-  typedef FT_Error
-  (*FTC_IFamily_LoadGlyphFunc)( FTC_Family  family,
-                                FT_UInt     gindex,
-                                FTC_Cache   cache,
-                                FT_Glyph   *aglyph );
-
-  typedef struct  FTC_IFamilyClassRec_
-  {
-    FTC_MruListClassRec        clazz;
-    FTC_IFamily_LoadGlyphFunc  family_load_glyph;
-
-  } FTC_IFamilyClassRec;
-
-  typedef const FTC_IFamilyClassRec*  FTC_IFamilyClass;
-
-#define FTC_IFAMILY_CLASS( x )  ((FTC_IFamilyClass)(x))
-
-#define FTC_CACHE__IFAMILY_CLASS( x ) \
-          FTC_IFAMILY_CLASS( FTC_CACHE__GCACHE_CLASS(x)->family_class )
-
-
-  /* can be used as a @FTC_Node_FreeFunc */
-  FT_EXPORT( void )
-  FTC_INode_Free( FTC_INode  inode,
-                  FTC_Cache  cache );
-
-  /* Can be used as @FTC_Node_NewFunc.  `gquery.index' and `gquery.family'
-   * must be set correctly.  This function will call the `family_load_glyph'
-   * method to load the FT_Glyph into the cache node.
-   */
-  FT_EXPORT( FT_Error )
-  FTC_INode_New( FTC_INode   *pinode,
-                 FTC_GQuery   gquery,
-                 FTC_Cache    cache );
-
-  /* can be used as @FTC_Node_WeightFunc */
-  FT_EXPORT( FT_ULong )
-  FTC_INode_Weight( FTC_INode  inode );
-
- /* */
-
-FT_END_HEADER
-
-#endif /* __FTCIMAGE_H__ */
-
-
-/* END */
diff --git a/include/freetype/cache/ftcmanag.h b/include/freetype/cache/ftcmanag.h
deleted file mode 100644
index 5265848..0000000
--- a/include/freetype/cache/ftcmanag.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ftcmanag.h                                                             */
-/*                                                                         */
-/*    FreeType Cache Manager (specification).                              */
-/*                                                                         */
-/*  Copyright 2000-2001, 2003, 2004 by                                     */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
-/*                                                                         */
-/*  This file is part of the FreeType project, and may only be used,       */
-/*  modified, and distributed under the terms of the FreeType project      */
-/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* A cache manager is in charge of the following:                        */
-  /*                                                                       */
-  /*  - Maintain a mapping between generic FTC_FaceIDs and live FT_Face    */
-  /*    objects.  The mapping itself is performed through a user-provided  */
-  /*    callback.  However, the manager maintains a small cache of FT_Face */
-  /*    and FT_Size objects in order to speed up things considerably.      */
-  /*                                                                       */
-  /*  - Manage one or more cache objects.  Each cache is in charge of      */
-  /*    holding a varying number of `cache nodes'.  Each cache node        */
-  /*    represents a minimal amount of individually accessible cached      */
-  /*    data.  For example, a cache node can be an FT_Glyph image          */
-  /*    containing a vector outline, or some glyph metrics, or anything    */
-  /*    else.                                                              */
-  /*                                                                       */
-  /*    Each cache node has a certain size in bytes that is added to the   */
-  /*    total amount of `cache memory' within the manager.                 */
-  /*                                                                       */
-  /*    All cache nodes are located in a global LRU list, where the oldest */
-  /*    node is at the tail of the list.                                   */
-  /*                                                                       */
-  /*    Each node belongs to a single cache, and includes a reference      */
-  /*    count to avoid destroying it (due to caching).                     */
-  /*                                                                       */
-  /*************************************************************************/
-
-
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*********                                                       *********/
-  /*********             WARNING, THIS IS BETA CODE.               *********/
-  /*********                                                       *********/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-  /*************************************************************************/
-
-
-#ifndef __FTCMANAG_H__
-#define __FTCMANAG_H__
-
-
-#include <ft2build.h>
-#include FT_CACHE_H
-#include FT_CACHE_INTERNAL_MRU_H
-#include FT_CACHE_INTERNAL_CACHE_H
-
-
-FT_BEGIN_HEADER
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Section>                                                             */
-  /*    cache_subsystem                                                    */
-  /*                                                                       */
-  /*************************************************************************/
-
-
-#define FTC_MAX_FACES_DEFAULT  2
-#define FTC_MAX_SIZES_DEFAULT  4
-#define FTC_MAX_BYTES_DEFAULT  200000L  /* ~200kByte by default */
-
-  /* maximum number of caches registered in a single manager */
-#define FTC_MAX_CACHES         16
-
-
-  typedef struct  FTC_ManagerRec_
-  {
-    FT_Library          library;
-    FT_Memory           memory;
-
-    FTC_Node            nodes_list;
-    FT_ULong            max_weight;
-    FT_ULong            cur_weight;
-    FT_UInt             num_nodes;
-
-    FTC_Cache           caches[FTC_MAX_CACHES];
-    FT_UInt             num_caches;
-
-    FTC_MruListRec      faces;
-    FTC_MruListRec      sizes;
-
-    FT_Pointer          request_data;
-    FTC_Face_Requester  request_face;
-
-  } FTC_ManagerRec;
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* <Function>                                                            */
-  /*    FTC_Manager_Compress                                               */
-  /*                                                                       */
-  /* <Description>                                                         */
-  /*    This function is used to check the state of the cache manager if   */
-  /*    its `num_bytes' field is greater than its `max_bytes' field.  It   */
-  /*    will flush as many old cache nodes as possible (ignoring cache     */
-  /*    nodes with a non-zero reference count).                            */
-  /*                                                                       */
-  /* <InOut>                                                               */
-  /*    manager :: A handle to the cache manager.                          */
-  /*                                                                       */
-  /* <Note>                                                                */
-  /*    Client applications should not call this function directly.  It is */
-  /*    normally invoked by specific cache implementations.                */
-  /*                                                                       */
-  /*    The reason this function is exported is to allow client-specific   */
-  /*    cache classes.                                                     */
-  /*                                                                       */
-  FT_EXPORT( void )
-  FTC_Manager_Compress( FTC_Manager  manager );
-
-
-  /* try to flush `count' old nodes from the cache; return the number
-   * of really flushed nodes
-   */
-  FT_EXPORT( FT_UInt )
-  FTC_Manager_FlushN( FTC_Manager  manager,
-                      FT_UInt      count );
-
-
-  /* this must be used internally for the moment */
-  FT_EXPORT( FT_Error )
-  FTC_Manager_RegisterCache( FTC_Manager      manager,
-                             FTC_CacheClass   clazz,
-                             FTC_Cache       *acache );
-
- /* */
-
-#define FTC_SCALER_COMPARE( a, b )                \
-    ( (a)->face_id      == (b)->face_id      &&   \
-      (a)->width        == (b)->width        &&   \
-      (a)->height       == (b)->height       &&   \
-      ((a)->pixel != 0) == ((b)->pixel != 0) &&   \
-      ( (a)->pixel ||                             \
-        ( (a)->x_res == (b)->x_res &&             \
-          (a)->y_res == (b)->y_res ) ) )
-
-#define FTC_SCALER_HASH( q )                                 \
-    ( FTC_FACE_ID_HASH( (q)->face_id ) +                     \
-      (q)->width + (q)->height*7 +                           \
-      ( (q)->pixel ? 0 : ( (q)->x_res*33 ^ (q)->y_res*61 ) ) )
-
- /* */
-
-FT_END_HEADER
-
-#endif /* __FTCMANAG_H__ */
-
-
-/* END */
diff --git a/include/freetype/cache/ftcmru.h b/include/freetype/cache/ftcmru.h
deleted file mode 100644
index ac1a1a9..0000000
--- a/include/freetype/cache/ftcmru.h
+++ /dev/null
@@ -1,247 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ftcmru.h                                                               */
-/*                                                                         */
-/*    Simple MRU list-cache (specification).                               */
-/*                                                                         */
-/*  Copyright 2000-2001, 2003, 2004, 2005 by                               */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
-/*                                                                         */
-/*  This file is part of the FreeType project, and may only be used,       */
-/*  modified, and distributed under the terms of the FreeType project      */
-/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* An MRU is a list that cannot hold more than a certain number of       */
-  /* elements (`max_elements').  All elements in the list are sorted in    */
-  /* least-recently-used order, i.e., the `oldest' element is at the tail  */
-  /* of the list.                                                          */
-  /*                                                                       */
-  /* When doing a lookup (either through `Lookup()' or `Lookup_Node()'),   */
-  /* the list is searched for an element with the corresponding key.  If   */
-  /* it is found, the element is moved to the head of the list and is      */
-  /* returned.                                                             */
-  /*                                                                       */
-  /* If no corresponding element is found, the lookup routine will try to  */
-  /* obtain a new element with the relevant key.  If the list is already   */
-  /* full, the oldest element from the list is discarded and replaced by a */
-  /* new one; a new element is added to the list otherwise.                */
-  /*                                                                       */
-  /* Note that it is possible to pre-allocate the element list nodes.      */
-  /* This is handy if `max_elements' is sufficiently small, as it saves    */
-  /* allocations/releases during the lookup process.                       */
-  /*                                                                       */
-  /*************************************************************************/
-
-
-#ifndef __FTCMRU_H__
-#define __FTCMRU_H__
-
-
-#include <ft2build.h>
-#include FT_FREETYPE_H
-
-#ifdef FREETYPE_H
-#error "freetype.h of FreeType 1 has been loaded!"
-#error "Please fix the directory search order for header files"
-#error "so that freetype.h of FreeType 2 is found first."
-#endif
-
-#define  xxFT_DEBUG_ERROR
-#define  FTC_INLINE
-
-FT_BEGIN_HEADER
-
-  typedef struct FTC_MruNodeRec_*  FTC_MruNode;
-
-  typedef struct  FTC_MruNodeRec_
-  {
-    FTC_MruNode  next;
-    FTC_MruNode  prev;
-
-  } FTC_MruNodeRec;
-
-
-  FT_EXPORT( void )
-  FTC_MruNode_Prepend( FTC_MruNode  *plist,
-                       FTC_MruNode   node );
-
-  FT_EXPORT( void )
-  FTC_MruNode_Up( FTC_MruNode  *plist,
-                  FTC_MruNode   node );
-
-  FT_EXPORT( void )
-  FTC_MruNode_Remove( FTC_MruNode  *plist,
-                      FTC_MruNode   node );
-
-
-  typedef struct FTC_MruListRec_*              FTC_MruList;
-
-  typedef struct FTC_MruListClassRec_ const *  FTC_MruListClass;
-
-
-  typedef FT_Bool
-  (*FTC_MruNode_CompareFunc)( FTC_MruNode  node,
-                              FT_Pointer   key );
-
-  typedef FT_Error
-  (*FTC_MruNode_InitFunc)( FTC_MruNode  node,
-                           FT_Pointer   key,
-                           FT_Pointer   data );
-
-  typedef FT_Error
-  (*FTC_MruNode_ResetFunc)( FTC_MruNode  node,
-                            FT_Pointer   key,
-                            FT_Pointer   data );
-
-  typedef void
-  (*FTC_MruNode_DoneFunc)( FTC_MruNode  node,
-                           FT_Pointer   data );
-
-
-  typedef struct  FTC_MruListClassRec_
-  {
-    FT_UInt                  node_size;
-    FTC_MruNode_CompareFunc  node_compare;
-    FTC_MruNode_InitFunc     node_init;
-    FTC_MruNode_ResetFunc    node_reset;
-    FTC_MruNode_DoneFunc     node_done;
-
-  } FTC_MruListClassRec;
-
-  typedef struct  FTC_MruListRec_
-  {
-    FT_UInt              num_nodes;
-    FT_UInt              max_nodes;
-    FTC_MruNode          nodes;
-    FT_Pointer           data;
-    FTC_MruListClassRec  clazz;
-    FT_Memory            memory;
-
-  } FTC_MruListRec;
-
-
-  FT_EXPORT( void )
-  FTC_MruList_Init( FTC_MruList       list,
-                    FTC_MruListClass  clazz,
-                    FT_UInt           max_nodes,
-                    FT_Pointer        data,
-                    FT_Memory         memory );
-
-  FT_EXPORT( void )
-  FTC_MruList_Reset( FTC_MruList  list );
-
-
-  FT_EXPORT( void )
-  FTC_MruList_Done( FTC_MruList  list );
-
-  FT_EXPORT( FTC_MruNode )
-  FTC_MruList_Find( FTC_MruList  list,
-                    FT_Pointer   key );
-
-  FT_EXPORT( FT_Error )
-  FTC_MruList_New( FTC_MruList   list,
-                   FT_Pointer    key,
-                   FTC_MruNode  *anode );
-
-  FT_EXPORT( FT_Error )
-  FTC_MruList_Lookup( FTC_MruList   list,
-                      FT_Pointer    key,
-                      FTC_MruNode  *pnode );
-
-
-  FT_EXPORT( void )
-  FTC_MruList_Remove( FTC_MruList  list,
-                      FTC_MruNode  node );
-
-  FT_EXPORT( void )
-  FTC_MruList_RemoveSelection( FTC_MruList              list,
-                               FTC_MruNode_CompareFunc  selection,
-                               FT_Pointer               key );
-
-
-#ifdef FTC_INLINE
-
-#define FTC_MRULIST_LOOKUP_CMP( list, key, compare, node, error )           \
-  FT_BEGIN_STMNT                                                            \
-    FTC_MruNode*             _pfirst  = &(list)->nodes;                     \
-    FTC_MruNode_CompareFunc  _compare = (FTC_MruNode_CompareFunc)(compare); \
-    FTC_MruNode              _first, _node, *_pnode;                        \
-                                                                            \
-                                                                            \
-    error  = 0;                                                             \
-    _first = *(_pfirst);                                                    \
-    _node  = NULL;                                                          \
-                                                                            \
-    if ( _first )                                                           \
-    {                                                                       \
-      _node = _first;                                                       \
-      do                                                                    \
-      {                                                                     \
-        if ( _compare( _node, (key) ) )                                     \
-        {                                                                   \
-          if ( _node != _first )                                            \
-            FTC_MruNode_Up( _pfirst, _node );                               \
-                                                                            \
-          _pnode = (FTC_MruNode*)(void*)&(node);                            \
-          *_pnode = _node;                                                  \
-          goto _MruOk;                                                      \
-        }                                                                   \
-        _node = _node->next;                                                \
-                                                                            \
-      } while ( _node != _first) ;                                          \
-    }                                                                       \
-                                                                            \
-    error = FTC_MruList_New( (list), (key), (FTC_MruNode*)(void*)&(node) ); \
-  _MruOk:                                                                   \
-    ;                                                                       \
-  FT_END_STMNT
-
-#define FTC_MRULIST_LOOKUP( list, key, node, error ) \
-  FTC_MRULIST_LOOKUP_CMP( list, key, (list)->clazz.node_compare, node, error )
-
-#else  /* !FTC_INLINE */
-
-#define FTC_MRULIST_LOOKUP( list, key, node, error ) \
-  error = FTC_MruList_Lookup( (list), (key), (FTC_MruNode*)&(node) )
-
-#endif /* !FTC_INLINE */
-
-
-#define FTC_MRULIST_LOOP( list, node )        \
-  FT_BEGIN_STMNT                              \
-    FTC_MruNode  _first = (list)->nodes;      \
-                                              \
-                                              \
-    if ( _first )                             \
-    {                                         \
-      FTC_MruNode  _node = _first;            \
-                                              \
-                                              \
-      do                                      \
-      {                                       \
-        *(FTC_MruNode*)&(node) = _node;
-
-
-#define FTC_MRULIST_LOOP_END()               \
-        _node = _node->next;                 \
-                                             \
-      } while ( _node != _first );           \
-    }                                        \
-  FT_END_STMNT
-
- /* */
-
-FT_END_HEADER
-
-
-#endif /* __FTCMRU_H__ */
-
-
-/* END */
diff --git a/include/freetype/cache/ftcsbits.h b/include/freetype/cache/ftcsbits.h
deleted file mode 100644
index b2ef0f1..0000000
--- a/include/freetype/cache/ftcsbits.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/***************************************************************************/
-/*                                                                         */
-/*  ftcsbits.h                                                             */
-/*                                                                         */
-/*    A small-bitmap cache (specification).                                */
-/*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003 by                                     */
-/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
-/*                                                                         */
-/*  This file is part of the FreeType project, and may only be used,       */
-/*  modified, and distributed under the terms of the FreeType project      */
-/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
-/*  this file you indicate that you have read the license and              */
-/*  understand and accept it fully.                                        */
-/*                                                                         */
-/***************************************************************************/
-
-
-#ifndef __FTCSBITS_H__
-#define __FTCSBITS_H__
-
-
-#include <ft2build.h>
-#include FT_CACHE_H
-#include FT_CACHE_INTERNAL_GLYPH_H
-
-
-FT_BEGIN_HEADER
-
-#define FTC_SBIT_ITEMS_PER_NODE  16
-
-  typedef struct  FTC_SNodeRec_
-  {
-    FTC_GNodeRec  gnode;
-    FT_UInt       count;
-    FTC_SBitRec   sbits[FTC_SBIT_ITEMS_PER_NODE];
-
-  } FTC_SNodeRec, *FTC_SNode;
-
-
-#define FTC_SNODE( x )         ( (FTC_SNode)( x ) )
-#define FTC_SNODE_GINDEX( x )  FTC_GNODE( x )->gindex
-#define FTC_SNODE_FAMILY( x )  FTC_GNODE( x )->family
-
-  typedef FT_UInt
-  (*FTC_SFamily_GetCountFunc)( FTC_Family   family,
-                               FTC_Manager  manager );
-
-  typedef FT_Error
-  (*FTC_SFamily_LoadGlyphFunc)( FTC_Family   family,
-                                FT_UInt      gindex,
-                                FTC_Manager  manager,
-                                FT_Face     *aface );
-
-  typedef struct  FTC_SFamilyClassRec_
-  {
-    FTC_MruListClassRec        clazz;
-    FTC_SFamily_GetCountFunc   family_get_count;
-    FTC_SFamily_LoadGlyphFunc  family_load_glyph;
-
-  } FTC_SFamilyClassRec;
-
-  typedef const FTC_SFamilyClassRec*  FTC_SFamilyClass;
-
-#define FTC_SFAMILY_CLASS( x )  ((FTC_SFamilyClass)(x))
-
-#define FTC_CACHE__SFAMILY_CLASS( x )  \
-          FTC_SFAMILY_CLASS( FTC_CACHE__GCACHE_CLASS( x )->family_class )
-
-
-  FT_EXPORT( void )
-  FTC_SNode_Free( FTC_SNode  snode,
-                  FTC_Cache  cache );
-
-  FT_EXPORT( FT_Error )
-  FTC_SNode_New( FTC_SNode   *psnode,
-                 FTC_GQuery   gquery,
-                 FTC_Cache    cache );
-
-  FT_EXPORT( FT_ULong )
-  FTC_SNode_Weight( FTC_SNode  inode );
-
-
-  FT_EXPORT( FT_Bool )
-  FTC_SNode_Compare( FTC_SNode   snode,
-                     FTC_GQuery  gquery,
-                     FTC_Cache   cache );
-
-  /* */
-
-FT_END_HEADER
-
-#endif /* __FTCSBITS_H__ */
-
-
-/* END */
diff --git a/include/freetype/config/ftheader.h b/include/freetype/config/ftheader.h
index d704f1d..fe27d15 100644
--- a/include/freetype/config/ftheader.h
+++ b/include/freetype/config/ftheader.h
@@ -623,15 +623,18 @@
 #define FT_SYNTHESIS_H          <freetype/ftsynth.h>
 #define FT_ERROR_DEFINITIONS_H  <freetype/fterrdef.h>
 
-#define FT_CACHE_MANAGER_H  <freetype/cache/ftcmanag.h>
-
-#define FT_CACHE_INTERNAL_MRU_H      <freetype/cache/ftcmru.h>
-#define FT_CACHE_INTERNAL_MANAGER_H  <freetype/cache/ftcmanag.h>
-#define FT_CACHE_INTERNAL_CACHE_H    <freetype/cache/ftccache.h>
-#define FT_CACHE_INTERNAL_GLYPH_H    <freetype/cache/ftcglyph.h>
-#define FT_CACHE_INTERNAL_IMAGE_H    <freetype/cache/ftcimage.h>
-#define FT_CACHE_INTERNAL_SBITS_H    <freetype/cache/ftcsbits.h>
 
+/* the internals of the cache sub-system are no longer exposed, we  */
+/* default to FT_CACHE_H at the moment just in case, but we know of */
+/* no rogue client that uses them anyway                            */
+/*                                                                  */
+#define FT_CACHE_MANAGER_H           <freetype/ftcache.h>
+#define FT_CACHE_INTERNAL_MRU_H      <freetype/ftcache.h>
+#define FT_CACHE_INTERNAL_MANAGER_H  <freetype/ftcache.h>
+#define FT_CACHE_INTERNAL_CACHE_H    <freetype/ftcache.h>
+#define FT_CACHE_INTERNAL_GLYPH_H    <freetype/ftcache.h>
+#define FT_CACHE_INTERNAL_IMAGE_H    <freetype/ftcache.h>
+#define FT_CACHE_INTERNAL_SBITS_H    <freetype/ftcache.h>
 
 #define FT_XFREE86_H              <freetype/ftxf86.h>
 
diff --git a/src/cache/ftcbasic.c b/src/cache/ftcbasic.c
index cff8be5..e9e8135 100644
--- a/src/cache/ftcbasic.c
+++ b/src/cache/ftcbasic.c
@@ -18,9 +18,9 @@
 
 #include <ft2build.h>
 #include FT_CACHE_H
-#include FT_CACHE_INTERNAL_GLYPH_H
-#include FT_CACHE_INTERNAL_IMAGE_H
-#include FT_CACHE_INTERNAL_SBITS_H
+#include "ftcglyph.h"
+#include "ftcimage.h"
+#include "ftcsbits.h"
 #include FT_INTERNAL_MEMORY_H
 
 #include "ftccback.h"
diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c
index b135114..0df9b09 100644
--- a/src/cache/ftccache.c
+++ b/src/cache/ftccache.c
@@ -17,7 +17,7 @@
 
 
 #include <ft2build.h>
-#include FT_CACHE_INTERNAL_MANAGER_H
+#include "ftcmanag.h"
 #include FT_INTERNAL_OBJECTS_H
 #include FT_INTERNAL_DEBUG_H
 
@@ -315,7 +315,7 @@
   /*************************************************************************/
 
 
-  FT_EXPORT_DEF( FT_Error )
+  FT_LOCAL_DEF( FT_Error )
   FTC_Cache_Init( FTC_Cache  cache )
   {
     return ftc_cache_init( cache );
@@ -396,7 +396,7 @@
   }
 
 
-  FT_EXPORT_DEF( void )
+  FT_LOCAL_DEF( void )
   FTC_Cache_Done( FTC_Cache  cache )
   {
     ftc_cache_done( cache );
@@ -431,7 +431,7 @@
   }
 
 
-  FT_EXPORT_DEF( FT_Error )
+  FT_LOCAL_DEF( FT_Error )
   FTC_Cache_NewNode( FTC_Cache   cache,
                      FT_UInt32   hash,
                      FT_Pointer  query,
@@ -468,7 +468,7 @@
   }
 
 
-  FT_EXPORT_DEF( FT_Error )
+  FT_LOCAL_DEF( FT_Error )
   FTC_Cache_Lookup( FTC_Cache   cache,
                     FT_UInt32   hash,
                     FT_Pointer  query,
@@ -527,7 +527,7 @@
   }
 
 
-  FT_EXPORT_DEF( void )
+  FT_LOCAL_DEF( void )
   FTC_Cache_RemoveFaceID( FTC_Cache   cache,
                           FTC_FaceID  face_id )
   {
diff --git a/src/cache/ftccache.h b/src/cache/ftccache.h
index 7d35456..b41b139 100644
--- a/src/cache/ftccache.h
+++ b/src/cache/ftccache.h
@@ -20,7 +20,7 @@
 #define __FTCCACHE_H__
 
 
-#include FT_CACHE_INTERNAL_MRU_H
+#include "ftcmru.h"
 
 FT_BEGIN_HEADER
 
@@ -165,11 +165,11 @@ FT_BEGIN_HEADER
 
 
   /* default cache initialize */
-  FT_EXPORT( FT_Error )
+  FT_LOCAL( FT_Error )
   FTC_Cache_Init( FTC_Cache  cache );
 
   /* default cache finalizer */
-  FT_EXPORT( void )
+  FT_LOCAL( void )
   FTC_Cache_Done( FTC_Cache  cache );
 
   /* Call this function to lookup the cache.  If no corresponding
@@ -177,13 +177,13 @@ FT_BEGIN_HEADER
    * is capable of flushing the cache adequately to make room for the
    * new cache object.
    */
-  FT_EXPORT( FT_Error )
+  FT_LOCAL( FT_Error )
   FTC_Cache_Lookup( FTC_Cache   cache,
                     FT_UInt32   hash,
                     FT_Pointer  query,
                     FTC_Node   *anode );
 
-  FT_EXPORT( FT_Error )
+  FT_LOCAL( FT_Error )
   FTC_Cache_NewNode( FTC_Cache   cache,
                      FT_UInt32   hash,
                      FT_Pointer  query,
@@ -199,7 +199,7 @@ FT_BEGIN_HEADER
    * in further lookup requests, and will be flushed on demand from
    * the cache normally when its reference count reaches 0.
    */
-  FT_EXPORT( void )
+  FT_LOCAL( void )
   FTC_Cache_RemoveFaceID( FTC_Cache   cache,
                           FTC_FaceID  face_id );
 
@@ -276,7 +276,7 @@ FT_BEGIN_HEADER
    *
    * It is used when creating a new cache node, or within a lookup
    * that needs to allocate data (e.g., the sbit cache lookup).
-   * 
+   *
    * Example:
    *
    *   {
diff --git a/src/cache/ftccback.h b/src/cache/ftccback.h
index 5d7e8bd..86e72a7 100644
--- a/src/cache/ftccback.h
+++ b/src/cache/ftccback.h
@@ -20,11 +20,11 @@
 
 #include <ft2build.h>
 #include FT_CACHE_H
-#include FT_CACHE_INTERNAL_MRU_H
-#include FT_CACHE_INTERNAL_IMAGE_H
-#include FT_CACHE_INTERNAL_MANAGER_H
-#include FT_CACHE_INTERNAL_GLYPH_H
-#include FT_CACHE_INTERNAL_SBITS_H
+#include "ftcmru.h"
+#include "ftcimage.h"
+#include "ftcmanag.h"
+#include "ftcglyph.h"
+#include "ftcsbits.h"
 
 
   FT_LOCAL( void )
diff --git a/src/cache/ftccmap.c b/src/cache/ftccmap.c
index 524a05d..fefcbdf 100644
--- a/src/cache/ftccmap.c
+++ b/src/cache/ftccmap.c
@@ -19,7 +19,7 @@
 #include <ft2build.h>
 #include FT_FREETYPE_H
 #include FT_CACHE_H
-#include FT_CACHE_INTERNAL_MANAGER_H
+#include "ftcmanag.h"
 #include FT_INTERNAL_MEMORY_H
 #include FT_INTERNAL_DEBUG_H
 #include FT_TRUETYPE_IDS_H
diff --git a/src/cache/ftcglyph.c b/src/cache/ftcglyph.c
index 46d5965..70474e3 100644
--- a/src/cache/ftcglyph.c
+++ b/src/cache/ftcglyph.c
@@ -18,7 +18,7 @@
 
 #include <ft2build.h>
 #include FT_CACHE_H
-#include FT_CACHE_INTERNAL_GLYPH_H
+#include "ftcglyph.h"
 #include FT_ERRORS_H
 #include FT_INTERNAL_OBJECTS_H
 #include FT_INTERNAL_DEBUG_H
diff --git a/src/cache/ftcglyph.h b/src/cache/ftcglyph.h
index 3f8301a..4441e83 100644
--- a/src/cache/ftcglyph.h
+++ b/src/cache/ftcglyph.h
@@ -118,7 +118,7 @@
 
 
 #include <ft2build.h>
-#include FT_CACHE_INTERNAL_MANAGER_H
+#include "ftcmanag.h"
 
 
 FT_BEGIN_HEADER
diff --git a/src/cache/ftcimage.c b/src/cache/ftcimage.c
index 02020ba..54133aa 100644
--- a/src/cache/ftcimage.c
+++ b/src/cache/ftcimage.c
@@ -18,7 +18,7 @@
 
 #include <ft2build.h>
 #include FT_CACHE_H
-#include FT_CACHE_INTERNAL_IMAGE_H
+#include "ftcimage.h"
 #include FT_INTERNAL_MEMORY_H
 
 #include "ftccback.h"
diff --git a/src/cache/ftcimage.h b/src/cache/ftcimage.h
index 1bf12db..6acc77b 100644
--- a/src/cache/ftcimage.h
+++ b/src/cache/ftcimage.h
@@ -23,7 +23,7 @@
   *  FTC_ICache extends FTC_GCache.  For an implementation example,
   *  see FTC_ImageCache in `src/cache/ftbasic.c'.
   */
-  
+
 
   /*************************************************************************/
   /*                                                                       */
@@ -38,7 +38,7 @@
 
 #include <ft2build.h>
 #include FT_CACHE_H
-#include FT_CACHE_INTERNAL_GLYPH_H
+#include "ftcglyph.h"
 
 FT_BEGIN_HEADER
 
diff --git a/src/cache/ftcmanag.c b/src/cache/ftcmanag.c
index c07bc32..dda6ed3 100644
--- a/src/cache/ftcmanag.c
+++ b/src/cache/ftcmanag.c
@@ -18,7 +18,7 @@
 
 #include <ft2build.h>
 #include FT_CACHE_H
-#include FT_CACHE_INTERNAL_MANAGER_H
+#include "ftcmanag.h"
 #include FT_INTERNAL_OBJECTS_H
 #include FT_INTERNAL_DEBUG_H
 #include FT_SIZES_H
diff --git a/src/cache/ftcmanag.h b/src/cache/ftcmanag.h
index 5265848..e455a54 100644
--- a/src/cache/ftcmanag.h
+++ b/src/cache/ftcmanag.h
@@ -65,8 +65,8 @@
 
 #include <ft2build.h>
 #include FT_CACHE_H
-#include FT_CACHE_INTERNAL_MRU_H
-#include FT_CACHE_INTERNAL_CACHE_H
+#include "ftcmru.h"
+#include "ftccache.h"
 
 
 FT_BEGIN_HEADER
diff --git a/src/cache/ftcmru.c b/src/cache/ftcmru.c
index 4bd82b3..21d2e0c 100644
--- a/src/cache/ftcmru.c
+++ b/src/cache/ftcmru.c
@@ -18,14 +18,14 @@
 
 #include <ft2build.h>
 #include FT_CACHE_H
-#include FT_CACHE_INTERNAL_MRU_H
+#include "ftcmru.h"
 #include FT_INTERNAL_OBJECTS_H
 #include FT_INTERNAL_DEBUG_H
 
 #include "ftcerror.h"
 
 
-  FT_EXPORT_DEF( void )
+  FT_LOCAL_DEF( void )
   FTC_MruNode_Prepend( FTC_MruNode  *plist,
                        FTC_MruNode   node )
   {
@@ -69,7 +69,7 @@
   }
 
 
-  FT_EXPORT_DEF( void )
+  FT_LOCAL_DEF( void )
   FTC_MruNode_Up( FTC_MruNode  *plist,
                   FTC_MruNode   node )
   {
@@ -118,7 +118,7 @@
   }
 
 
-  FT_EXPORT_DEF( void )
+  FT_LOCAL_DEF( void )
   FTC_MruNode_Remove( FTC_MruNode  *plist,
                       FTC_MruNode   node )
   {
@@ -165,7 +165,7 @@
   }
 
 
-  FT_EXPORT_DEF( void )
+  FT_LOCAL_DEF( void )
   FTC_MruList_Init( FTC_MruList       list,
                     FTC_MruListClass  clazz,
                     FT_UInt           max_nodes,
@@ -181,7 +181,7 @@
   }
 
 
-  FT_EXPORT_DEF( void )
+  FT_LOCAL_DEF( void )
   FTC_MruList_Reset( FTC_MruList  list )
   {
     while ( list->nodes )
@@ -191,14 +191,15 @@
   }
 
 
-  FT_EXPORT_DEF( void )
+  FT_LOCAL_DEF( void )
   FTC_MruList_Done( FTC_MruList  list )
   {
     FTC_MruList_Reset( list );
   }
 
 
-  FT_EXPORT_DEF( FTC_MruNode )
+#ifndef FTC_INLINE
+  FT_LOCAL_DEF( FTC_MruNode )
   FTC_MruList_Find( FTC_MruList  list,
                     FT_Pointer   key )
   {
@@ -229,9 +230,9 @@
 
     return NULL;
   }
+#endif
 
-
-  FT_EXPORT_DEF( FT_Error )
+  FT_LOCAL_DEF( FT_Error )
   FTC_MruList_New( FTC_MruList   list,
                    FT_Pointer    key,
                    FTC_MruNode  *anode )
@@ -285,7 +286,8 @@
   }
 
 
-  FT_EXPORT_DEF( FT_Error )
+#ifndef FTC_INLINE
+  FT_LOCAL_DEF( FT_Error )
   FTC_MruList_Lookup( FTC_MruList   list,
                       FT_Pointer    key,
                       FTC_MruNode  *anode )
@@ -300,9 +302,9 @@
     *anode = node;
     return 0;
   }
+#endif /* FTC_INLINE */
 
-
-  FT_EXPORT_DEF( void )
+  FT_LOCAL_DEF( void )
   FTC_MruList_Remove( FTC_MruList  list,
                       FTC_MruNode  node )
   {
@@ -321,7 +323,7 @@
   }
 
 
-  FT_EXPORT_DEF( void )
+  FT_LOCAL_DEF( void )
   FTC_MruList_RemoveSelection( FTC_MruList              list,
                                FTC_MruNode_CompareFunc  selection,
                                FT_Pointer               key )
diff --git a/src/cache/ftcmru.h b/src/cache/ftcmru.h
index ac1a1a9..37c60ef 100644
--- a/src/cache/ftcmru.h
+++ b/src/cache/ftcmru.h
@@ -68,15 +68,15 @@ FT_BEGIN_HEADER
   } FTC_MruNodeRec;
 
 
-  FT_EXPORT( void )
+  FT_LOCAL( void )
   FTC_MruNode_Prepend( FTC_MruNode  *plist,
                        FTC_MruNode   node );
 
-  FT_EXPORT( void )
+  FT_LOCAL( void )
   FTC_MruNode_Up( FTC_MruNode  *plist,
                   FTC_MruNode   node );
 
-  FT_EXPORT( void )
+  FT_LOCAL( void )
   FTC_MruNode_Remove( FTC_MruNode  *plist,
                       FTC_MruNode   node );
 
@@ -127,40 +127,31 @@ FT_BEGIN_HEADER
   } FTC_MruListRec;
 
 
-  FT_EXPORT( void )
+  FT_LOCAL( void )
   FTC_MruList_Init( FTC_MruList       list,
                     FTC_MruListClass  clazz,
                     FT_UInt           max_nodes,
                     FT_Pointer        data,
                     FT_Memory         memory );
 
-  FT_EXPORT( void )
+  FT_LOCAL( void )
   FTC_MruList_Reset( FTC_MruList  list );
 
 
-  FT_EXPORT( void )
+  FT_LOCAL( void )
   FTC_MruList_Done( FTC_MruList  list );
 
-  FT_EXPORT( FTC_MruNode )
-  FTC_MruList_Find( FTC_MruList  list,
-                    FT_Pointer   key );
 
-  FT_EXPORT( FT_Error )
+  FT_LOCAL( FT_Error )
   FTC_MruList_New( FTC_MruList   list,
                    FT_Pointer    key,
                    FTC_MruNode  *anode );
 
-  FT_EXPORT( FT_Error )
-  FTC_MruList_Lookup( FTC_MruList   list,
-                      FT_Pointer    key,
-                      FTC_MruNode  *pnode );
-
-
-  FT_EXPORT( void )
+  FT_LOCAL( void )
   FTC_MruList_Remove( FTC_MruList  list,
                       FTC_MruNode  node );
 
-  FT_EXPORT( void )
+  FT_LOCAL( void )
   FTC_MruList_RemoveSelection( FTC_MruList              list,
                                FTC_MruNode_CompareFunc  selection,
                                FT_Pointer               key );
@@ -208,6 +199,15 @@ FT_BEGIN_HEADER
 
 #else  /* !FTC_INLINE */
 
+  FT_LOCAL( FTC_MruNode )
+  FTC_MruList_Find( FTC_MruList  list,
+                    FT_Pointer   key );
+
+  FT_LOCAL( FT_Error )
+  FTC_MruList_Lookup( FTC_MruList   list,
+                      FT_Pointer    key,
+                      FTC_MruNode  *pnode );
+
 #define FTC_MRULIST_LOOKUP( list, key, node, error ) \
   error = FTC_MruList_Lookup( (list), (key), (FTC_MruNode*)&(node) )
 
diff --git a/src/cache/ftcsbits.c b/src/cache/ftcsbits.c
index 891c7ab..4e544d8 100644
--- a/src/cache/ftcsbits.c
+++ b/src/cache/ftcsbits.c
@@ -18,7 +18,7 @@
 
 #include <ft2build.h>
 #include FT_CACHE_H
-#include FT_CACHE_INTERNAL_SBITS_H
+#include "ftcsbits.h"
 #include FT_INTERNAL_OBJECTS_H
 #include FT_INTERNAL_DEBUG_H
 #include FT_ERRORS_H
@@ -341,7 +341,7 @@
        *  However, we need to `lock' the node before this operation to
        *  prevent it from being flushed within the loop.
        *
-       *  When we exit the loop, we unlock the node, then check the `error' 
+       *  When we exit the loop, we unlock the node, then check the `error'
        *  variable.  If it is non-zero, this means that the cache was
        *  completely flushed and that no usable memory was found to load
        *  the bitmap.
diff --git a/src/cache/ftcsbits.h b/src/cache/ftcsbits.h
index b2ef0f1..5da1bf7 100644
--- a/src/cache/ftcsbits.h
+++ b/src/cache/ftcsbits.h
@@ -22,7 +22,7 @@
 
 #include <ft2build.h>
 #include FT_CACHE_H
-#include FT_CACHE_INTERNAL_GLYPH_H
+#include "ftcglyph.h"
 
 
 FT_BEGIN_HEADER