jimj@iwtpm.ATT.COM (jennings james) (09/03/88)
I pulled this litle gem off the misc. sources netnews and it works fine
with/under MINIX. It's not quite offical SYS V but it banners and
even appears on the screen just a little bit neater. Enjoy.
Jim Jennings
AT&T Bell Laboratories
1100 E. Warrenville Road, IW-1E-429
Naperville, Ill. 60556
(312) 979-7648
att!iwtjj!jimj
---- CUT HERE ----
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of shell archive."
# Contents: banner.c
# Wrapped by minix@iwtjj on Mon Aug 1 21:13:32 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'banner.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'banner.c'\"
else
echo shar: Extracting \"'banner.c'\" \(6337 characters\)
sed "s/^X//" >'banner.c' <<'END_OF_FILE'
X/*****************************************************************
X *
X * SYSVbanner.c
X *
X * This is a PD version of the SYS V banner program (at least I think
X * it is compatible to SYS V) which I wrote to use with the clock
X * program written by:
X ** DCF, Inc.
X ** 14623 North 49th Place
X ** Scottsdale, AZ 85254
X * and published in the net comp.sources.misc newsgroup in early July
X * since the BSD banner program works quite differently.
X *
X * There is no copyright or responsibility accepted for the use
X * of this software.
X *
X * Brian Wallis, brw@jim.odr.oz, 4 July 1988
X *
X *****************************************************************/
X
X#include <stdio.h>
X#include <string.h>
X
Xchar *glyphs[] = {
X" @@@ @@@ @@@ @ @ @@@@@ @@@ @ @@ @@@ ",
X" @@@ @@@ @@@ @ @ @ @ @@ @ @ @ @ @@@ ",
X" @@@ @ @ @@@@@@@@ @ @@@ @ @@ @ ",
X" @ @ @ @@@@@ @ @@@ @ ",
X" @@@@@@@ @ @ @ @@@@ @ @ ",
X" @@@ @ @ @ @ @ @ @ @@ @ ",
X" @@@ @ @ @@@@@ @ @@@ @@@@ @ ",
X
X" @@ @@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@ @ @ @ @ @",
X" @@@@@ @ @ @ @@@@@ @ @ @ @ @ @ @ @@ @",
X" @ @ @ @ @ @ @ @ @ @ @ @ @@ @@",
X" @ @@@ @ @ @ @@@@ @ @@@@ @@ @ @",
X
X" @@@ @ @@@ @@ @ @ @ @",
X" @ @ @ @ @@@@@@ @ @ @ @ @ @ @ @ @ ",
X" @ @ @ @ @ @ @ @ @@ @ @ @ @",
X" @@ @ @ @@ @@ @ @ @ ",
X" @@ @ @ @ @ @ @ @ @ @",
X" @ @ @ @ @ @ @ @ @ @ ",
X" @ @ @ @@@@@@ @@@ @ @@@ @ @ @ @"};
X
X
Xmain(argc,argv)
Xint argc;
Xchar *argv[];
X{
X int a,b,c,len,ind;
X char line[80];
X
X for(argv++;--argc;argv++){
X len=strlen(*argv);
X if(len>10)
X len=10;
X for(a=0;a<7;a++){
X for(b=0;b<len;b++){
X if((ind=(*argv)[b]-' ')<0)
X ind=0;
X for(c=0;c<7;c++){
X line[b*8+c] = glyphs[(ind/8*7)+a][(ind%8*7)+c];
X }
X line[b*8+7] = ' ';
X }
X for(b=len*8-1;b>=0;b--){
X if(line[b]!=' ')
X break;
X line[b]='\0';
X }
X printf("%s\n", line);
X }
X printf("\n");
X }
X}
END_OF_FILE
if test 6337 -ne `wc -c <'banner.c'`; then
echo shar: \"'banner.c'\" unpacked with wrong size!
fi
# end of 'banner.c'
fi
echo shar: End of shell archive.
exit 0