Changeset cf83b7a for commands.c
- Timestamp:
- Jun 30, 2003, 6:12:40 PM (21 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 453bd70
- Parents:
- c9334b1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
commands.c
r03ad7b2 rcf83b7a 77 77 "start-command [initial-value]", 78 78 "Initializes the command field to initial-value."), 79 80 OWLCMD_ARGS("start-question", owl_command_start_question, OWL_CTX_INTERACTIVE, 81 "prompts the user to enter a response to some question", 82 "start-command <question>", 83 ""), 79 84 80 85 OWLCMD_ARGS("alias", owl_command_alias, OWL_CTX_ANY, … … 758 763 "", ""), 759 764 765 OWLCMD_VOID_CTX("editresponse:done", owl_command_editresponse_done, 766 OWL_CTX_EDITRESPONSE, 767 "completes the response to a question", 768 "", ""), 769 760 770 OWLCMD_VOID_CTX("editmulti:move-up-line", owl_editwin_key_up, 761 771 OWL_CTX_EDITMULTI, … … 835 845 }; 836 846 837 void owl_command_info() { 847 void owl_command_info() 848 { 838 849 owl_function_info(); 839 850 } 840 851 841 void owl_command_nop() { 842 } 843 844 char *owl_command_help(int argc, char **argv, char *buff) { 852 void owl_command_nop() 853 { 854 } 855 856 char *owl_command_help(int argc, char **argv, char *buff) 857 { 845 858 if (argc!=2) { 846 859 owl_help(); … … 852 865 } 853 866 854 char *owl_command_zlist(int argc, char **argv, char *buff) { 867 char *owl_command_zlist(int argc, char **argv, char *buff) 868 { 855 869 int elapsed=0, timesort=0; 856 870 char *file=NULL; … … 884 898 } 885 899 886 char *owl_command_alist() { 900 char *owl_command_alist() 901 { 887 902 owl_function_buddylist(1, 0, NULL); 888 903 return(NULL); 889 904 } 890 905 891 char *owl_command_blist() { 906 char *owl_command_blist() 907 { 892 908 owl_function_buddylist(1, 1, NULL); 893 909 return(NULL); 894 910 } 895 911 896 char *owl_command_toggleoneline() { 912 char *owl_command_toggleoneline() 913 { 897 914 owl_function_toggleoneline(); 898 915 return(NULL); 899 916 } 900 917 901 void owl_command_about() { 918 void owl_command_about() 919 { 902 920 owl_function_about(); 903 921 } 904 922 905 void owl_command_version() { 923 void owl_command_version() 924 { 906 925 char buff[1024]; 907 926 … … 1014 1033 } 1015 1034 1016 char *owl_command_dump(int argc, char **argv, char *buff) { 1035 char *owl_command_dump(int argc, char **argv, char *buff) 1036 { 1017 1037 if (argc!=2) { 1018 1038 owl_function_makemsg("usage: dump <filename>"); … … 1024 1044 } 1025 1045 1026 char *owl_command_next(int argc, char **argv, char *buff) { 1046 char *owl_command_next(int argc, char **argv, char *buff) 1047 { 1027 1048 char *filter=NULL; 1028 1049 int skip_deleted=0, last_if_none=0; … … 1053 1074 } 1054 1075 1055 char *owl_command_prev(int argc, char **argv, char *buff) { 1076 char *owl_command_prev(int argc, char **argv, char *buff) 1077 { 1056 1078 char *filter=NULL; 1057 1079 int skip_deleted=0, first_if_none=0; … … 1082 1104 } 1083 1105 1084 char *owl_command_smartnarrow(int argc, char **argv, char *buff) { 1106 char *owl_command_smartnarrow(int argc, char **argv, char *buff) 1107 { 1085 1108 char *filtname = NULL; 1086 1109 … … 1099 1122 } 1100 1123 1101 char *owl_command_smartfilter(int argc, char **argv, char *buff) { 1124 char *owl_command_smartfilter(int argc, char **argv, char *buff) 1125 { 1102 1126 char *filtname = NULL; 1103 1127 … … 1112 1136 } 1113 1137 1114 void owl_command_expunge() { 1138 void owl_command_expunge() 1139 { 1115 1140 owl_function_expunge(); 1116 1141 } 1117 1142 1118 void owl_command_first() { 1143 void owl_command_first() 1144 { 1119 1145 owl_global_set_rightshift(&g, 0); 1120 1146 owl_function_firstmsg(); 1121 1147 } 1122 1148 1123 void owl_command_last() { 1149 void owl_command_last() 1150 { 1124 1151 owl_function_lastmsg(); 1125 1152 } 1126 1153 1127 void owl_command_resize() { 1154 void owl_command_resize() 1155 { 1128 1156 owl_function_resize(); 1129 1157 } 1130 1158 1131 void owl_command_redisplay() { 1159 void owl_command_redisplay() 1160 { 1132 1161 owl_function_full_redisplay(); 1133 1162 owl_global_set_needrefresh(&g); 1134 1163 } 1135 1164 1136 void owl_command_shift_right() { 1165 void owl_command_shift_right() 1166 { 1137 1167 owl_function_shift_right(); 1138 1168 } 1139 1169 1140 void owl_command_shift_left() { 1170 void owl_command_shift_left() 1171 { 1141 1172 owl_function_shift_left(); 1142 1173 } 1143 1174 1144 void owl_command_unsuball() { 1175 void owl_command_unsuball() 1176 { 1145 1177 owl_function_unsuball(); 1146 1178 } 1147 1179 1148 char *owl_command_loadsubs(int argc, char **argv, char *buff) { 1180 char *owl_command_loadsubs(int argc, char **argv, char *buff) 1181 { 1149 1182 if (argc == 2) { 1150 1183 owl_function_loadsubs(argv[1]); … … 1159 1192 1160 1193 1161 char *owl_command_loadloginsubs(int argc, char **argv, char *buff) { 1194 char *owl_command_loadloginsubs(int argc, char **argv, char *buff) 1195 { 1162 1196 if (argc == 2) { 1163 1197 owl_function_loadloginsubs(argv[1]); … … 1171 1205 } 1172 1206 1173 void owl_command_suspend() { 1207 void owl_command_suspend() 1208 { 1174 1209 owl_function_suspend(); 1175 1210 } 1176 1211 1177 char *owl_command_start_command(int argc, char **argv, char *buff) { 1212 char *owl_command_start_command(int argc, char **argv, char *buff) 1213 { 1178 1214 buff = skiptokens(buff, 1); 1179 1215 owl_function_start_command(buff); 1180 return NULL; 1181 } 1182 1183 char *owl_command_zaway(int argc, char **argv, char *buff) { 1184 1216 return(NULL); 1217 } 1218 1219 char *owl_command_start_question(int argc, char **argv, char *buff) 1220 { 1221 buff = skiptokens(buff, 1); 1222 owl_function_start_question(buff); 1223 return(NULL); 1224 } 1225 1226 char *owl_command_zaway(int argc, char **argv, char *buff) 1227 { 1185 1228 if ((argc==1) || 1186 1229 ((argc==2) && !strcmp(argv[1], "on"))) { … … 1207 1250 1208 1251 1209 char *owl_command_set(int argc, char **argv, char *buff) { 1252 char *owl_command_set(int argc, char **argv, char *buff) 1253 { 1210 1254 char *var, *val; 1211 1255 int silent=0; … … 1237 1281 } 1238 1282 1239 char *owl_command_unset(int argc, char **argv, char *buff) { 1283 char *owl_command_unset(int argc, char **argv, char *buff) 1284 { 1240 1285 char *var, *val; 1241 1286 int silent=0; … … 1256 1301 } 1257 1302 1258 char *owl_command_print(int argc, char **argv, char *buff) { 1303 char *owl_command_print(int argc, char **argv, char *buff) 1304 { 1259 1305 char *var; 1260 1306 char valbuff[1024]; … … 1280 1326 1281 1327 1282 char *owl_command_exec(int argc, char **argv, char *buff) { 1328 char *owl_command_exec(int argc, char **argv, char *buff) 1329 { 1283 1330 return owl_function_exec(argc, argv, buff, 0); 1284 1331 } 1285 1332 1286 char *owl_command_pexec(int argc, char **argv, char *buff) { 1333 char *owl_command_pexec(int argc, char **argv, char *buff) 1334 { 1287 1335 return owl_function_exec(argc, argv, buff, 1); 1288 1336 } 1289 1337 1290 char *owl_command_aexec(int argc, char **argv, char *buff) { 1338 char *owl_command_aexec(int argc, char **argv, char *buff) 1339 { 1291 1340 return owl_function_exec(argc, argv, buff, 2); 1292 1341 } 1293 1342 1294 char *owl_command_perl(int argc, char **argv, char *buff) { 1343 char *owl_command_perl(int argc, char **argv, char *buff) 1344 { 1295 1345 return owl_function_perl(argc, argv, buff, 0); 1296 1346 } 1297 1347 1298 char *owl_command_pperl(int argc, char **argv, char *buff) { 1348 char *owl_command_pperl(int argc, char **argv, char *buff) 1349 { 1299 1350 return owl_function_perl(argc, argv, buff, 1); 1300 1351 } 1301 1352 1302 char *owl_command_aperl(int argc, char **argv, char *buff) { 1353 char *owl_command_aperl(int argc, char **argv, char *buff) 1354 { 1303 1355 return owl_function_perl(argc, argv, buff, 2); 1304 1356 } 1305 1357 1306 char *owl_command_multi(int argc, char **argv, char *buff) { 1358 char *owl_command_multi(int argc, char **argv, char *buff) 1359 { 1307 1360 char *lastrv = NULL, *newbuff; 1308 1361 char **commands; … … 1338 1391 1339 1392 1340 char *owl_command_alias(int argc, char **argv, char *buff) { 1393 char *owl_command_alias(int argc, char **argv, char *buff) 1394 { 1341 1395 if (argc < 3) { 1342 1396 owl_function_makemsg("Invalid arguments to 'alias' command."); … … 1349 1403 1350 1404 1351 char *owl_command_bindkey(int argc, char **argv, char *buff) { 1405 char *owl_command_bindkey(int argc, char **argv, char *buff) 1406 { 1352 1407 owl_keymap *km; 1353 1408 int ret; … … 1372 1427 } 1373 1428 1374 void owl_command_quit() { 1429 void owl_command_quit() 1430 { 1375 1431 owl_function_quit(); 1376 1432 } 1377 1433 1378 char *owl_command_debug(int argc, char **argv, char *buff) { 1434 char *owl_command_debug(int argc, char **argv, char *buff) 1435 { 1379 1436 if (argc<2) { 1380 1437 owl_function_makemsg("Need at least one argument to debug command"); … … 1391 1448 } 1392 1449 1393 char *owl_command_term(int argc, char **argv, char *buff) { 1450 char *owl_command_term(int argc, char **argv, char *buff) 1451 { 1394 1452 if (argc<2) { 1395 1453 owl_function_makemsg("Need at least one argument to the term command"); … … 1407 1465 } 1408 1466 1409 char *owl_command_zlog(int argc, char **argv, char *buff) { 1467 char *owl_command_zlog(int argc, char **argv, char *buff) 1468 { 1410 1469 if ((argc<2) || (argc>3)) { 1411 1470 owl_function_makemsg("Wrong number of arguments for zlog command"); … … 1431 1490 1432 1491 1433 void owl_command_zlog_out(void) { 1492 void owl_command_zlog_out(void) 1493 { 1434 1494 owl_zephyr_zlog_out(); 1435 1495 } 1436 1496 1437 1497 1438 char *owl_command_subscribe(int argc, char **argv, char *buff) { 1498 char *owl_command_subscribe(int argc, char **argv, char *buff) 1499 { 1439 1500 char *recip=""; 1440 1501 int temp=0; … … 1476 1537 1477 1538 1478 char *owl_command_unsubscribe(int argc, char **argv, char *buff) { 1539 char *owl_command_unsubscribe(int argc, char **argv, char *buff) 1540 { 1479 1541 char *recip=""; 1480 1542 int temp=0; … … 1515 1577 } 1516 1578 1517 char *owl_command_echo(int argc, char **argv, char *buff) { 1579 char *owl_command_echo(int argc, char **argv, char *buff) 1580 { 1518 1581 buff = skiptokens(buff, 1); 1519 1582 owl_function_popless_text(buff); … … 1521 1584 } 1522 1585 1523 void owl_command_getsubs() { 1586 void owl_command_getsubs(void) 1587 { 1524 1588 owl_function_getsubs(); 1525 1589 } 1526 1590 1527 void owl_command_status() { 1591 void owl_command_status(void) 1592 { 1528 1593 owl_function_status(); 1529 1594 } 1530 1595 1531 char *owl_command_zwrite(int argc, char **argv, char *buff) { 1596 char *owl_command_zwrite(int argc, char **argv, char *buff) 1597 { 1532 1598 owl_zwrite z; 1533 1599 … … 1549 1615 } 1550 1616 1551 char *owl_command_aimwrite(int argc, char **argv, char *buff) { 1617 char *owl_command_aimwrite(int argc, char **argv, char *buff) 1618 { 1552 1619 char *newbuff; 1553 1620 int i, j; … … 1577 1644 } 1578 1645 1579 char *owl_command_zcrypt(int argc, char **argv, char *buff) { 1646 char *owl_command_zcrypt(int argc, char **argv, char *buff) 1647 { 1580 1648 owl_zwrite z; 1581 1649 … … 1598 1666 } 1599 1667 1600 char *owl_command_reply(int argc, char **argv, char *buff) { 1668 char *owl_command_reply(int argc, char **argv, char *buff) 1669 { 1601 1670 int edit=0; 1602 1671 … … 1623 1692 } 1624 1693 1625 char *owl_command_filter(int argc, char **argv, char *buff) { 1694 char *owl_command_filter(int argc, char **argv, char *buff) 1695 { 1626 1696 owl_function_create_filter(argc, argv); 1627 1697 return NULL; 1628 1698 } 1629 1699 1630 char *owl_command_zlocate(int argc, char **argv, char *buff) { 1700 char *owl_command_zlocate(int argc, char **argv, char *buff) 1701 { 1631 1702 int auth; 1632 1703 … … 1654 1725 } 1655 1726 1656 char *owl_command_view(int argc, char **argv, char *buff) { 1727 char *owl_command_view(int argc, char **argv, char *buff) 1728 { 1657 1729 1658 1730 /* Backwards compatability has made this kind of complicated: … … 1738 1810 1739 1811 1740 char *owl_command_show(int argc, char **argv, char *buff) {1741 1812 char *owl_command_show(int argc, char **argv, char *buff) 1813 { 1742 1814 if (argc<2) { 1743 1815 owl_function_help_for_command("show"); … … 1795 1867 } 1796 1868 1797 char *owl_command_viewclass(int argc, char **argv, char *buff) { 1869 char *owl_command_viewclass(int argc, char **argv, char *buff) 1870 { 1798 1871 char *filtname; 1799 1872 if (argc!=2) { … … 1807 1880 } 1808 1881 1809 char *owl_command_viewuser(int argc, char **argv, char *buff) { 1882 char *owl_command_viewuser(int argc, char **argv, char *buff) 1883 { 1810 1884 char *filtname; 1811 1885 if (argc!=2) { … … 1820 1894 1821 1895 1822 void owl_command_pop_message(void) { 1896 void owl_command_pop_message(void) 1897 { 1823 1898 owl_function_curmsg_to_popwin(); 1824 1899 } 1825 1900 1826 void owl_command_openurl(void) { 1901 void owl_command_openurl(void) 1902 { 1827 1903 owl_function_openurl(); 1828 1904 } 1829 1905 1830 char *owl_command_delete(int argc, char **argv, char *buff) { 1906 char *owl_command_delete(int argc, char **argv, char *buff) 1907 { 1831 1908 int move_after = 1; 1832 1909 … … 1861 1938 } 1862 1939 1863 char *owl_command_undelete(int argc, char **argv, char *buff) { 1940 char *owl_command_undelete(int argc, char **argv, char *buff) 1941 { 1864 1942 int move_after = 1; 1865 1943 … … 1889 1967 } 1890 1968 1891 void owl_command_beep() { 1969 void owl_command_beep() 1970 { 1892 1971 owl_function_beep(); 1893 1972 } 1894 1973 1895 char *owl_command_colorview(int argc, char **argv, char *buff) { 1974 char *owl_command_colorview(int argc, char **argv, char *buff) 1975 { 1896 1976 if (argc!=2) { 1897 1977 owl_function_makemsg("Wrong number of arguments to colorview command"); … … 1902 1982 } 1903 1983 1904 char *owl_command_zpunt(int argc, char **argv, char *buff) { 1984 char *owl_command_zpunt(int argc, char **argv, char *buff) 1985 { 1905 1986 owl_command_zpunt_and_zunpunt(argc, argv, 0); 1906 1987 return NULL; 1907 1988 } 1908 1989 1909 char *owl_command_zunpunt(int argc, char **argv, char *buff) { 1990 char *owl_command_zunpunt(int argc, char **argv, char *buff) 1991 { 1910 1992 owl_command_zpunt_and_zunpunt(argc, argv, 1); 1911 1993 return NULL; … … 1913 1995 1914 1996 1915 void owl_command_zpunt_and_zunpunt(int argc, char **argv, int type) { 1997 void owl_command_zpunt_and_zunpunt(int argc, char **argv, int type) 1998 { 1916 1999 /* if type==0 then zpunt 1917 2000 * if type==1 then zunpunt … … 1949 2032 } 1950 2033 1951 char *owl_command_smartzpunt(int argc, char **argv, char *buff) { 2034 char *owl_command_smartzpunt(int argc, char **argv, char *buff) 2035 { 1952 2036 if (argc == 1) { 1953 2037 owl_function_smartzpunt(0); … … 1960 2044 } 1961 2045 1962 char *owl_command_getview(int argc, char **argv, char *buff) { 2046 char *owl_command_getview(int argc, char **argv, char *buff) 2047 { 1963 2048 char *filtname; 1964 2049 if (argc != 1) { … … 1971 2056 } 1972 2057 1973 char *owl_command_getvar(int argc, char **argv, char *buff) { 2058 char *owl_command_getvar(int argc, char **argv, char *buff) 2059 { 1974 2060 char tmpbuff[1024]; 1975 2061 if (argc != 2) { … … 1984 2070 } 1985 2071 1986 char *owl_command_search(int argc, char **argv, char *buff) { 2072 char *owl_command_search(int argc, char **argv, char *buff) 2073 { 1987 2074 int direction; 1988 2075 char *buffstart; … … 2004 2091 } 2005 2092 2006 char *owl_command_aimlogin(int argc, char **argv, char *buff) { 2093 char *owl_command_aimlogin(int argc, char **argv, char *buff) 2094 { 2007 2095 int ret; 2008 2096 … … 2031 2119 } 2032 2120 2033 char *owl_command_aimlogout(int argc, char **argv, char *buff) { 2121 char *owl_command_aimlogout(int argc, char **argv, char *buff) 2122 { 2034 2123 /* clear the buddylist */ 2035 2124 owl_buddylist_clear(owl_global_get_buddylist(&g)); … … 2043 2132 /*********************************************************************/ 2044 2133 2045 void owl_command_edit_cancel(owl_editwin *e) { 2134 void owl_command_edit_cancel(owl_editwin *e) 2135 { 2046 2136 owl_history *hist; 2047 2137 … … 2057 2147 owl_global_set_typwin_inactive(&g); 2058 2148 owl_editwin_new_style(e, OWL_EDITWIN_STYLE_ONELINE, NULL); 2059 } 2060 2061 void owl_command_edit_history_prev(owl_editwin *e) { 2149 2150 owl_function_activate_keymap("recv"); 2151 } 2152 2153 void owl_command_edit_history_prev(owl_editwin *e) 2154 { 2062 2155 owl_history *hist; 2063 2156 char *ptr; … … 2079 2172 } 2080 2173 2081 void owl_command_edit_history_next(owl_editwin *e) { 2174 void owl_command_edit_history_next(owl_editwin *e) 2175 { 2082 2176 owl_history *hist; 2083 2177 char *ptr; … … 2095 2189 } 2096 2190 2097 char *owl_command_edit_insert_text(owl_editwin *e, int argc, char **argv, char *buff) { 2191 char *owl_command_edit_insert_text(owl_editwin *e, int argc, char **argv, char *buff) 2192 { 2098 2193 buff = skiptokens(buff, 1); 2099 2194 owl_editwin_insert_string(e, buff); … … 2103 2198 } 2104 2199 2105 void owl_command_editline_done(owl_editwin *e) { 2200 void owl_command_editline_done(owl_editwin *e) 2201 { 2106 2202 owl_history *hist=owl_editwin_get_history(e); 2107 2203 char *rv, *cmd; … … 2124 2220 } 2125 2221 2126 void owl_command_editmulti_done(owl_editwin *e) { 2222 2223 void owl_command_editresponse_done(owl_editwin *e) 2224 { 2225 owl_global_set_response(&g, owl_editwin_get_text(e)); 2226 2227 owl_global_set_typwin_inactive(&g); 2228 owl_editwin_fullclear(e); 2229 wnoutrefresh(owl_editwin_get_curswin(e)); 2230 owl_global_set_needrefresh(&g); 2231 2232 owl_function_makemsg("Thank you"); 2233 } 2234 2235 2236 void owl_command_editmulti_done(owl_editwin *e) 2237 { 2127 2238 owl_history *hist=owl_editwin_get_history(e); 2128 2239 … … 2138 2249 } 2139 2250 2140 void owl_command_editmulti_done_or_delete(owl_editwin *e) { 2251 void owl_command_editmulti_done_or_delete(owl_editwin *e) 2252 { 2141 2253 if (owl_editwin_is_at_end(e)) { 2142 2254 owl_command_editmulti_done(e); … … 2151 2263 /*********************************************************************/ 2152 2264 2153 void owl_command_popless_quit(owl_viewwin *vw) { 2265 void owl_command_popless_quit(owl_viewwin *vw) 2266 { 2154 2267 owl_popwin_close(owl_global_get_popwin(&g)); 2155 2268 owl_viewwin_free(vw);
Note: See TracChangeset
for help on using the changeset viewer.