Files
@ r1725:dcb3319784d1
Branch filter:
Location: cpp/openttd-patchpack/source/console.c - annotation
r1725:dcb3319784d1
43.6 KiB
text/x-c
(svn r2229) - Fix: [ 1188777 ] Non-existing sprite #5125 (presignal). The DOS grf file trgi.grf has 6 less sprites than the windows one. This results in some segfaults for certain sprites. Fixed it by added a dummy grf file consisting ofr 6 sprites and loaded when using DOS gfx at the appropiate place.
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 | r135:83948fe02372 r135:83948fe02372 r507:b1b0a0a3c313 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r1390:bd550d5f6790 r135:83948fe02372 r135:83948fe02372 r289:071a0d96c419 r274:c331ba7cdabc r543:efdb197f91ad r1026:26bcb9a458ed r1026:26bcb9a458ed r274:c331ba7cdabc r301:6810207ce37e r1725:dcb3319784d1 r301:6810207ce37e r301:6810207ce37e r543:efdb197f91ad r543:efdb197f91ad r634:504ab3a4651c r1725:dcb3319784d1 r289:071a0d96c419 r135:83948fe02372 r1397:0f76b73a5f8b r135:83948fe02372 r301:6810207ce37e r543:efdb197f91ad r1390:bd550d5f6790 r135:83948fe02372 r135:83948fe02372 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r301:6810207ce37e r1725:dcb3319784d1 r1725:dcb3319784d1 r220:dbd559d29b3c r135:83948fe02372 r135:83948fe02372 r274:c331ba7cdabc r274:c331ba7cdabc r289:071a0d96c419 r135:83948fe02372 r1390:bd550d5f6790 r1390:bd550d5f6790 r1390:bd550d5f6790 r1390:bd550d5f6790 r1390:bd550d5f6790 r289:071a0d96c419 r135:83948fe02372 r135:83948fe02372 r1725:dcb3319784d1 r1725:dcb3319784d1 r1390:bd550d5f6790 r289:071a0d96c419 r135:83948fe02372 r1725:dcb3319784d1 r1390:bd550d5f6790 r289:071a0d96c419 r301:6810207ce37e r543:efdb197f91ad r289:071a0d96c419 r986:7e85f81d353a r289:071a0d96c419 r301:6810207ce37e r289:071a0d96c419 r135:83948fe02372 r1390:bd550d5f6790 r1390:bd550d5f6790 r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r1390:bd550d5f6790 r1390:bd550d5f6790 r1390:bd550d5f6790 r1390:bd550d5f6790 r289:071a0d96c419 r135:83948fe02372 r1390:bd550d5f6790 r1390:bd550d5f6790 r1390:bd550d5f6790 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r1725:dcb3319784d1 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r1725:dcb3319784d1 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r301:6810207ce37e r289:071a0d96c419 r289:071a0d96c419 r301:6810207ce37e r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r301:6810207ce37e r301:6810207ce37e r289:071a0d96c419 r301:6810207ce37e r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r301:6810207ce37e r301:6810207ce37e r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r1390:bd550d5f6790 r1390:bd550d5f6790 r1725:dcb3319784d1 r672:b3c600807dfa r1390:bd550d5f6790 r289:071a0d96c419 r289:071a0d96c419 r543:efdb197f91ad r1390:bd550d5f6790 r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r1390:bd550d5f6790 r1725:dcb3319784d1 r1725:dcb3319784d1 r1390:bd550d5f6790 r1725:dcb3319784d1 r1390:bd550d5f6790 r1390:bd550d5f6790 r1725:dcb3319784d1 r1725:dcb3319784d1 r1390:bd550d5f6790 r1725:dcb3319784d1 r1390:bd550d5f6790 r1390:bd550d5f6790 r1725:dcb3319784d1 r1725:dcb3319784d1 r1390:bd550d5f6790 r1725:dcb3319784d1 r289:071a0d96c419 r289:071a0d96c419 r1390:bd550d5f6790 r301:6810207ce37e r1390:bd550d5f6790 r1725:dcb3319784d1 r1390:bd550d5f6790 r1390:bd550d5f6790 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r1390:bd550d5f6790 r1390:bd550d5f6790 r1390:bd550d5f6790 r1390:bd550d5f6790 r1390:bd550d5f6790 r1390:bd550d5f6790 r1390:bd550d5f6790 r1390:bd550d5f6790 r1390:bd550d5f6790 r1390:bd550d5f6790 r1390:bd550d5f6790 r1390:bd550d5f6790 r659:c4726c05e825 r659:c4726c05e825 r289:071a0d96c419 r135:83948fe02372 r247:25f0803fdb46 r220:dbd559d29b3c r247:25f0803fdb46 r229:bce061e130b4 r220:dbd559d29b3c r220:dbd559d29b3c r301:6810207ce37e r1725:dcb3319784d1 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r1243:2fe6ec20bc6e r1243:2fe6ec20bc6e r1243:2fe6ec20bc6e r1243:2fe6ec20bc6e r1243:2fe6ec20bc6e r1725:dcb3319784d1 r1243:2fe6ec20bc6e r1243:2fe6ec20bc6e r1390:bd550d5f6790 r1390:bd550d5f6790 r1243:2fe6ec20bc6e r220:dbd559d29b3c r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r220:dbd559d29b3c r1725:dcb3319784d1 r135:83948fe02372 r135:83948fe02372 r289:071a0d96c419 r135:83948fe02372 r289:071a0d96c419 r301:6810207ce37e r220:dbd559d29b3c r1390:bd550d5f6790 r1390:bd550d5f6790 r135:83948fe02372 r135:83948fe02372 r1046:f95fd7865b1e r1046:f95fd7865b1e r1046:f95fd7865b1e r1046:f95fd7865b1e r1046:f95fd7865b1e r1046:f95fd7865b1e r1046:f95fd7865b1e r1046:f95fd7865b1e r1046:f95fd7865b1e r1046:f95fd7865b1e r1046:f95fd7865b1e r1046:f95fd7865b1e r1046:f95fd7865b1e r1046:f95fd7865b1e r1127:5edd8b6c07c7 r1046:f95fd7865b1e r1046:f95fd7865b1e r1046:f95fd7865b1e r1046:f95fd7865b1e r1046:f95fd7865b1e r1046:f95fd7865b1e r289:071a0d96c419 r135:83948fe02372 r289:071a0d96c419 r220:dbd559d29b3c r1046:f95fd7865b1e r135:83948fe02372 r135:83948fe02372 r289:071a0d96c419 r220:dbd559d29b3c r986:7e85f81d353a r986:7e85f81d353a r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r1725:dcb3319784d1 r135:83948fe02372 r986:7e85f81d353a r986:7e85f81d353a r135:83948fe02372 r135:83948fe02372 r289:071a0d96c419 r135:83948fe02372 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r1725:dcb3319784d1 r289:071a0d96c419 r1397:0f76b73a5f8b r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r1397:0f76b73a5f8b r543:efdb197f91ad r289:071a0d96c419 r986:7e85f81d353a r986:7e85f81d353a r135:83948fe02372 r135:83948fe02372 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r135:83948fe02372 r135:83948fe02372 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r135:83948fe02372 r135:83948fe02372 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r220:dbd559d29b3c r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r141:ed23912abdee r141:ed23912abdee r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r220:dbd559d29b3c r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r289:071a0d96c419 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r220:dbd559d29b3c r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1390:bd550d5f6790 r141:ed23912abdee r141:ed23912abdee r1588:d6cc470c75e5 r1588:d6cc470c75e5 r1588:d6cc470c75e5 r1588:d6cc470c75e5 r1588:d6cc470c75e5 r1588:d6cc470c75e5 r1588:d6cc470c75e5 r1588:d6cc470c75e5 r1588:d6cc470c75e5 r543:efdb197f91ad r135:83948fe02372 r1588:d6cc470c75e5 r135:83948fe02372 r1243:2fe6ec20bc6e r1026:26bcb9a458ed r1026:26bcb9a458ed r1026:26bcb9a458ed r1026:26bcb9a458ed r1026:26bcb9a458ed r1243:2fe6ec20bc6e r1026:26bcb9a458ed r543:efdb197f91ad r543:efdb197f91ad r1046:f95fd7865b1e r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r220:dbd559d29b3c r135:83948fe02372 r1588:d6cc470c75e5 r1588:d6cc470c75e5 r1588:d6cc470c75e5 r1588:d6cc470c75e5 r1588:d6cc470c75e5 r135:83948fe02372 r1588:d6cc470c75e5 r1588:d6cc470c75e5 r1588:d6cc470c75e5 r1588:d6cc470c75e5 r1588:d6cc470c75e5 r1588:d6cc470c75e5 r135:83948fe02372 r1046:f95fd7865b1e r650:3d93e30d027c r289:071a0d96c419 r135:83948fe02372 r135:83948fe02372 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r543:efdb197f91ad r135:83948fe02372 r135:83948fe02372 r1725:dcb3319784d1 r247:25f0803fdb46 r135:83948fe02372 r1725:dcb3319784d1 r135:83948fe02372 r247:25f0803fdb46 r289:071a0d96c419 r135:83948fe02372 r135:83948fe02372 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r543:efdb197f91ad r135:83948fe02372 r135:83948fe02372 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r135:83948fe02372 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r289:071a0d96c419 r1725:dcb3319784d1 r1725:dcb3319784d1 r289:071a0d96c419 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r135:83948fe02372 r220:dbd559d29b3c r289:071a0d96c419 r1725:dcb3319784d1 r135:83948fe02372 r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r135:83948fe02372 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r554:7327f1a89392 r220:dbd559d29b3c r554:7327f1a89392 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r554:7327f1a89392 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r289:071a0d96c419 r554:7327f1a89392 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r135:83948fe02372 r135:83948fe02372 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r220:dbd559d29b3c r1725:dcb3319784d1 r135:83948fe02372 r1725:dcb3319784d1 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r135:83948fe02372 r135:83948fe02372 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r634:504ab3a4651c r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r634:504ab3a4651c r634:504ab3a4651c r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r634:504ab3a4651c r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r634:504ab3a4651c r634:504ab3a4651c r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r634:504ab3a4651c r634:504ab3a4651c r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r634:504ab3a4651c r1725:dcb3319784d1 r634:504ab3a4651c r1725:dcb3319784d1 r634:504ab3a4651c r634:504ab3a4651c r1725:dcb3319784d1 r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1095:c4ca8dd7cd3e r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r1725:dcb3319784d1 r634:504ab3a4651c r1725:dcb3319784d1 r1725:dcb3319784d1 r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r644:a55719ab0889 r634:504ab3a4651c r656:44c757c66b53 r640:00f79586b328 r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r644:a55719ab0889 r644:a55719ab0889 r644:a55719ab0889 r644:a55719ab0889 r644:a55719ab0889 r656:44c757c66b53 r644:a55719ab0889 r644:a55719ab0889 r644:a55719ab0889 r644:a55719ab0889 r644:a55719ab0889 r644:a55719ab0889 r644:a55719ab0889 r644:a55719ab0889 r644:a55719ab0889 r932:7f098ab8d075 r644:a55719ab0889 r644:a55719ab0889 r932:7f098ab8d075 r634:504ab3a4651c r644:a55719ab0889 r634:504ab3a4651c r634:504ab3a4651c r656:44c757c66b53 r644:a55719ab0889 r634:504ab3a4651c r640:00f79586b328 r640:00f79586b328 r634:504ab3a4651c r634:504ab3a4651c r640:00f79586b328 r640:00f79586b328 r640:00f79586b328 r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r644:a55719ab0889 r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r644:a55719ab0889 r644:a55719ab0889 r644:a55719ab0889 r634:504ab3a4651c r634:504ab3a4651c r644:a55719ab0889 r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r644:a55719ab0889 r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r1725:dcb3319784d1 r634:504ab3a4651c r640:00f79586b328 r634:504ab3a4651c r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r634:504ab3a4651c r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r135:83948fe02372 r289:071a0d96c419 r135:83948fe02372 r554:7327f1a89392 r135:83948fe02372 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r543:efdb197f91ad r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r301:6810207ce37e r289:071a0d96c419 r289:071a0d96c419 r554:7327f1a89392 r554:7327f1a89392 r554:7327f1a89392 r289:071a0d96c419 r220:dbd559d29b3c r135:83948fe02372 r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r618:80731d9a1c73 r135:83948fe02372 r135:83948fe02372 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r1725:dcb3319784d1 r289:071a0d96c419 r1725:dcb3319784d1 r1725:dcb3319784d1 r220:dbd559d29b3c r135:83948fe02372 r135:83948fe02372 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r543:efdb197f91ad r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r301:6810207ce37e r301:6810207ce37e r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r301:6810207ce37e r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r289:071a0d96c419 r220:dbd559d29b3c r222:4409829eb08f r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r135:83948fe02372 r135:83948fe02372 r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r222:4409829eb08f r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r543:efdb197f91ad r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r222:4409829eb08f r135:83948fe02372 r135:83948fe02372 r289:071a0d96c419 r220:dbd559d29b3c r543:efdb197f91ad r289:071a0d96c419 r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r135:83948fe02372 r543:efdb197f91ad r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r135:83948fe02372 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r135:83948fe02372 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r135:83948fe02372 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r135:83948fe02372 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r135:83948fe02372 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r141:ed23912abdee r289:071a0d96c419 r289:071a0d96c419 r135:83948fe02372 r135:83948fe02372 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r301:6810207ce37e r301:6810207ce37e r301:6810207ce37e r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r135:83948fe02372 r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r1725:dcb3319784d1 r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r135:83948fe02372 r135:83948fe02372 r1725:dcb3319784d1 r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r135:83948fe02372 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r1725:dcb3319784d1 r289:071a0d96c419 r220:dbd559d29b3c r1725:dcb3319784d1 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r634:504ab3a4651c r634:504ab3a4651c r1725:dcb3319784d1 r1725:dcb3319784d1 r135:83948fe02372 r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r959:bb0ac3e56084 r959:bb0ac3e56084 r959:bb0ac3e56084 r1109:6c0cc4a443a2 r1725:dcb3319784d1 r1379:81130ee0652e r1725:dcb3319784d1 r1725:dcb3319784d1 r1379:81130ee0652e r1379:81130ee0652e r135:83948fe02372 r640:00f79586b328 r640:00f79586b328 r640:00f79586b328 r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r135:83948fe02372 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r543:efdb197f91ad r301:6810207ce37e r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r135:83948fe02372 r289:071a0d96c419 r543:efdb197f91ad r135:83948fe02372 r543:efdb197f91ad r289:071a0d96c419 r543:efdb197f91ad r543:efdb197f91ad r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r543:efdb197f91ad r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r543:efdb197f91ad r220:dbd559d29b3c r135:83948fe02372 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r543:efdb197f91ad r301:6810207ce37e r543:efdb197f91ad r301:6810207ce37e r301:6810207ce37e r301:6810207ce37e r301:6810207ce37e r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r289:071a0d96c419 r301:6810207ce37e r543:efdb197f91ad r289:071a0d96c419 r141:ed23912abdee r141:ed23912abdee r141:ed23912abdee r543:efdb197f91ad r543:efdb197f91ad r289:071a0d96c419 r301:6810207ce37e r543:efdb197f91ad r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r135:83948fe02372 r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r135:83948fe02372 r220:dbd559d29b3c r220:dbd559d29b3c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r135:83948fe02372 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r222:4409829eb08f r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r634:504ab3a4651c r135:83948fe02372 r135:83948fe02372 r135:83948fe02372 r289:071a0d96c419 r135:83948fe02372 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r301:6810207ce37e r289:071a0d96c419 r289:071a0d96c419 r301:6810207ce37e r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r193:6aa65dc5a4b4 r289:071a0d96c419 r543:efdb197f91ad r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r193:6aa65dc5a4b4 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r135:83948fe02372 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r135:83948fe02372 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r301:6810207ce37e r289:071a0d96c419 r301:6810207ce37e r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r301:6810207ce37e r289:071a0d96c419 r289:071a0d96c419 r301:6810207ce37e r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r135:83948fe02372 r543:efdb197f91ad r543:efdb197f91ad r543:efdb197f91ad r301:6810207ce37e r289:071a0d96c419 r135:83948fe02372 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r222:4409829eb08f r222:4409829eb08f r289:071a0d96c419 r222:4409829eb08f r220:dbd559d29b3c r222:4409829eb08f r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r222:4409829eb08f r289:071a0d96c419 r289:071a0d96c419 r135:83948fe02372 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r222:4409829eb08f r289:071a0d96c419 r220:dbd559d29b3c r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r543:efdb197f91ad r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r220:dbd559d29b3c r289:071a0d96c419 r135:83948fe02372 r220:dbd559d29b3c r289:071a0d96c419 r289:071a0d96c419 r135:83948fe02372 r135:83948fe02372 r289:071a0d96c419 r135:83948fe02372 r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r634:504ab3a4651c r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r289:071a0d96c419 r135:83948fe02372 r135:83948fe02372 r301:6810207ce37e r220:dbd559d29b3c r135:83948fe02372 r1725:dcb3319784d1 | #include "stdafx.h"
#include "ttd.h"
#include "table/strings.h"
#include "window.h"
#include "gui.h"
#include "gfx.h"
#include "player.h"
#include "variables.h"
#include "string.h"
#include "hal.h"
#include <stdarg.h>
#include <string.h>
#include "console.h"
#include "network.h"
#include "network_data.h"
#include "network_server.h"
#define ICON_BUFFER 79
#define ICON_HISTORY_SIZE 20
#define ICON_CMDLN_SIZE 255
#define ICON_LINE_HEIGHT 12
#define ICON_RIGHT_BORDERWIDTH 10
#define ICON_BOTTOM_BORDERWIDTH 12
#define ICON_MAX_ALIAS_LINES 40
#define ICON_TOKEN_COUNT 20
// ** main console ** //
static Window *_iconsole_win; // Pointer to console window
static bool _iconsole_inited;
static char* _iconsole_buffer[ICON_BUFFER + 1];
static uint16 _iconsole_cbuffer[ICON_BUFFER + 1];
static Textbuf _iconsole_cmdline;
static byte _iconsole_scroll;
// ** stdlib ** //
byte _stdlib_developer = 1;
bool _stdlib_con_developer = false;
FILE* _iconsole_output_file;
// ** main console cmd buffer
static char *_iconsole_history[ICON_HISTORY_SIZE];
static byte _iconsole_historypos;
/* *************** */
/* end of header */
/* *************** */
static void IConsoleClearCommand(void)
{
memset(_iconsole_cmdline.buf, 0, ICON_CMDLN_SIZE);
_iconsole_cmdline.length = 0;
_iconsole_cmdline.width = 0;
_iconsole_cmdline.caretpos = 0;
_iconsole_cmdline.caretxoffs = 0;
SetWindowDirty(_iconsole_win);
}
static inline void IConsoleResetHistoryPos(void) {_iconsole_historypos = ICON_HISTORY_SIZE - 1;}
// ** console window ** //
static void IConsoleWndProc(Window* w, WindowEvent* e)
{
switch (e->event) {
case WE_PAINT: {
int i = _iconsole_scroll;
int max = (w->height / ICON_LINE_HEIGHT) - 1;
int delta = 0;
GfxFillRect(w->left, w->top, w->width, w->height - 1, 0);
while ((i > 0) && (i > _iconsole_scroll - max) && (_iconsole_buffer[i] != NULL)) {
DoDrawString(_iconsole_buffer[i], 5,
w->height - (_iconsole_scroll + 2 - i) * ICON_LINE_HEIGHT, _iconsole_cbuffer[i]);
i--;
}
/* If the text is longer than the window, don't show the starting ']' */
delta = w->width - 10 - _iconsole_cmdline.width - ICON_RIGHT_BORDERWIDTH;
if (delta > 0) {
DoDrawString("]", 5, w->height - ICON_LINE_HEIGHT, _iconsole_color_commands);
delta = 0;
}
DoDrawString(_iconsole_cmdline.buf, 10 + delta, w->height - ICON_LINE_HEIGHT, _iconsole_color_commands);
if (_iconsole_cmdline.caret)
DoDrawString("_", 10 + delta + _iconsole_cmdline.caretxoffs, w->height - ICON_LINE_HEIGHT, 12);
break;
}
case WE_MOUSELOOP:
if (HandleCaret(&_iconsole_cmdline))
SetWindowDirty(w);
break;
case WE_DESTROY:
_iconsole_win = NULL;
_iconsole_mode = ICONSOLE_CLOSED;
break;
case WE_KEYPRESS:
e->keypress.cont = false;
switch (e->keypress.keycode) {
case WKC_UP:
IConsoleHistoryNavigate(+1);
SetWindowDirty(w);
break;
case WKC_DOWN:
IConsoleHistoryNavigate(-1);
SetWindowDirty(w);
break;
case WKC_SHIFT | WKC_PAGEUP:
if (_iconsole_scroll - (w->height / ICON_LINE_HEIGHT) - 1 < 0)
_iconsole_scroll = 0;
else
_iconsole_scroll -= (w->height / ICON_LINE_HEIGHT) - 1;
SetWindowDirty(w);
break;
case WKC_SHIFT | WKC_PAGEDOWN:
if (_iconsole_scroll + (w->height / ICON_LINE_HEIGHT) - 1 > ICON_BUFFER)
_iconsole_scroll = ICON_BUFFER;
else
_iconsole_scroll += (w->height / ICON_LINE_HEIGHT) - 1;
SetWindowDirty(w);
break;
case WKC_SHIFT | WKC_UP:
if (_iconsole_scroll <= 0)
_iconsole_scroll = 0;
else
--_iconsole_scroll;
SetWindowDirty(w);
break;
case WKC_SHIFT | WKC_DOWN:
if (_iconsole_scroll >= ICON_BUFFER)
_iconsole_scroll = ICON_BUFFER;
else
++_iconsole_scroll;
SetWindowDirty(w);
break;
case WKC_BACKQUOTE:
IConsoleSwitch();
break;
case WKC_RETURN: case WKC_NUM_ENTER:
IConsolePrintF(_iconsole_color_commands, "] %s", _iconsole_cmdline.buf);
IConsoleHistoryAdd(_iconsole_cmdline.buf);
IConsoleCmdExec(_iconsole_cmdline.buf);
IConsoleClearCommand();
break;
case WKC_CTRL | WKC_RETURN:
_iconsole_mode = (_iconsole_mode == ICONSOLE_FULL) ? ICONSOLE_OPENED : ICONSOLE_FULL;
IConsoleResize();
MarkWholeScreenDirty();
break;
case (WKC_CTRL | 'V'):
if (InsertTextBufferClipboard(&_iconsole_cmdline)) {
IConsoleResetHistoryPos();
SetWindowDirty(w);
}
break;
case WKC_BACKSPACE: case WKC_DELETE:
if (DeleteTextBufferChar(&_iconsole_cmdline, e->keypress.keycode)) {
IConsoleResetHistoryPos();
SetWindowDirty(w);
}
break;
case WKC_LEFT: case WKC_RIGHT: case WKC_END: case WKC_HOME:
if (MoveTextBufferPos(&_iconsole_cmdline, e->keypress.keycode)) {
IConsoleResetHistoryPos();
SetWindowDirty(w);
}
break;
default:
if (IsValidAsciiChar(e->keypress.ascii)) {
_iconsole_scroll = ICON_BUFFER;
InsertTextBufferChar(&_iconsole_cmdline, e->keypress.ascii);
IConsoleResetHistoryPos();
SetWindowDirty(w);
} else
e->keypress.cont = true;
break;
}
}
}
static const Widget _iconsole_window_widgets[] = {
{WIDGETS_END}
};
static const WindowDesc _iconsole_window_desc = {
0, 0, 2, 2,
WC_CONSOLE, 0,
WDF_STD_TOOLTIPS | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS,
_iconsole_window_widgets,
IConsoleWndProc,
};
extern const char _openttd_revision[];
void IConsoleInit(void)
{
_iconsole_output_file = NULL;
_iconsole_color_default = 1;
_iconsole_color_error = 3;
_iconsole_color_warning = 13;
_iconsole_color_debug = 5;
_iconsole_color_commands = 2;
_iconsole_scroll = ICON_BUFFER;
_iconsole_historypos = ICON_HISTORY_SIZE - 1;
_iconsole_inited = true;
_iconsole_mode = ICONSOLE_CLOSED;
_iconsole_win = NULL;
#ifdef ENABLE_NETWORK /* Initialize network only variables */
_redirect_console_to_client = 0;
#endif
memset(_iconsole_history, 0, sizeof(_iconsole_history));
memset(_iconsole_buffer, 0, sizeof(_iconsole_buffer));
memset(_iconsole_cbuffer, 0, sizeof(_iconsole_cbuffer));
_iconsole_cmdline.buf = calloc(ICON_CMDLN_SIZE, sizeof(*_iconsole_cmdline.buf)); // create buffer and zero it
_iconsole_cmdline.maxlength = ICON_CMDLN_SIZE - 1;
IConsoleStdLibRegister();
IConsolePrintF(13, "OpenTTD Game Console Revision 7 - %s", _openttd_revision);
IConsolePrint(12, "------------------------------------");
IConsolePrint(12, "use \"help\" for more info");
IConsolePrint(12, "");
IConsoleClearCommand();
IConsoleHistoryAdd("");
}
void IConsoleClear(void)
{
uint i;
for (i = 0; i <= ICON_BUFFER; i++)
free(_iconsole_buffer[i]);
free(_iconsole_cmdline.buf);
}
static void IConsoleWriteToLogFile(const char* string)
{
if (_iconsole_output_file != NULL) {
// if there is an console output file ... also print it there
fwrite(string, strlen(string), 1, _iconsole_output_file);
fwrite("\n", 1, 1, _iconsole_output_file);
}
}
bool CloseConsoleLogIfActive(void)
{
if (_iconsole_output_file != NULL) {
IConsolePrintF(_iconsole_color_default, "file output complete");
fclose(_iconsole_output_file);
_iconsole_output_file = NULL;
return true;
}
return false;
}
void IConsoleFree(void)
{
_iconsole_inited = false;
IConsoleClear();
CloseConsoleLogIfActive();
}
void IConsoleResize(void)
{
_iconsole_win = FindWindowById(WC_CONSOLE, 0);
switch (_iconsole_mode) {
case ICONSOLE_OPENED:
_iconsole_win->height = _screen.height / 3;
_iconsole_win->width = _screen.width;
break;
case ICONSOLE_FULL:
_iconsole_win->height = _screen.height - ICON_BOTTOM_BORDERWIDTH;
_iconsole_win->width = _screen.width;
break;
default:
NOT_REACHED();
}
MarkWholeScreenDirty();
}
void IConsoleSwitch(void)
{
switch (_iconsole_mode) {
case ICONSOLE_CLOSED:
_iconsole_win = AllocateWindowDesc(&_iconsole_window_desc);
_iconsole_win->height = _screen.height / 3;
_iconsole_win->width = _screen.width;
_iconsole_mode = ICONSOLE_OPENED;
SETBIT(_no_scroll, SCROLL_CON); // override cursor arrows; the gamefield will not scroll
break;
case ICONSOLE_OPENED: case ICONSOLE_FULL:
DeleteWindowById(WC_CONSOLE, 0);
_iconsole_win = NULL;
_iconsole_mode = ICONSOLE_CLOSED;
CLRBIT(_no_scroll, SCROLL_CON);
break;
}
MarkWholeScreenDirty();
}
void IConsoleClose(void)
{
if (_iconsole_mode == ICONSOLE_OPENED) IConsoleSwitch();
}
void IConsoleOpen(void)
{
if (_iconsole_mode == ICONSOLE_CLOSED) IConsoleSwitch();
}
/**
* Add the entered line into the history so you can look it back
* scroll, etc. Put it to the beginning as it is the latest text
* @param cmd Text to be entered into the 'history'
*/
void IConsoleHistoryAdd(const char *cmd)
{
free(_iconsole_history[ICON_HISTORY_SIZE - 1]);
memmove(&_iconsole_history[1], &_iconsole_history[0], sizeof(_iconsole_history[0]) * (ICON_HISTORY_SIZE - 1));
_iconsole_history[0] = strdup(cmd);
IConsoleResetHistoryPos();
}
/**
* Navigate Up/Down in the history of typed commands
* @param direction Go further back in history (+1), go to recently typed commands (-1)
*/
void IConsoleHistoryNavigate(signed char direction)
{
int i = _iconsole_historypos + direction;
// watch out for overflows, just wrap around
if (i < 0) i = ICON_HISTORY_SIZE - 1;
if (i >= ICON_HISTORY_SIZE) i = 0;
if (direction > 0)
if (_iconsole_history[i] == NULL) i = 0;
if (direction < 0) {
while (i > 0 && _iconsole_history[i] == NULL) i--;
}
_iconsole_historypos = i;
IConsoleClearCommand();
// copy history to 'command prompt / bash'
assert(_iconsole_history[i] != NULL && IS_INT_INSIDE(i, 0, ICON_HISTORY_SIZE));
ttd_strlcpy(_iconsole_cmdline.buf, _iconsole_history[i], _iconsole_cmdline.maxlength);
UpdateTextBufferSize(&_iconsole_cmdline);
}
/**
* Handle the printing of text entered into the console or redirected there
* by any other means. Text can be redirected to other players in a network game
* as well as to a logfile. If the network server is a dedicated server, all activities
* are also logged. All lines to print are added to a temporary buffer which can be
* used as a history to print them onscreen
* @param color_code the colour of the command. Red in case of errors, etc.
* @param string the message entered or output on the console (notice, error, etc.)
*/
void IConsolePrint(uint16 color_code, const char* string)
{
char *i;
#ifdef ENABLE_NETWORK
if (_redirect_console_to_client != 0) {
/* Redirect the string to the client */
SEND_COMMAND(PACKET_SERVER_RCON)(NetworkFindClientStateFromIndex(_redirect_console_to_client), color_code, string);
return;
}
#endif
if (_network_dedicated) {
printf("%s\n", string);
IConsoleWriteToLogFile(string);
return;
}
if (!_iconsole_inited) return;
/* move up all the strings in the buffer one place and do the same for colour
* to accomodate for the new command/message */
free(_iconsole_buffer[0]);
memmove(&_iconsole_buffer[0], &_iconsole_buffer[1], sizeof(_iconsole_buffer[0]) * ICON_BUFFER);
_iconsole_buffer[ICON_BUFFER] = strdup(string);
// filter out unprintable characters
for (i = _iconsole_buffer[ICON_BUFFER]; *i != '\0'; i++)
if (!IsValidAsciiChar((byte)*i)) *i = ' ';
memmove(&_iconsole_cbuffer[0], &_iconsole_cbuffer[1], sizeof(_iconsole_cbuffer[0]) * ICON_BUFFER);
_iconsole_cbuffer[ICON_BUFFER] = color_code;
IConsoleWriteToLogFile(string);
if (_iconsole_win != NULL) SetWindowDirty(_iconsole_win);
}
/**
* Handle the printing of text entered into the console or redirected there
* by any other means. Uses printf() style format, for more information look
* at @IConsolePrint()
*/
void CDECL IConsolePrintF(uint16 color_code, const char* s, ...)
{
va_list va;
char buf[ICON_MAX_STREAMSIZE];
va_start(va, s);
vsnprintf(buf, sizeof(buf), s, va);
va_end(va);
IConsolePrint(color_code, buf);
}
/**
* It is possible to print debugging information to the console,
* which is achieved by using this function. Can only be used by
* @debug() in debug.c. You need at least a level 2 (developer) for debugging
* messages to show up
*/
void IConsoleDebug(const char* string)
{
if (_stdlib_developer > 1)
IConsolePrintF(_iconsole_color_debug, "dbg: %s", string);
}
/**
* It is possible to print warnings to the console. These are mostly
* errors or mishaps, but non-fatal. You need at least a level 1 (developer) for
* debugging messages to show up
*/
void IConsoleWarning(const char* string)
{
if (_stdlib_developer > 0)
IConsolePrintF(_iconsole_color_warning, "WARNING: %s", string);
}
/**
* It is possible to print error information to the console. This can include
* game errors, or errors in general you would want the user to notice
*/
void IConsoleError(const char* string)
{
IConsolePrintF(_iconsole_color_error, "ERROR: %s", string);
}
/**
* Register a new command to be used in the console
* @param name name of the command that will be used
* @param addr function that will be called upon execution of command
*/
void IConsoleCmdRegister(const char *name, IConsoleCmdAddr addr)
{
IConsoleCmd *item, *item_before;
char *new_cmd = strdup(name);
IConsoleCmd *item_new = malloc(sizeof(IConsoleCmd));
item_new->_next = NULL;
item_new->addr = addr;
item_new->name = new_cmd;
item_new->hook_access = NULL;
item_new->hook_after_exec = NULL;
item_new->hook_before_exec = NULL;
// first command
if (_iconsole_cmds == NULL) {
_iconsole_cmds = item_new;
return;
}
item_before = NULL;
item = _iconsole_cmds;
/* BEGIN - Alphabetically insert the commands into the linked list */
while (item != NULL) {
int i = strcmp(item->name, item_new->name);
if (i == 0) {
IConsoleError("a command with this name already exists; insertion aborted");
free(item_new);
return;
}
if (i > 0) break; // insert at this position
item_before = item;
item = item->_next;
}
if (item_before == NULL) {
_iconsole_cmds = item_new;
} else
item_before->_next = item_new;
item_new->_next = item;
/* END - Alphabetical insert */
}
/**
* Find the command pointed to by its string
* @param name command to be found
* @return return Cmdstruct of the found command, or NULL on failure
*/
IConsoleCmd *IConsoleCmdGet(const char *name)
{
IConsoleCmd *item;
for (item = _iconsole_cmds; item != NULL; item = item->_next) {
if (strcmp(item->name, name) == 0) return item;
}
return NULL;
}
/**
* Register a an alias for an already existing command in the console
* @param name name of the alias that will be used
* @param cmd name of the command that 'name' will be alias of
*/
void IConsoleAliasRegister(const char *name, const char *cmd)
{
IConsoleAlias *item, *item_before;
char *new_alias = strdup(name);
char *cmd_aliased = strdup(cmd);
IConsoleAlias *item_new = malloc(sizeof(IConsoleAlias));
item_new->_next = NULL;
item_new->cmdline = cmd_aliased;
item_new->name = new_alias;
item_before = NULL;
item = _iconsole_aliases;
// first command
if (_iconsole_aliases == NULL) {
_iconsole_aliases = item_new;
return;
}
item_before = NULL;
item = _iconsole_aliases;
/* BEGIN - Alphabetically insert the commands into the linked list */
while (item != NULL) {
int i = strcmp(item->name, item_new->name);
if (i == 0) {
IConsoleError("an alias with this name already exists; insertion aborted");
free(item_new);
return;
}
if (i > 0) break; // insert at this position
item_before = item;
item = item->_next;
}
if (item_before == NULL) {
_iconsole_aliases = item_new;
} else
item_before->_next = item_new;
item_new->_next = item;
/* END - Alphabetical insert */
}
/**
* Find the alias pointed to by its string
* @param name alias to be found
* @return return Aliasstruct of the found alias, or NULL on failure
*/
IConsoleAlias *IConsoleAliasGet(const char *name)
{
IConsoleAlias* item;
for (item = _iconsole_aliases; item != NULL; item = item->_next) {
if (strcmp(item->name, name) == 0) return item;
}
return NULL;
}
static inline int IConsoleCopyInParams(char *dst, const char *src, uint bufpos)
{
int len = min(ICON_MAX_STREAMSIZE - bufpos, strlen(src));
strncpy(dst, src, len);
return len;
}
/**
* An alias is just another name for a command, or for more commands
* Execute it as well.
* @param cmdstr is the alias of the command
* @param tokens are the parameters given to the original command (0 is the first param)
* @param tokencount the number of parameters passed
*/
static void IConsoleAliasExec(const char *cmdstr, char *tokens[ICON_TOKEN_COUNT], int tokencount)
{
const char *cmdptr;
char *aliases[ICON_MAX_ALIAS_LINES], aliasstream[ICON_MAX_STREAMSIZE];
int i;
uint a_index, astream_i;
memset(&aliases, 0, sizeof(aliases));
memset(&aliasstream, 0, sizeof(aliasstream));
aliases[0] = aliasstream;
for (cmdptr = cmdstr, a_index = 0, astream_i = 0; *cmdptr != '\0'; *cmdptr++) {
if (a_index >= lengthof(aliases) || astream_i >= lengthof(aliasstream)) break;
switch (*cmdptr) {
case '\'': /* ' will double for : */
aliasstream[astream_i++] = '"';
break;
case ';': /* Cmd seperator, start new line */
aliasstream[astream_i] = '\0';
aliases[++a_index] = &aliasstream[++astream_i];
*cmdptr++;
break;
case '%': /* One specific parameter: %A = [param 1] %B = [param 2] ... */
*cmdptr++;
switch (*cmdptr) {
case '+': { /* All parameters seperated: "[param 1]" "[param 2]" */
for (i = 0; i != tokencount; i++) {
aliasstream[astream_i++] = '"';
astream_i += IConsoleCopyInParams(&aliasstream[astream_i], tokens[i], astream_i);
aliasstream[astream_i++] = '"';
aliasstream[astream_i++] = ' ';
}
} break;
case '!': { /* Merge the parameters to one: "[param 1] [param 2] [param 3...]" */
aliasstream[astream_i++] = '"';
for (i = 0; i != tokencount; i++) {
astream_i += IConsoleCopyInParams(&aliasstream[astream_i], tokens[i], astream_i);
aliasstream[astream_i++] = ' ';
}
aliasstream[astream_i++] = '"';
} break;
default: {
int param = *cmdptr - 'A';
if (param < 0 || param >= tokencount) {
IConsoleError("too many or wrong amount of parameters passed to alias, aborting");
return;
}
aliasstream[astream_i++] = '"';
astream_i += IConsoleCopyInParams(&aliasstream[astream_i], tokens[param], astream_i);
aliasstream[astream_i++] = '"';
} break;
} break;
default:
aliasstream[astream_i++] = *cmdptr;
break;
}
}
for (i = 0; i <= (int)a_index; i++) IConsoleCmdExec(aliases[i]);
}
#if 0
static void IConsoleAliasExec(const char* cmdline, char* tokens[TOKEN_COUNT], byte tokentypes[TOKEN_COUNT])
{
char *lines[ICON_MAX_ALIAS_LINES];
char *linestream, *linestream_s;
int c;
int i;
int l;
int x;
byte t;
memset(lines, 0, ICON_MAX_ALIAS_LINES); // clear buffer
linestream_s = linestream = malloc(1024 * ICON_MAX_ALIAS_LINES);
memset(linestream, 0, 1024 * ICON_MAX_ALIAS_LINES);
//** parsing **//
l = strlen(cmdline);
i = 0;
c = 0;
x = 0;
t = 0;
lines[c] = linestream;
while (i < l && c < ICON_MAX_ALIAS_LINES - 1) {
if (cmdline[i] == '%') {
i++;
if (cmdline[i] == '+') {
// all params seperated: "[param 1]" "[param 2]"
t=1;
while ((tokens[t]!=NULL) && (t<20) &&
((tokentypes[t] == ICONSOLE_VAR_STRING) || (tokentypes[t] == ICONSOLE_VAR_UNKNOWN))) {
int l2 = strlen(tokens[t]);
*linestream = '"';
linestream++;
memcpy(linestream,tokens[t],l2);
linestream += l2;
*linestream = '"';
linestream++;
*linestream = ' ';
linestream++;
x += l2+3;
t++;
}
} else if (cmdline[i] == '!') {
// merge the params to one: "[param 1] [param 2] [param 3...]"
t=1;
*linestream = '"';
linestream++;
while ((tokens[t]!=NULL) && (t<20) &&
((tokentypes[t] == ICONSOLE_VAR_STRING) || (tokentypes[t] == ICONSOLE_VAR_UNKNOWN))) {
int l2 = strlen(tokens[t]);
memcpy(linestream,tokens[t],l2);
linestream += l2;
*linestream = ' ';
linestream++;
x += l2+1;
t++;
}
linestream--;
*linestream = '"';
linestream++;
x += 1;
} else {
// one specific parameter: %A = [param 1] %B = [param 2] ...
int l2;
t = ((byte)cmdline[i]) - 64;
if ((t<20) && (tokens[t]!=NULL) &&
((tokentypes[t] == ICONSOLE_VAR_STRING) || (tokentypes[t] == ICONSOLE_VAR_UNKNOWN))) {
l2 = strlen(tokens[t]);
*linestream = '"';
linestream++;
memcpy(linestream,tokens[t],l2);
linestream += l2;
*linestream = '"';
linestream++;
x += l2+2;
}
}
} else if (cmdline[i] == '\\') {
// \\ = \ \' = ' \% = %
i++;
if (cmdline[i] == '\\') {
*linestream = '\\';
linestream++;
} else if (cmdline[i] == '\'') {
*linestream = '\'';
linestream++;
} else if (cmdline[i] == '%') {
*linestream = '%';
linestream++;
}
} else if (cmdline[i] == '\'') {
// ' = "
*linestream = '"';
linestream++;
} else if (cmdline[i] == ';') {
// ; = start a new line
c++;
*linestream = '\0';
linestream += 1024 - (x % 1024);
x += 1024 - (x % 1024);
lines[c] = linestream;
} else {
*linestream = cmdline[i];
linestream++;
x++;
}
i++;
}
linestream--;
if (*linestream != '\0') {
c++;
linestream++;
*linestream = '\0';
}
for (i = 0; i < c; i++) IConsoleCmdExec(lines[i]);
free(linestream_s);
}
#endif
static void IConsoleVarExec(char *token[ICON_TOKEN_COUNT]) {}
void IConsoleVarInsert(_iconsole_var* item_new, const char* name)
{
_iconsole_var* item;
_iconsole_var* item_before;
item_new->_next = NULL;
item_new->name = malloc(strlen(name) + 2); /* XXX unchecked malloc */
sprintf(item_new->name, "%s", name);
item_before = NULL;
item = _iconsole_vars;
if (item == NULL) {
_iconsole_vars = item_new;
} else {
while ((item->_next != NULL) && (strcmp(item->name,item_new->name)<=0)) {
item_before = item;
item = item->_next;
}
// insertion sort
if (item_before==NULL) {
if (strcmp(item->name,item_new->name)<=0) {
// appending
item ->_next = item_new;
} else {
// inserting as startitem
_iconsole_vars = item_new;
item_new ->_next = item;
}
} else {
if (strcmp(item->name,item_new->name)<=0) {
// appending
item ->_next = item_new;
} else {
// inserting
item_new ->_next = item_before->_next;
item_before ->_next = item_new;
}
}
// insertion sort end
}
}
void IConsoleVarRegister(const char* name, void* addr, _iconsole_var_types type)
{
_iconsole_var* item_new;
item_new = malloc(sizeof(_iconsole_var)); /* XXX unchecked malloc */
item_new->_next = NULL;
switch (type) {
case ICONSOLE_VAR_BOOLEAN:
item_new->data.bool_ = addr;
break;
case ICONSOLE_VAR_BYTE:
case ICONSOLE_VAR_UINT8:
item_new->data.byte_ = addr;
break;
case ICONSOLE_VAR_UINT16:
item_new->data.uint16_ = addr;
break;
case ICONSOLE_VAR_UINT32:
item_new->data.uint32_ = addr;
break;
case ICONSOLE_VAR_INT16:
item_new->data.int16_ = addr;
break;
case ICONSOLE_VAR_INT32:
item_new->data.int32_ = addr;
break;
case ICONSOLE_VAR_STRING:
item_new->data.string_ = addr;
break;
default:
error("unknown console variable type");
break;
}
IConsoleVarInsert(item_new, name);
item_new->type = type;
item_new->_malloc = false;
item_new->hook_access = NULL;
item_new->hook_after_change = NULL;
item_new->hook_before_change = NULL;
}
void IConsoleVarMemRegister(const char* name, _iconsole_var_types type)
{
_iconsole_var* item;
item = IConsoleVarAlloc(type);
IConsoleVarInsert(item, name);
}
_iconsole_var* IConsoleVarGet(const char* name)
{
_iconsole_var* item;
for (item = _iconsole_vars; item != NULL; item = item->_next) {
if (strcmp(item->name, name) == 0) return item;
}
return NULL;
}
_iconsole_var* IConsoleVarAlloc(_iconsole_var_types type)
{
_iconsole_var* item = malloc(sizeof(_iconsole_var)); /* XXX unchecked malloc */
item->_next = NULL;
item->name = NULL;
item->type = type;
switch (item->type) {
case ICONSOLE_VAR_BOOLEAN:
item->data.bool_ = malloc(sizeof(*item->data.bool_));
*item->data.bool_ = false;
item->_malloc = true;
break;
case ICONSOLE_VAR_BYTE:
case ICONSOLE_VAR_UINT8:
item->data.byte_ = malloc(sizeof(*item->data.byte_));
*item->data.byte_ = 0;
item->_malloc = true;
break;
case ICONSOLE_VAR_UINT16:
item->data.uint16_ = malloc(sizeof(*item->data.uint16_));
*item->data.uint16_ = 0;
item->_malloc = true;
break;
case ICONSOLE_VAR_UINT32:
item->data.uint32_ = malloc(sizeof(*item->data.uint32_));
*item->data.uint32_ = 0;
item->_malloc = true;
break;
case ICONSOLE_VAR_INT16:
item->data.int16_ = malloc(sizeof(*item->data.int16_));
*item->data.int16_ = 0;
item->_malloc = true;
break;
case ICONSOLE_VAR_INT32:
item->data.int32_ = malloc(sizeof(*item->data.int32_));
*item->data.int32_ = 0;
item->_malloc = true;
break;
case ICONSOLE_VAR_POINTER:
case ICONSOLE_VAR_STRING:
// needs no memory ... it gets memory when it is set to an value
item->data.addr = NULL;
item->_malloc = false;
break;
default:
error("unknown console variable type");
break;
}
item->hook_access = NULL;
item->hook_after_change = NULL;
item->hook_before_change = NULL;
return item;
}
void IConsoleVarFree(_iconsole_var* var)
{
if (var->_malloc)
free(var->data.addr);
free(var->name);
free(var);
}
void IConsoleVarSetString(_iconsole_var* var, const char* string)
{
if (string == NULL) return;
if (var->_malloc)
free(var->data.string_);
var->data.string_ = strdup(string);
var->_malloc = true;
}
void IConsoleVarSetValue(_iconsole_var* var, int value) {
switch (var->type) {
case ICONSOLE_VAR_BOOLEAN:
*var->data.bool_ = (value != 0);
break;
case ICONSOLE_VAR_BYTE:
case ICONSOLE_VAR_UINT8:
*var->data.byte_ = value;
break;
case ICONSOLE_VAR_UINT16:
*var->data.uint16_ = value;
break;
case ICONSOLE_VAR_UINT32:
*var->data.uint32_ = value;
break;
case ICONSOLE_VAR_INT16:
*var->data.int16_ = value;
break;
case ICONSOLE_VAR_INT32:
*var->data.int32_ = value;
break;
default:
assert(0);
break;
}
}
void IConsoleVarDump(const _iconsole_var* var, const char* dump_desc)
{
if (var == NULL) return;
if (dump_desc == NULL) dump_desc = var->name;
switch (var->type) {
case ICONSOLE_VAR_BOOLEAN:
IConsolePrintF(_iconsole_color_default, "%s = %s",
dump_desc, *var->data.bool_ ? "true" : "false");
break;
case ICONSOLE_VAR_BYTE:
case ICONSOLE_VAR_UINT8:
IConsolePrintF(_iconsole_color_default, "%s = %u",
dump_desc, *var->data.byte_);
break;
case ICONSOLE_VAR_UINT16:
IConsolePrintF(_iconsole_color_default, "%s = %u",
dump_desc, *var->data.uint16_);
break;
case ICONSOLE_VAR_UINT32:
IConsolePrintF(_iconsole_color_default, "%s = %u",
dump_desc, *var->data.uint32_);
break;
case ICONSOLE_VAR_INT16:
IConsolePrintF(_iconsole_color_default, "%s = %i",
dump_desc, *var->data.int16_);
break;
case ICONSOLE_VAR_INT32:
IConsolePrintF(_iconsole_color_default, "%s = %i",
dump_desc, *var->data.int32_);
break;
case ICONSOLE_VAR_STRING:
IConsolePrintF(_iconsole_color_default, "%s = %s",
dump_desc, var->data.string_);
break;
case ICONSOLE_VAR_REFERENCE:
IConsolePrintF(_iconsole_color_default, "%s = @%s",
dump_desc, var->data.reference_);
case ICONSOLE_VAR_UNKNOWN:
case ICONSOLE_VAR_POINTER:
IConsolePrintF(_iconsole_color_default, "%s = @%p",
dump_desc, var->data.addr);
break;
case ICONSOLE_VAR_NONE:
IConsolePrintF(_iconsole_color_default, "%s = [nothing]",
dump_desc);
break;
}
}
// * ************************* * //
// * hooking code * //
// * ************************* * //
void IConsoleVarHook(const char* name, _iconsole_hook_types type, iconsole_var_hook proc)
{
_iconsole_var* hook_var = IConsoleVarGet(name);
if (hook_var == NULL) return;
switch (type) {
case ICONSOLE_HOOK_BEFORE_CHANGE:
hook_var->hook_before_change = proc;
break;
case ICONSOLE_HOOK_AFTER_CHANGE:
hook_var->hook_after_change = proc;
break;
case ICONSOLE_HOOK_ACCESS:
hook_var->hook_access = proc;
break;
case ICONSOLE_HOOK_BEFORE_EXEC:
case ICONSOLE_HOOK_AFTER_EXEC:
assert(0);
break;
}
}
bool IConsoleVarHookHandle(_iconsole_var* hook_var, _iconsole_hook_types type)
{
iconsole_var_hook proc;
if (hook_var == NULL) return false;
proc = NULL;
switch (type) {
case ICONSOLE_HOOK_BEFORE_CHANGE:
proc = hook_var->hook_before_change;
break;
case ICONSOLE_HOOK_AFTER_CHANGE:
proc = hook_var->hook_after_change;
break;
case ICONSOLE_HOOK_ACCESS:
proc = hook_var->hook_access;
break;
case ICONSOLE_HOOK_BEFORE_EXEC:
case ICONSOLE_HOOK_AFTER_EXEC:
assert(0);
break;
}
return proc == NULL ? true : proc(hook_var);
}
void IConsoleCmdHook(const char* name, _iconsole_hook_types type, iconsole_cmd_hook proc)
{
IConsoleCmd* hook_cmd = IConsoleCmdGet(name);
if (hook_cmd == NULL) return;
switch (type) {
case ICONSOLE_HOOK_AFTER_EXEC:
hook_cmd->hook_after_exec = proc;
break;
case ICONSOLE_HOOK_BEFORE_EXEC:
hook_cmd->hook_before_exec = proc;
break;
case ICONSOLE_HOOK_ACCESS:
hook_cmd->hook_access = proc;
break;
case ICONSOLE_HOOK_BEFORE_CHANGE:
case ICONSOLE_HOOK_AFTER_CHANGE:
assert(0);
break;
}
}
bool IConsoleCmdHookHandle(IConsoleCmd* hook_cmd, _iconsole_hook_types type)
{
iconsole_cmd_hook proc = NULL;
switch (type) {
case ICONSOLE_HOOK_AFTER_EXEC:
proc = hook_cmd->hook_after_exec;
break;
case ICONSOLE_HOOK_BEFORE_EXEC:
proc = hook_cmd->hook_before_exec;
break;
case ICONSOLE_HOOK_ACCESS:
proc = hook_cmd->hook_access;
break;
case ICONSOLE_HOOK_BEFORE_CHANGE:
case ICONSOLE_HOOK_AFTER_CHANGE:
assert(0);
break;
}
return proc == NULL ? true : proc(hook_cmd);
}
/**
* Execute a given command passed to us. First chop it up into
* individual tokens, then execute it if possible
* @param cmdstr string to be parsed and executed
*/
void IConsoleCmdExec(const char *cmdstr)
{
IConsoleCmd *cmd = NULL;
IConsoleAlias *alias = NULL;
_iconsole_var *var = NULL;
const char *cmdptr;
char *tokens[ICON_TOKEN_COUNT], tokenstream[ICON_MAX_STREAMSIZE];
uint t_index, tstream_i;
bool longtoken = false;
for (cmdptr = cmdstr; *cmdptr != '\0'; *cmdptr++) {
if (!IsValidAsciiChar(*cmdptr)) {
IConsoleError("command contains malformed characters, aborting");
return;
}
}
if (_stdlib_con_developer)
IConsolePrintF(_iconsole_color_debug, "condbg: executing cmdline: %s", cmdstr);
memset(&tokens, 0, sizeof(tokens));
memset(&tokenstream, 0, sizeof(tokenstream));
/* 1. Split up commandline into tokens, seperated by spaces, commands
* enclosed in "" are taken as one token. We can only go as far as the amount
* of characters in our stream or the max amount of tokens we can handle */
tokens[0] = tokenstream;
for (cmdptr = cmdstr, t_index = 0, tstream_i = 0; *cmdptr != '\0'; *cmdptr++) {
if (t_index >= lengthof(tokens) || tstream_i >= lengthof(tokenstream)) break;
switch (*cmdptr) {
case ' ': /* Token seperator */
if (!longtoken) {
tokenstream[tstream_i] = '\0';
tokens[++t_index] = &tokenstream[tstream_i + 1];
} else
tokenstream[tstream_i] = *cmdptr;
tstream_i++;
break;
case '"': /* Tokens enclosed in "" are one token */
longtoken = !longtoken;
break;
default: /* Normal character */
tokenstream[tstream_i++] = *cmdptr;
break;
}
}
t_index++; // index was 0
/* 2. Determine type of command (cmd, alias or variable) and execute
* First try commands, then aliases, and finally variables
*/
cmd = IConsoleCmdGet(tokens[0]);
if (cmd != NULL) {
if (IConsoleCmdHookHandle(cmd, ICONSOLE_HOOK_ACCESS)) {
IConsoleCmdHookHandle(cmd, ICONSOLE_HOOK_BEFORE_EXEC);
cmd->addr(t_index, tokens, NULL);
IConsoleCmdHookHandle(cmd, ICONSOLE_HOOK_AFTER_EXEC);
}
return;
}
alias = IConsoleAliasGet(tokens[0]);
if (alias != NULL) {
IConsoleAliasExec(alias->cmdline, &tokens[1], t_index - 1);
return;
}
var = IConsoleVarGet(tokens[0]);
if (var != NULL) {
IConsoleVarExec(tokens);
return;
}
IConsoleError("command or variable not found");
}
#if 0
void IConsoleCmdExec(const char* cmdstr)
{
IConsoleCmdAddr function;
char* tokens[20];
byte tokentypes[20];
char* tokenstream;
char* tokenstream_s;
byte execution_mode;
_iconsole_var* var = NULL;
_iconsole_var* result = NULL;
IConsoleCmd* cmd = NULL;
IConsoleAlias* alias = NULL;
bool longtoken;
bool valid_token;
bool skip_lt_change;
uint c;
uint i;
uint l;
for (; strchr("\n\r \t", *cmdstr) != NULL; cmdstr++) {
switch (*cmdstr) {
case '\0': case '#': return;
default: break;
}
}
if (_stdlib_con_developer)
IConsolePrintF(_iconsole_color_debug, "CONDEBUG: execution_cmdline: %s", cmdstr);
//** clearing buffer **//
for (i = 0; i < 20; i++) {
tokens[i] = NULL;
tokentypes[i] = ICONSOLE_VAR_NONE;
}
tokenstream_s = tokenstream = malloc(1024);
memset(tokenstream, 0, 1024);
//** parsing **//
longtoken = false;
valid_token = false;
skip_lt_change = false;
l = strlen(cmdstr);
i = 0;
c = 0;
tokens[c] = tokenstream;
tokentypes[c] = ICONSOLE_VAR_UNKNOWN;
while (i < l && c < lengthof(tokens) - 1) {
if (cmdstr[i] == '"') {
if (longtoken) {
if (cmdstr[i + 1] == '"') {
i++;
*tokenstream = '"';
tokenstream++;
skip_lt_change = true;
} else {
longtoken = !longtoken;
tokentypes[c] = ICONSOLE_VAR_STRING;
}
} else {
longtoken = !longtoken;
tokentypes[c] = ICONSOLE_VAR_STRING;
}
if (!skip_lt_change) {
if (!longtoken) {
if (valid_token) {
c++;
*tokenstream = '\0';
tokenstream++;
tokens[c] = tokenstream;
tokentypes[c] = ICONSOLE_VAR_UNKNOWN;
valid_token = false;
}
}
skip_lt_change=false;
}
} else if (!longtoken && cmdstr[i] == ' ') {
if (valid_token) {
c++;
*tokenstream = '\0';
tokenstream++;
tokens[c] = tokenstream;
tokentypes[c] = ICONSOLE_VAR_UNKNOWN;
valid_token = false;
}
} else {
valid_token = true;
*tokenstream = cmdstr[i];
tokenstream++;
}
i++;
}
tokenstream--;
if (*tokenstream != '\0') {
c++;
tokenstream++;
*tokenstream = '\0';
}
//** interpreting **//
for (i = 0; i < c; i++) {
if (tokens[i] != NULL && i > 0 && strlen(tokens[i]) > 0) {
if (IConsoleVarGet((char *)tokens[i]) != NULL) {
// change the variable to an pointer if execution_mode != 4 is
// being prepared. execution_mode 4 is used to assign
// one variables data to another one
// [token 0 and 2]
if (!((i == 2) && (tokentypes[1] == ICONSOLE_VAR_UNKNOWN) &&
(strcmp(tokens[1], "<<") == 0))) {
// only look for another variable if it isnt an longtoken == string with ""
var = NULL;
if (tokentypes[i]!=ICONSOLE_VAR_STRING) var = IConsoleVarGet(tokens[i]);
if (var != NULL) {
// pointer to the data --> token
tokens[i] = (char *) var->data.addr; /* XXX: maybe someone finds an cleaner way to do this */
tokentypes[i] = var->type;
}
}
}
if (tokens[i] != NULL && tokens[i][0] == '@' && (IConsoleVarGet(tokens[i]+1) != NULL)) {
var = IConsoleVarGet(tokens[i]+1);
if (var != NULL) {
// pointer to the _iconsole_var struct --> token
tokens[i] = (char *) var; /* XXX: maybe someone finds an cleaner way to do this */
tokentypes[i] = ICONSOLE_VAR_REFERENCE;
}
}
}
}
execution_mode=0;
function = NULL;
cmd = IConsoleCmdGet(tokens[0]);
if (cmd != NULL) {
function = cmd->addr;
} else {
alias = IConsoleAliasGet(tokens[0]);
if (alias != NULL) execution_mode = 5; // alias handling
}
if (function != NULL) {
execution_mode = 1; // this is a command
} else {
var = IConsoleVarGet(tokens[0]);
if (var != NULL) {
execution_mode = 2; // this is a variable
if (c > 2 && strcmp(tokens[1], "<<") == 0) {
// this is command to variable mode [normal]
function = NULL;
cmd = IConsoleCmdGet(tokens[2]);
if (cmd != NULL) function = cmd->addr;
if (function != NULL) {
execution_mode = 3;
} else {
result = IConsoleVarGet(tokens[2]);
if (result != NULL)
execution_mode = 4;
}
}
}
}
//** executing **//
if (_stdlib_con_developer)
IConsolePrintF(_iconsole_color_debug, "CONDEBUG: execution_mode: %i",
execution_mode);
switch (execution_mode) {
case 0:
// not found
IConsoleError("command or variable not found");
break;
case 1:
if (IConsoleCmdHookHandle(cmd, ICONSOLE_HOOK_ACCESS)) {
// execution with command syntax
IConsoleCmdHookHandle(cmd, ICONSOLE_HOOK_BEFORE_EXEC);
result = function(c, tokens, tokentypes);
if (result != NULL) {
IConsoleVarDump(result, "result");
IConsoleVarFree(result);
}
IConsoleCmdHookHandle(cmd, ICONSOLE_HOOK_AFTER_EXEC);
break;
}
case 2:
{
// execution with variable syntax
if (IConsoleVarHookHandle(var, ICONSOLE_HOOK_ACCESS) && (c == 2 || c == 3)) {
// ** variable modifications ** //
IConsoleVarHookHandle(var, ICONSOLE_HOOK_BEFORE_CHANGE);
switch (var->type) {
case ICONSOLE_VAR_BOOLEAN:
{
if (strcmp(tokens[1], "=") == 0) {
if (c == 3) {
*var->data.bool_ = (atoi(tokens[2]) != 0);
} else {
*var->data.bool_ = false;
}
IConsoleVarDump(var, NULL);
} else if (strcmp(tokens[1], "++") == 0) {
*var->data.bool_ = true;
IConsoleVarDump(var, NULL);
} else if (strcmp(tokens[1], "--") == 0) {
*var->data.bool_ = false;
IConsoleVarDump(var, NULL);
}
else
IConsoleError("operation not supported");
break;
}
case ICONSOLE_VAR_BYTE:
case ICONSOLE_VAR_UINT8:
{
if (strcmp(tokens[1], "=") == 0) {
if (c == 3)
*var->data.byte_ = atoi(tokens[2]);
else
*var->data.byte_ = 0;
IConsoleVarDump(var, NULL);
} else if (strcmp(tokens[1], "++") == 0) {
++*var->data.byte_;
IConsoleVarDump(var, NULL);
} else if (strcmp(tokens[1], "--")==0) {
--*var->data.byte_;
IConsoleVarDump(var, NULL);
}
else
IConsoleError("operation not supported");
break;
}
case ICONSOLE_VAR_UINT16:
{
if (strcmp(tokens[1], "=") == 0) {
if (c == 3)
*var->data.uint16_ = atoi(tokens[2]);
else
*var->data.uint16_ = 0;
IConsoleVarDump(var, NULL);
} else if (strcmp(tokens[1], "++") == 0) {
++*var->data.uint16_;
IConsoleVarDump(var, NULL);
} else if (strcmp(tokens[1], "--") == 0) {
--*var->data.uint16_;
IConsoleVarDump(var, NULL);
}
else
IConsoleError("operation not supported");
break;
}
case ICONSOLE_VAR_UINT32:
{
if (strcmp(tokens[1], "=") == 0) {
if (c == 3)
*var->data.uint32_ = atoi(tokens[2]);
else
*var->data.uint32_ = 0;
IConsoleVarDump(var, NULL);
} else if (strcmp(tokens[1], "++") == 0) {
++*var->data.uint32_;
IConsoleVarDump(var, NULL);
} else if (strcmp(tokens[1], "--") == 0) {
--*var->data.uint32_;
IConsoleVarDump(var, NULL);
}
else
IConsoleError("operation not supported");
break;
}
case ICONSOLE_VAR_INT16:
{
if (strcmp(tokens[1], "=") == 0) {
if (c == 3)
*var->data.int16_ = atoi(tokens[2]);
else
*var->data.int16_ = 0;
IConsoleVarDump(var, NULL);
} else if (strcmp(tokens[1], "++") == 0) {
++*var->data.int16_;
IConsoleVarDump(var, NULL);
} else if (strcmp(tokens[1], "--") == 0) {
--*var->data.int16_;
IConsoleVarDump(var, NULL);
}
else
IConsoleError("operation not supported");
break;
}
case ICONSOLE_VAR_INT32:
{
if (strcmp(tokens[1], "=") == 0) {
if (c == 3)
*var->data.int32_ = atoi(tokens[2]);
else
*var->data.int32_ = 0;
IConsoleVarDump(var, NULL);
} else if (strcmp(tokens[1], "++") == 0) {
++*var->data.int32_;
IConsoleVarDump(var, NULL);
} else if (strcmp(tokens[1], "--") == 0) {
--*var->data.int32_;
IConsoleVarDump(var, NULL);
}
else { IConsoleError("operation not supported"); }
break;
}
case ICONSOLE_VAR_STRING:
{
if (strcmp(tokens[1], "=") == 0) {
if (c == 3)
IConsoleVarSetString(var, tokens[2]);
else
IConsoleVarSetString(var, "");
IConsoleVarDump(var, NULL);
}
else
IConsoleError("operation not supported");
break;
}
case ICONSOLE_VAR_POINTER:
{
if (strcmp(tokens[1], "=") == 0) {
if (c == 3) {
if (tokentypes[2] == ICONSOLE_VAR_UNKNOWN)
var->data.addr = (void*)atoi(tokens[2]); /* direct access on memory [by address] */
else
var->data.addr = (void*)tokens[2]; /* direct acces on memory [by variable] */
} else
var->data.addr = NULL;
IConsoleVarDump(var, NULL);
} else if (strcmp(tokens[1], "++") == 0) {
++*(char*)&var->data.addr; /* change the address + 1 */
IConsoleVarDump(var, NULL);
} else if (strcmp(tokens[1], "--") == 0) {
--*(char*)&var->data.addr; /* change the address - 1 */
IConsoleVarDump(var, NULL);
}
else
IConsoleError("operation not supported");
break;
}
case ICONSOLE_VAR_NONE:
case ICONSOLE_VAR_REFERENCE:
case ICONSOLE_VAR_UNKNOWN:
IConsoleError("operation not supported");
break;
}
IConsoleVarHookHandle(var, ICONSOLE_HOOK_AFTER_CHANGE);
}
if (c == 1) // ** variable output ** //
IConsoleVarDump(var, NULL);
break;
}
case 3:
case 4:
{
// execute command with result or assign a variable
if (execution_mode == 3) {
if (IConsoleCmdHookHandle(cmd, ICONSOLE_HOOK_ACCESS)) {
int i;
int diff;
void* temp;
byte temp2;
// tokenshifting
for (diff = 0; diff < 2; diff++) {
temp = tokens[0];
temp2 = tokentypes[0];
for (i = 0; i < 19; i++) {
tokens[i] = tokens[i + 1];
tokentypes[i] = tokentypes[i + 1];
}
tokens[19] = temp;
tokentypes[19] = temp2;
}
IConsoleCmdHookHandle(cmd, ICONSOLE_HOOK_BEFORE_EXEC);
result = function(c, tokens, tokentypes);
IConsoleCmdHookHandle(cmd, ICONSOLE_HOOK_AFTER_EXEC);
} else
execution_mode = 255;
}
if (IConsoleVarHookHandle(var, ICONSOLE_HOOK_ACCESS) && result != NULL) {
if (result->type != var->type) {
IConsoleError("variable type missmatch");
} else {
IConsoleVarHookHandle(var, ICONSOLE_HOOK_BEFORE_CHANGE);
switch (result->type) {
case ICONSOLE_VAR_BOOLEAN:
*var->data.bool_ = *result->data.bool_;
IConsoleVarDump(var, NULL);
break;
case ICONSOLE_VAR_BYTE:
case ICONSOLE_VAR_UINT8:
*var->data.byte_ = *result->data.byte_;
IConsoleVarDump(var, NULL);
break;
case ICONSOLE_VAR_UINT16:
*var->data.uint16_ = *result->data.uint16_;
IConsoleVarDump(var, NULL);
break;
case ICONSOLE_VAR_UINT32:
*var->data.uint32_ = *result->data.uint32_;
IConsoleVarDump(var, NULL);
break;
case ICONSOLE_VAR_INT16:
*var->data.int16_ = *result->data.int16_;
IConsoleVarDump(var, NULL);
break;
case ICONSOLE_VAR_INT32:
*var->data.int32_ = *result->data.int32_;
IConsoleVarDump(var, NULL);
break;
case ICONSOLE_VAR_POINTER:
var->data.addr = result->data.addr;
IConsoleVarDump(var, NULL);
break;
case ICONSOLE_VAR_STRING:
IConsoleVarSetString(var, result->data.string_);
IConsoleVarDump(var, NULL);
break;
default:
IConsoleError("variable type missmatch");
break;
}
IConsoleVarHookHandle(var, ICONSOLE_HOOK_AFTER_CHANGE);
}
if (execution_mode == 3) {
IConsoleVarFree(result);
}
}
break;
}
case 5: {
// execute an alias
IConsoleAliasExec(alias->cmdline, tokens,tokentypes);
}
break;
default:
// execution mode invalid
IConsoleError("invalid execution mode");
break;
}
//** freeing the tokenstream **//
free(tokenstream_s);
}
#endif
|