debian/0000755000000000000000000000000011317444762007177 5ustar debian/NEWS0000644000000000000000000000072111317441104007661 0ustar xbuffy (3.3.bl.3-25) unstable; urgency=low Xbuffy will no longer ask to make the /usr/lib/xbuffy/led binary suid-root, which is needed to blink the keyboard LEDs under Linux, but always install it without suid bit. You can use dpkg-statoverride to make it suid again to get blinking LEDs. /usr/share/doc/xbuffy/README.Debian gives more information how to do this. -- Bernhard R. Link Sat, 6 Aug 2005 13:34:44 +0200 debian/README.debian0000644000000000000000000000176711317441104011276 0ustar xbuffy for DEBIAN ----------------- This package was debianized by Joel Rosdahl and is currently maintained by Bernhard R. Link ----------------- Xbuffy will now read a .xbuffyrc in your $HOME, if -boxfile is not given. ----------------- Under Linux Xbuffy can notify you by blinking a keyboard LED when new mail has arrived. However, to access the Linux console driver (to be able to change the LED states) the code needs to run as root. In Xbuffy this is done by a small external program, that you have to make setuid-root in order to make this work: dpkg-statoverride --update --add root root 4755 /usr/lib/xbuffy/led Note: If you enable this, this means that anyone with execution access to the LED blinking program can change the states of the keyboard LEDs, so you might prefer something like (with blinkgroup replaced by the name of the group of users allowed to blink): dpkg-statoverride --update --add root blickgroup 4750 /usr/lib/xbuffy/led ----------------- debian/README.source0000644000000000000000000000031511317441104011340 0ustar This package comes with some patches shipped for your reference in debian/patches. Unless your care to look at them or unpack the source package manually not using dpkg-source, just ignore that directory. debian/changelog0000644000000000000000000002604611317441370011051 0ustar xbuffy (3.3.bl.3.dfsg-8) unstable; urgency=low * Import package into git, generate debian/patches from git * Use -z defs instead of -z syms so binutils-gold is happy * fix spelling error in manpage -- Bernhard R. Link Fri, 01 Jan 2010 18:12:56 +0100 xbuffy (3.3.bl.3.dfsg-7) unstable; urgency=low * refresh ident_subject.patch, so it can also be applied by dpkg-source when quilt is not installed. -- Bernhard R. Link Sat, 31 Oct 2009 16:35:32 +0100 xbuffy (3.3.bl.3.dfsg-6) unstable; urgency=low * modernize package - move patches to debian/patches, add DEP3 description headers - use format 3.0 (quilt) - update standards version -- Bernhard R. Link Tue, 27 Oct 2009 19:29:09 +0100 xbuffy (3.3.bl.3.dfsg-5) unstable; urgency=low * clean up debian/rules: - call make via $(MAKE) so that -jN works - move to debhelper compatibility level 5 - modernize (build-arch, dh_install, proper distclean, no config-stamp, ...) * update debian/menu to new section names * add Homepage: field -- Bernhard R. Link Sun, 2 Dec 2007 15:05:53 +0100 xbuffy (3.3.bl.3.dfsg-4) unstable; urgency=low * Specify manpage path to avoid problems with newer autoconfs (Closes: 376429) -- Bernhard R. Link Wed, 5 Jul 2006 21:44:41 +0200 xbuffy (3.3.bl.3.dfsg-3) unstable; urgency=low * The "never stop unless you understand or you will have to do it again" release * now really fix the spacing issue (Closes: 365648) * fix bug that application defaults are not shipped when xbuffy is installed in the build system -- Bernhard R. Link Tue, 2 May 2006 22:26:44 +0200 xbuffy (3.3.bl.3.dfsg-2) unstable; urgency=low * fix error parsing mails some mailers generate (Closes: 363002) * adopt to new location of X libraries * add AC_PREREQ(2.50) to avoid build-conflicting with autoconf2.13 -- Bernhard R. Link Fri, 21 Apr 2006 09:15:01 +0200 xbuffy (3.3.bl.3.dfsg-1) unstable; urgency=low * repackaged upstream source to remove all files with strange copyright notices and some build system stuff * correct debian/copyright file, including the copyright of all source files. * no longer use dpatch * adding build-dep to autoconf to generate configure from the now heavily changed configure.in at build time * give proper options to ./configure (like --host and --build and CFLAGS=) * to not link against libraries not used or with flags not needed. * add watch file * Retry autodetection when mailbox is not statable (Closes: 168910) -- Bernhard R. Link Sat, 1 Apr 2006 15:25:39 +0200 xbuffy (3.3.bl.3-25) unstable; urgency=low * bump stardard-version field * move menu file to /usr/share/menu (no change needed for that) * use dpkg-architecture -qDEB_HOST_ARCH_OS instead of DEB_HOST_GNU_SYSTEM to decide if we are under Linux. * default to not suiding the led binary, document how the user can suid it via dpkg-statoverride -- Bernhard R. Link Sat, 6 Aug 2005 13:34:44 +0200 xbuffy (3.3.bl.3-24) unstable; urgency=low * new da.po translation from Morten Bo Johansen (Closes: #285974) * new -silent switch to suppress all audio output. (Closes: 184750) * add direct include to string.h in xbuffy.c to avoid problems... -- Bernhard R. Link Mon, 3 Jan 2005 13:40:13 +0100 xbuffy (3.3.bl.3-23) unstable; urgency=low * New Maintainer (Closes: #242098) * using /usr instead of /usr/X11R6 * Tidy up a bit: - split patches in smaler parts - corrected some typos and missing escapes - added many missing includes and prototypes - removed spurious label (Closes: #259931) * now using $HOME/.xbuffyrc if no mailboxes specified (Closes: #55466) * changed -center and -fill slightly to leave more space (Closes: #184075) * PO File updates: - added the jo.po file from Hideki Yamane (Closes: #267671) - rewrote de.po * added checkfile mailboxtype to simple show the size of a file * converted debian/changeloge to unicode -- Bernhard R. Link Sat, 16 Oct 2004 14:53:50 +0200 xbuffy (3.3.bl.3-22) unstable; urgency=low * Orphaned. -- Joel Rosdahl Sun, 4 Apr 2004 20:53:48 +0200 xbuffy (3.3.bl.3-21) unstable; urgency=low * Added Dutch debconf template from Tim Vandermeersch. Closes: bug#209100. * Made libxaw7-dev a build dependency instead of libxaw-dev. * Standards-Version 3.6.1. -- Joel Rosdahl Sat, 18 Oct 2003 21:46:08 +0200 xbuffy (3.3.bl.3-20) unstable; urgency=low * Use colon instead of period between user and group in chown call. Closes: bug#205533. -- Joel Rosdahl Fri, 15 Aug 2003 11:23:46 +0200 xbuffy (3.3.bl.3-19) unstable; urgency=low * Use dpatch for patch management. * Updated Standards-Version to 3.5.10. * Added patch (from Albert Ting) which fixes the flags nobeep and nohighlight and indents the subject text somewhat. -- Joel Rosdahl Fri, 18 Jul 2003 11:21:26 +0200 xbuffy (3.3.bl.3-18) unstable; urgency=low * Added French debconf template. Patch from Michel Grentzinger. Closes: bug#199641. -- Joel Rosdahl Wed, 2 Jul 2003 10:00:29 +0200 xbuffy (3.3.bl.3-17) unstable; urgency=low * Use new gettext format of debconf template files. Closes: bug#198750. Michel Grentzinger provided the patch. Thanks! -- Joel Rosdahl Wed, 25 Jun 2003 18:15:10 +0200 xbuffy (3.3.bl.3-16) unstable; urgency=low * Added missing build dependency on libxaw-dev. Closes: bug#178632. -- Joel Rosdahl Mon, 27 Jan 2003 21:37:00 +0100 xbuffy (3.3.bl.3-15) unstable; urgency=low * Changed build dependency on xlib6g-dev to xlibs-dev. Closes: bug#170154. * Use DH_COMPAT 3. * Standards-Version 3.5.8. * Clarified arguments to the "box" and "title" boxfile options in the man page. Closes: bug#160858. * Added Spanish version of the debconf templates. Translation done by Carlos Valdivia Yagüe. Thanks and sorry for the delay! Closes: bug#151514. * Applied patch that adds a -nohighlight option from Bernhard R. Link. Thanks and sorry for the delay! Closes: bug#158504. -- Joel Rosdahl Sun, 26 Jan 2003 22:32:55 +0100 xbuffy (3.3.bl.3-14) unstable; urgency=low * Applied patch from Randolph Chung to make xbuffy build on ia64. Closes: bug#106251. * The above patch should also fix the build problems on hppa. Closes: bug#104904. * Applied patch from Marcus Brinkmann to make xbuffy build on the Hurd. Closes: bug#101649. -- Joel Rosdahl Tue, 2 Oct 2001 08:21:23 +0200 xbuffy (3.3.bl.3-13) unstable; urgency=low * Standards-Version 3.5.2. * Put app-defaults in /etc/X11/app-defaults. Closes: bug#86303. * Added app-defaults file as conffile. * Don't use suidmanager anymore. -- Joel Rosdahl Thu, 22 Feb 2001 22:39:51 +0100 xbuffy (3.3.bl.3-12) unstable; urgency=low * Translated debconf templates to Swedish. -- Joel Rosdahl Thu, 25 Jan 2001 21:17:42 +0100 xbuffy (3.3.bl.3-11) unstable; urgency=low * Added german version of the debconf templates. Translation done by Jörg Rieger. Closes: bug#83365. * Standards-Version 3.2.1. -- Joel Rosdahl Wed, 24 Jan 2001 21:00:24 +0100 xbuffy (3.3.bl.3-10) unstable; urgency=low * Improved build target in debian/rules (closes: #64035) * Added Build-Depends field to debian/control (closes: #64036) * Added patch for mailbox polling behaviour (closes: #64037) -- Joel Rosdahl Fri, 12 May 2000 19:43:04 +0200 xbuffy (3.3.bl.3-9) unstable; urgency=low * Debconfized. * Standards-Version 3.1.1. -- Joel Rosdahl Thu, 6 Jan 2000 15:09:35 +0100 xbuffy (3.3.bl.3-8) frozen unstable; urgency=low * Install xbuffyconfig with executable bit set (thanks to Matt McLean ). This fixes bug#29239 ("xbuffy: Doesn't install"). -- Joel Rosdahl Tue, 24 Nov 1998 07:49:46 +0100 xbuffy (3.3.bl.3-7) unstable; urgency=low * Changed a flag to test in xbuffyconfig. * Rebuilt to get a call to update-menus in postrm. -- Joel Rosdahl Wed, 14 Oct 1998 19:00:52 +0200 xbuffy (3.3.bl.3-6) unstable; urgency=low * Fixed variable name in /usr/sbin/xbuffyconfig (bug #27416). -- Joel Rosdahl Sun, 4 Oct 1998 09:27:43 +0200 xbuffy (3.3.bl.3-5) unstable; urgency=low * Made a configuration file (fixes bug #27235). -- Joel Rosdahl Fri, 2 Oct 1998 10:48:32 +0200 xbuffy (3.3.bl.3-4) unstable; urgency=low * Incorporated non-maintainer changes (bug #26135). -- Joel Rosdahl Mon, 28 Sep 1998 12:10:59 +0200 xbuffy (3.3.bl.3-3.1) unstable; urgency=low * non-maintainer upload (binary-only) for Alpha * added stdlib.h a couple of times for malloc prototypes which also meant bogus casts could be removed. -- Paul Slootman Tue, 25 Aug 1998 21:05:53 +0200 xbuffy (3.3.bl.3-3) unstable; urgency=low * Converted to debhelper. * Standards-Version 2.4.1 * Wrote a man page for /usr/sbin/xbuffyconfig -- Joel Rosdahl Sun, 26 Jul 1998 18:26:43 +0200 xbuffy (3.3.bl.3-2) unstable; urgency=low * Fixed typos in README.LED. -- Joel Rosdahl Fri, 24 Jul 1998 16:39:53 +0200 xbuffy (3.3.bl.3-1) unstable; urgency=low * Upstream version with the LED support. * Applied a minor patch from Anders Johansson. * The source can be unpacked, I think... (bug #24290). * Wrote a configure script (/usr/sbin/xbuffyconfig). * Wrote README.LED. * Removed the forking to background. -- Joel Rosdahl Sun, 19 Jul 1998 17:12:52 +0200 xbuffy (3.3.bl.2-1) unstable; urgency=low * Incorporating new patches (coordinated by Brandon Long; see /usr/doc/xbuffy/README.BL) which fix some bugs and add support for MH folders and maildirs * Fixed some problems reported by Lintian -- Joel Rosdahl Fri, 27 Feb 1998 14:07:08 +0100 xbuffy (3.3-1) unstable; urgency=low * New version (fixes bug #14255) -- Joel Rosdahl Fri, 31 Oct 1997 14:18:49 +0100 xbuffy (3.2.1-4) unstable; urgency=low * Changed the Architecture field in debian/control to any (fixes bug #13628) -- Joel Rosdahl Wed, 8 Oct 1997 23:53:24 +0200 xbuffy (3.2.1-3) unstable; urgency=low * Compiled against xlib6g (Fixes bug #12817) -- Joel Rosdahl Thu, 25 Sep 1997 21:21:37 +0200 xbuffy (3.2.1-2) unstable; urgency=low * Changed the app-defaults file * Fixed a couple of bugs in the parsing of mailbox and newsbox paths * Removed a bit of NNTP correctness checking that caused problems * Changed menu section to Apps/Net * Removed default news server -- Joel Rosdahl Tue, 5 Aug 1997 18:57:05 +0200 xbuffy (3.2.1-1) unstable; urgency=low * Initial Release. -- Joel Rosdahl Sat, 12 Jul 1997 01:36:09 +0200 debian/compat0000644000000000000000000000000211317441104010360 0ustar 5 debian/control0000644000000000000000000000205211317443635010577 0ustar Source: xbuffy Section: mail Priority: optional Maintainer: Bernhard R. Link Standards-Version: 3.8.3 Build-Depends: debhelper (>= 5), libxt-dev (>= 1:1.0), libxaw7-dev (>= 1:1.0), dpkg-dev (>= 1.13.2), autoconf Homepage: http://www.fiction.net/blong/programs/#xbuffy Vcs-Browser: http://git.debian.org/?p=users/brlink/xbuffy.git;a=summary Vcs-Git: git://git.debian.org/~brlink/xbuffy.git Package: xbuffy Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: monitor mailboxes and/or newsgroups Xbuffy is a program that displays how many unread mails you have in your different mailboxes. You can have different titles for the mailboxes, and define what shall happen when a new mail arrives. It can beep and invoke a shell command, for example. . If you press mouse button 1 on the title associated with a mail box, a list of From: and Subject: lines of the mails in the mail spool file is shown. If you press mouse button 2, an arbitrary command is executed. . Xbuffy can similarly watch newsgroups via NNTP. debian/copyright0000644000000000000000000000536311317441104011124 0ustar This package was debianized by Joel Rosdahl . The upstream sources was downloaded from http://www.fiction.net/blong/programs/#xbuffy The upstream source was stripped by Bernhard R. Link via: rm config.h.in libdyn/Makefile acconfig.h configure len_next.c header_cmp.c utimes.c strincmp.c strdup.c move_left.c getword.c remfirstwd.c realfrom.c Copyright for xbuffy: /******************************************************************************* Copyright (c) 1994,1995 William Pemberton (wfp5p@virginia.edu) The X Consortium, and any party obtaining a copy of these files from the X Consortium, directly or indirectly, is granted, free of charge, a full and unrestricted irrevocable, world-wide, paid up, royalty-free, nonexclusive right and license to deal in this software and documentation files (the "Software"), including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons who receive copies from any such party to do so. This license includes without limitation a license to do the foregoing actions under any patents of the party supplying this software to the X Consortium. *******************************************************************************/ Copyright for the led program: /********************************************************************** * Copyright (C) 1998 Anders Johansson (andersjo@lysator.liu.se) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation version 2 of the License. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General * Public License for more details (see enclosed file COPYING). * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ***********************************************************************/ On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-2'. Copyright for the libdyn included in the libdyn directory: * There are no restrictions on this code; however, if you make any * changes, I request that you document them so that I do not get * credit or blame for your modifications. * * Written by Barr3y Jaspan, Student Information Processing Board (SIPB) * and MIT-Project Athena, 1989. debian/dirs0000644000000000000000000000011111317441104010037 0ustar etc/X11/app-defaults usr/share/pixmaps usr/share/man/man1 usr/lib/xbuffy debian/docs0000644000000000000000000000004111317441104010030 0ustar README README.BL README.LED TODO debian/examples0000644000000000000000000000003311317441104010717 0ustar boxfile.sample boxfile.fmt debian/install0000644000000000000000000000017011317441104010551 0ustar debian/xbuffy16.xpm /usr/share/pixmaps/ debian/xbuffy32.xpm /usr/share/pixmaps/ debian/xbuffy64.xpm /usr/share/pixmaps/ debian/menu0000644000000000000000000000036711317441104010057 0ustar ?package(xbuffy):needs="x11" section="Applications/Network/Communication" title="Xbuffy" command="/usr/bin/xbuffy" icon16x16="/usr/share/pixmaps/xbuffy16.xpm" icon32x32="/usr/share/pixmaps/xbuffy32.xpm" icon64x64="/usr/share/pixmaps/xbuffy64.xpm" debian/patches/0000755000000000000000000000000011317441105010612 5ustar debian/patches/0001-Bring-build-system-to-proper-state.patch0000644000000000000000000001351011317441105020734 0ustar From 167d681e4a77c57aab3bae54669c8a5d4b43506c Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Sat, 19 Dec 2009 13:01:09 +0100 Subject: Bring build system to proper state. - do not link against Xmu or Xext as we do not use them - do not link against nls unless needed - no not reference files not longer existing - support newer autoconf (so --host and --build can both be given) - therefor move header headings from acconfig.h to configure.in - use NNTP_OBJS for nntp.o - support DESTDIR - install app-defaults to proper place (http://bugs.debian.org/86303) - install led binary to the proper place --- Makefile.in | 41 +++++++++++++++++++++-------------------- configure.in | 29 ++++++++++++++++------------- 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/Makefile.in b/Makefile.in index de878d5..63420cc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -6,11 +6,13 @@ SHELL=/bin/sh VERSION=@VERSION@ prefix=@prefix@ +datarootdir=@datarootdir@ exec_prefix=@exec_prefix@ bindir=@bindir@ libdir=@libdir@ mandir=@mandir@ srcdir=@srcdir@ +appdefdir=@sysconfdir@/X11/app-defaults VPATH=@srcdir@ @SET_MAKE@ @@ -23,7 +25,7 @@ LIBS=@LIBS@ LIBDYN = $(srcdir)/libdyn/libdyn.a OBJS = xbuffy.o boxfile.o realfrom.o getword.o len_next.o move_left.o \ - strincmp.o remfirstwd.o header_cmp.o @LIBOBJS@ + remfirstwd.o header_cmp.o @NNTP_OBJS@ DOC = README xbuffy.man boxfile.fmt boxfile.sample DEFAULTS = XBuffy.ad HDRS = xbuffy.h xbuffy.xbm @@ -38,30 +40,29 @@ led: led.o $(CC) -o led led.o $(LDFLAGS) $(LIBDYN): - (cd libdyn && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS) -I..") + cd libdyn && $(MAKE) CC="$(CC)" CFLAGS="$(CFLAGS) -I.." install: xbuffy @LED@ - $(srcdir)/mkinstalldirs $(bindir) - -mv -f $(bindir)/xbuffy $(bindir)/xbuffy.old - $(INSTALL) -m 755 xbuffy $(bindir) + $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) + $(INSTALL) -m 755 xbuffy $(DESTDIR)$(bindir) -if [ "@LED@" ]; then \ - $(INSTALL) -m 4755 led $(bindir); \ + $(srcdir)/mkinstalldirs $(DESTDIR)$(libdir)/xbuffy; \ + $(INSTALL) -m 755 led $(DESTDIR)$(libdir)/xbuffy; \ fi - $(srcdir)/mkinstalldirs $(mandir)/man1 - $(INSTALL) -m 644 $(srcdir)/xbuffy.man $(mandir)/man1/xbuffy.1 - -if [ ! -f $(libdir)/X11/app-defaults/XBuffy ]; then \ - $(srcdir)/mkinstalldirs $(libdir)/X11/app-defaults; \ - $(INSTALL) -m 644 $(srcdir)/XBuffy.ad $(libdir)/X11/app-defaults/XBuffy; \ + $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/man1 + $(INSTALL) -m 644 $(srcdir)/xbuffy.man $(DESTDIR)$(mandir)/man1/xbuffy.1 + -if [ ! -f $(DESTDIR)$(appdefdir)/XBuffy ]; then \ + $(srcdir)/mkinstalldirs $(DESTDIR)$(appdefdir); \ + $(INSTALL) -m 644 $(srcdir)/XBuffy.ad $(DESTDIR)$(appdefdir)/XBuffy; \ fi uninstall: - rm -f $(bindir)/xbuffy $(mandir)/man1/xbuffy.1 + rm -f $(DESTDIR)$(bindir)/xbuffy $(DESTDIR)$(mandir)/man1/xbuffy.1 -if [ "@LED@" ]; then \ - rm -f $(bindir)/led \ + rm -f $(DESTDIR)$(bindir)/led \ fi - -mv -f $(bindir)/xbuffy.old $(bindir)/xbuffy -config.h.in: $(srcdir)/acconfig.h +config.h.in: $(srcdir)/configure.in autoheader config.h: $(srcdir)/config.h.in @@ -73,11 +74,11 @@ dep: Makefile echo '# DO NOT REMOVE THIS LINE' >> Makefile $(CC) -MM $(XCPPFLAGS) $(srcdir)/*.c >> Makefile -clean: - (cd $(srcdir) && rm -f $(CLEANFILES)) - (cd $(srcdir)/libdyn && $(MAKE) $@) +clean: + cd $(srcdir) && rm -f $(CLEANFILES) + cd $(srcdir)/libdyn && $(MAKE) $@ distclean: clean - (cd $(srcdir) && rm -f config.cache config.log config.status \ - Makefile config.h tags) + cd $(srcdir) && rm -f config.cache config.log config.status \ + libdyn/Makefile Makefile config.h tags diff --git a/configure.in b/configure.in index 5d3d3d5..4b36ab0 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(xbuffy.h) AC_CONFIG_HEADER(config.h) +AC_PREREQ(2.50) VERSION=3.3 SUBVERSION=.bl.3 @@ -16,6 +17,14 @@ AC_PROG_CC AC_PROG_MAKE_SET AC_PROG_INSTALL +AH_TEMPLATE(DEBUG,[Enable debugging info]) +AH_TEMPLATE(USE_CONTENT_LENGTH,[try to use Content-Length: headers]) +AH_TEMPLATE(VERSION,[Version Information]) +AH_TEMPLATE(USE_NNTP,[enable NNTP mailboxes?]) +AH_TEMPLATE(NNTP_SERVER,[Default NNTP Server]) +AH_TEMPLATE(USE_MOTIF,[use Motif instead of Athena?]) +AH_TEMPLATE(USE_LED,[enable keyboard LED blinking?]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION$SUBVERSION") AC_SUBST(VERSION) @@ -31,12 +40,7 @@ if test -d "$x_libraries"; then AC_MSG_RESULT(Found X libraries at $x_libraries) fi -dnl AC_CHECK_LIB(ICE, IceOpenConnection, -dnl [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"],, [$X_EXTRA_LIBS]) - -LIBS="$LIBS -lXmu -lXt -lX11" -dnl Check for -lXext -AC_CHECK_LIB(Xext, XShapeQueryExtension, LIBS="-lXext $LIBS",, -lX11 $X_EXTRA_LIBS) +LIBS="$LIBS -lXt -lX11" XAW=yes AC_ARG_WITH(xaw3d, [ --with-xaw3d[=DIR] use Xaw3d instead of Xaw], @@ -115,7 +119,7 @@ AC_ARG_WITH(motif, [ --with-motif[=DIR] use Motif instead of Xaw], dnl Default to Athena libraries if test x$XAW = xyes; then - LIBS="-lXaw -lXext -lXmu $LIBS" + LIBS="-lXaw $LIBS" AC_MSG_RESULT(Defaulting to Athena Widgets) fi @@ -141,9 +145,10 @@ AC_ARG_ENABLE(nntp, [ --enable-nntp[=server] Enable NNTP 'Mailbox' support], xbuffy_nntp_server=$enableval fi AC_DEFINE(USE_NNTP) - LIBOBJS="$LIBOBJS nntp.o" - AC_CHECK_LIB(socket, socket) - AC_CHECK_LIB(nsl, gethostbyname) + NNTP_OBJS="nntp.o" + AC_SUBST(NNTP_OBJS) + AC_CHECK_FUNC(socket,[],[AC_CHECK_LIB(socket, socket)]) + AC_CHECK_FUNC(gethostbyname,[],[AC_CHECK_LIB(nsl, gethostbyname)]) if test x$xbuffy_nntp_server != xno; then AC_DEFINE_UNQUOTED(NNTP_SERVER, "$xbuffy_nntp_server") AC_SUBST(NNTP_SERVER) @@ -163,8 +168,6 @@ fi AC_HEADER_STDC -AC_CHECK_FUNCS(setpriority) -AC_REPLACE_FUNCS(utimes strdup bcopy) - +AC_CHECK_FUNCS(setpriority bcopy) AC_OUTPUT(Makefile libdyn/Makefile) -- 1.6.5.7 debian/patches/0002-Add-header-parsing-code-to-replace-the-non-free-one-.patch0000644000000000000000000002345011317441105023657 0ustar From 3d29185895bdc75e5811888a2bfea084f9a13b6c Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Sat, 19 Dec 2009 13:03:49 +0100 Subject: Add header parsing code to replace the non-free one removed --- Makefile.in | 3 +- headers.c | 248 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ xbuffy.c | 26 +++--- xbuffy.h | 4 +- 4 files changed, 265 insertions(+), 16 deletions(-) create mode 100644 headers.c diff --git a/Makefile.in b/Makefile.in index 63420cc..a639526 100644 --- a/Makefile.in +++ b/Makefile.in @@ -24,8 +24,7 @@ LDFLAGS=@LDFLAGS@ LIBS=@LIBS@ LIBDYN = $(srcdir)/libdyn/libdyn.a -OBJS = xbuffy.o boxfile.o realfrom.o getword.o len_next.o move_left.o \ - remfirstwd.o header_cmp.o @NNTP_OBJS@ +OBJS = xbuffy.o boxfile.o headers.o @NNTP_OBJS@ DOC = README xbuffy.man boxfile.fmt boxfile.sample DEFAULTS = XBuffy.ad HDRS = xbuffy.h xbuffy.xbm diff --git a/headers.c b/headers.c new file mode 100644 index 0000000..b443dfb --- /dev/null +++ b/headers.c @@ -0,0 +1,248 @@ +/******************************************************************************* + + Copyright (c) 2006 Bernhard R. Link + + The X Consortium, and any party obtaining a copy of these files, + directly or indirectly, is granted, free of charge, a + full and unrestricted irrevocable, world-wide, paid up, royalty-free, + nonexclusive right and license to deal in this software and + documentation files (the "Software"), including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons who receive + copies from any such party to do so. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +*******************************************************************************/ +/* mail header handling stuff */ + +#include +#include +#include + +#include + +int cmp_header(const char *buffer, const char *header) { + size_t len = strlen(header); + + return strncasecmp(buffer, header, len) == 0 + && buffer[len] == ':'; +} + +int cmp_header_get(const char *buffer, const char *header, const char **p) { + size_t len = strlen(header); + + if (strncasecmp(buffer, header, len) == 0 + && buffer[len] == ':') { + buffer += len; + do { + buffer++; + while (*buffer == ' ' || *buffer == '\t' ) { + buffer++; + } + } while ( *buffer == '\n' && + (buffer[1] == ' ' || buffer[1] == '\t')); + *p = buffer; + return 1; + } else { + return 0; + } +} + +int proper_mailstart(const char *buffer) { + char word[4]; int wordlen; + +#define FROM "From" + if (strncmp(buffer,FROM,sizeof(FROM)-1) != 0) + return 0; + buffer += sizeof(FROM)-1; + if (buffer[0] != ' ') + return 0; + while (*buffer && isspace(*buffer)) + buffer++; + /* over from address */ + while (*buffer && !isspace(*buffer)) { + if (*buffer == '\\') { + buffer++; + if (*buffer == '\0' ) + return 0; + buffer++; + } + if (*buffer == '"') { + while (*buffer != '"') { + if (*buffer == '\\') + buffer++; + if (*buffer == '\0') + return 0; + buffer++; + } + } + buffer++; + } + if (*buffer == '\0') + return 0; + while (*buffer && isspace(*buffer)) + buffer++; + /* weekday */ + wordlen = 0; + while (*buffer && !isspace(*buffer)) { + if (*buffer == '\\') { + buffer++; + if (*buffer == '\0' ) + return 0; + if (wordlen < 3) + word[wordlen++] = tolower(*buffer); + buffer++; + } + if (*buffer == '"') { + while (*buffer != '"') { + if (*buffer == '\\') + buffer++; + if (*buffer == '\0') + return 0; + if (wordlen < 3) + word[wordlen++] = tolower(*buffer); + buffer++; + } + } else { + if (wordlen < 3) + word[wordlen++] = tolower(*buffer); + } + buffer++; + } + if (*buffer == '\0') + return 0; + while (*buffer && isspace(*buffer)) + buffer++; + word[wordlen] = '\0'; + switch (word[0]) { + case 'f': + if (word[1] != 'r' || word[2] != 'i') + return 0; + break; + case 'm': + if (word[1] != 'o' || word[2] != 'n') + return 0; + break; + case 's': + if ((word[1] != 'u' || word[2] != 'n') + &&(word[1] != 'a' || word[2] != 't')) + return 0; + break; + case 't': + if ((word[1] != 'u' || word[2] != 'e') + &&(word[1] != 'h' || word[2] != 'u')) + return 0; + break; + case 'w': + if (word[1] != 'e' || word[2] != 'd') + return 0; + break; + default: + return 0; + } + /* month */ + wordlen = 0; + while (*buffer && !isspace(*buffer)) { + if (*buffer == '\\') { + buffer++; + if (*buffer == '\0' ) + return 0; + if (wordlen < 3) + word[wordlen++] = tolower(*buffer); + buffer++; + } + if (*buffer == '"') { + while (*buffer != '"') { + if (*buffer == '\\') + buffer++; + if (*buffer == '\0') + return 0; + if (wordlen < 3) + word[wordlen++] = tolower(*buffer); + buffer++; + } + } else { + if (wordlen < 3) + word[wordlen++] = tolower(*buffer); + } + buffer++; + } + if (*buffer == '\0') + return 0; + while (*buffer && isspace(*buffer)) + buffer++; + word[wordlen] = '\0'; + switch (word[0]) { + case 'a': + if ((word[1] != 'p' || word[2] != 'r') + &&(word[1] != 'u' || word[2] != 'g')) + return 0; + break; + case 'd': + if (word[1] != 'e' || word[2] != 'c') + return 0; + break; + case 'f': + if (word[1] != 'e' || word[2] != 'b') + return 0; + break; + case 'j': + if ((word[1] != 'a' || word[2] != 'n') + &&(word[1] != 'u' || + (word[2] != 'n' && word[2] !='l'))) + return 0; + break; + case 'm': + if (word[1] != 'a' || + (word[2] != 'r' && word[2] != 'y')) + return 0; + break; + case 'n': + if (word[1] != 'o' || word[2] != 'v') + return 0; + break; + case 'o': + if (word[1] != 'c' || word[2] != 't') + return 0; + break; + case 's': + if (word[1] != 'e' || word[2] != 'p') + return 0; + break; + default: + return 0; + } + + /* day of month*/ + wordlen = 0; + while (*buffer && !isspace(*buffer)) { + if (*buffer == '\\') { + buffer++; + if (*buffer < '0' || *buffer > '9') + return 0; + wordlen = wordlen*10+((*buffer)-'0'); + buffer++; + } + if (*buffer == '"') { + while (*buffer != '"') { + if (*buffer == '\\') + buffer++; + if (*buffer < '0' || *buffer > '9') + return 0; + wordlen = wordlen*10+((*buffer)-'0'); + buffer++; + } + } else { + if (*buffer < '0' || *buffer > '9') + return 0; + wordlen = wordlen*10+((*buffer)-'0'); + } + buffer++; + } + if (wordlen == 0 || wordlen > 31) + return 0; + return 1; +} diff --git a/xbuffy.c b/xbuffy.c index 29c5f78..abf18a1 100644 --- a/xbuffy.c +++ b/xbuffy.c @@ -719,6 +719,7 @@ int CountMBoxMail(mailBox, headerString) { FILE *fp = 0; char buffer[MAX_STRING]; + const char *p; char From[MAX_STRING], Subject[MAX_STRING]; register int count = 0; int status = UNKNOWN; @@ -744,7 +745,7 @@ int CountMBoxMail(mailBox, headerString) while ((c = getc(fp)) != EOF && c != '\n'); /* keep reading */ } - if ((!in_header) && (real_from(buffer))) + if ((!in_header) && (proper_mailstart(buffer))) { has_CL = FALSE; in_header = TRUE; @@ -752,27 +753,26 @@ int CountMBoxMail(mailBox, headerString) } else if (in_header) { - if (header_cmp(buffer, "From", NULL)) + if (cmp_header(buffer, "From")) { strcpy(From, buffer); } - if (header_cmp(buffer, "Content-Length", NULL)) + if (cmp_header_get(buffer, "Content-Length", &p)) { has_CL = TRUE; - CL = atol(buffer+15); + CL = atol(p); } - if (header_cmp(buffer, "Subject", NULL)) + if (cmp_header(buffer, "Subject")) { strcpy(Subject, buffer); } - if (header_cmp(buffer, "Status", NULL)) + if (cmp_header_get(buffer, "Status", &p)) { - remove_header_keyword(buffer); - if (*buffer == 'N') + if (*p == 'N') status = NEW_MSG; else status = READ_MSG; @@ -814,6 +814,7 @@ int CountDirMail(mailBox, headerString) DIR *dp = 0; FILE *fp = 0; char buffer[MAX_STRING]; + const char *p; char From[MAX_STRING], Subject[MAX_STRING]; char path[_POSIX_PATH_MAX]; int status; @@ -872,20 +873,19 @@ int CountDirMail(mailBox, headerString) while ((c = getc(fp)) != EOF && c != '\n'); /* keep reading */ } if (headerString != NULL && - header_cmp(buffer, "From", NULL)) + cmp_header(buffer, "From")) { strcpy(From, buffer); } else if (headerString != NULL && - header_cmp(buffer, "Subject", NULL)) + cmp_header(buffer, "Subject")) { strcpy(Subject, buffer); } else if (mailBox->type == MHDIR && - header_cmp(buffer, "Status", NULL)) + cmp_header_get(buffer, "Status", &p)) { - remove_header_keyword(buffer); - if (*buffer == 'N') + if (*p == 'N') status = NEW_MSG; else status = READ_MSG; diff --git a/xbuffy.h b/xbuffy.h index 406df0f..e831240 100644 --- a/xbuffy.h +++ b/xbuffy.h @@ -127,5 +127,7 @@ typedef struct ApplicationData_s ApplicationData_t; #define NEWstrlen(s) (s == NULL ? 0 : strlen(s)) #define NEWstrdup(s) (s == NULL ? NULL : strdup(s)) -extern char *header_cmp(); +int cmp_header(const char *, const char *); +int cmp_header_get(const char *buffer, const char *header, const char **p); +int proper_mailstart(const char *); #endif /* _XBUFFY_H_ */ -- 1.6.5.7 debian/patches/0003-Some-small-tidy-ups.patch0000644000000000000000000004420611317441105016006 0ustar From aabaefc50e51725a03ef1bfe3aaf3a4ea2b0a0ac Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Sat, 19 Dec 2009 13:07:28 +0100 Subject: Some small tidy ups - use stdarg instead of varargs - fixes of string typos and missing escapes - removal of unnecessary casts and definitions - added several #includes and declerations to avoid warnings (based on 01_original.dpatch by Joel Rosdahl) --- boxfile.c | 3 +- led.c | 4 ++- libdyn/dyn.h | 7 +++++ libdyn/dynP.h | 5 +++- libdyn/dyn_append.c | 6 ++++- libdyn/dyn_create.c | 5 ++- libdyn/dyn_delete.c | 8 ++++- libdyn/dyn_insert.c | 8 ++++- libdyn/dyn_put.c | 5 ++- libdyn/dyn_realloc.c | 3 +- libdyn/dyn_size.c | 3 +- nntp.c | 18 +++++-------- xbuffy.c | 28 ++++++++++++--------- xbuffy.h | 10 ++++++++ xbuffy.man | 64 +++++++++++++++++++++++++------------------------- 15 files changed, 106 insertions(+), 71 deletions(-) diff --git a/boxfile.c b/boxfile.c index be63bff..f15811b 100644 --- a/boxfile.c +++ b/boxfile.c @@ -239,8 +239,7 @@ void dumpBox(tempBox) -void readBoxfile(boxFile) - char *boxFile; +void readBoxfile(const char *boxFile) { BoxInfo_t tempBox; FILE *boxes; diff --git a/led.c b/led.c index 23d3456..464e032 100644 --- a/led.c +++ b/led.c @@ -1,6 +1,8 @@ #include +#include #include #include +#include #include #include @@ -26,7 +28,7 @@ int led_num; int main(int argc, char** argv) { - int i,num,parent; + int i,num; if (geteuid()) { fprintf(stderr, "led must be run as root!\n"); diff --git a/libdyn/dyn.h b/libdyn/dyn.h index e373ef8..48b07b2 100644 --- a/libdyn/dyn.h +++ b/libdyn/dyn.h @@ -8,6 +8,10 @@ * * Written by Barr3y Jaspan, Student Information Processing Board (SIPB) * and MIT-Project Athena, 1989. + * + * Changes: + * added DynSize prototype + * moves DynObjectP from dynP.h to here */ @@ -51,5 +55,8 @@ int DynAdd(), DynDelete(), DynDestroy(), DynDebug(); int DynInsert(), DynParanoid(); DynPtr DynGet(); +typedef struct _DynObject *DynObjectP; +int DynSize(DynObjectP obj); + #endif /* _Dyn_h */ /* DO NOT ADD ANYTHING AFTER THIS #endif */ diff --git a/libdyn/dynP.h b/libdyn/dynP.h index 37aee58..24bc5b6 100644 --- a/libdyn/dynP.h +++ b/libdyn/dynP.h @@ -8,6 +8,9 @@ * * Written by Barr3y Jaspan, Student Information Processing Board (SIPB) * and MIT-Project Athena, 1989. + * + * Changes: + * DynObjectP moved to public file */ @@ -35,7 +38,7 @@ typedef struct _DynObject { DynPtr array; int el_size, num_el, size, inc; char debug, paranoid; -} DynObjectRecP, *DynObjectP; +} DynObjectRecP; /* Internal functions */ int _DynRealloc(); diff --git a/libdyn/dyn_append.c b/libdyn/dyn_append.c index e4ca16b..af0d0a3 100644 --- a/libdyn/dyn_append.c +++ b/libdyn/dyn_append.c @@ -8,9 +8,13 @@ * * Written by Barr3y Jaspan, Student Information Processing Board (SIPB) * and MIT-Project Athena, 1989. + * + * Changes made: + * addes strings.h include, changed some %d to %p */ #include +#include #include "dynP.h" @@ -20,7 +24,7 @@ int DynAppend(obj, els, num) int num; { if (obj->debug) - fprintf(stderr, "dyn: append: Writing %d bytes from %d to %d + %d\n", + fprintf(stderr, "dyn: append: Writing %d bytes from %p to %p + %d\n", obj->el_size*num, els, obj->array, obj->num_el*obj->el_size); if (obj->size < obj->num_el + num) { diff --git a/libdyn/dyn_create.c b/libdyn/dyn_create.c index 16890ae..d20d78d 100644 --- a/libdyn/dyn_create.c +++ b/libdyn/dyn_create.c @@ -12,6 +12,7 @@ */ #include +#include #include "dynP.h" @@ -26,11 +27,11 @@ DynObjectP DynCreate(el_size, inc) { DynObjectP obj; - obj = (DynObjectP) malloc(sizeof(DynObjectRecP)); + obj = malloc(sizeof(DynObjectRecP)); if (obj == NULL) return NULL; - obj->array = (DynPtr) malloc(0); + obj->array = malloc(0); obj->el_size = el_size; obj->num_el = obj->size = 0; obj->debug = obj->paranoid = 0; diff --git a/libdyn/dyn_delete.c b/libdyn/dyn_delete.c index 2ec2497..bde8d61 100644 --- a/libdyn/dyn_delete.c +++ b/libdyn/dyn_delete.c @@ -8,9 +8,13 @@ * * Written by Barr3y Jaspan, Student Information Processing Board (SIPB) * and MIT-Project Athena, 1989. + * + * Changes made to this: + * added strings.h, changed some %d to %p */ #include +#include #include "dynP.h" @@ -45,7 +49,7 @@ int DynDelete(obj, index) else { if (obj->debug) fprintf(stderr, - "dyn: delete: copying %d bytes from %d + %d to + %d.\n", + "dyn: delete: copying %d bytes from %p + %d to + %d.\n", obj->el_size*(obj->num_el - index), obj->array, (index+1)*obj->el_size, index*obj->el_size); @@ -56,7 +60,7 @@ int DynDelete(obj, index) if (obj->paranoid) { if (obj->debug) fprintf(stderr, - "dyn: delete: zeroing %d bytes from %d + %d\n", + "dyn: delete: zeroing %d bytes from %p + %d\n", obj->el_size, obj->array, obj->el_size*(obj->num_el - 1)); bzero(obj->array + obj->el_size*(obj->num_el - 1), diff --git a/libdyn/dyn_insert.c b/libdyn/dyn_insert.c index c0ed297..4eded61 100644 --- a/libdyn/dyn_insert.c +++ b/libdyn/dyn_insert.c @@ -8,9 +8,13 @@ * * Written by Barr3y Jaspan, Student Information Processing Board (SIPB) * and MIT-Project Athena, 1989. + * + * changes: + * added strings.h header */ #include +#include #include "dynP.h" int DynInsert(obj, index, els, num) @@ -35,7 +39,7 @@ int DynInsert(obj, index, els, num) } if (obj->debug) - fprintf(stderr,"dyn: insert: Moving %d bytes from %d + %d to + %d\n", + fprintf(stderr,"dyn: insert: Moving %d bytes from %p + %d to + %d\n", (obj->num_el-index)*obj->el_size, obj->array, obj->el_size*index, obj->el_size*(index+num)); @@ -46,7 +50,7 @@ int DynInsert(obj, index, els, num) (obj->num_el-index)*obj->el_size); if (obj->debug) - fprintf(stderr, "dyn: insert: Copying %d bytes from %d to %d + %d\n", + fprintf(stderr, "dyn: insert: Copying %d bytes from %p to %p + %d\n", obj->el_size*num, els, obj->array, obj->el_size*index); bcopy(els, obj->array + obj->el_size*index, obj->el_size*num); diff --git a/libdyn/dyn_put.c b/libdyn/dyn_put.c index 4229f80..8e8f226 100644 --- a/libdyn/dyn_put.c +++ b/libdyn/dyn_put.c @@ -11,6 +11,7 @@ */ #include +#include #include "dynP.h" @@ -34,7 +35,7 @@ DynPtr DynGet(obj, num) } if (obj->debug) - fprintf(stderr, "dyn: get: Returning address %d + %d.\n", + fprintf(stderr, "dyn: get: Returning address %p + %d.\n", obj->array, obj->el_size*num); return (DynPtr) obj->array + obj->el_size*num; @@ -67,7 +68,7 @@ static int DynPut(obj, el, index) int ret; if (obj->debug) - fprintf(stderr, "dyn: put: Writing %d bytes from %d to %d + %d\n", + fprintf(stderr, "dyn: put: Writing %d bytes from %p to %p + %d\n", obj->el_size, el, obj->array, index*obj->el_size); if ((ret = _DynResize(obj, index)) != DYN_OK) diff --git a/libdyn/dyn_realloc.c b/libdyn/dyn_realloc.c index bf13910..ba6a657 100644 --- a/libdyn/dyn_realloc.c +++ b/libdyn/dyn_realloc.c @@ -11,6 +11,7 @@ */ #include +#include #include "dynP.h" @@ -32,7 +33,7 @@ int _DynRealloc(obj, num_incs) "dyn: alloc: Increasing object by %d bytes (%d incs).\n", obj->el_size*obj->inc*num_incs, num_incs); - temp = (DynPtr) realloc(obj->array, new_size_in_bytes); + temp = realloc(obj->array, new_size_in_bytes); if (temp == NULL) { if (obj->debug) fprintf(stderr, "dyn: alloc: Out of memory.\n"); diff --git a/libdyn/dyn_size.c b/libdyn/dyn_size.c index 773db4a..75bdee5 100644 --- a/libdyn/dyn_size.c +++ b/libdyn/dyn_size.c @@ -14,8 +14,7 @@ #include "dynP.h" -int DynSize(obj) - DynObjectP obj; +int DynSize(DynObjectP obj) { if (obj->debug) fprintf(stderr, "dyn: size: returning size %d.\n", obj->num_el); diff --git a/nntp.c b/nntp.c index 08d469c..1fc7383 100644 --- a/nntp.c +++ b/nntp.c @@ -23,7 +23,8 @@ #include #include #include -#include +#include +#include #include #include @@ -48,15 +49,13 @@ extern int NNTPinit; #endif -void Fatal(va_alist) +void Fatal(const char *fmt, ...) { - char *fmt; extern int errno; va_list p; - va_start(p); + va_start(p, fmt); - fmt = va_arg(p, char *); vfprintf(stderr, fmt, p); fputc('\n', stderr); if (errno) @@ -167,10 +166,10 @@ int getHeaders(long Article, char **from, char **subject) q[-1] = NEWLINE; - if (strincmp(line, "From:", 5) == 0) + if (strncasecmp(line, "From:", 5) == 0) *from = strdup(line); - if (strincmp(line, "Subject:", 8) == 0) + if (strncasecmp(line, "Subject:", 8) == 0) *subject = strdup(line); @@ -212,7 +211,7 @@ void readNewsrcEntry(newsBox, firstArt, lastArt) char *tmp; char *backp; - if (strincmp(line, newsBox->box, NEWstrlen(newsBox->box)) != 0) + if (strncasecmp(line, newsBox->box, NEWstrlen(newsBox->box)) != 0) continue; tmp = line + NEWstrlen(newsBox->box); @@ -294,12 +293,9 @@ int CountNNTP(newsBox, headerString, beenTouched) DynObject headerString; Boolean *beenTouched; { - int sock, err, len; char line[1024]; - long ipaddr; char *from; char *subject; - long firstScanArticle; long firstArticle; long lastArticle; long retVal; diff --git a/xbuffy.c b/xbuffy.c index abf18a1..0204ff1 100644 --- a/xbuffy.c +++ b/xbuffy.c @@ -34,6 +34,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -42,6 +45,7 @@ #include #include #endif /* SYSV */ +#include "libdyn/dyn.h" #include "xbuffy.h" #ifndef USE_MOTIF #include @@ -82,7 +86,6 @@ void TimerBreakPopup(); int CountUnixMail(); void ParseMailPath(); int makeBoxTitle(); -void initBox(); Pixel convertColor(); void ButtonDownHandler(); @@ -177,11 +180,7 @@ void CheckBox(i) int num = 0; Arg args[5]; int nargs; - static BoxInfo_t *tempNews = 0; BoxInfo_t *currentBox; - int found; - static char *mailHeader = NULL; - int headerSize; Boolean beenTouched; Boolean isIcon = FALSE; @@ -305,7 +304,6 @@ void UpdateBoxNumber(box) fprintf(stderr, "Error executing led\n"); _exit(1); } - default: } } else @@ -863,9 +861,6 @@ int CountDirMail(mailBox, headerString) if (fp != NULL) { while (!found && fgets(buffer, MAX_STRING - 2, fp) != 0) { - long CL; - int has_CL; - buffer[MAX_STRING - 1] = '\0'; /* just in case */ if ((strchr(buffer, '\n') == NULL) && (!feof(fp))) { /* read to end of line */ @@ -965,6 +960,8 @@ int CountUnixMail(mailBox, headerString, beenTouched) case MHDIR: count = CountDirMail(mailBox, headerString); break; + case NNTPBOX: + return(0); } /* Restore access time of mailbox. */ @@ -1187,7 +1184,10 @@ char *EliminatePath(path) char *file = 0; file = (char *) strrchr(path, '/'); - file = (file ? ++file : path); + if( file ) + ++file; + else + file = path; return (file); } @@ -1218,7 +1218,11 @@ void ParseNewsPath() { initBox(NEWstrdup(str), NNTPBOX, envPolltime, envHeadertime, UNDEF, data.command, data.audioCmd, NULL, data.origMode, data.nobeep, - NULL,NULL); + NULL,NULL +#ifdef USE_LED + ,-1 +#endif + ); str = strtok(NULL, ":, "); } } @@ -1648,7 +1652,7 @@ int main(argc, argv) #ifndef DEBUG #ifdef HAVE_SETPRIORITY if (setpriority(PRIO_PROCESS, 0, envPriority) == -1) - perror("Proirity change Failed"); + perror("Priority change failed"); #endif /* put ourself in the background */ switch (pid = fork()) diff --git a/xbuffy.h b/xbuffy.h index e831240..42a64df 100644 --- a/xbuffy.h +++ b/xbuffy.h @@ -127,6 +127,16 @@ typedef struct ApplicationData_s ApplicationData_t; #define NEWstrlen(s) (s == NULL ? 0 : strlen(s)) #define NEWstrdup(s) (s == NULL ? NULL : strdup(s)) +#ifdef USE_NNTP +int CountNNTP(BoxInfo_t *newsBox, DynObject headerString, Boolean *beenTouched); +#endif +void initBox(char *box, BoxType_t BoxType, int pollTime, int headerTime, BoxNameType_t BoxNameType, char *command, char *audioCmd, char *title, Boolean origMode, Boolean nobeep, char *bgName, char *fgName +#ifdef USE_LED +, int led +#endif +); +void readBoxfile(const char *boxFile); + int cmp_header(const char *, const char *); int cmp_header_get(const char *buffer, const char *header, const char **p); int proper_mailstart(const char *); diff --git a/xbuffy.man b/xbuffy.man index ef6cd23..ab88980 100644 --- a/xbuffy.man +++ b/xbuffy.man @@ -4,13 +4,13 @@ xbuffy \- yet another biff for the X Window System .SH SYNOPSIS .B xbuffy -[X toolkit options] [-help] [-version] [-horiz] -[-poll \fIseconds\fR] [-header \fIseconds\fR] -[-acmd \fIsound file\fR] [-nobeep] [-names] [-orig] -[-priority \fIpriority\fR] -[-command \fIcommand\fR] [-shortnames] -[-mail ] -[-news ] +[X toolkit options] [\-help] [\-version] [\-horiz] +[\-poll \fIseconds\fR] [\-header \fIseconds\fR] +[\-acmd \fIsound file\fR] [\-nobeep] [\-names] [\-orig] +[\-priority \fIpriority\fR] +[\-command \fIcommand\fR] [\-shortnames] +[\-mail ] +[\-news ] .SH DESCRIPTION Xbuffy is based on Xmultibiff by John Reardon. @@ -41,17 +41,17 @@ Read on for details on what it can do. .SH OPTIONS The following options are recognized: .TP 10 -.B -help +.B \-help Print a brief help message and exit .TP -.B -version +.B \-version Print the current version and exit .TP -.B -poll \fIsecs\fR +.B \-poll \fIsecs\fR How often the mailbox files are polled for new mail. If this is not specified, it will use the \fBMAILCHECK\fR environment variable. (default: 60) .TP -.B -header \fIsecs\fR +.B \-header \fIsecs\fR This will display the \fBFrom:\fR and \fBSubject:\fR lines from incoming mail messages in a popup window when button 1 is pressed in the box label. The mail @@ -62,50 +62,50 @@ new mail arrives. Clicking in the popup window when mail arrives (if the argument is non-zero) will instantly popdown the window. This feature was borrowed from xpbiff. .TP -.B -fill +.B \-fill Makes all the boxes the same size. .TP -.B -center +.B \-center Centers the name of the box in the box. This option turns on the fill option. .TP -.B -acmd \fIsound command\fR +.B \-acmd \fIsound command\fR This will run a command instead of ringing the bell when new mail arrives. For example, you could "cat meow >/dev/audio". This option could also be used to automatically open a mail reader when new mail arrives. .TP -.B -horiz +.B \-horiz This will line up the boxes horizontally (default: vertical) .TP -.B -nobeep +.B \-nobeep This will disable the beep (or sound command) when new mail arrives .TP -.B -boxfile \fIfilename\fR +.B \-boxfile \fIfilename\fR The name of a file containing configuration information for the boxes. The boxfile is an alternative way of specifying what to watch. The boxfile also allows each box to have different polltime, headertime, etc. .TP -.B -origMode +.B \-origMode This will show all messages in each mailbox. It has no effect on news groups. .TP -.B -names +.B \-names Will display the full pathname of all the mailboxes it is watching. .TP -.B -shortnames +.B \-shortnames Will display the file names of all the mailboxes it is watching. .TP -.B -priority \fIpriority\fR +.B \-priority \fIpriority\fR Nice level at which xbuffy and its child processes will run. .TP -.B -command \fIcommand\fR +.B \-command \fIcommand\fR This is the default command that is to be executed when Button 2 is pressed on a box. .TP .B X Options -Standard X windows options (e.g. -fn, -display, etc.) +Standard X windows options (e.g. \-fn, \-display, etc.) .SH ENVIRONMENT The names and purpose of the some of the following environment variables were borrowed from Bash, the GNU Shell. @@ -148,11 +148,11 @@ When using a \fIboxfile\fR, only the \fIbox\fR line is required. All options that are not given in the boxfile will default to the command line (or built in) value. .TP 10 -.B box \fIfile name\fR +.B box \fIfilename\fR The filename or newsgroup for this box. This also marks the beginning of a box definition. .TP -.B title \fIbox title\fR +.B title \fIboxtitle\fR The title that you want for this box. This will override the shortname or longname option. .TP @@ -205,18 +205,18 @@ box. Take care to escape characters correctly. .TP .B led \fInum\fR Specifies a keyboard led to flash when new mail arrives. This is a -number between 1 and 3. (1 - NumLock, 2 - CapsLock or 3 - ScrollLock). +number between 1 and 3. (1 - NumLock, 2 - CapsLock or 3 - ScrollLock.) -.B NOTE: -This is only available on LINUX and only if compiled with --enable-led +\fBNOTE:\fR This is only available on LINUX and only if compiled with +\-\-enable\-led -.TP 0 +.PP The following resources are settable on a per application basis in the Xresources: .TP 10 .B horiz -Set to TRUE or FALSE. Same as the -horiz option. +Set to TRUE or FALSE. Same as the \-horiz option. .TP .B mailboxes Set to a colon separated list of mailboxes (files). This @@ -233,7 +233,7 @@ maximum flexibility on a per-box basis, I suggest using a boxfile. The following example will watch 2 mailboxes in a home directory: .nf - \fI% xbuffy -mail ~/box1 ~/box2 &\fR + \fI% xbuffy \-mail ~/box1 ~/box2 &\fR .fi boxfile: @@ -244,7 +244,7 @@ The following example will watch 2 mailboxes in a home directory: The following example will watch a mailbox and a newsgroup: .nf - \fI% xbuffy -mail /usr/spool/mail/you -news comp.windows.x &\fR + \fI% xbuffy \-mail /usr/spool/mail/you \-news comp.windows.x &\fR .fi boxfile: -- 1.6.5.7 debian/patches/0004-led-related-patches.patch0000644000000000000000000001264411317441105016032 0ustar From 90d5498ab53060a0889c688df6ebab5e70628c54 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sat, 19 Dec 2009 13:09:24 +0100 Subject: led related patches taken from 01_original.dpatch from Joel Rasdahl --- README.LED | 16 ++++++++++++++++ led.c | 18 +++++++++++++++++- xbuffy.c | 45 ++++++++++++++++++++++++++++++--------------- 3 files changed, 63 insertions(+), 16 deletions(-) create mode 100644 README.LED diff --git a/README.LED b/README.LED new file mode 100644 index 0000000..77c238a --- /dev/null +++ b/README.LED @@ -0,0 +1,16 @@ +This is a keyboard LED blinking enabled kind of enhanced xbuffy +thing. The LED patch is written by Anders Johansson +. + +To make xbuffy blink a LED when new mail has arrived, add an option +line to the box definition in your boxfile like this: + +led [num] + +where [num] is an integer between 1 and 3. (1 - NumLock, 2 - CapsLock +or 3 - ScrollLock.) + +You can stop the blinking temporarily by clicking on the box area with +mouse button 3. + +1998-07-23 Joel Rosdahl diff --git a/led.c b/led.c index 464e032..abcdac9 100644 --- a/led.c +++ b/led.c @@ -1,3 +1,20 @@ +/********************************************************************** + * Copyright (C) 1998 Anders Johansson (andersjo@lysator.liu.se) + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General + * Public License for more details (see enclosed file COPYING). + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + ***********************************************************************/ + #include #include #include @@ -31,7 +48,6 @@ int main(int argc, char** argv) int i,num; if (geteuid()) { - fprintf(stderr, "led must be run as root!\n"); exit(1); } diff --git a/xbuffy.c b/xbuffy.c index 0204ff1..b2dbbe4 100644 --- a/xbuffy.c +++ b/xbuffy.c @@ -90,6 +90,7 @@ Pixel convertColor(); void ButtonDownHandler(); void ButtonUpHandler(); +void PopupEventHandler(); void BreakPopup(); void ExecuteCommand(); void setBoxColor(); @@ -288,10 +289,6 @@ void UpdateBoxNumber(box) if (box->pid > 1) { if (!kill(box->pid, SIGINT)) waitpid(box->pid, NULL, 0); -/* - else - perror("Failing to kill led"); -*/ } switch (box->pid = fork()) { case -1: @@ -300,7 +297,7 @@ void UpdateBoxNumber(box) case 0: sprintf(amt, "%d", box->n); sprintf(l, "%d", box->led); - if (execlp("led", "led", l, amt, (char*)NULL) == -1) { + if (execl("/usr/lib/xbuffy/led", "led", l, amt, (char*)NULL) == -1) { fprintf(stderr, "Error executing led\n"); _exit(1); } @@ -314,8 +311,6 @@ void UpdateBoxNumber(box) waitpid(box->pid, NULL, 0); box->pid = 0; } - else - perror("Failing to kill led"); } } #endif @@ -465,13 +460,29 @@ void ButtonUpHandler(w, i, event, cont) waitpid(currentBox->pid, NULL, 0); currentBox->pid = 0; } - else - perror("Failing to kill led"); #endif } } - +void PopupEventHandler(w, i, event, cont) + Widget w; + int *i; + XEvent *event; + Boolean *cont; +{ +#ifdef USE_LED + BoxInfo_t *currentBox; + currentBox = &boxInfo[*i]; + if (currentBox->led != -1) + if (currentBox->pid > 1) + if (!kill(currentBox->pid, SIGINT)) + { + waitpid(currentBox->pid, NULL, 0); + currentBox->pid = 0; + } +#endif + BreakPopup(w, *i, event, cont); +} void PopupHeader(w, i, event, cont) Widget w; @@ -581,7 +592,8 @@ void PopupHeader(w, i, event, cont) tmpCommand = XtCreateManagedWidget("popup", commandWidgetClass, header[i], args, nargs); - XtAddCallback(tmpCommand, XtNcallback, BreakPopup, (XtPointer) i); + XtAddEventHandler(tmpCommand, ButtonPressMask|KeyPressMask, True, + PopupEventHandler, &boxInfo[i].boxNum); #else dimension_text((char *) hdrPtr, &rows, &cols); XtSetArg(args[nargs], XmNvalue, hdrPtr); @@ -680,8 +692,6 @@ void ExecuteCommand(w, i, event, cont) waitpid(currentBox->pid, NULL, 0); currentBox->pid = 0; } - else - perror("Failing to kill led"); #endif if (currentBox->command != NULL) @@ -1364,7 +1374,6 @@ int main(argc, argv) char name[MAX_STRING]; Arg args[5]; int nargs; - int pid; #ifdef DEBUG char pause_string[10]; @@ -1654,8 +1663,11 @@ int main(argc, argv) if (setpriority(PRIO_PROCESS, 0, envPriority) == -1) perror("Priority change failed"); #endif +#ifndef USE_LED + /* the led program doesn't work initially if we are forking */ + /* put ourself in the background */ - switch (pid = fork()) + switch (fork()) { case 0: XtAppMainLoop(app); /* in child do the stuff */ @@ -1671,5 +1683,8 @@ int main(argc, argv) #else XtAppMainLoop(app); #endif +#else + XtAppMainLoop(app); +#endif return 0; } -- 1.6.5.7 debian/patches/0005-Add-a-nohighlight-option-to-avoid-highlighting.patch0000644000000000000000000002775411317441105023135 0ustar From 9948466fd89d4275ac9fba9d497e0d1adef7fec7 Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Sat, 19 Dec 2009 13:13:52 +0100 Subject: Add a nohighlight option to avoid highlighting --- XBuffy.ad | 1 + boxfile.c | 20 +++++++++++++++----- boxfile.fmt | 1 + xbuffy.c | 29 ++++++++++++++++++----------- xbuffy.h | 4 +++- xbuffy.man | 12 +++++++++++- 6 files changed, 49 insertions(+), 18 deletions(-) diff --git a/XBuffy.ad b/XBuffy.ad index 01b55b3..2f7f6e5 100644 --- a/XBuffy.ad +++ b/XBuffy.ad @@ -2,6 +2,7 @@ ! Application Defaults file for XBuffy ! XBuffy*nobeep: FALSE +XBuffy*nohighlight: FALSE XBuffy*horiz: FALSE XBuffy*names: FALSE XBuffy*shortnames: TRUE diff --git a/boxfile.c b/boxfile.c index f15811b..9f6f2df 100644 --- a/boxfile.c +++ b/boxfile.c @@ -25,9 +25,9 @@ extern ApplicationData_t data; -static char *tokens[20] = { +static char *tokens[21] = { "box", "title", "command", "audio", "mailbox", "newsbox", "origmode", - "newmode", "beep", "nobeep", "last", "headertime", "polltime", + "newmode", "beep", "nobeep", "highlight", "nohighlight", "last", "headertime", "polltime", "shortname", "longname", "background", "foreground", #ifdef USE_LED "led", @@ -38,7 +38,7 @@ static char *tokens[20] = { enum TokType { UNK_T = 0, BOX_T, TITLE_T, COMMAND_T, AUDIO_T, MAILBOX_T, NEWSBOX_T, - ORIGMODE_T, NEWMODE_T, BEEP_T, NOBEEP_T, LAST_T, HEADER_T, POLL_T, + ORIGMODE_T, NEWMODE_T, BEEP_T, NOBEEP_T, HIGHLIGHT_T, NOHIGHLIGHT_T, LAST_T, HEADER_T, POLL_T, SHORT_T, LONG_T, BG_T, FG_T #ifdef USE_LED , LED_T @@ -128,7 +128,7 @@ void clearBox(tempBox) tempBox->type = 0; tempBox->last = 0; - tempBox->headerTime = tempBox->nobeep = tempBox->origMode = 0; + tempBox->headerTime = tempBox->nobeep = tempBox->nohighlight = tempBox->origMode = 0; tempBox->pollTime = tempBox->headerTime = -1; #ifdef USE_LED tempBox->pid = 0; @@ -231,7 +231,7 @@ void dumpBox(tempBox) printf("audio = *%s*\n", showNull(tempBox.audioCmd)); printf("boxTitle = *%s*\n", showNull(tempBox.boxTitle)); printf("pollTime = %i headerTime = %i\n", tempBox.pollTime, tempBox.headerTime); - printf("nobeep = %i origMode = %i \n", tempBox.nobeep, tempBox.origMode); + printf("nobeep = %i nohighlight = %i origMode = %i \n", tempBox.nobeep, tmpBox.nohighlight, tempBox.origMode); printf("nametype = %i\n\n", tempBox.BoxNameType); } @@ -284,6 +284,7 @@ void readBoxfile(const char *boxFile) tempBox.boxTitle, tempBox.origMode, tempBox.nobeep, + tempBox.nohighlight, tempBox.bgName, tempBox.fgName # ifdef USE_LED @@ -340,6 +341,14 @@ void readBoxfile(const char *boxFile) tempBox.nobeep = TRUE; break; + case HIGHLIGHT_T: + tempBox.nohighlight = FALSE; + break; + + case NOHIGHLIGHT_T: + tempBox.nohighlight = TRUE; + break; + case LAST_T: tempBox.last = atoi(next); break; @@ -389,6 +398,7 @@ void readBoxfile(const char *boxFile) tempBox.boxTitle, tempBox.origMode, tempBox.nobeep, + tempBox.nohighlight, tempBox.bgName, tempBox.fgName # ifdef USE_LED diff --git a/boxfile.fmt b/boxfile.fmt index 55debed..6edd503 100644 --- a/boxfile.fmt +++ b/boxfile.fmt @@ -5,6 +5,7 @@ audio Somestring mailbox | newsbox origMode | newMode beep | nobeep +hightlight | nohighlight shortname | longname headertime 10 polltime 30 diff --git a/xbuffy.c b/xbuffy.c index b2dbbe4..03cf4e9 100644 --- a/xbuffy.c +++ b/xbuffy.c @@ -124,6 +124,8 @@ XtResource resources[] = { XtOffset(ApplicationData_t *, mailBoxes), XtRString, 0}, {"nobeep", "Nobeep", XtRBoolean, sizeof(int), XtOffset(ApplicationData_t *, nobeep), XtRString, "FALSE"}, + {"nohighlight", "Nohighlight", XtRBoolean, sizeof(int), + XtOffset(ApplicationData_t *, nohighlight), XtRString, "FALSE"}, {"horiz", "Horiz", XtRBoolean, sizeof(int), XtOffset(ApplicationData_t *, horiz), XtRString, "FALSE"}, {"command", "Command", XtRString, sizeof(String), @@ -161,6 +163,7 @@ XtResource resources[] = { XrmOptionDescRec options[] = { {"-nobeep", "*nobeep", XrmoptionNoArg, "TRUE"}, + {"-nohighlight", "*nohighlight", XrmoptionNoArg, "TRUE"}, {"-center", "*center", XrmoptionNoArg, "TRUE"}, {"-fill", "*fill", XrmoptionNoArg, "TRUE"}, {"-horiz", "*horiz", XrmoptionNoArg, "TRUE"}, @@ -244,7 +247,7 @@ void setBoxColor(box,status) int nargs; nargs = 0; - if (status) + if (status && ! box->nohighlight) { XtSetArg(args[nargs], XtNbackground, box->fg); nargs++; @@ -1007,10 +1010,10 @@ Pixel convertColor(colorname, defValue) #ifdef USE_LED void initBox(box, BoxType, pollTime, headerTime, BoxNameType, command, audioCmd, - title, origMode, nobeep, bgName, fgName, led) + title, origMode, nobeep, nohighlight, bgName, fgName, led) #else void initBox(box, BoxType, pollTime, headerTime, BoxNameType, command, audioCmd, - title, origMode, nobeep, bgName, fgName) + title, origMode, nobeep, nohighlight, bgName, fgName) #endif char *box; BoxType_t BoxType; @@ -1022,6 +1025,7 @@ void initBox(box, BoxType, pollTime, headerTime, BoxNameType, command, audioCmd, char *title; Boolean origMode; Boolean nobeep; + Boolean nohighlight; char *bgName; char *fgName; #ifdef USE_LED @@ -1049,7 +1053,7 @@ void initBox(box, BoxType, pollTime, headerTime, BoxNameType, command, audioCmd, fprintf(stderr, "audio = *%s*\n", audioCmd); fprintf(stderr, "boxTitle = *%s*\n", title); fprintf(stderr, "pollTime = %i headerTime = %i\n", pollTime, headerTime); - fprintf(stderr, "nobeep = %i origMode = %i \n", nobeep, origMode); + fprintf(stderr, "nobeep = %i nohighlight = %i origMode = %i \n", nobeep, nohighlight, origMode); fprintf(stderr, "nametype = %i\n\n", BoxNameType); #endif @@ -1124,6 +1128,7 @@ void initBox(box, BoxType, pollTime, headerTime, BoxNameType, command, audioCmd, tempBox.audioCmd = NEWstrdup(audioCmd); tempBox.origMode = origMode; tempBox.nobeep = nobeep; + tempBox.nohighlight = nohighlight; if (bgName != NULL) tempBox.bg = convertColor(bgName,data.bg); @@ -1178,10 +1183,10 @@ void ParseMailPath() { #ifdef USE_LED initBox(NEWstrdup(str), MAILBOX, envPolltime, envHeadertime, UNDEF, data.command, - data.audioCmd, NULL, data.origMode, data.nobeep,NULL,NULL,-1); + data.audioCmd, NULL, data.origMode, data.nobeep,data.nohighlight,NULL,NULL,-1); #else initBox(NEWstrdup(str), MAILBOX, envPolltime, envHeadertime, UNDEF, data.command, - data.audioCmd, NULL, data.origMode, data.nobeep,NULL,NULL); + data.audioCmd, NULL, data.origMode, data.nobeep,data.nohighlight,NULL,NULL); #endif str = (char *) strtok(NULL, ":, "); } @@ -1227,7 +1232,7 @@ void ParseNewsPath() while (str != NULL) { initBox(NEWstrdup(str), NNTPBOX, envPolltime, envHeadertime, UNDEF, - data.command, data.audioCmd, NULL, data.origMode, data.nobeep, + data.command, data.audioCmd, NULL, data.origMode, data.nobeep, data.nohighlight, NULL,NULL #ifdef USE_LED ,-1 @@ -1334,6 +1339,7 @@ void Usage() printf(" -boxfile filename containing names of mailboxes\n"); printf(" -horiz place the boxes horizontally; default: vertical\n"); printf(" -nobeep don't ring bell when mail is received\n"); + printf(" -nohighlight don't highlight box, if new messages are in it\n"); printf(" -names display full path of mail files in the boxes\n"); printf(" -shortnames display names of mail files in the boxes\n"); printf(" -center center the names of the boxes\n"); @@ -1479,10 +1485,10 @@ int main(argc, argv) { #ifdef USE_LED initBox(NEWstrdup(*argv), MAILBOX, envPolltime, envHeadertime, - UNDEF, data.command, data.audioCmd, NULL, data.origMode, data.nobeep,NULL,NULL,-1); + UNDEF, data.command, data.audioCmd, NULL, data.origMode, data.nobeep, data.nohighlight,NULL,NULL,-1); #else initBox(NEWstrdup(*argv), MAILBOX, envPolltime, envHeadertime, - UNDEF, data.command, data.audioCmd, NULL, data.origMode, data.nobeep,NULL,NULL); + UNDEF, data.command, data.audioCmd, NULL, data.origMode, data.nobeep, data.nohighlight,NULL,NULL); #endif } @@ -1492,10 +1498,10 @@ int main(argc, argv) { #ifdef USE_LED initBox(NEWstrdup(*argv), NNTPBOX, envPolltime, envHeadertime, - UNDEF, data.command, data.audioCmd, NULL, data.origMode, data.nobeep,NULL,NULL,-1); + UNDEF, data.command, data.audioCmd, NULL, data.origMode, data.nobeep, data.nohighlight,NULL,NULL,-1); #else initBox(NEWstrdup(*argv), NNTPBOX, envPolltime, envHeadertime, - UNDEF, data.command, data.audioCmd, NULL, data.origMode, data.nobeep,NULL,NULL); + UNDEF, data.command, data.audioCmd, NULL, data.origMode, data.nobeep, data.nohighlight,NULL,NULL); #endif } #endif /* USE_NNTP */ @@ -1648,6 +1654,7 @@ int main(argc, argv) fprintf(stderr, "headerTime = %i\n", boxInfo[i].headerTime); fprintf(stderr, "origMode = %i\n", boxInfo[i].origMode); fprintf(stderr, "nobeep = %i\n", boxInfo[i].nobeep); + fprintf(stderr, "nohighlight = %i\n", boxInfo[i].nohighlight); #ifdef USE_LED fprintf(stderr, "led = %i\n", boxInfo[i].led); #endif diff --git a/xbuffy.h b/xbuffy.h index 42a64df..2ec0fd1 100644 --- a/xbuffy.h +++ b/xbuffy.h @@ -79,6 +79,7 @@ struct BoxInfo_s{ int pollTime; int headerTime; int nobeep; + int nohighlight; int origMode; char *bgName, *fgName; /* these are only used in the boxfile function */ Pixel bg,fg; @@ -102,6 +103,7 @@ struct ApplicationData_s Boolean longNames; Boolean origMode; Boolean nobeep; + Boolean nohighlight; Boolean center; Boolean fill; char *pollTime; @@ -130,7 +132,7 @@ typedef struct ApplicationData_s ApplicationData_t; #ifdef USE_NNTP int CountNNTP(BoxInfo_t *newsBox, DynObject headerString, Boolean *beenTouched); #endif -void initBox(char *box, BoxType_t BoxType, int pollTime, int headerTime, BoxNameType_t BoxNameType, char *command, char *audioCmd, char *title, Boolean origMode, Boolean nobeep, char *bgName, char *fgName +void initBox(char *box, BoxType_t BoxType, int pollTime, int headerTime, BoxNameType_t BoxNameType, char *command, char *audioCmd, char *title, Boolean origMode, Boolean nobeep, Boolean nohighlight, char *bgName, char *fgName #ifdef USE_LED , int led #endif diff --git a/xbuffy.man b/xbuffy.man index ab88980..2219357 100644 --- a/xbuffy.man +++ b/xbuffy.man @@ -6,7 +6,7 @@ xbuffy \- yet another biff for the X Window System .B xbuffy [X toolkit options] [\-help] [\-version] [\-horiz] [\-poll \fIseconds\fR] [\-header \fIseconds\fR] -[\-acmd \fIsound file\fR] [\-nobeep] [\-names] [\-orig] +[\-acmd \fIsoundfile\fR] [\-nobeep] [\-nohighlight] [\-names] [\-orig] [\-priority \fIpriority\fR] [\-command \fIcommand\fR] [\-shortnames] [\-mail ] @@ -80,6 +80,9 @@ This will line up the boxes horizontally (default: vertical) This will disable the beep (or sound command) when new mail arrives .TP +.B \-nohighlight +This will disable the highlighting of the box in case of new mail. +.TP .B \-boxfile \fIfilename\fR The name of a file containing configuration information for the boxes. The boxfile is an alternative way of specifying what to watch. The boxfile also @@ -180,6 +183,13 @@ This will enable the beep (or sound) when new mail arrives in the specified mailbox to be counted. .TP +.B nohighlight +This will disable the highlighting of the box in case of new mail. +.TP +.B highlight +This will enable the highlighting of the box in case of new mail. This +is the default. +.TP .B shortname This will cause the specified box to be prefaced with the filename. .TP -- 1.6.5.7 debian/patches/0006-Indent-subject-lines-somewhat-for-a-better-xbuffy-ex.patch0000644000000000000000000000551711317441105024241 0ustar From 13c1011302120d9b2bcd578cbedf031c0e99d02b Mon Sep 17 00:00:00 2001 From: Albert Ting Date: Sat, 19 Dec 2009 13:14:53 +0100 Subject: Indent subject lines somewhat for a better xbuffy experience. (with some corrections by Joel Rosdahl ) --- xbuffy.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/xbuffy.c b/xbuffy.c index 03cf4e9..4ccc295 100644 --- a/xbuffy.c +++ b/xbuffy.c @@ -118,6 +118,7 @@ int NNTPinit = 0; int maxBoxSize = 0; FILE *NNTP_fIn, *NNTP_fOut; extern char **environ; +char subjectPrefix[] = " "; XtResource resources[] = { {"mailboxes", "Mailboxes", XtRString, sizeof(String), @@ -740,8 +741,7 @@ int CountMBoxMail(mailBox, headerString) if (fp == NULL) return 0; - From[0] = Subject[0] = '\0'; - + From[0] = '\0'; while (fgets(buffer, MAX_STRING - 2, fp) != 0) { @@ -778,7 +778,8 @@ int CountMBoxMail(mailBox, headerString) if (cmp_header(buffer, "Subject")) { - strcpy(Subject, buffer); + strcpy(Subject, subjectPrefix); + strcat(Subject, buffer); } if (cmp_header_get(buffer, "Status", &p)) @@ -803,7 +804,7 @@ int CountMBoxMail(mailBox, headerString) if (NEWstrlen(From) != 0) DynInsert(headerString, ((DynHigh(headerString) > 0) ? (DynSize(headerString)) : 0), From, NEWstrlen(From)); - if (NEWstrlen(Subject) != 0) + if (NEWstrlen(Subject) != sizeof(subjectPrefix)) DynInsert(headerString, ((DynHigh(headerString) > 0) ? (DynSize(headerString)) : 0), Subject, NEWstrlen(Subject)); } } @@ -862,7 +863,8 @@ int CountDirMail(mailBox, headerString) if (mailBox->type == MAILDIR) count++; if (headerString != NULL || mailBox->type == MHDIR) { /* Ok, we need to get the From: and Subject: lines */ - From[0] = Subject[0] = '\0'; + From[0] = '\0'; + strcpy(Subject, subjectPrefix); found = FALSE; status = NEW_MSG; if (mailBox->type == MAILDIR) { @@ -888,7 +890,7 @@ int CountDirMail(mailBox, headerString) else if (headerString != NULL && cmp_header(buffer, "Subject")) { - strcpy(Subject, buffer); + strcat(Subject, buffer); } else if (mailBox->type == MHDIR && cmp_header_get(buffer, "Status", &p)) @@ -907,7 +909,7 @@ int CountDirMail(mailBox, headerString) ((DynHigh(headerString) > 0) ? (DynSize(headerString)) : 0), From, strlen(From)); - if (strlen(Subject) != 0) + if (strlen(Subject) != sizeof(subjectPrefix)) DynInsert(headerString, ((DynHigh(headerString) > 0) ? (DynSize(headerString)) : 0), Subject, strlen(Subject)); -- 1.6.5.7 debian/patches/0007-Use-home-brl-.xbuffyrc-if-nothing-else-is-given.patch0000644000000000000000000000567511317441105023104 0ustar From dafbe2c4c8938e3ee327433311f460da490a9212 Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Sat, 19 Dec 2009 13:16:46 +0100 Subject: Use /home/brl/.xbuffyrc if nothing else is given --- boxfile.c | 4 +++- xbuffy.c | 9 +++++++++ xbuffy.man | 12 +++++++++--- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/boxfile.c b/boxfile.c index 9f6f2df..66214c4 100644 --- a/boxfile.c +++ b/boxfile.c @@ -16,6 +16,7 @@ *******************************************************************************/ +#include #include #include #include @@ -256,7 +257,8 @@ void readBoxfile(const char *boxFile) if ((boxes = fopen(boxFile, "r")) == 0) { - fprintf(stderr, "Could not open boxfile %s\n", boxFile); + if( boxFile == data.boxFile || errno != ENOENT ) + fprintf(stderr, "Could not open boxfile %s\n", boxFile); return; } diff --git a/xbuffy.c b/xbuffy.c index 4ccc295..7d94f53 100644 --- a/xbuffy.c +++ b/xbuffy.c @@ -1519,6 +1519,15 @@ int main(argc, argv) readBoxfile(data.boxFile); } + if ((data.boxFile == 0) && (nBoxes == 0)) + { + const char *homedir = getenv("HOME"); + char buffer[MAX_STRING]; + if (homedir != NULL) + snprintf(buffer,MAX_STRING,"%s/.xbuffyrc",homedir); + + readBoxfile(buffer); + } if (nBoxes == 0) { diff --git a/xbuffy.man b/xbuffy.man index 2219357..c68a146 100644 --- a/xbuffy.man +++ b/xbuffy.man @@ -109,6 +109,9 @@ on a box. .TP .B X Options Standard X windows options (e.g. \-fn, \-display, etc.) +.SH FILES +If nothing to look at is given at the command line, it will +try to open $HOME/.xbuffyrc .SH ENVIRONMENT The names and purpose of the some of the following environment variables were borrowed from Bash, the GNU Shell. @@ -118,10 +121,12 @@ This specifies the amount of seconds to wait in between polling for mail. .TP .B MAILPATH -This is a colon separated list of files to check for mail. +This is a colon separated list of files to check for mail, +if nothing to look at was given and no $HOME/.xbuffyrc exists. .TP .B NEWSPATH -This is a colon separated list of newsgroups to monitor. +This is a colon separated list of newsgroups to monitor, +if nothing to look at was given and no $HOME/.xbuffyrc exists. .TP .B NNTPSERVER This is the name of the NNTP server to use for news boxes. @@ -145,7 +150,8 @@ the end of file. Note that these options are NOT case sensitive. The following are settable on a per box basis by using the \fIboxfile\fR option (note that the boxfile may also be set in -the Xresources with the resource Xbuffy.boxfile: ). +the Xresources with the resource Xbuffy.boxfile: and +if nothing it given at the command line, it tries to read $HOME/.xbuffyrc). When using a \fIboxfile\fR, only the \fIbox\fR line is required. All options that are not given in the boxfile will default to the command line -- 1.6.5.7 debian/patches/0008-Changed-center-to-be-a-bit-more-like-the-description.patch0000644000000000000000000000233411317441105024010 0ustar From fc774088a91632258a569b43a19784be9666a153 Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Sat, 19 Dec 2009 13:17:25 +0100 Subject: Changed -center to be a bit more like the description --- xbuffy.c | 13 ++++++------- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/xbuffy.c b/xbuffy.c index 7d94f53..2ea3155 100644 --- a/xbuffy.c +++ b/xbuffy.c @@ -329,24 +329,23 @@ void UpdateBoxNumber(box) } memset(fmtString, ' ',MAX_STRING); - if (data.center) /* center implies fill */ { - offset = ((maxBoxSize+4) - NEWstrlen(amt))/2; + offset = ((maxBoxSize+6) - NEWstrlen(amt))/2; if (offset < 0) offset = 0; if (offset > MAX_STRING) offset = 0; ptr = fmtString+ offset; strcpy(ptr,amt); ptr = fmtString+NEWstrlen(fmtString); - *ptr = ' '; - *(ptr+offset+1-(offset%2))='\0'; + offset = maxBoxSize+6-NEWstrlen(fmtString); + while (offset-- >0) + *ptr++ = ' '; + *ptr = '\0'; } else if (data.fill) { - - - offset = maxBoxSize+4-NEWstrlen(amt); + offset = maxBoxSize+6-NEWstrlen(amt); if (offset < 0) offset = 0; strcpy(fmtString,amt); ptr = fmtString+NEWstrlen(fmtString); -- 1.6.5.7 debian/patches/0009-Correct-nohighlight-and-nobeep-options.patch0000644000000000000000000000327511317441105021632 0ustar From c3efd5673c9ee8fbaf407501149713f3551e690a Mon Sep 17 00:00:00 2001 From: Albert Ting Date: Sat, 19 Dec 2009 13:18:39 +0100 Subject: Correct nohighlight and nobeep options (with some corrections by Joel Rosdahl ) --- boxfile.c | 4 ++-- xbuffy.c | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/boxfile.c b/boxfile.c index 66214c4..4ff5a26 100644 --- a/boxfile.c +++ b/boxfile.c @@ -129,13 +129,13 @@ void clearBox(tempBox) tempBox->type = 0; tempBox->last = 0; - tempBox->headerTime = tempBox->nobeep = tempBox->nohighlight = tempBox->origMode = 0; + tempBox->headerTime = tempBox->origMode = 0; tempBox->pollTime = tempBox->headerTime = -1; #ifdef USE_LED tempBox->pid = 0; tempBox->led = -1; #endif - tempBox->BoxNameType = UNDEF; + tempBox->BoxNameType = tempBox->nobeep = tempBox->nohighlight = UNDEF; } diff --git a/xbuffy.c b/xbuffy.c index 2ea3155..8b829c5 100644 --- a/xbuffy.c +++ b/xbuffy.c @@ -364,7 +364,7 @@ void UpdateBoxNumber(box) if (!box->origMode) { - if (box->n > 0) + if (box->n > 0 && !box->nohighlight) { setBoxColor(box,1); } @@ -1129,7 +1129,15 @@ void initBox(box, BoxType, pollTime, headerTime, BoxNameType, command, audioCmd, tempBox.audioCmd = NEWstrdup(audioCmd); tempBox.origMode = origMode; tempBox.nobeep = nobeep; + if (tempBox.nobeep == UNDEF) + { + tempBox.nobeep = data.nobeep; + } tempBox.nohighlight = nohighlight; + if (tempBox.nohighlight == UNDEF) + { + tempBox.nohighlight = data.nohighlight; + } if (bgName != NULL) tempBox.bg = convertColor(bgName,data.bg); -- 1.6.5.7 debian/patches/0010-check-boxes-more-often.patch0000644000000000000000000000374511317441105016466 0ustar From 0b491bb2471d652e7cdfb6ad7a0bec42bf98dda2 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sat, 19 Dec 2009 13:20:13 +0100 Subject: check boxes more often taken from 01_original.dpatch by Joel Rosdahl --- xbuffy.c | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/xbuffy.c b/xbuffy.c index 8b829c5..f8d6efb 100644 --- a/xbuffy.c +++ b/xbuffy.c @@ -71,6 +71,7 @@ #ifdef USE_LED #include +#include #endif #include "xbuffy.xbm" @@ -188,6 +189,13 @@ void CheckBox(i) BoxInfo_t *currentBox; Boolean beenTouched; Boolean isIcon = FALSE; + Boolean isTimedPoll = TRUE; + + if (i < 0) + { + i = -1 - i; + isTimedPoll = FALSE; + } currentBox = &boxInfo[i]; @@ -207,8 +215,8 @@ void CheckBox(i) XtSetArg(args[nargs], XtNiconic, &isIcon); - if ((num > currentBox->n) || - ((!currentBox->origMode) && ((num != currentBox->n) || (beenTouched)))) + if (isTimedPoll && ((num > currentBox->n) || + ((!currentBox->origMode) && ((num != currentBox->n) || (beenTouched))))) { if ((currentBox->headerTime != 0) && (!isIcon) && (num > 0)) @@ -235,8 +243,10 @@ void CheckBox(i) UpdateBoxNumber(currentBox); } - - XtAppAddTimeOut(app, (currentBox->pollTime * 1000), CheckBox, (XtPointer) i); + if (isTimedPoll) + { + XtAppAddTimeOut(app, (currentBox->pollTime * 1000), CheckBox, (XtPointer) i); + } } @@ -427,6 +437,7 @@ void ButtonDownHandler(w, i, event, cont) { if (event->xbutton.button == 1) { + CheckBox(-1 - *i); PopupHeader(w, *i, event, cont); } /* don't do anything else for other button clicks */ @@ -447,6 +458,7 @@ void ButtonUpHandler(w, i, event, cont) else if (event->xbutton.button == 2) { ExecuteCommand(w, *i, event, cont); + CheckBox(-1 - *i); } else if (event->xbutton.button == 3) { -- 1.6.5.7 debian/patches/0011-Add-a-checkfile-mailbox-type-that-just-prints-the-si.patch0000644000000000000000000001144311317441105024073 0ustar From cc7504776f3f7ba58001fd2f47fa17a913849148 Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Sat, 19 Dec 2009 13:21:42 +0100 Subject: Add a 'checkfile' mailbox-type that just prints the size of a file --- boxfile.c | 10 +++++++--- xbuffy.c | 32 ++++++++++++++++++++++++++++++-- xbuffy.h | 1 + xbuffy.man | 4 ++++ 4 files changed, 42 insertions(+), 5 deletions(-) diff --git a/boxfile.c b/boxfile.c index 4ff5a26..cb8dfdb 100644 --- a/boxfile.c +++ b/boxfile.c @@ -26,8 +26,8 @@ extern ApplicationData_t data; -static char *tokens[21] = { - "box", "title", "command", "audio", "mailbox", "newsbox", "origmode", +static char *tokens[22] = { + "box", "title", "command", "audio", "mailbox", "newsbox", "checkfile", "origmode", "newmode", "beep", "nobeep", "highlight", "nohighlight", "last", "headertime", "polltime", "shortname", "longname", "background", "foreground", #ifdef USE_LED @@ -38,7 +38,7 @@ static char *tokens[21] = { enum TokType { - UNK_T = 0, BOX_T, TITLE_T, COMMAND_T, AUDIO_T, MAILBOX_T, NEWSBOX_T, + UNK_T = 0, BOX_T, TITLE_T, COMMAND_T, AUDIO_T, MAILBOX_T, NEWSBOX_T, CHECKFILE_T, ORIGMODE_T, NEWMODE_T, BEEP_T, NOBEEP_T, HIGHLIGHT_T, NOHIGHLIGHT_T, LAST_T, HEADER_T, POLL_T, SHORT_T, LONG_T, BG_T, FG_T #ifdef USE_LED @@ -327,6 +327,10 @@ void readBoxfile(const char *boxFile) tempBox.type = NNTPBOX; break; + case CHECKFILE_T: + tempBox.type = CHECKFILE; + break; + case ORIGMODE_T: tempBox.origMode = TRUE; break; diff --git a/xbuffy.c b/xbuffy.c index f8d6efb..8dabeaf 100644 --- a/xbuffy.c +++ b/xbuffy.c @@ -84,7 +84,8 @@ void CheckBox(); void TimerBreakPopup(); -int CountUnixMail(); +int CountUnixMail(BoxInfo_t *mailBox, DynObject headerString, Boolean *beenTouched); +int CountFilesizeMail(BoxInfo_t *mailBox, DynObject headerString, Boolean *beenTouched); void ParseMailPath(); int makeBoxTitle(); Pixel convertColor(); @@ -210,6 +211,10 @@ void CheckBox(i) { num = CountUnixMail(currentBox, NULL, &beenTouched); } + else if (boxInfo[i].type == CHECKFILE) + { + num = CountFilesizeMail(currentBox, NULL, &beenTouched); + } nargs = 0; XtSetArg(args[nargs], XtNiconic, &isIcon); @@ -527,6 +532,9 @@ void PopupHeader(w, i, event, cont) currentBox = &boxInfo[i]; + if( currentBox->type == CHECKFILE) + return; + if (rootH == 0) { rootH = DisplayHeight(XtDisplay(w), DefaultScreen(XtDisplay(w))); @@ -937,6 +945,19 @@ int CountDirMail(mailBox, headerString) return count; } +int CountFilesizeMail(mailBox, headerString, beenTouched) + BoxInfo_t *mailBox; + DynObject headerString; + Boolean *beenTouched; +{ + struct stat s; + + if (stat(mailBox->box,&s) != 0) + return 0; + + return (s.st_size+1023) >> 10; +} + int CountUnixMail(mailBox, headerString, beenTouched) BoxInfo_t *mailBox; DynObject headerString; @@ -987,6 +1008,7 @@ int CountUnixMail(mailBox, headerString, beenTouched) count = CountDirMail(mailBox, headerString); break; case NNTPBOX: + case CHECKFILE: return(0); } @@ -1082,6 +1104,9 @@ void initBox(box, BoxType, pollTime, headerTime, BoxNameType, command, audioCmd, DynParanoid(tempBox.articles, 1);*/ #endif + } else if (BoxType == CHECKFILE) + { + tempBox.type = CHECKFILE; } else if (BoxType == MAILBOX) { struct stat st; @@ -1302,7 +1327,7 @@ int makeBoxTitle(currentBox) line[0] = '\0'; if ((currentBox->type == MAILBOX) || (currentBox->type == MAILDIR) || - (currentBox->type == MHDIR)) + (currentBox->type == MHDIR) || (currentBox->type == CHECKFILE)) { switch (currentBox->BoxNameType) { @@ -1627,6 +1652,9 @@ int main(argc, argv) (boxInfo[i].type == MHDIR)) boxInfo[i].n = CountUnixMail(&boxInfo[i], NULL, &dummy); + if (boxInfo[i].type == CHECKFILE) + boxInfo[i].n = CountFilesizeMail(&boxInfo[i], NULL, &dummy); + #ifdef USE_NNTP if (boxInfo[i].type == NNTPBOX) boxInfo[i].n = CountNNTP(&boxInfo[i], NULL, &dummy); diff --git a/xbuffy.h b/xbuffy.h index 2ec0fd1..16feffb 100644 --- a/xbuffy.h +++ b/xbuffy.h @@ -44,6 +44,7 @@ enum BoxType_e { MAILDIR, MHDIR, NNTPBOX, + CHECKFILE, }; typedef enum BoxType_e BoxType_t; diff --git a/xbuffy.man b/xbuffy.man index c68a146..0f81187 100644 --- a/xbuffy.man +++ b/xbuffy.man @@ -172,6 +172,10 @@ newsbox is specified, mailbox is the default. .B newsbox Specify that the box is a newsbox (a NNTP newsgroup). .TP +.B checkfile +Specify to show the kilobytes of the given file. (Useful for watching +for mail in other accounts than the one running xbuffy.) +.TP .B origMode origMode will make Xbuffy try to act like Xmultibiff and count ALL messages instead of just NEW message. -- 1.6.5.7 debian/patches/0012-Add-a-silent-command-line-option-to-suppress-all-aud.patch0000644000000000000000000000622411317441105024107 0ustar From 3871ee1fc8a4f7a0b299ed9dbf8792a4ba6ca49f Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Sat, 19 Dec 2009 13:22:08 +0100 Subject: Add a -silent command line option to suppress all audio --- xbuffy.c | 6 +++++- xbuffy.h | 1 + xbuffy.man | 8 +++++--- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/xbuffy.c b/xbuffy.c index 8dabeaf..aceee69 100644 --- a/xbuffy.c +++ b/xbuffy.c @@ -125,6 +125,8 @@ char subjectPrefix[] = " "; XtResource resources[] = { {"mailboxes", "Mailboxes", XtRString, sizeof(String), XtOffset(ApplicationData_t *, mailBoxes), XtRString, 0}, + {"silent", "Silent", XtRBoolean, sizeof(int), + XtOffset(ApplicationData_t *, silent), XtRString, "FALSE"}, {"nobeep", "Nobeep", XtRBoolean, sizeof(int), XtOffset(ApplicationData_t *, nobeep), XtRString, "FALSE"}, {"nohighlight", "Nohighlight", XtRBoolean, sizeof(int), @@ -165,6 +167,7 @@ XtResource resources[] = { }; XrmOptionDescRec options[] = { + {"-silent", "*silent", XrmoptionNoArg, "TRUE"}, {"-nobeep", "*nobeep", XrmoptionNoArg, "TRUE"}, {"-nohighlight", "*nohighlight", XrmoptionNoArg, "TRUE"}, {"-center", "*center", XrmoptionNoArg, "TRUE"}, @@ -229,7 +232,7 @@ void CheckBox(i) PopupHeader(currentBox->w, currentBox->boxNum, 0, 0); } - if ((!currentBox->nobeep) && (num > 0)) + if ((!currentBox->nobeep) && (num > 0) && !data.silent ) { if (currentBox->audioCmd != NULL) { @@ -1378,6 +1381,7 @@ void Usage() printf("Options are:\n"); printf(" -help print this message\n"); printf(" -version print the version number\n"); + printf(" -silent Do not beep or play audio-commands\n"); printf(" -poll how often to poll the file(s); default: 60\n"); printf(" -header popup header when mail is received\n"); printf(" (use '0' for mouse press only)\n"); diff --git a/xbuffy.h b/xbuffy.h index 16feffb..2c02a1c 100644 --- a/xbuffy.h +++ b/xbuffy.h @@ -114,6 +114,7 @@ struct ApplicationData_s char *boxFile; char *priority; Pixel bg, fg; + Boolean silent; }; typedef struct ApplicationData_s ApplicationData_t; diff --git a/xbuffy.man b/xbuffy.man index 0f81187..e72053c 100644 --- a/xbuffy.man +++ b/xbuffy.man @@ -4,7 +4,7 @@ xbuffy \- yet another biff for the X Window System .SH SYNOPSIS .B xbuffy -[X toolkit options] [\-help] [\-version] [\-horiz] +[X toolkit options] [\-help] [\-version] [\-horiz] [\-silent] [\-poll \fIseconds\fR] [\-header \fIseconds\fR] [\-acmd \fIsoundfile\fR] [\-nobeep] [\-nohighlight] [\-names] [\-orig] [\-priority \fIpriority\fR] @@ -77,8 +77,10 @@ be used to automatically open a mail reader when new mail arrives. This will line up the boxes horizontally (default: vertical) .TP .B \-nobeep -This will disable the beep (or sound command) when new -mail arrives +This will disable the beep when new mail arrives +.TP +.B \-silent +Ignore all beep or audio commands. (i.e. be silent) .TP .B \-nohighlight This will disable the highlighting of the box in case of new mail. -- 1.6.5.7 debian/patches/0013-Retry-autodetection-when-mailbox-is-not-statable.patch0000644000000000000000000001126011317441105023562 0ustar From be160c738f46039c793d2674118903e0d3aa797f Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Sat, 19 Dec 2009 13:23:35 +0100 Subject: Retry autodetection when mailbox is not statable See http://bugs.debian.org/168910 --- xbuffy.c | 72 ++++++++++++++++++++++++++++++++++++------------------------- xbuffy.h | 1 + 2 files changed, 43 insertions(+), 30 deletions(-) diff --git a/xbuffy.c b/xbuffy.c index aceee69..e80c3ef 100644 --- a/xbuffy.c +++ b/xbuffy.c @@ -210,7 +210,7 @@ void CheckBox(i) } #endif /* USE_NNTP */ if ((boxInfo[i].type == MAILBOX) || (boxInfo[i].type == MAILDIR) || - (boxInfo[i].type == MHDIR)) + (boxInfo[i].type == MHDIR) || (boxInfo[i].type == UNKNOWNMBOX)) { num = CountUnixMail(currentBox, NULL, &beenTouched); } @@ -570,7 +570,7 @@ void PopupHeader(w, i, event, cont) /* update the number on the box (in case there are new articles) */ if ((currentBox->type == MAILBOX) || (currentBox->type == MAILDIR) || - (currentBox->type == MHDIR)) + (currentBox->type == MHDIR) || (currentBox->type == UNKNOWNMBOX)) { number = CountUnixMail(currentBox, mailHeaders, &beenTouched); @@ -584,7 +584,7 @@ void PopupHeader(w, i, event, cont) UpdateBoxNumber(&boxInfo[i]); /* if the number is zero, there's no header, so leave */ - if (boxInfo[i].n == 0) + if (boxInfo[i].n <= 0) { return; } @@ -699,6 +699,34 @@ void BreakPopup(w, i, event, cont) headerUp[i] = FALSE; } +void determineMBoxType(BoxInfo_t *b) +{ + struct stat st; + char tmp[_POSIX_PATH_MAX]; + + if (stat (b->box, &st) != -1) { + if (S_ISDIR (st.st_mode)) { + /* check for maildir mailb->box */ + sprintf(tmp, "%s/cur", b->box); + if (stat (tmp, &st) == 0 && S_ISDIR (st.st_mode)) { + b->type = MAILDIR; + } else { + /* check for mh mailb->box */ + sprintf(tmp, "%s/.mh_sequences", b->box); + if (access (tmp, F_OK) == 0) { + b->type = MHDIR; + } else { + sprintf(tmp, "%s/.xmhcache", b->box); + if (access (tmp, F_OK) == 0) { + b->type = MHDIR; + } + } + } + } else + b->type = MAILBOX; + } else + b->type = UNKNOWNMBOX; +} void ExecuteCommand(w, i, event, cont) Widget w; @@ -973,6 +1001,12 @@ int CountUnixMail(mailBox, headerString, beenTouched) *beenTouched = FALSE; + if (mailBox->type == UNKNOWNMBOX) { + determineMBoxType(mailBox); + if (mailBox->type == UNKNOWNMBOX) + return -1; + } + if (mailBox->type == MAILBOX) { if (isLocked(mailBox->box)) return (mailBox->n); @@ -1010,8 +1044,7 @@ int CountUnixMail(mailBox, headerString, beenTouched) case MHDIR: count = CountDirMail(mailBox, headerString); break; - case NNTPBOX: - case CHECKFILE: + default: return(0); } @@ -1112,29 +1145,7 @@ void initBox(box, BoxType, pollTime, headerTime, BoxNameType, command, audioCmd, tempBox.type = CHECKFILE; } else if (BoxType == MAILBOX) { - struct stat st; - char tmp[_POSIX_PATH_MAX]; - - if (stat (box, &st) != -1) { - if (S_ISDIR (st.st_mode)) { - /* check for maildir mailbox */ - sprintf(tmp, "%s/cur", box); - if (stat (tmp, &st) == 0 && S_ISDIR (st.st_mode)) { - tempBox.type = MAILDIR; - } else { - /* check for mh mailbox */ - sprintf(tmp, "%s/.mh_sequences", box); - if (access (tmp, F_OK) == 0) { - tempBox.type = MHDIR; - } else { - sprintf(tmp, "%s/.xmhcache", box); - if (access (tmp, F_OK) == 0) { - tempBox.type = MHDIR; - } - } - } - } - } + determineMBoxType(&tempBox); } if ((pollTime <= 0) || (pollTime >= 3600)) tempBox.pollTime = envPolltime; @@ -1330,7 +1341,8 @@ int makeBoxTitle(currentBox) line[0] = '\0'; if ((currentBox->type == MAILBOX) || (currentBox->type == MAILDIR) || - (currentBox->type == MHDIR) || (currentBox->type == CHECKFILE)) + (currentBox->type == MHDIR) || (currentBox->type == CHECKFILE) || + (currentBox->type == UNKNOWN)) { switch (currentBox->BoxNameType) { @@ -1653,7 +1665,7 @@ int main(argc, argv) headerUp[i] = FALSE; if ((boxInfo[i].type == MAILBOX) || (boxInfo[i].type == MAILDIR) || - (boxInfo[i].type == MHDIR)) + (boxInfo[i].type == MHDIR) || (boxInfo[i].type == UNKNOWNMBOX)) boxInfo[i].n = CountUnixMail(&boxInfo[i], NULL, &dummy); if (boxInfo[i].type == CHECKFILE) diff --git a/xbuffy.h b/xbuffy.h index 2c02a1c..e713364 100644 --- a/xbuffy.h +++ b/xbuffy.h @@ -45,6 +45,7 @@ enum BoxType_e { MHDIR, NNTPBOX, CHECKFILE, + UNKNOWNMBOX, }; typedef enum BoxType_e BoxType_t; -- 1.6.5.7 debian/patches/series0000644000000000000000000000131711317441105012031 0ustar 0001-Bring-build-system-to-proper-state.patch 0002-Add-header-parsing-code-to-replace-the-non-free-one-.patch 0003-Some-small-tidy-ups.patch 0004-led-related-patches.patch 0005-Add-a-nohighlight-option-to-avoid-highlighting.patch 0006-Indent-subject-lines-somewhat-for-a-better-xbuffy-ex.patch 0007-Use-home-brl-.xbuffyrc-if-nothing-else-is-given.patch 0008-Changed-center-to-be-a-bit-more-like-the-description.patch 0009-Correct-nohighlight-and-nobeep-options.patch 0010-check-boxes-more-often.patch 0011-Add-a-checkfile-mailbox-type-that-just-prints-the-si.patch 0012-Add-a-silent-command-line-option-to-suppress-all-aud.patch 0013-Retry-autodetection-when-mailbox-is-not-statable.patch 0014-fix-manpage-errors.patch debian/patches/0014-fix-manpage-errors.patch0000644000000000000000000000105011317441105015717 0ustar From 083b3908fb26ad5b698e369337a92022133eb80e Mon Sep 17 00:00:00 2001 From: Bernhard R. Link Date: Sat, 19 Dec 2009 13:24:36 +0100 Subject: fix manpage errors - remove '.uc' from mancase as it is causing make errors --- xbuffy.man | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/xbuffy.man b/xbuffy.man index e72053c..d0f590d 100644 --- a/xbuffy.man +++ b/xbuffy.man @@ -1,5 +1,4 @@ .TH XBUFFY 1 01/31/95 -.uc 4.2 .SH NAME xbuffy \- yet another biff for the X Window System .SH SYNOPSIS -- 1.6.5.7 debian/rules0000755000000000000000000000361611317441104010250 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) ifeq ($(DEB_HOST_ARCH_OS), linux) led = --enable-led else led = endif DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif ifneq (,$(filter parallel=%,$(BUILDOPTS))) MAKEFLAGS += -j$(patsubst parallel=%,%,$(filter parallel=%,$(BUILDOPTS))) endif config.status: configure.in Makefile.in dh_testdir autoheader autoconf ./configure --prefix=/usr --sysconfdir=/etc --enable-nntp $(led) \ --mandir=/usr/share/man \ --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \ --x-includes="" --x-libraries="" \ CFLAGS="$(CFLAGS)" CPPFLAGS="" LDFLAGS="-Wl,-z,defs" \ || ( echo configure failed with $$? ; echo BEGIN config.log: ; \ cat config.log ; echo "END config.log" ; exit 1 ) build: build-arch-stamp build-arch: build-arch-stamp build-indep: build-arch-stamp: config.status dh_testdir $(MAKE) touch build-arch-stamp clean: dh_testdir dh_testroot -rm -f build-arch-stamp if [ -e config.status ] ; then $(MAKE) distclean ; fi test ! -e config.status test ! -e Makefile if [ -e config.h.in ] ; then rm configure config.h.in ; fi test ! -e configure test ! -e config.h.in dh_clean binary-indep: # We have nothing to do. binary-arch: build-arch-stamp dh_testdir dh_testroot dh_clean -k dh_installdirs $(MAKE) install DESTDIR=$(CURDIR)/debian/xbuffy dh_install dh_installdocs dh_installexamples dh_installmenu dh_installchangelogs CHANGES dh_installman dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build build-arch build-indep clean binary-indep binary-arch binary clean debian/source/0000755000000000000000000000000011317441104010462 5ustar debian/source/format0000644000000000000000000000001411317441104011670 0ustar 3.0 (quilt) debian/watch0000644000000000000000000000015611317441104010215 0ustar version=3 opts=dversionmangle=s/\.dfsg$// http://www.fiction.net/blong/programs/ xbuffy/xbuffy-(.*)\.tar\.gz debian/xbuffy16.xpm0000644000000000000000000000071011317441104011360 0ustar /* XPM */ static char *xbuffy16[] = { /* columns rows colors chars-per-pixel */ "16 16 2 1", " c gray100", ". c black", /* pixels */ "................", ".. . .", ". . . .", ". . . .", ".. . . .", ". . ..", ". . . . .", ".. . . ... .", ". . . ......", ". . . ... .", ". . . .", ".. . .", ". . ..", ". . . .", ". . . .", "................" }; debian/xbuffy32.xpm0000644000000000000000000000241011317441104011355 0ustar /* XPM */ static char *xbuffy32[] = { /* columns rows colors chars-per-pixel */ "32 32 2 1", " c gray100", ". c black", /* pixels */ "................................", ". .", ". .. .. ... . . ... ... . . .", ". ..... . . . . . . . . .", ". ... ... . . .. .. . .", ". ..... . . . . . . . .", ". .. .. ... .... . . . .", ". .", "................................", "........... ......... ... .", ".......... ....... . .", ". . . . . ..... .", ".. . . . ... . .", "....... .. . .", "...... .. . . . .", "..... . .. . . . .", ". . . ... . . .", ". . . . .. . . ..", ". . . . . .. . ...", ". . . . . ... ....", ". . . . .. .....", ". . . . . . ........", ". .. . . . ... ..... .", ". . . . . ..... ... .", ". . . . . ... .. .", ". . . . . . . .", ". . . . . ... .", ". . .. . . . ... .", ". . . . ... ....", ". . .... . . .... ...", ". . . . ..... ..", "................................" }; debian/xbuffy64.xpm0000644000000000000000000001061011317441104011363 0ustar /* XPM */ static char *xbuffy64[] = { /* columns rows colors chars-per-pixel */ "64 64 2 1", " c gray100", ". c black", /* pixels */ "................................................................", ". ..", ". ...", ". ....", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . .....", ". . . . . ....", ". . .. .. ..... .. .. ..... ..... .. .. .. .....", ". . . ... .. .. .. .. .. .. .. .. .. ... ....", ". . .. ..... .. .. .... .... .. .. .....", ". . . .. ... .. .. .. .. .. .. .. ... ....", ". . .. .. ..... ...... .. .. .. .. .....", ". . . ... ....", ". . ................................................... .....", ". . ................. ......... ... ............. ....", ". . ............... ....... . ........... .....", ". . . . . . . . . . ..... . . . . . . ....", ". . . . . . . . . ... . ... . . . . .....", ". ................ .. . ..................", ". ................ .. . . . ...................", "................. . .. . . . ....................", ". . . ... . . ..... .", ". . . . .. . . ..... .", ". . . . . .. . ..... .", ". . . . . ... ..... .", ". . . . .. ..... .", ". . . . . . ....... .", ". . . . . ... ..... .", ". . . . ..... ... .", ". . . . ... .. .", ". . . . . . .", ". . . . ... . .", ". . . . ... . . .", ". . . ... ... . . .", ". . . .... ... . . .", ". . . ..... . . .. . .", ". . . . ... . . .... . .", ". . . . . . ... . .", ". ..................... .. . . . . . .", ". . . . .. . . . .", ". . ... .. .. . ... .", ". . ... . . . . ..... .", ". . .... . . . . . ....... .", ". . . . . . . . ..........", ". . ........ . . . . . . . ......... .", ". . . . . . . . ......... .", ". . ..... .... .. . . . . . . ......... .", ". . ... . . . . . ......... .", ". . ........... .... . . . . ......... .", ". . ... . .. . ......... .", ". ....................... . .... . ......... .", ". ...... . . . . . .... . ...... ......... .", ". ....... . . . . ..... ........ ......... .", ". . .. ..... . ......... .", ". . .. ... . ......... .", ". . .. . ......... .", ". . . . . .. ....... .", ". . . . . .. ..... .", ". . . . . .. ... .", ". . . . . .. . .", ". . . . .. .", ". . . . .. .", ". . . .. .", "................................................................" };