Changeset 09489b89


Ignore:
Timestamp:
Jul 2, 2003, 6:15:24 PM (21 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
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:
373b7e7
Parents:
7c9c847
Message:
First pass at making owl build without zephyr
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r7c9c847 r09489b89  
    11$Id$
    22
     32.0.7-pre-1
     4        First pass at making owl build without zephyr
     5       
    362.0.6
    47        aimlogin will now accept the screenname without a password and ask
  • codelist.pl

    r0ff8fb57 r09489b89  
    2222            && !/\/\*/
    2323            && !/ZWRITEOPTIONS/
    24             && !/owlfaim_priv/) 
     24            && !/owlfaim_priv/)
    2525        {
     26
    2627            s/\s+\{/\;/;
    2728            s/\)[ \t]*$/\)\;/;
    2829            print "extern ";
     30            print;
     31        } elsif (/^#if/ || /^#else/ || /^#endif/) {
    2932            print;
    3033        }
  • configure

    re016fc2 r09489b89  
    13801380else
    13811381  echo "$ac_t""no" 1>&6
    1382 { echo "configure: error: No zephyr library found." 1>&2; exit 1; }
    13831382fi
    13841383
    13851384echo $ac_n "checking for ZInitLocationInfo in -lzephyr""... $ac_c" 1>&6
    1386 echo "configure:1387: checking for ZInitLocationInfo in -lzephyr" >&5
     1385echo "configure:1386: checking for ZInitLocationInfo in -lzephyr" >&5
    13871386ac_lib_var=`echo zephyr'_'ZInitLocationInfo | sed 'y%./+-%__p_%'`
    13881387if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
     
    13921391LIBS="-lzephyr  $LIBS"
    13931392cat > conftest.$ac_ext <<EOF
    1394 #line 1395 "configure"
     1393#line 1394 "configure"
    13951394#include "confdefs.h"
    13961395/* Override any gcc2 internal prototype to avoid an error.  */
     
    14031402; return 0; }
    14041403EOF
    1405 if { (eval echo configure:1406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     1404if { (eval echo configure:1405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    14061405  rm -rf conftest*
    14071406  eval "ac_cv_lib_$ac_lib_var=yes"
     
    14301429do
    14311430echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
    1432 echo "configure:1433: checking for $ac_func" >&5
     1431echo "configure:1432: checking for $ac_func" >&5
    14331432if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
    14341433  echo $ac_n "(cached) $ac_c" 1>&6
    14351434else
    14361435  cat > conftest.$ac_ext <<EOF
    1437 #line 1438 "configure"
     1436#line 1437 "configure"
    14381437#include "confdefs.h"
    14391438/* System header to define __stub macros and hopefully few prototypes,
     
    14581457; return 0; }
    14591458EOF
    1460 if { (eval echo configure:1461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
     1459if { (eval echo configure:1460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
    14611460  rm -rf conftest*
    14621461  eval "ac_cv_func_$ac_func=yes"
     
    14841483
    14851484echo $ac_n "checking for des_ecb_encrypt prototype""... $ac_c" 1>&6
    1486 echo "configure:1487: checking for des_ecb_encrypt prototype" >&5
     1485echo "configure:1486: checking for des_ecb_encrypt prototype" >&5
    14871486cat > conftest.$ac_ext <<EOF
    1488 #line 1489 "configure"
     1487#line 1488 "configure"
    14891488#include "confdefs.h"
    14901489#include <des.h>
     
    14941493; return 0; }
    14951494EOF
    1496 if { (eval echo configure:1497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     1495if { (eval echo configure:1496: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    14971496  rm -rf conftest*
    14981497  ac_cv_des_ecb_encrypt_proto=no
     
    15131512
    15141513echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
    1515 echo "configure:1516: checking how to run the C preprocessor" >&5
     1514echo "configure:1515: checking how to run the C preprocessor" >&5
    15161515# On Suns, sometimes $CPP names a directory.
    15171516if test -n "$CPP" && test -d "$CPP"; then
     
    15281527  # not just through cpp.
    15291528  cat > conftest.$ac_ext <<EOF
    1530 #line 1531 "configure"
     1529#line 1530 "configure"
    15311530#include "confdefs.h"
    15321531#include <assert.h>
     
    15341533EOF
    15351534ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1536 { (eval echo configure:1537: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1535{ (eval echo configure:1536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    15371536ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    15381537if test -z "$ac_err"; then
     
    15451544  CPP="${CC-cc} -E -traditional-cpp"
    15461545  cat > conftest.$ac_ext <<EOF
    1547 #line 1548 "configure"
     1546#line 1547 "configure"
    15481547#include "confdefs.h"
    15491548#include <assert.h>
     
    15511550EOF
    15521551ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1553 { (eval echo configure:1554: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1552{ (eval echo configure:1553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    15541553ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    15551554if test -z "$ac_err"; then
     
    15621561  CPP="${CC-cc} -nologo -E"
    15631562  cat > conftest.$ac_ext <<EOF
    1564 #line 1565 "configure"
     1563#line 1564 "configure"
    15651564#include "confdefs.h"
    15661565#include <assert.h>
     
    15681567EOF
    15691568ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1570 { (eval echo configure:1571: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1569{ (eval echo configure:1570: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    15711570ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    15721571if test -z "$ac_err"; then
     
    15931592
    15941593echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
    1595 echo "configure:1596: checking for ANSI C header files" >&5
     1594echo "configure:1595: checking for ANSI C header files" >&5
    15961595if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
    15971596  echo $ac_n "(cached) $ac_c" 1>&6
    15981597else
    15991598  cat > conftest.$ac_ext <<EOF
    1600 #line 1601 "configure"
     1599#line 1600 "configure"
    16011600#include "confdefs.h"
    16021601#include <stdlib.h>
     
    16061605EOF
    16071606ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1608 { (eval echo configure:1609: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1607{ (eval echo configure:1608: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    16091608ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    16101609if test -z "$ac_err"; then
     
    16231622  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
    16241623cat > conftest.$ac_ext <<EOF
    1625 #line 1626 "configure"
     1624#line 1625 "configure"
    16261625#include "confdefs.h"
    16271626#include <string.h>
     
    16411640  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
    16421641cat > conftest.$ac_ext <<EOF
    1643 #line 1644 "configure"
     1642#line 1643 "configure"
    16441643#include "confdefs.h"
    16451644#include <stdlib.h>
     
    16621661else
    16631662  cat > conftest.$ac_ext <<EOF
    1664 #line 1665 "configure"
     1663#line 1664 "configure"
    16651664#include "confdefs.h"
    16661665#include <ctype.h>
     
    16731672
    16741673EOF
    1675 if { (eval echo configure:1676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
     1674if { (eval echo configure:1675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
    16761675then
    16771676  :
     
    16971696
    16981697echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
    1699 echo "configure:1700: checking for sys/wait.h that is POSIX.1 compatible" >&5
     1698echo "configure:1699: checking for sys/wait.h that is POSIX.1 compatible" >&5
    17001699if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then
    17011700  echo $ac_n "(cached) $ac_c" 1>&6
    17021701else
    17031702  cat > conftest.$ac_ext <<EOF
    1704 #line 1705 "configure"
     1703#line 1704 "configure"
    17051704#include "confdefs.h"
    17061705#include <sys/types.h>
     
    17181717; return 0; }
    17191718EOF
    1720 if { (eval echo configure:1721: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
     1719if { (eval echo configure:1720: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
    17211720  rm -rf conftest*
    17221721  ac_cv_header_sys_wait_h=yes
     
    17421741ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
    17431742echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
    1744 echo "configure:1745: checking for $ac_hdr" >&5
     1743echo "configure:1744: checking for $ac_hdr" >&5
    17451744if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    17461745  echo $ac_n "(cached) $ac_c" 1>&6
    17471746else
    17481747  cat > conftest.$ac_ext <<EOF
    1749 #line 1750 "configure"
     1748#line 1749 "configure"
    17501749#include "confdefs.h"
    17511750#include <$ac_hdr>
    17521751EOF
    17531752ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
    1754 { (eval echo configure:1755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
     1753{ (eval echo configure:1754: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
    17551754ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
    17561755if test -z "$ac_err"; then
     
    17841783
    17851784echo $ac_n "checking for the perl xsubpp precompiler""... $ac_c" 1>&6
    1786 echo "configure:1787: checking for the perl xsubpp precompiler" >&5
     1785echo "configure:1786: checking for the perl xsubpp precompiler" >&5
    17871786XSUBPPDIR="`(perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;') | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"
    17881787if test -n "${XSUBPPDIR}"; then
     
    17991798ac_safe=`echo "/usr/share/terminfo" | sed 'y%./+-%__p_%'`
    18001799echo $ac_n "checking for /usr/share/terminfo""... $ac_c" 1>&6
    1801 echo "configure:1802: checking for /usr/share/terminfo" >&5
     1800echo "configure:1801: checking for /usr/share/terminfo" >&5
    18021801if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
    18031802  echo $ac_n "(cached) $ac_c" 1>&6
     
    18241823ac_safe=`echo "/usr/share/lib/terminfo" | sed 'y%./+-%__p_%'`
    18251824echo $ac_n "checking for /usr/share/lib/terminfo""... $ac_c" 1>&6
    1826 echo "configure:1827: checking for /usr/share/lib/terminfo" >&5
     1825echo "configure:1826: checking for /usr/share/lib/terminfo" >&5
    18271826if eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then
    18281827  echo $ac_n "(cached) $ac_c" 1>&6
     
    18851884# ./install, which can be erroneously created by make from ./install.sh.
    18861885echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
    1887 echo "configure:1888: checking for a BSD compatible install" >&5
     1886echo "configure:1887: checking for a BSD compatible install" >&5
    18881887if test -z "$INSTALL"; then
    18891888if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
  • configure.in

    re016fc2 r09489b89  
    4141AC_CHECK_LIB(krb4, krb_sendauth,,
    4242   AC_CHECK_LIB(krb, krb_sendauth))
    43 AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.))
    44 dnl AC_CHECK_LIB(zephyr, ZGetSender)
     43dnl These are both off right now to simluate zephyr not being present
     44dnl AC_CHECK_LIB(zephyr, ZGetSender,, AC_MSG_ERROR(No zephyr library found.))
     45AC_CHECK_LIB(zephyr, ZGetSender)
    4546AC_CHECK_LIB(zephyr, ZInitLocationInfo, AC_DEFINE([HAVE_LIBZEPHYR_ZINITLOCATIONINFO], [], [Have ZInitLocationInfo]),)
    4647
  • filter.c

    re187445 r09489b89  
    6969          !strcasecmp(argv[i], "direction") ||
    7070          !strcasecmp(argv[i], "login")) {
    71         regexstr=owl_util_substitute(argv[i+1], "%me%", ZGetSender());
     71        regexstr=owl_util_substitute(argv[i+1], "%me%", owl_zephyr_get_sender());
    7272        owl_filterelement_create_re(fe, argv[i], regexstr);
    7373        owl_free(regexstr);
  • functions.c

    r7c9c847 r09489b89  
    748748
    749749  /* final clean up */
    750   unsuball();
    751   ZClosePort();
     750  owl_zephyr_shutdown();
    752751  endwin();
    753752  owl_function_debugmsg("Quitting Owl");
     
    12561255  owl_message *m;
    12571256  owl_fmtext fm, attrfm;
     1257  char buff[10000];
     1258  owl_view *v;
     1259#ifdef HAVE_LIBZEPHYR
    12581260  ZNotice_t *n;
    1259   char buff[10000], tmpbuff[1024];
    1260   char *ptr;
    1261   int i, j, fields, len;
    1262   owl_view *v;
     1261#endif
    12631262
    12641263  owl_fmtext_init_null(&fm);
     
    13211320    owl_fmtext_append_normal(&fm, owl_message_get_timestr(m));
    13221321    owl_fmtext_append_normal(&fm, "\n");
    1323 
     1322#ifdef HAVE_LIBZEPHYR
    13241323    if (owl_message_is_direction_in(m)) {
     1324      char *ptr, tmpbuff[1024];
     1325      int i, j, fields, len;
     1326
    13251327      n=owl_message_get_notice(m);
    13261328
     
    13941396      owl_fmtext_append_normal(&fm, n->z_default_format);
    13951397    }
     1398#endif   
    13961399  }
    13971400
     
    15411544void owl_function_getsubs()
    15421545{
    1543   int ret, num, i, one;
    1544   ZSubscription_t sub;
    1545   char *buff, *tmpbuff;
    1546 
    1547   one = 1;
    1548 
    1549   ret=ZRetrieveSubscriptions(0, &num);
    1550   if (ret == ZERR_TOOMANYSUBS) {
    1551     owl_function_makemsg("Zephyr: too many subscriptions");
    1552     return;
    1553   }
    1554 
    1555   buff=owl_malloc(num*500);
    1556   tmpbuff=owl_malloc(num*500);
    1557   strcpy(buff, "");
    1558   for (i=0; i<num; i++) {
    1559     if ((ret = ZGetSubscriptions(&sub, &one)) != ZERR_NONE) {
    1560       owl_function_makemsg("Error while getting subscriptions");
    1561       owl_free(buff);
    1562       owl_free(tmpbuff);
    1563       ZFlushSubscriptions();
    1564       return;
    1565     } else {
    1566       sprintf(tmpbuff, "<%s,%s,%s>\n%s", sub.zsub_class, sub.zsub_classinst, sub.zsub_recipient, buff);
    1567       strcpy(buff, tmpbuff);
    1568     }
    1569   }
    1570 
    1571   owl_function_popless_text(buff);
     1546  char *buff;
     1547
     1548  buff=owl_zephyr_getsubs();
     1549
     1550  if (buff) {
     1551    owl_function_popless_text(buff);
     1552  } else {
     1553    owl_function_popless_text("Error getting subscriptions");
     1554  }
     1555           
    15721556  owl_free(buff);
    1573   owl_free(tmpbuff);
    1574   ZFlushSubscriptions();
    15751557}
    15761558
     
    28632845void owl_function_buddylist(int aim, int zephyr, char *file)
    28642846{
    2865   char *ourfile, *tmp, buff[LINE], *line;
    2866   FILE *f;
    2867   int numlocs, ret, i, j;
    2868   ZLocations_t location[200];
     2847  int i, j;
    28692848  owl_fmtext fm;
    28702849  owl_buddylist *b;
     2850#ifdef HAVE_LIBZEPHYR
     2851  char *ourfile, *tmp, buff[LINE], *line;
     2852  ZLocations_t location[200];
     2853  FILE *f;
     2854  int numlocs, ret;
     2855#endif
    28712856
    28722857  owl_fmtext_init_null(&fm);
     
    28842869  }
    28852870
     2871#ifdef HAVE_LIBZEPHYR
    28862872  if (zephyr) {
    28872873    if (file==NULL) {
     
    29042890      return;
    29052891    }
    2906    
     2892
    29072893    owl_fmtext_append_bold(&fm, "Zephyr users logged in:\n");
    29082894   
     
    29582944    owl_free(ourfile);
    29592945  }
     2946#endif
    29602947 
    29612948  owl_function_popless_fmtext(&fm);
  • global.c

    rcf83b7a r09489b89  
    9797  owl_buddylist_init(&(g->buddylist));
    9898  g->response=NULL;
     99  g->havezephyr=0;
     100  g->haveaim=0;
    99101}
    100102
     
    779781  g->response=resp;
    780782}
     783
     784
     785void owl_global_set_haveaim(owl_global *g)
     786{
     787  g->haveaim=1;
     788}
     789
     790int owl_global_is_haveaim(owl_global *g)
     791{
     792  if (g->haveaim) return(1);
     793  return(0);
     794}
     795
     796void owl_global_set_havezephyr(owl_global *g)
     797{
     798  g->havezephyr=1;
     799}
     800
     801int owl_global_is_havezephyr(owl_global *g)
     802{
     803  if (g->havezephyr) return(1);
     804  return(0);
     805}
  • logging.c

    r723c427 r09489b89  
    1717  /* chop off a local realm */
    1818  ptr=strchr(tobuff, '@');
    19   if (ptr && !strncmp(ptr+1, ZGetRealm(), strlen(ZGetRealm()))) {
     19  if (ptr && !strncmp(ptr+1, owl_zephyr_get_realm(), strlen(owl_zephyr_get_realm()))) {
    2020    *ptr='\0';
    2121  }
     
    129129        from=frombuff=owl_strdup(owl_message_get_sender(m));
    130130        ptr=strchr(frombuff, '@');
    131         if (ptr && !strncmp(ptr+1, ZGetRealm(), strlen(ZGetRealm()))) {
     131        if (ptr && !strncmp(ptr+1, owl_zephyr_get_realm(), strlen(owl_zephyr_get_realm()))) {
    132132          *ptr='\0';
    133133        }
  • message.c

    r1d3e925 r09489b89  
    1 #include <zephyr/zephyr.h>
    21#include <stdlib.h>
    32#include <unistd.h>
     
    434433  return(&(m->notice));
    435434}
     435#else
     436void *owl_message_get_notice(owl_message *m)
     437{
     438  return(NULL);
     439}
    436440#endif
    437441
     
    473477    if (strcasecmp(owl_message_get_class(m), "message")) return(0);
    474478    if (strcasecmp(owl_message_get_instance(m), "personal")) return(0);
    475     if (!strcasecmp(owl_message_get_recipient(m), ZGetSender()) ||
    476         !strcasecmp(owl_message_get_sender(m), ZGetSender())) {
     479    if (!strcasecmp(owl_message_get_recipient(m), owl_zephyr_get_sender()) ||
     480        !strcasecmp(owl_message_get_sender(m), owl_zephyr_get_sender())) {
    477481      return(1);
    478482    }
     
    484488{
    485489  if (owl_message_is_type_zephyr(m)) {
    486     if (!strcasecmp(owl_message_get_sender(m), ZGetSender())) {
     490    if (!strcasecmp(owl_message_get_sender(m), owl_zephyr_get_sender())) {
    487491      return(1);
    488492    } else {
     
    534538
    535539  if (owl_message_is_type_zephyr(m)) {
    536     strcpy(sender, ZGetSender());
     540    strcpy(sender, owl_zephyr_get_sender());
    537541    ptr=strchr(sender, '@');
    538542    if (ptr) *ptr='\0';
     
    620624}
    621625
     626#ifdef HAVE_LIBZEPHYR
    622627void owl_message_create_from_znotice(owl_message *m, ZNotice_t *n)
    623628{
     
    654659    owl_message_set_realm(m, ptr+1);
    655660  } else {
    656     owl_message_set_realm(m, ZGetRealm());
     661    owl_message_set_realm(m, owl_zephyr_get_realm());
    657662  }
    658663
     
    667672
    668673  /* is the "isprivate" attribute if it's a private zephyr */
    669   if (!strcasecmp(n->z_recipient, ZGetSender())) {
     674  if (!strcasecmp(n->z_recipient, owl_zephyr_get_sender())) {
    670675    owl_message_set_isprivate(m);
    671676  }
     
    716721  m->time[strlen(m->time)-1]='\0';
    717722}
     723#else
     724void owl_message_create_from_znotice(owl_message *m, void *n)
     725{
     726}
     727#endif
    718728
    719729void owl_message_create_from_zwriteline(owl_message *m, char *line, char *body, char *zsig)
     
    730740  owl_message_set_direction_out(m);
    731741  owl_message_set_type_zephyr(m);
    732   owl_message_set_sender(m, ZGetSender());
     742  owl_message_set_sender(m, owl_zephyr_get_sender());
    733743  owl_message_set_class(m, owl_zwrite_get_class(&z));
    734744  owl_message_set_instance(m, owl_zwrite_get_instance(&z));
     
    765775  int i, j;
    766776  owl_pair *p;
    767    
     777#ifdef HAVE_LIBZEPHYR   
    768778  if (owl_message_is_type_zephyr(m) && owl_message_is_direction_in(m)) {
    769779    ZFreeNotice(&(m->notice));
    770780  }
     781#endif
    771782  if (m->time) owl_free(m->time);
    772783  if (m->zwriteline) owl_free(m->zwriteline);
  • owl.c

    rcf83b7a r09489b89  
    1515#include <stdlib.h>
    1616#include <string.h>
    17 #include <zephyr/zephyr.h>
    1817#include <com_err.h>
    1918#include <signal.h>
     
    4140  struct tm *today;
    4241  char *dir;
     42#ifdef HAVE_LIBZEPHYR
    4343  ZNotice_t notice;
     44#endif
    4445
    4546  argcsave=argc;
     
    133134  if (debug) owl_global_set_debug_on(&g);
    134135  owl_global_set_startupargs(&g, argcsave, argvsave);
    135 
     136#ifdef HAVE_LIBZEPHYR
     137  owl_global_set_havezephyr(&g);
     138#endif
     139  owl_global_set_haveaim(&g);
     140 
    136141  /* create the owl directory, in case it does not exist */
    137142  dir=owl_sprintf("%s/%s", owl_global_get_homedir(&g), OWL_CONFIG_DIR);
     
    340345    zpendcount=0;
    341346    while(owl_zephyr_zpending() || owl_global_messagequeue_pending(&g)) {
     347#ifdef HAVE_LIBZEPHYR
    342348      struct sockaddr_in from;
     349#endif
    343350      owl_message *m;
    344351      owl_filter *f;
    345      
     352
    346353      /* grab the new message, stick it in 'm' */
    347354      if (owl_zephyr_zpending()) {
     355#ifdef HAVE_LIBZEPHYR
    348356        /* grab a zephyr notice, but if we've done 20 without stopping,
    349357           take a break to process keystrokes etc. */
     
    366374        m=owl_malloc(sizeof(owl_message));
    367375        owl_message_create_from_znotice(m, &notice);
     376#endif
    368377      } else if (owl_global_messagequeue_pending(&g)) {
    369378        m=owl_global_messageuque_popmsg(&g);
  • owl.h

    r7c9c847 r09489b89  
    1111#include "config.h"
    1212#ifdef HAVE_LIBZEPHYR
    13 #include <zephyr/zephyr.h>
     13#undef HAVE_LIBZEPHYR
     14/* #include <zephyr/zephyr.h> */ /* this is to simulate not having zephyr */
    1415#endif
    1516
     
    1718static const char owl_h_fileIdent[] = "$Id$";
    1819
    19 #define OWL_VERSION         2.0.6
    20 #define OWL_VERSION_STRING "2.0.6"
     20#define OWL_VERSION         2.0.7-pre-1
     21#define OWL_VERSION_STRING "2.0.7-pre-1"
    2122
    2223#define OWL_DEBUG 0
     
    446447  owl_list stylelist;       /* global list of available styles */
    447448  char *response;           /* response to the last question asked */
     449  int havezephyr;
     450  int haveaim;
    448451} owl_global;
    449452
  • stylefunc.c

    r778d0a9 r09489b89  
    99void owl_stylefunc_basic(owl_fmtext *fm, owl_message *m)
    1010{
     11#ifdef HAVE_LIBZEPHYR
    1112  char *body, *indent, *ptr, *zsigbuff, frombuff[LINE];
    1213  ZNotice_t *n;
     14#endif
    1315
    1416  if (owl_message_is_type_zephyr(m) && owl_message_is_direction_in(m)) {
     17#ifdef HAVE_LIBZEPHYR
    1518    n=owl_message_get_notice(m);
    16 
     19 
    1720    /* get the body */
    1821    body=owl_strdup(owl_message_get_body(m));
     
    3134    strcpy(frombuff, owl_message_get_sender(m));
    3235    ptr=strchr(frombuff, '@');
    33     if (ptr && !strncmp(ptr+1, ZGetRealm(), strlen(ZGetRealm()))) {
     36    if (ptr && !strncmp(ptr+1, owl_zephyr_get_realm(), strlen(owl_zephyr_get_realm()))) {
    3437      *ptr='\0';
    3538    }
     
    8487      }
    8588      owl_fmtext_append_normal(fm, frombuff);
    86       if (strcasecmp(owl_message_get_realm(m), ZGetRealm())) {
     89      if (strcasecmp(owl_message_get_realm(m), owl_zephyr_get_realm()) {
    8790        owl_fmtext_append_normal(fm, " {");
    8891        owl_fmtext_append_normal(fm, owl_message_get_realm(m));
     
    112115    owl_free(body);
    113116    owl_free(indent);
     117#endif
    114118  } else if (owl_message_is_type_zephyr(m) && owl_message_is_direction_out(m)) {
    115119    char *indent, *text, *zsigbuff, *foo;
     
    200204void owl_stylefunc_default(owl_fmtext *fm, owl_message *m)
    201205{
     206#ifdef HAVE_LIBZEPHYR
    202207  char *body, *indent, *ptr, *zsigbuff, frombuff[LINE];
    203208  ZNotice_t *n;
     209#endif
    204210
    205211  if (owl_message_is_type_zephyr(m) && owl_message_is_direction_in(m)) {
     212#ifdef HAVE_LIBZEPHYR
    206213    n=owl_message_get_notice(m);
    207  
     214
    208215    /* get the body */
    209216    body=owl_malloc(strlen(owl_message_get_body(m))+30);
     
    222229    strcpy(frombuff, owl_message_get_sender(m));
    223230    ptr=strchr(frombuff, '@');
    224     if (ptr && !strncmp(ptr+1, ZGetRealm(), strlen(ZGetRealm()))) {
     231    if (ptr && !strncmp(ptr+1, owl_zephyr_get_realm(), strlen(owl_zephyr_get_realm()))) {
    225232      *ptr='\0';
    226233    }
     
    254261      }
    255262      owl_fmtext_append_normal(fm, " for ");
    256       ptr=short_zuser(n->z_class_inst);
     263      ptr=short_zuser(owl_zephyr_get_instance(m));
    257264      owl_fmtext_append_bold(fm, ptr);
    258265      owl_free(ptr);
     
    276283        owl_fmtext_append_normal(fm, "} ");
    277284      }
    278       if (n->z_opcode[0]!='\0') {
     285      if (strccmp(owl_zephyr_get_opcode(m), "")) {
    279286        owl_fmtext_append_normal(fm, " [");
    280287        owl_fmtext_append_normal(fm, owl_message_get_opcode(m));
     
    304311    owl_free(body);
    305312    owl_free(indent);
     313#endif
    306314  } else if (owl_message_is_type_zephyr(m) && owl_message_is_direction_out(m)) {
    307315    char *indent, *text, *zsigbuff, *foo;
     
    395403  char *baseformat="%s %-13.13s %-11.11s %-12.12s ";
    396404  char *sender, *recip;
     405#ifdef HAVE_LIBZEPHYR
    397406  ZNotice_t *n;
    398 
     407#endif
    399408
    400409  sender=short_zuser(owl_message_get_sender(m));
     
    402411 
    403412  if (owl_message_is_type_zephyr(m)) {
     413#ifdef HAVE_LIBZEPHYR
    404414    n=owl_message_get_notice(m);
    405415   
     
    472482    owl_free(sender);
    473483    owl_free(recip);
    474    
     484#endif
    475485  } else if (owl_message_is_type_aim(m)) {
    476486    owl_fmtext_append_spaces(fm, OWL_TAB);
  • util.c

    re7cc1c3 r09489b89  
    427427  ptr=strchr(out, '@');
    428428  if (ptr) {
    429     if (!strcasecmp(ptr+1, ZGetRealm())) {
     429    if (!strcasecmp(ptr+1, owl_zephyr_get_realm())) {
    430430      *ptr='\0';
    431431    }
     
    444444    return owl_strdup(in);
    445445  } else {
    446     return owl_sprintf("%s@%s", in, ZGetRealm());
     446    return owl_sprintf("%s@%s", in, owl_zephyr_get_realm());
    447447  }
    448448}
  • variable.c

    rb278973 r09489b89  
    354354
    355355int owl_variable_tty_set(owl_variable *v, void *newval) {
    356   ZInitLocationInfo(owl_global_get_hostname(&g), newval);
     356  owl_zephyr_set_locationinfo(owl_global_get_hostname(&g), newval);
    357357  return(owl_variable_string_set_default(v, newval));
    358358}
  • zcrypt.c

    rc86a35c r09489b89  
    2626#include <sys/types.h>
    2727#include <des.h>
    28 #include <zephyr/zephyr.h>
    2928
    3029#define MAX_KEY 128
  • zephyr.c

    rb2a91b6 r09489b89  
    44#include <sys/wait.h>
    55#include <string.h>
    6 #include <zephyr/zephyr.h>
    76#include <com_err.h>
    87#include "owl.h"
     
    109static const char fileIdent[] = "$Id$";
    1110
     11#ifdef HAVE_LIBZEPHYR
    1212Code_t ZResetAuthentication();
     13#endif
    1314
    1415int owl_zephyr_initialize()
    1516{
     17#ifdef HAVE_LIBZEPHYR
    1618  int ret;
    1719 
     
    2426    return(1);
    2527  }
     28#endif
     29  return(0);
     30}
     31
     32
     33int owl_zephyr_shutdown()
     34{
     35#ifdef HAVE_LIBZEPHYR
     36  unsuball();
     37  ZClosePort();
     38#endif
    2639  return(0);
    2740}
     
    3346#else
    3447  return(0);
     48#endif
     49}
     50
     51char *owl_zephyr_get_realm()
     52{
     53#ifdef HAVE_LIBZEPHYR
     54  return(ZGetRealm());
     55#else
     56  return("");
     57#endif
     58}
     59
     60char *owl_zephyr_get_sender()
     61{
     62#ifdef HAVE_LIBZEPHYR
     63  return(ZGetSender());
     64#else
     65  return("");
    3566#endif
    3667}
     
    258289  return("");
    259290}
     291#else
     292char *owl_zephyr_get_field(void *n, int j, int *k)
     293{
     294  return("");
     295}
    260296#endif
    261297
     
    271307 
    272308  return(fields);
     309}
     310#else
     311int owl_zephyr_get_num_fields(void *n)
     312{
     313  return(0);
    273314}
    274315#endif
     
    298339  *k=strlen(n->z_message);
    299340  return(n->z_message);
     341}
     342#else
     343char *owl_zephyr_get_zsig(void *n, int *k)
     344{
     345  return("");
    300346}
    301347#endif
     
    396442  }
    397443}
     444#else
     445void owl_zephyr_handle_ack(void *retnotice)
     446{
     447}
    398448#endif
    399449
     
    405455    return(1);
    406456  }
     457  return(0);
     458}
     459#else
     460int owl_zephyr_notice_is_ack(void *n)
     461{
    407462  return(0);
    408463}
     
    654709
    655710/* return auth string */
     711#ifdef HAVE_LIBZEPHYR
    656712char *owl_zephyr_get_authstr(ZNotice_t *n)
    657713{
     
    669725  }           
    670726}
    671 
    672 
     727#else
     728char *owl_zephyr_get_authstr(void *n)
     729{
     730  return("");
     731}
     732#endif
     733
     734
     735/* returns a buffer of subscriptions or an error message.
     736 * Caller must free the return.
     737 */
     738char *owl_zephyr_getsubs()
     739{
     740#ifdef HAVE_LIBZEPHYR
     741  int ret, num, i, one;
     742  ZSubscription_t sub;
     743  char *out, *tmpbuff;
     744  one=1;
     745
     746  ret=ZRetrieveSubscriptions(0, &num);
     747  if (ret==ZERR_TOOMANYSUBS) {
     748    out=owl_strdup("Zephyr: too many subscriptions\n");
     749    return(out);
     750  }
     751
     752  out=owl_malloc(num*500);
     753  tmpbuff=owl_malloc(num*500);
     754  strcpy(out, "");
     755  for (i=0; i<num; i++) {
     756    if ((ret = ZGetSubscriptions(&sub, &one)) != ZERR_NONE) {
     757      owl_free(out);
     758      owl_free(tmpbuff);
     759      ZFlushSubscriptions();
     760      out=owl_strdup("Error while getting subscriptions\n");
     761      return(out);
     762    } else {
     763      sprintf(tmpbuff, "<%s,%s,%s>\n%s", sub.zsub_class, sub.zsub_classinst, sub.zsub_recipient, buff);
     764      strcpy(out, tmpbuff);
     765    }
     766  }
     767
     768  owl_free(tmpbuff);
     769  ZFlushSubscriptions();
     770  return(out);
     771#else
     772  return("");
     773#endif
     774}
     775
     776char *owl_zephyr_get_variable(char *var)
     777{
     778#ifdef HAVE_LIBZEPHYR
     779  return(ZGetVariable(var));
     780#else
     781  return("");
     782#endif
     783}
     784
     785void owl_zephyr_set_locationinfo(char *host, char *val)
     786{
     787#ifdef HAVE_LIBZEPHYR
     788  ZInitLocationInfo(host, val);
     789#endif
     790}
     791 
  • zwrite.c

    re016fc2 r09489b89  
    143143    zsigproc = owl_global_get_zsigproc(&g);
    144144    zsigowlvar = owl_global_get_zsig(&g);
    145     zsigzvar = ZGetVariable("zwrite-signature");
     145    zsigzvar = owl_zephyr_get_variable("zwrite-signature");
    146146
    147147    if (zsigowlvar && *zsigowlvar) {
Note: See TracChangeset for help on using the changeset viewer.