Changeset d09e5a1
- Timestamp:
- May 31, 2003, 3:33:42 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:
- 5e53c4a
- Parents:
- c86a35c
- Files:
-
- 1 added
- 1 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
ChangeLog
rc269e22 rd09e5a1 69 69 do_encrypt declaired static 70 70 if we don't have des functions, do not try to build in zcrypt 71 kill the newmsgproc function on exit 72 Added libfaim 73 Added basic AIM support, including the "aimlogin", "aimwrite" and 74 "aimlogout" commands 71 75 72 76 1.2.8 -
Makefile.in
raaf6071 rd09e5a1 10 10 11 11 CC=@CC@ 12 LIBS=@LIBS@ 13 CFLAGS=@CFLAGS@ - DDATADIR=\"${datadir}\"12 LIBS=@LIBS@ -L./libfaim -lfaim 13 CFLAGS=@CFLAGS@ -I. -I./libfaim -DDATADIR=\"${datadir}\" 14 14 LDFLAGS=@LDFLAGS@ 15 15 XSUBPPDIR=@XSUBPPDIR@ … … 22 22 readconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \ 23 23 regex.c history.c view.c dict.c variable.c filterelement.c pair.c \ 24 keypress.c keymap.c keybinding.c cmd.c context.c zcrypt.c 24 keypress.c keymap.c keybinding.c cmd.c context.c zcrypt.c aim.c 25 25 OWL_SRC = owl.c 26 26 TESTER_SRC = tester.c … … 34 34 OBJS = $(BASE_OBJS) $(GEN_O) 35 35 36 AUTOGEN=$(GEN_C) $(GEN_H) 36 #AUTOGEN=$(GEN_C) $(GEN_H) 37 AUTOGEN=$(GEN_C) 37 38 38 39 39 owl: $(AUTOGEN) $(OBJS) owl.o 40 owl: $(AUTOGEN) $(OBJS) owl.o libfaim 40 41 ./athstatic $(CC) -o owl owl.o $(OBJS) $(LDFLAGS) $(LIBS) 41 42 … … 46 47 ./tester reg 47 48 48 clean: 49 clean: libfaimclean 49 50 $(RM) owl tester *.o $(AUTOGEN) owl_prototypes.h.new 50 51 51 distclean: clean 52 distclean: clean libfaimdistclean 52 53 $(RM) config.cache config.log config.status Makefile config.h TAGS *~ core 53 54 54 proto: owl_prototypes.h55 #proto: owl_prototypes.h 55 56 56 57 perlglue.c: perlglue.xs … … 61 62 62 63 # Only move owl_prototypes.h into place if the new one is different 63 owl_prototypes.h: codelist.pl varstubs.c $(BASE_SRCS) 64 perl codelist.pl | grep -v ZWRITEOPTIONS > owl_prototypes.h.new 65 @cmp -s owl_prototypes.h.new $@ || { \ 66 echo 'Interfaces changed!'; \ 67 echo mv -f owl_prototypes.h.new $@; \ 68 mv -f owl_prototypes.h.new $@; } 64 #owl_prototypes.h: codelist.pl varstubs.c $(BASE_SRCS) 65 # perl codelist.pl | grep -v ZWRITEOPTIONS > owl_prototypes.h.new 66 # @cmp -s owl_prototypes.h.new $@ || { \ 67 # echo 'Interfaces changed!'; \ 68 # echo mv -f owl_prototypes.h.new $@; \ 69 # mv -f owl_prototypes.h.new $@; } 70 owl_prototypes.h: 69 71 70 72 .PHONY: tags clean distclean proto test … … 75 77 etags $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H) 76 78 77 $(BASE_OBJS) varstubs.h:: owl.h config.h owl_prototypes.h 79 #$(BASE_OBJS) varstubs.h:: owl.h config.h owl_prototypes.h 80 $(BASE_OBJS) varstubs.h:: owl.h config.h 81 82 libfaim: libfaim/libfaim.a 83 84 libfaim/libfaim.a: 85 (cd libfaim; $(MAKE)) 86 87 libfaimclean: 88 (cd libfaim; $(MAKE) clean) 89 90 libfaimdistclean: 91 (cd libfaim; $(MAKE) distclean) 78 92 79 93 all: owl … … 83 97 ${INSTALL_DATA} doc/owl.1 ${mandir}/man1/owl.1 84 98 85 86 99 installdirs: mkinstalldirs 87 100 ${srcdir}/mkinstalldirs ${bindir} ${mandir}/man1 ${datadir}/owl -
athstatic
r601a9e0 rd09e5a1 29 29 done 30 30 31 echo "$progname" $options 31 32 exec "$progname" $options -
commands.c
recd5dc5 rd09e5a1 111 111 "-O opcode\n" 112 112 " Send to the specified opcode\n"), 113 114 OWLCMD_ARGS("aimwrite", owl_command_aimwrite, OWL_CTX_INTERACTIVE, 115 "send a zephyr", 116 "aimzwrite <user>", 117 "Send an aim message to a user.\n"), 113 118 114 119 /* … … 566 571 "is performed backwards"), 567 572 573 OWLCMD_ARGS("aimlogin", owl_command_aimlogin, OWL_CTX_ANY, 574 "login to an AIM account", 575 "aimlogin <screenname> <password>\n", 576 ""), 577 578 OWLCMD_ARGS("aimlogout", owl_command_aimlogout, OWL_CTX_ANY, 579 "logout from AIM", 580 "aimlogout\n", 581 ""), 582 583 568 584 /****************************************************************/ 569 585 /************************* EDIT-SPECIFIC ************************/ … … 1205 1221 owl_function_xterm_deiconify(); 1206 1222 } else { 1207 owl_function_makemsg("U known terminal subcommand");1223 owl_function_makemsg("Unknown terminal subcommand"); 1208 1224 } 1209 1225 return(NULL); … … 1353 1369 tmpbuff = owl_strdup(buff); 1354 1370 owl_function_zwrite_setup(tmpbuff); 1371 owl_global_set_buffercommand(&g, tmpbuff); 1372 owl_free(tmpbuff); 1373 } 1374 return NULL; 1375 } 1376 1377 char *owl_command_aimwrite(int argc, char **argv, char *buff) { 1378 char *tmpbuff, *pos, *cmd, *msg; 1379 1380 if (argc < 2) { 1381 owl_function_makemsg("Not enough arguments to the aimwrite command."); 1382 } else { 1383 tmpbuff = owl_strdup(buff); 1384 owl_function_aimwrite_setup(tmpbuff); 1355 1385 owl_global_set_buffercommand(&g, tmpbuff); 1356 1386 owl_free(tmpbuff); … … 1740 1770 } 1741 1771 1772 char *owl_command_aimlogin(int argc, char **argv, char *buff) { 1773 int ret; 1774 1775 if (argc!=3) { 1776 owl_function_makemsg("Wrong number of arguments to aimlogin command"); 1777 return(NULL); 1778 } 1779 ret=owl_aim_login(argv[1], argv[2]); 1780 if (!ret) { 1781 owl_function_makemsg("%s logged in.\n", argv[1]); 1782 return(NULL); 1783 } 1784 1785 owl_function_makemsg("Warning: login for %s failed.\n"); 1786 return(NULL); 1787 } 1788 1789 char *owl_command_aimlogout(int argc, char **argv, char *buff) { 1790 owl_aim_logout(); 1791 return(NULL); 1792 } 1793 1742 1794 /*********************************************************************/ 1743 1795 /************************** EDIT SPECIFIC ****************************/ -
configure
rc269e22 rd09e5a1 1147 1147 fi 1148 1148 1149 echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6 1150 echo "configure:1151: checking for res_search in -lresolv" >&5 1151 ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'` 1152 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then 1153 echo $ac_n "(cached) $ac_c" 1>&6 1154 else 1155 ac_save_LIBS="$LIBS" 1156 LIBS="-lresolv $LIBS" 1157 cat > conftest.$ac_ext <<EOF 1158 #line 1159 "configure" 1159 #include "confdefs.h" 1160 /* Override any gcc2 internal prototype to avoid an error. */ 1161 /* We use char because int might match the return type of a gcc2 1162 builtin and then its argument prototype would still apply. */ 1163 char res_search(); 1164 1165 int main() { 1166 res_search() 1167 ; return 0; } 1168 EOF 1169 if { (eval echo configure:1170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 1170 rm -rf conftest* 1171 eval "ac_cv_lib_$ac_lib_var=yes" 1172 else 1173 echo "configure: failed program was:" >&5 1174 cat conftest.$ac_ext >&5 1175 rm -rf conftest* 1176 eval "ac_cv_lib_$ac_lib_var=no" 1177 fi 1178 rm -f conftest* 1179 LIBS="$ac_save_LIBS" 1180 1181 fi 1182 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then 1183 echo "$ac_t""yes" 1>&6 1184 ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/[^a-zA-Z0-9_]/_/g' \ 1185 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` 1186 cat >> confdefs.h <<EOF 1187 #define $ac_tr_lib 1 1188 EOF 1189 1190 LIBS="-lresolv $LIBS" 1191 1192 else 1193 echo "$ac_t""no" 1>&6 1194 fi 1195 1149 1196 echo $ac_n "checking for krb5_get_credentials in -lkrb5""... $ac_c" 1>&6 1150 echo "configure:11 51: checking for krb5_get_credentials in -lkrb5" >&51197 echo "configure:1198: checking for krb5_get_credentials in -lkrb5" >&5 1151 1198 ac_lib_var=`echo krb5'_'krb5_get_credentials | sed 'y%./+-%__p_%'` 1152 1199 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1156 1203 LIBS="-lkrb5 $LIBS" 1157 1204 cat > conftest.$ac_ext <<EOF 1158 #line 1 159"configure"1205 #line 1206 "configure" 1159 1206 #include "confdefs.h" 1160 1207 /* Override any gcc2 internal prototype to avoid an error. */ … … 1167 1214 ; return 0; } 1168 1215 EOF 1169 if { (eval echo configure:1 170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then1216 if { (eval echo configure:1217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 1170 1217 rm -rf conftest* 1171 1218 eval "ac_cv_lib_$ac_lib_var=yes" … … 1195 1242 1196 1243 echo $ac_n "checking for krb_sendauth in -lkrb4""... $ac_c" 1>&6 1197 echo "configure:1 198: checking for krb_sendauth in -lkrb4" >&51244 echo "configure:1245: checking for krb_sendauth in -lkrb4" >&5 1198 1245 ac_lib_var=`echo krb4'_'krb_sendauth | sed 'y%./+-%__p_%'` 1199 1246 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1203 1250 LIBS="-lkrb4 $LIBS" 1204 1251 cat > conftest.$ac_ext <<EOF 1205 #line 12 06"configure"1252 #line 1253 "configure" 1206 1253 #include "confdefs.h" 1207 1254 /* Override any gcc2 internal prototype to avoid an error. */ … … 1214 1261 ; return 0; } 1215 1262 EOF 1216 if { (eval echo configure:12 17: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then1263 if { (eval echo configure:1264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 1217 1264 rm -rf conftest* 1218 1265 eval "ac_cv_lib_$ac_lib_var=yes" … … 1239 1286 else 1240 1287 echo "$ac_t""no" 1>&6 1241 fi1242 1243 1288 echo $ac_n "checking for krb_sendauth in -lkrb""... $ac_c" 1>&6 1244 echo "configure:12 45: checking for krb_sendauth in -lkrb" >&51289 echo "configure:1290: checking for krb_sendauth in -lkrb" >&5 1245 1290 ac_lib_var=`echo krb'_'krb_sendauth | sed 'y%./+-%__p_%'` 1246 1291 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1250 1295 LIBS="-lkrb $LIBS" 1251 1296 cat > conftest.$ac_ext <<EOF 1252 #line 12 53"configure"1297 #line 1298 "configure" 1253 1298 #include "confdefs.h" 1254 1299 /* Override any gcc2 internal prototype to avoid an error. */ … … 1261 1306 ; return 0; } 1262 1307 EOF 1263 if { (eval echo configure:1 264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then1308 if { (eval echo configure:1309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 1264 1309 rm -rf conftest* 1265 1310 eval "ac_cv_lib_$ac_lib_var=yes" … … 1276 1321 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then 1277 1322 echo "$ac_t""yes" 1>&6 1278 ac_tr_lib=HAVE_LIB`echo krb | sed -e 's/ [^a-zA-Z0-9_]/_/g' \1323 ac_tr_lib=HAVE_LIB`echo krb | sed -e 's/^a-zA-Z0-9_/_/g' \ 1279 1324 -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` 1280 1325 cat >> confdefs.h <<EOF … … 1288 1333 fi 1289 1334 1335 fi 1336 1290 1337 echo $ac_n "checking for ZGetSender in -lzephyr""... $ac_c" 1>&6 1291 echo "configure:1 292: checking for ZGetSender in -lzephyr" >&51338 echo "configure:1339: checking for ZGetSender in -lzephyr" >&5 1292 1339 ac_lib_var=`echo zephyr'_'ZGetSender | sed 'y%./+-%__p_%'` 1293 1340 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1297 1344 LIBS="-lzephyr $LIBS" 1298 1345 cat > conftest.$ac_ext <<EOF 1299 #line 13 00"configure"1346 #line 1347 "configure" 1300 1347 #include "confdefs.h" 1301 1348 /* Override any gcc2 internal prototype to avoid an error. */ … … 1308 1355 ; return 0; } 1309 1356 EOF 1310 if { (eval echo configure:13 11: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then1357 if { (eval echo configure:1358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 1311 1358 rm -rf conftest* 1312 1359 eval "ac_cv_lib_$ac_lib_var=yes" … … 1337 1384 1338 1385 echo $ac_n "checking for ZInitLocationInfo in -lzephyr""... $ac_c" 1>&6 1339 echo "configure:13 40: checking for ZInitLocationInfo in -lzephyr" >&51386 echo "configure:1387: checking for ZInitLocationInfo in -lzephyr" >&5 1340 1387 ac_lib_var=`echo zephyr'_'ZInitLocationInfo | sed 'y%./+-%__p_%'` 1341 1388 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then … … 1345 1392 LIBS="-lzephyr $LIBS" 1346 1393 cat > conftest.$ac_ext <<EOF 1347 #line 13 48"configure"1394 #line 1395 "configure" 1348 1395 #include "confdefs.h" 1349 1396 /* Override any gcc2 internal prototype to avoid an error. */ … … 1356 1403 ; return 0; } 1357 1404 EOF 1358 if { (eval echo configure:1 359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then1405 if { (eval echo configure:1406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 1359 1406 rm -rf conftest* 1360 1407 eval "ac_cv_lib_$ac_lib_var=yes" … … 1383 1430 do 1384 1431 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 1385 echo "configure:1 386: checking for $ac_func" >&51432 echo "configure:1433: checking for $ac_func" >&5 1386 1433 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then 1387 1434 echo $ac_n "(cached) $ac_c" 1>&6 1388 1435 else 1389 1436 cat > conftest.$ac_ext <<EOF 1390 #line 1 391"configure"1437 #line 1438 "configure" 1391 1438 #include "confdefs.h" 1392 1439 /* System header to define __stub macros and hopefully few prototypes, … … 1411 1458 ; return 0; } 1412 1459 EOF 1413 if { (eval echo configure:14 14: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then1460 if { (eval echo configure:1461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then 1414 1461 rm -rf conftest* 1415 1462 eval "ac_cv_func_$ac_func=yes" … … 1437 1484 1438 1485 echo $ac_n "checking for des_ecb_encrypt prototype""... $ac_c" 1>&6 1439 echo "configure:14 40: checking for des_ecb_encrypt prototype" >&51486 echo "configure:1487: checking for des_ecb_encrypt prototype" >&5 1440 1487 cat > conftest.$ac_ext <<EOF 1441 #line 14 42"configure"1488 #line 1489 "configure" 1442 1489 #include "confdefs.h" 1443 1490 #include <des.h> … … 1447 1494 ; return 0; } 1448 1495 EOF 1449 if { (eval echo configure:14 50: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then1496 if { (eval echo configure:1497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 1450 1497 rm -rf conftest* 1451 1498 ac_cv_des_ecb_encrypt_proto=no … … 1467 1514 1468 1515 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 1469 echo "configure:1 470: checking how to run the C preprocessor" >&51516 echo "configure:1517: checking how to run the C preprocessor" >&5 1470 1517 # On Suns, sometimes $CPP names a directory. 1471 1518 if test -n "$CPP" && test -d "$CPP"; then … … 1482 1529 # not just through cpp. 1483 1530 cat > conftest.$ac_ext <<EOF 1484 #line 1 485"configure"1531 #line 1532 "configure" 1485 1532 #include "confdefs.h" 1486 1533 #include <assert.h> … … 1488 1535 EOF 1489 1536 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 1490 { (eval echo configure:1 491: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }1537 { (eval echo configure:1538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1491 1538 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 1492 1539 if test -z "$ac_err"; then … … 1499 1546 CPP="${CC-cc} -E -traditional-cpp" 1500 1547 cat > conftest.$ac_ext <<EOF 1501 #line 15 02"configure"1548 #line 1549 "configure" 1502 1549 #include "confdefs.h" 1503 1550 #include <assert.h> … … 1505 1552 EOF 1506 1553 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 1507 { (eval echo configure:15 08: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }1554 { (eval echo configure:1555: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1508 1555 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 1509 1556 if test -z "$ac_err"; then … … 1516 1563 CPP="${CC-cc} -nologo -E" 1517 1564 cat > conftest.$ac_ext <<EOF 1518 #line 15 19"configure"1565 #line 1566 "configure" 1519 1566 #include "confdefs.h" 1520 1567 #include <assert.h> … … 1522 1569 EOF 1523 1570 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 1524 { (eval echo configure:15 25: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }1571 { (eval echo configure:1572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1525 1572 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 1526 1573 if test -z "$ac_err"; then … … 1547 1594 1548 1595 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 1549 echo "configure:15 50: checking for ANSI C header files" >&51596 echo "configure:1597: checking for ANSI C header files" >&5 1550 1597 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then 1551 1598 echo $ac_n "(cached) $ac_c" 1>&6 1552 1599 else 1553 1600 cat > conftest.$ac_ext <<EOF 1554 #line 1 555"configure"1601 #line 1602 "configure" 1555 1602 #include "confdefs.h" 1556 1603 #include <stdlib.h> … … 1560 1607 EOF 1561 1608 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 1562 { (eval echo configure:1 563: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }1609 { (eval echo configure:1610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1563 1610 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 1564 1611 if test -z "$ac_err"; then … … 1577 1624 # SunOS 4.x string.h does not declare mem*, contrary to ANSI. 1578 1625 cat > conftest.$ac_ext <<EOF 1579 #line 1 580"configure"1626 #line 1627 "configure" 1580 1627 #include "confdefs.h" 1581 1628 #include <string.h> … … 1595 1642 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. 1596 1643 cat > conftest.$ac_ext <<EOF 1597 #line 1 598"configure"1644 #line 1645 "configure" 1598 1645 #include "confdefs.h" 1599 1646 #include <stdlib.h> … … 1616 1663 else 1617 1664 cat > conftest.$ac_ext <<EOF 1618 #line 16 19"configure"1665 #line 1666 "configure" 1619 1666 #include "confdefs.h" 1620 1667 #include <ctype.h> … … 1627 1674 1628 1675 EOF 1629 if { (eval echo configure:16 30: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null1676 if { (eval echo configure:1677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null 1630 1677 then 1631 1678 : … … 1651 1698 1652 1699 echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 1653 echo "configure:1 654: checking for sys/wait.h that is POSIX.1 compatible" >&51700 echo "configure:1701: checking for sys/wait.h that is POSIX.1 compatible" >&5 1654 1701 if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then 1655 1702 echo $ac_n "(cached) $ac_c" 1>&6 1656 1703 else 1657 1704 cat > conftest.$ac_ext <<EOF 1658 #line 1 659"configure"1705 #line 1706 "configure" 1659 1706 #include "confdefs.h" 1660 1707 #include <sys/types.h> … … 1672 1719 ; return 0; } 1673 1720 EOF 1674 if { (eval echo configure:1 675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then1721 if { (eval echo configure:1722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then 1675 1722 rm -rf conftest* 1676 1723 ac_cv_header_sys_wait_h=yes … … 1696 1743 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` 1697 1744 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 1698 echo "configure:1 699: checking for $ac_hdr" >&51745 echo "configure:1746: checking for $ac_hdr" >&5 1699 1746 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then 1700 1747 echo $ac_n "(cached) $ac_c" 1>&6 1701 1748 else 1702 1749 cat > conftest.$ac_ext <<EOF 1703 #line 17 04"configure"1750 #line 1751 "configure" 1704 1751 #include "confdefs.h" 1705 1752 #include <$ac_hdr> 1706 1753 EOF 1707 1754 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 1708 { (eval echo configure:17 09: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }1755 { (eval echo configure:1756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } 1709 1756 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` 1710 1757 if test -z "$ac_err"; then … … 1738 1785 1739 1786 echo $ac_n "checking for the perl xsubpp precompiler""... $ac_c" 1>&6 1740 echo "configure:17 41: checking for the perl xsubpp precompiler" >&51787 echo "configure:1788: checking for the perl xsubpp precompiler" >&5 1741 1788 XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`" 1742 1789 if test -n "${XSUBPPDIR}"; then … … 1753 1800 ac_safe=`echo "/usr/share/terminfo" | sed 'y%./+-%__p_%'` 1754 1801 echo $ac_n "checking for /usr/share/terminfo""... $ac_c" 1>&6 1755 echo "configure:1 756: checking for /usr/share/terminfo" >&51802 echo "configure:1803: checking for /usr/share/terminfo" >&5 1756 1803 if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then 1757 1804 echo $ac_n "(cached) $ac_c" 1>&6 … … 1778 1825 ac_safe=`echo "/usr/share/lib/terminfo" | sed 'y%./+-%__p_%'` 1779 1826 echo $ac_n "checking for /usr/share/lib/terminfo""... $ac_c" 1>&6 1780 echo "configure:1 781: checking for /usr/share/lib/terminfo" >&51827 echo "configure:1828: checking for /usr/share/lib/terminfo" >&5 1781 1828 if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then 1782 1829 echo $ac_n "(cached) $ac_c" 1>&6 … … 1839 1886 # ./install, which can be erroneously created by make from ./install.sh. 1840 1887 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 1841 echo "configure:18 42: checking for a BSD compatible install" >&51888 echo "configure:1889: checking for a BSD compatible install" >&5 1842 1889 if test -z "$INSTALL"; then 1843 1890 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then … … 1890 1937 1891 1938 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' 1939 1940 1941 subdirs="libfaim" 1892 1942 1893 1943 … … 2031 2081 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g 2032 2082 s%@INSTALL_DATA@%$INSTALL_DATA%g 2083 s%@subdirs@%$subdirs%g 2033 2084 2034 2085 CEOF … … 2250 2301 test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 2251 2302 2303 if test "$no_recursion" != yes; then 2304 2305 # Remove --cache-file and --srcdir arguments so they do not pile up. 2306 ac_sub_configure_args= 2307 ac_prev= 2308 for ac_arg in $ac_configure_args; do 2309 if test -n "$ac_prev"; then 2310 ac_prev= 2311 continue 2312 fi 2313 case "$ac_arg" in 2314 -cache-file | --cache-file | --cache-fil | --cache-fi \ 2315 | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) 2316 ac_prev=cache_file ;; 2317 -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ 2318 | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) 2319 ;; 2320 -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) 2321 ac_prev=srcdir ;; 2322 -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) 2323 ;; 2324 *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; 2325 esac 2326 done 2327 2328 for ac_config_dir in libfaim; do 2329 2330 # Do not complain, so a configure script can configure whichever 2331 # parts of a large source tree are present. 2332 if test ! -d $srcdir/$ac_config_dir; then 2333 continue 2334 fi 2335 2336 echo configuring in $ac_config_dir 2337 2338 case "$srcdir" in 2339 .) ;; 2340 *) 2341 if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :; 2342 else 2343 { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; } 2344 fi 2345 ;; 2346 esac 2347 2348 ac_popdir=`pwd` 2349 cd $ac_config_dir 2350 2351 # A "../" for each directory in /$ac_config_dir. 2352 ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` 2353 2354 case "$srcdir" in 2355 .) # No --srcdir option. We are building in place. 2356 ac_sub_srcdir=$srcdir ;; 2357 /*) # Absolute path. 2358 ac_sub_srcdir=$srcdir/$ac_config_dir ;; 2359 *) # Relative path. 2360 ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; 2361 esac 2362 2363 # Check for guested configure; otherwise get Cygnus style configure. 2364 if test -f $ac_sub_srcdir/configure; then 2365 ac_sub_configure=$ac_sub_srcdir/configure 2366 elif test -f $ac_sub_srcdir/configure.in; then 2367 ac_sub_configure=$ac_configure 2368 else 2369 echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2 2370 ac_sub_configure= 2371 fi 2372 2373 # The recursion is here. 2374 if test -n "$ac_sub_configure"; then 2375 2376 # Make the cache file name correct relative to the subdirectory. 2377 case "$cache_file" in 2378 /*) ac_sub_cache_file=$cache_file ;; 2379 *) # Relative path. 2380 ac_sub_cache_file="$ac_dots$cache_file" ;; 2381 esac 2382 case "$ac_given_INSTALL" in 2383 [/$]*) INSTALL="$ac_given_INSTALL" ;; 2384 *) INSTALL="$ac_dots$ac_given_INSTALL" ;; 2385 esac 2386 2387 echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir" 2388 # The eval makes quoting arguments work. 2389 if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir 2390 then : 2391 else 2392 { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; } 2393 fi 2394 fi 2395 2396 cd $ac_popdir 2397 done 2398 fi 2399 -
configure.in
rc269e22 rd09e5a1 37 37 AC_CHECK_LIB(des425, des425_req_act_vno) 38 38 AC_CHECK_LIB(des, des_quad_cksum) 39 AC_CHECK_LIB(resolv, res_search) 39 40 AC_CHECK_LIB(krb5, krb5_get_credentials) 40 AC_CHECK_LIB(krb4, krb_sendauth )41 AC_CHECK_LIB(krb, krb_sendauth)41 AC_CHECK_LIB(krb4, krb_sendauth,, 42 AC_CHECK_LIB(krb, krb_sendauth)) 42 43 AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.)) 43 44 AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [], [Have ZInitLocationInfo]),) … … 90 91 AC_PROG_INSTALL 91 92 93 AC_CONFIG_SUBDIRS(libfaim) 94 92 95 AC_OUTPUT(Makefile) -
editwin.c
r060b3b4 rd09e5a1 809 809 } 810 810 return(0); 811 812 #if 0 /* old implementation */813 if (e->bufflen>=2) {814 if ((e->buff[e->bufflen-1]=='\n') &&815 (e->buff[e->bufflen-2]=='.') &&816 ((e->bufflen==2) || (e->buff[e->bufflen-3]=='\n'))) {817 e->buff[e->bufflen-2]='\0';818 e->bufflen-=2;819 owl_editwin_redisplay(e, 0);820 return(1);821 }822 }823 return(0);824 #endif825 811 } 826 812 -
filter.c
r89426ab rd09e5a1 121 121 char *field, *match; 122 122 123 /* create the working list */123 /* create the working list of expression elements */ 124 124 fes=&(f->fes); 125 125 owl_list_create(&work_fes); … … 129 129 } 130 130 131 /* first go thru and turn all RE elements into true or false */131 /* first go thru and evaluate all RE elements to true or false */ 132 132 match=""; 133 133 for (i=0; i<j; i++) { … … 152 152 if (owl_message_is_type_zephyr(m)) { 153 153 match="zephyr"; 154 } else if (owl_message_is_type_aim(m)) { 155 match="aim"; 154 156 } else if (owl_message_is_type_admin(m)) { 155 157 match="admin"; … … 177 179 } 178 180 179 180 181 /* call the recrsive helper */ 181 182 i=_owl_filter_message_match_recurse(f, m, &work_fes, 0, owl_list_get_size(&(f->fes))-1); 182 183 184 /* now there will be only one TRUE / FALSE, find it among the NULL's */ 183 185 tmp=0; 184 /* now we should have one value */185 186 for (i=0; i<j; i++) { 186 187 fe=owl_list_get_element(&work_fes, i); … … 196 197 } 197 198 198 if (f->polarity) {199 200 } 199 /* reverse the answer if negative polarity is in use */ 200 if (f->polarity) tmp=!tmp; 201 201 202 owl_list_free_simple(&work_fes); 202 203 return(tmp); … … 207 208 owl_filterelement *fe, *tmpfe=NULL; 208 209 209 /* deal with parens first*/210 /* Deal with parens first. */ 210 211 for (i=0; i<OWL_FILTER_MAX_DEPTH; i++) { 212 /* Find first open paren and matching close paren, store in x, y */ 211 213 score=x=y=0; 212 214 for (i=start; i<=end; i++) { … … 231 233 } 232 234 235 /* Simply the parens by removing them and evaluating what was in between */ 233 236 if (y>0) { 234 237 /* null out the parens */ … … 236 239 owl_list_replace_element(fes, y, owl_global_get_filterelement_null(&g)); 237 240 238 /* simplify the part that wasin between */241 /* evaluate expression in between */ 239 242 ret=_owl_filter_message_match_recurse(f, m, fes, x+1, y-1); 240 243 if (ret<0) return(-1); … … 248 251 } 249 252 if (i==OWL_FILTER_MAX_DEPTH) { 253 /* hit the saftey limit, consider it invalid */ 250 254 return(-1); 251 255 } 252 256 253 /* and / or / not */ 257 /* Find AND / OR / NOT. 258 * For binary expressions (AND/OR): 259 * "type" is 1 260 * "x" will index first val, "y" the operator and "z" the second val 261 * For unary expressions (NOT): 262 * "type" is 2 263 * "x" will index the operator, "y" the value 264 * "score" tallys how many expression elements have been found so far 265 */ 254 266 for (i=0; i<OWL_FILTER_MAX_DEPTH; i++) { 255 267 type=score=x=y=z=0; … … 273 285 y=i; 274 286 } else { 287 /* it's not a valid binary expression */ 275 288 x=y=z=score=0; 276 289 } 277 290 } else if (type==2) { 278 291 if (owl_filterelement_is_value(fe)) { 279 /* it's a valid "NOT expr"*/292 /* valid unary expression, we're done */ 280 293 y=i; 281 294 break; … … 284 297 } else if (score==2) { 285 298 if (owl_filterelement_is_value(fe)) { 286 /* yes, it's a good match*/299 /* valid binary expression, we're done */ 287 300 z=i; 288 301 break; … … 293 306 } 294 307 295 /* process and / or*/308 /* simplify AND / OR */ 296 309 if ((type==1) && (z>0)) { 297 310 fe=owl_list_get_element(fes, x); … … 326 339 owl_list_replace_element(fes, y, tmpfe); 327 340 owl_list_replace_element(fes, z, owl_global_get_filterelement_null(&g)); 328 } else if ((type==2) && (y>0)) { /* process NOT */ 341 } else if ((type==2) && (y>0)) { 342 /* simplify NOT */ 329 343 fe=owl_list_get_element(fes, y); 330 344 owl_list_replace_element(fes, x, owl_global_get_filterelement_null(&g)); -
functions.c
r801c7cb rd09e5a1 10 10 #include <sys/wait.h> 11 11 #include <errno.h> 12 #include <signal.h> 12 13 #include "owl.h" 13 14 … … 124 125 } 125 126 127 void owl_function_make_outgoing_aim(char *body, char *to) 128 { 129 owl_message *m; 130 int followlast; 131 132 followlast=owl_global_should_followlast(&g); 133 134 /* create the message */ 135 m=owl_malloc(sizeof(owl_message)); 136 owl_message_create_aim(m, owl_global_get_aim_screenname(&g), body); 137 owl_message_set_recipient(m, to); 138 owl_message_set_direction_out(m); 139 140 /* add it to the global list and current view */ 141 owl_messagelist_append_element(owl_global_get_msglist(&g), m); 142 owl_view_consider_message(owl_global_get_current_view(&g), m); 143 144 if (followlast) owl_function_lastmsg_noredisplay(); 145 146 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 147 if (owl_popwin_is_active(owl_global_get_popwin(&g))) { 148 owl_popwin_refresh(owl_global_get_popwin(&g)); 149 } 150 151 wnoutrefresh(owl_global_get_curs_recwin(&g)); 152 owl_global_set_needrefresh(&g); 153 } 154 126 155 void owl_function_zwrite_setup(char *line) 127 156 { … … 166 195 } 167 196 197 void owl_function_aimwrite_setup(char *line) 198 { 199 owl_editwin *e; 200 char buff[1024]; 201 202 /* check the arguments */ 203 204 /* create and setup the editwin */ 205 e=owl_global_get_typwin(&g); 206 owl_editwin_new_style(e, OWL_EDITWIN_STYLE_MULTILINE, owl_global_get_msg_history(&g)); 207 208 if (!owl_global_get_lockout_ctrld(&g)) { 209 owl_function_makemsg("Type your message below. End with ^D or a dot on a line by itself. ^C will quit."); 210 } else { 211 owl_function_makemsg("Type your message below. End with a dot on a line by itself. ^C will quit."); 212 } 213 214 owl_editwin_clear(e); 215 owl_editwin_set_dotsend(e); 216 strcpy(buff, "----> "); 217 strcat(buff, line); 218 strcat(buff, "\n"); 219 owl_editwin_set_locktext(e, buff); 220 221 /* make it active */ 222 owl_global_set_typwin_active(&g); 223 } 224 225 226 168 227 void owl_function_zcrypt_setup(char *line) 169 228 { … … 241 300 owl_zwrite_free(&z); 242 301 } 302 303 304 void owl_function_aimwrite(char *to) 305 { 306 /* send the message */ 307 owl_aim_send_im(to, owl_editwin_get_text(owl_global_get_typwin(&g))); 308 owl_function_makemsg("AIM message sent."); 309 310 /* display the message as an outgoing message in the receive window */ 311 if (owl_global_is_displayoutgoing(&g)) { 312 owl_function_make_outgoing_aim(owl_editwin_get_text(owl_global_get_typwin(&g)), to); 313 } 314 315 /* not yet */ 316 #if 0 317 /* log it if we have logging turned on */ 318 if (owl_global_is_logging(&g)) { 319 owl_log_outgoing(to, owl_editwin_get_text(owl_global_get_typwin(&g))); 320 } 321 #endif 322 } 323 243 324 244 325 … … 619 700 ret = owl_config_execute("owl::shutdown();"); 620 701 if (ret) owl_free(ret); 702 703 /* signal our child process, if any */ 704 if (owl_global_get_newmsgproc_pid(&g)) { 705 kill(owl_global_get_newmsgproc_pid(&g), SIGHUP); 706 } 621 707 622 708 /* final clean up */ … … 1005 1091 buff=owl_global_get_buffercommand(&g); 1006 1092 if (!strncmp(buff, "zwrite ", 7)) { 1007 1008 1093 owl_function_zwrite(buff); 1094 } else if (!strncmp(buff, "aimwrite ", 9)) { 1095 owl_function_aimwrite(buff+9); 1009 1096 } 1010 1097 } … … 1193 1280 } else if (owl_message_is_type_generic(m)) { 1194 1281 owl_fmtext_append_normal(&fm, "Type : generic\n"); 1282 } else if (owl_message_is_type_aim(m)) { 1283 owl_fmtext_append_normal(&fm, "Type : aim\n"); 1195 1284 } else { 1196 1285 owl_fmtext_append_normal(&fm, "Type : unknown\n"); … … 1680 1769 } 1681 1770 1682 /* for now we disable replies to zcrypt messages, since we can't 1683 support an encrypted reply */ 1684 if (!strcasecmp(owl_message_get_opcode(m), "crypt")) { 1685 owl_function_makemsg("Replies to zcrypt messages are not enabled in this release"); 1771 /* admin */ 1772 if (owl_message_is_type_admin(m)) { 1773 owl_function_makemsg("You cannot reply to an admin message"); 1686 1774 return; 1687 1775 } 1688 1776 1689 if (owl_message_is_direction_out(m)) { 1690 owl_function_zwrite_setup(owl_message_get_zwriteline(m)); 1691 owl_global_set_buffercommand(&g, owl_message_get_zwriteline(m)); 1692 } else if (owl_message_is_type_admin(m)) { 1693 owl_function_makemsg("You cannot reply to an admin message"); 1694 } else { 1777 /* zephyr */ 1778 if (owl_message_is_type_zephyr(m)) { 1779 /* for now we disable replies to zcrypt messages, since we can't 1780 support an encrypted reply */ 1781 if (!strcasecmp(owl_message_get_opcode(m), "crypt")) { 1782 owl_function_makemsg("Replies to zcrypt messages are not enabled in this release"); 1783 return; 1784 } 1785 1786 if (owl_message_is_direction_out(m)) { 1787 owl_function_zwrite_setup(owl_message_get_zwriteline(m)); 1788 owl_global_set_buffercommand(&g, owl_message_get_zwriteline(m)); 1789 return; 1790 } 1791 1695 1792 if (owl_message_is_login(m)) { 1696 1793 class="MESSAGE"; … … 1714 1811 } 1715 1812 } 1716 1813 1717 1814 /* create the command line */ 1718 1815 buff = owl_strdup("zwrite"); … … 1745 1842 } 1746 1843 if (cc) owl_free(cc); 1747 1748 if (enter) { 1749 owl_history *hist = owl_global_get_cmd_history(&g); 1750 owl_history_store(hist, buff); 1751 owl_history_reset(hist); 1752 owl_function_command_norv(buff); 1753 } else { 1754 owl_function_start_command(buff); 1755 } 1756 owl_free(buff); 1757 } 1844 } 1845 1846 /* aim */ 1847 if (owl_message_is_type_aim(m)) { 1848 buff=owl_sprintf("aimwrite %s", owl_message_get_sender(m)); 1849 } 1850 1851 if (enter) { 1852 owl_history *hist = owl_global_get_cmd_history(&g); 1853 owl_history_store(hist, buff); 1854 owl_history_reset(hist); 1855 owl_function_command_norv(buff); 1856 } else { 1857 owl_function_start_command(buff); 1858 } 1859 owl_free(buff); 1758 1860 } 1759 1861 } -
global.c
recd5dc5 rd09e5a1 51 51 owl_list_create(&(g->filterlist)); 52 52 owl_list_create(&(g->puntlist)); 53 owl_list_create(&(g->messagequeue)); 53 54 g->curmsg_vert_offset=0; 54 55 g->resizepending=0; … … 87 88 owl_mainwin_init(&(g->mw)); 88 89 owl_popwin_init(&(g->pw)); 90 91 g->aim_screenname=NULL; 92 g->aim_loggedin=0; 93 g->aim_lastnop=0; 89 94 } 90 95 … … 637 642 return(g->malloced-g->freed); 638 643 } 644 645 /* AIM stuff */ 646 647 int owl_global_is_aimloggedin(owl_global *g) { 648 if (g->aim_loggedin) return(1); 649 return(0); 650 } 651 652 char *owl_global_get_aim_screenname(owl_global *g) { 653 return (g->aim_screenname); 654 } 655 656 void owl_global_set_aimloggedin(owl_global *g, char *screenname) { 657 g->aim_loggedin=1; 658 if (g->aim_screenname) owl_free(g->aim_screenname); 659 g->aim_screenname=owl_strdup(screenname); 660 } 661 662 void owl_global_set_aimnologgedin(owl_global *g) { 663 g->aim_loggedin=0; 664 } 665 666 aim_session_t *owl_global_get_aimsess(owl_global *g) { 667 return(&(g->aimsess)); 668 } 669 670 aim_conn_t *owl_global_get_waitingconn(owl_global *g) { 671 return(&(g->waitingconn)); 672 } 673 674 int owl_global_is_aimnop_time(owl_global *g) { 675 time_t now; 676 677 now=time(NULL); 678 if (g->aim_lastnop==0) { 679 g->aim_lastnop=now; 680 return(0); 681 } 682 683 if (now-g->aim_lastnop >= 30) { 684 return(1); 685 } 686 return(0); 687 } 688 689 void owl_global_aimnop_sent(owl_global *g) { 690 time_t now; 691 692 now=time(NULL); 693 g->aim_lastnop=now; 694 } 695 696 /* message queue */ 697 698 void owl_global_messagequeue_addmsg(owl_global *g, owl_message *m) { 699 owl_list_append_element(&(g->messagequeue), m); 700 } 701 702 /* pop off the first message and return it. Return NULL if the queue 703 * is empty. The caller should free the message after using it, if 704 * necessary. 705 */ 706 owl_message *owl_global_messageuque_popmsg(owl_global *g) { 707 owl_message *out; 708 709 if (owl_list_get_size(&(g->messagequeue))==0) return(NULL); 710 out=owl_list_get_element(&(g->messagequeue), 0); 711 owl_list_remove_element(&(g->messagequeue), 0); 712 return(out); 713 } 714 715 int owl_global_messagequeue_pending(owl_global *g) { 716 if (owl_list_get_size(&(g->messagequeue))==0) return(0); 717 return(1); 718 } -
list.c
r1aee7d9 rd09e5a1 26 26 27 27 int owl_list_append_element(owl_list *l, void *element) { 28 void *ptr; 29 28 30 if ((l->size+1) > (l->avail/GROWAT)) { 29 l->list=owl_realloc(l->list, l->avail*GROWBY*sizeof(void *)); 31 ptr=owl_realloc(l->list, l->avail*GROWBY*sizeof(void *)); 32 if (ptr==NULL) return(-1); 33 l->list=ptr; 30 34 l->avail=l->avail*GROWBY; 31 if (l->list==NULL) return(-1);32 35 } 33 36 … … 38 41 39 42 int owl_list_prepend_element(owl_list *l, void *element) { 43 void *ptr; 40 44 int i; 41 45 42 46 if ((l->size+1) > (l->avail/GROWAT)) { 43 l->list=owl_realloc(l->list, l->avail*GROWBY*sizeof(void *)); 47 ptr=owl_realloc(l->list, l->avail*GROWBY*sizeof(void *)); 48 if (ptr==NULL) return(-1); 49 l->list=ptr; 44 50 l->avail=l->avail*GROWBY; 45 if (l->list==NULL) return(-1);46 51 } 47 52 -
logging.c
r4b464a4 rd09e5a1 60 60 int len, ch, i, personal; 61 61 62 /* we only do zephyrs right now */ 63 if (!owl_message_is_type_zephyr(m)) return; 64 62 65 /* check for nolog */ 63 66 if (!strcasecmp(owl_message_get_opcode(m), "nolog") || -
message.c
rc86a35c rd09e5a1 196 196 m->type=OWL_MESSAGE_TYPE_ZEPHYR; 197 197 } 198 199 void owl_message_set_type_aim(owl_message *m) { 200 m->type=OWL_MESSAGE_TYPE_AIM; 201 } 198 202 199 203 int owl_message_is_type_admin(owl_message *m) { … … 204 208 int owl_message_is_type_zephyr(owl_message *m) { 205 209 if (m->type==OWL_MESSAGE_TYPE_ZEPHYR) return(1); 210 return(0); 211 } 212 213 int owl_message_is_type_aim(owl_message *m) { 214 if (m->type==OWL_MESSAGE_TYPE_AIM) return(1); 206 215 return(0); 207 216 } … … 384 393 385 394 owl_message_init(m); 386 387 395 owl_message_set_body(m, text); 388 396 … … 398 406 } 399 407 408 owl_free(indent); 409 } 410 411 void owl_message_create_aim(owl_message *m, char *sender, char *text) { 412 char *indent; 413 414 owl_message_init(m); 415 owl_message_set_body(m, text); 416 owl_message_set_sender(m, sender); 417 owl_message_set_type_aim(m); 418 419 indent=owl_malloc(strlen(text)+owl_text_num_lines(text)*OWL_MSGTAB+10); 420 owl_text_indent(indent, text, OWL_MSGTAB); 421 owl_fmtext_init_null(&(m->fmtext)); 422 owl_fmtext_append_normal(&(m->fmtext), OWL_TABSTR); 423 owl_fmtext_append_normal(&(m->fmtext), "AIM: "); 424 owl_fmtext_append_normal(&(m->fmtext), sender); 425 owl_fmtext_append_normal(&(m->fmtext), "\n"); 426 owl_fmtext_append_ztext(&(m->fmtext), indent); 427 if (text[strlen(text)-1]!='\n') { 428 owl_fmtext_append_normal(&(m->fmtext), "\n"); 429 } 430 400 431 owl_free(indent); 401 432 } -
owl.c
rac70242 rd09e5a1 31 31 owl_popwin *pw; 32 32 int j, ret, initialsubs, debug, argcsave, followlast; 33 int new zephyrs, zpendcount, nexttimediff;33 int newmsgs, zpendcount, nexttimediff; 34 34 struct sigaction sigact; 35 35 char *configfile, *tty, *perlout, **argvsave, buff[LINE], startupmsg[LINE]; … … 214 214 owl_function_zlog_in(); 215 215 } 216 217 /* AIM init */ 218 owl_aim_init(); 216 219 217 220 /* welcome message */ … … 264 267 265 268 /* grab incoming zephyrs */ 266 new zephyrs=0;269 newmsgs=0; 267 270 zpendcount=0; 268 while(ZPending() ) {271 while(ZPending() || owl_global_messagequeue_pending(&g)) { 269 272 ZNotice_t notice; 270 273 struct sockaddr_in from; … … 272 275 owl_filter *f; 273 276 274 /* grab a notice, but if we've done 20 without stopping, take 275 a break to process keystrokes etc. */ 276 if (zpendcount>20) break; 277 ZReceiveNotice(¬ice, &from); 278 zpendcount++; 279 280 /* is this an ack from a zephyr we sent? */ 281 if (owl_zephyr_notice_is_ack(¬ice)) { 282 owl_zephyr_handle_ack(¬ice); 283 continue; 284 } 285 286 /* if it's a ping and we're not viewing pings then skip it */ 287 if (!owl_global_is_rxping(&g) && !strcasecmp(notice.z_opcode, "ping")) { 288 continue; 289 } 290 291 /* create the new message */ 292 m=owl_malloc(sizeof(owl_message)); 293 owl_message_create_from_znotice(m, ¬ice); 277 if (ZPending()) { 278 /* grab a zephyr notice, but if we've done 20 without stopping, 279 take a break to process keystrokes etc. */ 280 if (zpendcount>20) break; 281 ZReceiveNotice(¬ice, &from); 282 zpendcount++; 283 284 /* is this an ack from a zephyr we sent? */ 285 if (owl_zephyr_notice_is_ack(¬ice)) { 286 owl_zephyr_handle_ack(¬ice); 287 continue; 288 } 289 290 /* if it's a ping and we're not viewing pings then skip it */ 291 if (!owl_global_is_rxping(&g) && !strcasecmp(notice.z_opcode, "ping")) { 292 continue; 293 } 294 295 /* create the new message */ 296 m=owl_malloc(sizeof(owl_message)); 297 owl_message_create_from_znotice(m, ¬ice); 298 } else if (owl_global_messagequeue_pending(&g)) { 299 m=owl_global_messageuque_popmsg(&g); 300 } 294 301 295 302 /* if it's on the puntlist then, nuke it and continue */ … … 301 308 /* otherwise add it to the global list */ 302 309 owl_messagelist_append_element(owl_global_get_msglist(&g), m); 303 new zephyrs=1;310 newmsgs=1; 304 311 305 312 /* let the config know the new message has been received */ … … 324 331 owl_function_command(owl_global_get_alert_action(&g)); 325 332 } 326 327 328 333 329 334 /* check for burning ears message */ … … 338 343 } 339 344 340 /* log the zephyrif we need to */345 /* log the message if we need to */ 341 346 if (owl_global_is_logging(&g) || owl_global_is_classlogging(&g)) { 342 347 owl_log_incoming(m); … … 344 349 } 345 350 351 /* If we're logged into AIM, do AIM stuff */ 352 if (owl_global_is_aimloggedin(&g)) { 353 owl_function_debugmsg("Doing aim processing"); 354 owl_aim_process_events(); 355 } 356 346 357 /* follow the last message if we're supposed to */ 347 if (new zephyrs && followlast) {358 if (newmsgs && followlast) { 348 359 owl_function_lastmsg_noredisplay(); 349 360 } 350 361 351 362 /* do the newmsgproc thing */ 352 if (new zephyrs) {363 if (newmsgs) { 353 364 owl_function_do_newmsgproc(); 354 365 } 355 366 356 367 /* redisplay if necessary */ 357 /* maybe this should be optimized to not even run if 358 the zephyr won't be displayed */ 359 if (newzephyrs) { 368 /* this should be optimized to not run if the new messages won't be displayed */ 369 if (newmsgs) { 360 370 owl_mainwin_redisplay(owl_global_get_mainwin(&g)); 361 371 sepbar(NULL); … … 394 404 } 395 405 396 /* handle all keypresses */ 406 /* Handle all keypresses. 407 * If no key has been pressed sleep for a little bit, but 408 * otherwise do not, this lets input be grabbed as quickly 409 * as possbile */ 397 410 j=wgetch(typwin); 398 411 if (j==ERR) { … … 426 439 } 427 440 } 428 429 441 } 430 442 -
owl.h
rc86a35c rd09e5a1 8 8 #include <netdb.h> 9 9 #include <regex.h> 10 #include <time.h> 11 #include <libfaim/aim.h> 10 12 #include "config.h" 11 13 … … 396 398 owl_filterelement fe_false; 397 399 owl_filterelement fe_null; 400 aim_session_t aimsess; 401 aim_conn_t waitingconn; 402 time_t aim_lastnop; 403 int aim_loggedin; 404 char *aim_screenname; 405 owl_list messagequeue; /* for queueing up aim and other messages */ 398 406 } owl_global; 399 407
Note: See TracChangeset
for help on using the changeset viewer.