Changeset 8b2419c
- Timestamp:
- Aug 8, 2013, 2:32:12 PM (11 years ago)
- Parents:
- 4f7b1f4 (diff), 5625001 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Files:
-
- 5 added
- 47 deleted
- 35 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r81691e8 r1c22155 3 3 *.par 4 4 .deps 5 /bin/ 5 6 META.yml 7 MYMETA.yml 6 8 Makefile 7 9 Makefile.in … … 10 12 aclocal.m4 11 13 autom4te.cache 12 barnowl.bin 13 tester.bin 14 zcrypt 14 barnowl 15 15 blib 16 16 config.cache … … 23 23 core 24 24 depcomp 25 gmarshal_funcs.c 26 gmarshal_funcs.h 27 inc/ 25 28 install-sh 26 29 jabber.log … … 29 32 owl_prototypes.h.new 30 33 perlglue.c 31 perlwrap.c32 34 pm_to_blib 35 runtests.sh.log 36 runtests.sh.trs 33 37 stamp-h1 38 test-driver 39 test-suite.log 40 tester 34 41 varstubs.c 42 zcrypt -
AUTHORS
r1d2c4c3 r80c0fc7 3 3 4 4 The following people have provided patches or other contributions: 5 Alex Vandiver 6 Kevin Chen 7 Arun Tharuvai 5 8 Sam Hartman 6 Alex Vandiver7 Geoffrey Thomas8 9 Derrick Brashear 9 10 David Glasser 11 Eric Price 10 12 Matthew Goldstein 11 Arun Tharuvai 12 Kevin Chen 13 Eric Price 13 Geoffrey Thomas 14 Anders Kaseorg 15 Greg Price 16 Chris Lesniewski-Laas 17 Alex Dehnert 18 Edward Z. Yang 19 Karl Ramm 20 Evan Broder 21 David Benjamin 22 Cathy Zhang 23 Joshua Oreman 24 Leonid Grinberg 25 Kevin Riggle 26 Brian Sniffen 27 William Throwe 28 Jason Gross 29 Adam Glasgall 30 Tim Hill 31 DD Liu 32 Betsy Riley 33 Robert Jacobs 14 34 15 BarnOwl is based on code from Owl, which was originally primar ly35 BarnOwl is based on code from Owl, which was originally primarily 16 36 written by James Kretchmar. Erik Nygren also made substantial 17 contributions and improvem nts to the program.37 contributions and improvements to the program. 18 38 19 The following people provided patches and other tech incal support for39 The following people provided patches and other technical support for 20 40 Owl: 21 41 … … 30 50 Mark Eichin 31 51 32 Mark Eichin is also maintaining the debian package of Owl.52 Mark Eichin is also maintaining the Debian package of Owl. 33 53 34 54 The following people helped with beta testing the earliest versions of -
ChangeLog
r65ff3f4 r1b17f50 1 1.9 2 * Add getnumlines() to perl interface -asedeno@mit.edu 3 * Include names of invalid filters on filter errors -adehnert@mit.edu 4 * Don't incorrectly mark decryption failures as decrypted -davidben@mit.edu 5 * Hide the default cursor when possible -davidben@mit.edu 6 * Complete viewperson and vp as viewuser and vu -davidben@mit.edu 7 * Set z_charset = ZCHARSET_UTF_8 -andersk@mit.edu 8 * Allow zsender spoofing on cross-realm classes -andersk@mit.edu 9 * Append the realm to the zsender if missing -andersk@mit.edu 10 * Redisplay on setting colorztext -jgross@mit.edu 11 * Rename default config file to .owl/init.pl -kevinr@free-dissociation.com 12 * Add completion for jabberlogout -adehnert@mit.edu 13 * Switch to interactive context before sourcing the startup file -davidben@mit.edu 14 * Add completion for reload-module -adehnert@mit.edu 15 * editwin callback for canceling the editwin -jgross@mit.edu 16 * Fix dirtying windows inside a redraw handler -davidben@mit.edu 17 * Facebook module -ezyang@mit.edu 18 * Complete unstartup command just like startup command -jgross@mit.edu 19 * Fix the description of disable-ctrl-d -jgross@mit.edu 20 * Use wbkgrndset instead of wbkgdset in _owl_fmtext_wcolor_set -davidben@mit.edu 21 * Show the time zone in :info -jgross@mit.edu 22 * Treat [!.?]" as end of sentence in edit:fill-paragraph -jgross@mit.edu 23 * Correctly display multiline fields in :info -jgross@mit.edu 24 25 1.8.1 26 * Only add outgoing messages for personal part of half-personal messages -andersk@mit.edu 27 * Don’t write CC: line on zwrite -C '' -andersk@mit.edu 28 * Don’t send public pings on zwrite '' or zwrite @REALM -andersk@mit.edu 29 * Don’t treat zwrite '' as personal -andersk@mit.edu 30 * Stop pretending to support zwrite * -andersk@mit.edu 31 * Show foreign realms on non-personal zephyrs like Owl did -andersk@mit.edu 32 * Fix memory leak in zcrypt -davidben@mit.edu 33 * Don't attempt to switch filters in :view -d if invalid -davidben@mit.edu 34 * Fixed typo in unbindkey usage error -rileyb@mit.edu 35 * Fix bug generating filter text in 256-color mode -asedeno@mit.edu 36 * Remove ^noc from reply-lockout -geofft@mit.edu 37 * Avoid quadratic loops when receiving zephyrs -andersk@mit.edu 38 * Fix hang on empty zcrypt messages -adehnert@MIT.EDU 39 1 40 1.8 2 41 * Compute the home directory in zcrypt consistently with BarnOwl -davidben@mit.edu -
Makefile.am
r353719a ra223b6b 4 4 GIT_FLAGS := $(if $(GIT_DESCRIPTION),-DGIT_VERSION=$(GIT_DESCRIPTION:barnowl-%=%)) 5 5 6 bin_PROGRAMS = b arnowl.bin6 bin_PROGRAMS = bin/barnowl 7 7 if ENABLE_ZCRYPT 8 8 bin_PROGRAMS += zcrypt … … 11 11 zcrypt_SOURCES = zcrypt.c filterproc.c 12 12 13 check_PROGRAMS = tester.bin 13 check_PROGRAMS = bin/tester 14 dist_check_DATA = t 15 dist_check_SCRIPTS = runtests.sh 14 16 15 barnowl_bin_SOURCES = $(BASE_SRCS) \ 16 owl.h owl_perl.h config.h \ 17 owl.c \ 18 $(GEN_C) $(GEN_H) 17 noinst_SCRIPTS = barnowl 18 check_SCRIPTS = tester 19 19 20 man_MANS = doc/barnowl.1 21 doc_DATA = doc/intro.txt doc/advanced.txt 20 barnowl tester: %: barnowl-wrapper.in bin/% Makefile 21 sed \ 22 -e 's,[@]abs_srcdir[@],$(abs_srcdir),g' \ 23 -e 's,[@]abs_builddir[@],$(abs_builddir),g' \ 24 $< > $@ 25 chmod +x $@ 22 26 23 barnowl_bin_LDADD = compat/libcompat.a libfaim/libfaim.a 27 bin_barnowl_SOURCES = $(BASE_SRCS) \ 28 owl.h owl_perl.h \ 29 owl.c 30 nodist_bin_barnowl_SOURCES = $(GEN_C) $(GEN_H) 24 31 25 tester_bin_SOURCES = $(BASE_SRCS) \ 26 owl.h owl_perl.h config.h \ 27 $(GEN_C) $(GEN_H) \ 32 dist_man_MANS = doc/barnowl.1 33 dist_doc_DATA = doc/intro.txt doc/advanced.txt 34 35 bin_barnowl_LDADD = compat/libcompat.a libfaim/libfaim.a 36 37 bin_tester_SOURCES = $(BASE_SRCS) \ 38 owl.h owl_perl.h \ 28 39 tester.c 40 nodist_bin_tester_SOURCES = $(GEN_C) $(GEN_H) 29 41 30 tester_bin_LDADD = compat/libcompat.a libfaim/libfaim.a42 bin_tester_LDADD = compat/libcompat.a libfaim/libfaim.a 31 43 32 44 TESTS=runtests.sh 33 45 34 AM_CPPFLAGS = -I$(top_srcdir)/\46 AM_CPPFLAGS = \ 35 47 -I$(top_srcdir)/libfaim/ \ 36 48 -DDATADIR='"$(pkgdatadir)"' \ … … 48 60 mainpanel.c msgwin.c sepbar.c editcontext.c signal.c closures.c 49 61 50 NORMAL_SRCS = filterproc.c window.cwindowcb.c62 NORMAL_SRCS = filterproc.c filterproc.h window.c window.h windowcb.c 51 63 52 64 BASE_SRCS = $(CODELIST_SRCS) $(NORMAL_SRCS) 53 65 54 66 GEN_C = varstubs.c perlglue.c gmarshal_funcs.c 55 GEN_H = owl_prototypes.h gmarshal_funcs.h67 GEN_H = owl_prototypes.h owl_prototypes.h.new gmarshal_funcs.h 56 68 57 69 BUILT_SOURCES = $(GEN_C) $(GEN_H) … … 66 78 proto: owl_prototypes.h 67 79 68 perlglue.c: perlglue.xs $(TYPEMAP)69 $(AM_V_GEN)perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes perlglue.xs > perlglue.c80 perlglue.c: perlglue.xs typemap 81 $(AM_V_GEN)perl $(XSUBPPDIR)/xsubpp $(XSUBPPFLAGS) -prototypes $< > $@ 70 82 71 83 varstubs.c: stubgen.pl variable.c … … 84 96 $(COMPILE) -Wall -Wextra -pedantic -fsyntax-only $(CHK_SOURCES) 85 97 86 install-data-local: 87 $(mkinstalldirs) ${DESTDIR}${pkgdatadir}/lib 88 (cd perl/lib && tar -cf - . ) | (cd ${DESTDIR}${pkgdatadir}/lib && tar -xf - ) 89 90 do_transform = $(shell echo '$(1)' | sed '$(transform)') 91 install-exec-hook: 92 mv -f $(DESTDIR)$(bindir)/$(call do_transform,barnowl.bin) \ 93 $(DESTDIR)$(bindir)/$(call do_transform,barnowl) 98 CLEANFILES = $(BUILT_SOURCES) $(noinst_SCRIPTS) $(check_SCRIPTS) 99 EXTRA_DIST = \ 100 autogen.sh \ 101 barnowl-wrapper.in \ 102 codelist.pl \ 103 doc/code.txt \ 104 doc/owl-window.txt \ 105 doc/releasing-barnowl.txt \ 106 examples \ 107 marshal_types \ 108 perlglue.xs \ 109 scripts \ 110 stubgen.pl \ 111 typemap 94 112 95 113 SUBDIRS = compat libfaim perl -
README
rba5e919 r1c22155 21 21 AnyEvent 22 22 Class::Accessor 23 ExtUtils::Depends 23 24 Glib 25 Module::Install 24 26 PAR 25 ExtUtils::Depends26 27 27 28 (Note that these are all available as Debian packages) -
barnowl-wrapper.in
- Property mode changed from 100755 to 100644
rf5f6ec0 ra223b6b 1 1 #!/bin/sh 2 2 # This is a wrapper script to point BARNOWL_DATA_DIR at the source dir 3 # if we're running from a build tree. b arnowl.binis the actual built3 # if we're running from a build tree. bin/barnowl is the actual built 4 4 # binary. 5 5 6 SRCDIR=`dirname "${0}"` 7 EXE="$0.bin" 6 EXE="@abs_builddir@/bin/$(basename "$0")" 8 7 9 8 if test ! -x "$EXE"; then … … 12 11 fi 13 12 14 BARNOWL_DATA_DIR=" $SRCDIR/perl/"15 BARNOWL_BIN_DIR=" $SRCDIR/"13 BARNOWL_DATA_DIR="@abs_srcdir@/perl" 14 BARNOWL_BIN_DIR="@abs_builddir@" 16 15 export BARNOWL_DATA_DIR 17 16 export BARNOWL_BIN_DIR -
compat/Makefile.am
r12a6616 rb80bae0 1 1 noinst_LIBRARIES = libcompat.a 2 2 3 libcompat_a_SOURCES = 3 libcompat_a_SOURCES = compat.h 4 4 libcompat_a_LIBADD = $(LIBOBJS) -
compat/compat.h
r4dde585 r6249a88f 2 2 #define INC_BARNOWL_COMPAT_COMPAT_H 3 3 4 #include "../config.h"4 #include <config.h> 5 5 6 6 #include <stddef.h> -
configure.ac
r06e04a9 r77dfeb1 1 1 dnl Process this file with autoconf to produce a configure script. 2 2 AC_INIT([BarnOwl],[1.10dev],[bug-barnowl@mit.edu]) 3 AM_INIT_AUTOMAKE([1.7.0 -Wall -Wno-portability foreign]) 3 AM_INIT_AUTOMAKE([1.7.0 foreign std-options -Wall -Wno-portability]) 4 AM_MAINTAINER_MODE([enable]) 4 5 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) 5 6 … … 9 10 AC_PROG_CC 10 11 AC_PROG_CC_C99 12 AC_PROG_LN_S 13 14 AC_ARG_WITH([zephyr-default-format], 15 [AS_HELP_STRING([--with-zephyr-default-format], 16 [value for the default format zephyrgram field])], 17 [ 18 case $withval in 19 yes) withval='Config error: see http://mit.edu/df';; 20 no) withval='';; 21 esac 22 zephyr_default_format=$withval 23 ], 24 [zephyr_default_format='Config error: see http://mit.edu/df']) 25 AC_DEFINE_UNQUOTED( 26 [ZEPHYR_DEFAULT_FORMAT], ["$zephyr_default_format"], 27 [Value for the default format zephyrgram field] 28 ) 11 29 12 30 AC_ARG_WITH([stack-protector], … … 100 118 dnl Find the location of perl XSUBPP 101 119 AC_MSG_CHECKING(for the perl xsubpp precompiler) 102 XSUBPPDIR="` (perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;')| grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`"120 XSUBPPDIR="`cd "$srcdir" && perl -MExtUtils::MakeMaker -e 'print ExtUtils::MakeMaker->new({NAME => qw(owl)})->tool_xsubpp;' | grep \^XSUBPPDIR | sed -e 's/XSUBPPDIR = //g;'`" 103 121 if test -n "${XSUBPPDIR}"; then 104 122 AC_MSG_RESULT(${XSUBPPDIR}) … … 123 141 AX_PROG_PERL_MODULES([Class::Accessor::Fast],, 124 142 [AC_MSG_ERROR([cannot find perl module Class::Accessor::Fast.])]) 143 AX_PROG_PERL_MODULES([ExtUtils::Depends],, 144 [AC_MSG_ERROR([cannot find perl module ExtUtils::Depends])]) 125 145 AX_PROG_PERL_MODULES([Glib],, 126 146 [AC_MSG_ERROR([cannot find perl module Glib.])]) 147 AX_PROG_PERL_MODULES([Module::Install::Base],, 148 [AC_MSG_ERROR([cannot find perl module Module::Install::Base])]) 127 149 AX_PROG_PERL_MODULES([PAR],, 128 150 [AC_MSG_WARN([PAR.pm not found. Loadable modules will be disabled.])]) 129 AX_PROG_PERL_MODULES([ExtUtils::Depends],,130 [AC_MSG_ERROR([cannot find perl module ExtUtils::Depends])])131 151 132 152 dnl Add CFLAGS and LIBS for glib-2.0 … … 167 187 dnl Define __EXTENSIONS__ for strcasecmp on Solaris. 168 188 AM_CFLAGS="$AM_CFLAGS -D__EXTENSIONS__" 189 dnl Define _XOPEN_SOURCE_EXTENDED for some features in ncurses, 190 dnl including cchar_t. This should not be necessary with 191 dnl _XOPEN_SOURCE=600, but some versions of ncurses 192 dnl apparently still need it. 193 AM_CFLAGS="$AM_CFLAGS -D_XOPEN_SOURCE_EXTENDED" 169 194 170 195 AC_SUBST([AM_CFLAGS]) … … 185 210 AC_REPLACE_FUNCS([memrchr]) 186 211 212 AC_SUBST([abs_builddir]) 213 AC_SUBST([abs_srcdir]) 214 187 215 AC_CONFIG_FILES([Makefile compat/Makefile libfaim/Makefile perl/Makefile perl/modules/Makefile]) 188 216 AC_OUTPUT -
doc/releasing-barnowl.txt
r5f08dbe rd995ff3 16 16 - [ ] Do a locker build (See DOING A LOCKER BUILD) 17 17 - [ ] Update configure.ac on master to bump the version to 1.(N+1)dev 18 - [ ] Add the barnowl-1.(N+1)dev git tag 18 19 - [ ] Push git git: 19 20 - [ ] The RC commit 20 21 - [ ] The configure.ac change on master 21 22 - [ ] A release-1.N branch pointing at the RC commit 23 - [ ] the new git tags 24 - [ ] Update debian/changelog on the launchpad build using `dch -v 1.(N+1)` 25 - [ ] bzr branch lp:~barnowl/barnowl/packaging && cd packaging && dch -v 1.(N+1) 26 - [ ] Add relevant changelog entries such as "New upstream release" or 27 "Placeholder version number for daily builds."; fix your name and email 28 if necessary 29 - [ ] bzr commit && bzr push 22 30 - [ ] Copy tarball into /mit/barnowl/web_scripts/dist 23 31 - [ ] Send mail announcing the RC to barnowl-dev@mit.edu … … 31 39 * DOING THE ACTUAL RELEASE 32 40 - [ ] Update the changelog and configure.ac for barnowl 1.N 41 - [ ] Copy the changelog changes to the master branch 33 42 - [ ] run ./scripts/do-release 34 43 - [ ] Do the locker build -
filterproc.c
r3496369 r7155955 1 #include " owl.h"1 #include "filterproc.h" 2 2 #include <sys/wait.h> 3 #include <fcntl.h> 4 #include <glib.h> 3 5 #include <poll.h> 6 #include <string.h> 7 #include <unistd.h> 4 8 5 9 /* Even in case of error, send_receive is responsible for closing wfd -
functions.c
r05adccf r60e8617 855 855 void owl_function_unsuball(void) 856 856 { 857 unsuball();858 owl_function_makemsg("Unsubscribed from all messages.");857 if (unsuball()) 858 owl_function_makemsg("Unsubscribed from all messages."); 859 859 } 860 860 -
global.c
r0792d99 r6383920 9 9 const char *homedir; 10 10 11 #if !GLIB_CHECK_VERSION(2, 35, 0) 11 12 g_type_init(); 13 #endif 12 14 #if !GLIB_CHECK_VERSION(2, 31, 0) 13 15 g_thread_init(NULL); … … 847 849 } filters[] = { 848 850 { "personal", 849 "isprivate ^true$ and ( not type ^zephyr$ or ( class ^message 851 "isprivate ^true$ and ( not type ^zephyr$ or ( class ^message$ ) )" }, 850 852 { "trash", 851 853 "class ^mail$ or opcode ^ping$ or type ^admin$ or ( not login ^none$ )" }, … … 854 856 { "auto", "opcode ^auto$" }, 855 857 { "login", "not login ^none$" }, 856 { "reply-lockout", "class ^mail$ " },858 { "reply-lockout", "class ^mail$ or class ^filsrv$" }, 857 859 { "out", "direction ^out$" }, 858 860 { "aim", "type ^aim$" }, -
libfaim/Makefile.am
r215c119 rb80bae0 13 13 libfaim_a_CPPFLAGS = -DAIM_BUILDDATE=\"x\" -DAIM_BUILDTIME=\"x\" \ 14 14 -I${top_srcdir}/libfaim 15 16 EXTRA_DIST = oscar.c -
m4/ax_cflags_warn_all.m4
r378ede7 re9b4a2c 25 25 # - $3 action-if-found : add value to shellvariable 26 26 # - $4 action-if-not-found : nothing 27 # 28 # NOTE: These macros depend on AX_APPEND_FLAG. 27 29 # 28 30 # LICENSE … … 57 59 # exception to the GPL to apply to your modified version as well. 58 60 59 #serial 1 061 #serial 14 60 62 61 AC_DEFUN([AX_ CFLAGS_WARN_ALL],[dnl62 AS_VAR_PUSHDEF([FLAGS],[ CFLAGS])dnl63 AS_VAR_PUSHDEF([VAR],[ac_cv_ cflags_warn_all])dnl63 AC_DEFUN([AX_FLAGS_WARN_ALL],[dnl 64 AS_VAR_PUSHDEF([FLAGS],[_AC_LANG_PREFIX[]FLAGS])dnl 65 AS_VAR_PUSHDEF([VAR],[ac_cv_[]_AC_LANG_ABBREV[]flags_warn_all])dnl 64 66 AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings], 65 67 VAR,[VAR="no, unknown" 66 AC_LANG_PUSH([C]) 67 ac_save_[]FLAGS="$[]FLAGS" 68 for ac_arg dnl 69 in "-pedantic % -Wall" dnl GCC 70 "-xstrconst % -v" dnl Solaris C 71 "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix 72 "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX 73 "-ansi -ansiE % -fullwarn" dnl IRIX 74 "+ESlit % +w1" dnl HP-UX C 75 "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10) 76 "-h conform % -h msglevel 2" dnl Cray C (Unicos) 77 # 78 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` 79 AC_COMPILE_IFELSE([AC_LANG_PROGRAM], 80 [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) 81 done 82 FLAGS="$ac_save_[]FLAGS" 83 AC_LANG_POP([C]) 84 ]) 85 case ".$VAR" in 86 .ok|.ok,*) m4_ifvaln($3,$3) ;; 87 .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[ 88 AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"]) 89 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;; 90 *) m4_ifvaln($3,$3,[ 91 if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null 92 then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR]) 93 else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"]) 94 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR" 95 fi ]) ;; 96 esac 97 AS_VAR_POPDEF([VAR])dnl 98 AS_VAR_POPDEF([FLAGS])dnl 99 ]) 100 101 dnl the only difference - the LANG selection... and the default FLAGS 102 103 AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl 104 AS_VAR_PUSHDEF([FLAGS],[CXXFLAGS])dnl 105 AS_VAR_PUSHDEF([VAR],[ax_cv_cxxflags_warn_all])dnl 106 AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings], 107 VAR,[VAR="no, unknown" 108 AC_LANG_PUSH([C++]) 109 ac_save_[]FLAGS="$[]FLAGS" 110 for ac_arg dnl 111 in "-pedantic % -Wall" dnl GCC 112 "-xstrconst % -v" dnl Solaris C 113 "-std1 % -verbose -w0 -warnprotos" dnl Digital Unix 114 "-qlanglvl=ansi % -qsrcmsg -qinfo=all:noppt:noppc:noobs:nocnd" dnl AIX 115 "-ansi -ansiE % -fullwarn" dnl IRIX 116 "+ESlit % +w1" dnl HP-UX C 117 "-Xc % -pvctl[,]fullmsg" dnl NEC SX-5 (Super-UX 10) 118 "-h conform % -h msglevel 2" dnl Cray C (Unicos) 119 # 120 do FLAGS="$ac_save_[]FLAGS "`echo $ac_arg | sed -e 's,%%.*,,' -e 's,%,,'` 121 AC_COMPILE_IFELSE([AC_LANG_PROGRAM], 122 [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) 123 done 124 FLAGS="$ac_save_[]FLAGS" 125 AC_LANG_POP([C++]) 126 ]) 127 case ".$VAR" in 128 .ok|.ok,*) m4_ifvaln($3,$3) ;; 129 .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[ 130 AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"]) 131 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;; 132 *) m4_ifvaln($3,$3,[ 133 if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null 134 then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR]) 135 else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"]) 136 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR" 137 fi ]) ;; 138 esac 139 AS_VAR_POPDEF([VAR])dnl 140 AS_VAR_POPDEF([FLAGS])dnl 141 ]) 142 143 dnl the only difference - the LANG selection... and the default FLAGS 144 145 AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl 146 AS_VAR_PUSHDEF([FLAGS],[FCFLAGS])dnl 147 AS_VAR_PUSHDEF([VAR],[ax_cv_fcflags_warn_all])dnl 148 AC_CACHE_CHECK([m4_ifval($1,$1,FLAGS) for maximum warnings], 149 VAR,[VAR="no, unknown" 150 AC_LANG_PUSH([Fortran]) 151 ac_save_[]FLAGS="$[]FLAGS" 68 ac_save_[]FLAGS="$[]FLAGS" 152 69 for ac_arg dnl 153 70 in "-warn all % -warn all" dnl Intel … … 165 82 [VAR=`echo $ac_arg | sed -e 's,.*% *,,'` ; break]) 166 83 done 167 FLAGS="$ac_save_[]FLAGS" 168 AC_LANG_POP([Fortran]) 84 FLAGS="$ac_save_[]FLAGS" 169 85 ]) 86 AS_VAR_POPDEF([FLAGS])dnl 87 AC_REQUIRE([AX_APPEND_FLAG]) 170 88 case ".$VAR" in 171 89 .ok|.ok,*) m4_ifvaln($3,$3) ;; 172 .|.no|.no,*) m4_ifvaln($4,$4,[m4_ifval($2,[ 173 AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"]) 174 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $2"])]) ;; 175 *) m4_ifvaln($3,$3,[ 176 if echo " $[]m4_ifval($1,$1,FLAGS) " | grep " $VAR " 2>&1 >/dev/null 177 then AC_RUN_LOG([: m4_ifval($1,$1,FLAGS) does contain $VAR]) 178 else AC_RUN_LOG([: m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR"]) 179 m4_ifval($1,$1,FLAGS)="$m4_ifval($1,$1,FLAGS) $VAR" 180 fi ]) ;; 90 .|.no|.no,*) m4_default($4,[m4_ifval($2,[AX_APPEND_FLAG([$2], [$1])])]) ;; 91 *) m4_default($3,[AX_APPEND_FLAG([$VAR], [$1])]) ;; 181 92 esac 182 93 AS_VAR_POPDEF([VAR])dnl 183 AS_VAR_POPDEF([FLAGS])dnl 184 ]) 185 94 ])dnl AX_FLAGS_WARN_ALL 186 95 dnl implementation tactics: 187 96 dnl the for-argument contains a list of options. The first part of … … 194 103 dnl delimiter. A non-option comment can be given after "%%" marks 195 104 dnl which will be shown but not added to the respective C/CXXFLAGS. 105 106 AC_DEFUN([AX_CFLAGS_WARN_ALL],[dnl 107 AC_LANG_PUSH([C]) 108 AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) 109 AC_LANG_POP([C]) 110 ]) 111 112 AC_DEFUN([AX_CXXFLAGS_WARN_ALL],[dnl 113 AC_LANG_PUSH([C++]) 114 AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) 115 AC_LANG_POP([C++]) 116 ]) 117 118 AC_DEFUN([AX_FCFLAGS_WARN_ALL],[dnl 119 AC_LANG_PUSH([Fortran]) 120 AX_FLAGS_WARN_ALL([$1], [$2], [$3], [$4]) 121 AC_LANG_POP([Fortran]) 122 ]) -
m4/pkg.m4
r650fb2c r13a39ae8 158 158 fi[]dnl 159 159 ])# PKG_CHECK_MODULES 160 161 162 # PKG_INSTALLDIR(DIRECTORY) 163 # ------------------------- 164 # Substitutes the variable pkgconfigdir as the location where a module 165 # should install pkg-config .pc files. By default the directory is 166 # $libdir/pkgconfig, but the default can be changed by passing 167 # DIRECTORY. The user can override through the --with-pkgconfigdir 168 # parameter. 169 AC_DEFUN([PKG_INSTALLDIR], 170 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) 171 m4_pushdef([pkg_description], 172 [pkg-config installation directory @<:@]pkg_default[@:>@]) 173 AC_ARG_WITH([pkgconfigdir], 174 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, 175 [with_pkgconfigdir=]pkg_default) 176 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) 177 m4_popdef([pkg_default]) 178 m4_popdef([pkg_description]) 179 ]) dnl PKG_INSTALLDIR 180 181 182 # PKG_NOARCH_INSTALLDIR(DIRECTORY) 183 # ------------------------- 184 # Substitutes the variable noarch_pkgconfigdir as the location where a 185 # module should install arch-independent pkg-config .pc files. By 186 # default the directory is $datadir/pkgconfig, but the default can be 187 # changed by passing DIRECTORY. The user can override through the 188 # --with-noarch-pkgconfigdir parameter. 189 AC_DEFUN([PKG_NOARCH_INSTALLDIR], 190 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) 191 m4_pushdef([pkg_description], 192 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) 193 AC_ARG_WITH([noarch-pkgconfigdir], 194 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, 195 [with_noarch_pkgconfigdir=]pkg_default) 196 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) 197 m4_popdef([pkg_default]) 198 m4_popdef([pkg_description]) 199 ]) dnl PKG_NOARCH_INSTALLDIR 200 201 202 # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, 203 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 204 # ------------------------------------------- 205 # Retrieves the value of the pkg-config variable for the given module. 206 AC_DEFUN([PKG_CHECK_VAR], 207 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 208 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl 209 210 _PKG_CONFIG([$1], [variable="][$3]["], [$2]) 211 AS_VAR_COPY([$1], [pkg_cv_][$1]) 212 213 AS_VAR_IF([$1], [""], [$5], [$4])dnl 214 ])# PKG_CHECK_VAR -
owl.c
r4d9e311c r499224d 34 34 } owl_options; 35 35 36 void usage( void)36 void usage(FILE *file) 37 37 { 38 fprintf( stderr, "Barnowl version %s\n", OWL_VERSION_STRING);39 fprintf( stderr, "Usage: barnowl [-n] [-d] [-D] [-v] [-h] [-c <configfile>] [-s <confdir>] [-t <ttyname>]\n");40 fprintf( stderr, " -n,--no-subs don't load zephyr subscriptions\n");41 fprintf( stderr, " -d,--debug enable debugging\n");42 fprintf( stderr, " -v,--version print the Barnowl version number and exit\n");43 fprintf( stderr, " -h,--help print this help message\n");44 fprintf( stderr, " -s,--config-dir specify an alternate config dir (default ~/.owl)\n");45 fprintf( stderr, " -c,--config-file specify an alternate config file (default ~/.owl/init.pl)\n");46 fprintf( stderr, " -t,--tty set the tty name\n");38 fprintf(file, "Barnowl version %s\n", OWL_VERSION_STRING); 39 fprintf(file, "Usage: barnowl [-n] [-d] [-D] [-v] [-h] [-c <configfile>] [-s <confdir>] [-t <ttyname>]\n"); 40 fprintf(file, " -n,--no-subs don't load zephyr subscriptions\n"); 41 fprintf(file, " -d,--debug enable debugging\n"); 42 fprintf(file, " -v,--version print the Barnowl version number and exit\n"); 43 fprintf(file, " -h,--help print this help message\n"); 44 fprintf(file, " -s,--config-dir specify an alternate config dir (default ~/.owl)\n"); 45 fprintf(file, " -c,--config-file specify an alternate config file (default ~/.owl/init.pl)\n"); 46 fprintf(file, " -t,--tty set the tty name\n"); 47 47 } 48 48 … … 83 83 exit(0); 84 84 case 'h': 85 usage(stdout); 86 exit(0); 85 87 default: 86 usage( );88 usage(stderr); 87 89 exit(1); 88 90 } -
owl.h
rbbc31e4 r6249a88f 10 10 #define INC_BARNOWL_OWL_H 11 11 12 #include "config.h"12 #include <config.h> 13 13 14 14 #include "compat/compat.h" … … 608 608 extern owl_global g; 609 609 610 #include "owl_prototypes.h"610 #include <owl_prototypes.h> 611 611 612 612 /* These were missing from the Zephyr includes before Zephyr 3. */ -
owl_perl.h
rf271129 r92ffd89 4 4 #include <stdio.h> 5 5 6 #define OWL_PERL_VOID_CALL (void)POPs; 6 /* 7 * This macro defines a convenience wrapper around the boilerplate 8 * of pushing char * arguments on to the stack for perl calling. 9 * 10 * Arguments are 11 * * i - the counter variable to use, which must be declared prior 12 * to calling this macro 13 * * argc - the number of arguments 14 * * argv - an array of char*s, of length at least argc; the arguments 15 * to push on to the stack 16 */ 17 #define OWL_PERL_PUSH_ARGS(i, argc, argv) { \ 18 for (i = 0; i < argc; i++) { \ 19 XPUSHs(sv_2mortal(owl_new_sv(argv[i]))); \ 20 } \ 21 } 7 22 8 23 /* 9 24 * This macro defines a convenience wrapper around the boilerplate of 10 * calling a method on a perl object (SV*) from C.25 * the perlcall methods. 11 26 * 12 27 * Arguments are 13 * * obj - the SV* to call the method on 14 * * meth - a char* method name 15 * * args - a code block responsible for pushing args (other than the object) 16 * * err - a string with a %s format specifier to log in case of error 17 * * fatalp - if true, perl errors terminate BarnOwl 18 * * ret - a code block executed if the call succeeded 28 * * call - the line of code to make the perl call 29 * * args - a code block responsible for pushing args 30 * * err - a string with a %s format specifier to log in case of error 31 * * fatalp - if true, perl errors terminate BarnOwl 32 * * discardret - should be true if no return is expected 33 * (if the call is passed the flag G_DISCARD or G_VOID) 34 * * ret - a code block executed if the call succeeded 19 35 * 20 36 * See also: `perldoc perlcall', `perldoc perlapi' 21 37 */ 22 #define OWL_PERL_CALL_METHOD(obj, meth, args, err, fatalp, ret) { \ 23 int count; \ 24 dSP; \ 25 ENTER; \ 26 SAVETMPS; \ 27 PUSHMARK(SP); \ 28 XPUSHs(obj); \ 29 {args} \ 30 PUTBACK; \ 31 \ 32 count = call_method(meth, G_SCALAR|G_EVAL); \ 33 \ 34 SPAGAIN; \ 35 \ 36 if(count != 1) { \ 37 fprintf(stderr, "perl returned wrong count: %d\n", count); \ 38 abort(); \ 38 #define OWL_PERL_CALL(call, args, err, fatalp, discardret, ret) { \ 39 int count; \ 40 dSP; \ 41 \ 42 ENTER; \ 43 SAVETMPS; \ 44 \ 45 PUSHMARK(SP); \ 46 {args} \ 47 PUTBACK; \ 48 \ 49 count = call; \ 50 \ 51 SPAGAIN; \ 52 \ 53 if (!discardret && count != 1) { \ 54 croak("Perl returned wrong count: %d\n", count); \ 55 } \ 56 \ 57 if (SvTRUE(ERRSV)) { \ 58 if (fatalp) { \ 59 fprintf(stderr, err, SvPV_nolen(ERRSV)); \ 60 exit(-1); \ 61 } else { \ 62 owl_function_error(err, SvPV_nolen(ERRSV)); \ 63 if (!discardret) (void)POPs; \ 64 sv_setsv(ERRSV, &PL_sv_undef); \ 39 65 } \ 40 if (SvTRUE(ERRSV)) { \ 41 if(fatalp) { \ 42 printf(err, SvPV_nolen(ERRSV)); \ 43 exit(-1); \ 44 } else { \ 45 owl_function_error(err, SvPV_nolen(ERRSV)); \ 46 (void)POPs; \ 47 sv_setsv(ERRSV, &PL_sv_undef); \ 48 } \ 49 } else { \ 50 ret; \ 51 } \ 52 PUTBACK; \ 53 FREETMPS; \ 54 LEAVE; \ 66 } else if (!discardret) { \ 67 ret; \ 68 } \ 69 PUTBACK; \ 70 FREETMPS; \ 71 LEAVE; \ 55 72 } 56 73 -
perl/Makefile.am
r10557e6 ra870319 1 1 SUBDIRS = modules 2 nobase_dist_pkgdata_DATA = \ 3 lib/BarnOwl.pm \ 4 lib/BarnOwl/Complete/AIM.pm \ 5 lib/BarnOwl/Complete/Client.pm \ 6 lib/BarnOwl/Complete/Filter.pm \ 7 lib/BarnOwl/Complete/Zephyr.pm \ 8 lib/BarnOwl/Completion.pm \ 9 lib/BarnOwl/Completion/Context.pm \ 10 lib/BarnOwl/Completion/Util.pm \ 11 lib/BarnOwl/Editwin.pm \ 12 lib/BarnOwl/Help.pm \ 13 lib/BarnOwl/Hook.pm \ 14 lib/BarnOwl/Hooks.pm \ 15 lib/BarnOwl/MainLoopCompatHook.pm \ 16 lib/BarnOwl/Message.pm \ 17 lib/BarnOwl/Message/AIM.pm \ 18 lib/BarnOwl/Message/Admin.pm \ 19 lib/BarnOwl/Message/Generic.pm \ 20 lib/BarnOwl/Message/Loopback.pm \ 21 lib/BarnOwl/Message/Zephyr.pm \ 22 lib/BarnOwl/ModuleLoader.pm \ 23 lib/BarnOwl/Parse.pm \ 24 lib/BarnOwl/Style.pm \ 25 lib/BarnOwl/Style/Basic.pm \ 26 lib/BarnOwl/Style/Default.pm \ 27 lib/BarnOwl/Style/Legacy.pm \ 28 lib/BarnOwl/Style/OneLine.pm \ 29 lib/BarnOwl/Timer.pm \ 30 lib/BarnOwl/Zephyr.pm \ 31 lib/Module/Install/BarnOwl.pm -
perl/lib/BarnOwl.pm
r104a4eb r1ced34f 14 14 error debug 15 15 create_style getnumcolors wordwrap 16 message_matches_filter 16 17 add_dispatch remove_dispatch 17 18 add_io_dispatch remove_io_dispatch … … 239 240 240 241 Returns the number of colors this BarnOwl is capable of displaying 242 243 =head2 message_matches_filter MESSAGE FILTER_NAME [QUIET = 0] 244 245 Returns 1 if C<FILTER_NAME> is the name of a valid filter, and 246 C<MESSAGE> matches that filter. Returns 0 otherwise. If 247 C<QUIET> is false, this method displays an error message if 248 if C<FILTER_NAME> does not name a valid filter. 241 249 242 250 =head2 add_dispatch FD CALLBACK -
perl/lib/BarnOwl/Message.pm
ra130fc5 r0adbce1 51 51 sub is_ping { return 0; } 52 52 sub is_mail { return 0; } 53 sub is_personal { return shift->is_private; }53 sub is_personal { return BarnOwl::message_matches_filter(shift, "personal"); } 54 54 sub class { return undef; } 55 55 sub instance { return undef; } -
perl/lib/BarnOwl/Message/Zephyr.pm
r6401db3 r0adbce1 65 65 66 66 sub is_ping { return (lc(shift->opcode) eq "ping"); } 67 68 sub is_personal {69 my ($m) = @_;70 return ((lc($m->class) eq "message")71 && $m->is_private);72 }73 67 74 68 sub is_mail { -
perl/lib/BarnOwl/Zephyr.pm
rdf569c5 r53151d4 12 12 use BarnOwl::Hook; 13 13 14 my$zephyrStartup = BarnOwl::Hook->new;14 our $zephyrStartup = BarnOwl::Hook->new; 15 15 16 16 sub _zephyr_startup { -
perl/lib/Module/Install/BarnOwl.pm
rb8a3e00 re4b8f93 41 41 my $class = ref $self; 42 42 43 my $srcdir = $ENV{BARNOWL_SRCDIR} || '.'; 44 43 45 $self->name("BarnOwl-Module-$name"); 44 $self->all_from("lib/BarnOwl/Module/$name.pm"); 46 $self->all_from("$srcdir/lib/BarnOwl/Module/$name.pm"); 47 $self->makemaker_args(PMLIBDIRS => ["$srcdir/lib"], 48 PMLIBPARENTDIRS => ["$srcdir/lib"]); 45 49 46 50 $self->postamble(<<"END_MAKEFILE"); 47 51 48 52 # --- $class section: 53 54 BARNOWL_SRCDIR = $srcdir 55 export BARNOWL_SRCDIR 49 56 50 57 $name.par: pm_to_blib -
perl/modules/IRC/lib/BarnOwl/Module/IRC.pm
r5625001 r4f7b1f4 23 23 use Getopt::Long; 24 24 use Encode; 25 use Text::Wrap; 25 26 26 27 our $VERSION = 0.02; … … 65 66 description => 'If set, each (space-separated) message type ' . 66 67 'provided will be hidden and ignored if received.' 68 }); 69 70 BarnOwl::new_variable_int('irc:max-message-length', { 71 default => 450, 72 summary => 'Split messages to at most this many characters.' . 73 "If non-positive, don't split messages", 74 description => 'If set to a positive number, any paragraph in an ' . 75 'IRC message will be split after this many characters.' 67 76 }); 68 77 … … 433 442 @msgs = split "\n\n", $fullbody; 434 443 map { tr/\n/ / } @msgs; 444 # split each body at irc:max-message-length characters, if that number 445 # is positive. Only split at space boundaries. Start counting a-fresh 446 # at the beginning of each paragraph 447 my $max_len = BarnOwl::getvar('irc:max-message-length'); 448 if ($max_len > 0) { 449 local($Text::Wrap::columns) = $max_len; 450 @msgs = split "\n", wrap("", "", join "\n", @msgs); 451 } 435 452 for my $body (@msgs) { 436 453 if ($body =~ /^\/me (.*)/) { … … 606 623 } 607 624 608 if(! $channel&&625 if(!defined($channel) && 609 626 ($flags & CHANNEL_ARG) && 610 627 !($flags & CHANNEL_OPTIONAL)) { -
perl/modules/Makefile.am
r35c5bd8 re4b8f93 1 1 MODULES = Jabber IRC WordWrap Twitter Facebook 2 2 3 EXTRA_DIST = $(MODULES:=/Makefile.PL) $(MODULES:=/inc) $(MODULES:=/lib) 3 EXTRA_DIST = $(MODULES:=/Makefile.PL) $(MODULES:=/lib) 4 EXTRA_DIST += \ 5 Facebook/README \ 6 Twitter/README \ 7 Twitter/twitter.example 4 8 5 9 all-local: $(MODULES) … … 7 11 (cd $* && $(MAKE) $*.par) 8 12 13 BARNOWL_PERL := $(shell which perl) -I$(abs_srcdir)/../lib 14 9 15 MODULES_MAKEFILE = $(MODULES:=/Makefile) 10 $(MODULES_MAKEFILE): %/Makefile: %/Makefile.PL 11 $(AM_V_GEN)(cd $* && perl -I../../lib Makefile.PL) 16 $(MODULES_MAKEFILE): %/Makefile: %/Makefile.PL ../lib/Module/Install/BarnOwl.pm 17 $(AM_V_GEN)test -d $* || mkdir $* 18 $(AM_V_at)test $(srcdir) = . || $(LN_S) $(abs_srcdir)/$*/Makefile.PL $*/Makefile.PL 19 $(AM_V_at)(cd $* && BARNOWL_SRCDIR='$(abs_srcdir)/$*' && export BARNOWL_SRCDIR && $(BARNOWL_PERL) Makefile.PL 'PERL=$(BARNOWL_PERL)') 12 20 13 21 MODULES_CLEAN = $(MODULES:%=clean_%) 14 22 clean-local: $(MODULES_CLEAN) 15 23 $(MODULES_CLEAN): clean_%: 16 (cd $* && (test ! -f Makefile || $(MAKE) clean)) 24 (cd $* && { test ! -f Makefile || $(MAKE) realclean; }) 25 rm -f $*/$*.par 26 rm -rf $*/inc 27 test $(srcdir) = . || rm -f $*/Makefile.PL 17 28 18 29 MODULES_INSTALL = $(MODULES:%=module_install_%) … … 23 34 ${INSTALL_DATA} $*/$*.par ${DESTDIR}${pkgdatadir}/modules/$*.par 24 35 36 uninstall-local: 37 rm -f $(MODULES:%=${DESTDIR}${pkgdatadir}/modules/%.par) 38 25 39 .PHONY: $(MODULES) $(MODULES_CLEAN) $(MODULES_INSTALL) -
perlconfig.c
re5210c9 r96d80e9 228 228 CALLER_OWN char *owl_perlconfig_call_with_message(const char *subname, const owl_message *m) 229 229 { 230 dSP ; 231 int count; 232 SV *msgref, *srv; 233 char *out; 234 235 ENTER ; 236 SAVETMPS; 237 238 PUSHMARK(SP) ; 230 SV *msgref, *rv; 231 char *out = NULL; 232 239 233 msgref = owl_perlconfig_message2hashref(m); 240 XPUSHs(sv_2mortal(msgref)); 241 PUTBACK ; 242 243 count = call_pv(subname, G_SCALAR|G_EVAL); 244 245 SPAGAIN ; 246 247 if (SvTRUE(ERRSV)) { 248 owl_function_error("Perl Error: '%s'", SvPV_nolen(ERRSV)); 249 /* and clear the error */ 250 sv_setsv (ERRSV, &PL_sv_undef); 251 } 252 253 if (count != 1) { 254 fprintf(stderr, "bad perl! no biscuit! returned wrong count!\n"); 255 abort(); 256 } 257 258 srv = POPs; 259 260 if (srv) { 261 out = g_strdup(SvPV_nolen(srv)); 262 } else { 263 out = NULL; 264 } 265 266 PUTBACK ; 267 FREETMPS ; 268 LEAVE ; 269 234 235 OWL_PERL_CALL((call_pv(subname, G_SCALAR|G_EVAL)) 236 , 237 XPUSHs(sv_2mortal(msgref)); 238 , 239 "Perl Error: '%s'" 240 , 241 false 242 , 243 false 244 , 245 rv = POPs; 246 if (rv && SvPOK(rv)) 247 out = g_strdup(SvPV_nolen(rv)); 248 ); 270 249 return out; 271 250 } … … 277 256 CALLER_OWN char *owl_perlconfig_message_call_method(const owl_message *m, const char *method, int argc, const char **argv) 278 257 { 279 dSP; 280 unsigned int count, i; 281 SV *msgref, *srv; 282 char *out; 258 SV *msgref, *rv; 259 char *out = NULL; 260 int i; 283 261 284 262 msgref = owl_perlconfig_message2hashref(m); 285 263 286 ENTER; 287 SAVETMPS; 288 289 PUSHMARK(SP); 290 XPUSHs(sv_2mortal(msgref)); 291 for(i=0;i<argc;i++) { 292 XPUSHs(sv_2mortal(owl_new_sv(argv[i]))); 293 } 294 PUTBACK; 295 296 count = call_method(method, G_SCALAR|G_EVAL); 297 298 SPAGAIN; 299 300 if(count != 1) { 301 fprintf(stderr, "perl returned wrong count %u\n", count); 302 abort(); 303 } 304 305 if (SvTRUE(ERRSV)) { 306 owl_function_error("Error: '%s'", SvPV_nolen(ERRSV)); 307 /* and clear the error */ 308 sv_setsv (ERRSV, &PL_sv_undef); 309 } 310 311 srv = POPs; 312 313 if (srv) { 314 out = g_strdup(SvPV_nolen(srv)); 315 } else { 316 out = NULL; 317 } 318 319 PUTBACK; 320 FREETMPS; 321 LEAVE; 322 264 OWL_PERL_CALL(call_method(method, G_SCALAR|G_EVAL) 265 , 266 XPUSHs(sv_2mortal(msgref)); 267 OWL_PERL_PUSH_ARGS(i, argc, argv); 268 , 269 "Perl Error: '%s'" 270 , 271 false 272 , 273 false 274 , 275 rv = POPs; 276 if (rv && SvPOK(rv)) 277 out = g_strdup(SvPV_nolen(rv)); 278 ); 323 279 return out; 324 280 } … … 470 426 void owl_perlconfig_new_command(const char *name) 471 427 { 472 dSP; 473 474 ENTER; 475 SAVETMPS; 476 477 PUSHMARK(SP); 478 XPUSHs(sv_2mortal(owl_new_sv(name))); 479 PUTBACK; 480 481 call_pv("BarnOwl::Hooks::_new_command", G_VOID|G_EVAL); 482 483 SPAGAIN; 484 485 if(SvTRUE(ERRSV)) { 486 owl_function_error("%s", SvPV_nolen(ERRSV)); 487 } 488 489 FREETMPS; 490 LEAVE; 428 OWL_PERL_CALL(call_pv("BarnOwl::Hooks::_new_command", G_VOID|G_EVAL); 429 , 430 XPUSHs(sv_2mortal(owl_new_sv(name))); 431 , 432 "Perl Error: '%s'" 433 , 434 false 435 , 436 true 437 , 438 ); 439 } 440 441 CALLER_OWN char *owl_perlconfig_perl_call(const char *method, int argc, const char *const *argv) 442 { 443 SV *rv; 444 char *out = NULL; 445 int i; 446 OWL_PERL_CALL(call_pv(method, G_SCALAR|G_EVAL) 447 , 448 OWL_PERL_PUSH_ARGS(i, argc, argv); 449 , 450 "Perl Error: '%s'" 451 , 452 false 453 , 454 false 455 , 456 rv = POPs; 457 if (rv && SvPOK(rv)) 458 out = g_strdup(SvPV_nolen(rv)); 459 ); 460 return out; 461 } 462 463 int owl_perlconfig_perl_call_int(const char *method, int argc, const char *const *argv) 464 { 465 SV *rv; 466 int ret = -1; 467 int i; 468 OWL_PERL_CALL(call_pv(method, G_SCALAR|G_EVAL) 469 , 470 OWL_PERL_PUSH_ARGS(i, argc, argv); 471 , 472 "Perl Error: '%s'" 473 , 474 false 475 , 476 false 477 , 478 rv = POPs; 479 if (rv && SvIOK(rv)) 480 ret = SvIV(rv); 481 ); 482 return ret; 483 } 484 485 bool owl_perlconfig_perl_call_bool(const char *method, int argc, const char *const *argv) 486 { 487 SV *rv; 488 bool ret = false; 489 int i; 490 OWL_PERL_CALL(call_pv(method, G_SCALAR|G_EVAL) 491 , 492 OWL_PERL_PUSH_ARGS(i, argc, argv); 493 , 494 "Perl Error: '%s'" 495 , 496 false 497 , 498 false 499 , 500 rv = POPs; 501 if (rv) 502 ret = SvTRUE(rv); 503 ); 504 return ret; 505 } 506 507 void owl_perlconfig_perl_call_norv(const char *method, int argc, const char *const *argv) 508 { 509 int i; 510 OWL_PERL_CALL(call_pv(method, G_DISCARD|G_EVAL) 511 , 512 OWL_PERL_PUSH_ARGS(i, argc, argv); 513 , 514 "Perl Error: '%s'" 515 , 516 false 517 , 518 true 519 , 520 ); 491 521 } 492 522 … … 494 524 CALLER_OWN char *owl_perlconfig_perlcmd(const owl_cmd *cmd, int argc, const char *const *argv) 495 525 { 496 int i, count; 497 char * ret = NULL; 498 SV *rv; 499 dSP; 500 501 ENTER; 502 SAVETMPS; 503 504 PUSHMARK(SP); 505 for(i=0;i<argc;i++) { 506 XPUSHs(sv_2mortal(owl_new_sv(argv[i]))); 507 } 508 PUTBACK; 509 510 count = call_sv(cmd->cmd_perl, G_SCALAR|G_EVAL); 511 512 SPAGAIN; 513 514 if(SvTRUE(ERRSV)) { 515 owl_function_error("%s", SvPV_nolen(ERRSV)); 516 (void)POPs; 517 } else { 518 if(count != 1) 519 croak("Perl command %s returned more than one value!", cmd->name); 520 rv = POPs; 521 if(SvTRUE(rv)) { 522 ret = g_strdup(SvPV_nolen(rv)); 523 } 524 } 525 526 FREETMPS; 527 LEAVE; 528 529 return ret; 526 int i; 527 SV* rv; 528 char *out = NULL; 529 530 OWL_PERL_CALL(call_sv(cmd->cmd_perl, G_SCALAR|G_EVAL) 531 , 532 OWL_PERL_PUSH_ARGS(i, argc, argv); 533 , 534 "Perl Error: '%s'" 535 , 536 false 537 , 538 false 539 , 540 rv = POPs; 541 if (rv && SvPOK(rv)) 542 out = g_strdup(SvPV_nolen(rv)); 543 ); 544 return out; 530 545 } 531 546 … … 538 553 { 539 554 SV *cb = owl_editwin_get_cbdata(e); 540 SV *text; 541 dSP; 542 543 if(cb == NULL) { 555 SV *text = owl_new_sv(owl_editwin_get_text(e)); 556 557 if (cb == NULL) { 544 558 owl_function_error("Perl callback is NULL!"); 545 559 return; 546 560 } 547 text = owl_new_sv(owl_editwin_get_text(e)); 548 549 ENTER; 550 SAVETMPS; 551 552 PUSHMARK(SP); 553 XPUSHs(sv_2mortal(text)); 554 XPUSHs(sv_2mortal(newSViv(success))); 555 PUTBACK; 556 557 call_sv(cb, G_DISCARD|G_EVAL); 558 559 if(SvTRUE(ERRSV)) { 560 owl_function_error("%s", SvPV_nolen(ERRSV)); 561 } 562 563 FREETMPS; 564 LEAVE; 561 562 OWL_PERL_CALL(call_sv(cb, G_DISCARD|G_EVAL) 563 , 564 XPUSHs(sv_2mortal(text)); 565 XPUSHs(sv_2mortal(newSViv(success))); 566 , 567 "Perl Error: '%s'" 568 , 569 false 570 , 571 true 572 , 573 ); 565 574 } 566 575 -
perlglue.xs
r3b9ca71 r1ced34f 256 256 } 257 257 258 bool 259 message_matches_filter(message, filter_name, quiet = false) 260 SV *message 261 const char *filter_name 262 bool quiet 263 PREINIT: 264 owl_message *m; 265 const owl_filter *f; 266 CODE: 267 { 268 if (!SvROK(message) || SvTYPE(SvRV(message)) != SVt_PVHV) { 269 croak("Usage: BarnOwl::message_matches_filter($message, $filter_name[, $quiet])"); 270 } 271 272 m = owl_perlconfig_hashref2message(message); 273 f = owl_global_get_filter(&g, filter_name); 274 if (!f && !quiet) { 275 owl_function_error("%s filter is not defined", filter_name); 276 } 277 RETVAL = f && owl_filter_message_match(f, m); 278 } 279 OUTPUT: 280 RETVAL 281 CLEANUP: 282 owl_message_delete(m); 283 258 284 const utf8 * 259 285 wordwrap(in, cols) -
runtests.sh
rf6ab6ee r5db8835 1 1 #!/bin/sh 2 exec env HARNESS_PERL=./tester prove --failures t/2 exec env HARNESS_PERL=./tester prove --failures "${srcdir:=$(dirname "$0")}/t/" -
style.c
r14be3a5 r92ffd89 23 23 { 24 24 SV *sv = NULL; 25 OWL_PERL_CALL _METHOD(s->perlobj,26 "description",27 ;,28 "Error in style_get_description: %s",29 0,30 31 32 if (sv) {25 OWL_PERL_CALL(call_method("description", G_SCALAR|G_EVAL), 26 XPUSHs(s->perlobj);, 27 "Error in style_get_description: %s", 28 0, 29 false, 30 sv = SvREFCNT_inc(POPs); 31 ); 32 if (sv) { 33 33 return SvPV_nolen(sv_2mortal(sv)); 34 34 } else { … … 50 50 51 51 /* Call the perl object */ 52 OWL_PERL_CALL_METHOD(s->perlobj, 53 "format_message", 54 XPUSHs(sv_2mortal(owl_perlconfig_message2hashref(m)));, 55 "Error in format_message: %s", 56 0, 57 sv = SvREFCNT_inc(POPs); 58 ); 52 OWL_PERL_CALL(call_method("format_message", G_SCALAR|G_EVAL), 53 XPUSHs(s->perlobj); 54 XPUSHs(sv_2mortal(owl_perlconfig_message2hashref(m)));, 55 "Error in format_message: %s", 56 0, 57 false, 58 sv = SvREFCNT_inc(POPs); 59 ); 59 60 60 if (sv) {61 if (sv) { 61 62 body = SvPV_nolen(sv); 62 63 } else { -
t/00-core-tests.t
r95414bf r5db8835 1 1 #!/usr/bin/env perl 2 use File::Basename; 3 system(dirname($0) . "/../tester", "--builtin"); 2 system("./tester", "--builtin"); -
t/variable.t
r4953c44 r5d8c9a7 17 17 BarnOwl::unset("-q", "intvar"); 18 18 is(BarnOwl::getvar("intvar"), "24", "intvar unset bogus"); 19 BarnOwl::new_variable_int("intvar", { default => 7 }); 20 isnt(BarnOwl::getvar("intvar"), "7", "intvar reinit shouldn't override preexisting value"); 19 21 20 22 BarnOwl::new_variable_bool("boolvar", { default => 1 }); … … 28 30 BarnOwl::unset("-q", "boolvar"); 29 31 is(BarnOwl::getvar("boolvar"), "off", "boolvar unset"); 32 BarnOwl::new_variable_bool("boolvar", { default => 1 }); 33 isnt(BarnOwl::getvar("boolvar"), "on", "boolvar reinit shouldn't override preexisting value"); 30 34 31 35 BarnOwl::new_variable_string("strvar", { default => "monkey" }); … … 37 41 BarnOwl::unset("-q", "strvar"); 38 42 is(BarnOwl::getvar("strvar"), "cuttlefish", "strvar unset bogus"); 43 BarnOwl::new_variable_string("strvar", { default => "monkey" }); 44 isnt(BarnOwl::getvar("strvar"), "monkey", "strvar reinit shouldn't override value"); 39 45 40 46 BarnOwl::new_variable_enum("enumvar", { validsettings => [qw/foo bar baz/], default => "bar" }); … … 46 52 BarnOwl::unset("-q", "enumvar"); 47 53 is(BarnOwl::getvar("enumvar"), "baz", "enumvar unset bogus"); 54 BarnOwl::new_variable_enum("enumvar", { validsettings => [qw/foo bar baz/], default => "bar" }); 55 isnt(BarnOwl::getvar("enumvar"), "bar", "enumvar reinit shouldn't override value"); 48 56 49 57 BarnOwl::new_variable_int("intvar2"); … … 60 68 BarnOwl::new_variable_full("fullvar", { 61 69 validsettings => '<short-words>', 62 get_tostring => sub { "value is " .$value },70 get_tostring => sub { $value }, 63 71 set_fromstring => sub { 64 65 $value = $_[0];72 die "Too long" unless $_[0] =~ /^...?$/; 73 $value = lc($_[0]); 66 74 }, 67 75 takes_on_off => 1 68 76 }); 69 is(BarnOwl::getvar("fullvar"), " value isfoo", "fullvar get");70 BarnOwl::set("-q", "fullvar", " bar");71 is(BarnOwl::getvar("fullvar"), " value isbar", "fullvar set");77 is(BarnOwl::getvar("fullvar"), "foo", "fullvar get"); 78 BarnOwl::set("-q", "fullvar", "Bar"); 79 is(BarnOwl::getvar("fullvar"), "bar", "fullvar set"); 72 80 BarnOwl::set("-q", "fullvar"); 73 is(BarnOwl::getvar("fullvar"), " value ison", "fullvar set2");81 is(BarnOwl::getvar("fullvar"), "on", "fullvar set2"); 74 82 BarnOwl::unset("-q", "fullvar"); 75 is(BarnOwl::getvar("fullvar"), " value isoff", "fullvar unset");83 is(BarnOwl::getvar("fullvar"), "off", "fullvar unset"); 76 84 BarnOwl::set("-q", "fullvar", "bogus"); 77 is(BarnOwl::getvar("fullvar"), "value is off", "fullvar set bogus"); 78 $value = "something really long"; 79 is(BarnOwl::getvar("fullvar"), "value is something really long", "fullvar set out-of-band"); 85 is(BarnOwl::getvar("fullvar"), "off", "fullvar set bogus"); 86 $value = "xyz"; 87 is(BarnOwl::getvar("fullvar"), "xyz", "fullvar set out-of-band"); 88 # Kinda verbose, but better to test all forms 89 my $newvalue = "foo"; 90 BarnOwl::new_variable_full("fullvar", { 91 validsettings => '<short-words>', 92 get_tostring => sub { $newvalue }, 93 set_fromstring => sub { 94 die "Too long" unless $_[0] =~ /^...?$/; 95 $newvalue = lc($_[0]); 96 }, 97 takes_on_off => 1 98 }); 99 is(BarnOwl::getvar("fullvar"), "xyz", "fullvar reinit doesn't override value"); 100 $newvalue = "abc"; 101 is(BarnOwl::getvar("fullvar"), "abc", "fullvar reinit changed setters"); 80 102 81 103 1; -
variable.c
r6a8b519 r9d4dfdc 612 612 void owl_variable_dict_add_variable(owl_vardict * vardict, 613 613 owl_variable * var) { 614 char *oldvalue = NULL; 615 owl_variable *oldvar = owl_variable_get_var(vardict, var->name); 616 /* Save the old value as a string. */ 617 if (oldvar) { 618 oldvalue = owl_variable_get_tostring(oldvar); 619 } 614 620 owl_dict_insert_element(vardict, var->name, var, (void (*)(void *))owl_variable_delete); 621 /* Restore the old value. */ 622 if (oldvalue) { 623 owl_variable_set_fromstring(var, oldvalue, 0); 624 g_free(oldvalue); 625 } 615 626 } 616 627 … … 777 788 g_free(v->default_str); 778 789 g_free(v->validsettings); 779 g_value_unset(&(v->val)); 790 if (v->type != OWL_VARIABLE_OTHER) 791 g_value_unset(&(v->val)); 780 792 g_closure_unref(v->get_tostring_fn); 781 793 g_closure_unref(v->set_fromstring_fn); -
zcrypt.c
rd72ba1e r8f335a8 16 16 #include <sys/wait.h> 17 17 #include <ctype.h> 18 19 #include "config.h" 18 #include <limits.h> 19 #include <getopt.h> 20 21 #include <config.h> 20 22 21 23 #ifdef HAVE_KERBEROS_IV … … 26 28 27 29 #include "filterproc.h" 30 31 #ifndef OWL_VERSION_STRING 32 #ifdef GIT_VERSION 33 #define stringify(x) __stringify(x) 34 #define __stringify(x) #x 35 #define OWL_VERSION_STRING stringify(GIT_VERSION) 36 #else 37 #define OWL_VERSION_STRING PACKAGE_VERSION 38 #endif 39 #endif /* !OWL_VERSION_STRING */ 28 40 29 41 /* Annotate functions in which the caller owns the return value and is … … 106 118 } 107 119 120 void usage(FILE *file, const char *progname) 121 { 122 fprintf(file, "Usage: %s [-Z|-D|-E|-R|-S] [-F Keyfile] [-c class] [-i instance]\n", progname); 123 fprintf(file, " [-advqtluon] [-s signature] [-f arg] [-m message]\n"); 124 fprintf(file, " One or more of class, instance, and keyfile must be specified.\n"); 125 } 126 108 127 int main(int argc, char *argv[]) 109 128 { … … 116 135 int mode = M_NONE; 117 136 118 charc;137 int c; 119 138 120 139 int messageflag = FALSE; … … 122 141 zoptions.flags = 0; 123 142 124 while ((c = getopt(argc, argv, "ZDERSF:c:i:advqtluons:f:m")) != (char)EOF) 143 enum { 144 OPT_VERSION = CHAR_MAX + 1, 145 OPT_HELP, 146 }; 147 static const struct option options[] = { 148 {"version", no_argument, NULL, OPT_VERSION}, 149 {"help", no_argument, NULL, OPT_HELP}, 150 {NULL, 0, NULL, 0} 151 }; 152 153 while ((c = getopt_long(argc, argv, "ZDERSF:c:i:advqtluons:f:m", options, NULL)) != -1) 125 154 { 126 155 switch(c) 127 156 { 157 case OPT_VERSION: 158 /* Version */ 159 printf("This is zcrypt version %s\n", OWL_VERSION_STRING); 160 exit(0); 161 case OPT_HELP: 162 /* Help */ 163 usage(stdout, argv[0]); 164 exit(0); 128 165 case 'Z': 129 166 /* Zephyr encrypt */ … … 257 294 if (error || !cryptspec) 258 295 { 259 fprintf(stderr, "Usage: %s [-Z|-D|-E|-R|-S] [-F Keyfile] [-c class] [-i instance]\n", argv[0]); 260 fprintf(stderr, " [-advqtluon] [-s signature] [-f arg] [-m message]\n"); 261 fprintf(stderr, " One or more of class, instance, and keyfile must be specified.\n"); 296 usage(stderr, argv[0]); 262 297 exit(1); 263 298 } -
zephyr.c
rbbe7d4a r80d7b44 29 29 #define HM_SVC_FALLBACK htons((unsigned short) 2104) 30 30 31 static char *owl_zephyr_dotfile(const char *name, const char *input)31 static CALLER_OWN char *owl_zephyr_dotfile(const char *name, const char *input) 32 32 { 33 33 if (input != NULL) … … 455 455 } 456 456 457 voidunsuball(void)457 bool unsuball(void) 458 458 { 459 459 #if HAVE_LIBZEPHYR … … 465 465 owl_function_error("Zephyr: Cancelling subscriptions: %s", 466 466 error_message(ret)); 467 #endif 467 return (ret == ZERR_NONE); 468 #endif 469 return true; 468 470 } 469 471 … … 729 731 if (!owl_zwrite_recip_is_personal(recipient) && *owl_global_get_zsender(&g)) 730 732 notice.z_sender = zsender = long_zuser(owl_global_get_zsender(&g)); 731 notice.z_default_format=zstr( "http://zephyr.1ts.org/wiki/df");733 notice.z_default_format=zstr(ZEPHYR_DEFAULT_FORMAT); 732 734 if (opcode) notice.z_opcode=zstr(opcode); 733 735 … … 742 744 /* free then check the return */ 743 745 g_free(notice.z_message); 744 ZFreeNotice(¬ice);745 746 g_free(zsender); 746 747 if (ret != ZERR_NONE) { … … 1024 1025 } 1025 1026 1027 g_free(subsfile); 1026 1028 g_free(line); 1027 1029 #endif
Note: See TracChangeset
for help on using the changeset viewer.