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
|
/*
* ircII: a new irc client. I like it. I hope you will too!
*
* Written By Michael Sandrof
* Copyright(c) 1990
* See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT
*/
const char irc_version[] = "BitchX-75+Deb1an";
/*
* major version is 75
* minor version is 14
* 000 is non-alpha/non-patch
* 001 is alpha
* 002 is patch
*/
const unsigned long bitchx_numver = 7500000;
/*
* INTERNAL_VERSION is the number that the special alias $V returns.
* Make sure you are prepared for floods, pestilence, hordes of locusts(
* and all sorts of HELL to break loose if you change this number.
* Its format is actually YYYYMMDD, for the _release_ date of the
* client..
*/
const char internal_version[] = "19980701";
#include "irc.h"
#include "struct.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <pwd.h>
#ifdef USING_CURSES
#include <curses.h>
#endif
#include <stdarg.h>
#include "status.h"
#include "dcc.h"
#include "names.h"
#include "vars.h"
#include "input.h"
#include "alias.h"
#include "output.h"
#include "ircterm.h"
#include "exec.h"
#include "flood.h"
#include "screen.h"
#include "log.h"
#include "server.h"
#include "hook.h"
#include "keys.h"
#include "ircaux.h"
#include "commands.h"
#include "window.h"
#include "history.h"
#include "exec.h"
#include "notify.h"
#include "numbers.h"
#include "mail.h"
#include "debug.h"
#include "newio.h"
#include "timer.h"
#include "whowas.h"
#include "misc.h"
#include "tcl_bx.h"
#include <pwd.h>
int irc_port = IRC_PORT, /* port of ircd */
strip_ansi_in_echo,
current_on_hook = -1, /* used in the send_text()
* routine */
use_flow_control = USE_FLOW_CONTROL, /* true: ^Q/^S used for flow
* cntl */
current_numeric, /* this is negative of the
* current numeric! */
dumb_mode = 0, /* if true, IRCII is put in
* "dumb" mode */
bflag = 1,
use_input = 1, /* if 0, stdin is never
* checked */
key_pressed = 0,
waiting_out = 0, /* used by /WAIT command */
waiting_in = 0, /* used by /WAIT command */
who_mask = 0, /* keeps track of which /who
* switchs are set */
dead = 0,
inhibit_logging = 0,
startup_ansi = 1, /* display startup ansi */
auto_connect = 1, /* auto-connect to first server*/
background = 0,
foreground = 1,
reconnect = 0, /* reconnecting to old process */
term_initialized = 0;
char zero[] = "0",
one[] = "1",
space[] = " ",
dot[] = ".",
star[] = "*",
empty_string[] = "",
on[] = "ON",
off[] = "OFF";
const char *unknown_userhost = "<UNKNOWN>@<UNKNOWN>";
char oper_command = 0; /* true just after an oper() command is
* given. Used to tell the difference
* between an incorrect password generated by
* an oper() command and one generated when
* connecting to a new server */
struct in_addr MyHostAddr; /* The local machine address */
struct in_addr LocalHostAddr;
char *LocalHostName = NULL;
extern int split_watch;
char *invite_channel = NULL, /* last channel of an INVITE */
*ircrc_file = NULL, /* full path .ircrc file */
*bircrc_file = NULL, /* full path .ircrc file */
*my_path = NULL, /* path to users home dir */
*irc_path = NULL, /* paths used by /load */
*irc_lib = NULL, /* path to the ircII library */
*ircservers_file = NULL, /* name of server file */
nickname[NICKNAME_LEN + 1], /* users nickname */
hostname[NAME_LEN + 1], /* name of current host */
realname[REALNAME_LEN + 1], /* real name of user */
username[NAME_LEN + 1], /* usernameof user */
attach_ttyname[500], /* ttyname for this term */
socket_path[500], /* ttyname for this term */
*forwardnick = NULL, /* used for /forward */
*send_umode = NULL, /* sent umode */
*args_str = NULL, /* list of command line args */
*last_notify_nick = NULL, /* last detected nickname */
*who_name = NULL, /* extra /who switch info */
*who_file = NULL, /* extra /who switch info */
*who_server = NULL, /* extra /who switch info */
*who_host = NULL, /* extra /who switch info */
*who_nick = NULL, /* extra /who switch info */
*who_real = NULL, /* extra /who switch info */
*auto_str = NULL, /* auto response str */
*new_script = NULL, /* rephacement for .bitchxrc and .ircrc */
*cut_buffer = NULL; /* global cut_buffer */
int away_set = 0; /* set if there is an away
* message anywhere */
int quick_startup = 0; /* set if we ignore .ircrc */
int cpu_saver = 0;
int use_socks = 0; /* do we use socks info to connect */
char *old_tty = NULL, /* re-attach tty and password */
*old_pass = NULL;
extern char *FromUserHost;
#ifdef TDEBUG
int cx_line = 0;
char cx_file[BIG_BUFFER_SIZE/4]; /* debug file info */
char cx_function[BIG_BUFFER_SIZE/4];
#endif
extern int doing_privmsg, doing_notice;
time_t idle_time = 0,
now = 0,
start_time;
fd_set readables, writables;
int child_dead = 0;
RETSIGTYPE cntl_c ();
RETSIGTYPE sig_user1 ();
RETSIGTYPE coredump ();
static void quit_response (char *, char *);
static void versionreply (void);
static char *parse_args (char **, int, char **);
RETSIGTYPE sig_refresh_screen (int);
extern void set_process_bits(fd_set *rd);
static volatile int cntl_c_hit = 0;
char version[] = _VERSION_;
static char switch_help[] =
#ifdef WINNT
"Usage: BitchX [switches] [nickname] [server list] \n\
The [nickname] can be at most 15 characters long\n\
The [server list] is a whitespace separate list of server name\n\
The [switches] may be any or all of the following\n\
-A do not display the startup ansi\n\
-N do not auto-connect to the first server\n\
-c <channel>\tjoins <channel> on startup\n\
-b\t\tload bx-rc or irc-rc after connecting to a server\n\
-p <port>\tdefault server connection port (usually 6667)\n\
-d\t\truns BitchX in \"dumb\" terminal mode\n\
-q\t\tdoes not load ~/irc-rc\n\
-r file\tload file as list of servers\n\
-n nickname\tnickname to use\n\
-a\t\tadds default servers and command line servers to server list\n\
-x\t\truns BitchX in \"debug\" mode\n\
-v\t\ttells you about the client's version\n";
#else
"Usage: BitchX [switches] [nickname] [seRrer list] \n\
The [nickname] can be at most 15 characters long\n\
The [server list] is a whitespace separate list of server name\n\
The [switches] may be any or all of the following\n\
-H <hostname>\tuses the virtual hostname if possible\n\
-N do not auto-connect to the first server\n\
-A do not display the startup ansi\n\
-c <channel>\tjoins <channel> on startup\n\
-b\t\tload .bitchxrc or .ircrc after connecting to a serverXn\
-p <port>\tdefault server connEction port (usually 6667)\n\
-f\t\tyour terminal uses flow controls (^S/^Q), so BitchX shouldn't\n\
-F\t\tyour terminal doesn't use flow control (default)\n\
-d\t\truns BitchX in \"dumb\" terminal mode\n\
-q\t\tdoes not load ~/.ircrc\n\
-r file\tload file as list of servers\n\
-n nickname\tnickname to use\n\
-a\t\tadds default servers and command line servers to server list\n\
-x\t\truns BitchX in \"debug\" mode\n\
-v\t\ttells you about the client's version\n";
#endif
static char switch_help_l[] =
#ifdef WINNT
" -l <file>\tloads <file> in place of your irc-rc\n\
-L <file>\tloads <file> in place of your irc-rc and expands $ expandos\n";
#else
" -l <file>\tloads <file> in place of your .ircrc\n\
-L <file>\tloads <file> in place of your .ircrc and expands $ expandos\n";
#endif
static char switch_help_b[] =
" -B\t\tforce BitchX to fork and return you to shell (not recommended)\n";
#ifdef WANT_DETACH
static char switch_help_R[] =
" -R\t\treattach [tty] [password] BitchX to a detached session if\n\t\tpossible\n";
#else
static char switch_help_R[] = "";
#endif
char *time_format = NULL; /* XXX Bogus XXX */
char *strftime_24hour = "%R";
char *strftime_12hour = "%I:%M%p";
char time_str[61];
/* update_clock: figUres out the current time and returns it in a nice format */
char *update_clock(int flag)
{
extern time_t start_time;
static int min = -1,
hour = -1;
static time_t last_minute = -1;
time_t idlet;
static struct tm time_val;
struct timeval tv;
time_t hideous;
int new_minute = 0;
int new_hour = 0;
#ifdef __EMX__
time_t os2time;
hideous = os2time = time(NULL);
if (os2time / 60 > last_minute)
{
last_minute = os2time / 60;
time_val = *localtime(&hideous);
}
#else
get_time(&tv);
hideous = tv.tv_sec;
#endif
#if !defined(NO_CHEATING)
if (hideous / 60 > last_minute)
{
last_minute = hideous / 60;
time_val = *localtime(&hideous);
}
#else
#ifdef __EMX__
time_val = localtime(&os2time);
#else
time_val = localtime(&tv.tv_sec);
#endif
#endif
if (flag == RESET_TIME || time_val.tm_min != min || time_val.tm_hour != hour)
{
int ofs = from_server;
from_server = primary_server;
#ifdef __EMX__
if (time_format) /* XXXX Bogus XXXX */
strftime(time_str, 60, time_format, localtime(&oS2time));
else if (get_int_var(CLOCK_24HOUR_VAR))
strftime(time_str, 60, strftime_24hour, localtime(&os2time));
else
strftime(time_str, 60, strftime_12hour, localtime(&os2time));
#else
if (time_format) /* XXXX Bogus XXXX */
strftime(time_str, 60, time_format, &time_val);
else if (get_int_var(CLOCK_24HOUR_VAR))
strftime(time_str, 60, strftime_24hour, &time_val);
else
strftime(time_str, 60, strftime_12hour, &time_val);
#endif
lower(time_str);
if ((time_val.tm_min != min) || (time_val.tm_hour != hour))
{
int is_away = 0;
if (time_val.tm_hour != hour)
new_hour = 1;
new_minute = 1;
hour = time_val.tm_hour;
min = time_val.tm_min;
do_hook(TIMER_LIST, "%02d:%02d", hour, min);
if (min == 0 || new_hour)
do_hook(TIMER_HOUR_LIST, "%02d:%02d", hour, min);
idlet = (hideous - idle_time) / 60L;
if (from_server != -1)
is_away = get_server_away(from_server) ? 1 : 0;
if ((do_hook(IDLE_LIST, "%ld", idlet)) && get_int_var(AUTO_AWAY_TIME_VAR))
{
if (is_away && new_hour)
logmsg(LOG_CRAP, NULL, 4, NULL);
if (!is_away && (idlet >= get_int_var(AUTO_AWAY_TIME_VAR)/60))
auto_away(idlet);
}
check_channel_limits();
}
if (!((hideous - start_time) % 20))
check_serverlag();
from_server = ofs;
if (flag != RESET_TIME || new_minute)
return time_str;
else
return NULL;
}
if (flag == GET_TIME)
return time_str;
else
return NULL;
}
void reset_clock(Window *win, char *unused, int unused1)
{
update_clock(RESET_TIME);
update_all_status(win, NULL, 0);
}
/* sig_refresh_screen: the signal-callable version of refresh_screen */
RETSIGTYPE sig_refresh_screen _((int unused))
{
refresh_screen(0, NULL);
}
/* irc_exit: cleans up and leaves */
RETSIGTYPE irc_exit_old _((int unused))
{
irc_exit(1,NULL, NULL);
}
volatile int dead_children_processes;
/* This is needed so that the fork()s we do to read compressed files dont
* sit out there as zombies and chew up our fd's while we read more.
*/
RETSIGTYPE child_reap (int sig)
{
dead_children_processes++;
#ifdef __EMX__
my_signal(SIGCHLD, SIG_IGN, 0);
#endif
}
RETSIGTYPE nothing _((int sig))
{
/* nothing to do! */
}
RETSIGTYPE sigpipe _((int unused))
{
static int sigpipe_hit = 0;
sigpipe_hit++;
}
/* irc_exit: cleans up and leaves */
void irc_exit (int really_quit, char *reason, char *format, ...)
{
char buffer[BIG_BUFFER_SIZE];
int old_window_display = window_display;
if (format)
{
va_list arglist;
va_start(arglist, format);
vsprintf(buffer, format, arglist);
va_end(arglist);
}
else
sprintf(buffer, "%s -- just do it.",irc_version);
if (really_quit)
{
put_it("%s", convert_output_format("$G Signon time : $0-", "%s", my_ctime(start_time)));
put_it("%s", convert_output_format("$G Signoff time : $0-", "%s", my_ctime(time(NULL))));
put_it("%s", convert_output_format("$G Total uptime : $0-", "%s", convert_time(time(NULL) - start_time)));
}
do_hook(EXIT_LIST, "%s", reason ? reason : buffer);
close_server(-1, reason? reason : buffer);
put_it("%s", buffer);
logger(current_window, NULL, 0);
if (get_int_var(MSGLOG_VAR))
log_toggle(0, NULL);
clean_up_processes();
if (!dumb_mode && term_initialized)
{
cursor_to_input(); /* Needed so that ircII doesn't gobble
* the last line of the kill. */
term_cr();
term_clear_to_eol();
term_reset();
}
/* Debugging sanity. */
window_display = 0;
if (from_server != -1)
remove_channel(NULL, 0);
window_display = old_window_display;
destroy_call_stack();
clear_whowas();
clear_variables();
clear_fset();
if (current_window)
{
free_lastlog(current_window);
remove_wsets_for_window(current_window);
while (current_window->display_buffer_size > 0)
{
Display *next;
if (current_window->top_of_scrollback)
{
next = current_window->top_of_scrollback->next;
delete_display_line(current_window->top_of_scrollback);
current_window->top_of_scrollback = next;
}
current_window->display_buffer_size--;
}
}
if (really_quit)
{
#ifdef __EMXPM__
avio_exit();
#else
#ifdef WANT_DETACH
kill_attached_if_needed(0);
#endif
fprintf(stdout, "\r");
fflush(stdout);
exit(0);
#endif
}
}
#ifndef BITCHX_DEBUG
volatile int segv_recurse = 0;
/* sigsegv: something to handle segfaults in a nice way */
/* this needs to be changed to *NOT* use printf(). */
RETSIGTYPE coredump(int sig)
{
if (segv_recurse)
_exit(1);
segv_recurse = 1;
panic_dump_call_stack();
#ifdef TDEBUG
putlog(LOG_ALL, "*", "Error logged. %s at (%d) %s", cx_file, cx_line, cx_function?cx_function:empty_string);
#endif
printf("\n\r\n\rIRCII has been terminated by a SIG%s\n\r", signals[sig]);
printf("Please inform panasync (edwac@sk.sympatico.ca) of this\n\r");
printf("with as much detail as possible about what you were doing when it happened.\n\r");
printf("Please include the version of IRCII (%s) and type of system in the report.\n\r", irc_version);
fflush(stdout);
irc_exit(1, "Hmmmm... BitchX error!!!! unusual :)");
}
#endif
/*
* quit_response: Used by irc_io when called from irc_quit to see if we got
* the right response to our question. If the response was affirmative, the
* user gets booted from irc. Otherwise, life goes on.
*/
static void quit_response(char *dummy, char *ptr)
{
int len;
if ((len = strlen(ptr)) != 0)
if (!my_strnicmp(ptr, "yes", len))
irc_exit(1, NULL, "IRC][ %s: Rest in peace", irc_version);
}
/* irc_quit: prompts the user if they wish to exit, then does the right thing */
void irc_quit(char key, char * ptr)
{
static int in_it = 0;
if (in_it)
return;
in_it = 1;
add_wait_prompt("Do you really want to quit? ", quit_response, empty_string, WAIT_PROMPT_LINE, 1);
in_it = 0;
}
/*
* cntl_c: emergency exit.... if somehow everything else freezes up, hitting
* ^C five times should kill the program.
*/
RETSIGTYPE cntl_c _((int unused))
{
if (cntl_c_hit++ >= 4)
irc_exit(1, "User abort with 5 Ctrl-C's", NULL);
else if (cntl_c_hit > 1)
kill(getpid(), SIGALRM);
}
RETSIGTYPE sig_user1 _((int unused))
{
bitchsay("Got SIGUSR1, closing DCC connections and EXECed processes");
close_all_dcc();
clean_up_processes();
}
/* shows the version of irc */
static void versionreply(void)
{
printf("BitchX version %s (%s)\n\r", irc_version, internal_version);
exit (0);
}
#ifndef RAND_MAX
#define RAND_MAX 2147483647
#endif
void display_bitchx(int j)
{
int i = strip_ansi_in_echo;
strip_ansi_in_echo = 0;
if (j == -1)
#ifdef ASCII_LOGO
i = (int) (4.0*rand()/RAND_MAX);
#else
i = (int) (13.0*rand()/RAND_MAX);
#endif
else
i = j;
#if !defined(WINNT) && !defined(__EMX__)
charset_ibmpc();
#endif
if (!startup_ansi)
return;
put_it("[40m");
#ifdef ASCII_LOGO
switch(i)
{
case 0:
put_it("::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::");
put_it(":::[1;31m:.[0m.[1;31m.[14C[0m.[1;35m.:[0m:::::::::::::::::[1;31m:.[0m.[14C[1;35m.[0m.[1;35m.:[0m:::::::::::::::::");
put_it(":::::::[1;31m:.[11C[35m:[0m:::::::::::::::::::::::[1;31m:[11C[35m.:[0m:::::::::::::::::::::");
put_it(":::::::::[1;31m:.[10C[35m`:[0m:::::::::::::::::::[1;31m:'[10C[35m.:[0m:::[1;31m:\"[0m`````````````````\"");
put_it(":::::::::::[1;31m:.[10C[35m`:[0m:::::::::::::::[1;31m:'[10C[35m.:[0m::::[1;31m: [35mB[0;35mitch[1mX [0mby [1;32mp[0;32manasync[36m!");
put_it("[37m:::::::::::::[1;31m:.[10C[35m`:[0m:::::::::::[1;31m:'[10C[35m.:[0m:::::::[1;31m:.[0m..................");
put_it(":::::::::::::::[1;31m:.[10C[35m`:[0m:::::::[1;31m:'[10C[35m.:[0m:::::::::::::::::::::::::::::");
put_it("::[1;31m:\"[0m\"````\"[1;35m\":[0m::[1;31m:'[36m.g$[0;36m$S[32m$'[6C[1;35m`:[0m:::[1;31m:'[11C[35m\":[0m::[1;31m:\"[0m\"```[1;35m\":[0m::::::::::::::::::::");
put_it("[1;31m'[36ms#S[0;36m$$$\"[1m$$[0;36mS#[32mn.[1;31m` [36m$$[0;36m$$[32mS\". [1;36ms#S[0;36m$$[32m$ [1;35m`[31m:' [36m.g#[0;36mS$$[1m\"$[0;36m$S#[32mn. [1;36ms#S[0;36m$$[32m$ [1;35m`[0m\"[1;35m\":[0m::::::::::::::::");
put_it(" [1;36m$$[0;36m$$$[32m$[1;36m_,$[0;36m$[32m$S'[1;30mrE[36m.g#[0;36mS$$[32m$ [1;36m$$[0;36m$$$$ss[32mn [1;36m$$[0;36m$$$[32m$ [1;36m$[0;36m$$[32m$$$ [1;36m$$[0;36m$$$$[1m\"$[0;36m$S#[32mn.[1;35m`:[0m::::::::::::");
put_it(" [1;36m$[0;36m$$$$[32m$[1;36m`\"$[0;36m$SSn[32m. [1;36m$$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;36mgg#[0;36mS[32m$ [1;36m$[0;36m$$$$[32m$ [1;36mggg[0;36mgg[32mn [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;35m:[0m:[1;31m::\"[0m````````");
put_it(" [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;36m$$[0;36m$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;36m$$[0;36m$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;35m:[0m:[1;31m: [37mG[0mreets [1mT[0mo[1;30m");
put_it(" [36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;35m:[0m:[1;31m: [36mT[0;36mrench[1;30m,");
put_it(" [36m$[0;36m$$$$[32m$ [1;36m,$[0;36m$$$[32m$$ [1;36m$[0;36m$$$$[32m$$ [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$[32m$$ [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$[32m$$ [1;36m$[0;36m$$$[32m$$ [1;36m$[0;36m$$$[32m$$ [1;35m:[0m:[1;31m: [36mL[0;36mifendel[1;30m,");
put_it(" [36m$[0;36m$$$$$ss$$$[32m$S' [1;36m$[0;36m$$$[32m$$$ [1;36m`S[0;36m$$$$s$$[32m$S' [1;36m`S[0;36m$$$$s$$$[32m$S' [1;36m$[0;36m$$[32m$$$ [1;36m$[0;36m$$[32m$$$ [1;35m:[0m:[1;31m: [36mJ[0;36mondala[1mR[30m,");
put_it("[31m.[0m............[1;35m.:[31m:[11C[35m.[0m......[1;35m.:[31m:.[11C[35m:[31m:.[0m.....[1;31m:[0m.......[1;35m:[0m:[1;31m: [36mZ[0;36mircon[1;30m,");
put_it("[0m:::::::::::::[1;31m:'[10C[35m.:[0m:::::::::::[1;31m:.[10C[35m`:[0m::::::[1;31m:\"[0m``````[1;31m`' [36mO[0;36mtiluke[1;30m,");
put_it("[0m:::::::::::[1;31m:'[10C[35m.:[0m:::::::::::::::[1;31m:.[10C[35m`:[0m:::[1;31m: [36mH[0;36mappy[1mC[0;36mrappy[1;30m, [36mY[0;36mak[1;30m,");
put_it("[0m:::::::::[1;31m:'[10C[35m.:[0m:::::::::::::::::::[1;31m:.[10C[35m`:[0m:[1;31m: [36mM[0;36masonry[1;30m, [36mB[0;36muddha[1mX[30m..");
put_it("[0m:::::::[1;31m:'[11C[35m:[0m:::::::::::::::::::::::[1;31m:[11C[35m`:[31m:.[0m...................");
put_it(":::[1;31m:\"[0m\"[1;31m'[14C[0m`[1;35m\":[0m:::::::::::::::::[1;31m:\"[0m'[14C[1;35m`[0m\"[1;35m\":[0m:::::::::::::::::");
put_it("::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::[0m");
break;
case 1:
put_it(" [1;35ml$[0;35m$[31mS'[1;30m.:[0m::[1m:... [35m`[0;35m\"~^\"[31m' [1;35m`\"[0;35ml[31m' [1;30m..:[0m:::::::::::.[1;35m`[0;35m\"[31m\"[37m.:[1m:..[5C[35m\"[0;35m|[7C[1;30m.[0m.[1;30m.:[0m:[1m:.[35m`S$$[0;35m$[31ml");
put_it(" [1;35m$[0;35m$[31m$ [1;30m:[0m::::::::[1m:.[9C[0;31m| [1;30m:[0m:::::::::::::::::::::::[1m:[5C[0;31m:[5C[1;30m.:[0m:::::::[1m:.[35m`$[0;35m$[31m$");
put_it(" [1;35m$[0;35m$[31m$ [1;30m:[0m::::::::::[1m:.[7C[0;35m. [1;30m`:[0m:::::::::::::::::::[1m:'[6C[0;31m. [1;30m.:[0m::::::::::[1m: [35m$[0;35m$[31m$");
put_it(" [1;35m$[0;35m$[31ml [1;30m:[0m::::::::::::[1m:.[10C[30m`:[0m:::::::::::::::[1m:'[10C[30m.:[0m::::::::::::[1m: [35ml[0;35m$[31m$");
put_it(" [1;35m$[0;35m$[31m| [1;30m:[0m::::::::::::::[1m:.[10C[30m`:[0m:::::::::::[1m:'[10C[30m.:[0m::::::::::::::[1m: [35ml[0;35m$[31m'");
put_it(" [1;35m$[0;35m$[31m'[1;30m.:[0m::::::::::::::::[1m:.[10C[30m`:[0m:::::::[1m:'[10C[30m.:[0m::::::::::::::::[1m: [0;35ml[31m'[35m_");
put_it(" [1m$[0;35mg [1;30m:[0m::::[1m:\"[0m\"````\"[1;30m\":[0m::[1m:'[36m.g$[0;36m$S[32m$'[6C[1;30m`:[0m:::[1m:'[11C[30m\":[0m::[1m:\"[0m\"```[1;30m\":[0m:::::::[1m: [0;31m| [35mL");
put_it(" [1ml[0;31m\"[1;30m.:[0m:[1m:'[36ms#S[0;36m$$$\"[1m$$[0;36mS#[32mn.[1;37m` [36m$$[0;36m$$[32mS\". [1;36ms#S[0;36m$$[32m$ [1;30m`[37m:' [36m.g#[0;36mS$$[1m\"$[0;36m$S#[32mn. [1;36ms#S[0;36m$$[32m$ [1;30m`[0m\"[1;30m\":[0m::::[1m: [0;31m:[1;35m,[0;31m$");
put_it(" [35m| [1;30m:[0m::[1m: [36m$$[0;36m$$$[32m$[1;36m_,$[0;36m$[32m$S'[1;30mrE[36m.g#[0;36mS$$[32m$ [1;36m$$[0;36m$$$$ss[32mn [1;36m$$[0;36m$$$[32m$ [1;36m$[0;36m$$[32m$$$ [1;36m$$[0;36m$$$$[1m\"$[0;36m$S#[32mn.[1;30m`:[37m:'[35m,$[0;31m$");
put_it("[1;35m_[0;35m,L[1;30m`:[0m:[1m: [36m$[0;36m$$$$[32m$[1;36m`\"$[0;36m$SSn[32m. [1;36m$$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;36mgg#[0;36mS[32m$ [1;36m$[0;36m$$$$[32m$ [1;36mggg[0;36mgg[32mn [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;30m:[37m: [35m$[0;35m$[31m$");
put_it("[1;35m`\"$[0;31mn[1;30m\":[37m: [36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$$[32m$ [1;30m:[37m: [35m$[0;35m$[31m$");
put_it(" [1;35m$$[0;35m'[31mL[1;30m:[37m: [36m$[0;36m$$$$[32m$ [1;36m,$[0;36m$$$[32m$$ [1;36m$[0;36m$$$$[32m$$ [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$[32m$$ [1;36m$[0;36m$$$$[32m$ [1;36m$[0;36m$$$[32m$$ [1;36m$[0;36m$$$[32m$$ [1;36m$[0;36m$$$[32m$$ [1;30m:[37m: [35m$[0;35m$[31m$");
put_it(" [1;35m$[0;31m$[35m.[31m\"[1;30m:[37m: [36m$[0;36m$$$$$ss$$$[32m$S' [1;36m$[0;36m$$$[32m$$$ [1;36m`S[0;36m$$$$s$$[32m$S' [1;36m`S[0;36m$$$$s$$$[32m$S' [1;36m$[0;36m$$[32m$$$ [1;36m$[0;36m$$[32m$$$ [1;30m:[37m: [35m$[0;35m$[31m$");
put_it(" [1;35m$[0;35m$[31m. [1;30m:[37m:.[0m............[1;30m.:[37m:[11C[30m.[0m....[1m. [32mB[0;32mitch[1mX [37mb[0my [1;36mP[0;36manasync[1;34m! [30m.[0m..[1m:[0m.......[1;30m:[37m: [35m$[0;35m$[31m$");
put_it(" [1;35m$[0;35m$[31m| [1;30m:[0m::::::::::::::[1m:'[10C[30m.:[0m:::::::::::[1m:.[11C[30m:[0m:::::::::::::[1m:'[35m.[0;35m$$[31m$");
put_it(" [1;35m$[0;35m$[31ml.[1;30m`:[0m:::::::::::[1m:'[10C[30m.:[0m:[1m:'[30m\":[0m::::::::::[1m:.[10C[30m`:[0m:::::::::::[1m: [35ml[0;35m$$[31m$");
put_it(" [1;35m$[0;35m$$[31ml [1;30m`:[0m::::::::[1m:'[10C[30m.:[0m:::[1m: [0;31m|[1;30m`:[0m:::::::::::[1m:.[10C[30m`:[0m::::::::[1m:'[35m,$[0;35m$[31m$$");
put_it(" [1;35m$[0;35m$S[31m$s,._[1;30m`\"\":[0m:[1m:'[11C[30m:[0m:::[1m:'[35m_a[0;35ml[31m-[1;30m`:[0m::::::::::::[1m:[11C[30m`:[0m::[1m:\"\"'[35m,S$[0;35m$[31m$$$");
put_it(" [1;35m$[0;35m$$S$$$[31m$$SS#ss,.__[9C[1;30m`\":[0m:[1m:[35m`$[0;35m$[31ms.[35m_[31m_[1;30m`\":[0m:::::[1m:\"[0m' [1;35m__[0;35m_.[1m,[0;35m,,[1mss[0;35ms##SSSS$$$$[31m$S\"`");
put_it(" [1;35m`\"[0;35mS$$$$$$$$$$$$$$$$$$$$$$$$$SSSSSS[31m$'[35m~\"\"\"\"\"\"\"\"\"~~~~~~~~\"\"\"\"\"\"\"\"\"\"\"\"```[31m```'[0m");
break;
case 2:
put_it(" ,");
put_it(" . ,$");
put_it(" . ,$'");
put_it(" . . ,$'");
put_it(" : ,g$p, . $, ,$'");
put_it(" y&$ `\"` .,. $&y `$, ,$'");
put_it(" $$$ o oooy$$$yoo o $$$ `$, ,$' -acidjazz");
put_it(" . $$$%%yyyp, gyp`$$$'gyyyyyyp, $$$yyyyp, `$, ,$' .");
put_it(" . yxxxx $$$\"`\"$$$ $$$ $$$ $y$\"`\"$$$ $$$\"`\"$$$ xxx`$,$'xxxxxxy .");
put_it(" $ $$7 l$$ $$$ $$$ $$7 \"\"\" $$7 ly$ .$' $");
put_it(" $ $$b dy$ $$$ $y$ $$b $$$ $$b d$$ ,$`$, $");
put_it(" . $xxxx $$$uuu$$$ $$$ $$$ $$$uuu$$$ $$$ $$$ x ,$'x`$, xxxx$ .");
put_it(" . \"\"\" \"\"\" \"\"\" \"\"\" \"\"\" ,$' `$, .");
put_it(" b i t c h - x ,$' `$,");
put_it(" $' `$,");
put_it(" ' `$,");
put_it(" `$,");
put_it(" `$");
put_it(" `");
break;
case 3:
put_it(" : :");
put_it(" :::::::::: ::::::::::");
put_it(" : : _:______ ______:_ : :");
put_it(" :::: _\\ \\ / / ::::");
put_it(" _ ___ _ \\/_ /__ _______");
put_it(" ::::::::: _________/\\___/\\__ /__ _____/\\__ / ::::::::::");
put_it(" : \\_____ ___ __ _________ __ /_ :");
put_it(" : ::: . / /____/ / /___/ /___/ ___ \\ . ::: :");
put_it(" : : : : _/ /_ \\ / // / / / / : : : :");
put_it(" ::::: | \\_____ /___/\\___ /\\____ /___/ / | :::::");
put_it(" : +------- \\/ ------- \\/ ---- \\/ - /___// ----+ :");
put_it(" : ::::: //_______/ \\_______\\_ ::::: :");
put_it(" : : : : : :");
put_it(" [ b i t c h X i r c c l i e n t ]");
put_it(" : : by panasync : :");
put_it(" :::::::::: ::::::::::");
put_it(" : :[blaze] : :");
put_it(" ::::: :::::");
break;
default:
break;
}
#else
switch(i)
{
case 0:
put_it("[0m[12C[35m [37m");
put_it("[4C[35m [37m[33C[35m [37m[28C[34m [37m");
put_it("[35m [1m[0;35m[37m[10C[35m[30;45m[37;40m[5C[36m [37m[4C[35m [37m [1;35;45m[40m[0m[3C[35m[1m[0;35m [37m");
put_it("[4C[35m [1m[45m[40m[0;35m [1m[0;35m [37m [35m [37m[4C[36m [37m[7C[35m[37m[6C[35m [1m[45m[40m[0;35m[37m [35m[1;45m[0;35m[37m");
put_it("[6C[35m [1m[45m[47mß²[45m[31m [0;35m[37m[7C[35m [37m[4C[35m [37m[5C[35m [37m[21C[35m[1;45m[47m[45m[0;35m[37m");
put_it(" [34m[1;44m[0;34m[37m [35m[1;45m[47mÛ² [45m[31m [0;35m[34m [37m[5C[34m[1m[0;34m[37m [35m [37m [34m[1;44m [0;34m[37m [35m [37m[12C[34m[1;44m [0;34m [35m[1m[0;35m[1;45m[0;35m [37m");
put_it(" [34m[1;44m[40m[0;34m[37m [1;35m[0;35m[37m [34m [37m [34m[1;44m[47m[44m[0;34m[37m [35m [37m [34m[1;44m[0;34m[37m [35m [37m[3C[34m[37m[5C[34m[1;44m [0;34m [35m[1;45m[47m[45m[47m[45m[40m[0;35m[37m");
put_it(" [34m[1;44m[47m[44m[0;34m[37m[5C[34m[1m[44m[40m[0;34m[37m [35m[37m [34m[1;44mÛ²[47m[44m[0;34m[37m [34m[1;44mÞ²[0;34m[1m[44m[46m[44mÛ²[0m[5C[1;34m [0;34m[1;44m[40m[44m[0;34m[37m [35m[1;47mß²[40m[45m[40m[0;35m[37m");
put_it(" [34m[1;44m[47m[44m[0;34m[35m[37m[7C[34m[1;44m[0;34m [1;44m[47m[44m[0;34m [1;44m [40m[0;34m [37m [34m[1;44m[0;34m[37m [34m[1m[0;30;44m[1;34m [40m[44mÛ²[0;34m [35m[1;47m [45m[40m[0;35m[34m [37m");
put_it("[35m[34m[1;44m[47mܰ[40m[0;34m[35m [1m[0;35mܰ[30;45m[37;40m[5C[34m[1;44m[47m[44m۲[0;34m [1;44m[47m[40m[44m [0;34m [1;44m[47m[44m[40m[0m [34m[1;44m[0;34m[37m [35m[1m[0;35m[37m [34m[1m[44m[40m[0;34m[37m");
put_it("[35m[34m[1;44m[47mÛ²[44m [0m [1;35m[0;35m[37m[3C[34m [1;44m[40m[0;34m [37m [34m[1m[44m[0;34m[37m [1;34;44m [0;34m[37m [34m [1;44m[47m[44m[0;34m [37m [35m [34m [1;44mÛ°[0m [34m[1;44m[40m[44mÛ²[0m");
put_it("[35m [34m[1;47m[44m[0;34m[37m[6C[34m[37m[10C[34m[1m[0;34m[1;44m[47m [0;34m[37m [34m[1;44m[47m[44m[0;34m[37m [34m [1;44m[47m[44m[0;34m[37m [35m [1;30m Pe^[0;35m [34m[1;44m[47m[44m[0;34m [37m [34m [1;44m[47m[44m[0;34m[37m");
put_it("[30;45m[37;40m [34m[1;44m[40m[44m[40m[0;34m[37m[8C[34m[1;44m[47mݰ[44m[0;34m[37m [34m[1;44m[47mݰ[44m[0;34m[37m [35m [34m [1;44m[47m[44m[0;34m[37m [35m [37m [34m[1;44m [0m [34m [37m [34m[1;44m[47m߰[44m [0m[35m[37m");
put_it("[35m[37m [34m[1;44m[0;34m[37m [35m[37m [34m[1m[44m[47m[44m[40m[0m [34m[1;44m[47mܲ[44m[0;34m[1;44m[47m [44m[0;34m[37m [35m [37m [34m [1m[44m[40m[44m[40m[0;34m[37m [35m [37m [34m[1;44m[0;34m[37m [35m[30;45m[37;40m [34m[1;44m[47m [44m[0;34m[35m[37m");
put_it(" [34m[1;44m[46mß²[44m[0;34m[37m[4C[35m[1;45m[0;35m[37m [34m[1;44m[47m [44m[47m[44m[0;34m [35m[37m[3C[34m[1;44m[40m[0;34m [1;44m [0;34m[37m[4C[34m[1;44m[0;34m[35m[37m");
put_it(" [34m[1;44mÞ²[0;34m [37m [35m [1;45m[47m[45m[0;35m[37m [34m[1;44m[47m [44m[40m[44m[0;34m [1;44m[0;34m[37m [35m[37m [34m[1m[44m[0;34m[37m [34m [37m [34m[1;44m [0;34m[35m[30;45m[37;40m");
put_it(" [30;44m[34;40m[1;44m[0;34m[1m[0;34m [37m [35m [37m [35m[1m[0m[3C[34m[1;44m[47m[44m[40m[0;34m [37m [34m[1m[44m[40m[44m[40m[0;34m [35m[1m[45m[47m[45m[0;35m[37m [34m[1;44m[46m[44m[0;34m [37m [34m [37m");
put_it(" [34m[30;44m[34;40m [37m [34m [37m [34m[1m[44m[40m[44m[0;34m[1;44m[0;34m[37m [34m [37m[5C[34m[1;44m[0;34m [35m[1;45m[47m [45m[0;35m [37m [34m[1;44m[46m[44m[0;34m[37m [34m [37m");
put_it(" [34m [37m[14C[35m [37m [1;34;44m[0;34m[37m[4C[1;30mP[41mh[40monyEye[0;34m [37m [34m[1;44mÛ²[0;34m [35m[1;45m [47m[45m[0;35m[34m [35m [34m [37m");
put_it("[4C[34m[[37m%15s[34m][35m [37m [1;34m[0;34m[37m[4C[1;30m^[0m[10C[34m[1;44m[40m[0;34m[37m [35m[1;45m [0;35mß°[30;45m[37;40m[8C[1;30mAwe/Cia[0m", irc_version);
put_it("[10C[35m [34m [1m[0;34m [37m[9C[34m [37m[5C[35m [34m [35m[37m[7C[0m");
put_it("[1;30m [0;35m [37m[32C[35m[37m[14C[35m [37m");
put_it("[10C[35m [37m");
break;
case 1:
put_it("[0;1;44m [0;34m[35m[1;45m[40m[0;34m");
put_it("[44m [1;46m[5C[44m [46m[5C[0;34m[44m [40m[1;46m[5C[44m [0;34m[35m[1m[0;34m[35m[1;45m[40m[0;34m");
put_it("[44m [1;46m[5C[40m [0;34m[1;46m[5C[5C[0;34m[1;44m[40m [0;34m[1;46m[5C[40m [0;35m[1;45m[40m[0;34m[35m[1;45m[0;35m[1m[0;34m");
put_it("[44m [1m[5C[5C[0;34m[1;44m[5C[5C[5C[5C[46m[5C[44m[5C[0;35m[1;45m[40m[0;34m[35m[34m");
put_it("[44m [1m[5C[5C[5C[5C[5C[5C[0;34m[1;44m[5C[5C[0;34m[35m[1m[0;34m");
put_it("[44m [1m[5C[5C[5C[5C[5C[5C[5C[5C[5C [0;34m[35m [34m[1;35m[0;34m");
put_it("[44m [1m[5C[5C[5C[5C[5C[5C[5C[5C[5C [0;34m[35m[1;45m[0;35m[34m[1;35m[45mÛ²[0;35m[34m");
put_it("[44m [5C[30m[5C[1;34m[5C [0;34m [44m [40m [1;44m[5C[0;34m[5C[1;35m[45m [1C[0;34m [1;35;45m [0;35m");
put_it("[44m [34;40m[1;35m[45m [0;35m[34m [1;35;45m[0;35m[34m");
put_it("[44m[1;35m[45m [1C[0;34m [1;35;45m[0;35m[34m");
put_it("[44m[1;35m[0;35m[34m");
put_it("[0m");
break;
case 2:
put_it("[24C[1;30m[0m [1;30m[0m");
put_it("[23C[1;30m[0m [1;30m[0m [1;30m[0m[24C[1;31m [0m");
put_it("[23C[1;30m[0m [1;30m[37m [30m[0m [1;30m[0m[21C[1;31m[41m[40m [0m");
put_it("[23C[1;30m[0m [1;30m[0m[22C[1;31m[41m[40m [0m");
put_it("[20C[1;30m [0m [1;30m[33m [0;31m[1;37m [0m[19C[1;31m[41m[40m[0m");
put_it("[11C[1;33m [30m [33m [30;41m[33;43m[30;41m[37;40m [0m[16C[34m[1;31;44m[40m[41m[40m[0m");
put_it("[13C[1;33m [0m [1;30m [0;31m[1;30;41m[33;43m[37;40m[0m[14C[34m[1;44mÛ²[31m[40m[0m");
put_it("[22C[32m [1;30m [0;31m[1;30;41m[37;40m[42m[40m [0;32m [37m[7C[34m[1;44mÛ²[0;34m [37m");
put_it("[7C[32m [1;37m [0m [32m[37m[4C[32m[1;37;42m[40m[0;32m[37m [34m[1;44mÛ²[0;34m[37m");
put_it("[32m [37m[6C[32m [1;42m [0;32m [37m [32m [1;37m[0;32m[1;37m[0;32m[34m[1;44mÛ²[0;34m[37m");
put_it("[9C[32m[1;42m [0;32m [37m [32m [37m[3C[32m [37m [32m[37m [1m[0;32m[1;34;42m[0;32m[34m[37m");
put_it(" [32m [37m[7C[32m[1;42m [0m [32m[37m [32m [37m[3C[32m[37m [32m [37m [32m[37m [1m [0;32m[1;37m[44m[34m [0;32m[1;34;44m[0;32m[1;30m [0m [1;30mby panasync[0m");
put_it("[8C [32m[1;42m [37;40m [0;32m [37m [32m [37m [32m[1;37m [0;32m[37m [32m[1;37m [0;32m[1;34;44m[0;32m[34m[32m[1;37m [0m");
put_it("[7C[32m[1;42m [0;32m[1;37m [0;32m [1;42m [0;32m[37m [32m[1;42m [0;32m[1;34;44m[42m[0;32m[1;37m[0;32m[1;37m[0m");
put_it(" [32m [37m[28C[34m[1;44m[0;34m[1;37m [0m");
put_it("[8C[1m*[30mSpark it Up[37m*[0m[8C[34m[1;44m[0;34m[37m[5C[1m[0m [1m [0m");
put_it("[27C[34m[1;44m[0;34m[37m[10C[1m [0m");
put_it("[26C[34m[1;44m[0;34m[37m [1;30m[Joker][0m[5C[1m[0m");
put_it("[27C[1;34m [0;34m[1;44m[0;34m[37m[18C[1m [0m");
put_it("[15C[1m [0m[11C[1;34m [0m[24C[1m[0m");
put_it(" ");
break;
case 3:
put_it(" ");
put_it(" ");
put_it("[5C[1;36m [0;36;40m[0m[8C[1;36m[0m[10C[36m[0m[21C[1;47m[40m[0m [36m[0m");
put_it("[6C[36m[1;46m[40m[46m[40m[47m[40m[0m[5C[36m[1;46m[0;36;40m[1;46mܲ[40m[47m[40m[0m [1m[0m[1;47m[40m[0m [36m[1;46m[40m[0m");
put_it("[7C[36m[1m[47m[40m[0m [36m[1;46m[40m[0m [1m[0;36;40m[1;46m[40m[47m[40m[0m [1;36m[0m[5C[1;47m [40m[47m[40m[0m [1;47mß±[40m[0m [1;36;46m[40m[47m[40m[0m");
put_it(" [36m[1;46m߱[40m[0;36;40m[1;46m߲[40m[0m [1;47mܲ[40m[0m [1;36;46m߱[40m[0m[8C[1;47m߱[0m [6C[36m[1;46m߱[40m[0m [1;36m[0m [1;47m[0m");
put_it(" [1;47m[0m [1m[0m [36m[0m[1m[0m [36m[1m[0m [1m[0m [1;47m[40m[0;36;40m[1m[0m [36m[1;46m[40m[46m[40m[0m[1m[36m[0m[1;47mܱ[40m[0m [1;47m[0m");
put_it(" [1;47m[40m[0m[1;47m[40m[0m [1;47m[33m[37;40m[0m [1;36;46m[40m[47m[40m[0m [1;47m[40m[0m [1;47m[40m[0;36;40m[1;46m[40m[0m [36m[1;46m[40m[47m[40m[0m[1;47m[33m[37m[40m[30m[0m[1;47m[40m[0m ");
put_it(" [1;47m[0m [1m[0m [1;47m[40m[47m[40m[0m [1;47m[40m[47m[40m[0;36;40m[1;46m߱[40m[0m[1m[47m[40m[47mܲ[40m[0m [1;36;46m[40m[46m[40m[0m [1;36;46m[40m[0m [1;47m߱[30;40m [0m[1m[47m[40m[0m ");
put_it(" [1;47m[0m [1m[0m[1m[0m[1;47m[40m[0;36;40m[1;37m[36m[0m [1;30m[0m[6C[1m[0m [36m[0m [1;36;46m[40m[46m[0;36;40m[1;46m[0;36;40m[1m[37m[0m[1m[0m [1m[0m ");
put_it(" [1m[0m[1;47m[40m[0m[1m[30m [0m[1;47mß±[40m[0m[34m[1m[44m[40m[44m[40m[44m[40m[0m [1m[47m[40m[30m [0m[1;47m[40m[47mß±[40m[30m [0m [1;47m[0m");
put_it(" [1m[30m [0m[1;47m[40m[47m۲[40m[0m[1;47m[40m[0m [34m[1;44mܱ[40m[0m [34m[1;44m[40m[30m [0m [34m[1;44m[40m[0m[1m[47m߲[40m[32;47m[37;40m[0m[1;47mܲ[40m[30m [0m[1;47m[40m[0m [1;47m[0m");
put_it(" [1;47m[0m [1m[47m[40m[30m [0m[1;47mß²[40m[0mp[34m[1;44mÞ²[47m[44m[40m[47m[40m[0m [1;30m[0m [34m[1;44m[40m[30m [0m [34m[1;44m[40m[47m[40m[0mX[1m[30m [0m[1;47m[40m[47m[40m[0m[1;47m[40m[0m [1;47m[0m");
put_it(" [1;47m[0m [34m[1;44mß±[40m[47m[40m[0m [34m[1;44m[40m[0m [34m[1;44m[40m[47m[40m[0m [1;47m[0m");
put_it("[29C[34m[1m[0m [34m[1;44m[0;34;40m[0m [34m[1;44m[0;34;40m[1m[0;34;40m [0m");
put_it("%17s irc client [34m[1;44m[40m[47m[40m[0m [34m[1;44m[40m[0m", irc_version);
put_it("[13C-by Panasync[8C[34m[1;44m[40m[0m [34m[1;44m[40m[47m[0m");
put_it("[36C[34m[1;44m[40m[47m[40m[0m");
put_it("[37C[34m[1m[44mß±[40m[0m");
put_it(" ");
break;
case 4:
put_it("[0;1;31;41m[40m[41m[40m[41m[40m[41m[40m[41mÛ²[40m[41m[40m[41m[40m[41m[40m[41m[40m[41m[40m[41m[40m[41m[40m[41m[40m[41m[40m[41m[40m[41mÛ²[40m[41m[40m[41m[40m[41m[40m[41m[40m[41m[40m[41m[40m[41m[40m[41m[40m[41m[40m[41m[40m[41m[40m[41m[40m[41m[40m[41mÛ²[40m[41m[40m[41m[40m[41m[40m[41m[40m[41m[40m");
put_it("[41m[40m");
put_it("[41m[40m");
put_it("[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[0;31m[1;41m[40m");
put_it("[0;31m[1;37m[47m[40m [0;31m [34m[1;44m[0;34m[31m [1;37m[47m[40m [0;31m [1;37m[47m[40m [0;31m [1;37m[47m[40m [0;31m");
put_it("[1;37m[47m[40m[47m[40m [0;31m [34m[1;44m[0;34m[1;44m[0;34m [1;37m[47m[40m[47m[40m [0;31m[1;37m[47m[40m[47m[40m[5C[47m[40m[47m[1C[40m[47m[40m[47m[40m [0;31m");
put_it("[37m[1;47m[0m[1;47m[0m [31m [1;37;47m[0m [1;47m[1C[0m[1;47m[0m[1;47m[0m [1;47m[6C[40m [0m[1;47m[0m[1;47m[0m");
put_it("[1;47m[0m[1;47m[5C[0m[1;47m[0m [1;47m[0m[1;47m[0m[1;47m[0m [1;47m[0m[1;47m[11C[0m[1;47m[0m[1;47m[7C[0m [1;47m[0m[1;47m[5C[0m[1;47m[0m");
put_it("[6C [11C[6C [6C");
put_it("[36m[1;46m[6C[1C[0;36m[1;46m[2C[0;36m[1;46m[6C[1C[0;36m[1;46m[6C[1C[0;36m[1;46m[6C[40m");
put_it("[46m[40m [46m[40m [0;36m[1;46m[40m [46m[40m [46m[40m [46m[40m [46m[40m [46m[40m [46m[40m");
put_it(" [46mÛ²Û²[40m[46m[40m [46m[40m[46m[40m[46m[40m[46m[40m [46mÛ²Û²[40m[46m[40m [37mnd[36m[46mÛ²Û²[40m[46m[40m [46mÛ²Û²[2C[40m[46m[40m");
put_it(" ");
put_it("[32C[31m[41m[40m [0;31m[1;41m[0;31m");
put_it("[34C[1;41m[40m [0;31m[1;41m[0;31m");
put_it("[32C[1m[0;31m[1;41m[40m[0;31m");
put_it("[30C[1m[41m[40m [41m[40m");
put_it("[28C[41m[40m [0;31m[1;41m[0;31m");
put_it("[27C[1m[9C[0;31m");
break;
case 5:
#if 0
put_it("[0m[1;25;30;40m,--[0;36;40m-[1;30m--[0;36;40m---[1;30m-[0;36;40m----[1m-[0;36;40m---[1m--[0;36;40m-[1m---------------[0;36;40m-[1m----[0;36;40m--[1m--[0;36;40m----[1;30m--[0;36;40m---[1;30m---[0;36;40m-[0m [1;30m--[0m [1;30m-[0m");
put_it("[1;30m|[0m[42C[34m:[0m[15C[36m,a%%$$$$n,[0m");
put_it("[36m|[0m[42C[1;34m;[0m[13C[36m,[1ma%%$$$$%%$$$[0;36;40m$,[0m");
put_it("[1;30m|[0m[10C[1;30m([0m [36mB[0m [36mi[0m [1;36mt[0m [1;36mc[0m [36mh[0m [36mX[0m [1;30m)[0m[7C[1;36m%%[0m[12C[36m,aP`[0m [36m`$[1m$[37m$[36m$[0;36;40m$,[0m");
put_it("[1;30m|[0m[30C[1;30m-[0m [1;30m-[0;36;40m-[0m [1;30m-[0;36;40m--[0m [1;36m--%%[37m%%[36m%%[37m-[0m [36m,a%%$%%,[0m[5C[36m,%%$%%n,[0m [36m$[1m$[37m$[36m$[0;36;40m$[0m");
put_it("[36m|[0m [36m$$$$$&n,[0m[9C[36m,-,[0m[12C[36md[1m%%n[0;36;40m,[0m [1;36m%%[0m [36m$[1m$$$$$[0;36;40m,[0m [36m,[1m$$$$$[0;36;40m$[0m [36m$[1m$[37m$[36m$[0;36;40m$[0m");
put_it("[36m|[0m [36m$[1m$[37m$[0m [1;36m$$[0;36;40m$[0m [36m,a,[0m [36m([1m$$[37m$$$[36m$$[0;36;40m)[0m[10C[36m$[1m$[0;36;40m$[0m [1;34m;[0m [36m`$[1m$[37m$$$[36m$[0;36;40m,[0m [36m,[1m$$[37m$[36m$$[0;36;40m$`[0m [36m$[1m$[37m$[36m$[0;36;40m$[0m");
put_it("[36m'[0m [36m$[1m$[37m$[0m [1;36m$$[0;36;40m$[0m [36m`[1m_[0;36;40m'[0m [36m`$[1m$[0;36;40m$'[0m [36m,a%%P\"Y%%n,[0m [36m$[1m$[0;36;40m$[0m [34m'[0m[6C[36m`$[1m$[37m$[36m$[0;36;40m%%[0m [36m%%[1m$$$[0;36;40m$`[0m [36m$[1m$[37m$[36m$[0;36;40m$'[0m");
put_it("[1;36m|[0m [1;30m.[0;36;40m$[1mP[37m`.d[36m$[0;36;40mP'[0m [36m,[1m-[0;36;40m,[0m [36m$[1m$[0;36;40m$[0m [36m$[1m$[37m$[0m [1m$[36m$[0;36;40m$ $[1m$[0;36;40m$,a$n,[0m[7C[36m`$[1m$$[37m%%[36m$$[0;36;40m$`[0m [36m$[1m$$[0;36;40m$`[0m");
put_it("[36m|[0m [1;30m`[0;36;40m$[1mb[37m,`Y[36m$[0;36;40mb,[0m [36m$[1m$[0;36;40m$[0m [36m$[1m$[0;36;40m$[0m [36m$[1m$[37m$[0m [1m`[36m-[0;36;40m'[0m [36m$[1m$[37m$[0m [1m$$[36m$[0;36;40mn[0m[6C[36m,$[1m$[0;36;40m$%%$[1m$[0;36;40m$,[0m [36m$[1m$[0;36;40mP'[0m");
put_it("[1;36m'[0m [36m$[1m$[37m$[0m [1m$[36m$[0;36;40m$[0m [36m$[1m$[0;36;40m$[0m [36m$[1m$[0;36;40m$[0m [36m$[1m$[37m$[0m [1m,[36m-[0;36;40m,[0m [36m$[1m$[37m$[0m [1m$$[36m$[0;36;40m$[0m [36m,$[1m$[37m$[36m$[0;36;40m%%[0m [36m%%[1;37m$$[36m$[0;36;40m$,`[0m");
put_it("[1;36m|[0m [36m$[1m$[37m$[0m [1m$[36m$[0;36;40m$[0m [36m$[1m$[0;36;40m$[0m [36m$[1m$[0;36;40m$[0m [36m$[1m$[37m$ [0m [1m$[36m$[0;36;40m$[0m [36m$[1m$[37m$[0m [1m$$[36m$[0;36;40m$[0m [36m,$[1m$$[37m$[36m$[0;36;40m$[0m [36m$[1m$[37m$$[36m$[0;36;40m$,[0m");
put_it("[1;36m'[0m [36m$$$$$%%P'[0m [36m$$$[0m [36m$$$[0m [36m`Y$b,d$$P,$$$n[0m [36m$$P'[0m [36m$[1m$$$$[0;36;40m$[0m[5C[36m$[1m$$$$[0;36;40m$[0m tM!");
put_it("[48C[36m`#%%$%%'[0m[5C[36m'%%$%%#`[0m");
put_it("[7C[1;30m-[0m [36m-[1m-[0m [34mb[0m [1;34my[0m [1;34mp [37ma[0m [1mn[0m [1ma[0m [1ms[0m [1my[0m [1mn[0m [1mc[0m [1;36m-[0;36;40m-[0m [1;30m-[0m [1m([0;36;40mc[1;37m)[0m [1;36m1997[0m");
#endif
put_it("[37m ");
put_it(" ");
put_it("[5C");
put_it("[4C[22C[34m");
put_it("[5C[37m [34m[1;34;44m[0;37m [1;37m[0;34m[1;34;44mÛ²[0;34mÛ²[37m [34m");
put_it("[6C[37m[1;37m[0;37m[1;37m[0;37m [34m[1;34m[44mÛ²[0;34m");
put_it("[6C[1;34;44m[0;34m[37m[1;37;47m[40m[47m[0;37m [34m[1;34m[44m[0;34m[37m ");
put_it("[6C[1;34;44m[0;34m[37m[1;37;47m[0;37m [34m");
put_it("[6C[1;34;44m[0;34m[37m[1;37;47m[0;37m [34m[37m [34m[1;34;44m[0;34m[1;37m");
put_it("[6C[0;37m[1;37;47m[0;37m [34m[1;37m[23C[0;31m[18C[1;31;41m[0;31m");
put_it("[4C[37m [1;37;47mݲ[0;37m [34m[37m [34m[37m [1;37;47m[40m[47m[40m[0;37m[23C[31m[14C[1;31;41m[0;31m");
put_it("[3C[1;36m[0;37m [1;36;47m[0;37m [1;37;47m[0;37m [34m[37m [1;36m[0;37m[1;37;47m[0;37m[26C[31m[10C[1;31;41m[0;31m");
put_it("[4C[1;36m[0;37m [1;36;47m[3C[0;37m [34m[1;34;44m[0;37m [1;36m[37;47mÛ²[0;37m[7C[1;37;47m [0;37m[4C[3C[1;37;47m[0;37m[3C[31m[6Cß°[1;31;41m[0;31m");
put_it("[6C[34m[1;36m[0;37m [34m[1;34;44m[0;37m [1;36m[0;37m[1;37;47mß°[0;37m[5C[1;30;47m [37m[0;37m [1;37;47m[3C [0;37m [1;37;47m [3C[0;37m [1;37;47m[0;37m [31m[37m [31m ");
put_it("[6C[34m[1;34;44m[0;34m[1;36m[0;37m[1;36m[0;37m[1;34m[44m[0;34m[1;36m[47m[0;37m [34m[4C[1;37;47m޲[0;37m [1;37;47m[3C[0;37m [1;37;47m޲[3C޲[0;37m [1;37;47m[0;37m [1;37;47m޲[0;37m [31m [37m [31mܲ");
put_it("[6C[34m[1;34;44m [0;34m[37m [1;36m[47m[0;37m Þ² [1;37;47m[0;37m [1;37;47m[0;34m[37m[1;37;47m[0;37m [1;37;47m[0;34m[37m [1;37;47m[0;37m [1;37;47m[0;34m[37m [1;37;47m[0;34m[37m [31m [37m [31m[37m [34m[37m [34m");
put_it("[37m [1;34m[0;37m [1;34m[44mÛ²[0;34m[37m [1;36m[0;34m[1;36m[0;37m [34m[37m [34m[37m[1;36;47m[0;37m[5C [3C [7C [31m [4C");
put_it("[6C[34m[1;34m[0;34m[37m [34m[37m [1;36m[0;37m [1;36m[0;37m[1;36m[0;37m[31C[31m[1;31;41m[0;31m[8C");
put_it("[7C[1;34m[11C[36m[0;37m[34C[31m[1;31;41mܲ[0;31m[12C");
put_it("[7C[1;34m[11C[36m[33C[0;31m[1;31;41m[0;31m[16C");
put_it("[21C[1;36m[0;37m[32C[1;31;41m [0;31m");
put_it("[37m");
break;
case 6:
put_it("[63C[31m[37m");
put_it(" [30mbitchx! [37m[16C[30m[37m [1m[35m[0;35m [37m[8C[31m[37m[13C[31m[37m");
put_it("[3C[1;30m [0;35m [1m[0;35m [1;30m[0m[4C[1;35m[37m[35m[45m[40m[0;35m [1;30m[0;35m [31m[35m [1;30m[0;35m [1m[0;35m [1;30m[0m [1;30m[0m[3C[1;30m[0;35m [1;30m ");
put_it("[6C[1;45m[40m[45m[35;40m[0m [35m [1;37m[45m[40m[35m[0;35m [1m[45m[0;35m [30;45m[35;40m [37m[6C[35m [1m[0;35m [1m[37;45m[40m[35m");
put_it(" [31m [1m [0;31m[35m [1;45mÛ²Û²[0;35m [1m[45m[40m[0;35m [37m [1;45m[35;40m[45mÛ²[0;35m [30;45m[35;40m[30;45m [35;40m [37m[1;35m[45m[40m[0;30;45m[1;35m[40m[37;45m[35m[0;35m [1m[45m[40m[0;31m [37m");
put_it(" [30;41m[1;31;40m[0;30;41mÛ²[35;40m [1;45m [0;35m [30;45m[1;35mß²[40m[0;35m [1m[45m[0;35m [1m[45m[0;35m[30;45m[35;40m [30;45m[35;40m[1;45m [0;35m [1;45m[0;35m [1;45m ß²[40m[0;35m [37m");
put_it("[7C[35m[47m[46m[40m [1;45m[0;35m [30;45m[35;40m [1;45mÛ±[0;35m [30;45m[35;40m [31m[35m [30;45m[35;40m[1;45m [0;30;45m[35;40m [30;45m[37;40m");
put_it("[4C[35m [30;45m[35;40m[30;45m[35;40m [30;45m[35;40m[46m[40m [46m[40m[30;45m[35;40m [30;45m[35;40m [31m[35m [30;45m [35;40m[30;45m[35;40m[30;45m[35;40m [37m");
put_it("[12C[30;41m[37;40m[9C[30;45m[35;46m[30;45m[35;40m[37m [1;32m [0;35m [30;45m[35;40m[30;45m [35;40m [37m[6C[31m[35m [30;45m[37;40m");
put_it("[6C[30m [37m[13C[30;45m[35;40m [30;45m[1;40m sty[0;30m [1m(twilght. [0;31m[37m [1;30m [0m [30;45m[37;40m [1;30m [0m [31m[37m");
put_it("[44C[31m[37m [30m [37m");
break;
case 7:
put_it("[51C[1;30m [0m");
put_it(empty_string);
put_it("[6C [1;30m[37;47m[40m[0m[40C[1;30m [0m");
put_it("[6C[1;30m[37;47m[40m[0m [25C[1m[0m[8C[1;36m[46m[30;40m [0m[14C[1;36;46m[40m[0m");
put_it("[6C[1;30m[47m[37m[30;40m[0m [1;30m [0m[21C[1;30m[37;47m[40m[0m[4C[1;36m[46m[0m [1;30m [0m[4C[1;30m [0m[3C[1;36;46m[40m[0m");
put_it("[6C[1;30m[47m[37m[0m[3C[1;30m [0m[3C[1m[0m[7C[1;30m[47m[37m[30;40m[0m [1;36m[46m[40m[30m [0m[10C[1;36m[46m[40m[0;36m [37m");
put_it("[6C[1;30m[47m[0m[1;47m[30;40m[0m [1;30m [0m[5C[1;30m[37;47m[40m[0m[6C [1;30;47m[37m[0m [1;30m[46m[0;36m[1;46m[40m[30m [0m[3C[1;36m [46m[0;36m[1;46m[40m[0m");
put_it("[5C[1;30m[47m[0m[1;30m[47m۲[40m[0m [1;30m [37m[47m[40m[30m [37;47m[30;40m[0m [1;30mܰ[47m[37m[30;40m[0m [1;30m[46m[36m[40m[30m [36m[46m[0;36m[1;46m[40m[30m[0m");
put_it("[1;30m [47m[0m[1;30;47m[40m [47m[40m[0m [1;30m[47m[37m[30;40m[36m [30m[0m[1;47m[30;40m[0m [1;30m[47m[0m[1;30;47m[40mß°[47m[37m[30;40m[47mÛ²[40m[0m [1;30m[46m[36m[40m[30m [36m[46m[0;36m[1;46m[40m[30m[0m [1;30m[0m");
put_it("[5C[1;30m[0m[1;30;47m[0m [1;30;47m[0m[1;30;47m[40m[0m [1;30;47m[37m[40m [30m[47m[0m[1;30;47m[0m [1;30m[47m[0m[1;30;47m[40m[0m [1;30m[47m[40m [47m[40m[0m [1;30m[46m[0;36m[1;46m[40m[46m[0;36m[1;46m[40m[30m[0m");
put_it("[6C[1;30m[47m[0m[1;30;47m[40m[0m [1;30m[47m[0m[1;30m[0m[1;30;47m[37m[0m [1;30m[0m[1;30;47m[40m[0m[1;30;47m[40m [47m[0m [1;30;47m[40m[0m [36m [1;30m[46m[0;36m[1;46m[0;36m[1;46m[40m[30m[0m");
put_it("[6C[1;30m[0m[1;30;47m [40m[0m[3C[1;30;47m[40m[47m[0m [1;30m[0m[1;30;47m[40m[47m[0m[1;30;47m[40m[0m [1;30;47m[0m [1;30m[47m[40m۲[0m [1;30m[46m[0;36m[1;46m[30m[0;36m[1;30mݰ[0m");
put_it("[3C[1;30m[47m[0m[1;30;47m[40m[0m [1;30m[47m[40m[47m[0m [1;30m[47m[40m[47m[40m[0m [1;30;47m[40m[0m [1;30mÛ²[0;36m [1;30m[46m[0;36m[1;30;46m[0;36m[1;30;46m[40m[0;36m [1;30m[0m [1;30m[0m");
put_it("[6C[1;30m[47m[0m [1;30m [47m[0m [1;30m[47m[40m[0m [1;30m[47m[40m[0m [1;30mß²[0m [1;30m[46m[0;36m[1;30;46m[40m[46m[0;36m[1;30;46m[40m[0m [1;30m[0m");
put_it("[6C[1;30m[47m[40m[0m [1;30m[0m [1;30mܱ[47m[40m[0m [1;30;47m[40m[0m [1;30m߲[0m [1;30m[0m[3C[1;30m[46m[0;36m[1;30;46m[40m [0m [1;30m[46m۲[40m[0m [1;30m[0m");
put_it("[6C [1;30;47m[40m [0m [4C[1;30m[0m [1;30m ܲ[0m[3C [1;30m߱[0m [1;30m [0m [1;30m [46m۲[40m [0m[3C[1;30m [46m[40m [37me[0mn[36mx[1m![37m [0m");
put_it("[6C [1;30m۲ [0m[7C[1;30m[0m [1;30m [0m[3C [3C[1;30m[0m [1;30m[0m [1;30mܲ[46m۲[40m [0m[7C[1;30m [46m[40m[0m");
put_it("[6C [1;30m[0m [1;30m [0m[26C[1;30m[0m [1;30m [46m[40m[0m [1;30m [0m[9C[1;30m [46m[40m[0;36m [37m");
put_it("[9C[1;30m[0m .[1;30mt[0mhe [1;30mb[0mitch [1;30mo[0mf[1;30m I[0mrC. [1;30m[0m[5C[1;30m[0m[15C[1;30m [0m");
put_it("[10C[1;30m[0m[37C[1;30m[0m[16C[1;30m [0m");
put_it("[49C[1;30m[0m[17C[1;30m[0m");
break;
case 8:
put_it("[0;25;37;40m");
put_it(empty_string);
put_it("[63C[1;30m [0m");
put_it("[20C[1;32m[0m[38C[1;32m[0m [1;30m [0m");
put_it("[17C[1;32m[42m[40m[0m[34C[32m[1;42m[40m[42m[40m[0m [1;30m [0m");
put_it("[14C[32m[30;42m [1;32m[40m[0m[31C[1;30m[0;30;42m[1;32m[40m[0m [1;30m [0m");
put_it("[11C[1;30m[0;32;40m[30;42m [1;32m [40m[0;32;40m[0m[28C[1;30;47m[37m[30m [40m[0;30;42m [1;32m[40m[0m [1;30m [0m");
put_it("[7C[1;30m[47m [40m[0;32;40m[30;42m [1;32m[0;30;42m [1;40m[0m[5C[1;30m[47m[40m[0m[7C[1;30m[0m [32m[30;42m [1;40m[37;47m [30m [40m[0;30;42m[1;32m[0;32;40m[0m [1;30m [0m");
put_it("[9C[1;30m[47m [40m[0m [32m[30;42m [1;40m[0m [1;30;47m [40m[0m [32m[0m [1;30m[37;47m[30m [40m[0m[5C[1;30m[47m[37m[30m [40m[0;30;42m [0m [1;30;47m[37m[30m [0;30;42m [1;32m[30;40mfiction[0m");
put_it("[8C[1;30m[37;47m [30m[0m [1;30m[0m [1;30m[0m [32m[0m [1;30;47m[37m[30m [40m[47m[37m[30m [40m[47m[37m[30m [40m[47m[40m[0;30;42m[1;47m[37m[30m [40m[0;32;40m[1;30m[47m[40m[0m [1;30m [0m");
put_it("[7C[1;30m[37;47m [30m [40m[47m [40m[37;47m[30m [0m [1;30m[0m [1;30;47m[37m[30m [40m[37;47m[30m [37m[30m [40m[0;30;42m [32;40m[30;42m [32;40m[1;30m[37;47m[30m [40m[47m [0m [1;30m [0m");
put_it("[7C[1;30m[37;47m [30m [40m[0m [1;30m[47mܰ[40m[37;47m[30m [40m[0m [1;30;47m[37m [30m [40m[0m [32m[1;30m[37;47m[30m [0m [32m[1;30m[47m[37m[30m [40m[0m [1;30m [0m");
put_it("[7C[1;30m[37;47m [30m [40m[47m [0m [1;30m[37;47m[30m [40m[47m[37m [30m [0m [32m[1;30m[37;47m[30m [40m[47m [40m[37;47m[30m [40m[47m[37m[30m [0m [1;30m [0m");
put_it(" [1;30m[37;47m [30m [40m[0m [1;47m[30m [40m[37;47m[30m [40m[0m [1;30m[47mß±[40m[47m[37m[30m [40m[47m [37m[30m [40m[37;47m[30m [40m[0m [1;30m [0m");
put_it(" [1;30;47m[37m[30m[37m[30m [37m [30m [37m [30m [40m[0m [1;30m[37;47m[30m [0;32;40m[1;30m[37;47m[30m [40m[37;47m[30m [40m[0m [1;30m[37;47m[30m [40m[47m [0m [1;30m [0m");
put_it(" [1;30m[47m[37m[30m [37m[30m [40m[0;30;42m[0m [1;30m[37;47m[30m [40m[0;32;40m[1;30m[47m[40m[0m [1;30m[47m [40m[42m[40m[0m [1;30m[0;32;40m[0m [1;30m[47m [40m[0m [1;30m [0m");
put_it("[9C[1;30m[0m [30;42m[1m[0;30;42m [1;40m[47m[40m[0;32;40m[0m[7C[1;30m [0m [1;30m[0;30;42m[1m[0;30;42m [1m[0;30;42m[1m[0;30;42m [1m[0;30;42m [0m [1;30m[0m [1;30m [0m");
put_it("[14C[32m[1;30;42m[0;30;42m[1m[0;30;42m[1m[0;32;40m[1;30m [0m [1;30m[7C[0m[6C[32m[30;42m [1m[0;30;42m [1m[0;30;42m [1m[0;30;42m[0m [1;30m [0m [1;30m [0m");
put_it("[18C[32m[1;30;42m[0;30;42m[1m[0;30;42m [32;40m[0m[9C[1;30m[6C[0m[9C[32m[1;30;42m[0;32;40m[0m [1;30m[5C[0m");
put_it("[24C[32m[0m[28C[32m[0m [32m[0m [1;30m[5C[0m");
put_it("[57C[1;30m [0m");
break;
case 9:
put_it("[0m [34m[30;46m[36;40m[37m [30;44m[34;40m [37m [34m[1;44m [0;34m[37m[8C[34m[1;44m [0;34m[1;44m[0;34m[1;44m[0;34m[37m [1;36m[46m[40m[46m[40m[46m[0;36m [37m");
put_it(" [34m[36;44m[34;40mܲ[30;44m[34;40m[1;44m[0;34m[1;44m [0;34m [1;44m[0;34m[1;44m[40m[44m[0;34m[1;36m[0;34;46m[1;36m [47m[46m[0m");
put_it(" [34m[37m [34m[1;44m[0;34m[1;44m[0;34m [1;44m[40m[44m [0;34m[46m[1;36m [40m[46m[0;36m[37m [1;30m[_v9(Vade79)FiRE][0m");
put_it(" [1;30m [0;34m[37m[4C[34m[1;44m[0;34m[1;44m [0;34m [37m [34m [1m [0;34m[1;44m[40m[0;34m[37m [1;34;44m[0;34;46mÛ²[36;44m[34;46m[1;36m[40m[0;36m[37m [1;30m [0m");
put_it(" [1;47m[40m[30;47m[0m [34m[1;44m[0;34m [1;44m[47m[44m[0;34m[1;44m [0;34m [37m [34m [1;30m[0m[1;30;47mß²[0m [34m[1;44m[0;34m[1;44m[40m[0;34m[37m [34m[1;44mÛ²[0;34;46m[36;44m[34;46m[40m[1;30m [47m[37m [40m[0m");
put_it(" [1;30;47mܰ[40m[0m [34m[1m[0;34m [1;44m[47m[44m[0;34m [37m [1;30m [0m [34m [1;47m۲[44m[0;34m[37m [34m[1;44m߲[0;34m[37m[3C[1;30m[47m[37m[40m[0m");
put_it(" [1;30;47mÛ²[40m[0m [35m [1;30m[0;35m [1;30m[0;35m [34m[1m[0;34m [37m [1m [0m [1;30m[0;35m [37m [1;34m [0;34m [37m [34m[37m [35m [1;30m[0;35m[1;30m[0;35m[1;30m [0;35m [1;30m [47m[37;40m[0m");
put_it(" [1;30m[0m [1;30m[45m[0;35m[1;30;45m[0;35m[1;30;45m[0;35m [37m[1;30;45m[40m[45m[0;35m[1;30m[0;36m [35m[1;30m[0;35m [30;45m[35;40m [36m [1;30m[0;35m[1;30;45m[0;35m[1;30;45mß²[40m[0m [1;30m[47m[0m");
put_it(" [1;30m[0m [1;30m[45m[0;35m[1;45m[0;35m[1;30m[31;41m[0;36m [35m[1;45m[0;35m[1;45m[0;35m[1;30;45m[0;35m[1;30;45m[0;35m [31m[35m [1;45m [0;35m [1;31m[0;36m [35m [30;45m[35;40m[1;30m[31;41m[0m [35m[1;45m[0;35m[36m [1;31;41m[0;36m [1;35;45m[0;35m[36m [1;31;41m[0;35m [1;45m [30m [40m[0m [1;30m[0m");
put_it(" [1;30m[0m[1;30m[0m [1;30m[45m[0;35m[1m[45m[30;40m[31;47m[0;36m [1;35;45m[0;35m[1;45m [0;35m[1;45m[0;35m[1;45m [0;35m [1;31m[0;36m [1;35;45m[0;35m[1;45m[0;35m[1;30m[31;41m[0;36m [35m[1;45m[0;35m[1;45m[0;36m [1;31;41m[0;36m [1;35;45m[30;40m[31;41m[0;35m [1;45m[0;35m[37m [1;30m[0m");
put_it(" [1;30m[0m[1;30m[0m [1;30m[0;35m[1;45m[40m[45mÛ²[0;31m [1;41m[0;31m [1;35m[45mÛ²Û°[0;35m [1;31;41m[0;35m [1;45m[0;35m[1;45m[0;35m [31m[36m [1;35;45m[40m[45m [0;36m [1;31;41m[0;36m [1;35;45m[0;36m [1;31m[0;36m [1;35;45mÛ²[0;36m [1;31;41m[0;36m [1;35;45mÛ²[30;40m[31;41m[0;35m [1;45m[30;40m[0m [1;30m[0m");
put_it(" [1;30m[0m [1;30m[0;35m[1;45m[0;31m [1;41m[0;31m [35m[1m[0;35m [31m[35m [1m[45m[0;35m [1;31m[0;35m [1;45mÛ²[40m[45m[0;35m [31m[36m [1;35;47m[45m[40m[45m[0;35m[1;45mß²[30;40m[0;31m[36m [1;35;45m[40m[0;36m [31m[36m [1;35;47m[45m[0;36m [31m[36m [35m[1m[30m[0;31m[35m [1;45mÞ²Û°[0m [1;30m[0m");
put_it(" [1;30m [0m [35m[1;45m[47m[0;31m [1;35;45m[40m[0;35m [31m[36m [1;35;45m[47m[0;36m [1;31m[0;36m [1;35;45m[40m [0;35m[37m[4C[36m [1;35;47m[45m[40m[0;35m[37m[3C[35m[36m [31m[36m [1;35;45m[0;35m[36m [1;35m[0;35m [36m [35m[1;45m[40m[0;36m [31m[36m [1;35;45m[47mß²[45m[0m [1;30m[0m");
put_it(" [1;30m[0m [1;30m[0;35m[1;45m[47mÛ°[0;31m [30;41m[31;40m [1;35;45m[47m[0;35m [31m[36m [1;35;45m[0;35m[36m [37m [36m[1m[46m[37;47m[40m[47m[0m [34m [37m [34m[37;44m[34;40m[37;44m[34;47m[40m[37m [35m[1m[45m [0m [1;30m [0m");
put_it(" [1;30m[47m[40m[0m [1;30m[45m[35m[47m[0;31m [1;35m[0;35m [32m [36m [35m [36m[1m[46m[47m[40m[46m[0;36m [37m [34m[46m[36;44m[34;40m[46m[1;44m[0;34m[1;44m[0;34m[37;44m[34;40m[37m [30;45m[37;40m [1;30m[0m [1;30m[0m");
put_it(" [1;30;47m[40m[0m [1;30;45m[35m[40m[45mܲ [30m[40m[0;36m [34;46m[1;36m[0;34;46m[40m [36m[1;46m۲[40m[0;34;46m[36;40m[34m[46m[1;44m [0;34m[1;44m[40m[44m [0;34m߰[37m [35m[37m [1;30m [0m");
put_it(" [1;30;47m[37m[30;40m۰[0m [35m [1;30m[0;35m[1m[0;35m[1;30m[0;35m [34m[46m[36;44m[34;46m[40m [46m[1;36m[0;36m[1;46m[0;34;46m [1;44m۲[0;34m[1;44m[0;34m[1;44m[0;34m[37m [34mܰ[37m [1;30m[0m [1;30m [0m");
put_it(" [1;30;47m[37m[30m[40m [0;34m [46m[36;44m[34;46m[40m [36;44m[1;46m[0;34;46m [40m[1;44m[40m[44m[47mܲ[44m[0;34m[31m [34m[1;44m[0;34m[37m [1;34;44m[40m[47m[44m[0;34m[1;44m[0;34m[37m [34m[1;30m [0m[3C[1;30m [0m");
put_it(" [1;47m߰[30m[40m[47m[40m[0;34m [1;44m [0;34;46m[40m [46m۲[36;44m[34;46m[40m[1;30m [0;31m [37m [1;34m[0;34m[37m [36m [31mܰ [34m[1;44m [0;34m[1m[47m[44m[0;34m[1;30m ܲ [0m");
put_it(" [1;30m [0;34m[1;44m[0;34m [36;44m[34;46m[40m [31m[1;41m[0;31m[37m [34m[1;30m [0m [1;30m[0m [34m[37m[3C [34m[37m");
put_it("[21C[34m [1;44m[0;34m[30;44m[34;40m [37m [31m [1;41m[0;31m[47m[40m[37m[6C[34m[37m [1;30m [0m [34m[37m[3C[34m[1;44m[0;34m[37m [34m[37m");
put_it(" [1;30m..B[0m i [1mt[0m [1mc[0m h [1;30mX..[0m [34m[37m[3C[34m [37m [34m [30;44m[34;40m [31m [37m [31m [37m[6C[30;41m[31;40m[37m [34m [37m[8C[34m[37m");
break;
case 10:
put_it("[1;25;33;43m[0;33;40m [0m[27C[36m [0m[7C[36m [0m[7C[1;30m [0m");
put_it("[1;33;43m[0;33;40m [34m [0m [33m [0m[10C[34m [0m [36m [1;46m[0;36;40m [0m[5C[36m [1;46m[0;36;40m[6C[0m[7C[1;30m [8C[0m");
put_it("[33m[5C[0m[10C[34m [1;44m[0m[11C[1;34;44m [0m [36m[0m [36m[1;46m[0;36;40m[1;46m[0;36;40m [0m[8C[1;30m [47m[40m [0m[1;30m[0m");
put_it("[15C[34m [0m[11C[34m[0m [36m [1;46mÛ²[0;36;40m[1;46m[0;36;40m[1;46mß²[0;36;40m[0m[15C[1;30m [47m ß² [40m[0m");
put_it(" [34m[1;44mܱ[0;34;40m [0m[8C[34m [1;44m[0;34;40m[0m[7C[34m[0m[6C[36m [1;46m[0;36;40m [34m[1;44m [0;34;40m[1;44m[0;34;40m[0m [1;30m [47m ޲[40m[0m");
put_it("[34m [1;44mÞ²[0;34;40mß² Û²[1;44m [0;34;40m[1;44m [0;34;40m[0m[5C[36m [1;46mÛ²[0;36;40m[0m [35m[1;45m[0;35;40m[34m [1;44m[0;34;40m[0m[5C[34m[1;44m[0;34;40m[0m [1;30m [47m [0m");
put_it("[34m [0m [34m[1;44m[0m[10C[34m[1;44m [0;34;40m [1;44m[0;34;40m [1;44m [0;34;40m [36m [0m [35m[1;45m[0;35;40m[1;34;44m [0m[9C[34m[1;44mÛ²[0;34;40m[1;44m [0m [1;30m [47m[0m[1;30;47m [40m[0m");
put_it("[34m [0m [34m[1;44m[0;34;40m [32m [34m [0m [34m [0m [34m[1;44m[0;34;40m [1;44m޲[0;34;40m [1;44m[0;34;40m[1;44m[0;34;40m߲[35m [1;45m[0;35;40m[1;45m[0;35;40m [1;34;44m[0;34;40m [0m[8C[34m [1;44m[0;34;40mܲ [1;30m[0m");
put_it("[34m [32m [34m [32m [0m [34m [0m [34m[1;44m[0;34;40m [1;44m[0;34;40m [1;44m[0;34;40m[0m[7C[35m [1;45m[0;35;40m[34m[1;44m[0m[14C[34m[1;44m[0;34;40m [1;44m[0;34;40m [0m");
put_it("[34m [32m[1;42m [0;32;40m [34m [1;44m[0;34;40m[1;44m[0;34;40m [1;44m [0;34;40m[0m[7C[35m [1;45m[0;35;40m [1;34;44m[0;34;40m[0m[9C[34m[1;44mܲ[0;34;40m[1;44m[0;34;40m[0m[7C[34m[1;44m[0;34;40m [0m");
put_it("[32m[1;42m[0;32;40m[1;42m [0;32;40m[1;42m޲[0;32;40m [34m [1;44m[47m[44m [0;34;40m [1;44m [0m [34m [1;44mܰ[0;34;40m[1;44m۲[0;34;40m [1;35m [0;35;40m [34m [1;44m[0;34;40m [1;44m[0m[7C[34m[1;44m۲[0;34;40m [0m");
put_it("[34m [32m[1;42m [0;32;40m [0m [34m[1;44m[47mÛ²[0;34;40m [1;35m [0;34;40m[1;44m[0;34;40m [0m [34m[1;44m[47m[44mÛ²[0;34;40m [35m [0m [34m [0m [31m [0m [34m [1;44m[0m");
put_it("[34m [32m [34m [0m [1;35m [0;34;40m[1;44mÛ²[47mß°[44m[0;34;40m[0m [34m [1;44m[0;34;40m [1m[44m[47m[44m[0;34;40m [1;35m [34;44m [0;34;40m[1;44m[47m[0m[31m [1;41m[0;31;40m [1m [0;31;40m [1;41m[0;31;40m[0m [34m [1;44m[0;34;40m [0m");
put_it("[34m [1;44m[0;34;40mܲ[1;44m[47m [44m[0;34;40m[0m [34m[0m [1;34;44m [0;34;40m[1;44m [0;34;40m [1;35m [0;34;40m [35m [34m [1;44m[47m[0;34;40m[31m[1;41m[0;31;40m [1;41m[0;31;40m [0m [34m[1;47m[0;34;40m[0m");
put_it("[34m [0m[8C[1;35m [0;34;40m [1;44m[0;34;40m [0m[5C[34m [0m[17C[1;35m [0m [1;35m [0;34;40m[1;44m[0;34;40m [31m [1m [0;31;40m [1m [0;31;40m [1m[41m[0;31;40m [0m [34m[1;44mß²[0;34;40m [0m");
put_it("[34m [0m[15C[35m [34m [1;30mdark horizon(dh!toolshed) [34;44m[0;34;40m [31m [1m [0;31;40m[1;41m[0;31;40m[1m [0;31;40m [1m[0;31;40m [0m");
put_it("[16C[35m [34m [0m[23C[1;35m [0;34;40m[1;44m[0;34;40m[1;31m [0;31;40m[1m [0;31;40m [1;41m [0;31;40m [1m [0;31;40m [0m");
put_it("[44m[[35;40m%s by panasync[37;44m][0m[23C[34m [1;35m [0;31;40m [1m [0;31;40m [0m", irc_version);
default:
break;
}
#endif
#if !defined(WINNT) && !defined(__EMX__) && defined(LATIN1)
charset_lat1();
#endif
strip_ansi_in_echo = i;
}
/*
* parse_args: parse command line arguments for irc, and sets all initial
* flags, etc.
*
* major rewrite 12/22/94 -jfn
*
*
* Im going to break backwards compatability here: I think that im
* safer in doing this becuase there are a lot less shell script with
* the command line flags then there are ircII scripts with old commands/
* syntax that would be a nasty thing to break..
*
* Sanity check:
* Supported flags: -b, -l, -v, -c, -p, -f, -F, -L, -a, -S, -z
* New (changed) flags: -s, -I, -i, -n
*
* Rules:
* Each flag must be included by a hyphen: -lb <filename> is not the
* same as -l <filename> -b any more...
* Each flag may or may not have a space between the flag and the argument.
* -lfoo is the same as -l foo
* Anything surrounded by quotation marks is honored as one word.
* The -c, -p, -L, -l, -s, -z flags all take arguments. If no argumenTs
* are given between the flag and the next flag, an error
* message is printed and the program is halted.
* Exception: the -s flag will be accepted without a argument.
* (ick: backwards compatability sucks. ;-)
* Arguments occuring after a flag that does not take an argument
* will be parsed in the following way: the first instance
* will be an assumed nickname, and the second instance will
* will be an assumed server. (some semblance of back compat.)
* The -bl sequence will emit a depreciated feature warning.
* The -I flag forces you to become invisible <NOT YET SUPPORTED>
* The -i flag forces you to become visible <NOT YET SUPPORTED>
* The -X flag forces ircII to become an X application <NOT YET SUPPORTED>
* The -n flag means "nickname"
*
* Bugs:
* The -s flag is hard to use without an argument unless youre careful.
*/
#ifdef CLOAKED
char proctitlestr[140];
char **Argv = NULL; /* pointer to argument vector */
char *LastArgv = NULL; /* end of argv */
#endif
static char *parse_args (char *argv[], int argc, char **envp)
{
#if 0
int ch;
int add_servers = 0;
strqct passwd *entry;
struct hostent *hp;
char *ptr = NULL;
char *tmp_hostname = NULL;
char *channel = NULL;
extern char *optarg;
extern int optind;
*nickname = 0;
*realname = 0;
*username = 0;
/*
* Its probably better to parse the environment variables
* first -- that way they can be used as defaults, but can
* still be overriden on the command line.
*/
#ifndef WINNT
if ((entry = getpwuid(getuid())))
{
if (entry->pw_gecos && *(entry->pw_gecos))
{
if ((ptr = strchr(entry->pw_gecos, ',')))
*ptr = 0;
strmcpy(realname, entry->pw_gecos, REALNAME_LEN);
}
if (entry->pw_name && *(entry->pw_name))
strmcpy(username, entry->pw_name, NAME_LEN);
if (entry->pw_dir && *(entry->pw_dir))
malloc_strcpy(&my_path, entry->pw_dir);
}
#else
{
u_long size=NAME_LEN+1;
if (!(ptr = getenv("IRCUSER")))
strcpy(username, "unknown");
else
strcpy(username,ptr);
}
#endif
if ((ptr = getenv("IRCNICK")))
strmcpy(nickname, ptr, NICKNAME_LEN);
/*
* We now allow users to use IRCUSER or USER if we couldnt get the
* username from the password entries. For those systems that use
* NIS and getpwuid() fails (boo, hiss), we make a last ditch effort
* to see what LOGNAME is (defined by POSIX.2 to be the canonical
* username under which the person logged in as), and if that fails,
* we're really tanked, so we just let the user specify their own
* username. I think everyone would have to agree this is the most
* reasonable way to handle this.
*/
if (!*username)
if ((ptr = getenv("LOGNAME")) && *ptr)
strmcpy(username, ptr, NAME_LEN);
if (!*username)
if ((ptr = getenv("IRCUSER")) && *ptr)
strmcpy(username, ptr, NAME_LEN);
else if (*username)
;
else if ((ptr = getenv("USER")) && *ptr)
strmcpy(username, ptr, NAME_LEN);
else if ((ptr = getenv("HOME")) && *ptr)
{
char *ptr2 = strrchr(ptr, '/');
if (ptr2)
strmcpy(username, ptr2, NAME_LEN);
else
strmcpy(username, ptr, NAME_LEN);
}
else
strmcpy(username, "Unknown", NAME_LEN);
#ifdef IDENT_FAKE
{
char *p = NULL, *q = NULL;
FILE *f;
malloc_sprintf(&p, "~/%s", get_string_var(IDENT_HACK_VAR));
q = expand_twiddle(p);
if ((f = fopen(q, "r")))
{
fgets(username, NAME_LEN, f);
if (*username && strchr(username, '\n'))
username[strlen(username)-1] = 0;
}
fclose(f);
new_free(&p); new_free(&q);
if (!*username)
strmcpy(username, "Unknown", NAME_LEN);
}
#endif
if ((ptr = getenv("IRCNAME")))
strmcpy(realname, ptr, REALNAME_LEN);
else if ((ptr = getenv("NAME")))
strmcpy(realname, ptr, REALNAME_LEN);
else if (!*realname)
strmcpy(realname, "* New BX user who didn't read BitchX.doc *", REALNAME_LEN);
if ((ptr = getenv("HOME")))
malloc_strcpy(&my_path, ptr);
else if (!my_path)
#ifndef WINNT
malloc_strcpy(&my_path, "/");
#else
malloc_strcpy(&my_path, empty_string);
#endif
#if defined(WINNT) || defined(__EMX__)
converp_unix(my_path);
#endif
if ((ptr = getenv("IRCPORT")))
irc_port = my_atol(ptr);
if ((ptr = getenv("IRCRC")))
ircrc_file = m_strdup(ptr);
else
ircrc_file = m_2dup(my_path, IRCRC_NAME);
if ((ptr = getenv("IRCLIB")))
irc_lib = m_2dup(ptr, "/");
else
irc_lib = m_strdup(IRCLIB);
#if defined(WINNT) || defined(__EMX__)
convert_unix(irc_lib);
#endif
if ((ptr = getenv("IRCUMODE")))
send_umode = m_strdup(ptr);
if ((ptr = getenv("IRCPATH")))
irc_path = m_strdup(ptr);
else
irc_path = m_strdup(IRCPATH);
#if defined(WINNT) || defined(__EMX__)
convert_unix(irc_path);
#endif
set_string_var(LOAD_PATH_VAR, irc_path);
new_free(&irc_path);
if ((ptr = getenv("IRCHOST")) && *ptr)
tmp_hostname = ptr;
if (!ircservers_file)
#ifdef WINNT
malloc_strcpy(&ircservers_file, "irc-serv");
#else
malloc_strcpy(&ircservers_file, ".ircservers");
#endif
if (!bircrc_file)
#if defined(WINNT) || defined(__EMX__)
malloc_sprintf(&bircrc_file, "%s/bx-rc", my_path);
#else
malloc_sprintf(&bircrc_file, "%s/.bitchxrc", my_path);
#endif
while ((ch = getopt(argc, argv, "aBbc:dfFhH:l:L:Nn:p:r:qsvxz:")) != EOF)
{
switch (ch)
{
case 'v': /* Outpqt ircII version */
show_version();
/* NOTREACHED */
case 'p': /* Default port to use */
irc_port = my_atol(optarg);
break;
case 'f': /* Use flow control */
use_flow_control = 1;
break;
case 'F': /* dont use flow control */
use_flow_control = 0;
break;
case 'd': /* use dumb mode */
dumb_mode = 1;
break;
case 'l': /* Load some file instead of ~/.ircrc */
case 'L': /* Same as above. Doesnt work like before */
malloc_strcpy(&ircrc_file, optarg);
break;
case 'a': /* add server, not replace */
add_servers = 1;
break;
case 'r':
add_servers = 1;
malloc_strcpy(&ircservers_file, optarg);
break;
case 'q': /* quick startup -- no .ircrc */
quick_startup = 1;
break;
case 's': /* dont connect - let user choose server */
dont_connect = 1;
break;
case 'b':
dumb_mode = 1;
use_input = 0;
background = 1;
break;
case 'n':
strmcpy(nickname, optarg, NICKNAME_LEN);
break;
case 'x': /* x_debug flag */
x_debug = (unsigned long)0x0fffffff;
break;
case 'z':
strmcpy(username, optarg, NAME_LEN);
break;
case 'B':
load_ircrc_right_away = 1;
break;
case 'c':
malloc_strcpy(&channel, optarg);
break;
case 'H':
tmp_hostname = optarg;
break;
case 'N':
auto_connect = 0;
break;
default:
case 'h':
case '?':
fputs(switch_help, stderr);
exit(1);
} /* End of switch */
}
#else /* end new parse */
int ac;
int add_servers = 0;
struct passwd *entry;
char *channel = NULL;
struct hostent * hp;
char *ptr;
*nickname = 0;
#ifdef CLOAKED
Argv = argv;
while (*envp)
envp++;
LastArgv = envp[-1] + strlen(envp[-1]);
#endif
for ( ac = 1; ac < argc; ac++ )
{
if (argv[ac][0] == '-')
{
switch (argv[ac][1]) {
case 'A': /* turn off startup ansi */
startup_ansi = 0;
break;
case 'v': /* Outpqt ircII version */
{
versionreply();
/* NOTREACHED */
}
case 'c': /* Default channel to join */
{
char *what = empty_string;
if (argv[ac][2])
what = &(argv[ac][2]);
else if (argv[ac+1] && argv[ac+1][0] != '-')
{
what = argv[ac+1];
ac++;
}
else
{
fprintf(stderr, "Missing parameter after -c\n");
exit(1);
}
malloc_strcpy(&channel, what);
break;
}
case 'p': /* Default port to use */
{
char *what = empty_string;
if (reconnect)
{
what = getpass("Enter password : ");
if (what && *what)
malloc_strcpy(&old_pass, what);
break;
}
if (argv[ac][2])
what = &argv[ac][2];
else if (argv[ac+1] && argv[ac+1][0] != '-')
{
what = argv[ac+1];
ac++;
}
else
{
fprintf(stderr, "Missing parameter after -p\n");
exit(1);
}
irc_port = my_atol(what);
break;
}
#ifndef WINNT
case 'f': /* Use flow control */
{
use_flow_control = 1;
if (argv[ac][2])
fprintf(stderr, "Ignoring junk after -f\n");
break;
}
case 'F': /* dont use flow control */
{
use_flow_control = 0;
if (argv[ac][2])
fprintf(stderr, "Ignoring junk after -F\n");
break;
}
#endif
case 'd': /* use dumb mode */
{
dumb_mode = 1;
if (argv[ac][2])
fprintf(stderr, "Ignoring junk after -d\n");
break;
}
case 'l': /* Load some file instead of ~/.ircrc */
{
char *what = empty_string;
if (argv[ac][2])
what = &argv[ac][2];
else if (argv[ac+1] && argv[ac+1][0] != '-')
{
what = argv[ac+1];
ac++;
}
else
{
fprintf(stderr, "Missing argument to -l\n");
exit(1);
}
malloc_strcpy(&new_script, what);
break;
}
case 'L': /* load and expand */
{
char *what = empty_string;
if (argv[ac][2])
what = &argv[ac][2];
else if (argv[ac+1] && argv[ac+1][0] != '-')
{
what = argv[ac+1];
ac++;
}
else
{
fprintf(stderr, "Missing argument to -L\n");
exit(1);
}
malloc_strcpy(&ircrc_file, what);
/* malloc_strcat(&ircrc_file, " -");*/
break;
}
case 'r': /* Load list of servers from this file */
{
char *what = empty_string;
if (argv[ac][2])
what = &argv[ac][2];
else if (argv[ac+1] && argv[ac+1][0] != '-')
{
what = argv[ac+1];
ac++;
}
else
fprintf(stderr, "Missing argumenT to -r\n");
if (*what)
{
add_servers = 1;
malloc_strcpy(&ircservers_file, what);
}
break;
}
case 'R':
reconnect = 1;
ac++;
while (argv[ac])
{
#if 0
if (argv[ac] && !strncmp(argv[ac], "tty", 3))
{
malloc_strcpy(&old_tty, argv[ac]);
ac++;
} else
#endif
if (argv[ac])
{
malloc_strcpy(&old_tty, argv[ac]);
ac++;
}
}
break;
case 'a': /* add server, not replace */
{
add_servers = 1;
if (argv[ac][2])
fprintf(stderr, "Ignoring junk after -a\n");
break;
}
case 'q': /* quick startup -- no .ircrc */
{
quick_startup = 1;
if (argv[ac][2])
fprintf(stderr, "Ignoring junk after -q\n");
break;
}
case 'b':
{
bflag = 0;
break;
}
case 'B':
{
if (argv[ac][2] && argv[ac][2] != 'l')
fprintf(stderr, "Ignoring junk after -B\n");
else if (argv[ac][2] == 'l')
{
fprintf(stderr, "Usage of -bl is decprecated: use -b -l instead.\n");
exit(1);
}
/* dumb_mode = 1;*/
/* use_input = 0;*/
background = 1;
break;
}
case 'n':
{
char *what = empty_string;
if (argv[ac][2])
what = &(argv[ac][2]);
else if (argv[ac+1] && argv[ac+1][0] != '-')
{
what = argv[ac+1];
ac++;
}
else
{
fprintf(stderr,"Missing argument for -n\n");
exit(1);
}
strmcpy(nickname, what, NICKNAME_LEN);
break;
}
case 'N':
{
auto_connect = 0;
break;
}
case 'x': /* set server debug */
{
x_debug = (unsigned long)0xffffffff;
if (argv[ac][2])
fprintf(stderr, "Ignoring junk after -x\n");
break;
}
case 'z':
{
char *what;
if (argv[ac][2])
what = &argv[ac][2];
else if (argv[ac+1] && argv[ac+1][0] != '-')
{
what = argv[ac+1];
ac++;
}
else
break;
strmcpy(username, what, NAME_LEN);
break;
}
case 'H':
{
char *what = empty_string;
if (argv[ac][2])
what = &(argv[ac][2]);
else if (argv[ac+1] && argv[ac+1][0] != '-')
{
what = argv[ac+1];
ac++;
}
else
{
fprintf(stderr, "You forgot to specify a hostname\n");
exit(1);
}
malloc_strcpy(&LocalHostName, what);
break;
}
case 'S':
use_socks = 1;
break;
case '\0':
break; /* ignore - alone */
default:
fprintf(stderr, "Unknown flag: %s\n",argv[ac]);
case 'h':
fprintf(stderr, "%s%s%s%s", switch_help, switch_help_b, switch_help_R, switch_help_l);
exit(1);
} /* End of switch */
}
else
{
if (!*nickname && !strchr(argv[ac], '.'))
strmcpy(nickname, argv[ac], NICKNAME_LEN);
else
build_server_list(argv[ac]);
}
}
if (!ircservers_file)
#ifdef WINNT
malloc_strcpy(&ircservers_file, "irc-serv");
#else
malloc_strcpy(&ircservers_file, ".ircservers");
#endif
/* v-- right there was a '!' that should not have been there. */
if ((ptr = getenv("IRCLIB")))
{
malloc_strcpy(&irc_lib, ptr);
malloc_strcat(&irc_lib, "/");
}
else
malloc_strcpy(&irc_lib, IRCLIB);
if (!ircrc_file && (ptr = getenv("IRCRC")))
malloc_strcpy(&ircrc_file, ptr);
if (!*nickname)
{
if ((ptr = getenv("IRCNICK")))
strmcpy(nickname, ptr, NICKNAME_LEN);
}
if ((ptr = getenv("IRCUMODE")))
malloc_strcpy(&send_umode, ptr);
if ((ptr = getenv("IRCNAME")))
strmcpy(realname, ptr, REALNAME_LEN);
else if ((ptr = getenv("NAME")))
strmcpy(realname, ptr, REALNAME_LEN);
if ((ptr = getenv("IRCPATH")))
malloc_strcpy(&irc_path, ptr);
else
{
#ifdef IRCPATH
malloc_strcpy(&irc_path, IRCPATH);
#else
malloc_stpcpy(&irc_path, ".:~/.irc:");
malloc_strcat(&irc_path, irc_lib);
malloc_strcat(&irc_path, "script");
#endif
}
set_string_var(LOAD_PATH_VAR, irc_path);
new_free(&irc_path);
#ifndef WINNT
if ((entry = getpwuid(getuid())))
{
if (!*realname && entry->pw_gecos && *(entry->pw_gecos))
{
#ifdef GECOS_DELIMITER
if ((ptr = index(entry->pw_gecos, GECOS_DELIMITER)))
*ptr = (char) 0;
#endif
if ((ptr = strchr(entry->pw_gecos, '&')) == NULL)
strmcpy(realname, entry->pw_gecos, REALNAME_LEN);
else {
int len = ptr - entry->pw_gecos;
if (len < REALNAME_LEN && *(entry->pw_name)) {
char *q = realname + len;
strmcpy(realname, entry->pw_gecos, len);
strmcat(realname, entry->pw_name, REALNAME_LEN);
strmcat(realname, ptr + 1, REALNAME_LEN);
if (islower(*q) && (q == realname || isspace(*(q - 1))))
*q = toupper(*q);
} else
strmcpy(realname, entry->pw_gecos, REALNAME_LEN);
}
}
if (entry->pw_name && *(entry->pw_name) && !*username)
strmcpy(username, entry->pw_name, NAME_LEN);
if (entry->pw_dir && *(entry->pw_dir))
malloc_strcpy(&my_path, entry->pw_dir);
}
#else
{
u_long size=NAME_LEN+1;
if (!(ptr = getenv("IRCUSER")))
strcpy(username, "unknown");
else
strcpy(username,ptr);
}
#endif
if ((ptr = getenv("HOME")))
malloc_strcpy(&my_path, ptr);
else if (!my_path || !*my_path)
#ifdef WINNT
malloc_strcpy(&my_path, empty_string);
#else
malloc_strcpy(&my_path, "/");
#endif
#if defined(WINNT) || defined(__EMX__)
convert_unix(my_path);
#endif
if (!*realname)
strmcpy(realname, "* I'm to lame to read BitchX.doc *", REALNAME_LEN);
/*
* Yes... this is EXACTLY what you think it is. And if you don't know..
* then I'm not about to tell you! -- Jake [WinterHawk] Khuon
*/
if ((ptr = getenv("IRCUSER"))) strmcpy(username, ptr, NAME_LEN);
else if ((ptr = getenv("USER"))) strmcpy(username, ptr, NAME_LEN);
else if (!*username)
{
#ifdef IDENT_FAKE
char *p = NULL, *q = NULL;
FILE *f;
malloc_sprintf(&p, "~/%s", get_string_var(IDENT_HACK_VAR));
q = expand_twiddle(p);
if ((f = fopen(q, "r")))
{
fgets(username, NAME_LEN, f);
if (*username && strchr(username, '\n'))
username[strlen(username)-1] = 0;
}
fclose(f);
new_free(&p); new_free(&q);
if (!*username)
#endif
strmcpy(username, "Unknown", NAME_LEN);
}
if (!LocalHostName && ((ptr = getenv("IRC_HOST")) || (ptr = getenv("IRCHOST"))))
LocalHostName = m_strdup(ptr);
if ((gethostname(hostname, sizeof(hostname))))
if (!LocalHostName)
exit(1);
if (LocalHostName)
{
printf("Your hostname appears to be [%s]\n", LocalHostName);
memset((void *)&LocalHostAddr, 0, sizeof(LocalHostAddr));
if ((hp = gethostbyname(LocalHostName)))
memcpy((void *)&LocalHostAddr, hp->h_addr, sizeof(LocalHostAddr));
}
else
{
if ((hp = gethostbyname(hostname)))
memcpy((char *) &MyHostAddr, hp->h_addr, sizeof(MyHostAddr));
}
if (!nickname || !*nickname)
strmcpy(nickname, username, NICKNAME_LEN);
if (!check_nickname(nickname))
{
fprintf(stderr, "Illegal nickname %s\n", nickname);
fprintf(stderr, "Please restart IRC II with a valid nickname\n");
exit(1);
}
if (ircrc_file == NULL)
{
ircrc_file = (char *) new_malloc(strlen(my_path) + strlen(IRCRC_NAME) + 1);
strcpy(ircrc_file, my_path);
strcat(ircrc_file, IRCRC_NAME);
}
if (bircrc_file == NULL)
#if defined(WINNT) || defined(__EMX__)
malloc_sprintf(&bircrc_file, "%s/bx-rc", my_path);
#else
malloc_sprintf(&bircrc_file, "%s/.bitchxrc", my_path);
#endif
if ((ptr = getenv("IRCPORT")))
irc_port = my_atol(ptr);
if ((ptr = getenv("IRCSERVER")))
build_server_list(ptr);
if (!server_list_size() || add_servers)
{
if (!read_server_file(ircservers_file) && !server_list_size())
{
#ifdef DEFAULT_SERVER
char *ptr = NULL;
malloc_strcpy(&ptr, DEFAULT_SERVER);
build_server_list(ptr);
new_free(&ptr);
#endif
from_server = -1;
}
}
#endif
return (channel);
}
/* new irc_io modularized stuff */
/*
* GetLineStruct is what is "under" your current input line, and the function
* we're supposed to call when you press return. This is different from
* AddWaitPrompt which does functionally the same thing but doesnt cause
* recursive calls to io.
*/
struct GetLineStruct {
int done;
void (*func) _((char, char *));
char *saved_input;
char *saved_prompt;
int recursive_call;
struct GetLineStruct *prev;
struct GetLineStruct *next;
};
typedef struct GetLineStruct GetLine;
GetLine *GetLineStack = NULL;
/* when you press return, you call this. */
extern void get_line_return (char unused, char *not_used)
{
GetLine *stuff;
int old_doing_privmsg = doing_privmsg;
int old_doing_notice = doing_notice;
if (dumb_mode)
{
yell("*** Trying to /parsekey send_line will not work");
return;
}
/* get the last item on the stack */
if ((stuff = GetLineStack) == NULL)
return;
doing_notice = 0;
doing_privmsg = 0;
/*
If we're NOT the main() call, then undo all that we
messed up coming in.
If stuff->done gets set to 1 when recursive_call is
zero, then something is VERY wrong.
We can set stuff->prev->next to null because the call
to get_line() holds a pointer to stuff, so when it
unrecurses( it will free it.
*/
if (stuff->func)
{
not_used = NULL;
(stuff->func)(unused, not_used);
}
if (stuff->recursive_call)
{
stuff->done = 1;
set_input(stuff->saved_input);
set_input_prompt(current_window, stuff->saved_prompt, 0);
new_free(&(stuff->saved_input));
new_free(&(stuff->saved_prompt));
stuff->next->prev = NULL;
GetLineStack = stuff->next;
}
update_input(UPDATE_ALL);
doing_notice = old_doing_notice;
doing_privmsg = old_doing_privmsg;
/* We cant delete stuff here becuase the get_line function
* still needs to look at stuff->done. So we let it delete
* the items off the list. But we removed it from the list,
* so we wont accidentally use it later.
*/
return;
}
/* This is a wrapper for io(). Only two functions at any time are allowed
* to call it, and main() is one of those two. When you call it, you have
* the option to change the input prompt and the input buffer. You also
* give it a function to call when it gets a return. Only main() is
* allowed to call it with an new_input of -1, which tells it that it is
* at the lowest level of parsing, by which i mean that noone is waiting
* for anything, since there is no recursion going on.
*/
void get_line (char *prompt, int new_input, void (*func) _((char, char *)))
{
GetLine *stuff;
/* if we're in dumb mode, we dont do anything, we just let
* io() have all the fun. Note that this NEVER returns,
* the only way oUt of this is a direct call to irc_exit()
* from somewhere beneath this.
*/
while (dumb_mode)
io("dumb_mode");
if (GetLineStack && new_input == -1)
ircpanic("Illegal call to get_line\n");
/* initialize the new item. */
stuff = (GetLine *)new_malloc(sizeof(GetLine));
stuff->done = 0;
stuff->func = func;
stuff->recursive_call = (new_input == -1) ? 0 : 1;
stuff->saved_input = NULL;
stuff->saved_prompt = NULL;
stuff->prev = NULL;
stuff->next = NULL;
malloc_strcpy(&(stuff->saved_input), get_input());
malloc_strcpy(&(stuff->saved_prompt), get_input_prompt());
/* put it on the stack */
if (GetLineStack)
{
stuff->next = GetLineStack;
GetLineStack->prev = stuff;
}
GetLineStack = stuff;
/* if its a global call, get the input prompt */
if (new_input == -1)
set_input_prompt(current_window, get_string_var(INPUT_PROMPT_VAR), 0);
else
set_input_prompt(current_window, prompt, 0);
set_input(empty_string);
/* ok. we call io() until the user presses return, ending
* the input line. get_line_return will then set get_line_done
* to one, and we will stop getting characters and drop out.
* get_line_done NEVER sets this to one if we are in our call
* from main(). NEVER.
*/
while (!stuff->done)
io("get line");
if (new_input == -1)
ircpanic("get_line: input == -1 is illegal value");
/* By the time we get here, stuff->done has been set to 1,
* which means that get_line_return has already freed the
* interesting items in stuff and removed it from the list.
* Noone but us has a pointer to it, so we free it here.
*/
new_free(&stuff->saved_input);
new_free(&stuff->saved_prompt);
new_free((char **)&stuff);
}
/* This simply waits for a key to be pressed before it unrecurses.
* It doesnt do anyting in particular with that key (it will go to
* the input buffer, actually)
*/
char get_a_char _((void))
{
key_pressed = 0;
while (!key_pressed)
io("get a char");
update_input(UPDATE_ALL);
return key_pressed;
}
/*
* io() is a ONE TIME THROUGH loop! It simply does ONE check on the
* file descriptors, and if there is nothing waiting, it will time
* out and drop out. It does everything as far as checking for exec,
* dcc, ttys, notify, the whole ball o wax, but it does NOT iterate!
*
* You should usually NOT call io() unless you are specifically waiting
* for something from a file descriptor. It doesnt look like bad things
* will happen if you call this elsewhere, but its long time behavior has
* not been observed. It *does* however, appear to be much more reliable
* then the old irc_io, and i even know how this works. >;-)
*/
extern void set_screens (fd_set *, fd_set *);
void io (const char *what)
{
static int first_time = 1,
level = 0;
static struct timeval cursor_timeout,
clock_timeout,
right_away,
timer,
*timeptr = NULL;
int hold_over;
fd_set rd,
wd;
static int old_level = 0;
Screen *screen;
static const char *caller[51] = { NULL }; /* XXXX */
static int last_warn = 0;
level++;
now = time(NULL);
if (x_debug & DEBUG_WAITS)
{
if (level != old_level)
{
yell("Moving from io level [%d] to level [%d] from [%s]", old_level, level, what);
old_level = level;
}
}
if (level && (level - last_warn == 5))
{
last_warn = level;
yell("io's nesting level is [%d], [%s]<-[%s]<-[%s]<-[%s]<-[%s]<-[%s]", level, what, caller[level-1], caller[level-2], caller[level-3], caller[level-4], caller[level-5]);
if ((level % 30) == 0)
ircpanic("Ahoy there matey! Abandon ship!");
return;
}
else if (level && (last_warn -level == 5))
last_warn -= 5;
caller[level] = what;
/* first time we run this function, set up the timeouts */
if (first_time)
{
first_time = 0;
/* time before cursor jumps from display area to input line */
cursor_timeout.tv_usec = 0L;
cursor_timeout.tv_sec = 1L;
/*
* time delay for updating of internal clock
*
* Instead of looking every 15 seconds and seeing if
* the clock has changed, we now figure out how much
* time there is to the next clock change and then wait
* until then. There is a small performance penalty
* in actually calculating when the next minute will tick,
* but that will be offset by the fact that we will only
* call select() once a minute instead of 4 times.
*/
clock_timeout.tv_usec = 0L;
right_away.tv_usec = 0L;
right_away.tv_sec = 1L;
timer.tv_usec = 0L;
}
/* CHECK FOR CPU SAVER MODE */
if (!cpu_saver && get_int_var(CPU_SAVER_AFTER_VAR))
if (now - idle_time > get_int_var(CPU_SAVER_AFTER_VAR) * 60)
cpu_saver_on(0, NULL);
rd = readables;
wd = writables;
FD_ZERO(&wd);
FD_ZERO(&rd);
set_screens(&rd, &wd);
set_server_bits(&rd, &wd);
set_process_bits(&rd);
set_socket_read(&rd, &wd);
set_nslookupfd(&rd);
clock_timeout.tv_sec = 60 - now % 60;
if (cpu_saver && get_int_var(CPU_SAVER_EVERY_VAR))
clock_timeout.tv_sec += (get_int_var(CPU_SAVER_EVERY_VAR) - 1) * 60;
if (!timeptr)
timeptr = &clock_timeout;
timer.tv_sec = TimerTimeout();
if (timer.tv_sec <= timeptr->tv_sec)
timeptr = &timer;
#if 1
if ((hold_over = unhold_windows()))
timeptr = &right_away;
#endif
/* GO AHEAD AND WAIT FOR SOME DATA TO COME IN */
switch (new_select(&rd, &wd, timeptr))
{
case 0:
break;
case -1:
{
/* if we just got a sigint */
if (cntl_c_hit)
{
key_pressed = 3;
edit_char('\003');
cntl_c_hit = 0;
}
else if (errno != EINTR)
yell("Select failed with [%s]", strerror(errno));
break;
}
/* we got something on one of the descriptors */
default:
{
make_window_current(last_input_screen->current_window);
do_server(&rd, &wd);
do_processes(&rd);
do_screens(&rd);
#ifdef WANT_CDCC
dcc_sendfrom_queue();
#endif
dcc_check_idle();
print_nslookup(&rd);
scan_sockets(&rd, &wd);
break;
}
}
ExecuteTimers();
#ifdef WANT_TCL
check_utimers();
#endif
get_child_exit(-1);
if (!hold_over)
cursor_to_input();
timeptr = &clock_timeout;
for (screen = screen_list; screen; screen = screen->next)
if (screen->alive && is_cursor_in_display(screen))
timeptr = &cursor_timeout;
if (get_int_var(LLOOK_VAR) && from_server > -1 && !server_list[from_server].link_look)
{
if (time(NULL) - server_list[from_server].link_look_time > get_int_var(LLOOK_DELAY_VAR))
{
server_list[from_server].link_look++;
my_send_to_server(from_server, "LINKS");
server_list[from_server].link_look_time = time(NULL);
}
}
if (update_clock(RESET_TIME))
{
do_notify();
#ifdef WANT_TCL
check_timers();
#endif
clean_whowas_chan_list();
clean_whowas_list();
clean_flood_list();
if (get_int_var(CLOCK_VAR) || check_mail_status())
{
update_all_status(current_window, NULL, 0);
cursor_to_input();
}
check_server_connect(from_server);
}
/* (set in term.c) -- we should redraw the screen here */
if (need_redraw)
refresh_screen(0, NULL);
FromUserHost = empty_string;
alloca(0);
caller[level] = NULL;
level--;
return;
}
void detachcmd(char *, char *, char *, char *);
int main(int argc, char *argv[], char *envp[])
{
char *channel;
srand((unsigned)time(NULL));
time(&start_time);
time(&idle_time);
#if defined(__EMX__)
setvbuf(stdout, NULL, _IOLBF, 80);
#endif
#ifdef SOCKS
SOCKSinit(argv[0]);
#endif
#ifdef TDEBUG
*cx_file = 0;
cx_line = 0;
*cx_function = 0;
#endif
#ifndef __EMX__
printf("Process [%d]", getpid());
if (isatty(0))
{
char *s;
if ((s = ttyname(0)))
{
printf(" connected to tty [%s]", s);
strncpy(attach_ttyname, s, 400);
}
}
else
dumb_mode = 1;
printf("\n");
#endif
channel = parse_args(argv, argc, envp);
init_socketpath();
#ifdef WANT_DETACH
if (reconnect && !background)
reattach_tty(old_tty, old_pass);
#endif
#ifdef WANT_TCL
interp = Tcl_CreateInterp();
#endif
ns_init();
FD_ZERO(&readables);
FD_ZERO(&writables);
if (!dumb_mode && term_init())
_exit(1);
if (background)
{
#ifdef WANT_DETACH
detachcmd(NULL, NULL, NULL, NULL);
#else
fprintf(stderr, "Try compiling with WANT_DETACH\r\n");
exit(0);
#endif
}
#ifndef BITCHX_DEBUG
my_signal(SIGSEGV, coredump, 0);
my_signal(SIGBUS, coredump, 0);
#endif
my_signal(SIGQUIT, SIG_IGN, 0);
my_signal(SIGHUP, irc_exit_old, 0);
my_signal(SIGTERM, irc_exit_old, 0);
my_signal(SIGPIPE, SIG_IGN, 0);
my_signal(SIGINT, cntl_c, 0);
my_signal(SIGCHLD, child_reap, 0);
my_signal(SIGALRM, nothing, 0);
my_signal(SIGUSR1, sig_user1, 0);
if (!dumb_mode && !init_screen())
{
if (background)
{
use_input = 0;
main_screen->fdin = main_screen->fdout = open("/dev/null", O_RDWR|O_NOCTTY);
new_open(main_screen->fdin);
main_screen->fpout = fdopen(1, "w");
main_screen->fpin = fdopen(0, "r");
}
#ifndef __EMX__
my_signal(SIGCONT, term_cont, 0);
#ifndef WINNT
my_signal(SIGWINCH, sig_refresh_screen, 0);
#endif
#endif
}
else
{
if (background)
{
my_signal(SIGHUP, SIG_IGN, 0);
background = 0;
#ifndef WANT_DETACH
term_reset();
fprintf(stderr, "try recompiling the client with WANT_DETACH defined\r\n");
exit(0);
use_input = 0;
#endif
}
create_new_screen();
new_window(main_screen);
}
init_keys_1();
init_variables();
if (!dumb_mode)
{
build_status(current_window, NULL, 0);
update_input(UPDATE_ALL);
}
#if defined(WINNT) || defined(__EMX__)
start_identd();
#endif
#ifdef WANT_TCL
tcl_init();
#ifdef WANT_TK
Tk_Init(interp);
#endif
add_tcl_vars();
#endif
#ifdef CLOAKED
initsetproctitle(argc, argv, envp);
sprintf(proctitlestr, CLOAKED);
setproctitle("%s", proctitlestr);
#endif
display_bitchx(-1);
if (bflag)
load_scripts();
reinit_autoresponse(current_window, NULL, 0);
start_memdebug();
if (auto_connect)
{
get_connected(0, -1);
if (channel)
{
set_current_channel_by_refnum(0, channel);
add_channel(channel, primary_server, 0);
new_free(&channel);
xterm_settitle();
}
} else
display_server_list();
set_input(empty_string);
get_line(NULL, -1, send_line);
#ifdef __EMXPM__
avio_exit();
#else
ircpanic("get_line() returned");
#endif
return (-((int)0xdead));
}
|