Changeset d09e5a1


Ignore:
Timestamp:
May 31, 2003, 3:33:42 PM (18 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
5e53c4a
Parents:
c86a35c
Message:
Added libfaim
Added basic AIM support, including the "aimlogin", "aimwrite" and
   "aimlogout" commands
Files:
1 added
1 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rc269e22 rd09e5a1  
    6969        do_encrypt declaired static
    7070        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
    7175       
    72761.2.8
  • Makefile.in

    raaf6071 rd09e5a1  
    1010
    1111CC=@CC@
    12 LIBS=@LIBS@
    13 CFLAGS=@CFLAGS@ -DDATADIR=\"${datadir}\"
     12LIBS=@LIBS@ -L./libfaim -lfaim
     13CFLAGS=@CFLAGS@ -I. -I./libfaim -DDATADIR=\"${datadir}\"
    1414LDFLAGS=@LDFLAGS@
    1515XSUBPPDIR=@XSUBPPDIR@
     
    2222     readconfig.c keys.c functions.c zwrite.c viewwin.c help.c filter.c \
    2323     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
    2525OWL_SRC = owl.c
    2626TESTER_SRC = tester.c
     
    3434OBJS = $(BASE_OBJS) $(GEN_O)
    3535
    36 AUTOGEN=$(GEN_C) $(GEN_H)
     36#AUTOGEN=$(GEN_C) $(GEN_H)
     37AUTOGEN=$(GEN_C)
    3738
    3839
    39 owl: $(AUTOGEN) $(OBJS) owl.o
     40owl: $(AUTOGEN) $(OBJS) owl.o libfaim
    4041        ./athstatic $(CC) -o owl owl.o $(OBJS) $(LDFLAGS) $(LIBS)
    4142
     
    4647        ./tester reg
    4748
    48 clean:
     49clean: libfaimclean
    4950        $(RM) owl tester *.o $(AUTOGEN) owl_prototypes.h.new
    5051
    51 distclean: clean
     52distclean: clean libfaimdistclean
    5253        $(RM) config.cache config.log config.status Makefile config.h TAGS *~ core
    5354
    54 proto: owl_prototypes.h
     55#proto: owl_prototypes.h
    5556
    5657perlglue.c: perlglue.xs
     
    6162
    6263# 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 $@; }
     70owl_prototypes.h:
    6971
    7072.PHONY: tags clean distclean proto test
     
    7577        etags $(BASE_SRCS) $(OWL_SRC) $(TESTER_SRC) $(GEN_C) owl.h $(GEN_H)
    7678
    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
     82libfaim: libfaim/libfaim.a
     83
     84libfaim/libfaim.a:
     85        (cd libfaim; $(MAKE))
     86
     87libfaimclean:
     88        (cd libfaim; $(MAKE) clean)
     89
     90libfaimdistclean:
     91        (cd libfaim; $(MAKE) distclean)
    7892
    7993all: owl
     
    8397        ${INSTALL_DATA} doc/owl.1 ${mandir}/man1/owl.1
    8498
    85 
    8699installdirs: mkinstalldirs
    87100        ${srcdir}/mkinstalldirs ${bindir} ${mandir}/man1 ${datadir}/owl
  • athstatic

    r601a9e0 rd09e5a1  
    2929done
    3030
     31echo "$progname" $options
    3132exec "$progname" $options
  • commands.c

    recd5dc5 rd09e5a1  
    111111              "-O opcode\n"
    112112              "      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"),
    113118
    114119  /*
     
    566571              "is performed backwards"),
    567572
     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
    568584  /****************************************************************/
    569585  /************************* EDIT-SPECIFIC ************************/
     
    12051221    owl_function_xterm_deiconify();
    12061222  } else {
    1207     owl_function_makemsg("Uknown terminal subcommand");
     1223    owl_function_makemsg("Unknown terminal subcommand");
    12081224  }
    12091225  return(NULL);
     
    13531369    tmpbuff = owl_strdup(buff);
    13541370    owl_function_zwrite_setup(tmpbuff);
     1371    owl_global_set_buffercommand(&g, tmpbuff);
     1372    owl_free(tmpbuff);
     1373  }
     1374  return NULL;
     1375}
     1376
     1377char *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);
    13551385    owl_global_set_buffercommand(&g, tmpbuff);
    13561386    owl_free(tmpbuff);
     
    17401770}
    17411771
     1772char *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
     1789char *owl_command_aimlogout(int argc, char **argv, char *buff) {
     1790  owl_aim_logout();
     1791  return(NULL);
     1792}
     1793
    17421794/*********************************************************************/
    17431795/************************** EDIT SPECIFIC ****************************/
  • configure

    rc269e22 rd09e5a1  
    11471147fi
    11481148
     1149echo $ac_n "checking for res_search in -lresolv""... $ac_c" 1>&6
     1150echo "configure:1151: checking for res_search in -lresolv" >&5
     1151ac_lib_var=`echo resolv'_'res_search | sed 'y%./+-%__p_%'`
     1152if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     1153  echo $ac_n "(cached) $ac_c" 1>&6
     1154else
     1155  ac_save_LIBS="$LIBS"
     1156LIBS="-lresolv  $LIBS"
     1157cat > 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.  */
     1163char res_search();
     1164
     1165int main() {
     1166res_search()
     1167; return 0; }
     1168EOF
     1169if { (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"
     1172else
     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"
     1177fi
     1178rm -f conftest*
     1179LIBS="$ac_save_LIBS"
     1180
     1181fi
     1182if 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
     1188EOF
     1189
     1190  LIBS="-lresolv $LIBS"
     1191
     1192else
     1193  echo "$ac_t""no" 1>&6
     1194fi
     1195
    11491196echo $ac_n "checking for krb5_get_credentials in -lkrb5""... $ac_c" 1>&6
    1150 echo "configure:1151: checking for krb5_get_credentials in -lkrb5" >&5
     1197echo "configure:1198: checking for krb5_get_credentials in -lkrb5" >&5
    11511198ac_lib_var=`echo krb5'_'krb5_get_credentials | sed 'y%./+-%__p_%'`
    11521199if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    11561203LIBS="-lkrb5  $LIBS"
    11571204cat > conftest.$ac_ext <<EOF
    1158 #line 1159 "configure"
     1205#line 1206 "configure"
    11591206#include "confdefs.h"
    11601207/* Override any gcc2 internal prototype to avoid an error.  */
     
    11671214; return 0; }
    11681215EOF
    1169 if { (eval echo configure:1170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     1216if { (eval echo configure:1217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    11701217  rm -rf conftest*
    11711218  eval "ac_cv_lib_$ac_lib_var=yes"
     
    11951242
    11961243echo $ac_n "checking for krb_sendauth in -lkrb4""... $ac_c" 1>&6
    1197 echo "configure:1198: checking for krb_sendauth in -lkrb4" >&5
     1244echo "configure:1245: checking for krb_sendauth in -lkrb4" >&5
    11981245ac_lib_var=`echo krb4'_'krb_sendauth | sed 'y%./+-%__p_%'`
    11991246if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    12031250LIBS="-lkrb4  $LIBS"
    12041251cat > conftest.$ac_ext <<EOF
    1205 #line 1206 "configure"
     1252#line 1253 "configure"
    12061253#include "confdefs.h"
    12071254/* Override any gcc2 internal prototype to avoid an error.  */
     
    12141261; return 0; }
    12151262EOF
    1216 if { (eval echo configure:1217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     1263if { (eval echo configure:1264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    12171264  rm -rf conftest*
    12181265  eval "ac_cv_lib_$ac_lib_var=yes"
     
    12391286else
    12401287  echo "$ac_t""no" 1>&6
    1241 fi
    1242 
    12431288echo $ac_n "checking for krb_sendauth in -lkrb""... $ac_c" 1>&6
    1244 echo "configure:1245: checking for krb_sendauth in -lkrb" >&5
     1289echo "configure:1290: checking for krb_sendauth in -lkrb" >&5
    12451290ac_lib_var=`echo krb'_'krb_sendauth | sed 'y%./+-%__p_%'`
    12461291if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    12501295LIBS="-lkrb  $LIBS"
    12511296cat > conftest.$ac_ext <<EOF
    1252 #line 1253 "configure"
     1297#line 1298 "configure"
    12531298#include "confdefs.h"
    12541299/* Override any gcc2 internal prototype to avoid an error.  */
     
    12611306; return 0; }
    12621307EOF
    1263 if { (eval echo configure:1264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     1308if { (eval echo configure:1309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    12641309  rm -rf conftest*
    12651310  eval "ac_cv_lib_$ac_lib_var=yes"
     
    12761321if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
    12771322  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' \
    12791324    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
    12801325  cat >> confdefs.h <<EOF
     
    12881333fi
    12891334
     1335fi
     1336
    12901337echo $ac_n "checking for ZGetSender in -lzephyr""... $ac_c" 1>&6
    1291 echo "configure:1292: checking for ZGetSender in -lzephyr" >&5
     1338echo "configure:1339: checking for ZGetSender in -lzephyr" >&5
    12921339ac_lib_var=`echo zephyr'_'ZGetSender | sed 'y%./+-%__p_%'`
    12931340if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    12971344LIBS="-lzephyr  $LIBS"
    12981345cat > conftest.$ac_ext <<EOF
    1299 #line 1300 "configure"
     1346#line 1347 "configure"
    13001347#include "confdefs.h"
    13011348/* Override any gcc2 internal prototype to avoid an error.  */
     
    13081355; return 0; }
    13091356EOF
    1310 if { (eval echo configure:1311: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     1357if { (eval echo configure:1358: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    13111358  rm -rf conftest*
    13121359  eval "ac_cv_lib_$ac_lib_var=yes"
     
    13371384
    13381385echo $ac_n "checking for ZInitLocationInfo in -lzephyr""... $ac_c" 1>&6
    1339 echo "configure:1340: checking for ZInitLocationInfo in -lzephyr" >&5
     1386echo "configure:1387: checking for ZInitLocationInfo in -lzephyr" >&5
    13401387ac_lib_var=`echo zephyr'_'ZInitLocationInfo | sed 'y%./+-%__p_%'`
    13411388if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    13451392LIBS="-lzephyr  $LIBS"
    13461393cat > conftest.$ac_ext <<EOF
    1347 #line 1348 "configure"
     1394#line 1395 "configure"
    13481395#include "confdefs.h"
    13491396/* Override any gcc2 internal prototype to avoid an error.  */
     
    13561403; return 0; }
    13571404EOF
    1358 if { (eval echo configure:1359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     1405if { (eval echo configure:1406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    13591406  rm -rf conftest*
    13601407  eval "ac_cv_lib_$ac_lib_var=yes"
     
    13831430do
    13841431echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
    1385 echo "configure:1386: checking for $ac_func" >&5
     1432echo "configure:1433: checking for $ac_func" >&5
    13861433if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
    13871434  echo $ac_n "(cached) $ac_c" 1>&6
    13881435else
    13891436  cat > conftest.$ac_ext <<EOF
    1390 #line 1391 "configure"
     1437#line 1438 "configure"
    13911438#include "confdefs.h"
    13921439/* System header to define __stub macros and hopefully few prototypes,
     
    14111458; return 0; }
    14121459EOF
    1413 if { (eval echo configure:1414: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     1460if { (eval echo configure:1461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    14141461  rm -rf conftest*
    14151462  eval "ac_cv_func_$ac_func=yes"
     
    14371484
    14381485echo $ac_n "checking for des_ecb_encrypt prototype""... $ac_c" 1>&6
    1439 echo "configure:1440: checking for des_ecb_encrypt prototype" >&5
     1486echo "configure:1487: checking for des_ecb_encrypt prototype" >&5
    14401487cat > conftest.$ac_ext <<EOF
    1441 #line 1442 "configure"
     1488#line 1489 "configure"
    14421489#include "confdefs.h"
    14431490#include <des.h>
     
    14471494; return 0; }
    14481495EOF
    1449 if { (eval echo configure:1450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     1496if { (eval echo configure:1497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    14501497  rm -rf conftest*
    14511498  ac_cv_des_ecb_encrypt_proto=no
     
    14671514
    14681515echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
    1469 echo "configure:1470: checking how to run the C preprocessor" >&5
     1516echo "configure:1517: checking how to run the C preprocessor" >&5
    14701517# On Suns, sometimes $CPP names a directory.
    14711518if test -n "$CPP" && test -d "$CPP"; then
     
    14821529  # not just through cpp.
    14831530  cat > conftest.$ac_ext <<EOF
    1484 #line 1485 "configure"
     1531#line 1532 "configure"
    14851532#include "confdefs.h"
    14861533#include <assert.h>
     
    14881535EOF
    14891536ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1490 { (eval echo configure:1491: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1537{ (eval echo configure:1538: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    14911538ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    14921539if test -z "$ac_err"; then
     
    14991546  CPP="${CC-cc} -E -traditional-cpp"
    15001547  cat > conftest.$ac_ext <<EOF
    1501 #line 1502 "configure"
     1548#line 1549 "configure"
    15021549#include "confdefs.h"
    15031550#include <assert.h>
     
    15051552EOF
    15061553ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1507 { (eval echo configure:1508: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1554{ (eval echo configure:1555: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    15081555ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    15091556if test -z "$ac_err"; then
     
    15161563  CPP="${CC-cc} -nologo -E"
    15171564  cat > conftest.$ac_ext <<EOF
    1518 #line 1519 "configure"
     1565#line 1566 "configure"
    15191566#include "confdefs.h"
    15201567#include <assert.h>
     
    15221569EOF
    15231570ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1524 { (eval echo configure:1525: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1571{ (eval echo configure:1572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    15251572ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    15261573if test -z "$ac_err"; then
     
    15471594
    15481595echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
    1549 echo "configure:1550: checking for ANSI C header files" >&5
     1596echo "configure:1597: checking for ANSI C header files" >&5
    15501597if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
    15511598  echo $ac_n "(cached) $ac_c" 1>&6
    15521599else
    15531600  cat > conftest.$ac_ext <<EOF
    1554 #line 1555 "configure"
     1601#line 1602 "configure"
    15551602#include "confdefs.h"
    15561603#include <stdlib.h>
     
    15601607EOF
    15611608ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1562 { (eval echo configure:1563: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1609{ (eval echo configure:1610: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    15631610ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    15641611if test -z "$ac_err"; then
     
    15771624  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
    15781625cat > conftest.$ac_ext <<EOF
    1579 #line 1580 "configure"
     1626#line 1627 "configure"
    15801627#include "confdefs.h"
    15811628#include <string.h>
     
    15951642  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
    15961643cat > conftest.$ac_ext <<EOF
    1597 #line 1598 "configure"
     1644#line 1645 "configure"
    15981645#include "confdefs.h"
    15991646#include <stdlib.h>
     
    16161663else
    16171664  cat > conftest.$ac_ext <<EOF
    1618 #line 1619 "configure"
     1665#line 1666 "configure"
    16191666#include "confdefs.h"
    16201667#include <ctype.h>
     
    16271674
    16281675EOF
    1629 if { (eval echo configure:1630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     1676if { (eval echo configure:1677: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    16301677then
    16311678  :
     
    16511698
    16521699echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
    1653 echo "configure:1654: checking for sys/wait.h that is POSIX.1 compatible" >&5
     1700echo "configure:1701: checking for sys/wait.h that is POSIX.1 compatible" >&5
    16541701if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
    16551702  echo $ac_n "(cached) $ac_c" 1>&6
    16561703else
    16571704  cat > conftest.$ac_ext <<EOF
    1658 #line 1659 "configure"
     1705#line 1706 "configure"
    16591706#include "confdefs.h"
    16601707#include <sys/types.h>
     
    16721719; return 0; }
    16731720EOF
    1674 if { (eval echo configure:1675: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     1721if { (eval echo configure:1722: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    16751722  rm -rf conftest*
    16761723  ac_cv_header_sys_wait_h=yes
     
    16961743ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    16971744echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    1698 echo "configure:1699: checking for $ac_hdr" >&5
     1745echo "configure:1746: checking for $ac_hdr" >&5
    16991746if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    17001747  echo $ac_n "(cached) $ac_c" 1>&6
    17011748else
    17021749  cat > conftest.$ac_ext <<EOF
    1703 #line 1704 "configure"
     1750#line 1751 "configure"
    17041751#include "confdefs.h"
    17051752#include <$ac_hdr>
    17061753EOF
    17071754ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1708 { (eval echo configure:1709: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1755{ (eval echo configure:1756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    17091756ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    17101757if test -z "$ac_err"; then
     
    17381785
    17391786echo $ac_n "checking for the perl xsubpp precompiler""... $ac_c" 1>&6
    1740 echo "configure:1741: checking for the perl xsubpp precompiler" >&5
     1787echo "configure:1788: checking for the perl xsubpp precompiler" >&5
    17411788XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
    17421789if test -n "${XSUBPPDIR}"; then
     
    17531800ac_safe=`echo "/usr/share/terminfo" | sed 'y%./+-%__p_%'`
    17541801echo $ac_n "checking for /usr/share/terminfo""... $ac_c" 1>&6
    1755 echo "configure:1756: checking for /usr/share/terminfo" >&5
     1802echo "configure:1803: checking for /usr/share/terminfo" >&5
    17561803if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
    17571804  echo $ac_n "(cached) $ac_c" 1>&6
     
    17781825ac_safe=`echo "/usr/share/lib/terminfo" | sed 'y%./+-%__p_%'`
    17791826echo $ac_n "checking for /usr/share/lib/terminfo""... $ac_c" 1>&6
    1780 echo "configure:1781: checking for /usr/share/lib/terminfo" >&5
     1827echo "configure:1828: checking for /usr/share/lib/terminfo" >&5
    17811828if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
    17821829  echo $ac_n "(cached) $ac_c" 1>&6
     
    18391886# ./install, which can be erroneously created by make from ./install.sh.
    18401887echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
    1841 echo "configure:1842: checking for a BSD compatible install" >&5
     1888echo "configure:1889: checking for a BSD compatible install" >&5
    18421889if test -z "$INSTALL"; then
    18431890if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
     
    18901937
    18911938test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
     1939
     1940
     1941subdirs="libfaim"
    18921942
    18931943
     
    20312081s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
    20322082s%@INSTALL_DATA@%$INSTALL_DATA%g
     2083s%@subdirs@%$subdirs%g
    20332084
    20342085CEOF
     
    22502301test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
    22512302
     2303if 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
     2398fi
     2399
  • configure.in

    rc269e22 rd09e5a1  
    3737AC_CHECK_LIB(des425, des425_req_act_vno)
    3838AC_CHECK_LIB(des, des_quad_cksum)
     39AC_CHECK_LIB(resolv, res_search)
    3940AC_CHECK_LIB(krb5, krb5_get_credentials)
    40 AC_CHECK_LIB(krb4, krb_sendauth)
    41 AC_CHECK_LIB(krb, krb_sendauth)
     41AC_CHECK_LIB(krb4, krb_sendauth,,
     42   AC_CHECK_LIB(krb, krb_sendauth))
    4243AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.))
    4344AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [], [Have ZInitLocationInfo]),)
     
    9091AC_PROG_INSTALL
    9192
     93AC_CONFIG_SUBDIRS(libfaim)
     94
    9295AC_OUTPUT(Makefile)
  • editwin.c

    r060b3b4 rd09e5a1  
    809809  }
    810810  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 #endif
    825811}
    826812
  • filter.c

    r89426ab rd09e5a1  
    121121  char *field, *match;
    122122
    123   /* create the working list */
     123  /* create the working list of expression elements */
    124124  fes=&(f->fes);
    125125  owl_list_create(&work_fes);
     
    129129  }
    130130
    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 */
    132132  match="";
    133133  for (i=0; i<j; i++) {
     
    152152      if (owl_message_is_type_zephyr(m)) {
    153153        match="zephyr";
     154      } else if (owl_message_is_type_aim(m)) {
     155        match="aim";
    154156      } else if (owl_message_is_type_admin(m)) {
    155157        match="admin";
     
    177179  }
    178180
    179  
    180181  /* call the recrsive helper */
    181182  i=_owl_filter_message_match_recurse(f, m, &work_fes, 0, owl_list_get_size(&(f->fes))-1);
    182183
     184  /* now there will be only one TRUE / FALSE, find it among the NULL's */
    183185  tmp=0;
    184   /* now we should have one value */
    185186  for (i=0; i<j; i++) {
    186187    fe=owl_list_get_element(&work_fes, i);
     
    196197  } 
    197198
    198   if (f->polarity) {
    199     tmp=!tmp;
    200   }
     199  /* reverse the answer if negative polarity is in use */
     200  if (f->polarity) tmp=!tmp;
     201
    201202  owl_list_free_simple(&work_fes);
    202203  return(tmp);
     
    207208  owl_filterelement *fe, *tmpfe=NULL;
    208209
    209   /* deal with parens first */
     210  /* Deal with parens first. */
    210211  for (i=0; i<OWL_FILTER_MAX_DEPTH; i++) {
     212    /* Find first open paren and matching close paren, store in x, y */
    211213    score=x=y=0;
    212214    for (i=start; i<=end; i++) {
     
    231233    }
    232234
     235    /* Simply the parens by removing them and evaluating what was in between */
    233236    if (y>0) {
    234237      /* null out the parens */
     
    236239      owl_list_replace_element(fes, y, owl_global_get_filterelement_null(&g));
    237240
    238       /* simplify the part that was in between */
     241      /* evaluate expression in between */
    239242      ret=_owl_filter_message_match_recurse(f, m, fes, x+1, y-1);
    240243      if (ret<0) return(-1);
     
    248251  }
    249252  if (i==OWL_FILTER_MAX_DEPTH) {
     253    /* hit the saftey limit, consider it invalid */
    250254    return(-1);
    251255  }
    252256
    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   */
    254266  for (i=0; i<OWL_FILTER_MAX_DEPTH; i++) {
    255267    type=score=x=y=z=0;
     
    273285            y=i;
    274286          } else {
     287            /* it's not a valid binary expression */
    275288            x=y=z=score=0;
    276289          }
    277290        } else if (type==2) {
    278291          if (owl_filterelement_is_value(fe)) {
    279             /* it's a valid "NOT expr" */
     292            /* valid unary expression, we're done */
    280293            y=i;
    281294            break;
     
    284297      } else if (score==2) {
    285298        if (owl_filterelement_is_value(fe)) {
    286           /* yes, it's a good match */
     299          /* valid binary expression, we're done */
    287300          z=i;
    288301          break;
     
    293306    }
    294307
    295     /* process and / or */
     308    /* simplify AND / OR */
    296309    if ((type==1) && (z>0)) {
    297310      fe=owl_list_get_element(fes, x);
     
    326339      owl_list_replace_element(fes, y, tmpfe);
    327340      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 */
    329343      fe=owl_list_get_element(fes, y);
    330344      owl_list_replace_element(fes, x, owl_global_get_filterelement_null(&g));
  • functions.c

    r801c7cb rd09e5a1  
    1010#include <sys/wait.h>
    1111#include <errno.h>
     12#include <signal.h>
    1213#include "owl.h"
    1314
     
    124125}
    125126
     127void 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
    126155void owl_function_zwrite_setup(char *line)
    127156{
     
    166195}
    167196
     197void 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
    168227void owl_function_zcrypt_setup(char *line)
    169228{
     
    241300  owl_zwrite_free(&z);
    242301}
     302
     303
     304void 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
    243324
    244325
     
    619700  ret = owl_config_execute("owl::shutdown();");
    620701  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  }
    621707
    622708  /* final clean up */
     
    10051091  buff=owl_global_get_buffercommand(&g);
    10061092  if (!strncmp(buff, "zwrite ", 7)) {
    1007 
    10081093    owl_function_zwrite(buff);
     1094  } else if (!strncmp(buff, "aimwrite ", 9)) {
     1095    owl_function_aimwrite(buff+9);
    10091096  }
    10101097}
     
    11931280  } else if (owl_message_is_type_generic(m)) {
    11941281    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");
    11951284  } else {
    11961285    owl_fmtext_append_normal(&fm, "Type      : unknown\n");
     
    16801769    }
    16811770
    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");
    16861774      return;
    16871775    }
    16881776
    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     
    16951792      if (owl_message_is_login(m)) {
    16961793        class="MESSAGE";
     
    17141811        }
    17151812      }
    1716      
     1813       
    17171814      /* create the command line */
    17181815      buff = owl_strdup("zwrite");
     
    17451842      }
    17461843      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);
    17581860  }
    17591861}
  • global.c

    recd5dc5 rd09e5a1  
    5151  owl_list_create(&(g->filterlist));
    5252  owl_list_create(&(g->puntlist));
     53  owl_list_create(&(g->messagequeue));
    5354  g->curmsg_vert_offset=0;
    5455  g->resizepending=0;
     
    8788  owl_mainwin_init(&(g->mw));
    8889  owl_popwin_init(&(g->pw));
     90
     91  g->aim_screenname=NULL;
     92  g->aim_loggedin=0;
     93  g->aim_lastnop=0;
    8994}
    9095
     
    637642  return(g->malloced-g->freed);
    638643}
     644
     645/* AIM stuff */
     646
     647int owl_global_is_aimloggedin(owl_global *g) {
     648  if (g->aim_loggedin) return(1);
     649  return(0);
     650}
     651
     652char *owl_global_get_aim_screenname(owl_global *g) {
     653  return (g->aim_screenname);
     654}
     655
     656void 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
     662void owl_global_set_aimnologgedin(owl_global *g) {
     663  g->aim_loggedin=0;
     664}
     665
     666aim_session_t *owl_global_get_aimsess(owl_global *g) {
     667  return(&(g->aimsess));
     668}
     669
     670aim_conn_t *owl_global_get_waitingconn(owl_global *g) {
     671  return(&(g->waitingconn));
     672}
     673
     674int 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
     689void 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
     698void 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 */
     706owl_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
     715int 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  
    2626
    2727int owl_list_append_element(owl_list *l, void *element) {
     28  void *ptr;
     29 
    2830  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;
    3034    l->avail=l->avail*GROWBY;
    31     if (l->list==NULL) return(-1);
    3235  }
    3336
     
    3841
    3942int owl_list_prepend_element(owl_list *l, void *element) {
     43  void *ptr;
    4044  int i;
    4145 
    4246  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;
    4450    l->avail=l->avail*GROWBY;
    45     if (l->list==NULL) return(-1);
    4651  }
    4752
  • logging.c

    r4b464a4 rd09e5a1  
    6060  int len, ch, i, personal;
    6161
     62  /* we only do zephyrs right now */
     63  if (!owl_message_is_type_zephyr(m)) return;
     64     
    6265  /* check for nolog */
    6366  if (!strcasecmp(owl_message_get_opcode(m), "nolog") ||
  • message.c

    rc86a35c rd09e5a1  
    196196  m->type=OWL_MESSAGE_TYPE_ZEPHYR;
    197197}
     198
     199void owl_message_set_type_aim(owl_message *m) {
     200  m->type=OWL_MESSAGE_TYPE_AIM;
     201}
    198202                                               
    199203int owl_message_is_type_admin(owl_message *m) {
     
    204208int owl_message_is_type_zephyr(owl_message *m) {
    205209  if (m->type==OWL_MESSAGE_TYPE_ZEPHYR) return(1);
     210  return(0);
     211}
     212
     213int owl_message_is_type_aim(owl_message *m) {
     214  if (m->type==OWL_MESSAGE_TYPE_AIM) return(1);
    206215  return(0);
    207216}
     
    384393
    385394  owl_message_init(m);
    386 
    387395  owl_message_set_body(m, text);
    388396
     
    398406  }
    399407
     408  owl_free(indent);
     409}
     410
     411void 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 
    400431  owl_free(indent);
    401432}
  • owl.c

    rac70242 rd09e5a1  
    3131  owl_popwin *pw;
    3232  int j, ret, initialsubs, debug, argcsave, followlast;
    33   int newzephyrs, zpendcount, nexttimediff;
     33  int newmsgs, zpendcount, nexttimediff;
    3434  struct sigaction sigact;
    3535  char *configfile, *tty, *perlout, **argvsave, buff[LINE], startupmsg[LINE];
     
    214214    owl_function_zlog_in();
    215215  }
     216
     217  /* AIM init */
     218  owl_aim_init();
    216219
    217220  /* welcome message */
     
    264267
    265268    /* grab incoming zephyrs */
    266     newzephyrs=0;
     269    newmsgs=0;
    267270    zpendcount=0;
    268     while(ZPending()) {
     271    while(ZPending() || owl_global_messagequeue_pending(&g)) {
    269272      ZNotice_t notice;
    270273      struct sockaddr_in from;
     
    272275      owl_filter *f;
    273276
    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(&notice, &from);
    278       zpendcount++;
    279 
    280       /* is this an ack from a zephyr we sent? */
    281       if (owl_zephyr_notice_is_ack(&notice)) {
    282         owl_zephyr_handle_ack(&notice);
    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, &notice);
     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(&notice, &from);
     282        zpendcount++;
     283       
     284        /* is this an ack from a zephyr we sent? */
     285        if (owl_zephyr_notice_is_ack(&notice)) {
     286          owl_zephyr_handle_ack(&notice);
     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, &notice);
     298      } else if (owl_global_messagequeue_pending(&g)) {
     299        m=owl_global_messageuque_popmsg(&g);
     300      }
    294301     
    295302      /* if it's on the puntlist then, nuke it and continue */
     
    301308      /* otherwise add it to the global list */
    302309      owl_messagelist_append_element(owl_global_get_msglist(&g), m);
    303       newzephyrs=1;
     310      newmsgs=1;
    304311
    305312      /* let the config know the new message has been received */
     
    324331        owl_function_command(owl_global_get_alert_action(&g));
    325332      }
    326 
    327          
    328333
    329334      /* check for burning ears message */
     
    338343      }
    339344
    340       /* log the zephyr if we need to */
     345      /* log the message if we need to */
    341346      if (owl_global_is_logging(&g) || owl_global_is_classlogging(&g)) {
    342347        owl_log_incoming(m);
     
    344349    }
    345350
     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
    346357    /* follow the last message if we're supposed to */
    347     if (newzephyrs && followlast) {
     358    if (newmsgs && followlast) {
    348359      owl_function_lastmsg_noredisplay();
    349360    }
    350361
    351362    /* do the newmsgproc thing */
    352     if (newzephyrs) {
     363    if (newmsgs) {
    353364      owl_function_do_newmsgproc();
    354365    }
    355366   
    356367    /* 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) {
    360370      owl_mainwin_redisplay(owl_global_get_mainwin(&g));
    361371      sepbar(NULL);
     
    394404    }
    395405
    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 */
    397410    j=wgetch(typwin);
    398411    if (j==ERR) {
     
    426439    }
    427440  }
    428 
    429441}
    430442
  • owl.h

    rc86a35c rd09e5a1  
    88#include <netdb.h>
    99#include <regex.h>
     10#include <time.h>
     11#include <libfaim/aim.h>
    1012#include "config.h"
    1113
     
    396398  owl_filterelement fe_false;
    397399  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 */
    398406} owl_global;
    399407
Note: See TracChangeset for help on using the changeset viewer.