[Midnightbsd-cvs] mports: mports/mail: Add faces.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri May 30 23:02:14 EDT 2008


Log Message:
-----------
Add faces.

Modified Files:
--------------
    mports/mail:
        Makefile (r1.41 -> r1.42)

Added Files:
-----------
    mports/mail/faces:
        Makefile (r1.1)
        distinfo (r1.1)
        pkg-descr (r1.1)
        pkg-message (r1.1)
        pkg-plist (r1.1)
    mports/mail/faces/files:
        Makefile.compface (r1.1)
        ikon2xbm (r1.1)
        patch-ba (r1.1)
        patch-ca (r1.1)
        patch-cb (r1.1)
        patch-cc (r1.1)
        patch-cd (r1.1)
        patch-ce (r1.1)
        patch-cf (r1.1)
        patch-ch (r1.1)
        patch-ci (r1.1)
        patch-cj (r1.1)
        patch-ck (r1.1)
        xbm2ikon (r1.1)
        xbmcut48 (r1.1)
        xbmsize48 (r1.1)

-------------- next part --------------
--- /dev/null
+++ mail/faces/pkg-message
@@ -0,0 +1,26 @@
+**************************************************
+NOTE:
+
+For generating faces out of xbm files you must use
+the following helper filters:
+
+    xbm2ikon
+
+and perhaps
+
+    xbmsize48 or xbmcut48
+
+e.g.
+
+    1) generate a 48x48x1 xbm file
+    2) cat <file.xbm> | xbm2ikon > file.ikon
+    3) compface file.ikon > file.face
+
+And the other way arround to display a face
+
+Note uncompface -X is the same as
+
+   uncompface | ikon2xbm
+
+useful for exmh!
+**************************************************
--- /dev/null
+++ mail/faces/pkg-descr
@@ -0,0 +1,15 @@
+Faces is a Gtk+ program for monitoring a list visually. Typically this is
+a list of incoming mail messages. IMAP and POP mailbox formats are
+supported.
+
+Faces has three different modes of operation:
+* The default will monitor for new mail.
+* You can monitor the whole of a mail file.
+* Custom monitoring. You can specify a program or shell script to run.
+
+Lots of good examples can be downloaded from:
+ftp://ftp.cs.indiana.edu/pub/faces/picons/src/
+
+Audio capabilities are also provided as a conditional compilation option.
+
+WWW: http://faces.sourceforge.net/
--- /dev/null
+++ mail/faces/pkg-plist
@@ -0,0 +1,12 @@
+%%X11%%bin/faces
+bin/compface
+bin/uncompface
+bin/ikon2xbm
+bin/xbm2ikon
+bin/xbmcut48
+bin/xbmsize48
+include/compface.h
+lib/libcompface.a
+lib/libcompface.so
+lib/libcompface.so.1
+%%X11%%lib/X11/app-defaults/Faces
--- /dev/null
+++ mail/faces/Makefile
@@ -0,0 +1,116 @@
+# New ports collection makefile for:	faces-1.6.1
+# Date created:		09 December 96
+# Whom:			Lars Koeller <Lars_Koeller at odie.physik2.uni-rostock.de>
+#			Andreas Klemm <andreas at FreeBSD.org>
+#
+# $MidnightBSD: mports/mail/faces/Makefile,v 1.1 2008/05/31 03:02:12 laffer1 Exp $
+# $FreeBSD: ports/mail/faces/Makefile,v 1.40 2008/03/30 09:36:45 dinoex Exp $
+#
+
+PORTNAME=	faces
+PORTVERSION=	1.7.7
+PORTREVISION=	0
+CATEGORIES=	mail
+MASTER_SITES=	SF
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	Visual mail, user and print face server
+LICENSE=	gpl2
+
+OPTIONS=	X11 "X11/GTK support" on	\
+		NAS "NAS audio support" off	\
+		RPLAY "rplay audio support" off	\
+		SOX "Sox audio support" off
+
+WANT_GNOME=	yes
+USE_LDCONFIG=	yes
+
+MAN1=		compface.1
+MAN3=		compface.3
+MLINKS=		compface.1 uncompface.1 \
+		compface.3 uncompface.3
+PORTDOCS=	README
+
+.include <bsd.port.pre.mk>
+
+.if defined(WITHOUT_X11)
+PLIST_SUB+=	X11="@comment "
+WITH_AUDIO=	# none
+.else # with X11
+PLIST_SUB+=	X11=""
+USE_GNOME=	gnomehack gtk12
+GNU_CONFIGURE=	yes
+CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd6.0
+CONFIGURE_ENV=	CPPFLAGS="-I../compface -I${LOCALBASE}/include" \
+		LDFLAGS="-L../compface -L${LOCALBASE}/lib"
+CONFIGURE_ARGS=	--enable-imap --enable-pop \
+		--enable-name-unknown --with-spooldir=/var/mail \
+		--with-facedir=${DATADIR}
+MAN1+=		faces.1
+.endif
+
+.if defined(WITHOUT_NLS)
+CONFIGURE_ARGS+=--disable-nls
+.endif
+
+.ifdef WITH_NAS
+ CONFIGURE_ARGS+=	--enable-audio --with-audio-cmd=${LOCALBASE}/bin/auplay
+ RUN_DEPENDS=	auplay:${PORTSDIR}/audio/nas
+.elifdef WITH_SOX
+ CONFIGURE_ARGS+=	--enable-audio --with-audio-cmd=${LOCALBASE}/bin/play
+ RUN_DEPENDS=	play:${PORTSDIR}/audio/sox
+.elifdef WITH_RPLAY
+ CONFIGURE_ARGS+=	--enable-audio --with-audio-cmd=${LOCALBASE}/bin/rplay
+ RUN_DEPENDS=	rplay:${PORTSDIR}/audio/rplay
+.endif
+
+# I have no better idea up to now
+# Install the working Makefile for compface from the old faces port
+# This was much less complex an builds the shared libs, too
+post-patch:
+	@${REINPLACE_CMD} -e "s%/usr/local/faces%${DATADIR}%g ; \
+		 s%/var/spool/mail%/var/mail%g" ${WRKSRC}/faces/faces.man
+	@${LN} -sf ${WRKSRC}/faces/faces.man ${WRKSRC}/faces/faces.1
+.ifdef WITH_NAS
+	@${REINPLACE_CMD} -e "s%rplay%auplay%" ${WRKSRC}/faces/Faces.ad
+.elifdef WITH_SOX
+	@${REINPLACE_CMD} -e "s%rplay%play%" ${WRKSRC}/faces/Faces.ad
+.elifdef WITH_RPLAY
+	# nada
+.else
+	@${REINPLACE_CMD} -e "s%^faces.audioSupport.*%faces.audioSupport:		false%" ${WRKSRC}/faces/Faces.ad
+.endif
+
+do-build:
+	cd ${WRKSRC}/compface && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} \
+		${FILESDIR}/Makefile.compface ${MAKE_ARGS} ${ALL_TARGET}
+.if !defined(WITHOUT_X11)
+	cd ${WRKSRC}/faces && ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} \
+		${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET}
+.endif
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/compface/compface ${PREFIX}/bin
+	${INSTALL_PROGRAM} ${WRKSRC}/compface/uncompface ${PREFIX}/bin
+	${INSTALL_DATA} ${WRKSRC}/compface/compface.h ${PREFIX}/include
+	${INSTALL_DATA} ${WRKSRC}/compface/libcompface.a ${PREFIX}/lib
+	${INSTALL_DATA} ${WRKSRC}/compface/libcompface.so.1 ${PREFIX}/lib
+	${LN} -sf libcompface.so.1 ${PREFIX}/lib/libcompface.so
+	${INSTALL_MAN} ${WRKSRC}/compface/compface.1 ${MANPREFIX}/man/man1
+	${INSTALL_MAN} ${WRKSRC}/compface/compface.3 ${MANPREFIX}/man/man3
+	${INSTALL_SCRIPT} ${FILESDIR}/ikon2xbm ${PREFIX}/bin
+	${INSTALL_SCRIPT} ${FILESDIR}/xbm2ikon ${PREFIX}/bin
+	${INSTALL_SCRIPT} ${FILESDIR}/xbmcut48 ${PREFIX}/bin
+	${INSTALL_SCRIPT} ${FILESDIR}/xbmsize48 ${PREFIX}/bin
+.if !defined(WITHOUT_X11)
+	${INSTALL_PROGRAM} ${WRKSRC}/faces/faces ${PREFIX}/bin
+	${INSTALL_MAN} ${WRKSRC}/faces/faces.1 ${MANPREFIX}/man/man1
+	${MKDIR} ${PREFIX}/lib/X11/app-defaults/Faces
+	${INSTALL_DATA} ${WRKSRC}/faces/Faces.ad ${PREFIX}/lib/X11/app-defaults/Faces
+.endif
+.if !defined(NOPORTDOCS)
+	@${MKDIR} ${DOCSDIR}
+	${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
+.endif
+
+.include <bsd.port.post.mk>
--- /dev/null
+++ mail/faces/distinfo
@@ -0,0 +1,3 @@
+MD5 (faces-1.7.7.tar.gz) = afdc4c3b0f84e747fe5f167adbc32c77
+SHA256 (faces-1.7.7.tar.gz) = 25644c675f080fe862aba2c6883f3b8e5b491cde1a2a8dbce7a12f581a843e9f
+SIZE (faces-1.7.7.tar.gz) = 290359
Index: Makefile
===================================================================
RCS file: /home/cvs/mports/mail/Makefile,v
retrieving revision 1.41
retrieving revision 1.42
diff -L mail/Makefile -L mail/Makefile -u -r1.41 -r1.42
--- mail/Makefile
+++ mail/Makefile
@@ -14,6 +14,7 @@
     SUBDIR += couriergraph
     SUBDIR += dovecot
     SUBDIR += evolution
+    SUBDIR += faces
     SUBDIR += fetchmail
     SUBDIR += gmime2
     SUBDIR += gnumail
--- /dev/null
+++ mail/faces/files/patch-ce
@@ -0,0 +1,306 @@
+*** compface/compface.h	Thu Feb 21 16:42:54 2002
+--- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/compface.h	Thu Sep  5 07:24:42 1991
+***************
+*** 14,45 ****
+   *  to me, then an attempt will be made to fix them.
+   */
+  
+  #include <string.h>
+  #include <fcntl.h>
+  #include <setjmp.h>
+  
+! /* Need to know how many bits per hexadecimal digit for io */
+  #define BITSPERDIG 4
+! extern char HexDigits[];
+  
+! /* Define the face size - 48x48x1 */
+  #define WIDTH  48
+  #define HEIGHT WIDTH
+  
+! /* Total number of pixels and digits */
+  #define PIXELS (WIDTH * HEIGHT)
+  #define DIGITS (PIXELS / BITSPERDIG)
+  
+! extern char F[PIXELS];
+  
+! /* Output formatting word lengths and line lengths */
+  #define DIGSPERWORD  4
+  #define WORDSPERLINE (WIDTH / DIGSPERWORD / BITSPERDIG)
+  
+! /* Compressed output uses the full range of printable characters.
+   * in ascii these are in a contiguous block so we just need to know
+!  * the first and last.  The total number of printables is needed too.
+!  */
+  #define FIRSTPRINT '!'
+  #define LASTPRINT  '~'
+  #define NUMPRINTS  (LASTPRINT - FIRSTPRINT + 1)
+--- 13,64 ----
+   *  to me, then an attempt will be made to fix them.
+   */
+  
++ #if defined(SYSV32) || defined(hpux)
+  #include <string.h>
++ #else
++ #include <strings.h>
++ #endif /* SYSV32 || hpux */
+  #include <fcntl.h>
+  #include <setjmp.h>
+  
+! /* For all function declarations, if ANSI then use a prototype. */
+! 
+! #if  defined(__STDC__)
+! #define P(args)  args
+! #else  /* ! __STDC__ */
+! #define P(args)  ()
+! #endif  /* STDC */
+! 
+! #ifdef MAIN
+! #define EXTERN
+! #define INIT(x) = x
+! #else
+! #define EXTERN extern
+! #define INIT(x)
+! #endif
+! 
+! /* need to know how many bits per hexadecimal digit for io */
+  #define BITSPERDIG 4
+! EXTERN char HexDigits[] INIT("0123456789ABCDEF");
+  
+! /* define the face size - 48x48x1 */
+  #define WIDTH 48
+  #define HEIGHT WIDTH
+  
+! /* total number of pixels and digits */
+  #define PIXELS (WIDTH * HEIGHT)
+  #define DIGITS (PIXELS / BITSPERDIG)
+  
+! /* internal face representation - 1 char per pixel is faster */
+! EXTERN char F[PIXELS];
+  
+! /* output formatting word lengths and line lengths */
+  #define DIGSPERWORD 4
+  #define WORDSPERLINE (WIDTH / DIGSPERWORD / BITSPERDIG)
+  
+! /* compressed output uses the full range of printable characters.
+   * in ascii these are in a contiguous block so we just need to know
+!  * the first and last.  The total number of printables is needed too */
+  #define FIRSTPRINT '!'
+  #define LASTPRINT '~'
+  #define NUMPRINTS (LASTPRINT - FIRSTPRINT + 1)
+***************
+*** 49,56 ****
+  
+  /* Portable, very large unsigned integer arithmetic is needed.
+   * Implementation uses arrays of WORDs.  COMPs must have at least
+!  * twice as many bits as WORDs to handle intermediate results.
+!  */
+  #define WORD        unsigned char
+  #define COMP        unsigned long
+  #define BITSPERWORD 8
+--- 68,74 ----
+  
+  /* Portable, very large unsigned integer arithmetic is needed.
+   * Implementation uses arrays of WORDs.  COMPs must have at least
+!  * twice as many bits as WORDs to handle intermediate results */
+  #define WORD unsigned char
+  #define COMP unsigned long
+  #define BITSPERWORD 8
+***************
+*** 64,76 ****
+      WORD b_word[MAXWORDS];
+  } BigInt;
+  
+! extern BigInt B;
+  
+  /* This is the guess the next pixel table.  Normally there are 12 neighbour
+   * pixels used to give 1<<12 cases but in the upper left corner lesser
+!  * numbers of neighbours are available, leading to 6231 different guesses.
+!  */
+! typedef struct guesses {
+      char g_00[1<<12];
+      char g_01[1<<7];
+      char g_02[1<<2];
+--- 82,94 ----
+  	WORD b_word[MAXWORDS];
+  } BigInt;
+  
+! EXTERN BigInt B;
+  
+  /* This is the guess the next pixel table.  Normally there are 12 neighbour
+   * pixels used to give 1<<12 cases but in the upper left corner lesser
+!  * numbers of neighbours are available, leading to 6231 different guesses */
+! typedef struct guesses
+! {
+  	char g_00[1<<12];
+  	char g_01[1<<7];
+  	char g_02[1<<2];
+***************
+*** 88,155 ****
+      char g_42[1<<2];
+  } Guesses;
+  
+! extern Guesses G;
+  
+  /* Data of varying probabilities are encoded by a value in the range 0 - 255.
+   * The probability of the data determines the range of possible encodings.
+!  * Offset gives the first possible encoding of the range.
+!  */
+! typedef struct prob {
+      WORD p_range;
+      WORD p_offset;
+  } Prob;
+  
+! extern Prob *ProbBuf[PIXELS * 2];
+! extern int NumProbs;
+  
+  /* Each face is encoded using 9 octrees of 16x16 each.  Each level of the
+   * trees has varying probabilities of being white, grey or black.
+!  * The table below is based on sampling many faces.
+!  */
+  
+  #define BLACK 0
+  #define GREY  1
+  #define WHITE 2
+  
+! extern Prob levels[4][3];
+! extern Prob freqs[16];
+  
+  #define ERR_OK        0     /* successful completion */
+  #define ERR_EXCESS    1     /* completed OK but some input was ignored */
+  #define ERR_INSUFF    -1    /* insufficient input.  Bad face format? */
+  #define ERR_INTERNAL  -2    /* Arithmetic overflow or buffer overflow */
+  
+! extern int status;
+  
+! extern jmp_buf comp_env;
+  
+! int AllBlack(char *, int, int);
+! int AllWhite(char *, int, int);
+! int BigPop(Prob *);
+! int compface(char *);
+! int main(int, char *[]);
+! int ReadBuf();
+! int Same(char *, int, int);
+! int uncompface(char *);
+! int WriteBuf();
+! 
+! void BigAdd(WORD);
+! void BigClear();
+! void BigDiv(WORD, WORD *);
+! void BigMul(WORD);
+! void BigPrint();
+! void BigPush(Prob *);
+! void BigRead(char *);
+! void BigSub(WORD);
+! void BigWrite(char *);
+! void CompAll(char *);
+! void Compress(char *, int, int, int);
+! void GenFace();
+! void PopGreys(char *, int, int);
+! void PushGreys(char *, int, int);
+! void ReadFace(char *);
+! void RevPush(Prob *);
+! void UnCompAll(char *);
+! void UnCompress(char *, int, int, int);
+! void UnGenFace();
+! void WriteFace(char *);
+--- 106,204 ----
+  	char g_42[1<<2];
+  } Guesses;
+  
+! /* data.h was established by sampling over 1000 faces and icons */
+! EXTERN Guesses G
+! #ifdef MAIN
+! =
+! #include "data.h"
+! #endif
+! ;
+  
+  /* Data of varying probabilities are encoded by a value in the range 0 - 255.
+   * The probability of the data determines the range of possible encodings.
+!  * Offset gives the first possible encoding of the range */
+! typedef struct prob
+! {
+  	WORD p_range;
+  	WORD p_offset;
+  } Prob;
+  
+! /* A stack of probability values */
+! EXTERN Prob *ProbBuf[PIXELS * 2];
+! EXTERN int NumProbs INIT(0);
+  
+  /* Each face is encoded using 9 octrees of 16x16 each.  Each level of the
+   * trees has varying probabilities of being white, grey or black.
+!  * The table below is based on sampling many faces */
+  
+  #define BLACK 0
+  #define GREY 1
+  #define WHITE 2
+  
+! EXTERN Prob levels[4][3]
+! #ifdef MAIN
+! =
+! {
+! 	{{1, 255},	{251, 0},	{4, 251}},	/* Top of tree almost always grey */
+! 	{{1, 255},	{200, 0},	{55, 200}},
+! 	{{33, 223},	{159, 0},	{64, 159}},
+! 	{{131, 0},	{0, 0}, 	{125, 131}}	/* Grey disallowed at bottom */
+! }
+! #endif
+! ;
+! 
+! /* At the bottom of the octree 2x2 elements are considered black if any
+!  * pixel is black.  The probabilities below give the distribution of the
+!  * 16 possible 2x2 patterns.  All white is not really a possibility and
+!  * has a probability range of zero.  Again, experimentally derived data */
+! EXTERN Prob freqs[16]
+! #ifdef MAIN
+! =
+! {
+! 	{0, 0}, 	{38, 0},	{38, 38},	{13, 152},
+! 	{38, 76},	{13, 165},	{13, 178},	{6, 230},
+! 	{38, 114},	{13, 191},	{13, 204},	{6, 236},
+! 	{13, 217},	{6, 242},	{5, 248},	{3, 253}
+! }
+! #endif
+! ;
+  
+  #define ERR_OK		0	/* successful completion */
+  #define ERR_EXCESS	1	/* completed OK but some input was ignored */
+  #define ERR_INSUFF	-1	/* insufficient input.  Bad face format? */
+  #define ERR_INTERNAL	-2	/* Arithmetic overflow or buffer overflow */
+  
+! EXTERN int status;
+  
+! EXTERN jmp_buf comp_env;
+  
+! int AllBlack P((char *, int, int)) ;
+! int AllWhite P((char *, int, int)) ;
+! int BigPop P((Prob *)) ;
+! int compface P((char *)) ;
+! int main P((int, char *[])) ;
+! int ReadBuf P(()) ;
+! int Same P((char *, int, int)) ;
+! int uncompface P((char *)) ;
+! int WriteBuf P(()) ;
+! 
+! void BigAdd P((unsigned char)) ;
+! void BigClear P(()) ;
+! void BigDiv P((unsigned char, unsigned char *)) ;
+! void BigMul P((unsigned char)) ;
+! void BigPrint P(()) ;
+! void BigPush P((Prob *)) ;
+! void BigRead P((char *)) ;
+! void BigSub P((unsigned int)) ;
+! void BigWrite P((char *)) ;
+! void CompAll P((char *)) ;
+! void Compress P((char *, int, int, int)) ;
+! void GenFace P(()) ;
+! void PopGreys P((char *, int, int)) ;
+! void PushGreys P((char *, int, int)) ;
+! void ReadFace P((char *)) ;
+! void RevPush P((Prob *)) ;
+! void UnCompAll P((char *)) ;
+! void UnCompress P((char *, int, int, int)) ;
+! void UnGenFace P(()) ;
+! void WriteFace P((char *)) ;
--- /dev/null
+++ mail/faces/files/Makefile.compface
@@ -0,0 +1,94 @@
+#
+#  Compface - 48x48x1 image compression and decompression
+#
+#  Copyright (c) James Ashton - Sydney University - June 1990.
+#
+#  Written 11th November 1989.
+#
+#  Permission is given to distribute these sources, as long as the
+#  copyright messages are not removed, and no monies are exchanged.
+#
+#  No responsibility is taken for any errors on inaccuracies inherent
+#  either to the comments or the code of this program, but if reported
+#  to me, then an attempt will be made to fix them.
+
+# SYSV is expected to be overridden by the calling Makefile.
+#--------------------------------------------------------------------------
+#  If you are running on a Unix System V machine, then you should uncomment
+#  the next definition.
+#
+#SYSV           = -DSYSV32
+#--------------------------------------------------------------------------
+# BINDIR, LIBDIR, INCDIR and MANDIR are expected to be overridden by the
+# calling Makefile
+
+BINDIR		= ${PREFIX}/bin
+LIBDIR		= ${PREFIX}/lib
+INCDIR		= ${PREFIX}/include
+MANDIR		= ${PREFIX}/man
+
+NAME		= compface
+UNNAME		= uncompface
+EXECUTABLE	= $(BINDIR)/$(NAME)
+UNEXECUTABLE	= $(BINDIR)/$(UNNAME)
+LIBNAME		= lib$(NAME).a
+SHLIB_MAJOR	= 1
+LIB		= $(NAME)
+SOLIB		= lib$(NAME).so.$(SHLIB_MAJOR)
+NOPROFILE	= ''
+LIBRARY		= $(LIBDIR)
+MAN1DIR		= $(MANDIR)/man1
+MAN3DIR		= $(MANDIR)/man3
+OBJECTS		= arith.o file.o compress.o gen.o uncompface.o
+SOURCES		= compface.c uncompface.o arith.c file.c compress.c gen.c \
+		  cmain.c uncmain.c
+SRCS		= arith.c file.c compress.c gen.c uncompface.c
+HDRS		= compface.h data.h
+OTHERS		= README $(NAME).1 $(NAME).3 Makefile
+
+CC		?= cc
+CDEFS		= $(SYSV)
+CFLAGS		+= $(CDEFS) $(CCOMP)
+
+all:		lib$(NAME).a $(SOLIB) $(NAME) $(UNNAME)
+
+$(NAME) :	cmain.o compface.o
+		$(CC) $(CFLAGS) -o $(NAME) cmain.o compface.o -L./ -lcompface
+
+$(UNNAME) :	uncmain.o $(LIBNAME)
+		$(CC) $(CFLAGS) -o $(UNNAME) uncmain.o -L./ -lcompface
+
+lint :
+		lint -abchx $(SOURCES)
+
+clean :
+		rm -f *.o *po *so *.a *.so.* *.sh core a.out $(NAME) $(UNNAME)
+
+install :	$(NAME) $(UNNAME) $(LIBNAME)
+		install -c -s -o bin -m 755 $(NAME) $(EXECUTABLE)
+		install -c -s -o bin -m 755 $(UNNAME) $(UNEXECUTABLE)
+		install -c -g bin -o bin -m 444 $(NAME).1 $(MAN1DIR)
+		-rm -f $(MAN1DIR)/$(UNNAME).1*
+		ln -fs $(MAN1DIR)/$(NAME).1 $(MAN1DIR)/$(UNNAME).1
+		install -c -o bin -m 444 $(LIBNAME) $(LIBRARY)
+		install -c -o bin -m 444 $(SOLIB) $(LIBRARY)
+		ln -sf $(SOLIB) $(LIBRARY)/lib$(NAME).so
+		install -c -g bin -o bin -m 444 $(NAME).3 $(MAN3DIR)
+		rm -f $(MAN3DIR)/$(UNNAME).3*
+		ln -fs $(MAN3DIR)/$(NAME).3 $(MAN3DIR)/$(UNNAME).3
+		install -m 444 -o bin -g bin -c compface.h $(INCDIR)
+
+shar :
+		shar.script $(OTHERS) $(HDRS) $(SOURCES) > $(NAME).sh
+		compress $(NAME).sh
+
+arith.o:	arith.c compface.h data.h
+cmain.o:	cmain.c compface.h data.h
+compface.o:	compface.c compface.h data.h
+compress.o:	compress.c compface.h data.h
+file.o:		file.c compface.h data.h
+gen.o:		gen.c compface.h data.h
+uncmain.o:	uncmain.c compface.h data.h
+uncompface.o:	uncompface.c compface.h data.h
+
+.include <bsd.lib.mk>
--- /dev/null
+++ mail/faces/files/patch-ci
@@ -0,0 +1,186 @@
+*** compface/gen.c	Tue Jan 15 23:58:46 2002
+--- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/gen.c	Wed Jun 19 08:29:13 1991
+***************
+*** 18,79 ****
+  
+  #define GEN(g) F[h] ^= G.g[k]; break
+  
+! static void Gen(char *);
+  
+  static void
+! Gen(char *f)
+  {
+!     int m, l, k, j, i, h;
+  
+!     for (j = 0; j < HEIGHT;  j++) {
+!         for (i = 0; i < WIDTH;  i++) {
+              h = i + j * WIDTH;
+              k = 0;
+!             for (l = i - 2; l <= i + 2; l++) {
+!                 for (m = j - 2; m <= j; m++) {
+!                     if ((l >= i) && (m == j)) {
+                          continue;
+!                     }
+!                     if ((l > 0) && (l <= WIDTH) && (m > 0)) {
+                          k = *(f + l + m * WIDTH) ? k * 2 + 1 : k * 2;
+                      }
+!                 }
+!             }
+!             switch (i) {
+                  case 1 :
+!                     switch (j) {
+                          case 1 : GEN(g_22);
+                          case 2 : GEN(g_21);
+                          default : GEN(g_20);
+                      }
+                      break;
+- 
+                  case 2 :
+!                     switch (j) {
+                          case 1 : GEN(g_12);
+                          case 2 : GEN(g_11);
+                          default : GEN(g_10);
+                      }
+                      break;
+- 
+                  case WIDTH - 1 :
+!                     switch (j) {
+                          case 1 : GEN(g_42);
+                          case 2 : GEN(g_41);
+                          default : GEN(g_40);
+                      }
+                      break;
+- 
+                  case WIDTH :
+!                     switch (j) {
+                          case 1 : GEN(g_32);
+                          case 2 : GEN(g_31);
+                          default : GEN(g_30);
+                      }
+                      break;
+- 
+                  default :
+!                     switch (j) {
+                          case 1 : GEN(g_02);
+                          case 2 : GEN(g_01);
+                          default : GEN(g_00);
+--- 17,81 ----
+  
+  #define GEN(g) F[h] ^= G.g[k]; break
+  
+! static void Gen P((char *)) ;
+  
+  static void
+! Gen(f)
+! register char *f;
+  {
+! 	register int m, l, k, j, i, h;
+  
+! 	for (j = 0; j < HEIGHT;  j++)
+! 	{
+! 		for (i = 0; i < WIDTH;  i++)
+! 		{
+  			h = i + j * WIDTH;
+  			k = 0;
+! 			for (l = i - 2; l <= i + 2; l++)
+! 				for (m = j - 2; m <= j; m++)
+! 				{
+! 					if ((l >= i) && (m == j))
+  						continue;
+! 					if ((l > 0) && (l <= WIDTH) && (m > 0))
+  						k = *(f + l + m * WIDTH) ? k * 2 + 1 : k * 2;
+  				}
+! 			switch (i)
+! 			{
+  				case 1 :
+! 					switch (j)
+! 					{
+  						case 1 : GEN(g_22);
+  						case 2 : GEN(g_21);
+  						default : GEN(g_20);
+  					}
+  					break;
+  				case 2 :
+! 					switch (j)
+! 					{
+  						case 1 : GEN(g_12);
+  						case 2 : GEN(g_11);
+  						default : GEN(g_10);
+  					}
+  					break;
+  				case WIDTH - 1 :
+! 					switch (j)
+! 					{
+  						case 1 : GEN(g_42);
+  						case 2 : GEN(g_41);
+  						default : GEN(g_40);
+  					}
+  					break;
+  				case WIDTH :
+! 					switch (j)
+! 					{
+  						case 1 : GEN(g_32);
+  						case 2 : GEN(g_31);
+  						default : GEN(g_30);
+  					}
+  					break;
+  				default :
+! 					switch (j)
+! 					{
+  						case 1 : GEN(g_02);
+  						case 2 : GEN(g_01);
+  						default : GEN(g_00);
+***************
+*** 84,109 ****
+      }
+  }
+  
+- 
+  void
+  GenFace()
+  {
+      static char new[PIXELS];
+!     char *f1, *f2;
+!     int i;
+  
+      f1 = new;
+      f2 = F;
+      i = PIXELS;
+!     while (i-- > 0) {
+          *(f1++) = *(f2++);
+-     }
+      Gen(new);
+  }
+  
+- 
+  void
+  UnGenFace()
+  {
+      Gen(F);
+  }
+--- 86,110 ----
+  	}
+  }
+  
+  void
+  GenFace()
+  {
+  	static char new[PIXELS];
+! 	register char *f1;
+! 	register char *f2;
+! 	register int i;
+  
+  	f1 = new;
+  	f2 = F;
+  	i = PIXELS;
+! 	while (i-- > 0)
+  		*(f1++) = *(f2++);
+  	Gen(new);
+  }
+  
+  void
+  UnGenFace()
+  {
+  	Gen(F);
+  }
++ 
--- /dev/null
+++ mail/faces/files/patch-cf
@@ -0,0 +1,314 @@
+*** compface/compress.c	Tue Jan 15 23:58:46 2002
+--- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/compress.c	Wed Jun 19 08:29:13 1991
+***************
+*** 17,113 ****
+  #include "compface.h"
+  
+  int
+! Same(char *f, int wid, int hei)
+  {
+! 	char val, *row;
+! 	int x;
+  
+  	val = *f;
+! 	while (hei--) {
+  		row = f;
+  		x = wid;
+! 		while (x--) {
+! 			if (*(row++) != val) {
+  				return(0);
+-             }
+-         }
+  		f += WIDTH;
+  	}
+! 	return(1);
+  }
+  
+- 
+  int
+! AllBlack(char *f, int wid, int hei)
+  {
+! 	if (wid > 3) {
+  		wid /= 2;
+  		hei /= 2;
+! 		return(AllBlack(f, wid, hei) && AllBlack(f + wid, wid, hei) &&
+  		       AllBlack(f + WIDTH * hei, wid, hei) &&
+  		       AllBlack(f + WIDTH * hei + wid, wid, hei));
+- 	} else {
+- 		return(*f || *(f + 1) || *(f + WIDTH) || *(f + WIDTH + 1));
+      }
+  }
+  
+- 
+  int
+! AllWhite(char *f, int wid, int hei)
+  {
+! 	return((*f == 0) && Same(f, wid, hei));
+  }
+  
+- 
+  void
+! PopGreys(char *f, int wid, int hei)
+  {
+! 	if (wid > 3) {
+  		wid /= 2;
+  		hei /= 2;
+  		PopGreys(f, wid, hei);
+  		PopGreys(f + wid, wid, hei);
+  		PopGreys(f + WIDTH * hei, wid, hei);
+  		PopGreys(f + WIDTH * hei + wid, wid, hei);
+! 	} else {
+  		wid = BigPop(freqs);
+! 		if (wid & 1) {
+  			*f = 1;
+!         }
+! 		if (wid & 2) {
+  			*(f + 1) = 1;
+!         }
+! 		if (wid & 4) {
+  			*(f + WIDTH) = 1;
+!         }
+! 		if (wid & 8) {
+  			*(f + WIDTH + 1) = 1;
+          }
+- 	}
+  }
+  
+- 
+  void
+! PushGreys(char *f, int wid, int hei)
+  {
+! 	if (wid > 3) {
+  		wid /= 2;
+  		hei /= 2;
+  		PushGreys(f, wid, hei);
+  		PushGreys(f + wid, wid, hei);
+  		PushGreys(f + WIDTH * hei, wid, hei);
+  		PushGreys(f + WIDTH * hei + wid, wid, hei);
+- 	} else {
+- 		RevPush(freqs + *f + 2 * *(f + 1) + 
+-                 4 * *(f + WIDTH) + 8 * *(f + WIDTH + 1));
+      }
+  }
+  
+- 
+  void
+! UnCompress(char *f, int wid, int hei, int lev)
+  {
+! 	switch (BigPop(&levels[lev][0])) {
+  		case WHITE :
+  			return;
+  		case BLACK :
+--- 16,120 ----
+  #include "compface.h"
+  
+  int
+! Same(f, wid, hei)
+! register char *f;
+! register int wid, hei;
+  {
+! 	register char val, *row;
+! 	register int x;
+  
+  	val = *f;
+! 	while (hei--)
+! 	{
+  		row = f;
+  		x = wid;
+! 		while (x--)
+! 			if (*(row++) != val)
+  				return(0);
+  		f += WIDTH;
+  	}
+! 	return 1;
+  }
+  
+  int
+! AllBlack(f, wid, hei)
+! char *f;
+! int wid, hei;
+  {
+! 	if (wid > 3)
+! 	{
+  		wid /= 2;
+  		hei /= 2;
+! 		return (AllBlack(f, wid, hei) && AllBlack(f + wid, wid, hei) &&
+  		  AllBlack(f + WIDTH * hei, wid, hei) &&
+  		  AllBlack(f + WIDTH * hei + wid, wid, hei));
+  	}
++ 	else
++ 		return (*f || *(f + 1) || *(f + WIDTH) || *(f + WIDTH + 1));
+  }
+  
+  int
+! AllWhite(f, wid, hei)
+! char *f;
+! int wid, hei;
+  {
+! 	return ((*f == 0) && Same(f, wid, hei));
+  }
+  
+  void
+! PopGreys(f, wid, hei)
+! char *f;
+! int wid, hei;
+  {
+! 	if (wid > 3)
+! 	{
+  		wid /= 2;
+  		hei /= 2;
+  		PopGreys(f, wid, hei);
+  		PopGreys(f + wid, wid, hei);
+  		PopGreys(f + WIDTH * hei, wid, hei);
+  		PopGreys(f + WIDTH * hei + wid, wid, hei);
+! 	}
+! 	else
+! 	{
+  		wid = BigPop(freqs);
+! 		if (wid & 1)
+  			*f = 1;
+! 		if (wid & 2)
+  			*(f + 1) = 1;
+! 		if (wid & 4)
+  			*(f + WIDTH) = 1;
+! 		if (wid & 8)
+  			*(f + WIDTH + 1) = 1;
+  	}
+  }
+  
+  void
+! PushGreys(f, wid, hei)
+! char *f;
+! int wid, hei;
+  {
+! 	if (wid > 3)
+! 	{
+  		wid /= 2;
+  		hei /= 2;
+  		PushGreys(f, wid, hei);
+  		PushGreys(f + wid, wid, hei);
+  		PushGreys(f + WIDTH * hei, wid, hei);
+  		PushGreys(f + WIDTH * hei + wid, wid, hei);
+  	}
++ 	else
++ 		RevPush(freqs + *f + 2 * *(f + 1) + 4 * *(f + WIDTH) +
++ 		  8 * *(f + WIDTH + 1));
+  }
+  
+  void
+! UnCompress(f, wid, hei, lev)
+! register char *f;
+! register int wid, hei, lev;
+  {
+! 	switch (BigPop(&levels[lev][0]))
+! 	{
+  		case WHITE :
+  			return;
+  		case BLACK :
+***************
+*** 125,139 ****
+  	}
+  }
+  
+- 
+  void
+! Compress(char *f, int wid, int hei, int lev)
+  {
+! 	if (AllWhite(f, wid, hei)) {
+  		RevPush(&levels[lev][WHITE]);
+  		return;
+  	}
+! 	if (AllBlack(f, wid, hei)) {
+  		RevPush(&levels[lev][BLACK]);
+  		PushGreys(f, wid, hei);
+  		return;
+--- 132,149 ----
+  	}
+  }
+  
+  void
+! Compress(f, wid, hei, lev)
+! register char *f;
+! register int wid, hei, lev;
+  {
+! 	if (AllWhite(f, wid, hei))
+! 	{
+  		RevPush(&levels[lev][WHITE]);
+  		return;
+  	}
+! 	if (AllBlack(f, wid, hei))
+! 	{
+  		RevPush(&levels[lev][BLACK]);
+  		PushGreys(f, wid, hei);
+  		return;
+***************
+*** 149,164 ****
+  }
+  
+  void
+! UnCompAll(char *fbuf)
+  {
+! 	char *p;
+  
+  	BigClear();
+  	BigRead(fbuf);
+  	p = F;
+! 	while (p < F + PIXELS) {
+  		*(p++) = 0;
+-     }
+  	UnCompress(F, 16, 16, 0);
+  	UnCompress(F + 16, 16, 16, 0);
+  	UnCompress(F + 32, 16, 16, 0);
+--- 159,174 ----
+  }
+  
+  void
+! UnCompAll(fbuf)
+! char *fbuf;
+  {
+! 	register char *p;
+  
+  	BigClear();
+  	BigRead(fbuf);
+  	p = F;
+! 	while (p < F + PIXELS)
+  		*(p++) = 0;
+  	UnCompress(F, 16, 16, 0);
+  	UnCompress(F + 16, 16, 16, 0);
+  	UnCompress(F + 32, 16, 16, 0);
+***************
+*** 171,177 ****
+  }
+  
+  void
+! CompAll(char *fbuf)
+  {
+  	Compress(F, 16, 16, 0);
+  	Compress(F + 16, 16, 16, 0);
+--- 181,188 ----
+  }
+  
+  void
+! CompAll(fbuf)
+! char *fbuf;
+  {
+  	Compress(F, 16, 16, 0);
+  	Compress(F + 16, 16, 16, 0);
+***************
+*** 183,190 ****
+  	Compress(F + WIDTH * 32 + 16, 16, 16, 0);
+  	Compress(F + WIDTH * 32 + 32, 16, 16, 0);
+  	BigClear();
+! 	while (NumProbs > 0) {
+  		BigPush(ProbBuf[--NumProbs]);
+-     }
+  	BigWrite(fbuf);
+  }
+--- 194,200 ----
+  	Compress(F + WIDTH * 32 + 16, 16, 16, 0);
+  	Compress(F + WIDTH * 32 + 32, 16, 16, 0);
+  	BigClear();
+! 	while (NumProbs > 0)
+  		BigPush(ProbBuf[--NumProbs]);
+  	BigWrite(fbuf);
+  }
--- /dev/null
+++ mail/faces/files/xbm2ikon
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+#  @(#)xbm2ikon 1.4 91/05/06
+#
+#  Copyright (c) Steve Kinzler - March 1991.
+#
+#  Permission is given to distribute these sources, as long as the
+#  copyright messages are not removed, and no monies are exchanged.
+#
+#  No responsibility is taken for any errors on inaccuracies inherent
+#  either to the comments or the code of this program, but if reported
+#  to me, then an attempt will be made to fix them.
+
+PATH=$PATH:/usr/bin/X11; export PATH
+
+# xbm2ikon - convert an X11 bitmap to a Blit ikon bitmap
+# stdin/stdout filter
+# requires some bitmap filters from the pbmplus package
+# kludge by kinzler at cs.indiana.edu
+
+xbmtopbm |
+pbmtoicon |
+sed -e 1,2d -e '$s/$/,/' |
+tr -d '\011\012' |
+tr ',' '\012' |
+pr -l1 -t -w22 -3 -s, |
+sed -e 's/$/,/' -e 's/\(0x....\)\(0x....\)\(0x....\),/\1,\2,\3,/'
--- /dev/null
+++ mail/faces/files/patch-ba
@@ -0,0 +1,17 @@
+*** faces/Faces.ad.orig	Tue Dec 18 05:11:31 2001
+--- faces/Faces.ad	Sun Mar 17 21:14:05 2002
+***************
+*** 12,17 ****
+  faces.button1clear:		false
+  faces.displayHostname:		false
+  
+! faces.audioSupport:		false
+! faces.audioCommand:		play
+  faces.bellAudioFile:
+--- 12,17 ----
+  faces.button1clear:		false
+  faces.displayHostname:		false
+  
+! faces.audioSupport:		true
+! faces.audioCommand:		rplay
+  faces.bellAudioFile:
--- /dev/null
+++ mail/faces/files/patch-ck
@@ -0,0 +1,40 @@
+*** compface/uncompface.c	Thu Feb 21 16:42:54 2002
+--- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/uncompface.c	Wed Jun 19 08:29:14 1991
+***************
+*** 14,29 ****
+   *  to me, then an attempt will be made to fix them.
+   */
+  
+  #include "compface.h"
+- #include "vars.h"
+  
+  int
+! uncompface(char *fbuf)
+  {
+!     if (!(status = setjmp(comp_env))) {
+!         UnCompAll(fbuf);       /* compress otherwise */
+          UnGenFace();
+          WriteFace(fbuf);
+      }
+!     return(status);
+  }
+--- 13,31 ----
+   *  to me, then an attempt will be made to fix them.
+   */
+  
++ #define MAIN
++ 
+  #include "compface.h"
+  
+  int
+! uncompface(fbuf)
+! char *fbuf;
+  {
+! 	if (!(status = setjmp(comp_env)))
+! 	{
+! 		UnCompAll(fbuf);/* compress otherwise */
+  		UnGenFace();
+  		WriteFace(fbuf);
+  	}
+! 	return status;
+  }
--- /dev/null
+++ mail/faces/files/xbmcut48
@@ -0,0 +1,16 @@
+#!/bin/sh
+#
+#  @(#)xbmcut48 1.2 91/04/15
+#
+#  Copyright (c) Steve Kinzler - April 1991.
+#
+#  Permission is given to distribute these sources, as long as the
+#  copyright messages are not removed, and no monies are exchanged.
+#
+#  No responsibility is taken for any errors on inaccuracies inherent
+#  either to the comments or the code of this program, but if reported
+#  to me, then an attempt will be made to fix them.
+
+PATH=$PATH:/usr/bin/X11; export PATH
+
+xbmtopbm | pnmcut 0 0 48 48 | pbmtoxbm
--- /dev/null
+++ mail/faces/files/patch-cc
@@ -0,0 +1,17 @@
+*** compface/compface.1	Tue Jan 15 23:58:46 2002
+--- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/compface.1	Sun Jan 19 19:35:35 2003
+***************
+*** 56,61 ****
+--- 58,69 ----
+  .I compface
+  averages less than 200 characters.
+  The average number of output lines is three.
++ .SH OPTIONS
++ .TP 12
++ .B \-X
++ The same as
++ .I uncompface
++ | ikon2xbm. Usefull for exmh!
+  .SH DIAGNOSTICS
+  Exit status is normally 0.
+  Possible errors include IO errors when opening, reading or writing
--- /dev/null
+++ mail/faces/files/patch-ch
@@ -0,0 +1,314 @@
+*** compface/file.c	Tue Jan 15 23:58:46 2002
+--- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/file.c	Sun Jan 19 19:35:35 2003
+***************
+*** 16,147 ****
+  
+  #include "compface.h"
+  
+  void
+! BigRead(char *fbuf)
+  {
+!     int c;
+  
+!     while (*fbuf != '\0') {
+          c = *(fbuf++);
+!         if ((c < FIRSTPRINT) || (c > LASTPRINT)) {
+              continue;
+-         }
+          BigMul(NUMPRINTS);
+          BigAdd((WORD)(c - FIRSTPRINT));
+      }
+  }
+  
+- 
+  void
+! BigWrite(char *fbuf)
+  {
+      static WORD tmp;
+      static char buf[DIGITS];
+!     char *s;
+!     int i;
+  
+      s = buf;
+!     while (B.b_words > 0) {
+          BigDiv(NUMPRINTS, &tmp);
+          *(s++) = tmp + FIRSTPRINT;
+      }
+!     i = 7;              /* Leave room for the field name on the first line */
+      *(fbuf++) = ' ';
+!     while (s-- > buf) {
+!         if (i == 0) {
+              *(fbuf++) = ' ';
+-         }
+          *(fbuf++) = *s;
+!         if (++i >= MAXLINELEN) {
+              *(fbuf++) = '\n';
+              i = 0;
+          }
+      }
+!     if (i > 0) {
+          *(fbuf++) = '\n';
+-     }
+      *(fbuf++) = '\0';
+  }
+  
+- 
+  void
+! ReadFace(char *fbuf)
+  {
+!     int c, i;
+!     char *s, *t;
+  
+      t = s = fbuf;
+!     for (i = strlen(s); i > 0; i--) {
+!         c = (int) *(s++);
+!         if ((c >= '0') && (c <= '9')) {
+!             if (t >= fbuf + DIGITS) {
+                  status = ERR_EXCESS;
+                  break;
+              }
+              *(t++) = c - '0';
+!         } else if ((c >= 'A') && (c <= 'F')) {
+!             if (t >= fbuf + DIGITS) {
+                  status = ERR_EXCESS;
+                  break;
+              }
+              *(t++) = c - 'A' + 10;
+!         } else if ((c >= 'a') && (c <= 'f')) {
+!             if (t >= fbuf + DIGITS) {
+                  status = ERR_EXCESS;
+                  break;
+              }
+              *(t++) = c - 'a' + 10;
+-         } else if (((c == 'x') || (c == 'X')) && (t > fbuf) && (*(t-1) == 0)) {
+-             t--;
+          }
+      }
+!     if (t < fbuf + DIGITS) {
+          longjmp(comp_env, ERR_INSUFF);
+-     }
+      s = fbuf;
+      t = F;
+      c = 1 << (BITSPERDIG - 1);
+!     while (t < F + PIXELS) {
+          *(t++) = (*s & c) ? 1 : 0;
+!         if ((c >>= 1) == 0) {
+              s++;
+              c = 1 << (BITSPERDIG - 1);
+          }
+      }
+  }
+  
+- 
+  void
+! WriteFace(char *fbuf)
+  {
+!     char *s, *t;
+!     int i, bits, digits, words;
+  
+      s = F;
+      t = fbuf;
+      bits = digits = words = i = 0;
+!     while (s < F + PIXELS) {
+!         if ((bits == 0) && (digits == 0)) {
+              *(t++) = '0';
+              *(t++) = 'x';
+          }
+!         if (*(s++)) {
+              i = i * 2 + 1;
+!         } else {
+              i *= 2;
+          }
+!         if (++bits == BITSPERDIG) {
+!             *(t++) = *(i + HexDigits);
+              bits = i = 0;
+!             if (++digits == DIGSPERWORD) {
+                  *(t++) = ',';
+                  digits = 0;
+!                 if (++words == WORDSPERLINE) {
+                      *(t++) = '\n';
+                      words = 0;
+                  }
+              }
+          }
+      }
+      *(t++) = '\0';
+  }
+--- 15,191 ----
+  
+  #include "compface.h"
+  
++ int xbitmap=0;
++ 
+  void
+! BigRead(fbuf)
+! register char *fbuf;
+  {
+! 	register int c;
+  
+! 	while (*fbuf != '\0')
+! 	{
+  		c = *(fbuf++);
+! 		if ((c < FIRSTPRINT) || (c > LASTPRINT))
+  			continue;
+  		BigMul(NUMPRINTS);
+  		BigAdd((WORD)(c - FIRSTPRINT));
+  	}
+  }
+  
+  void
+! BigWrite(fbuf)
+! register char *fbuf;
+  {
+  	static WORD tmp;
+  	static char buf[DIGITS];
+! 	register char *s;
+! 	register int i;
+  
+  	s = buf;
+! 	while (B.b_words > 0)
+! 	{
+  		BigDiv(NUMPRINTS, &tmp);
+  		*(s++) = tmp + FIRSTPRINT;
+  	}
+! 	i = 7;	/* leave room for the field name on the first line */
+  	*(fbuf++) = ' ';
+! 	while (s-- > buf)
+! 	{
+! 		if (i == 0)
+  			*(fbuf++) = ' ';
+  		*(fbuf++) = *s;
+! 		if (++i >= MAXLINELEN)
+! 		{
+  			*(fbuf++) = '\n';
+  			i = 0;
+  		}
+  	}
+! 	if (i > 0)
+  		*(fbuf++) = '\n';
+  	*(fbuf++) = '\0';
+  }
+  
+  void
+! ReadFace(fbuf)
+! char *fbuf;
+  {
+! 	register int c, i;
+! 	register char *s, *t;
+  
+  	t = s = fbuf;
+! 	for(i = strlen(s); i > 0; i--)
+! 	{
+! 		c = (int)*(s++);
+! 		if ((c >= '0') && (c <= '9'))
+! 		{
+! 			if (t >= fbuf + DIGITS)
+! 			{
+  				status = ERR_EXCESS;
+  				break;
+  			}
+  			*(t++) = c - '0';
+! 		}
+! 		else if ((c >= 'A') && (c <= 'F'))
+! 		{
+! 			if (t >= fbuf + DIGITS)
+! 			{
+  				status = ERR_EXCESS;
+  				break;
+  			}
+  			*(t++) = c - 'A' + 10;
+! 		}
+! 		else if ((c >= 'a') && (c <= 'f'))
+! 		{
+! 			if (t >= fbuf + DIGITS)
+! 			{
+  				status = ERR_EXCESS;
+  				break;
+  			}
+  			*(t++) = c - 'a' + 10;
+  		}
++ 		else if (((c == 'x') || (c == 'X')) && (t > fbuf) && (*(t-1) == 0))
++ 			t--;
+  	}
+! 	if (t < fbuf + DIGITS)
+  		longjmp(comp_env, ERR_INSUFF);
+  	s = fbuf;
+  	t = F;
+  	c = 1 << (BITSPERDIG - 1);
+! 	while (t < F + PIXELS)
+! 	{
+  		*(t++) = (*s & c) ? 1 : 0;
+! 		if ((c >>= 1) == 0)
+! 		{
+  			s++;
+  			c = 1 << (BITSPERDIG - 1);
+  		}
+  	}
+  }
+  
+  void
+! WriteFace(fbuf)
+! char *fbuf;
+  {
+! 	register char *s, *t;
+! 	register int i, bits, digits, words;
+! 	extern int xbitmap;
+! 	int digsperword = DIGSPERWORD;
+! 	int wordsperline = WORDSPERLINE;
+  
+  	s = F;
+  	t = fbuf;
+  	bits = digits = words = i = 0;
+! 	if (xbitmap) {
+! 		sprintf(t,"#define noname_width 48\n#define noname_height 48\nstatic char noname_bits[] = {\n ");
+! 		while (*t) t++;
+! 		digsperword = 2;
+! 		wordsperline = 15;
+! 	}
+! 	while (s < F + PIXELS)
+! 	{
+! 		if ((bits == 0) && (digits == 0))
+! 		{
+  			*(t++) = '0';
+  			*(t++) = 'x';
+  		}
+! 		if (xbitmap) {
+! 			if (*(s++))
+! 				i = (i >> 1) | 0x8;
+! 			else
+! 				i >>= 1;
+! 		}
+! 		else {
+! 			if (*(s++))
+  				i = i * 2 + 1;
+! 			else
+  				i *= 2;
+  		}
+! 		if (++bits == BITSPERDIG)
+! 		{
+! 			if (xbitmap) {
+! 				t++;
+! 				t[-(digits & 1) * 2] = *(i + HexDigits);
+! 			}
+! 			else *(t++) = *(i + HexDigits);
+  			bits = i = 0;
+! 			if (++digits == digsperword)
+! 			{
+! 				if (xbitmap && (s >= F + PIXELS)) break;
+  				*(t++) = ',';
+  				digits = 0;
+! 				if (++words == wordsperline)
+! 				{
+  					*(t++) = '\n';
++ 					if (xbitmap) *(t++) = ' ';
+  					words = 0;
+  				}
+  			}
+  		}
+  	}
++ 	if (xbitmap) {
++ 		sprintf(t, "}\n");
++ 		while (*t) t++;
++ 	}
+  	*(t++) = '\0';
+  }
--- /dev/null
+++ mail/faces/files/patch-cj
@@ -0,0 +1,296 @@
+*** compface/uncmain.c	Thu Feb 21 16:42:54 2002
+--- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/uncmain.c	Sun Jan 19 19:35:35 2003
+***************
+*** 13,28 ****
+   *  to me, then an attempt will be made to fix them.
+   */
+  
+- #include <stdlib.h>
+- #include <unistd.h>
+  #include <fcntl.h>
+  #include "compface.h"
+  
+! #define  STRCAT        (void) strcat
+! #define  STRCPY        (void) strcpy
+! #define  WRITE         (void) write
+  
+! /* The buffer is longer than needed to handle sparse input formats */
+  #define FACEBUFLEN 2048
+  char fbuf[FACEBUFLEN];
+  
+--- 15,26 ----
+   *  to me, then an attempt will be made to fix them.
+   */
+  
+  #include <fcntl.h>
+  #include "compface.h"
+  
+! extern int xbitmap;
+  
+! /* the buffer is longer than needed to handle sparse input formats */
+  #define FACEBUFLEN 2048
+  char fbuf[FACEBUFLEN];
+  
+***************
+*** 32,87 ****
+  int outfile   = 1;
+  char *outname = "<stdout>";
+  
+! char *cmdname;                 /* Basename of executable */
+  
+! /* Error handling definitions follow */
+  
+  extern int errno, sys_nerr;
+  extern char *sys_errlist[];
+  
+  #define ERR         ((errno < sys_nerr) ? sys_errlist[errno] : "")
+! #define INITERR(s)  { \
+!                         STRCPY(fbuf, cmdname); \
+!                         STRCAT(fbuf, ": "); \
+!                         STRCAT(fbuf, (s));\
+!                     }
+! #define ADDERR(s)   STRCAT(fbuf, (s));
+! #define ERROR       { \
+!                         STRCAT(fbuf, "\n"); \
+!                         WRITE(2, fbuf, strlen(fbuf)); \
+!                         exit(1); \
+!                     }
+! #define INITWARN(s) { \
+!                         STRCPY(fbuf, cmdname); \
+!                         STRCAT(fbuf, ": (warning) "); \
+!                         STRCAT(fbuf, (s)); \
+!                     }
+! #define ADDWARN(s)  STRCAT(fbuf, (s));
+! #define WARN        { \
+!                         STRCAT(fbuf, "\n"); \
+!                         WRITE(2, fbuf, strlen(fbuf)); \
+!                     }
+  
+  int
+! main(int argc, char *argv[])
+  {
+      cmdname = *argv;
+!     while (**argv) {
+!         if (*((*argv)++) == '/') {
+              cmdname = *argv;               /* find the command's basename */
+!         }
+      }
+  
+!     if (argc > 3) {
+          INITERR("usage: ")
+          ADDERR(cmdname)
+          ADDERR(" [infile [outfile]]")
+          ERROR
+      }
+  
+!     if ((argc > 1) && strcmp(*++argv, "-")) {
+          inname = *argv;
+!         if ((infile = open(inname, O_RDONLY)) == -1) {
+              INITERR(inname)
+              ADDERR(": ")
+              ADDERR(ERR)
+--- 30,87 ----
+  int outfile   = 1;
+  char *outname = "<stdout>";
+  
+! /* basename of executable */
+! char *cmdname;
+  
+! /* error handling definitions follow */
+  
+  extern int errno, sys_nerr;
+  extern char *sys_errlist[];
+  
++ extern void exit P((int)) ;
++ 
+  #define ERR ((errno < sys_nerr) ? sys_errlist[errno] : "")
+! #define INITERR(s) {(void)strcpy(fbuf, cmdname); (void)strcat(fbuf, ": ");\
+! 					(void)strcat(fbuf, (s));}
+! #define ADDERR(s) (void)strcat(fbuf, (s));
+! #define ERROR {(void)strcat(fbuf, "\n");\
+! 				(void)write(2, fbuf, strlen(fbuf)); exit(1);}
+! #define INITWARN(s) {(void)strcpy(fbuf, cmdname);\
+! 					(void)strcat(fbuf, ": (warning) ");\
+! 					(void)strcat(fbuf, (s));}
+! #define ADDWARN(s) (void)strcat(fbuf, (s));
+! #define WARN {(void)strcat(fbuf, "\n"); (void)write(2, fbuf, strlen(fbuf));}
+  
+  int
+! main(argc, argv)
+! int argc;
+! char *argv[];
+  {
+    cmdname = *argv;
+!   while (**argv)
+!     if (*((*argv)++) == '/')
+        cmdname = *argv;               /* find the command's basename */
+! 
+!   if (argc > 1 && !strcmp(argv[1], "-X"))
+!     {
+!       xbitmap++;
+!       argc--;
+!       argv++;
+      }
+  
+!   if (argc > 3)
+!     {
+        INITERR("usage: ")
+        ADDERR(cmdname)
+        ADDERR(" [infile [outfile]]")
+        ERROR
+      }
+  
+!   if ((argc > 1) && strcmp(*++argv, "-"))
+!     {
+        inname = *argv;
+!       if ((infile = open(inname, O_RDONLY)) == -1)
+!         {
+            INITERR(inname)
+            ADDERR(": ")
+            ADDERR(ERR)
+***************
+*** 89,98 ****
+          }
+      }
+  
+!     if (argc > 2) {
+          outname = *++argv;
+!         if ((outfile = open(outname, O_WRONLY | O_CREAT | 
+!                                      O_TRUNC, 0644)) == -1) {
+              INITERR(outname)
+              ADDERR(": ")
+              ADDERR(ERR)
+--- 89,99 ----
+          }
+      }
+  
+!   if (argc > 2)
+!     {
+        outname = *++argv;
+!       if ((outfile = open(outname, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1)
+!         {
+            INITERR(outname)
+            ADDERR(": ")
+            ADDERR(ERR)
+***************
+*** 101,107 ****
+      }
+  
+      (void) ReadBuf();
+!     switch (uncompface(fbuf)) {
+          case -2 : INITERR("internal error")
+                    ERROR
+          case -1 : INITERR(inname)
+--- 102,109 ----
+      }
+  
+    (void) ReadBuf();
+!   switch (uncompface(fbuf))
+!     {
+        case -2 : INITERR("internal error")
+                  ERROR
+        case -1 : INITERR(inname)
+***************
+*** 121,133 ****
+  int
+  WriteBuf()
+  {
+!     char *s, *t;
+!     int len;
+  
+      s = fbuf;
+      t = s + strlen(s);
+!     while (s < t) {
+!         if ((len = write(outfile, s, t - s)) == -1) {
+              INITERR(outname)
+              ADDERR(": ")
+              ADDERR(ERR)
+--- 123,137 ----
+  int
+  WriteBuf()
+  {
+! 	register char *s, *t;
+! 	register int len;
+  
+  	s = fbuf;
+  	t = s + strlen(s);
+! 	while (s < t)
+! 	{
+! 		if ((len = write(outfile, s, t - s)) == -1)
+! 		{
+  			INITERR(outname)
+  			ADDERR(": ")
+  			ADDERR(ERR)
+***************
+*** 135,161 ****
+          }
+          s += len;
+      }
+!     return(0);
+  }
+  
+  
+  int
+  ReadBuf()
+  {
+!     int count, len;
+!     char *t;
+  
+      count = 0;
+      t = fbuf;
+!     while ((len = read(infile, t, FACEBUFLEN - count))) {
+!         if (len == -1) {
+              INITERR(inname)
+              ADDERR(": ")
+              ADDERR(ERR)
+              ERROR
+          }
+          t += len;
+!         if ((count += len) >= FACEBUFLEN) {
+              INITWARN(inname)
+              ADDWARN(" exceeds internal buffer size.  Data may be lost")
+              WARN
+--- 139,168 ----
+  		}
+  		s += len;
+  	}
+! 	return 0;
+  }
+  
+  
+  int
+  ReadBuf()
+  {
+! 	register int count, len;
+! 	register char *t;
+  
+  	count = 0;
+  	t = fbuf;
+! 	while (len = read(infile, t, FACEBUFLEN - count))
+! 	{
+! 		if (len == -1)
+! 		{
+  			INITERR(inname)
+  			ADDERR(": ")
+  			ADDERR(ERR)
+  			ERROR
+  		}
+  		t += len;
+! 		if ((count += len) >= FACEBUFLEN)
+! 		{
+  			INITWARN(inname)
+  			ADDWARN(" exceeds internal buffer size.  Data may be lost")
+  			WARN
+***************
+*** 163,167 ****
+          }
+      }
+      *t = '\0';
+!     return(count);
+  }
+--- 170,174 ----
+  		}
+  	}
+  	*t = '\0';
+! 	return count;
+  }
--- /dev/null
+++ mail/faces/files/patch-cb
@@ -0,0 +1,292 @@
+*** compface/cmain.c	Thu Feb 21 16:42:54 2002
+--- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/cmain.c	Thu Oct 24 03:28:07 1991
+***************
+*** 13,89 ****
+   *  to me, then an attempt will be made to fix them.
+   */
+  
+- #include <stdlib.h>
+- #include <unistd.h>
+  #include <fcntl.h>
+  #include "compface.h"
+  
+! #define  STRCAT        (void) strcat
+! #define  STRCPY        (void) strcpy
+! #define  WRITE         (void) write
+! 
+! /* The buffer is longer than needed to handle sparse input formats */
+! 
+  #define FACEBUFLEN 2048
+  char fbuf[FACEBUFLEN];
+  
+  /* IO file descriptors and their names */
+- 
+  int infile    = 0;
+  char *inname  = "<stdin>";
+  int outfile   = 1;
+  char *outname = "<stdout>";
+  
+! char *cmdname;            /* Basename of executable */
+  
+! /* Error handling definitions follow */
+  
+  extern int errno, sys_nerr;
+  extern char *sys_errlist[];
+  
+  #define ERR         ((errno < sys_nerr) ? sys_errlist[errno] : "")
+! #define INITERR(s)  { \
+!                         STRCPY(fbuf, cmdname); \
+!                         STRCAT(fbuf, ": "); \
+!                         STRCAT(fbuf, (s));\
+!                     }
+! #define ADDERR(s)   STRCAT(fbuf, (s));
+! #define ERROR       { \
+!                         STRCAT(fbuf, "\n"); \
+!                         WRITE(2, fbuf, strlen(fbuf)); \
+!                         exit(1); \
+!                     }
+! #define INITWARN(s) { \
+!                         STRCPY(fbuf, cmdname); \
+!                         STRCAT(fbuf, ": (warning) "); \
+!                         STRCAT(fbuf, (s)); \
+!                     }
+! #define ADDWARN(s)  STRCAT(fbuf, (s));
+! #define WARN        { \
+!                         STRCAT(fbuf, "\n"); \
+!                         WRITE(2, fbuf, strlen(fbuf)); \
+!                     }
+  
+  int
+! main(int argc, char *argv[])
+  {
+      cmdname = *argv;
+!     while (**argv) {
+!         if (*((*argv)++) == '/') {
+!             cmdname = *argv;               /* Find the command's basename */
+!         }
+!     }
+  
+!     if (argc > 3) {
+          INITERR("usage: ")
+          ADDERR(cmdname)
+          ADDERR(" [infile [outfile]]")
+          ERROR
+      }
+  
+!     if ((argc > 1) && strcmp(*++argv, "-")) {
+          inname = *argv;
+!         if ((infile = open(inname, O_RDONLY)) == -1) {
+              INITERR(inname)
+              ADDERR(": ")
+              ADDERR(ERR)
+--- 15,78 ----
+   *  to me, then an attempt will be made to fix them.
+   */
+  
+  #include <fcntl.h>
+  #include "compface.h"
+  
+! /* the buffer is longer than needed to handle sparse input formats */
+  #define FACEBUFLEN 2048
+  char fbuf[FACEBUFLEN];
+  
+  /* IO file descriptors and their names */
+  int infile    = 0;
+  char *inname  = "<stdin>";
+  int outfile   = 1;
+  char *outname = "<stdout>";
+  
+! /* basename of executable */
+! char *cmdname;
+  
+! /* error handling definitions follow */
+  
+  extern int errno, sys_nerr;
+  extern char *sys_errlist[];
+  
++ extern void exit P((int)) ;
++ 
+  #define ERR ((errno < sys_nerr) ? sys_errlist[errno] : "")
+! #define INITERR(s) {(void)strcpy(fbuf, cmdname); (void)strcat(fbuf, ": ");\
+! 					(void)strcat(fbuf, (s));}
+! #define ADDERR(s) (void)strcat(fbuf, (s));
+! #define ERROR {(void)strcat(fbuf, "\n");\
+! 				(void)write(2, fbuf, strlen(fbuf)); exit(1);}
+! #define INITWARN(s) {(void)strcpy(fbuf, cmdname);\
+! 					(void)strcat(fbuf, ": (warning) ");\
+! 					(void)strcat(fbuf, (s));}
+! #define ADDWARN(s) (void)strcat(fbuf, (s));
+! #define WARN {(void)strcat(fbuf, "\n"); (void)write(2, fbuf, strlen(fbuf));}
+  
+  int
+! main(argc, argv)
+! int argc;
+! char *argv[];
+  {
+    cmdname = *argv;
+!   while (**argv)
+!     if (*((*argv)++) == '/')
+!       cmdname = *argv;               /* find the command's basename */
+  
+!   if (argc > 3)
+!     {
+        INITERR("usage: ")
+        ADDERR(cmdname)
+        ADDERR(" [infile [outfile]]")
+        ERROR
+      }
+  
+!   if ((argc > 1) && strcmp(*++argv, "-"))
+!     {
+        inname = *argv;
+!       if ((infile = open(inname, O_RDONLY)) == -1)
+!         {
+            INITERR(inname)
+            ADDERR(": ")
+            ADDERR(ERR)
+***************
+*** 91,100 ****
+          }
+      }
+  
+!     if (argc > 2) {
+          outname = *++argv;
+!         if ((outfile = open(outname, O_WRONLY | O_CREAT | 
+!                                      O_TRUNC, 0644)) == -1) {
+              INITERR(outname)
+              ADDERR(": ")
+              ADDERR(ERR)
+--- 80,90 ----
+          }
+      }
+  
+!   if (argc > 2)
+!     {
+        outname = *++argv;
+!       if ((outfile = open(outname, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1)
+!         {
+            INITERR(outname)
+            ADDERR(": ")
+            ADDERR(ERR)
+***************
+*** 103,109 ****
+      }
+  
+      (void) ReadBuf();
+!     switch (compface(fbuf)) {
+          case -2 : INITERR("internal error")
+                    ERROR
+          case -1 : INITERR(inname)
+--- 93,100 ----
+      }
+  
+    (void) ReadBuf();
+!   switch (compface(fbuf))
+!     {
+        case -2 : INITERR("internal error")
+                  ERROR
+        case -1 : INITERR(inname)
+***************
+*** 123,135 ****
+  int
+  WriteBuf()
+  {
+!     char *s, *t;
+!     int len;
+  
+      s = fbuf;
+      t = s + strlen(s);
+!     while (s < t) {
+!         if ((len = write(outfile, s, t - s)) == -1) {
+              INITERR(outname)
+              ADDERR(": ")
+              ADDERR(ERR)
+--- 114,128 ----
+  int
+  WriteBuf()
+  {
+! 	register char *s, *t;
+! 	register int len;
+  
+  	s = fbuf;
+  	t = s + strlen(s);
+! 	while (s < t)
+! 	{
+! 		if ((len = write(outfile, s, t - s)) == -1)
+! 		{
+  			INITERR(outname)
+  			ADDERR(": ")
+  			ADDERR(ERR)
+***************
+*** 137,163 ****
+          }
+          s += len;
+      }
+!     return(0);
+  }
+  
+  
+  int
+  ReadBuf()
+  {
+!     int count, len;
+!     char *t;
+  
+      count = 0;
+      t = fbuf;
+!     while ((len = read(infile, t, FACEBUFLEN - count))) {
+!         if (len == -1) {
+              INITERR(inname)
+              ADDERR(": ")
+              ADDERR(ERR)
+              ERROR
+          }
+          t += len;
+!         if ((count += len) >= FACEBUFLEN) {
+              INITWARN(inname)
+              ADDWARN(" exceeds internal buffer size.  Data may be lost")
+              WARN
+--- 130,159 ----
+  		}
+  		s += len;
+  	}
+! 	return 0;
+  }
+  
+  
+  int
+  ReadBuf()
+  {
+! 	register int count, len;
+! 	register char *t;
+  
+  	count = 0;
+  	t = fbuf;
+! 	while (len = read(infile, t, FACEBUFLEN - count))
+! 	{
+! 		if (len == -1)
+! 		{
+  			INITERR(inname)
+  			ADDERR(": ")
+  			ADDERR(ERR)
+  			ERROR
+  		}
+  		t += len;
+! 		if ((count += len) >= FACEBUFLEN)
+! 		{
+  			INITWARN(inname)
+  			ADDWARN(" exceeds internal buffer size.  Data may be lost")
+  			WARN
+***************
+*** 165,169 ****
+          }
+      }
+      *t = '\0';
+!     return(count);
+  }
+--- 161,165 ----
+  		}
+  	}
+  	*t = '\0';
+! 	return count;
+  }
--- /dev/null
+++ mail/faces/files/ikon2xbm
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+#  @(#)ikon2xbm 1.4 91/05/06
+#
+#  Copyright (c) Steve Kinzler - March 1991.
+#
+#  Permission is given to distribute these sources, as long as the
+#  copyright messages are not removed, and no monies are exchanged.
+#
+#  No responsibility is taken for any errors on inaccuracies inherent
+#  either to the comments or the code of this program, but if reported
+#  to me, then an attempt will be made to fix them.
+
+PATH=$PATH:/usr/bin/X11; export PATH
+
+# ikon2xbm - convert a square Blit ikon bitmap to an X11 bitmap
+# stdin/stdout filter
+# requires some bitmap filters from the pbmplus package
+# assumes 16 valid data bits per item, 1 depth bit, and width = height
+# kludge by kinzler at cs.indiana.edu
+
+tmp=/tmp/ikon2xbm$$
+trap "rm -f $tmp; exit" 0 1 2 13 15
+
+sed -e 's/\(0x....\),\(0x....\),\(0x....\),/\1\
+\2\
+\3/' > $tmp
+
+dim=`wc -l < $tmp | awk '{ print 4 * sqrt(144) }'`
+
+pr -l1 -t -8 -s, < $tmp |
+(cat << EOF
+/* Format_version=1, Width=$dim, Height=$dim, Depth=1, Valid_bits_per_item=16
+ */
+EOF
+sed -e 's/^/	/' -e 's/$/,/' -e '$s/,$//') |
+icontopbm |
+pbmtoxbm
--- /dev/null
+++ mail/faces/files/patch-ca
@@ -0,0 +1,447 @@
+*** compface/arith.c	Tue Jan 15 23:58:46 2002
+--- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/arith.c	Thu Oct 24 03:28:07 1991
+***************
+*** 17,33 ****
+  #include "compface.h"
+  
+  void
+! RevPush(Prob *p)
+  {
+!     if (NumProbs >= PIXELS * 2 - 1) {
+          longjmp(comp_env, ERR_INTERNAL);
+-     }
+      ProbBuf[NumProbs++] = p;
+  }
+  
+-  
+  void
+! BigPush(Prob *p)
+  {
+      static WORD tmp;
+  
+--- 16,32 ----
+  #include "compface.h"
+  
+  void
+! RevPush(p)
+! Prob *p;
+  {
+! 	if (NumProbs >= PIXELS * 2 - 1)
+  		longjmp(comp_env, ERR_INTERNAL);
+  	ProbBuf[NumProbs++] = p;
+  }
+   
+  void
+! BigPush(p)
+! Prob *p;
+  {
+  	static WORD tmp;
+  
+***************
+*** 36,76 ****
+      BigAdd(tmp + p->p_offset);
+  }
+  
+- 
+  int
+! BigPop(Prob *p)
+  {
+      static WORD tmp;
+!     int i;
+  
+      BigDiv(0, &tmp);
+      i = 0;
+!     while ((tmp < p->p_offset) || (tmp >= p->p_range + p->p_offset)) {
+          p++;
+          i++;
+      }
+      BigMul(p->p_range);
+      BigAdd(tmp - p->p_offset);
+!     return(i);
+  }
+  
+- 
+  #ifdef DEBUG
+  void
+! BigPrint()              /* Print a BigInt in HexaDecimal. */
+  {
+!     int i, c, count;
+!     WORD *w;
+  
+      count = 0;
+      w = B.b_word + (i = B.b_words);
+!     while (i--) {
+          w--;
+          c = *((*w >> 4) + HexDigits);
+          putc(c, stderr);
+          c = *((*w & 0xf) + HexDigits);
+          putc(c, stderr);
+!         if (++count >= 36) {
+              putc('\\', stderr);
+              putc('\n', stderr);
+              count = 0;
+--- 35,79 ----
+  	BigAdd(tmp + p->p_offset);
+  }
+  
+  int
+! BigPop(p)
+! register Prob *p; 
+  {
+  	static WORD tmp;
+! 	register int i;
+  
+  	BigDiv(0, &tmp);
+  	i = 0;
+! 	while ((tmp < p->p_offset) || (tmp >= p->p_range + p->p_offset))
+! 	{
+  		p++;
+  		i++;
+  	}
+  	BigMul(p->p_range);
+  	BigAdd(tmp - p->p_offset);
+! 	return i;
+  }
+  
+  #ifdef DEBUG
++ /* Print a BigInt in HexaDecimal
++  */
+  void
+! BigPrint()
+  {
+! 	register int i, c, count;
+! 	register WORD *w;
+  
+  	count = 0;
+  	w = B.b_word + (i = B.b_words);
+! 	while (i--)
+! 	{
+  		w--;
+  		c = *((*w >> 4) + HexDigits);
+  		putc(c, stderr);
+  		c = *((*w & 0xf) + HexDigits);
+  		putc(c, stderr);
+! 		if (++count >= 36)
+! 		{
+  			putc('\\', stderr);
+  			putc('\n', stderr);
+  			count = 0;
+***************
+*** 78,110 ****
+      }
+      putc('\n', stderr);
+  }
+! #endif /*DEBUG*/
+! 
+  
+  /* Divide B by a storing the result in B and the remainder in the word
+!  * pointer to by r.
+   */
+- 
+  void
+! BigDiv(WORD a, WORD *r)
+  {
+!     int i;
+!     WORD *w;
+!     COMP c, d;
+  
+      a &= WORDMASK;
+!     if ((a == 1) || (B.b_words == 0)) {
+          *r = 0;
+          return;
+      }
+! 
+! /* Treat this as a == WORDCARRY and just shift everything right a WORD */
+! 
+!     if (a == 0)    {
+          i = --B.b_words;
+          w = B.b_word;
+          *r = *w;
+!         while (i--) {
+              *w = *(w + 1);
+              w++;
+          }
+--- 81,112 ----
+  	}
+  	putc('\n', stderr);
+  }
+! #endif
+  
+  /* Divide B by a storing the result in B and the remainder in the word
+!  * pointer to by r
+   */
+  void
+! BigDiv(a, r)
+! register WORD a, *r;
+  {
+! 	register int i;
+! 	register WORD *w;
+! 	register COMP c, d;
+  
+  	a &= WORDMASK;
+! 	if ((a == 1) || (B.b_words == 0))
+! 	{
+  		*r = 0;
+  		return;
+  	}
+! 	if (a == 0)	/* treat this as a == WORDCARRY */
+! 	{			/* and just shift everything right a WORD */
+  		i = --B.b_words;
+  		w = B.b_word;
+  		*r = *w;
+! 		while (i--)
+! 		{
+  			*w = *(w + 1);
+  			w++;
+  		}
+***************
+*** 113,154 ****
+      }
+      w = B.b_word + (i = B.b_words);
+      c = 0;
+!     while (i--) {
+          c <<= BITSPERWORD;
+!         c += (COMP) *--w;
+!         d = c / (COMP) a;
+!         c = c % (COMP) a;
+!         *w = (WORD) (d & WORDMASK);
+      }
+      *r = c;
+!     if (B.b_word[B.b_words - 1] == 0) {
+          B.b_words--;
+-     }
+  }
+  
+! 
+! /* Multiply a by B storing the result in B. */
+! 
+  void
+! BigMul(WORD a)
+  {
+!     int i;
+!     WORD *w;
+!     COMP c;
+  
+      a &= WORDMASK;
+!     if ((a == 1) || (B.b_words == 0)) {
+          return;
+!     }
+! 
+! /* Treat this as a == WORDCARRY and just shift everything left a WORD */
+! 
+!     if (a == 0) {
+!         if ((i = B.b_words++) >= MAXWORDS - 1) {
+              longjmp(comp_env, ERR_INTERNAL);
+-         }
+          w = B.b_word + i;
+!         while (i--) {
+              *w = *(w - 1);
+              w--;
+          }
+--- 115,153 ----
+  	}
+  	w = B.b_word + (i = B.b_words);
+  	c = 0;
+! 	while (i--)
+! 	{
+  		c <<= BITSPERWORD;
+! 		c += (COMP)*--w;
+! 		d = c / (COMP)a;
+! 		c = c % (COMP)a;
+! 		*w = (WORD)(d & WORDMASK);
+  	}
+  	*r = c;
+! 	if (B.b_word[B.b_words - 1] == 0)
+  		B.b_words--;
+  }
+  
+! /* Multiply a by B storing the result in B
+!  */
+  void
+! BigMul(a)
+! register WORD a;
+  {
+! 	register int i;
+! 	register WORD *w;
+! 	register COMP c;
+  
+  	a &= WORDMASK;
+! 	if ((a == 1) || (B.b_words == 0))
+  		return;
+! 	if (a == 0)	/* treat this as a == WORDCARRY */
+! 	{			/* and just shift everything left a WORD */
+! 		if ((i = B.b_words++) >= MAXWORDS - 1)
+  			longjmp(comp_env, ERR_INTERNAL);
+  		w = B.b_word + i;
+! 		while (i--)
+! 		{
+  			*w = *(w - 1);
+  			w--;
+  		}
+***************
+*** 158,239 ****
+      i = B.b_words;
+      w = B.b_word;
+      c = 0;
+!     while (i--) {
+          c += (COMP)*w * (COMP)a;
+          *(w++) = (WORD)(c & WORDMASK);
+          c >>= BITSPERWORD;
+      }
+!     if (c) {
+!         if (B.b_words++ >= MAXWORDS) {
+              longjmp(comp_env, ERR_INTERNAL);
+-         }
+          *w = (COMP)(c & WORDMASK);
+      }
+  }
+  
+! 
+! /* Subtract a from B storing the result in B. */
+! 
+  void
+! BigSub(WORD a)
+  {
+!     int i;
+!     WORD *w;
+!     COMP c;
+  
+      a &= WORDMASK;
+!     if (a == 0) {
+          return;
+-     }
+      i = 1;
+      w = B.b_word;
+!     c = (COMP) *w - (COMP) a;
+!     *w = (WORD) (c & WORDMASK);
+!     while (c & WORDCARRY) {
+!         if (i >= B.b_words) {
+              longjmp(comp_env, ERR_INTERNAL);
+!         }
+!         c = (COMP) *++w - 1;
+!         *w = (WORD) (c & WORDMASK);
+          i++;
+      }
+!     if ((i == B.b_words) && (*w == 0) && (i > 0)) {
+          B.b_words--;
+-     }
+  }
+  
+! 
+! /* Add to a to B storing the result in B. */
+! 
+  void
+! BigAdd(WORD a)
+  {
+!     int i;
+!     WORD *w;
+!     COMP c;
+  
+      a &= WORDMASK;
+!     if (a == 0) {
+          return;
+-     }
+      i = 0;
+      w = B.b_word;
+      c = a;
+!     while ((i < B.b_words) && c) {
+!         c += (COMP) *w;
+!         *w++ = (WORD) (c & WORDMASK);
+          c >>= BITSPERWORD;
+          i++;
+      }
+!     if ((i == B.b_words) && c) {
+!         if (B.b_words++ >= MAXWORDS) {
+              longjmp(comp_env, ERR_INTERNAL);
+!         }
+!         *w = (COMP) (c & WORDMASK);
+      }
+  }
+  
+- 
+  void
+  BigClear()
+  {
+--- 157,238 ----
+  	i = B.b_words;
+  	w = B.b_word;
+  	c = 0;
+! 	while (i--)
+! 	{
+  		c += (COMP)*w * (COMP)a;
+  		*(w++) = (WORD)(c & WORDMASK);
+  		c >>= BITSPERWORD;
+  	}
+! 	if (c)
+! 	{
+! 		if (B.b_words++ >= MAXWORDS)
+  			longjmp(comp_env, ERR_INTERNAL);
+  		*w = (COMP)(c & WORDMASK);
+  	}
+  }
+  
+! #if 0
+! /* Subtract a from B storing the result in B
+!  */
+  void
+! BigSub(a)
+! WORD a;
+  {
+! 	register int i;
+! 	register WORD *w;
+! 	register COMP c;
+  
+  	a &= WORDMASK;
+! 	if (a == 0)
+  		return;
+  	i = 1;
+  	w = B.b_word;
+! 	c = (COMP)*w - (COMP)a;
+! 	*w = (WORD)(c & WORDMASK);
+! 	while (c & WORDCARRY)
+! 	{
+! 		if (i >= B.b_words)
+  			longjmp(comp_env, ERR_INTERNAL);
+! 		c = (COMP)*++w - 1;
+! 		*w = (WORD)(c & WORDMASK);
+  		i++;
+  	}
+! 	if ((i == B.b_words) && (*w == 0) && (i > 0))
+  		B.b_words--;
+  }
++ #endif
+  
+! /* Add to a to B storing the result in B
+!  */
+  void
+! BigAdd(a)
+! WORD a;
+  {
+! 	register int i;
+! 	register WORD *w;
+! 	register COMP c;
+  
+  	a &= WORDMASK;
+! 	if (a == 0)
+  		return;
+  	i = 0;
+  	w = B.b_word;
+  	c = a;
+! 	while ((i < B.b_words) && c)
+! 	{
+! 		c += (COMP)*w;
+! 		*w++ = (WORD)(c & WORDMASK);
+  		c >>= BITSPERWORD;
+  		i++;
+  	}
+! 	if ((i == B.b_words) && c)
+! 	{
+! 		if (B.b_words++ >= MAXWORDS)
+  			longjmp(comp_env, ERR_INTERNAL);
+! 		*w = (COMP)(c & WORDMASK);
+  	}
+  }
+  
+  void
+  BigClear()
+  {
--- /dev/null
+++ mail/faces/files/patch-cd
@@ -0,0 +1,40 @@
+*** compface/compface.c	Thu Feb 21 16:42:54 2002
+--- /home/lkoeller/tmp/ports/mail/faces/work/faces/compface/compface.c	Wed Jun 19 08:29:12 1991
+***************
+*** 14,29 ****
+   *  to me, then an attempt will be made to fix them.
+   */
+  
+  #include "compface.h"
+- #include "vars.h"
+  
+  int
+! compface(char *fbuf)
+  {
+!     if (!(status = setjmp(comp_env))) {
+          ReadFace(fbuf);
+          GenFace();
+          CompAll(fbuf);
+      }
+!     return(status);
+  }
+--- 13,31 ----
+   *  to me, then an attempt will be made to fix them.
+   */
+  
++ #define MAIN
++ 
+  #include "compface.h"
+  
+  int
+! compface(fbuf)
+! char *fbuf;
+  {
+! 	if (!(status = setjmp(comp_env)))
+! 	{
+  		ReadFace(fbuf);
+  		GenFace();
+  		CompAll(fbuf);
+  	}
+! 	return status;
+  }
--- /dev/null
+++ mail/faces/files/xbmsize48
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+#  @(#)xbmsize48 1.3 91/11/19
+#
+#  Copyright (c) Steve Kinzler - April 1991.
+#
+#  Permission is given to distribute these sources, as long as the
+#  copyright messages are not removed, and no monies are exchanged.
+#
+#  No responsibility is taken for any errors on inaccuracies inherent
+#  either to the comments or the code of this program, but if reported
+#  to me, then an attempt will be made to fix them.
+
+PATH=$PATH:/usr/bin/X11; export PATH
+
+size=48
+
+# xbmsize48 - size an X11 bitmap to 48x48
+#
+# If the bitmaps exceeds 48 pixels in either dimension it is scaled down
+# to 48 pixels.  Then, the bitmap is pasted into the upper left corner of
+# a 48x48 blank bitmap.
+#
+# A stdin/stdout filter.
+# Requires filters from the pbmplus package.
+#
+# Steve Kinzler, kinzler at cs.indiana.edu, March 1991
+
+tmp=/tmp/xbmsize48.$$
+tmp2=/tmp/xbmsize48.2.$$
+trap "rm -f $tmp $tmp2; exit" 0 1 2 13 15
+
+cat > $tmp || exit
+
+eval `sed -n 's/^#define.*_width[ 	]*\([0-9]*\).*$/w=\1/p
+	      s/^#define.*_height[ 	]*\([0-9]*\).*$/h=\1/p
+	      /{/q' $tmp`
+
+if test $w -gt $size -o $h -gt $size
+then
+	if test $w -ge $h
+	then	dim=xsize
+	else	dim=ysize
+	fi
+
+	xbmtopbm < $tmp | ppmscale -$dim $size |
+	ppmtopgm | pgmtopbm | pbmtoxbm > $tmp2
+	mv $tmp2 $tmp
+fi
+
+xbmtopbm < $tmp > $tmp2
+pbmmake $size $size | pnmpaste $tmp2 0 0 | pbmtoxbm


More information about the Midnightbsd-cvs mailing list