1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
|
2006-10-18 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_op_exec): save the current
security level and rollback it after finished the object's execution.
* hieroglyph/vm.c (_hg_vm_op_rollbacksecuritylevel): new function.
(hg_vm_set_security_level): implemented.
(hg_vm_get_security_level): implemented.
* hieroglyph/operator.c (_hg_operator_op_countdictstack):
check VMerror.
(_hg_operator_op_countexecstack): likewise.
(_hg_operator_op_currentdict): likewise.
(_hg_operator_op_currentfile): likewise.
(_hg_operator_op_dup): likewise.
(_hg_operator_op_private_hg_getsecuritylevel): new function.
(_hg_operator_op_private_hg_setsecuritylevel): new function.
2006-10-16 Akira TAGOH <at@gclab.org>
* plugins/test/hg_unittest.ps (initunittest): erase a prompt.
(.updateunittestprogress): show a pinwheel.
2006-10-15 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_op_restore): drop the save object
out of ostack if restore successfully complete.
* hieroglyph/vm.c (hg_vm_startjob): allow an empty initializer to
just makes VM initialization.
* src/hgs.c (main): add --sync option.
* hieroglyph/hgfile.c (hg_file_io_synchronous): new function.
(hg_file_object_write): call fsync after writing according to
the current state of I/O synchronous.
* hieroglyph/hgstring.c (hg_string_append_printf): new function.
(hg_string_append_vprintf): new function.
* hieroglyph/hgdict.c (_hg_dict_traverse_set_flags): removed
the unnecessary debugging code.
2006-10-12 Akira TAGOH <at@gclab.org>
* tests/ps/test-exp.ps: new testcase.
* tests/ps/test-ps.sh (run_test): new function.
* hieroglyph/scanner.c (_hg_scanner_parse_number): fixed a typo.
* hieroglyph/operator.c (_hg_operator_op_exit): throw /invalidexit
if it's going to jump stopped context.
(_hg_operator_op_private_hg_exit): new function to not check
/invalidexit for stopped.
* lib/hg_init.ps (executive): use .exit instead of exit.
* tests/ps/test-exec.ps:
* tests/ps/test-executeonly.ps:
* tests/ps/test-execstack.ps:
* tests/ps/test-eq.ps:
* tests/ps/test-exch.ps:
* tests/ps/test-exit.ps:
* tests/ps/testtest-exit.ps: new testcases.
2006-10-11 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_op_eq): check /invalidaccess for
only name/string objects.
* tests/ps/test-dup.ps:
* tests/ps/test-end.ps:
* tests/ps/test-dictstack.ps:
* tests/ps/test-div.ps:
* tests/ps/test-errordict.ps:
* tests/ps/test-eq.ps: new testcases.
* tests/ps/test-dict.ps: new testcase.
* hieroglyph/operator.c (_hg_operator_op_put): check /dictfull.
* hieroglyph/scanner.c (_hg_scanner_get_object): exclude dict object
to make a readonly object.
* hieroglyph/operator.c (_hg_operator_op_dict): detect /dictfull
if it's running on PS1 VM.
* hieroglyph/hgdict.c (hg_dict_new): allow to create an empty dict.
* plugins/test/hg_unittest.ps (.dotypecheck): fixed /dictfull error.
* tests/ps/test-cvx.ps:
* tests/ps/test-def.ps: new testcases.
2006-10-10 Akira TAGOH <at@gclab.org>
* lib/hg_init.ps (cvs): better error handling.
* tests/ps/test-cvs.ps:
* tests/ps/test-cvrs.ps: new testcases.
2006-10-09 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_op_cvi): fixed not catching
an exception in some cases.
(_hg_operator_op_cvr): likewise.
* tests/ps/test-cvr.ps: new testcase.
* hieroglyph/scanner.c (_hg_scanner_get_object): shut up the warning.
* hieroglyph/hgvaluenode.c (hg_value_node_compare_content):
extend to be able to compare the permissions as well.
* hieroglyph/hgdict.c (_hg_dict_compare_on_traverse): likewise.
(hg_dict_compare): likewise.
* hieroglyph/hgarray.c (hg_array_compare): likewise.
* tests/ps/currentfile.ps: clean up.
* tests/ps/test-cvn.ps:
* tests/ps/test-cvlit.ps: new testcases.
* tests/ps/test-concatmatrix.ps:
* tests/ps/test-astore.ps:
* tests/ps/test-copy.ps:
* tests/ps/test-anchorsearch.ps:
* tests/ps/test-aload.ps:
* tests/ps/test-cvi.ps: add more testcases.
* tests/ps/test-ps.sh: run with the quiet mode.
* plugins/test/hg_unittest.ps (setunittestmask): new proc.
* plugins/test/test-main.c (_test_op_validateunittest): compare
the permissions too.
* tests/ps/test-0base.ps: new testcase.
* hieroglyph/operator.c (_hg_operator_op_cvi): check the overflow.
* hieroglyph/scanner.c (_hg_scanner_get_object): split up the numeral
parser.
(_hg_scanner_parse_number): new function.
* hieroglyph/Makefile.am (libhieroglyph_private_SOURCES):
add iarray.[ch].
* hieroglyph/iarray.[ch]: new files.
2006-10-08 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_op_add): correct the overflow
checking.
* tests/ps/test-add.ps: add more testcases.
2006-10-05 Akira TAGOH <at@gclab.org>
* tests/ps/test-ps.sh: change the current dir during testing to ensure
the expected behavior.
* tests/ps/test-count.ps:
* tests/ps/test-countdictstack.ps:
* tests/ps/test-counttomark.ps:
* tests/ps/test-currentdict.ps:
* tests/ps/test-currentfile.ps:
* tests/ps/testtest-currentfile.ps: new testcases.
* hieroglyph/hgvaluenode.h (HG_VALUE_REAL_SIMILAR): need to decrease
the precision to ensure "90 cos" is 0.
* hieroglyph/hgvaluenode.c (hg_value_node_compare_content): use macro.
* plugins/test/hg_unittest.ps (.dotypecheck): reflect the result to
dict.
2006-09-24 Akira TAGOH <at@gclab.org>
* tests/ps/test-copy.ps: new testcase.
* hieroglyph/operator.c (_hg_operator_op_concatmatrix):
create new node to store the result. array may has the same instance
for node.
(_hg_operator_op_copy): fixed a typo. and check /typecheck first.
* plugins/test/hg_unittest.ps (.dotypecheck): create another file
object to avoid any breakages.
* tests/ps/test-ceiling.ps:
* tests/ps/test-clear.ps:
* tests/ps/test-cleartomark.ps:
* tests/ps/test-closefile.ps:
* tests/ps/test-concatmatrix.ps: new testcases.
* hieroglyph/hgplugins.c (_hg_plugin_load): silence the debug output.
* tests/ps/test-and.ps:
* tests/ps/test-array.ps:
* tests/ps/test-astore.ps:
* tests/ps/test-atan.ps:
* tests/ps/test-begin.ps:
* tests/ps/test-bind.ps:
* tests/ps/test-bitshift.ps: new testcases.
* hieroglyph/hgarray.c (hg_array_set_name): don't free array->name
here. it may be likely that older objects in snapshot may still refers
to it.
* hieroglyph/hgstring.c (hg_string_new): fixed the uninitialized value.
* plugins/debug/debug-main.c (_debug_op_breakpoint): new function.
* lib/hg_init.ps (anchorsearch): fixed wrong return value.
treat /rangecheck as /stackunderflow when it happens in index or roll.
* tests/ps/test-aload.ps: new testcase.
* tests/ps/test-anchorsearch.ps: new testcase.
* plugins/test/hg_unittest.ps (typecheck): new procedure to test
if /typecheck happens.
(.dotypecheck): new.
2006-09-23 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_op_add): fixed a overflow.
* hieroglyph/hgvaluenode.c (hg_value_node_compare): use macro.
* tests/ps/test-add.ps: new test case.
* src/hgs.c (main): returns an error code.
* plugins/test/hg_unittest.ps (unittestresult): stop with an error code
when unit test failed.
2006-09-20 Akira TAGOH <at@gclab.org>
* tests/ps/test-ps.sh: depends on hgs instead of pse.
* tests/ps/Makefile.am (check): run test-ps.sh.
* plugins/test/hg_unittest.ps (initunittest): new proc.
(unittest): updated the result in dict.
(unittestresult): new proc.
* hieroglyph/hgmem.h (hg_mem_set_dead): new macro.
(hg_mem_unset_dead): likewise.
(hg_mem_is_dead): likewise.
* hieroglyph/hgallocator-bfit.c (_hg_bfit_snapshot_chunk_new):
new function.
(_hg_bfit_snapshot_chunk_free): new function.
(_hg_allocator_bfit_real_save_snapshot): implemented.
(_hg_allocator_bfit_real_restore_snapshot): implemented.
(_hg_allocator_bfit_real_resize): set a HG_FL_DEAD flag instead of
hg_mem_free().
(_hg_allocator_bfit_snapshot_real_free): implemented.
(_hg_allocator_bfit_snapshot_real_set_flags): implemented.
2006-09-18 Akira TAGOH <at@gclab.org>
* hieroglyph/vm.c (_hg_vm_set_error): replace *POINTER to *OPERATOR.
(_hg_vm_set_error_from_file): likewise.
(hg_vm_init): makes a VM memory pool to be a local pool.
* hieroglyph/scanner.c (_hg_scanner_set_error): likewise.
* plugins/test/test-main.c (REMOVE_OP): replace *POINTER to *OPERATOR.
* plugins/debug/debug-main.c (REMOVE_OP): likewise.
* plugins/libedit/libedit-main.c (REMOVE_OP): likewise.
* hieroglyph/operator.[ch]: likewise.
* hieroglyph/hgvaluenode.[ch]: use separate structure instead of union.
(_hg_value_node_register_type): new function.
(hg_value_node_init): new function.
(hg_value_node_finalize): new function.
(hg_value_node_register_type): new function.
(hg_value_node_get_type_name): new function.
* src/hgspy.c (_hgspy_vm_thread): likewise.
* src/hgs.c (_hgs_arg_load_plugin_cb): reflect a return value from
hg_vm_load_plugin().
2006-09-09 Akira TAGOH <at@gclab.org>
* hieroglyph/hgallocator-private.h (HG_MEM_POOL_FLAGS_GET_FLAGS):
new macro.
(HG_MEM_POOL_GET_FLAGS): likewise.
(HG_MEM_POOL_SET_FLAGS): likewise.
(HG_MEM_POOL_FLAGS_HAS_FLAGS): likewise.
(HG_MEM_POOL_HAS_FLAGS): likewise.
* hieroglyph/hgmem.c (hg_mem_pool_new): take bitwise flags.
(hg_mem_pool_use_global_mode): removed.
2006-09-06 Akira TAGOH <at@gclab.org>
* src/hgs.c (_hgs_arg_define_cb): implemented.
(_hgs_arg_load_plugin_cb): simplified.
(main): added --device option.
2006-09-05 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.h (hg_mem_is_flags__inline): use
hg_mem_is_gc_mark__inline if it goes to be marked for GC.
(hg_mem_set_flags__inline): don't inherit the age of gc mark to
the children.
* hieroglyph/hgmem.c (hg_mem_pool_get_age_of_mark): new function.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_garbage_collection):
show the age of gc mark for debugging purpose.
* hieroglyph/hgvaluenode.c (hg_value_node_debug_print): show the age of
gc mark for debugging purpose.
* hieroglyph/hgfile.c (hg_file_object_read): trivial warning message fix.
(hg_file_object_write): likewise.
(hg_file_object_getc): likewise.
* hieroglyph/hgarray.c (hg_array_make_subarray): make an empty array
if end_index is out of range.
* hieroglyph/operator.c (_hg_operator_op_search): just call
hg_string_make_substring.
* hieroglyph/hgstring.c (hg_string_make_substring): make an empty
string if end_index is out of range.
* hieroglyph/operator-private.h: moved macros from operator.c
* hieroglyph/vm.c (_hg_vm_eval_file): reflect an error result from
$error dict.
* hieroglyph/hgplugins.c (hg_plugin_load): output an warning
if load failed.
* plugins/test/test-main.c (plugin_load): load will be failed
if any errors happened during loading hg_unittest.ps.
* hieroglyph/vm.c (hg_vm_startjob): no need to enter in the loop
if the file is given.
(_hg_vm_eval_file): set FALSE if no errors happened.
2006-09-04 Akira TAGOH <at@gclab.org>
* hieroglyph/hgdict.c: use HgList instead of GList.
(_hg_dict_node_free): removed.
(_hg_dict_real_free): removed.
(_hg_dict_traverse_relocate): removed.
* hieroglyph/hgallocator-libc.[ch]: removed.
* hieroglyph/hgallocator-bfit.c: use HgList instead of GSList.
(_hg_allocator_bfit_btree_traverse_in_destroy): removed.
(_hg_allocator_bfit_real_initialize): libc pool is no longer needed.
(_hg_allocator_bfit_real_free_block_traverse): new function.
* hieroglyph/ilist.c (_hg_list_free): check NULL.
(_hg_list_iter_delete_link): fixed a memory leak.
* hieroglyph/hggraphics.c (hg_graphics_new): fixed uninitialized value.
* hieroglyph/ilist.h (hg_list_free): new macro.
* hieroglyph/ilist.[ch]: new files.
* hieroglyph/ibtree.[ch]: new files.
* hieroglyph/hglist.c (_hg_list_iter_real_set_data): new function.
(hg_list_init): new function.
(hg_list_finalize): new function.
(hg_list_first): new function.
(hg_list_last): new function.
(hg_list_iter_new): use own memory pool to avoid an allocation failure,
because it's quite likely so that it's used under set_flags where could
be invoked during GC.
(hg_list_iter_get_data): renamed.
(hg_list_iter_set_data): new function.
(hg_list_iter_set_object): new function.
(hg_list_iter_delete_link): new function.
(hg_list_find_iter): new function.
(hg_list_find_iter_custom): new function.
* hieroglyph/vm.c (_hg_vm_eval_file): allow NULL to not want to get
an error result.
* src/hgspy.c (_hgspy_quit_cb): try to shutdown VM.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_remove_block):
* hieroglyph/operator.c (_hg_operator_real_set_flags): fixed outdated
function call.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_initialize):
disable the unsuported features.
(_hg_allocator_bfit_real_garbage_collection): output more debugging
info.
* src/hgspy_helper.c (hg_mem_alloc_with_flags): fixed a segfault issue.
2006-09-03 Akira TAGOH <at@gclab.org>
* hieroglyph/hglist.[ch]: new files.
* hieroglyph/hgbtree.c (_hg_btree_page_real_set_flags): stop marking
if marking is disabled by request.
(_hg_btree_page_real_relocate): likewise.
(hg_btree_allow_marking): new function.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_initialize):
disallow marking to avoid warnings so that the stored values aren't
any hieroglyph objects.
* hieroglyph/hgarray.c (_hg_array_real_set_flags): stop marking
if the object is already marked.
2006-08-28 Akira TAGOH <at@gclab.org>
* hieroglyph/Makefile.am (hginclude_HEADERS): added hgallocator-libc.h
(libhieroglyph_la_SOURCES): added hgallocator-libc.c
* hieroglyph/hgbtree.c (_hg_btree_page_real_free): new function.
(_hg_btree_page_real_set_flags): new function.
(_hg_btree_page_real_relocate): new function.
(_hg_btree_real_free): new function.
(_hg_btree_real_set_flags): new function.
(_hg_btree_real_relocate): new function.
* hieroglyph/hgallocator-libc.[ch]: new files.
* hieroglyph/hgdict.c (_hg_dict_real_free): modified to use new HgBTree
that is now managed under the hieroglyph mm.
(_hg_dict_real_set_flags): likewise.
(_hg_dict_real_relocate): likewise.
(hg_dict_new): likewise.
* hieroglyph/hgmem.c (hg_mem_init): use GHashTable instead of HgBTree.
it can't be used before hg_mem_init finished.
(hg_mem_finalize): modified to use GHashTable.
(hg_object_set_vtable): likewise.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_initialize):
modified to use HgBTree that is now managed under the hieroglyph mm.
(_hg_allocator_bfit_real_destroy): likewise.
2006-08-27 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_op_private_hg_filelibfile):
push a filename into the stack even if no files found.
* hieroglyph/vm.c (hg_vm_startjob): add an error handler
when the external file is being invoked.
(hg_vm_set_error_from_file): just ignore an error code 0.
* hieroglyph/hglineedit.c (_hg_line_edit__default_get_line):
return NULL if EBADF happens.
* lib/hg_init.ps (runlibfile): trivial fix.
* README: updated.
2006-08-25 Akira TAGOH <at@gclab.org>
* hieroglyph/hgstack.c (hg_stack_roll): trivial fix.
2006-08-23 Akira TAGOH <at@gclab.org>
* hieroglyph/hgstack.c (hg_stack_roll): fixed a segfault issue.
* configure.ac: disable -Werror when not specifying
--enable-maintainer-mode.
2006-08-22 Akira TAGOH <at@gclab.org>
* lib/hg_init.ps (StandardEncoding): implemented.
* hieroglyph/operator.c (_hg_operator_op_bind): ignore the writable check
during initialization.
* hieroglyph/vm.c (hg_vm_set_io): reflect the IO changes to HgLineEdit.
(hg_vm_startjob): just changes the IO with an initializer.
* hieroglyph/hglineedit.c (_hg_line_edit_real_set_flags): new function.
(_hg_line_edit_real_relocate): new function.
(_hg_line_edit__default_get_line): use HgFileObject instead of using low APIs.
(hg_line_edit_set_stdin): new function.
(hg_line_edit_set_stdout): new function.
* lib/hg_init.ps (start): implemented.
not entered into the loop here.
2006-08-20 Akira TAGOH <at@gclab.org>
* hieroglyph/hgplugins.c (hg_plugin_unload): fixed a typo.
(hg_plugin_open): trivial improvement.
* hieroglyph/vm.c (hg_vm_main): make sure that VM isn't going to shut
down.
* hieroglyph/operator.c (_hg_operator_op_private_hg_quit):
new function.
* hieroglyph/vm.c (hg_vm_get_error_code): new function.
(hg_vm_set_error_code): likewise.
(hg_vm_shutdown): likewise.
* lib/hg_init.ps (quit): implemented in PostScript.
2006-08-19 Akira TAGOH <at@gclab.org>
* lib/hg_init.ps (load): implemented in PostScript.
* hieroglyph/operator.c (hg_operator_level1_init): removed anchorsearch
implementation.
(_hg_operator_op_load): removed.
* lib/hg_init.ps (anchorsearch): implemented in PostScript.
* hieroglyph/operator.c (_hg_operator_op_private_hg_undef):
implemented.
* lib/hg_init_lv2.ps (undef): defined.
* lib/hg_init.ps: undef .forceput and .odef.
* hieroglyph/hgarray.c (hg_array_set_name): new function.
(hg_array_get_name): new function.
* hieroglyph/operator.c (_hg_operator_op_private_hg_odef):
new function.
(_hg_operator_op_private_hg_forceput): ignore even readonly flag.
* hieroglyph/scanner.c (_hg_scanner_get_object): disabled making
an readonly object during initialization.
* hieroglyph/vm.c (hg_vm_set_error): dumps stacks if no handler
available.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_to_string): return
the array name instead of -array- if it has.
(hg_value_node_debug_print): fixed a segfault issue.
* lib/hg_init.ps (odef): improved to deal with the error recovery.
2006-08-18 Akira TAGOH <at@gclab.org>
* tests/ps/test-abs.ps: new file.
* tests/ps/test-ps.sh: try to test the PostScript file on the same
directory to the test runner.
* plugins/test/hg_unittest.ps: fixed a typo.
* hieroglyph/hgarray.c (hg_array_compare): new function.
* hieroglyph/hgbtree.c (hg_btree_page_foreach): breaks the loop
if the function returns false.
* hieroglyph/hgdict.c (_hg_dict_compare_on_traverse): new function.
(hg_dict_compare): new function.
* hieroglyph/hgvaluenode.c (hg_value_node_compare_content):
new function.
* tests/ps/Makefile.am: new file.
* tests/ps/test-ps.sh: new file.
* plugins/test/test-main.c (_test_op_validateunittest): use
hg_value_node_compare_content instead of hg_value_node_compare.
* hieroglyph/operator.c (_hg_operator_op_private_hg_findlibfile):
new function.
* hieroglyph/vm.c (hg_vm_find_libfile): new function.
* lib/hg_init.ps (runlibfile): implemented.
* tests/run.sh: inherit HIEROGLYPH_LIB_PATH.
* plugins/test/hg_unittest.ps: new file.
* plugins/test/Makefile.am (hgpslib_DATA): add hg_unittest.ps.
* plugins/test/test-main.c (_test_op_validateunittest): new function.
(plugin_init): implemented.
(plugin_load): implemented.
(plugin_unload): implemented.
* hieroglyph/operator.c (_hg_operator_op_for): check the executeonly
flag.
(_hg_operator_op_forall): likewise.
(_hg_operator_op_if): likewise.
(_hg_operator_op_ifelse): likewise.
(_hg_operator_op_loop): likewise.
(_hg_operator_op_repeat): likewise.
(_hg_operator_op_stopped): likewise.
2006-08-16 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_op_search): implemented.
* hieroglyph/hgstring.c (hg_string_compare_offset_later): new function.
(hg_string_ncompare_offset_later): new function.
(hg_string_ncompare): just return false if length is greater than
the source length.
(hg_string_compare_with_raw): likewise.
* src/hgspy.c (_hgspy_file_close_cb): new function.
* hieroglyph/hgfile.c (hg_file_object_is_closed): new function.
* hieroglyph/operator.c (_hg_operator_op_status): implemented.
2006-08-15 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_op_token): implemented.
* hieroglyph/hgfile.c (hg_file_object_seek): reflect ungetc.
* hieroglyph/scanner.h (_hg_scanner_isspace): new macro.
* hieroglyph/hgstring.c (hg_string_copy_as_substring): refer to current
substring offset to not break a substring when making from substring.
* hieroglyph/hgarray.c (hg_array_copy_as_subarray): refer to current
subarray offset to not break a subarray when making from subarray.
* hieroglyph/operator.c (_hg_operator_op_put): improved to detect
/invalidaccess.
* hieroglyph/vm.c (hg_vm_is_global_object): new function.
* hieroglyph/hgvaluenode.h (HG_VALUE_SET_ARRAY): inherited a complex
mark to find it easily.
(HG_VALUE_SET_STRING): likewise.
(HG_VALUE_SET_DICT): likewise.
(HG_VALUE_SET_POINTER): likewise.
(HG_VALUE_SET_FILE): likewise.
(HG_VALUE_SET_SNAPSHOT): likewise.
(HG_VALUE_MAKE_ARRAY): likewise.
(HG_VALUE_MAKE_STRING): likewise.
(HG_VALUE_MAKE_DICT): likewise.
(HG_VALUE_MAKE_POINTER): likewise.
(HG_VALUE_MAKE_FILE): likewise.
(HG_VALUE_MAKE_SNAPSHOT): likewise.
(hg_value_node_inherit_complex): new macro.
(hg_value_node_has_complex_object): likewise.
* lib/hg_init.ps (store): implemented.
* hieroglyph/hgfile.c (hg_file_object_new): marked as complex object.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_save_snapshot):
likewise.
* hieroglyph/operator.c (_hg_operator_op_writehexstring): implemented.
(_hg_operator_op_write): implemented.
2006-08-14 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_op_readline): have to check EOF
after reading a character.
(_hg_operator_op_readstring): implemented.
(_hg_operator_op_round): implemented.
(_hg_operator_or_xor): implemented.
* src/hgspy.c (_hgspy_update_vm_status): use macro.
* hieroglyph/hgvaluenode.c (hg_value_node_debug_print): use macro
instead of casting directly.
* configure.ac: don't stop configure process even if libedit isn't
installed.
* plugins/Makefile.am (SUBDIRS): built without libedit plugin
if it's not available.
* hieroglyph/vm.c (_hg_vm_eval_file): new function.
(hg_vm_set_ostack): new function.
(hg_vm_set_estack): make it as a private function.
(hg_vm_set_dstack): new function.
(hg_vm_eval): new function.
* lib/hg_init.ps: don't invoke if .loadhistory and .savehistory isn't
available.
* plugins/libedit/libedit-main.c (_libedit_op_loadhistory): moved from
operator.c.
(_libedit_op_statementedit): likewise.
(_libedit_op_savehistory): likewise.
2006-08-13 Akira TAGOH <at@gclab.org>
* hieroglyph/scanner.c (_hg_scanner_get_object): '\r', '\n' and '\r\n'
has to be escaped by '\'.
* hieroglyph/operator.c (_hg_operator_op_readhexstring):
check the access attributes.
* hieroglyph/hglineedit.c (_hg_line_edit__default_get_line):
implemented.
2006-08-10 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_op_file): give a HgLineEdit
for %lineedit.
(_hg_operator_op_readhexstring): implemented.
* hieroglyph/hgstring.c (_hg_string_real_to_string): mask a character
to get a char exactly.
2006-08-03 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_op_cvn): inherited
the executeonly.
* hieroglyph/hgmem.h (hg_object_is_accessible): new macro.
* hieroglyph/hgmem.c (hg_mem_pool_new): changed the default access
mode.
* hieroglyph/operator.c (_hg_operator_op_exec): check executeonly flag.
(_hg_operator_op_executeonly): implemented.
(_hg_operator_op_noaccess): use hg_object_inaccessible.
* hieroglyph/vm.c (hg_vm_main): set the same flags from string to file.
* hieroglyph/hgmem.h (hg_object_inexecutable): renamed from
hg_object_unexecutable.
(hg_object_executeonly): new macro.
(hg_object_is_executeonly): new macro.
(hg_object_inaccessible): new macro.
2006-08-02 Akira TAGOH <at@gclab.org>
* plugins/debug/Makefile.am (LIBS): removed the unnecessary dependency.
* hieroglyph/operator.c (hg_operator_hieroglyph_init): removed
.startgc definition.
(_hg_operator_op_private_hg_startgc): removed.
* plugins/Makefile.am (SUBDIRS): added debug subdir.
* plugins/debug/debug-main.c: new file.
* plugins/debug/Makefile.am: new file.
* hieroglyph/operator.h (_hg_operator_build_operator): moved from
operator.c.
(BUILD_OP): likewise.
(BUILD_OP_): likewise.
(hg_operator_build_operator__inline): new macro.
2006-07-26 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_op_ln): implemented.
(_hg_operator_op_log): implemented.
(_hg_operator_op_readonly): implemented.
2006-07-24 Akira TAGOH <at@gclab.org>
* lib/hg_init.ps (matrix): use identmatrix instead of
the own C function.
* hieroglyph/operator.c (_hg_operator_op_identmatrix): implemented.
(_hg_operator_op_matrix): moved into lib/hg_init.ps.
* hieroglyph/hgfile.c (hg_file_object_flush): changed the behavior for
read mode.
* hieroglyph/operator.c (_hg_operator_op_flushfile): implemented.
2006-07-23 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_op_cvrs): implemented.
* hieroglyph/hgstring.c (hg_string_convert_from_integer): new function.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_to_string): suppressed
the unnecessary zeros.
2006-07-18 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_op_cvr): implemented.
(_hg_operator_op_copy): fixed to not include a invalid character in
a substring.
* tests/ps/currentfile.ps: new file.
* hieroglyph/operator.c (_hg_operator_op_closefile): implemented.
(_hg_operator_op_currentfile): implemented.
(_hg_operator_op_readline): implemented.
* hieroglyph/hgfile.c (_hg_file_object_real_free): use
hg_file_object_close instead of handling a close process directly.
(hg_file_object_close): new function.
* src/hgspy.c (_hgspy_file_close_cb): new function.
* hieroglyph/operator.c (_hg_operator_op_bytesavailable): implemented.
(_hg_operator_op_ceiling): implemented.
* hieroglyph/hgfile.c (hg_file_object_seek): new function.
(hg_file_object_is_readable): new function.
(hg_file_object_is_writable): new function.
* src/hgspy.c (_hgspy_file_seek_cb): new function.
2006-07-17 Akira TAGOH <at@gclab.org>
* hieroglyph/operator.c (_hg_operator_op_anchorsearch): implemented.
(_hg_operator_op_bitshift): implemented.
* hieroglyph/hgstring.c (hg_string_ncompare): new function.
(hg_string_copy_as_substring): fixed an index bug.
* README: described a bit.
* hieroglyph/Makefile.am (EXTRA_DIST): added version.h.in.in.
* Makefile.am (EXTRA_DIST): added update-version.
* hieroglyph.pc.in: trivial fix.
* Makefile.am (pkgconfig_DATA): removed hg-libretto.pc.
* examples/pse.c (_pse_plugin_arg_cb): new function.
* hieroglyph/operator.c (_hg_operator_op_file): support new HgLineEdit.
(_hg_operator_op_private_hg_initplugins): new function.
* hieroglyph/vm.c (hg_vm_load_plugin): new function.
(hg_vm_load_plugins_all): new function.
(hg_vm_unload_plugin): new function.
* hieroglyph/hgdevice.c (hg_device_new): support the multiple paths.
* lib/hg_init.ps: initialize the plugins.
* tests/run.sh: support the multiple paths.
2006-07-16 Akira TAGOH <at@gclab.org>
* hieroglyph/vm.c (hg_vm_new): create an instance of HgLineEdit.
* hieroglyph/hglineedit.[ch]: made a lot of changes to get rid of
the libedit dependency directly.
* hieroglyph/hgplugins.[ch]: new files.
* hieroglyph/hgfile.c (hg_file_object_new): handle an argument
as HgLineEdit.
* .gdbinit: modified for current object structures.
(hgstringprint): implemented.
* plugins/libedit/libedit-main.c (plugin_load): implemented.
(plugin_unload): implemented.
* hg-libretto.pc.in: removed.
* configure.ac: check for exp10 function.
* plugins/Makefile.am: new file.
* plugins/test/Makefile.am: new file.
* plugins/test/test-main.c: new file.
* plugins/libedit/Makefile.am: new file.
* plugins/libedit/libedit-main.c: new file.
* src/hgspy.c: use hieroglyph/* instead of libretto/*.
* src/Makefile.am: removed the libretto.la dependency.
* examples/pse.c: use hieroglyph/* instead of libretto/*.
* examples/cairo-xlib.c: likewise.
* examples/Makefile.am: removed the libretto.la dependency.
* hieroglyph/operator.[ch]: moved from libretto/.
* hieroglyph/scanner.[ch]: moved from libretto/.
* hieroglyph/vm.[ch]: moved from libretto/.
* hieroglyph/hggraphics.[ch]: moved from libretto/lbgraphics.[ch].
2006-07-04 Akira TAGOH <at@gclab.org>
* hieroglyph/hgvaluenode.c (hg_value_node_new): validate if pool is
non-null.
* src/hgspy.c (_hgspy_ask_dialog): new function.
(_hgspy_run_vm): ask if VM is already running.
* hieroglyph/hgstack.[ch]: new files.
* libretto/Makefile.am: removed lbstack.[ch].
* libretto/lbtypes.h: removed LibrettoStack definition.
* libretto/vm.[ch]: modified for LibrettoStack->HgStack transition.
* libretto/scanner.c: likewise.
* libretto/operator.c: likewise.
* libretto/lbstack.[ch]: moved as hieroglyph/hgstack.[ch].
* devices/cairo/cairo-xlib-main.c (device_close): fixed a memory leak.
2006-07-01 Akira TAGOH <at@gclab.org>
* TODO: add an item.
* hieroglyph/hgdict.c (hg_dict_new): add a limitation of the amount of
Hash items.
* libretto/vm.c (libretto_vm_new): allocate more spaces for the name
dict.
* hieroglyph/hgfile.h (HG_FILE_GET_FILE_TYPE): new macro.
(HG_FILE_SET_FILE_TYPE): new macro.
* hieroglyph/hgfile.c (_hg_file_object_real_free): use macro instead of
a direct access.
(_hg_file_object_real_set_flags): likewise.
(_hg_file_object_real_relocate): likewise.
(_hg_file_object_real_to_string): likewise.
(hg_file_object_new): likewise.
(hg_file_object_has_error): likewise.
(hg_file_object_read): likewise.
(hg_file_object_write): likewise.
(hg_file_object_getc): likewise.
(hg_file_object_flush): likewise.
* hieroglyph/hgstring.c (hg_string_new): add a limitation of the amount
of strings.
* hieroglyph/hgarray.c (hg_array_new): add a limitation of the amount
of arrays.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_dup): don't duplicate
a null object and a mark object.
(_hg_value_node_real_copy): don't copy a null object and a mark object.
* libretto/operator.c (_libretto_operator_op_array): use the existing
null object in systemdict.
* libretto/scanner.c (_libretto_scanner_get_object): free a special
null object that used for a terminator of proc.
(_libretto_scanner_get_object): use the existing mark object
in systemdict.
2006-06-20 Akira TAGOH <at@gclab.org>
* hieroglyph/hgvaluenode.c (hg_value_node_debug_print): show the name
to be dumped.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_alloc):
exactly set HG_FL_HGOBJECT.
2006-06-19 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.h (HG_OBJECT_INIT_OBJECT): new macro.
* hieroglyph/hgmacros.h (HG_MEMOBJ_GET_HGOBJECT_ID): new macro.
(HG_MEMOBJ_SET_HGOBJECT_ID): new macro.
(HG_MEMOBJ_IS_HGOBJECT): new macro.
(HG_OBJECT_GET_USER_DATA): new macro.
(HG_OBJECT_SET_USER_DATA): new macro.
* hieroglyph/hgvaluenode.h (HG_VALUE_GET_VALUE_TYPE): new macro.
(HG_VALUE_SET_VALUE_TYPE): new macro.
* hieroglyph/hgmem.h (HG_MEMOBJ_GET_MARK_AGE): new macro.
(HG_MEMOBJ_SET_MARK_AGE): new macro.
(hg_mem_set_flags__inline): use HG_MEMOBJ_SET_MARK_AGE for marking.
(hg_mem_add_flags__inline): modified for marking.
(hg_mem_gc_mark): removed.
(hg_mem_gc_unmark): removed.
(hg_mem_is_gc_mark): removed.
(hg_mem_gc_mark__inline): new macro.
(hg_mem_is_gc_mark__inline): new macro.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_garbage_collection):
increase an age of mark.
(_hg_allocator_bfit_real_garbage_collection): removed unmarking code.
(_hg_allocator_bfit_real_gc_unmark): removed.
* hieroglyph/hgarray.c (_hg_array_real_set_flags): modified to not use
HG_FL_MARK which is obsolete.
(hg_array_append_forcibly): removed pre-marking code.
(hg_array_replace_forcibly): likewise.
* hieroglyph/hgfile.c (_hg_file_object_real_set_flags): modified to not
use HG_FL_MARK which is obsolete.
* hieroglyph/hgstring.c (_hg_string_real_set_flags): likewise.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_set_flags): likewise.
* hieroglyph/hgdict.c (_hg_dict_node_real_set_flags): likewise.
(hg_dict_insert_forcibly): removed pre-marking code.
2006-06-18 Akira TAGOH <at@gclab.org>
* hieroglyph/hgarray.c (hg_array_new): use macro.
* hieroglyph/hgdict.c (hg_dict_node_new): use macro.
(hg_dict_new): likewise.
* hieroglyph/hgmem.h (hg_mem_get_object__inline): use macro.
(hg_mem_set_flags__inline): likewise.
* hieroglyph/hgmem.c (hg_mem_free): use macro.
(hg_object_dup): likewise.
(hg_object_copy): likewise.
(hg_object_get_vtable): likewise.
* hieroglyph/hgstring.c (hg_string_new): use macro.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_relocate):
use macro.
(_hg_allocator_bfit_real_alloc): likewise.
(_hg_allocator_bfit_real_resize): likewise.
(_hg_allocator_bfit_real_save_snapshot): likewise.
* hieroglyph/hgpath.c (hg_path_node_new): use macro.
(hg_path_new): likewise.
* hieroglyph/hgmacros.h (HG_CHECK_MAGIC_CODE): new macro.
(HG_SET_MAGIC_CODE): new macro.
* hieroglyph/hgvaluenode.c (hg_value_node_new): use macro.
* hieroglyph/hgfile.c (hg_file_object_new): use macro.
* hieroglyph/hgrender.c (hg_render_eofill_new): use macro.
(hg_render_fill_new): likewise.
(hg_render_stroke_new): likewise.
(hg_render_debug_new): likewise.
* libretto/operator.c (libretto_operator_new): use macro.
* libretto/lbstack.c (libretto_stack_new): use macro.
* libretto/vm.c (libretto_vm_new): use macro.
* libretto/lbgraphics.c (libretto_graphic_state_new): use macro.
(libretto_graphics_new): likewise.
* src/hgspy.c (_hgspy_entry_activate_cb): don't send anything
if VM isn't running.
(main): added visualizer widget into VPaned.
* src/visualizer.c (hg_memory_visualizer_real_size_request):
new function.
* src/hgspy.c (_hgspy_file_read_cb): update a prompt.
(_hgspy_entry_activate_cb): echo back the input to the textview.
(_hgspy_insert_text_into_textview): new function.
(main): added a prompt label.
* src/visualizer.c (hg_memory_visualizer_class_init): added gc-started
and gc-finished signals.
(hg_memory_visualizer_notify_gc_state): new function.
* src/hgspy.c (_hgspy_gc_started_cb): new function.
(_hgspy_gc_finished_cb): new function.
(main): added a statusbar.
* src/hgspy_helper.c (helper_init): watch hg_mem_garbage_collection too.
(hg_mem_garbage_collection): new function.
* examples/cairo-xlib.c (main): invoke HG_MEM_INIT before doing anything.
* hieroglyph/hgarray.c (hg_array_new): improved a footprint.
* hieroglyph/hgmem.h (hg_mem_set_flags__inline): don't access vtable
directly.
(HG_OBJECT_GET_VTABLE_ID): new macro.
(HG_OBJECT_SET_VTABLE_ID): likewise.
(HG_OBJECT_GET_STATE): likewise.
(HG_OBJECT_SET_STATE): likewise.
* hieroglyph/hgdict.c (hg_dict_node_new): improved a footprint.
(hg_dict_new): likewise.
* hieroglyph/hgmem.c (hg_mem_init): initialize vtable tree for
HgObject.
(hg_mem_finalize): destroy vtable tree for HgObject.
(hg_mem_free): don't access vtable directly.
(hg_object_get_state): use macro instead of direct access.
(hg_object_set_state): likewise.
(hg_object_is_state): likewise.
(hg_object_dup): don't access vtable directly.
(hg_object_copy): likewise.
(hg_object_get_vtable): new function.
(hg_object_set_vtable): new function.
* hieroglyph/hgstring.c (hg_string_new): improved a footprint.
(hg_object_to_string): use macro instead of direct access.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_relocate):
don't access vtable directly.
(_hg_allocator_bfit_real_resize): likewise.
(_hg_allocator_bfit_real_save_snapshot): improved a footprint.
* hieroglyph/hgpath.c (hg_path_node_new): improved a footprint.
(hg_path_new): likewise.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_dup): use macro
instead of direct access.
(_hg_value_node_real_copy): likewise.
(hg_value_node_new): improved a footprint.
* hieroglyph/hgfile.c (hg_file_object_new): improved a footprint.
* hieroglyph/hgrender.c (hg_render_eofill_new): improved a footprint.
(hg_render_fill_new): likewise.
(hg_render_stroke_new): likewise.
(hg_render_debug_new): likewise.
* libretto/operator.c (libretto_operator_new): improved a footprint.
* libretto/lbgraphics.c (libretto_graphic_state_new): improved
a footprint.
(libretto_graphics_new): likewise.
* libretto/vm.c (libretto_vm_new): likewise.
* libretto/lbstack.c (libretto_stack_new): likewise.
(libretto_stack_dump): don't reply on hieroglyph memory management
system to dump a stack. it may be failed.
2006-06-16 Akira TAGOH <at@gclab.org>
* src/hgspy.c (_hgspy_quit_cb): new function.
(_hgspy_file_write_cb): scroll up to the latest output.
(main): only wait for finalize process when VM is running.
* src/visualizer.c (_hg_memory_visualizer_idle_handler_cb): update
a pixmap in lock.
* src/hgspy.c (main): changed the default window size.
* hieroglyph/hgfile.c (_hg_file_object_real_free): add
HG_FILE_TYPE_BUFFER_WITH_CALLBACK support.
(hg_file_object_new): likewise.
(hg_file_object_has_error): likewise.
(hg_file_object_read): likewise.
(hg_file_object_write): likewise.
(hg_file_object_getc): likewise.
(hg_file_object_flush): new function.
* src/visualizer.c (hg_memory_visualizer_set_max_size): fixed memory
corruption.
(hg_memory_visualizer_set_heap_state): don't add a pool name when it's
already in pool_name_list.
* src/hgspy.c (_hgspy_op_private_statementedit): new function to take
over the statementedit.
(_hgspy_file_read_cb): new function.
(_hgspy_file_write_cb): new function.
(_hgspy_file_is_eof_cb): new function.
(_hgspy_file_get_error_code_cb): new function.
(_hgspy_vm_thread): override stdin/stdout in VM, and ..statementedit
operator.
(_hgspy_entry_activate_cb): new function.
(main): invoke gdk_threads_init first.
(main): add input/output widget.
2006-06-15 Akira TAGOH <at@gclab.org>
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_garbage_collection):
use a flag instead of mutex lock.
* src/visualizer.c (hg_memory_visualizer_real_destroy): free a node in
pool_name_list.
(_hg_memory_visualizer_compare_pool_name_list): new function.
(hg_memory_visualizer_remove_pool): new function.
* src/hgspy.c (_hgspy_vm_thread): finalize vm instance.
(_hgspy_pool_updated_cb): allow NULL for name and add None item to menu
when no menuitem is added.
(_hgspy_update_vm_status): clear text when name is NULL.
* src/hgspy_helper.c (helper_init): watch hg_mem_pool_destroy as well.
(hg_mem_pool_destroy): new function.
* src/visualizer.c (hg_memory_visualizer_real_size_allocate):
implemented.
(hg_memory_visualizer_real_realize): implemented.
(hg_memory_visualizer_real_expose): implemented.
(hg_memory_visualizer_class_init): added draw-updated signal.
(hg_memory_visualizer_real_unrealize): implemented.
(_hg_memory_visualizer_idle_handler_cb): update a pixmap.
(_hg_memory_visualizer_create_gc): new function.
(_hg_memory_visualizer_redraw_in_pixmap): new function.
(hg_memory_visualizer_get_used_size): new function.
(hg_memory_visualizer_get_current_pool_name): new function.
(hg_memory_visualizer_set_chunk_state): update a pixmap only when
changes happened on current pool.
* src/hgspy.c (_hgspy_draw_updated_cb): new function.
(_hgspy_update_vm_status): new function.
(main): add widgets for memory informations.
* src/hgspy_helper.c (helper_init): get an original function pointer
for hg_mem_resize.
(hg_mem_alloc_with_flags): check null.
(hg_mem_free): fixed a typo.
(hg_mem_resize): new function. need to watch this function too.
* examples/pse.c (main): invoke HG_MEM_INIT before doing anything.
* hieroglyph/hgvaluenode.h (HG_VALUE_SET_VALUE_NODE): check null.
* libretto/operator.c (_libretto_operator_op_array): set /VMError when
creating a null object is failed.
2006-06-12 Akira TAGOH <at@gclab.org>
* hieroglyph/hgfile.c (hg_file_object_new): use strncpy instead of
strcpy.
* libretto/operator.c (_libretto_operator_op_private_hg_abort):
dump a vm status as well.
(libretto_operator_new): use strncpy instead of strpy.
* devices/cairo/cairo-ps-main.c (device_open): use g_file_open_tmp
instead.
2006-06-05 Akira TAGOH <at@gclab.org>
* src/visualizer.c (hg_memory_visualizer_real_destroy): remove idle
timer.
(hg_memory_visualizer_real_size_allocate): implemented a bit.
(hg_memory_visualizer_real_unrealize): remove idle timer.
(hg_memory_visualizer_real_map): add idle timer.
(hg_memory_visualizer_real_unmap): remove idle timer.
(hg_memory_visualizer_class_init): add a signal, pool-updated.
(_hg_memory_visualizer_idle_handler_cb): new function.
(_hg_memory_visualizer_add_idle): new function.
(_hg_memory_visualizer_remove_idle): new function.
(hg_memory_visualizer_set_heap_state): set current pool and info.
(hg_memory_visualizer_set_chunk_state): set a flag to be updated.
(hg_memory_visualizer_change_pool): new function.
* src/hgspy.c (_hgspy_radio_menu_pool_activate_cb): new function.
(_hgspy_pool_updated_cb): new function.
* hieroglyph/version.h.in.in: surround with G_*_DECLS.
* src/visualizer.c (hg_memory_visualizer_real_destroy): set a null to
avoid a double-free.
* src/hgspy.c (_hgspy_action_menubar_open_cb): set a filter name.
(main): set a window title and added a view menu.
* Makefile.am (SUBDIRS): added po.
* configure.ac (ALL_LINGUAS): added ja.
* hieroglyph/hgmem.c (hg_mem_init_stack_start): new function.
(hg_mem_pool_add_heap): new function.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_initialize):
use hg_mem_pool_add_heap instead of direct access.
(_hg_allocator_bfit_real_resize_pool): likewise.
* hieroglyph/hgmacros.h (HG_STACK_INIT): new macro.
(HG_MEM_INIT): new macro.
* src/visualizer.c (_heap2offset_new): new function.
(_heap2offset_free): new function.
(hg_memory_visualizer_set_max_size): store the max size for each pools.
(hg_memory_visualizer_get_max_size): similar change.
(hg_memory_visualizer_set_heap_state): new function.
(hg_memory_visualizer_set_chunk_state): implemented.
* src/hgspy.c (_hgspy_vm_thread): call HG_MEM_INIT here.
* src/hgspy_helper.c (hg_mem_pool_add_heap): new function.
2006-06-04 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (hg_mem_gc_mark_array_region): new function.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_garbage_collection):
lock with mutex during GC.
(_hg_allocator_bfit_real_gc_mark): use hg_mem_gc_mark_array_region.
(_hg_allocator_bfit_real_is_safe_object): new function.
2006-06-03 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (hg_mem_get_object_size): new function.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_get_object_size__inline):
new macro.
(_hg_allocator_bfit_real_get_size): new function.
* src/hgspy_helper.c (hg_mem_alloc_with_flags): don't access block_size
directly.
(hg_mem_free): likewise.
* hieroglyph/hgbtree.c (hg_btree_find_near): fixed to get correct near block.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_get_minimum_aligned_size__inline):
new macro.
(_hg_allocator_get_aligned_size__inline): likewise.
(_hg_allocator_compute_minimum_block_size_index__inline): removed.
(_hg_allocator_grow_index_size__inline): removed.
(_hg_allocator_compute_block_size_index__inline): removed.
(_hg_allocator_compute_block_size__inline): removed.
* hieroglyph/hgvaluenode.h (HG_VALUE_SET_NAME_STATIC): allocate more
memory for null-terminated.
* .gdbinit (_hgmeminfo): support compat structure.
2006-06-02 Akira TAGOH <at@gclab.org>
* hieroglyph/hgtypes.h: improved a footprint a bit.
* hieroglyph/hgmem.h (HG_MEMOBJ_GET_HEAP_ID): new macro.
(HG_MEMOBJ_SET_HEAP_ID): new macro.
(HG_MEMOBJ_GET_FLAGS): new macro.
(HG_MEMOBJ_SET_FLAGS): new macro.
(HG_MEMOBJ_INIT_FLAGS): new macro.
(hg_mem_is_flags__inline): use macro instead of direct access.
(hg_mem_get_flags__inline): likewise.
(hg_mem_set_flags__inline): likewise.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_alloc):
use macro instead of direct access.
(_hg_allocator_bfit_real_resize): likewise.
* hieroglyph/hgvaluenode.c (hg_value_node_new): removed unnecessary
value.
* src/hgspy_helper.c (hg_mem_alloc_with_flags): use macro instead of
direct access.
(hg_mem_free): likewise.
2006-05-29 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (hg_mem_garbage_collection): trivial fix.
* libretto/vm.c (libretto_vm_new): just disable a global pool so far.
* commit.sh: ask once when going to commit without log.
* src/hgspy_helper.[ch]: new files.
* src/hgspy.c: new file.
* src/visualizer.[ch]: new files.
* src/Makefile.am: new file.
* po/POTFILES.in: new file.
2006-05-25 Akira TAGOH <at@gclab.org>
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_resize):
update a block size in HgMemObject as well.
(_hg_allocator_bfit_snapshot_real_to_string): implemented.
* hieroglyph/hgfile.c (hg_file_object_new): fixed a memory corruption.
2006-05-19 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (hg_mem_pool_new): enable periodical GC by default.
* hieroglyph/hgarray.c (_hg_array_real_copy): update the amount of
objects in array when an object is copied once. it caused not marking
when GC happened during copying.
* hieroglyph/hgmem.h (hg_mem_set_flags__inline): don't recursively
set flags that isn't expected.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_add_free_block):
exactly clear headers.
(_hg_allocator_bfit_real_alloc): likewise.
* hieroglyph/hgvaluenode.c (hg_value_node_debug_print): renamed.
* .gdbinit: added.
* hieroglyph/hgstring.c (hg_string_new): ensure a memory for termination.
(hg_string_append_c): likewise.
(hg_string_append): likewise.
(hg_string_fix_string_size): likewise.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_garbage_collection):
unmark objects in other pools after GC.
(_hg_allocator_bfit_real_gc_unmark): new function.
* libretto/operator.c (_libretto_operator_op_copy): clean up.
2006-05-12 Akira TAGOH <at@gclab.org>
* hieroglyph/hgarray.c (_hg_array_real_copy): unset copying flag
if fails happens.
(hg_array_append_forcibly): add pool if node is from different pool.
(hg_array_replace_forcibly): likewise.
* hieroglyph/hgdict.c (hg_dict_insert_forcibly): check if object
is sane.
(hg_dict_insert_forcibly): add pool if node is from different pool.
* hieroglyph/hgmem.c (_hg_mem_pool_is_own_memobject): new function.
(hg_mem_add_pool_reference): don't add the duplicate pool.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_add_free_block):
clear data to avoid incomplete header detection.
(_hg_allocator_bfit_relocate): avoid the infinite loop.
(_hg_allocator_bfit_real_gc_mark): likewise.
* libretto/operator.c (_libretto_operator_op_private_hg_forceput):
reverted a previous change.
(libretto_operator_init): likewise.
2006-05-07 Akira TAGOH <at@gclab.org>
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_alloc):
clear data to avoid incomplete header detection.
(_hg_allocator_bfit_real_resize): fixed possibly causing wrong block
chain.
* libretto/operator.c (_libretto_operator_op_floor): removed.
(_libretto_operator_op_run): removed.
(_libretto_operator_op_private_hg_forceput): added objects to the pool
reference.
(_libretto_operator_real_set_flags): use hg_debug_print_gc_state.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_add_free_block):
check if block chain is sane.
(_hg_allocator_bfit_get_free_block): fixed causing wrong block chain.
(_hg_allocator_bfit_real_gc_mark): trace the pool reference and
the registers.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_set_flags): set flags
for HG_TYPE_VALUE_POINTER as well.
(hg_debug_print_gc_state): support HgValueNode dump.
* hieroglyph/hgarray.c (hg_array_new): clear data to avoid segfaults.
it may causes staying a incomplete header in the aligned memory.
2006-05-06 Akira TAGOH <at@gclab.org>
* commit.sh: implemented a testrun mode and -m option to give the own
commit message.
also check if the required command is available.
* hieroglyph/hgmem.c (hg_pool_ref_new): new function.
(hg_pool_ref_free): new function.
(hg_pool_ref_last): new function.
(hg_pool_ref_add): new function.
(hg_pool_ref_remove): new function.
(hg_mem_add_pool_reference): new function.
(hg_mem_remove_pool_reference): new function.
* libretto/vm.c (libretto_vm_new): correct adding object to root node.
2006-05-05 Akira TAGOH <at@gclab.org>
* hieroglyph/hgdict.c (hg_dict_insert_forcibly): clean up.
* hieroglyph/hgarray.c (hg_array_replace_forcibly): clean up.
* hieroglyph/hgmem.c (hg_mem_pool_is_own_object): always return true
if current allocation mode is local.
* lib/hg_init.ps (.defaulterrorhandler): enter the local allocation
mode in advance to avoid /invalidaccess again.
* libretto/operator.c (_libretto_operator_op_astore): check
the allocation mode before an warning is output.
(_libretto_operator_op_put): likewise.
(_libretto_operator_op_private_dicttomark): likewise.
(_libretto_operator_op_def): likewise.
(_libretto_operator_op_private_hg_abort): possibly avoid /VMerror twice.
* hieroglyph/hgmem.c (hg_mem_pool_new): enable GC by default.
* libretto/vm.c (libretto_vm_init): use the best fit memory allocator
by default.
(libretto_vm_new): likewise.
* hieroglyph/hgfile.c (hg_file_init): likewise.
* hieroglyph/hgarray.c (hg_array_append_forcibly): new function.
* hieroglyph/hgdict.c (hg_dict_insert_forcibly): new function.
* hieroglyph/hgvaluenode.c (hg_debug_print_gc_state): new function.
* lib/hg_init.ps (userdict): trick to add /userdict into systemdict.
(odef): likewise for $error.
(floor): implemented.
(.seterror): don't use end here.
(.printerror): show more information.
* libretto/operator.c (_libretto_operator_op_private_hg_forceput):
new function.
(libretto_operator_init): add objects to the root node to allow
including them to the global objects.
* hieroglyph/hgmem.c (hg_mem_pool_is_own_object): check if it's in
the root node and give a privilege to the object.
* libretto/vm.c (libretto_vm_new): set a pool mode.
* hieroglyph/hgmem.c (hg_mem_pool_is_own_object): new function.
(hg_mem_pool_get_name): new function.
2006-05-04 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (hg_mem_pool_is_global_mode): new function.
(hg_mem_pool_use_global_mode): new function.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_garbage_collection):
added the debugging messages.
* libretto/operator.c (_libretto_operator_op_private_arraytomark):
go along with the steps like PS.
(_libretto_operator_op_private_hg_startgc): do GC for only local pool.
* libretto/vm.c (libretto_vm_set_error): dump the stacks
when the multiple errors happened.
2006-05-03 Akira TAGOH <at@gclab.org>
* configure.ac: configurable allocator for testing purpose.
* libretto/vm.c: likewise.
* hieroglyph/hgfile.c: likewise.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_real_garbage_collection):
return TRUE if GC is succeeded.
* hieroglyph/hgfile.c (hg_file_object_new): fixed a typo.
(hg_file_object_clear_error): new function.
* libretto/operator.c (_libretto_operator_op_private_hg_startgc):
new private operator to start GC manually.
* libretto/vm.c (libretto_vm_set_error_from_file): clear an error in
a file object after set it to vm.
2006-05-02 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (hg_mem_free): fixed causing the double-free
issue.
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_remove_block):
fixed broken deletion from the linked list.
(_hg_allocator_bfit_real_free): sanity check to get the block.
(_hg_allocator_bfit_real_resize): set NULL to vtable before free'ing.
(_hg_allocator_bfit_real_resize): exactly separate off the block.
2006-04-24 Akira TAGOH <at@gclab.org>
* hieroglyph/hgallocator-bfit.c (_hg_bfit_block_new): store a heap id.
(_hg_allocator_bfit_get_free_block): update the amount of the used
heap in pool.
(_hg_allocator_bfit_relocate): new function.
(_hg_allocator_bfit_real_free): update the amount of the used heap
in pool.
(_hg_allocator_bfit_real_resize): implemented.
2006-04-18 Akira TAGOH <at@gclab.org>
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_add_free_block):
fixed invalid memory block reference.
2006-04-17 Akira TAGOH <at@gclab.org>
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_remove_block):
remove node if there are no list for chunks.
(_hg_allocator_bfit_get_free_block): likewise.
(_hg_allocator_bfit_add_free_block): replace node with updated list
if there are already list in btree.
(_hg_allocator_bfit_real_garbage_collection): implemented.
2006-04-16 Akira TAGOH <at@gclab.org>
* hieroglyph/hgallocator-bfit.c (_hg_allocator_bfit_remove_block):
changes to use btree instead of list to manage the free block.
(_hg_allocator_bfit_add_free_block): likewise.
(_hg_allocator_bfit_get_free_block): likewise.
(_hg_allocator_bfit_btree_traverse_in_destroy): new function.
(_hg_allocator_bfit_real_destroy): destroying blocks through block chain.
(_hg_allocator_bfit_real_gc_mark): implemented.
(_hg_allocator_bfit_add_user_block): removed.
(_hg_allocator_bfit_get_used_block_list): removed.
(_hg_allocator_bfit_has_used_block_with_list): removed.
(_hg_allocator_bfit_remove_used_block): removed.
2006-04-13 Akira TAGOH <at@gclab.org>
* hieroglyph/hgallocator-bfit.[ch]: added the best fit algorithm
memory allocator.
2006-04-12 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (_hg_mem_pool_free): also use hg_heap_free.
* hieroglyph/hgallocator-ffit.c: use hg_heap_new/free.
* hieroglyph/hgmem.c (hg_heap_new): new function.
(hg_heap_free): new function.
2006-04-05 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (hg_allocator_new): new again.
(hg_allocator_destroy): likewise.
* hieroglyph/hgallocator-ffit.c (hg_allocator_ffit_get_vtable):
new function.
(hg_allocator_ffit_new): removed.
(hg_allocator_ffit_destroy): removed.
* hieroglyph/hgfile.c (hg_file_init): trivial thing to support
optional allocator.
* libretto/scanner.c: use own error function to not push self into
the estack.
* libretto/vm.c: trivial thing to support optional allocator.
2006-04-04 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (_hg_mem_init_stack_start): comment out
the incomplete code.
* hieroglyph/hgbtree.c (hg_btree_find): use proper variable type.
(hg_btree_find_near): likewise.
(hg_btree_find_near): fixed uninitialized variable warning. [Toshiya Suzuki]
2006-04-03 Akira TAGOH <at@gclab.org>
* libretto/operator.c (_libretto_operator_op_counttomark): fixed
a bulid error on older gcc. [Toshiya Suzuki]
2006-03-31 Akira TAGOH <at@gclab.org>
* libretto/operator.c (_libretto_operator_op_exp): implemented.
* hieroglyph/hgvaluenode.h (HG_VALUE_GET_REAL_FROM_INTEGER):
add a macro.
2006-03-30 Akira TAGOH <at@gclab.org>
* libretto/operator.c (_libretto_operator_op_cvlit): implemented.
(_libretto_operator_op_cvn): implemented.
(_libretto_operator_op_getinterval): check if it's readable.
* lib/hg_init.ps (.printerror): show the details of dict.
* hieroglyph/hgmem.c: split up the allocator part to another files.
* hieroglyph/hgallocator-private.h: new file.
* hieroglyph/hgallocator-ffit.[ch]: new files.
2006-03-28 Akira TAGOH <at@gclab.org>
* libretto/operator.c: makes a node with the same pool where the value
was created.
* libretto/vm.c: likewise.
* libretto/scanner.c: likewise.
* hieroglyph/hgvaluenode.h: get a memory pool from the given value for
complex objects.
2006-03-27 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (hg_mem_pool_new): initialize use_gc.
(hg_mem_pool_get_used_heap_size): new function.
(hg_mem_pool_get_free_heap_size): new function.
* libretto/operator.c (_libretto_operator_op_vmstatus): implemented.
* libretto/scanner.c (_libretto_scanner_get_object): fixed a null
exception.
* libretto/vm.c (libretto_vm_get_save_level): new function.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_to_string):
fix an allocated size at the end.
* commit.sh: don't commit if there are no changes.
* lib/hg_init.ps (.seterror): modify /estack in $error to indicate
a correct stack where an error actually happened.
* libretto/operator.c (_libretto_operator_op_getinterval): implemented.
2006-03-26 Akira TAGOH <at@gclab.org>
* hieroglyph/hgfile.c (_hg_file_object_real_to_string): makes
a difference to not confuse for string.
* lib/hg_init.ps (.seterror): save ostack, estack and dstack into $error.
(.printerror): show the stack in $error instead.
* libretto/operator.c (_libretto_operator_op_dictstack): implemented.
(_libretto_operator_op_execstack): fixed a typo.
(_libretto_operator_op_stop): invoke /.abort instead of /quit.
(_libretto_operator_op_private_hg_abort): implemented.
* libretto/lbstack.c (libretto_stack_dump): new function.
2006-03-24 Akira TAGOH <at@gclab.org>
* libretto/operator.c (_libretto_operator_op_copy): always set TRUE to
retval when the amount of copy object is 0.
2006-03-23 Akira TAGOH <at@gclab.org>
* lib/hg_init.ps (run): defined.
* libretto/operator.c (_libretto_operator_op_exit): makes /invalidexit
when file object appears on the estack.
2006-03-21 Akira TAGOH <at@gclab.org>
* hieroglyph/hglineedit.c (hg_line_edit_get_statement):
show a prompt at only first.
* lib/hg_init.ps (executive): take care of the real /undefinedfilename
from interactive shell.
load/save history.
(..statementedit): defined.
* libretto/operator.c (_libretto_operator_op_private_hg_loadhistory):
implemented.
(_libretto_operator_op_private_hg_savehistory): implemented.
(_libretto_operator_op_private_hg_statementedit): fixed a memory leak
and detect EOL.
* hieroglyph/hglineedit.c (hg_line_edit_load_history): new function.
(hg_line_edit_save_history): new function.
* lib/hg_init.ps (prompt): use .promptmsg to get a prompt string.
* hieroglyph/hglineedit.c (hg_line_edit_get_line):
support the use of own prompt.
(hg_line_edit_get_statement): don't add an empty line to the history.
* hieroglyph/hgmem.c (hg_mem_pool_use_garbage_collection):
new function.
* hieroglyph/hgstring.c (hg_string_maxlength): new function.
(hg_string_insert_c): update length.
* lib/hg_init.ps (.promptmsg): defined.
(cvs): defined.
(executive): use .statementedit to avoid the prompt deletion.
(putinterval): defined.
* libretto/operator.c (_libretto_operator_op_string): implemented.
(_libretto_operator_op_private_hg_execn): implemented.
(_libretto_operator_op_private_hg_statementedit): implemented.
* libretto/scanner.c (_libretto_scanner_get_object): don't set
an executable bit to string.
* libretto/lbstack.c (libretto_stack_roll): fixed the wrong chain.
2006-03-17 Akira TAGOH <at@gclab.org>
* libretto/vm.c (libretto_vm_reset_error): reenable stack validator.
(libretto_vm_set_error): makes a copy for an error handler.
* libretto/operator.c (_libretto_operator_op_private_hg_clearerror):
implemented.
* hieroglyph/hgfile.c (hg_file_object_has_error): set ENOENT if there
are no buffer.
* lib/hg_init.ps (executive): defined.
* hieroglyph/hglineedit.[ch]: new files.
* hieroglyph/hgfile.c (_hg_file_object_real_free): support
HG_FILE_TYPE_STATEMENT_EDIT and HG_FILE_TYPE_LINE_EDIT.
(_hg_file_object_real_set_flags): likewise.
(_hg_file_object_real_relocate): likewise.
(hg_file_object_new): likewise.
(hg_file_object_has_error): likewise.
(hg_file_object_read): likewise.
(hg_file_object_getc): likewise.
* lib/hg_init.ps (prompt): show the depth of current stack.
support an interactive mode.
* configure.ac: add a library check for libedit.
* libretto/operator.c (_libretto_operator_op_file): makes an error
when %statementedit and %lineedit is going to be opened as
write/append mode. it must be read-only.
(_libretto_operator_op_private_hg_startjobserver): don't stack a file
object onto the exec stack.
2006-03-16 Akira TAGOH <at@gclab.org>
* libretto/operator.c (_libretto_operator_op_private_stringcvs):
makes a string as is when given node is string.
* lib/hg_init_lv2.ps (currentglobal): defined.
(setglobal): defined.
* lib/hg_init.ps (odef): defined.
(.defaulterrorhandler): change an allocation mode to local.
* libretto/operator.c (_libretto_operator_op_private_stopped_continue):
don't always return true after error happened. it has to be false after
stopped invoked once and no stop nor error happens.
* libretto/vm.c (_libretto_vm_run): use libretto_vm_reset_error
instead of libretto_vm_clear_error.
(libretto_vm_reset_error): new function.
* lib/hg_init_lv2.ps (globaldict): defined.
* lib/hg_init.ps (userdict): defined.
trivial fix to get PS initialization working.
* libretto/operator.c (_libretto_operator_op_file): support
(%statementedit) and (%lineedit).
(_libretto_operator_op_private_hg_currentglobal): implemented.
(_libretto_operator_op_private_hg_setglobal): implemented.
(_libretto_operator_op_private_hg_startjobserver): set an read-only
attribute to systemdict.
(libretto_operator_init): removed /userdict and /globaldict definition.
(libretto_operator_init): don't set an read-only attribute to
systemdict here.
* libretto/vm.c (libretto_vm_new): removed initialization of userdict
and globaldict here.
(libretto_vm_get_dict_userdict): removed.
(libretto_vm_get_dict_globaldict): removed.
(libretto_vm_startjob): removed initialization of dictstack here.
(libretto_vm_startjob): set an read-only attribute to systemdict.
* configure.ac: output more build info.
* hieroglyph/hgfile.c (hg_file_object_new): set O_NONBLOCK flag to
stdin.
(hg_file_object_has_error): return true if error is only 0.
* libretto/vm.c (libretto_vm_set_error_from_file): just ignore EAGAIN
if it was from stdin.
(libretto_vm_run): try to load a file from current path too when
HIEROGLYPH_LIB_PATH isn't defined.
* lib/hg_init.ps (stack): defined.
(version): defined.
2006-03-15 Akira TAGOH <at@gclab.org>
* libretto/operator.c (libretto_operator_init): added /serverdict.
* libretto/vm.c (libretto_vm_new): added serverdict.
(libretto_vm_get_dict_serverdict): new function.
* lib/hg_init.ps (prompt): defined.
* libretto/operator.c (_libretto_operator_op_astore): implemented.
(_libretto_operator_op_ne): implemented.
(_libretto_operator_op_flush): implemented.
(_libretto_operator_op_ge): implemented.
(_libretto_operator_op_le): implemented.
(_libretto_operator_op_load): implemented.
(_libretto_operator_op_read): implemented.
* hieroglyph/hgdict.c (_hg_dict_traverse_dup): new function.
(_hg_dict_real_dup): new function.
(hg_dict_remove): replace a value with a node being.
(hg_dict_first): new function.
* libretto/operator.c (_libretto_operator_op_private_forall_array_continue):
implemented.
(_libretto_operator_op_private_forall_string_continue): implemented.
(_libretto_operator_op_and): return integer when it's called with integer.
(_libretto_operator_op_forall): implemented.
(_libretto_operator_op_or): implemented.
(_libretto_operator_op_rcheck): implemented.
(_libretto_operator_op_type): implemented.
(_libretto_operator_op_wcheck): implemented.
(_libretto_operator_op_where): implemented.
(_libretto_operator_op_xcheck): implemented.
(_libretto_operator_op_private_forall_dict_continue): implemented.
(_libretto_operator_op_private_stringcvs): check NULL.
* libretto/scanner.c (_libretto_scanner_get_object):
use __lb_operator_list instead of __lb_operator_scanner.
2006-03-13 Akira TAGOH <at@gclab.org>
* lib/hg_init_lv2.ps (product): defined.
(revision): defined.
* lib/hg_init.ps (.printversion): new procedure.
show version.
* libretto/operator.c (_libretto_operator_op_file):
use file objects in VM instead of using the external variables
directly.
(_libretto_operator_op_private_hg_hgrevision): implemented.
(_libretto_operator_op_private_hg_product): implemented.
(_libretto_operator_op_private_hg_revision): implemented.
2006-03-12 Akira TAGOH <at@gclab.org>
* hieroglyph/hgdict.c (_hg_dict_traverse_real_traverse):
new function.
(hg_dict_lookup): return a duplicate node.
(hg_dict_lookup_with_string): likewise.
(hg_dict_maxlength): new function.
(hg_dict_traverse): new function.
* libretto/operator.c (_libretto_operator_copy__traverse_dict):
new function.
(_libretto_operator_op_currentdict): implemented.
(_libretto_operator_op_maxlength): implemented.
(_libretto_operator_op_private_hg_startjobserver): implemented.
* libretto/vm.c (libretto_vm_startjob): don't set a initialized flag
here.
* hieroglyph/hgarray.c (hg_array_append): remove the real node and
reset removed_arrays before adding any node.
(hg_array_make_subarray): new function.
(hg_array_copy_as_subarray): new function.
* hieroglyph/hgdict.c (hg_dict_maxlength): new function.
* hieroglyph/hgstring.c (_hg_string_real_to_string): use current
instead of strings.
(hg_string_make_substring): new function.
(hg_string_copy_as_substring): new function.
* hieroglyph/hgfile.c (_hg_file_object_real_to_string): convert file
object like string if it's from buffer.
* lib/hg_init_lv2.ps: initialize error handlers.
* lib/hg_init.ps (.seterror): new procedure to set an error.
(.defaulterrorhandler): default handler for errors.
(handleerror): new procedure.
* libretto/operator.c (_libretto_operator_op_private_stopped_continue):
implemented.
(_libretto_operator_op_cleartomark): implemented.
(_libretto_operator_op_copy): implemented.
(_libretto_operator_op_counttomark): implemented.
(_libretto_operator_op_execstack): implemented.
(_libretto_operator_op_idiv): implemented.
(_libretto_operator_op_not): implemented.
(_libretto_operator_op_stop): implemented.
(_libretto_operator_op_stopped): implemented.
* libretto/scanner.c (_libretto_scanner_get_object): makes an object
to the read-only if it's under the initialization.
* libretto/vm.c (libretto_vm_set_error): report the multiple error.
(libretto_vm_set_error): invoke an procedure for the error.
(libretto_vm_main): parse a token from string.
2006-03-08 Akira TAGOH <at@gclab.org>
* hieroglyph/hgfile.c (hg_file_init): add objects to the root node.
* libretto/lbtypes.h: new file.
* hieroglyph/hgarray.c (_hg_array_real_copy):
detect the circular reference.
(_hg_array_real_to_string): likewise.
* hieroglyph/hgmem.h (hg_mem_set_copying): new macro.
(hg_mem_unset_copying): likewise.
(hg_mem_is_copying): likewise.
* hieroglyph/hgstring.c (_hg_string_real_to_string): check NULL.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_to_string):
free an unnecessary object.
* libretto/operator.c (_libretto_operator_op_private_write_eqeq_only):
check NULL.
(libretto_operator_init): add /statusdict into systemdict.
* libretto/lbstack.c (_libretto_stack_use_stack_validator):
new function.
(libretto_stack_push): don't validate the stack if use_validator is
false.
* libretto/vm.c (libretto_vm_set_error): stop to use the stack
validator when the error happened.
(libretto_vm_main): check NULL.
(libretto_vm_get_current_pool): return a special memory pool if it's
in error handler.
(libretto_vm_startjob): enable a executable bit for name object.
(libretto_vm_main): now depends on the external PS file for
the error handler.
2006-03-07 Akira TAGOH <at@gclab.org>
* libretto/operator.c (_libretto_operator_op_private_dicttomark):
implemented.
(_libretto_operator_op_countdictstack): implemented.
(_libretto_operator_op_countexecstack): implemented.
(_libretto_operator_op_cvx): implemented.
(_libretto_operator_op_known): implemented.
(_libretto_operator_load_file): removed.
(libretto_operator_load_file): removed.
(libretto_operator_init): set an readonly attribute to systemdict.
* libretto/scanner.c (_libretto_scanner_get_object): implemented
a parser for dict.
* libretto/lbstack.c (_libretto_stack_push): new function.
* libretto/vm.c (_libretto_vm_run): new function.
(libretto_vm_startjob): allow to initialize VM with
the specific PS file.
(libretto_vm_clear_error): new function.
(_libretto_vm_set_error): new function.
(_libretto_vm_set_error_from_file): new function.
(libretto_vm_run): new function.
2006-03-05 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmatrix.c (hg_matrix_scale): new function.
* libretto/operator.c (_libretto_operator_op_concatmatrix):
implemented.
(_libretto_operator_op_matrix): implemented.
(_libretto_operator_op_scale): implemented.
* libretto/lbgraphics.c (libretto_graphics_matrix_scale): new function.
2006-03-03 Akira TAGOH <at@gclab.org>
* hieroglyph/hgpath.c (hg_path_compute_current_point): check if
currentpoint is there for lineto.
(hg_path_get_bbox): likewise.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_dup): don't make a new object.
* libretto/operator.c (_libretto_operator_op_private_for_pos_int_continue):
take care of the minus value of the increment.
(_libretto_operator_op_private_for_pos_real_continue): implemented.
(_libretto_operator_op_lineto): check /nocurrentpoint.
(_libretto_operator_op_rlineto): likewise.
* lib/Makefile.am (EXTRA_DIST): added $(hgpslib_DATA)
* hieroglyph/hgarray.c (_hg_array_real_to_string): check access mode.
(hg_array_append): likewise.
(hg_array_replace): likewise.
(hg_array_remove): likewise.
(hg_array_index): likewise.
(hg_array_fix_array_size): likewise.
(hg_array_new): set a default access mode.
* hieroglyph/hgdict.c (hg_dict_node_new): set a default access mode.
(hg_dict_new): likewise.
(hg_dict_insert): check access mode.
(hg_dict_remove): likewise.
(hg_dict_lookup): likewise.
(hg_dict_lookup_with_string): likewise.
(hg_dict_length): likewise.
* hieroglyph/hgmem.c (_hg_allocator_ffit_real_save_snapshot):
set a default access mode.
(hg_mem_pool_get_default_access_mode): new function.
(hg_mem_pool_set_default_access_mode): new function.
* hieroglyph/hgstring.c (_hg_string_real_to_string): check access mode.
(hg_string_length): likewise.
(hg_string_clear): likewise.
(hg_string_append_c): likewise.
(hg_string_append): likewise.
(hg_string_insert_c): likewise.
(hg_string_concat): likewise.
(hg_string_index): likewise.
(hg_string_get_string): likewise.
(hg_string_compare): likewise.
(hg_string_compare_with_raw): likewise.
(hg_string_new): set a default access mode.
(hg_string_fix_string_size): new function.
* hieroglyph/hgpath.c (hg_path_node_new): set a default access mode.
(hg_path_new): likewise.
(hg_path_compute_current_point): fixed a typo.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_to_string):
check access mode.
(hg_value_node_new): set a default access mode.
* hieroglyph/hgrender.c (hg_render_eofill_new): set a default
access mode.
(hg_render_fill_new): likewise.
(hg_render_stroke_new): likewise.
(hg_render_debug_new): likewise.
* hieroglyph/hgfile.c (hg_file_object_new): set a default access mode.
(hg_file_object_read): check access mode.
(hg_file_object_write): likewise.
(hg_file_object_getc): likewise.
(hg_file_object_ungetc): likewise.
(hg_file_object_vprintf): likewise.
* libretto/operator.c (_libretto_operator_op_private_stringcvs):
fixed a behavior to match the exact one.
(_libretto_operator_op_aload): check the access attribute.
(_libretto_operator_op_begin): likewise.
(_libretto_operator_op_bind): likewise.
(_libretto_operator_op_concat): likewise.
(_libretto_operator_op_currentmatrix): likewise.
(_libretto_operator_op_cvi): likewise.
(_libretto_operator_op_def): likewise.
(_libretto_operator_op_eq): likewise.
(_libretto_operator_op_exec): likewise.
(_libretto_operator_op_file): likewise.
(_libretto_operator_op_for): likewise.
(_libretto_operator_op_get): likewise.
(_libretto_operator_op_gt): likewise.
(_libretto_operator_op_if): likewise.
(_libretto_operator_op_ifelse): likewise.
(_libretto_operator_op_length): likewise.
(_libretto_operator_op_loop): likewise.
(_libretto_operator_op_lt): likewise.
(_libretto_operator_op_print): likewise.
(_libretto_operator_op_put): likewise.
(_libretto_operator_op_repeat): likewise.
(_libretto_operator_op_rotate): likewise.
(_libretto_operator_op_setmatrix): likewise.
(_libretto_operator_op_translate): likewise.
(_libretto_operator_op_writestring): likewise.
(_libretto_operator_op_noaccess): implemented.
(libretto_operator_load_file): fixed a typo.
(libretto_operator_new): set a default access mode.
(libretto_operator_init): set systemdict in dict.
* libretto/lbgraphics.c (libretto_graphic_state_new): set a default
access mode.
(libretto_graphics_new): likewise.
* libretto/vm.c (libretto_vm_new): likewise.
2006-03-02 Akira TAGOH <at@gclab.org>
* lib/hg_init.ps: new file.
* lib/hg_init_lv2.ps: new file.
* lib/hg_init_lv3.ps: new file.
* libretto/operator.c (_libretto_operator_load_file): new function.
(libretto_operator_load_file): new function.
(libretto_operator_init): initialize from PS file.
* libretto/vm.c (libretto_vm_main): don't break current node in
the estack. it causes segfault when scanner fails to get an object.
(libretto_vm_startjob): check an return value of libretto_operator_init
and if it fails, quit here immediately.
* hieroglyph/hgarray.c (hg_array_fix_array_size): new function.
* hieroglyph/hgpath.c (hg_path_compute_current_point): new function.
* libretto/operator.c (_libretto_operator_op_concat):
implemented.
(_libretto_operator_op_currentpoint): implemented.
(_libretto_operator_op_curveto): check /nocurrentpoint error.
(_libretto_operator_op_initclip): implemented.
(_libretto_operator_op_length): implemented.
(_libretto_operator_op_lt): implemented.
(_libretto_operator_op_setmatrix): set a path to update current matrix.
* libretto/scanner.c (_libretto_scanner_get_object): check NULL.
(_libretto_scanner_get_object): resize Array to fix the array size.
* libretto/vm.c (libretto_vm_main): use another pool instead of
local/global pool to avoid the allocation error when /VMerror happened.
* libretto/lbgraphics.c (libretto_graphics_initclip): new function.
2006-03-01 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (hg_mem_remove_root_node): fixed not to store a result.
* configure.ac: add --with{,out}-x11 option.
* devices/cairo/cairo-xlib-main.c (device_close): implemented.
* libretto/lbgraphics.c (_libretto_graphics_real_free):
destroy the pages.
* hieroglyph/hgarray.c (hg_array_new): fixed the uninitialized value.
* hieroglyph/hgmem.c (_hg_allocator_ffit_real_initialize):
support the multiple heaps.
(_hg_allocator_ffit_real_alloc): likewise.
(_hg_allocator_ffit_real_free): likewise.
(_hg_allocator_ffit_real_resize): likewise.
(_hg_allocator_ffit_real_resize_pool): likewise.
(_hg_allocator_ffit_compare): likewise.
(_hg_allocator_ffit_real_garbage_collection): likewise.
(_hg_allocator_ffit_snapshot_real_free): likewise.
(_hg_allocator_ffit_snapshot_real_relocate): likewise.
(_hg_allocator_ffit_real_save_snapshot): likewise.
(_hg_allocator_ffit_real_restore_snapshot): likewise.
(_hg_mem_pool_free): likewise.
* libretto/operator.c (_libretto_operator_op_atan): implemented.
(_libretto_operator_op_cos): implemented.
(_libretto_operator_op_setmatrix): trivial fix.
(_libretto_operator_op_sin): implemented.
2006-02-28 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmatrix.[ch]: new files.
* hieroglyph/hgpath.c (_hg_path_node_real_path_last): new function.
(_hg_path_node_find): new function.
(hg_path_find): new function.
(hg_path_close): don't make a duplicate node for closepath.
(hg_path_matrix): new function.
* hieroglyph/hgdebug.[ch]: new files.
* hieroglyph/hgrender.c (_hg_render_debug_real_set_flags):
new function.
(_hg_render_debug_real_relocate): new function.
(hg_render_eofill_new): keep CTM in the structure.
(hg_render_fill_new): likewise.
(hg_render_stroke_new): likewise.
(hg_render_debug_new): new function.
* libretto/operator.c (_libretto_operator_op_array):
allocate a node for each object.
(_libretto_operator_op_currentmatrix): implemented.
(_libretto_operator_op_initgraphics): implemented.
(_libretto_operator_op_rotate): trivial fix.
(_libretto_operator_op_setmatrix): implemented.
(_libretto_operator_op_translate): trivial fix.
(_libretto_operator_op_private_hg_sleep): new function.
(libretto_operator_hieroglyph_init): new function.
* libretto/lbgraphics.c (libretto_graphics_init): new function.
(libretto_graphics_show_page): support the multiple pages.
(libretto_graphics_matrix_rotate): transform the matrix to fit into
cairo's device space.
(libretto_graphics_matrix_translate): likewise.
(libretto_graphic_state_path_new): update a snapshot matrix.
(libretto_graphics_render_eofill): likewise.
(libretto_graphics_render_fill): likewise.
(libretto_graphics_render_stroke): likewise.
(libretto_graphics_debug): new function.
* devices/cairo/hgdevice-cairo.c (_hg_cairo_device_print_path):
new function for debugging.
(_hg_cairo_device_real_initialize): keep the page size.
(_hg_cairo_device_real_initialize): use cairo_set_matrix instead of
cairo_transform to manage CTM in hieroglyph.
(_hg_cairo_device_real_finalize): call cairo_show_page here.
(_hg_cairo_device_real_eofill): update CTM before doing anything.
(_hg_cairo_device_real_fill): likewise.
(_hg_cairo_device_real_stroke): likewise.
(_hg_cairo_device_set_matrix): new function.
(_hg_cairo_device_set_path): initialize path.
(_hg_cairo_device_set_path): add HG_PATH_MATRIX support.
2006-02-26 Akira TAGOH <at@gclab.org>
* libretto/operator.c (libretto_operator_define_macro): check NULL.
(_libretto_operator_op_and): implemented.
(_libretto_operator_op_exit): implemented.
(_libretto_operator_op_if): implemented.
(_libretto_operator_op_sqrt): implemented.
(BUILD_OP): check NULL.
(libretto_operator_new): allocate one more byte memory.
* libretto/lbgraphics.h (libretto_graphics_get_state): new macro.
* libretto/vm.c (libretto_vm_main): revert a change to duplicate
an object that isn't executable. it caused not updating an object
in the dictionary say.
(libretto_vm_main): shows the context of the objects in the stack.
* libretto/lbgraphics.c (_libretto_graphic_state_real_set_flags):
new function.
(_libretto_graphic_state_real_relocate): new function.
(_libretto_graphic_state_real_copy): new function.
(libretto_graphic_state_new): new function.
(libretto_graphics_save): implemented.
(libretto_graphics_restore): implemented.
2006-02-25 Akira TAGOH <at@gclab.org>
* hieroglyph/hgpath.c (hg_path_get_bbox): add HG_PATH_ARC.
(hg_path_arc): new function.
* libretto/operator.c (_libretto_operator_op_arc): implemented.
* libretto/lbgraphics.c (libretto_graphics_path_arc): new function.
* devices/cairo/hgdevice-cairo.c (_hg_cairo_device_real_stroke):
implemented the color conversion for HSV.
(_hg_cairo_device_set_path): implemented for HG_PATH_ARC.
2006-02-21 Akira TAGOH <at@gclab.org>
* hieroglyph/hgpage.c (hg_page_get_size): convert mm size to unit
size.
* hieroglyph/hgdevice.c (hg_device_draw): added HG_RENDER_EOFILL.
(hg_device_draw): call finalizer.
* hieroglyph/hgpath.c (_hg_path_node_real_copy): new function.
(_hg_path_real_copy): new function.
(hg_path_copy): new function.
(hg_path_get_bbox): new function.
(hg_path_rlineto): new function.
(hg_path_curveto): new function.
* hieroglyph/hgrender.c (hg_render_eofill_new): new function.
* libretto/operator.c (_libretto_operator_op_private_loop_continue):
implemented.
(_libretto_operator_op_private_repeat_continue): implemented.
(_libretto_operator_op_abs): implemented.
(_libretto_operator_op_aload): implemented.
(_libretto_operator_op_clippath): implemented.
(_libretto_operator_op_closepath): set VMerror
if libretto_graphics_path_close failed.
(_libretto_operator_op_curveto): implemented.
(_libretto_operator_op_cvi): implemented.
(_libretto_operator_op_div): implemented.
(_libretto_operator_op_eofill): implemented.
(_libretto_operator_op_fill): set VMerror
if libretto_graphics_render_fill failed.
(_libretto_operator_op_grestore): set VMerror
if libretto_graphics_state_restore failed.
(_libretto_operator_op_gsave): set VMerror
if libretto_graphics_state_save failed.
(_libretto_operator_op_gt): implemented.
(_libretto_operator_op_lineto): set VMerror
if libretto_graphics_path_lineto failed.
(_libretto_operator_op_loop): implemented.
(_libretto_operator_op_mod): implemented.
(_libretto_operator_op_moveto): set VMerror
if libretto_graphics_path_moveto failed.
(_libretto_operator_op_mul): make an real object when it's bigger than
G_MAXINT.
(_libretto_operator_op_neg): implemented.
(_libretto_operator_op_newpath): set VMerror
if libretto_graphics_path_new failed.
(_libretto_operator_op_pathbbox): implemented.
(_libretto_operator_op_pop): implemented.
(_libretto_operator_op_rand): implemented.
(_libretto_operator_op_repeat): implemented.
(_libretto_operator_op_rlineto): implemented.
(_libretto_operator_op_rotate): set VMerror
if libretto_graphics_matrix_rotate failed.
(_libretto_operator_op_sethsbcolor): implemented.
(_libretto_operator_op_srand): implemented.
(_libretto_operator_op_stroke): set VMerror
if libretto_graphics_render_stroke failed.
(_libretto_operator_op_translate): set VMerror
if libretto_graphics_matrix_translate failed.
(_libretto_operator_op_truncate): implemented.
(_libretto_operator_op_usertime): implemented.
(libretto_operator_init): make a mark object.
* libretto/vm.c (libretto_vm_new): initialize an random number
generator.
(libretto_vm_get_current_time): new function.
(libretto_vm_get_random_generator): new function.
(libretto_vm_main): drop an object if an empty array was pushed into
exec stack.
* libretto/lbgraphics.c (libretto_graphics_new): create an instance
of clip_path.
(libretto_graphics_set_page_size): new function.
(libretto_graphics_set_graphic_size): new function.
(libretto_graphics_path_from_clip): new function.
(libretto_graphics_get_bbox_from_path): new function.
(libretto_graphics_path_rlineto): new function.
(libretto_graphics_path_curveto): new function.
(libretto_graphics_color_set_hsv): new function.
(libretto_graphics_render_eofill): new function.
* devices/cairo/cairo-xlib-main.c (_cairo_xlib_real_set_page_size):
removed an ad hoc code.
* devices/cairo/hgdevice-cairo.c (hsv_to_rgb): new function.
(_hg_cairo_device_real_initialize): removed an ad hoc code.
(_hg_cairo_device_real_eofill): new function.
(_hg_cairo_device_real_fill): implemented for hsv color.
(_hg_cairo_device_set_path): added HG_PATH_RLINETO.
2006-02-17 Akira TAGOH <at@gclab.org>
* hieroglyph/hgdevice.c (hg_device_draw): add HG_RENDER_ROTATE
and HG_RENDER_TRANSLATE.
* hieroglyph/hgrender.c (hg_render_rotate_new): new function.
(hg_render_translate_new): new function.
* libretto/operator.c (_libretto_operator_op_private_arraytomark):
implemented.
(_libretto_operator_op_array): implemented.
(_libretto_operator_op_eq): implemented.
(_libretto_operator_op_get): implemented.
(_libretto_opreator_op_grestore): implemented.
(_libretto_operator_op_gsave): implemented.
(_libretto_operator_op_ifelse): implemented.
(_libretto_operator_op_mul): implemented.
(_libretto_operator_op_newpath): implemented.
(_libretto_operator_op_put): implemented.
(_libretto_operator_op_rotate): implemented.
(_libretto_operator_op_translate): implemented.
* libretto/vm.c (libretto_vm_main): copy an object even if it's not
an executable object.
* libretto/lbgraphics.c (libretto_graphics_matrix_rotate):
new function.
(libretto_graphics_matrix_translate): new function.
* devices/cairo/hgdevice-cairo.c (_hg_cairo_device_real_rotate):
new function.
(_hg_cairo_device_real_translate): new function.
* hieroglyph/hgarray.c (_hg_array_real_to_string):
return NULL if failed.
* hieroglyph/hgmem.c (_hg_allocator_ffit_real_restore_snapshot):
collect the unnecessary objects first because it prevents to success
restoring snapshot.
(hg_mem_pool_use_periodical_gc): new function.
(hg_mem_alloc_with_flags): if it's under the periodical GC mode and
the memory usage is over the threshold, try GC before allocating
a memory.
(hg_mem_free): this is now going to free an object immediately.
be careful to use this.
* hieroglyph/hgstring.c (hg_string_append): return FALSE if failed.
(hg_string_concat): likewise.
* hieroglyph/hgvaluenode.h (HG_VALUE_SET_SNAPSHOT): new macro.
(HG_VALUE_MAKE_NAME_STATIC): terminate with NULL.
(HG_VALUE_MAKE_SNAPSHOT): new macro.
(HG_VALUE_GET_SNAPSHOT): new macro.
(HG_IS_VALUE_SNAPSHOT): likewise.
* hieroglyph/hgdict.c (_hg_dict_node_free): don't call hg_mem_free
here.
(hg_dict_insert): likewise.
(hg_dict_remove): likewise.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_set_flags):
support a snapshot object.
(_hg_value_node_real_relocate): likewise.
(_hg_value_node_real_dup): likewise.
(_hg_value_node_real_copy): likewise.
(_hg_value_node_real_to_string): likewise.
(_hg_value_node_real_to_string): check NULL.
(hg_value_node_get_hash): support all object types.
(hg_value_node_compare): likewise.
* libretto/operator.c (_libretto_operator_op_restore):
implemented.
(_libretto_operator_op_save): implemented.
* libretto/scanner.c (_libretto_scanner_get_object):
destroy an unnecessary object immediately.
* libretto/lbgraphics.c (_libretto_graphics_real_free):
destroy the pages.
(libretto_graphics_new): take care of the multiple pages.
* examples/cairo-xlib.c: new file.
* hieroglyph/hgarray.c (hg_array_new): allow an empty array.
* hieroglyph/hgdevice.c (hg_device_draw): support HG_RENDER_STROKE.
* hieroglyph/hgrender.c (_hg_render_stroke_real_set_flags):
new function.
(_hg_render_stroke_real_relocate): new function.
(hg_render_fill_new): fixed a typo.
(hg_render_stroke_new): new function.
* libretto/lbgraphics.c (libretto_graphics_new): check if an error
happened.
(libretto_graphics_render_stroke): implemented.
* devices/cairo/cairo-xlib-main.c: reimplemented.
* devices/cairo/hgdevice-cairo.[ch]: reimplemented.
* hieroglyph/hgmem.c (_hg_allocator_ffit_traverse_for_gc):
don't collect an object if it's locked.
* hieroglyph/hgpage.c (hg_page_append_node): new function.
* hieroglyph/hgdevice.[ch]: new files.
* hieroglyph/hgpath.[ch]: new files.
* hieroglyph/hgmem.h (hg_mem_set_lock): new macro.
(hg_mem_set_unlock): likewise.
(hg_mem_is_locked): likewise.
* hieroglyph/hgrender.[ch]: new files.
* libretto/vm.c (libretto_vm_new): make a memory pool for graphics.
* libretto/lbgraphics.[ch]: new files, which was moved from hggraphics.[ch].
2006-02-16 Akira TAGOH <at@gclab.org>
* hieroglyph/hgarray.c (_hg_array_real_set_flags): refers current.
(_hg_array_real_relocate): relocate a current array pointer.
(_hg_array_real_dup): duplicate an array from current array pointer.
(_hg_array_real_copy): likewise.
(_hg_array_real_to_string): refers current array pointer.
(hg_array_append): if there are any removed array, then failed.
(hg_array_remove): if index is 0, just increase a pointer to speed up.
* hieroglyph/hggraphics.[ch]: new files.
* libretto/operator.c (_libretto_operator_op_clear): implemented.
(_libretto_operator_op_cleardictstack): implemented.
(_libretto_operator_op_closepath): implemented.
(_libretto_operator_op_dup): implemented.
(_libretto_operator_op_end): implemented.
(_libretto_operator_op_fill): implemented.
(_libretto_operator_op_lineto): implemented.
(_libretto_operator_op_moveto): implemented.
(_libretto_operator_op_roll): implemented.
(_libretto_operator_op_setgray): implemented.
(_libretto_operator_op_setlinewidth): implemented.
(_libretto_operator_op_setrgbcolor): implemented.
(_libretto_operator_op_showpage): implemented.
(_libretto_operator_op_stroke): implemented.
* libretto/lbstack.c (libretto_stack_roll): new function.
* libretto/vm.c (libretto_vm_get_graphics): new function.
2006-02-15 Akira TAGOH <at@gclab.org>
* libretto/scanner.c (_libretto_scanner_get_object): escape from
the loop after an array is terminated.
* hieroglyph/hgpage.[ch]: new files.
* Makefile.am: modified to install .pc files.
* configure.ac: modified to generate .pc files.
* tests/hgpage.c: new testcase.
* hieroglyph.pc.in: new file.
* hg-libretto.pc.in: new file.
2006-02-14 Akira TAGOH <at@gclab.org>
* hieroglyph/hgstring.c (_hg_string_real_to_string): convert
the unvisible characters to the visible characters.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_to_string):
quote a string with ().
* libretto/operator.c (_libretto_operator_op_private_stringcvs):
implemented.
(_libretto_operator_op_writestring): implemented.
* libretto/scanner.c (_libretto_scanner_get_object): convert \\ stuff.
* hieroglyph/hgarray.c (_hg_array_real_copy): new function.
* hieroglyph/hgmem.c (hg_object_dup): check HgObject ID.
(hg_object_copy): new function.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_copy): new function.
* libretto/operator.c (_libretto_operator_op_private_for_pos_int_continue):
copy a node to avoid an array object breakage.
(_libretto_operator_op_exec): likewise.
* libretto/vm.c (libretto_vm_main): copy a node to avoid an object
breakage in dict.
* hieroglyph/hgarray.c (_hg_array_real_dup): new function.
(_hg_array_real_to_string): new function.
* hieroglyph/hgmem.c (_hg_allocator_ffit_real_resize):
set the stack end again. it may breaks after the memory allocation.
(_hg_allocator_ffit_snapshot_real_to_string): new function.
(hg_object_dup): new function.
* hieroglyph/hgstring.c (_hg_string_real_to_string): new function.
(hg_string_concat): new function.
(hg_object_to_string): new function.
* hieroglyph/hgmacros.h (HG_SET_STACK_END_AGAIN): new macro.
* hieroglyph/hgdict.c (_hg_dict_real_to_string): new function.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_set_flags): check NULL.
(_hg_value_node_real_dup): new function.
(_hg_value_node_real_to_string): new function.
* hieroglyph/hgfile.c (_hg_file_object_real_to_string): new function.
(hg_file_object_new): fixed a typo.
* libretto/operator.c (_libretto_operator_op_private_for_pos_int_continue):
reimplemented.
(_libretto_operator_op_private_write_eqeq_only): reimplemented.
(_libretto_operator_op_begin): reimplemented.
(_libretto_operator_op_count): reimplemented.
(_libretto_operator_op_def): reimplemented.
(_libretto_operator_op_dict): reimplemented.
(_libretto_operator_op_exch): reimplemented.
(_libretto_operator_op_exec): reimplemented.
(_libretto_operator_get_file_type): new function.
(_libretto_operator_get_file_mode): new function.
(_libretto_operator_op_file): reimplemented.
(_libretto_operator_op_for): reimplemented.
(_libretto_operator_op_index): reimplemented.
(_libretto_operator_op_print): reimplemented.
(_libretto_operator_op_sub): reimplemented.
(_libretto_operator_real_to_string): new function.
(BUILD_OP): set an executable bit.
* libretto/lbstack.c (_libretto_stack_real_dup): new function.
* libretto/vm.c (libretto_vm_get_io): new function.
(libretto_vm_set_io): likewise.
(libretto_vm_main): implemented the handler of proc.
2006-02-12 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (_hg_allocator_ffit_real_free): trivial fix.
(_hg_allocator_ffit_real_resize): likewise.
(_hg_allocator_ffit_real_resize_pool): likewise.
(_hg_allocator_ffit_snapshot_real_set_flags): mark a snapshot itself.
(_hg_allocator_ffit_snapshot_real_relocate): resize a private object.
* hieroglyph/hgstring.c (hg_string_append_c): return FALSE if resize
failed.
(hg_string_get_string): terminate with 0 here.
* hieroglyph/hgbtree.c (hg_btree_page_insert): avoid an unnecessary
loop.
(hg_btree_page_remove): likewise.
(hg_btree_find): likewise.
(hg_btree_find_near): new function.
* hieroglyph/hgfile.c (_hg_file_object_real_set_flags):
check if is.buf.buffer is NULL.
(_hg_file_object_real_relocate): likewise.
* libretto/scanner.c (_libretto_scanner_get_object): initialize
with NULL.
2006-02-08 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (_hg_allocator_ffit_real_resize): don't resize
if the unnecessary memory is less than sizeof (HgMemObject).
2006-02-07 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (_hg_allocator_ffit_real_save_snapshot):
allocate a memory from system for snapshot of heap.
* libretto/vm.[ch]: reimplemented.
* libretto/operator.[ch]: reimplemented.
* libretto/scanner.[ch]: reimplemented.
2006-02-06 Akira TAGOH <at@gclab.org>
* hieroglyph/hgarray.c (_hg_array_real_set_flags): use inline.
* hieroglyph/hgmem.c (_hg_allocator_ffit_snapshot_real_set_flags):
use inline.
(hg_mem_set_flags): removed.
(hg_mem_get_flags): removed.
(hg_mem_add_flags): removed.
(hg_mem_is_flags): removed.
(hg_mem_get_object): removed.
* hieroglyph/hgstring.c (_hg_string_real_set_flags): use inline.
* hieroglyph/hgdict.c (_hg_dict_traverse_set_flags): use inline.
(_hg_dict_node_real_set_flags): use inline.
* hieroglyph/hgmem.h (hg_mem_get_object__inline_nocheck): new macro.
(hg_mem_get_object__inline): new macro.
(hg_mem_is_flags__inline): new macro.
(hg_mem_get_flags__inline): new macro.
(hg_mem_set_flags__inline): new macro.
(hg_mem_add_flags__inline): new macro.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_set_flags): use inline.
* hieroglyph/hgfile.c (_hg_file_object_real_set_flags): use inline.
* libretto/lbstack.c (_libretto_stack_real_set_flags): use inline.
* hieroglyph/hgarray.c (_hg_array_real_free): removed.
* hieroglyph/hgmem.c (hg_mem_get_object__inline): new macro.
(_hg_allocator_ffit_traverse_for_destroy): new function.
(_hg_allocator_ffit_real_destroy): use hg_btree_foreach instead of
iter.
(_hg_allocator_ffit_traverse_for_relocation): new function.
(_hg_allocator_ffit_relocate): relocate the variables which is located
on the object that isn't allocated with the targetted pool.
(_hg_allocator_ffit_relocate): use hg_btree_foreach instead of iter.
(_hg_allocator_ffit_traverse_for_gc): new function.
(_hg_allocator_ffit_traverse_for_gc_destroyed): new function.
(_hg_allocator_ffit_real_garbage_collection): use hg_btree_foreach
instead of iter.
* hieroglyph/hgstring.c (_hg_string_real_free): removed.
* hieroglyph/hgbtree.c (hg_btree_page_remove): fixed a typo.
* hieroglyph/hgdict.c (_hg_dict_node_real_free): removed.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_free): removed.
2006-02-05 Akira TAGOH <at@gclab.org>
* examples/pse.c: reimplemented.
* hieroglyph/hgmem.c (_hg_allocator_ffit_real_garbage_collection):
join much more free spaces.
(hg_mem_add_root_node): save the root node list.
* hieroglyph/hgvaluenode.h (HG_VALUE_REAL_SIMILAR): new macro.
* hieroglyph/hgfile.c (hg_stdout_printf): fixed a typo.
(hg_stderr_printf): fixed a typo.
2006-02-04 Akira TAGOH <at@gclab.org>
* hieroglyph/hgarray.c (hg_array_new): support the variable sized
array.
(hg_array_append): resize an array when allocated array is full.
* hieroglyph/hgmem.c (_hg_allocator_ffit_real_resize_pool):
allocate much more memory if block_size is bigger than the initial
allocated size.
(_hg_allocator_ffit_real_garbage_collection): copy the object to
new tree to avoid non-marking accidentally.
* hieroglyph/hgvaluenode.h (HG_VALUE_SET_FILE): new macro.
(HG_VALUE_MAKE_FILE): likewise.
(HG_VALUE_GET_FILE): likewise.
(HG_IS_VALUE_FILE): likewise.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_free): add file object
support.
(_hg_value_node_real_set_flags): likewise.
(_hg_value_node_real_relocate): likewise.
(hg_value_node_get_hash): likewise.
(hg_value_node_compare): likewise.
* hieroglyph/hgfile.c (hg_file_object_has_error): renamed.
* libretto/lbstack.c (libretto_stack_pop): fixed a crash when
the stack has just one item after pop.
2006-02-02 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (_hg_allocator_ffit_relocate): new function.
(_hg_allocator_ffit_real_resize): new function.
(hg_mem_resize): new function.
* hieroglyph/hgstring.c (hg_string_new): support a variable sized
string.
(hg_string_append_c): resize a string when the allocated size is full.
(hg_string_append): likewise.
2006-02-01 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (hg_object_get_state): new function.
(hg_object_set_state): likewise.
(hg_object_add_state): likewise.
(hg_object_is_state): likewise.
* hieroglyph/hgbtree.c (hg_btree_page_blance): check null.
(hg_btree_page_blance): fixed a typo that causes a memory corruption.
* hieroglyph/hgmem.h (hg_object_readable): new macro.
(hg_object_unreadable): new macro.
(hg_object_is_readable): new macro.
(hg_object_writable): new macro.
(hg_object_is_writable): new macro.
(hg_object_unwritable): new macro.
(hg_object_executable): new macro.
(hg_object_unexecutable): new macro.
(hg_object_is_executable): new macro.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_free): added null and
mark object support.
(_hg_value_node_real_set_flags): likewise.
(_hg_value_node_real_relocate): likewise.
* hieroglyph/hgarray.c (_hg_array_real_relocate):
use HgMemRelocateInfo.
* hieroglyph/hgmem.c (_hg_allocator_ffit_real_resize_pool):
use HgMemRelocateInfo.
(_hg_allocator_ffit_snapshot_real_relocate): likewise.
* hieroglyph/hgstring.c (_hg_string_real_relocate):
use HgMemRelocateInfo.
* hieroglyph/hgdict.c (_hg_dict_traverse_relocate):
use HgMemRelocateInfo.
(_hg_dict_real_relocate): likewise.
(_hg_dict_node_real_relocate): likewise.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_relocate):
use HgMemRelocateInfo.
* hieroglyph/hgfile.c (_hg_file_object_real_relocate):
use HgMemRelocateInfo.
(hg_file_object_new): get a buffer size as gint32 instead of gsize.
* libretto/lbstack.c (_libretto_stack_real_relocate):
use HgMemRelocateInfo.
2006-01-31 Akira TAGOH <at@gclab.org>
* hieroglyph/hgvaluenode.h (HG_VALUE_SET_MARK): new macro.
(HG_VALUE_MAKE_MARK): new macro.
(HG_VALUE_GET_MARK): new macro.
(HG_IS_VALUE_MARK): new macro.
* hieroglyph/hgdict.c (_hg_dict_node_compare_with_string):
new function.
(hg_dict_lookup_with_string): new function.
* hieroglyph/hgfile.c (hg_file_object_new): resize the buffer size
if the given is less than zero.
* libretto/lbstack.c (libretto_stack_index): fixed a typo.
* hieroglyph/hgvaluenode.h (HG_VALUE_SET_NULL): new macro.
(HG_VALUE_SET_POINTER): likewise.
(HG_VALUE_MAKE_NULL): likewise.
(HG_VALUE_MAKE_POINTER): likewise.
(HG_VALUE_GET_NULL): likewise.
(HG_VALUE_GET_POINTER): likewise.
(HG_IS_VALUE_NULL): likewise.
(HG_IS_VALUE_POINTER): likewise.
* hieroglyph/hgfile.c (hg_file_object_ungetc): new function.
2006-01-29 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (hg_mem_pool_allow_resize): new function.
* hieroglyph/hgarray.c (_hg_array_real_set_flags): use hg_mem_add_flags
instead of hg_mem_use_flags.
* hieroglyph/hgmem.c (_hg_allocator_ffit_snapshot_real_free):
new function.
(_hg_allocator_ffit_snapshot_real_set_flags): likewise.
(_hg_allocator_ffit_snapshot_real_relocate): likewise.
(_hg_allocator_ffit_snapshot_traverse_save): likewise.
(_hg_allocator_ffit_snapshot_traverse_complex_object): likewise.
(_hg_allocator_ffit_real_restore_snapshot): implemented.
(hg_mem_garbage_collection): new function.
(hg_mem_alloc_with_flags): likewise.
(hg_mem_add_flags): likewise.
* hieroglyph/hgstring.c (_hg_string_real_set_flags): new function.
(_hg_string_real_relocate): new function.
* hieroglyph/hgvaluenode.h (HG_VALUE_MAKE_NAME_STATIC): new macro.
(HG_VALUE_SET_NAME_STATIC): new macro.
* hieroglyph/hgdict.c (_hg_dict_traverse_set_flags): fixed to not set
flags properly.
(_hg_dict_traverse_relocate): new function.
(_hg_dict_real_relocate): new function.
(_hg_dict_node_real_set_flags): use hg_mem_add_flags instead of
hg_mem_set_flags.
* hieroglyph/hgfile.c (_hg_file_object_real_set_flags): use
hg_mem_add_flags instead of hg_mem_set_flags.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_set_flags): likewise.
2006-01-25 Akira TAGOH <at@gclab.org>
* hieroglyph/hgbtree.c (_hg_btree_count_traverse): new function.
(hg_btree_length): likewise.
* hieroglyph/hgmem.h (hg_mem_complex_mark): new macro.
(hg_mem_complex_unmark): likewise.
(hg_mem_is_complex_mark): likewise.
* libretto/lbstack.c (libretto_stack_new): check if allocation was
failed.
* hieroglyph/hgstring.c (hg_string_new): likewise.
* hieroglyph/hgdict.c (hg_dict_new): likewise.
* hieroglyph/hgvaluenode.c (hg_value_node_new): likewise.
* hieroglyph/hgfile.c (hg_file_object_new): likewise.
* hieroglyph/hgmem.c (hg_mem_pool_save_snapshot): new function.
(hg_mem_pool_restore_snapshot): new function.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_free): add Array
support.
(_hg_value_node_real_set_flags): likewise.
(_hg_value_node_real_relocate): likewise.
(hg_value_node_get_hash): likewise.
(hg_value_node_compare): likewise.
* hieroglyph/hgvaluenode.h (hg_value_node_restorable): new macro.
(hg_value_node_is_restorable): likewise.
* hieroglyph/hgmem.h (hg_mem_restorable): new macro.
(hg_mem_is_restorable): likewise.
* hieroglyph/hgmem.c (_hg_allocator_ffit_real_gc_mark): try to mark
the object from the root node.
(hg_mem_add_root_node): new function.
(hg_mem_remove_root_node): new function.
(hg_mem_pool_destroy): free the root node.
(_hg_allocator_ffit_real_resize_pool): try to relocate the addresses
in the root node.
(hg_mem_pool_save_snapshot): new function.
(hg_mem_pool_restore_snapshot): new function.
2006-01-24 Akira TAGOH <at@gclab.org>
* libretto/lbstack.c (_libretto_stack_real_set_flags): implemented.
(_libretto_stack_real_relocate): implemented.
* libretto/lbstack.[ch]: reimplemented.
* hieroglyph/hgfile.[ch]: reimplemented.
2006-01-23 Akira TAGOH <at@gclab.org>
* hieroglyph/hgdict.c (_hg_dict_traverse_set_flags): new function.
(_hg_dict_real_set_flags): likewise.
(_hg_dict_node_real_set_flags): likewise.
(_hg_dict_node_real_relocate): likewise.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_relocate): new function.
* hieroglyph/hgarray.c (_hg_array_real_set_flags): new function.
(_hg_array_real_relocate): likewise.
* hieroglyph/hgmem.c (_hg_allocator_ffit_real_resize_pool): recompute
all the addresses.
(hg_mem_set_flags): notify to all the children objects.
(hg_mem_get_object): new function.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_free): added name and
dict object.
(_hg_value_node_real_set_flags): new function.
(hg_value_node_get_hash): added name and dict object.
(hg_value_node_compare): likewise.
2006-01-21 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (_hg_allocator_ffit_real_garbage_collection):
implemented GC.
(_hg_allocator_ffit_real_gc_mark): new function.
(_hg_mem_free): moved out from hg_mem_free.
(hg_mem_set_stack_end): new function.
(hg_mem_free): do nothing if allocator supports GC.
(hg_mem_set_flags): new function.
(hg_mem_get_flags): likewise.
(hg_mem_is_flags): likewise.
* hieroglyph/hgbtree.c (hg_btree_page_foreach): fixed not to pick up
some nodes.
(hg_btree_page_get_iter): new function.
(hg_btree_iter_new): likewise.
(hg_btree_iter_free): likewise.
(hg_btree_get_iter_first): likewise.
(hg_btree_get_iter_next): likewise.
(hg_btree_is_iter_valid): likewise.
(hg_btree_update_iter): likewise.
(hg_btree_first): removed.
* hieroglyph/hgmem.h (hg_mem_gc_mark): new macro.
(hg_mem_gc_unmark): likewise.
(hg_mem_is_gc_mark): likewise.
2006-01-20 Akira TAGOH <at@gclab.org>
* hieroglyph/hgvaluenode.c (hg_value_node_get_hash): support
HG_TYPE_VALUE_STRING.
* hieroglyph/hgstring.[ch]: reimplemented.
* hieroglyph/hgmem.c (_hg_mem_init_stack_start): use __libc_stack_end
instead of the value where from /proc/self/stat.
(_hg_allocator_ffit_real_destroy): destroy all the node.
(_hg_allocator_ffit_real_alloc): fixed a memory leak.
(_hg_allocator_ffit_compare): fixed not to sort out properly.
* hieroglyph/hgbtree.c (hg_btree_page_foreach): fixed a typo.
(hg_btree_page_first): new function.
(hg_btree_first): new function.
* hieroglyph/hgdict.c (_hg_dict_node_free): new function.
(_hg_dict_destroy): destroy the node instance as well.
(hg_dict_new): don't set a destroyer function where called at
destroying, to avoid the loop between the allocator destroyer.
(hg_dict_remove): remove the hash key when there are no items for that
anymore.
* hieroglyph/hgmem.c (_hg_allocator_ffit_real_resize_pool):
align to the block size.
* hieroglyph/hgdict.[ch]: reimplemented.
* hieroglyph/hgvaluenode.c (hg_value_node_get_hash): new function.
(hg_value_node_compare): likewise.
2006-01-19 Akira TAGOH <at@gclab.org>
* hieroglyph/hgarray.[ch]: reimplemented.
* hieroglyph/hgmem.c (_hg_mem_init_stack_start): new function to
determine the stack location.
(_hg_allocator_get_block_id): fixed a problem that the return value
could be less than the given size.
(_hg_allocator_ffit_real_alloc): put an identity to recognize an
object.
(_hg_allocator_ffit_real_free): forgot to add a free block to the list.
(hg_mem_init): implemented.
(hg_mem_finalize): new function.
(hg_mem_free): free an object without a memory pool because the given
pool could be the different thing. so tell the object which one was
your mother.
* hieroglyph/hgbtree.c (hg_btree_page_foreach): make it possible to
give an extra data.
(hg_btree_foreach): likewise.
* hieroglyph/hgvaluenode.[ch]: reimplemented.
2006-01-18 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.[ch]: reimplemented a lot.
* hieroglyph/hgmacros.h: new file.
2006-01-17 Akira TAGOH <at@gclab.org>
* hieroglyph/hgbtree.c (hg_btree_page_destroy): fixed a memory leak.
(hg_btree_page_insert): fixed a typo.
(hg_btree_page_insert): free a val when it's called as replaced.
(hg_btree_replace): new function.
2006-01-16 Akira TAGOH <at@gclab.org>
* hieroglyph/hgbtree.[ch]: new files.
2006-01-13 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (hg_mem_save_object_new): make it speeding up
a bit.
* hieroglyph/hgfile.c (_hg_file_object_free__internal): mmap support.
(hg_file_object_new): likewise.
(hg_file_object_is_error): likewise.
(hg_file_object_read): likewise.
(hg_file_object_read_line): likewise.
(hg_file_object_write): likewise.
(hg_file_object_seek): likewise.
(hg_file_object_getchar): new function.
* libretto/scanner.c (libretto_scanner_get_token): make it speeding
up a bit.
2006-01-11 Akira TAGOH <at@gclab.org>
* hieroglyph/hgarray.c (hg_array_new): try GC when the memory
allocation was failed.
(hg_array_length__internal): removed.
* hieroglyph/hgmem.c (_gg_list_reverse_find): new function.
(hg_mem_save_object_new): try GC when the memory allocation was
failed.
(hg_mem_object_new): likewise.
(hg_mem_object_gc_append_root): new function.
(hg_mem_object_gc_remove_root): new function.
(hg_mem_gc_mark_from_root_node__internal): new function.
(hg_mem_gc_mark_from_root_node): new function.
* hieroglyph/hgstring.c (hg_string_new): try GC when the memory
allocation was failed.
* hieroglyph/hgdict.c (_hg_dict_real_dup): new function.
(hg_dict_new): try GC when the memory allocation was failed.
* hieroglyph/hgvaluenode.c (hg_value_node_new): return NULL when
hg_mem_object_new was failed.
* hieroglyph/hgfile.c (_hg_file_object_real_to_string): new function.
(hg_file_object_read_line): don't try to copy the buffer more than
the buffer size.
(hg_file_object_seek): new function.
* configure.ac: check if fseeko is available.
* libretto/operator.c (_libretto_operator_op_begin): implemented.
(_libretto_operator_op_def): implemented.
(_libretto_operator_op_dict): implemented.
(_libretto_operator_op_exec): implemented.
* libretto/scanner.c (_libretto_scanner_get_next_token): parse a token
from the file object instead of String.
(libretto_scanner_get_object): return NULL when there are no token.
* libretto/vm.c (libretto_vm_new): enable the statement edit scanning
by default.
(libretto_vm_new): add the stacks, the dictionaries to the root node
to get GC working.
(libretto_vm_init): wrap up the dictionaries with HgValueNode before
pushing them into the stack.
(libretto_vm_exec): don't set an executable flag to the name object
since Array has the proper flag.
(libretto_vm_exec): get a token from the file object directly.
2006-01-06 Akira TAGOH <at@gclab.org>
* hieroglyph/hgarray.c (_hg_array_real_gc_marker): call
hg_value_node_node_gc_mark__internal instead of its own codes for
the nodes.
(_hg_array_real_gc_lock): likewise.
(_hg_array_real_to_string): likewise.
* hieroglyph/hgdict.c (_hg_dict_real_gc_marker): call
hg_value_node_node_gc_mark__internal instead of its own codes for
the nodes.
(_hg_dict_real_gc_lock): likewise.
(_hg_dict_node_gc_marker): removed.
(_hg_dict_node_gc_lock): removed.
* hieroglyph/hgvaluenode.c (_hg_value_node_real_gc_lock): new function.
(_hg_value_node_real_to_string): new function.
(_hg_value_node_real_dup): new function.
(hg_value_node_node_gc_mark__internal): new function.
(hg_value_node_node_gc_lock__internal): new function.
(hg_value_node_node_to_string__internal): new function.
(hg_value_node_node_dup__internal): new function.
(hg_value_node_compare): new function.
* libretto/scanner.c (_libretto_scanner_get_next_token): clean
the buffer up when a line is only a comment.
* libretto/lbstack.c (_libretto_stack_real_gc_marker): call
hg_value_node_node_gc_mark__internal instead of having its own code for
the nodes.
(_libretto_stack_real_gc_lock): likewise.
* libretto/vm.c (libretto_vm_set_emulation_level): new function.
(libretto_vm_exec): fixed a fail when comment appears in the string.
* hieroglyph/hgarray.c (_hg_array_real_to_string): output a string
without / if the name object has an executable flag.
(_hg_array_real_dup): new function.
(hg_array_length__internal): new function.
(hg_array_append__internal): likewise.
(hg_array_replace_with_index__internal): likewise.
* hieroglyph/hgstring.c (hg_string_real_length__internal):
new function.
(hg_string_get_character__internal): new function.
* hieroglyph/hgvaluenode.[ch]: new files.
* hieroglyph/hgfile.c (hg_file_object_is_error): renamed from
hg_file_is_accessible.
(hg_file_object_get_error): new function.
* libretto/operator.c (_libretto_operator_op_private_for_pos_int_continue):
implemented.
(_libretto_operator_op_private_write_eqeq_only): implemented.
(_libretto_operator_op_bind): implemented.
(_libretto_operator_op_count): implemented.
(_libretto_operator_op_exch): implemented.
(_libretto_operator_get_open_type): new function.
(_libretto_operator_get_access_type): new function.
(_libretto_operator_op_file): implemented.
(_libretto_operator_op_for): implemented.
(_libretto_operator_op_index): implemented.
(_libretto_operator_op_print): implemented.
(_libretto_operator_op_sub): implemented.
(_libretto_operator_op_writestring): implemented.
(libretto_operator_init): defined /write==only, /==only, /== and
/pstack operator.
* libretto/scanner.c (_libretto_scanner_parse_string): convert \n, \r,
\t, \b and \f to the actual control characters.
(_libretto_scanner_get_next_token): fixed a typo.
(libretto_scanner_get_object): use hg_value_node_new instead of
hg_mem_object_new.
* libretto/vm.c (_libretto_vm_examine_object): make a duplicate object
to avoid an array breakage.
(libretto_vm_destroy): destroy a scanner object.
(libretto_vm_file_set_error): new function.
(libretto_vm_exec): implemented a procedure for array.
(libretto_vm_exec): make a duplicate object to avoid an array breakage.
(libretto_vm_exec): implemented a trivial code to dump current ostack
and estack. (FIXME: it should be done by PS code)
2006-01-05 Akira TAGOH <at@gclab.org>
* hieroglyph/hgarray.c (_hg_array_real_gc_marker): support HG_TYPE_FILE
object.
(_hg_array_real_to_string): new function.
* hieroglyph/hgmem.c (hg_mem_object_dup): new function.
(hg_mem_object_to_string_internal): new function.
(hg_mem_object_to_string): new function.
* hieroglyph/hgstring.c (_hg_string_real_to_string): new function.
(hg_string_real_length): new function.
* hieroglyph/hgtypes.c (hg_value_compare): support HG_TYPE_FILE object.
* hieroglyph/hgdict.c (_hg_dict_node_gc_marker): support
HG_TYPE_FILE object.
(_hg_dict_node_gc_lock): likewise.
(_hg_dict_hash): likewise.
(_hg_dict_real_to_string): new function.
* hieroglyph/hgmem.h (hg_mem_object_set_node_internal): new macro.
(hg_mem_object_set_node): likewise.
(hg_mem_object_copy_node_internal): likewise.
(hg_mem_object_copy_node): likewise.
* hieroglyph/hgfile.c (_hg_file_get_access_mode): new function.
(hg_file_object_is_accessible): likewise.
* libretto/operator.c (libretto_operator_define_macro): a macro to
define the couple of PS object.
(libretto_operator_op_private_gstringcvs): implemented.
(libretto_operator_op_add): implemented.
(_libretto_operator_real_to_string): new function.
(libretto_operator_init): define /write=only, /=only and /= operator.
(libretto_operator_get_name): new function.
* libretto/scanner.c: reimplemented.
* libretto/lbstack.c (_libretto_stack_real_gc_marker): support
HG_TYPE_FILE object.
* libretto/vm.c (_libretto_vm_examine_object): new function.
(libretto_vm_new): initialize a scanner.
(libretto_vm_set_estack): new function.
(libretto_vm_is_error): likewise.
(libretto_vm_set_error): likewise.
(libretto_vm_exec): implemented.
2005-12-30 Akira TAGOH <at@gclab.org>
* hieroglyph/hgfile.[ch]: new files.
* hieroglyph/hgmem.c (hg_mem_chunk_new): new function.
(hg_mem_chunk_ref): likewise.
(hg_mem_chunk_unref): likewise.
(hg_mem_chunk_alloc): likewise.
(hg_mem_chunk_alloc0): likewise.
(hg_mem_chunk_free): likewise.
(hg_mem_is_internal): likewise.
(hg_mem_object_is_internal): likewise.
(hg_mem_object_is): likewise.
* hieroglyph/hgtypes.h (HG_VALUE_SET_NAME): fixed a typo.
* hieroglyph/hgdict.c (hg_dict_lookup_internal): new function.
* hieroglyph/hgmem.h (hg_mem_chunk_create): new macro.
(hg_chunk_new): likewise.
(hg_chunk_new0): likewise.
(hg_chunk_free): likewise.
(hg_mem_object_is_executable_internal): likewise.
(hg_mem_object_is_executable): likewise.
* libretto/operator.c (libretto_operator_call): new function.
* libretto/lbstack.c (libretto_stack_index): new function.
* libretto/vm.c (libretto_vm_get_userdict): new function.
(libretto_vm_get_errordict): likewise.
(libretto_vm_get_errorhandlerdict): likewise.
(libretto_vm_get_io): likewise.
(libretto_vm_set_io): likewise.
(libretto_vm_init): initialize operators here.
(libretto_vm_lookup_operator): new function.
(libretto_vm_exec): likewise.
2005-12-29 Akira TAGOH <at@gclab.org>
* hieroglyph/hgarray.c (_hg_array_real_gc_marker): added null/pointer
object support.
(_hg_array_real_gc_lock): new function.
* hieroglyph/hgmem.c (_hg_mem_gc_compute_relocatable): don't swap
a start pointer and an end pointer when end is null.
(hg_mem_gc_lock_internal): new function.
(hg_mem_object_gc_lock_internal): new function.
(hg_mem_object_gc_lock): new function.
(hg_mem_object_gc_mark_internal): don't mark HG_FL_MARK when it has
already been marked.
* hieroglyph/hgtypes.c (hg_value_compare): added null/pointer
object support.
* hieroglyph/hgdict.c (_hg_dict_node_gc_marker): added null/pointer
object support.
(_hg_dict_node_gc_lock): new function.
(_hg_dict_real_gc_lock): likewise.
(_hg_dict_hash): added null/pointer object support.
(hg_dict_insert_internal): new function.
* hieroglyph/hgmem.h: added gc_lock function pointer.
* libretto/lbstack.c (_libretto_stack_real_gc_marker): added
null/pointer object support.
(_libretto_stack_real_gc_lock): new function.
* libretto/vm.c (libretto_vm_new): validate an allocated memory.
(libretto_vm_get_emulation_level): new function.
(libretto_vm_get_systemdict): likewise.
(libretto_vm_get_current_pool): likewise.
(libretto_vm_is_global_pool_used): likewise.
(libretto_vm_use_global_pool): likewise.
(libretto_vm_get_ostack): likewise.
(libretto_vm_get_estack): likewise.
(libretto_vm_get_dstack): likewise.
(libretto_vm_init): use a local pool by default.
(libretto_vm_startjob): new function.
* libretto/operator.[ch]: new files.
2005-12-27 Akira TAGOH <at@gclab.org>
* configure.ac: added -Werror to CFLAGS to be sane.
* libretto/inputdevice.[ch]: new files.
* hieroglyph/hgmem.c (_hg_mem_save_object_free_internal): fixed
an wrong free.
(hg_mem_save_object_new): increase an reference count for the allocated
object.
(hg_mem_save_object_free): validate the heap memory before restoring.
* hieroglyph/hgtypes.h: added mark value.
* hieroglyph/hgstring.c (hg_string_set_string): reset error status.
(hg_string_put_character): set an error if it's out of range.
(hg_string_get_character): likewise.
* hieroglyph/hgdict.c (hg_dict_new): initialize nodes.
* hieroglyph/hgmem.h (hg_mem_mark_complex_object_internal): new macro.
(hg_mem_object_mark_complex_object_internal): likewise.
(hg_mem_object_mark_complex_object): likewise.
(hg_mem_executable_internal): likewise.
(hg_mem_object_executable_internal): likewise.
(hg_mem_object_executable): likewise.
* libretto/scanner.[ch]: modified to sit down on the current memory
management system.
* libretto/lbstack.[ch]: new files.
* libretto/vm.[ch]: new files.
2005-12-26 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.c (_hg_mem_save_object_free_internal): new function.
(hg_mem_init): set GAllocator here.
(hg_mem_is_initialized): new function.
(hg_mem_save_object_new): new function.
(hg_mem_save_object_free): new function.
(hg_mem_alloc): don't fail allocation even if atom_size <= 0.
2005-12-25 Akira TAGOH <at@gclab.org>
* hieroglyph/hgdict.c (_hg_dict_hash_node_lookup): new function.
(hg_dict_insert): replace the value when the key was already registered.
* hieroglyph/hgmem.c (hg_mem_pool_new): initialize all member variables
in structure.
(hg_mem_pool_allow_heap_expansion): removed.
(hg_mem_pool_set_emulation_level): new function.
(hg_mem_pool_get_emulation_level): new function.
(hg_mem_object_gc_mark_internal): new function.
(hg_mem_gc_start): check why the lock failed and retry to lock if GC
isn't still running.
(hg_mem_gc_suspend): new function.
* hieroglyph/hgstring.c (hg_string_compare): new function.
* hieroglyph/hgtypes.c: new file.
* hieroglyph/hgdict.[ch]: new files.
* hieroglyph/hgmem.h (hg_mem_object_restorable_internal): new macro.
(hg_mem_object_restorable): likewise.
(hg_mem_object_relocatable_internal): likewise.
(hg_mem_object_relocatable): likewise.
2005-12-21 Akira TAGOH <at@gclab.org>
* hieroglyph/hgtypes.h: new file.
* hieroglyph/hgmem.c: added the reverse map to object and function
pointer to free it.
(_hg_mem_object_free_internal): new function to do it without lock.
(hg_mem_pool_allow_heap_expansion): do lock.
(hg_mem_pool_lookup): new function to lookup the list which contains
HgMem.
(hg_mem_alloc): removed lock stuff.
(hg_mem_free): likewise.
(hg_mem_set_destroyer): new function.
(hg_mem_object_new): trivial fix.
(hg_mem_object_get_status): new function.
(hg_mem_object_set_status): new function.
(hg_mem_gc_mark_internal): new function.
(hg_mem_gc_mark): new function.
* hieroglyph/hgstring.[ch]: new files for handling string.
* hieroglyph/hgerror.h: error definition file.
* hieroglyph/hgarray.[ch]: new files for the array.
2005-12-19 Akira TAGOH <at@gclab.org>
* hieroglyph/hgmem.[ch]: new file for the memory management.
2005-12-03 Akira TAGOH <at@gclab.org>
* tests/doretree.ps: added a testcase.
* tests/snowflak.ps: added a testcase.
* tests/run.sh: added.
* devices/cairo/hgdevice-cairo.c, libretto/lvstring.c,
libretto/lvarray.c, libretto/lvarray.h, libretto/lvdict.c,
libretto/operator.c, libretto/lvmark.c, hieroglyph/hgvalue-string.c,
hieroglyph/hgfilter.c, hieroglyph/hgvalue-boolean.c,
hieroglyph/hgvalue-name.c, hieroglyph/hgvalue-real.c,
hieroglyph/hgvalue-hash.c, hieroglyph/hgvalue-integer.c,
hieroglyph/hgvalue.c, hieroglyph/hgvalue-array.c,
hieroglyph/hgvalue-pointer.c, hieroglyph/hgstream.c,
hieroglyph/hgvalue-array.h, hieroglyph/hgdevice.c: removed the unused
variable.
* hieroglyph/hgdevice.c (hieroglyph_device_class_init): added rmove_to
signal.
(hieroglyph_device_rmove_to): new function.
* libretto/operator.c (libretto_operator_op_atan): implemented atan
operator.
(libretto_operator_op_concatmatrix): implemented concatmatrix operator.
(libretto_operator_op_cos): implemented cos operator.
(libretto_operator_op_lt): implemented lt operator.
(libretto_operator_op_matrix): implemented matrix operator.
(libretto_operator_op_rmoveto): implemented rmoveto operator.
(libretto_operator_op_sin): implemented sin operator.
(libretto_operator_op_sqrt): implemented sqrt operator.
* devices/cairo/hgdevice-cairo.c (hieroglyph_cairo_device_real_rmove_to):
new callback function.
* hieroglyph/hgdevice.c (hieroglyph_device_class_init): removed
the unnecessary callback functions.
(hieroglyph_device_class_init): added a clip signal and removed
path_bbox and path_bbox2 signals.
(_hieroglyph_device_open): set the initial clippath.
(hieroglyph_path_new): new function.
(hieroglyph_path_free): likewise.
(hieroglyph_path_copy): likewise.
(_hieroglyph_device_path_bbox): likewise.
(hieroglyph_device_clip): likewise.
(hieroglyph_device_clip_path): set a path.
(hieroglyph_device_close_path): likewise.
(hieroglyph_device_curve_to): likewise.
(hieroglyph_device_eofill): likewise.
(hieroglyph_device_fill): likewise.
(hieroglyph_device_line_to): likewise.
(hieroglyph_device_move_to): likewise.
(hieroglyph_device_new_path): clear the paths.
(hieroglyph_device_rline_to): set a path.
* libretto/operator.c (libretto_operator_op_clip): implemented clip
operator.
(libretto_operator_op_rotate): convert a degree to a radian.
* libretto/scanner.c (_libretto_scanner_find_skip_characters):
trival fix.
(_libretto_scanner_skip_characters): likewise.
(_libretto_scanner_get_next_token): skip the comment without the large
loop.
* libretto/lvdict.c (libretto_value_dict_hash_key_equal): trival fix.
* libretto/operator.h: include the stacks in the structure.
* devices/cairo/hgdevice-cairo.c (hieroglyph_cairo_device_real_clip):
new callback function.
(hieroglyph_cairo_device_real_clip_path): fixed the wrong implementation.
(hieroglyph_cairo_device_real_path_bbox): removed.
(hieroglyph_cairo_device_real_path_bbox2): removed.
(_hieroglyph_cairo_device_show_path): new function for the path debug.
2005-11-30 Akira TAGOH <at@gclab.org>
* tests/Makefile.am (noinst_PROGRAMS): clean up.
* libretto/Makefile.am (lrinclude_HEADERS): clean up.
* requires (GLIB_REQUIRED): require glib >= 2.8.0.
* hieroglyph/hgdevice.c (hieroglyph_device_class_init):
added more signals.
(hieroglyph_device_curve_to): new function.
(hieroglyph_device_eofill): likewise.
(hieroglyph_device_rline_to): likewise.
(hieroglyph_device_rotate): likewise.
(hieroglyph_device_translate): likewise.
* hieroglyph/hgvalue-array.c (hieroglyph_value_array_pop):
access to GPtrArray directly.
* configure.ac: added --enable-profile option.
* libretto/operator.c (libretto_operator_op_abs): implemented abs
operator.
(libretto_operator_op_aload): implemented aload operator.
(libretto_operator_op_curveto): implemented curveto operator.
(libretto_operator_op_eofill): implemented eofill operator.
(libretto_operator_op_mod): implemented mod operator.
(libretto_operator_op_rand): implemented rand operator.
(libretto_operator_op_rlineto): implemented rlineto operator.
(libretto_operator_op_rotate): implemented rotate operator.
(libretto_operator_op_setgray): implemented setgray operator.
(libretto_operator_op_sethsbcolor): implemented sethsbcolor operator.
(libretto_operator_op_srand): implemented srand operator.
(libretto_operator_op_translate): implemented translate operator.
(rgb_to_hsv): borrowed from GTK+.
(hsv_to_rgb): likewise.
(libretto_operator_new): add true, false and null into the systemdict.
* devices/cairo/hgdevice-cairo.c (hieroglyph_cairo_device_real_curve_to):
new callback function.
(hieroglyph_cairo_device_real_eofill): likewise.
(hieroglyph_cairo_device_real_rline_to): likewise.
(hieroglyph_cairo_device_real_rotate): likewise.
(hieroglyph_cairo_device_real_translate): likewise.
2005-11-25 Akira TAGOH <at@gclab.org>
* examples/ps2x.c: new file.
* examples/Makefile.am (noinst_PROGRAMS): added ps2x.
* examples/ps2ps.c (main): use hieroglyph_init instead of the macros
for debug.
* hieroglyph/hgdevice.c (hieroglyph_device_class_init):
added more callbacks and signals.
(hieroglyph_device_clip_path): new function.
(hieroglyph_device_close_path): likewise.
(hieroglyph_device_fill): likewise.
(hieroglyph_device_line_to): likewise.
(hieroglyph_device_new_path): likewise.
(hieroglyph_device_path_bbox): likewise.
(hieroglyph_device_path_bbox2): likewise.
(hieroglyph_device_restore): likewise.
(hieroglyph_device_save): likewise.
(hieroglyph_device_set_line_width): likewise.
(hieroglyph_device_set_rgb_color): likewise.
(hieroglyph_device_stroke): likewise.
* hieroglyph/hgvalue-array.c (hieroglyph_value_array_clear):
fixed an removal from the wrong place.
* hieroglyph/hgobject.c (hieroglyph_init): new function.
* hieroglyph/hgdefs.h: added HgBBox structure.
* hieroglyph/hgfilter.c (hieroglyph_filter_real_set_device):
new callback function.
* filters/ps/ps-filter.c (ps_filter_private_init): call
libretto_operator_init.
(ps_filter_real_set_device): new callback function.
(filter_open): connect to set_device signal.
* libretto/operator.c (libretto_operator_op_begin): implemented begin
operator.
(libretto_operator_op_clear): implemented clear operator.
(libretto_operator_op_cleardictstack): implemented cleardictstack
operator.
(libretto_operator_op_clippath): implemented clippath operator.
(libretto_operator_op_closepath): implemented closepath operator.
(libretto_operator_op_cvi): implemented cvi operator.
(libretto_operator_op_dict): implemented dict operator.
(libretto_operator_op_div): implemented div operator.
(libretto_operator_op_end): implemented end operator.
(libretto_operator_op_fill): implemented fill operator.
(libretto_operator_op_get): implemented get operator.
(libretto_operator_op_grestore): implemented grestore operator.
(libretto_operator_op_gsave): implemented gsave operator.
(libretto_operator_op_lineto): implemented lineto operator.
(libretto_operator_op_moveto): implemented moveto operator.
(libretto_operator_op_newpath): implemented newpath operator.
(libretto_operator_op_pathbbox): implemented pathbbox operator.
(libretto_operator_op_repeat): implemented repeat operator.
(libretto_operator_op_roll): implemented roll operator.
(libretto_operator_op_setlinewidth): implemented setlinewidth operator.
(libretto_operator_op_setrgbcolor): implemented setrgbcolor operator.
(libretto_operator_op_stroke): implemented stroke operator.
(libretto_operator_op_truncate): implemented truncate operator.
(libretto_operator_op_usertime): implemented usertime operator.
* libretto/scanner.c (_libretto_scanner_parse_string):
ignore only \r at the end of line.
(_libretto_scanner_parse_hexadecimal_string): new function.
(_libretto_scanner_get_next_token): implemented <hex> scanner.
(libretto_scanner_parse_numbers): new function.
* devices/cairo/cairo-xlib-main.c: new file for x11 module.
* devices/cairo/hgdevice-cairo.c (hieroglyph_cairo_device_real_clip_path):
new callback function.
(hieroglyph_cairo_device_real_close_path): likewise.
(hieroglyph_cairo_device_real_fill): likewise.
(hieroglyph_cairo_device_real_line_to): likewise.
(hieroglyph_cairo_device_real_new_path): likewise.
(hieroglyph_cairo_device_real_path_bbox): likewise.
(hieroglyph_cairo_device_real_path_bbox2): likewise.
(hieroglyph_cairo_device_real_restore): likewise.
(hieroglyph_cairo_device_real_save): likewise.
(hieroglyph_cairo_device_real_set_line_width): likewise.
(hieroglyph_cairo_device_real_set_rgb_color): likewise.
(hieroglyph_cairo_device_real_stroke): likewise.
* devices/cairo/Makefile.am (device_LTLIBRARIES): added x11 module.
* devices/cairo/hgdevice-cairo.h: added Xlib support.
2005-11-23 Akira TAGOH <at@gclab.org>
* libretto/operator.c (libretto_operator_op_and): implemented and
operator.
(libretto_operator_op_eq): implemented eq operator.
(libretto_operator_op_gt): implemented gt operator.
(libretto_operator_op_mul): implemented mul operator.
(libretto_operator_op_neg): implemented neg operator.
* libretto/scanner.c (_libretto_scanner_get_next_token):
moved from libretto_scanner_get_next_token to parse the multiple { }
recursively.
* libretto/operator.c (_libretto_operator_object2string):
check the array size.
(libretto_operator_op_array): implemented array operator.
(libretto_operator_op_for): implemented for operator.
(libretto_operator_op_put): implemented put operator.
* libretto/operator.c (_libretto_operator_object2string):
display an operator object.
(libretto_operator_op_bind): implemented bind operator.
(libretto_operator_build_closure): take an operator name in
the argument and set it as quark.
(libretto_operator_process_object): call libretto_operator_call when
it was HgValuePointer.
* libretto/lvdict.c (libretto_value_dict_real_lookup):
new function for lookup signal on HgValueHash.
(libretto_value_dict_new): connect to lookup signal.
(libretto_value_dict_lookup): emit a lookup signal instead of
calling hieroglyph_value_hash_lookup.
2005-11-22 Akira TAGOH <at@gclab.org>
* libretto/operator.c (libretto_operator_real_destroy):
use LibrettoValueDict instead of HgValueHash.
(_libretto_operator_object2string): display the object type
for the debugging purpose.
(libretto_operator_op_currentdict): fixed a typo.
(libretto_operator_op_def): use LibrettoValueDict instead
of HgValueHash.
(libretto_operator_op_exec): call libretto_operator_exec_procedure
for LibrettoValueArray.
(libretto_operator_op_known): use LibrettoValueDict instead of
HgValueHash.
(libretto_operator_instance_init): likewise.
(DEFUNC_CLOSURE): likewise.
(libretto_operator_op_sub): implemented sub operator.
(libretto_operator_is_operator): removed.
(libretto_operator_lookup): new function.
(libretto_operator_process_object): look up the object from
the dictionary stack.
(libretto_operator_exec_procedure): new function.
* libretto/lvdict.[ch]: new class.
* libretto/operator.c (libretto_operator_op_s_bracketright):
use LibrettoValueArray instead of HgValueArray.
(_libretto_operator_object2string): likewise.
(libretto_operator_op_if): likewise.
(libretto_operator_op_ifelse): likewise.
(libretto_operator_op_currentdict): pick up the dictionary from the stack.
(libretto_operator_init): new function to initialize the PS engine.
* libretto/scanner.c (_libretto_scanner_parse_numbers):
implemented a parser for { }.
* libretto/lvmark.h (LIBRETTO_IS_VALUE_MARK_TYPE): fixed a typo.
* libretto/scanner.h: added LIBRETTO_SCANNER_NO_MEMORY.
* libretto/lvarray.[ch]: new class.
2005-11-21 Akira TAGOH <at@gclab.org>
* po/POTFILES.in: added libretto/attribute.c
* hieroglyph/_marshal.list: added UINT:VOID marshaler.
* hieroglyph/hgvalue.c (hieroglyph_value_real_get_node_size):
a empty function for get_node_size signal.
(hieroglyph_value_class_init): added a get_node_size signal.
(hieroglyph_value_dup): don't use g_object_ref.
(hieroglyph_value_get_node_size): new function.
* hieroglyph/hgvalue-boolean.c (hieroglyph_value_boolean_real_get_node_size):
implemented a get_node_size signal callback.
* hieroglyph/hgvalue-name.c (hieroglyph_value_name_real_get_node_size):
likewise.
* hieroglyph/hgvalue-real.c (hieroglyph_value_real_real_get_node_size):
likewise.
* hieroglyph/hgvalue-hash.c (hieroglyph_value_hash_real_get_node_size):
likewise.
* hieroglyph/hgvalue-integer.c (hieroglyph_value_integer_real_get_node_size):
likewise.
* hieroglyph/hgvalue-array.c (hieroglyph_value_array_real_get_node_size):
likewise.
* hieroglyph/hgvalue-pointer.c (hieroglyph_value_pointer_real_get_node_size):
likewise.
* hieroglyph/hgvalue-string.c (hieroglyph_value_string_real_dup_node):
implemented a dup_node signal callback.
(hieroglyph_value_string_real_get_node_size): likewise.
* libretto/operator.c (_libretto_operator_object2string):
use LibrettoValueString instead of HgValueString.
(libretto_operator_op_dup): use hieroglyph_value_dup and set attributes.
(libretto_operator_op_if): unref the object.
(libretto_operator_op_ifelse): implemented ifelse operator.
(libretto_operator_op_xcheck): implemented xcheck operator.
(libretto_operator_is_operator): use LibrettoValueString
instead of HgValueString.
* libretto/scanner.c (_libretto_scanner_parse_string):
use LibrettoValueString instead of HgValueString.
* libretto/lvstring.[ch]: new class.
* libretto/attribute.c: trivial changes.
* libretto/Makefile.am: added lvstring.[ch].
2005-11-19 Akira TAGOH <at@gclab.org>
* libretto/operator.c (_libretto_operator_object2string):
display { } as well.
(libretto_operator_op_cvx): implemented cvx operator.
(libretto_operator_op_exec): implemented exec operator.
(libretto_operator_op_if): implemented if operator.
(libretto_operator_process_object): new function to process the object.
* libretto/scanner.c (_libretto_scanner_parse_string):
ignore \n and \r\n with \.
(libretto_scanner_get_next_token): use HgValueName instead of HgValueKey.
give the exec attribute to the operators.
* hieroglyph/hgvalue-key.[ch]: removed.
* libretto/attribute.[ch]: new file.
* tests/attribute.c: new testcase for LibrettoAttribute.
2005-11-18 Akira TAGOH <at@gclab.org>
* libretto/operator.c (libretto_operator_op_s_bracketright):
implemented ] operator.
(_libretto_operator_object2string): fixed a typo.
(libretto_operator_op_pop): implemented pop operator.
* libretto/scanner.c (_libretto_scanner_is_skip_character):
new function which was seprated from _libretto_scanner_find_skip_characters.
(libretto_scanner_get_next_token): return the name object of ].
* libretto/lvmark.h: added null type.
2005-11-17 Akira TAGOH <at@gclab.org>
* examples/ps2ps.c: added an example file for converting PS to the embedded PS.
* filters/ps/ps-filter.c (ps_filter_private_init):
new function to initialize the private structure.
(ps_filter_private_destroy): new function to destroy the private structure.
(ps_filter_get_private): new function.
(ps_filter_real_parse): new function for parse signal.
* libretto/operator.c (libretto_operator_op_s_eqeq): implemented ==.
(_libretto_operator_object2string): new function to convert the object to the string.
(libretto_operator_op_add): implemented add operator.
(libretto_operator_op_currentdict): implemented currentdict operator.
(libretto_operator_op_def): implemented def operator.
(libretto_operator_op_dup): implemented dup operator.
(libretto_operator_op_exch): implemented exch operator.
(libretto_operator_op_known): implemented known operator.
(libretto_operator_op_pstack): implemented pstack operator.
(libretto_operator_is_operator): implemented.
(libretto_operator_call): implemented.
* libretto/scanner.c (libretto_scanner_reset): new function to reset the scanner.
* hieroglyph/hgvalue-array.c (hieroglyph_value_array_real_dup_node):
new callback for dup_node signal.
* hieroglyph/hgvalue.c (hieroglyph_value_real_dup_node):
new callback for dup_node signal.
(hieroglyph_value_class_init): added dup_node signal.
(hieroglyph_value_dup): new function to duplicate HgValue.
* hieroglyph/hgvalue-hash.c (hieroglyph_value_hash_real_hash_foreach):
new function to duplicate the hash value.
(hieroglyph_value_hash_real_dup_node): new callback for dup_node signal.
2005-11-16 Akira TAGOH <at@gclab.org>
* libretto/operator.[ch]: new class.
* hieroglyph/hgfilter.c (hieroglyph_filter_class_init):
added a parse signal.
(hieroglyph_filter_set_device): increase an reference count for device.
(hieroglyph_filter_parse): new function.
* tests/hgvalue-pointer.c: new testcase for HgValuePointer.
* hieroglyph/hgvalue-pointer.[ch]: new class.
* hieroglyph/hgvalue-array.c (hieroglyph_value_array_real_destroy):
ensure to destroy the objects in the array.
* tests/hgvalue-array.c: new testcase for HgValueArray.
* hieroglyph/hgvalue-array.[ch]: new class.
2005-11-15 Akira TAGOH <at@gclab.org>
* libretto/lvmark.[ch]: new class.
* filters/ps/ps-filter.c: new file for ps filter module.
* hieroglyph/hgdevice.[ch]: added the modular support.
* hieroglyph/hgdefs.h: new file.
* hieroglyph/hgfilter.[ch]: new class.
* filters/Makefile.am: new file.
* filters/ps/Makefile.am: new file.
* tests/hgfilter-ps.c: new testcase for ps filter.
* tests/hgdevice-cairo.c: new testcase for cairo device.
* tests/Makefile.am (TESTS): added a testcase for HgFilter and HgCairoDevice.
* devices/cairo/cairo-ps-main.c: new file for cairo device module.
* devices/cairo/hgdevice-cairo.[ch]: new class to handle cairo device.
2005-11-14 Akira TAGOH <at@gclab.org>
* libretto/scanner.c (libretto_scanner_read_from_stream):
new function to read from the stream.
(libretto_scanner_get_error): new function to get the error code.
2005-11-11 Akira TAGOH <at@gclab.org>
* libretto/scanner.c (libretto_scanner_get_cur_line): new function.
(libretto_scanner_get_next_token): added string support.
(_libretto_scanner_parse_string): new function.
* hieroglyph/hgvalue-string.c (hieroglyph_value_string_new):
allow NULL for the initial value.
* libretto/scanner.c (_libretto_scanner_parse_numbers):
support the value with the radix.
* hieroglyph/hgvalue-real.h: added a macro to compare the floating variable.
* configure.ac: added a rule for LFS support.
* tests/scanner.c: new testcase for scanner.
* tests/Makefile.am (noinst_PROGRAMS): added a new testcase for scanner.
* libretto/Makefile.am: added.
* libretto/scanner.[ch]: new class to parse PostScript.
2005-11-10 Akira TAGOH <at@gclab.org>
* hieroglyph/hgvalue-key.[ch]: new class.
2005-11-01 Akira TAGOH <at@gclab.org>
* hieroglyph/hgstream.[ch]: new class.
* hieroglyph/debug.c.in (debug_assist_new_with_masks):
fixed a gcc warning.
* hieroglyph/hgfont.[ch]: new class.
2005-10-31 Akira TAGOH <at@gclab.org>
* hieroglyph/hgvalue-hash.c (hieroglyph_value_hash_real_lookup):
moved from hieroglyph_value_hash_lookup.
(hieroglyph_value_hash_class_init): made a lookup signal.
* tests/hgvalue-font.c: new testcase for HgValueFont.
* hieroglyph/hgvalue-font.[ch]: new class.
2005-10-29 Akira TAGOH <at@gclab.org>
* hieroglyph/hgvalue.c (hieroglyph_value_real_destroy):
call the parent's destroy method.
* hieroglyph/hgvalue-hash.c (hieroglyph_value_hash_real_create_node):
use the virtualized functions.
(hieroglyph_value_hash_instance_init): set the real functions for
GHashTable here.
2005-10-28 Akira TAGOH <at@gclab.org>
* hieroglyph/hgvalue-hash.[ch]: new class.
* tests/hgvalue-hash.c: new testcase for HgValueHash.
* tests/hgvalue-name.c: new testcase for HgValueName.
* hieroglyph/hgvalue-name.[ch]: new class.
2005-10-27 Akira TAGOH <at@gclab.org>
* hieroglyph/hgvalue-real.h: added a macro to convert the integer value
to an real.
* hieroglyph/hgvalue-integer.h: added a macro to convert the real value
to a integer.
* hieroglyph/debug.c (debug_assist_new_with_masks):
fixed a memory leak.
* devices/cairo/Makefile.am: added.
* devices/Makefile.am: added.
* configure.ac: added cairo checking.
2005-10-25 Akira TAGOH <at@gclab.org>
* hieroglyph/hgvalue.c (hieroglyph_value_real_create_node):
added warning message.
(hieroglyph_value_real_destroy_node): likewise.
* hieroglyph/hgdevice.[ch]: new class to handle the devices.
* hieroglyph/hgvalue-string.[ch]: new class.
* tests/hgvalue-string.c: new testcase for HgValueString.
* hieroglyph/hgvalue-float.[ch]: new class.
* tests/hgvalue-float.c: new testcase for HgValueFloat.
* hieroglyph/hgvalue-integer.c: new class.
* hieroglyph/hgvalue-integer.h: new header file.
* hieroglyph/Makefile.am (libhieroglyph_la_SOURCES): added hgvalue-integer.c
* tests/Makefile.am (noinst_PROGRAMS): added test-hgvalue-integer.
* tests/hgvalue-integer.c: new testcase for HgValueInteger.
* hieroglyph/hgvalue-boolean.c (hieroglyph_value_set_boolean):
new function.
* hieroglyph/hgvalue.c (hieroglyph_value_get_node): new function.
2005-10-24 Akira TAGOH <at@gclab.org>
* hieroglyph/hgvalue.c: added a create_node and a destroy_node signal.
* hieroglyph/hgobject.c: added a destroy signal.
(hieroglyph_object_unref): new function.
* hieroglyph/hgvalue.list: removed.
* hieroglyph/hg-mkvalue.rb: removed.
* hieroglyph/_marshal.list: added some marshaler.
* hieroglyph/hgvalue-boolean.[ch]: new class.
* tests/Makefile.am: added a new testcase for HgValueBoolean.
* tests/hgvalue-boolean.c: added a new testcase for HgValueBoolean.
2005-10-22 Akira TAGOH <at@gclab.org>
* hieroglyph/Makefile.am: modified to generate the HgValue classes.
* hieroglyph/hgvalue.list: added a list to generate the HgValue classes.
* hieroglyph/hg-mkvalue.rb: added a helper program.
* Makefile.am (EXTRA_DIST): added intltool stuff.
2005-10-20 Akira TAGOH <at@gclab.org>
* hieroglyph/common.h: added hgobject.h and hgvalue.h
* hieroglyph/Makefile.am: added hgobject.[ch] and hgvalue.[ch].
* hieroglyph/hgobject.[ch]: base class for hieroglyph.
* hieroglyph/hgvalue.[ch]: new class to handle the value.
* tests/Makefile.am: added a testcase for HgValue.
|