[comp.sources.bugs] bpe patch

lee@uhccux.uhcc.hawaii.edu (Greg Lee) (07/03/88)

The bpe program just posted to comp.sources.misc works better on
Ultrix 2.2 with the following patches, which define values for
KEY_{UP,DOWN,LEFT,RIGHT}, beep(), and use "crmode()" instead
of "cbreak()".
		Greg, lee@uhccux.uhcc.hawaii.edu

#! /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 archive 1 (of 1)."
# Contents:  bpe.patch
# Wrapped by lee@uhccux on Sat Jul  2 18:01:43 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'bpe.patch' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bpe.patch'\"
else
echo shar: Extracting \"'bpe.patch'\" \(3492 characters\)
sed "s/^X//" >'bpe.patch' <<'END_OF_FILE'
X*** makefile	Sat Jul  2 17:44:12 1988
X--- Makefile	Sat Jul  2 17:12:43 1988
X***************
X*** 1,5
X  CFLAGS = -O 
X! LIBES = -lcurses
X  OBJS = bpe.o
X  SRCS = bpe.c
X  EXEC = bpe
X
X--- 1,5 -----
X  CFLAGS = -O 
X! LIBES = -lcurses -ltermcap
X  OBJS = bpe.o
X  SRCS = bpe.c
X  EXEC = bpe
X*** bpe.c.orig	Sat Jul  2 17:44:13 1988
X--- bpe.c	Sat Jul  2 17:55:56 1988
X***************
X*** 31,36
X  #define ASCY	6
X  #define HEXY	6
X  #define HEXX	12
X  
X  int     path;                   /* path to file to patch */
X  long	filpos;			/* position in file */
X
X--- 31,40 -----
X  #define ASCY	6
X  #define HEXY	6
X  #define HEXX	12
X+ #define KEY_UP  'k'
X+ #define KEY_DOWN 'j'
X+ #define KEY_RIGHT 'l'
X+ #define KEY_LEFT 'h'
X  
X  int     path;                   /* path to file to patch */
X  long	filpos;			/* position in file */
X***************
X*** 58,64
X  	refresh();
X  	signal(SIGINT,donix);
X  	signal(SIGQUIT,donix);
X! 	cbreak();                       /* set single char input */
X  	noecho();
X  	keypad(stdscr,TRUE);
X  	filpos = 0;			/* set global position to 0 */
X
X--- 62,69 -----
X  	refresh();
X  	signal(SIGINT,donix);
X  	signal(SIGQUIT,donix);
X! /*	cbreak(); */                      /* set single char input */
X! 	crmode();
X  	noecho();
X  /*	keypad(stdscr,TRUE); -- gl */
X  	filpos = 0;			/* set global position to 0 */
X***************
X*** 60,66
X  	signal(SIGQUIT,donix);
X  	cbreak();                       /* set single char input */
X  	noecho();
X! 	keypad(stdscr,TRUE);
X  	filpos = 0;			/* set global position to 0 */
X  	length = 0;
X  	command();
X
X--- 65,71 -----
X  /*	cbreak(); */                      /* set single char input */
X  	crmode();
X  	noecho();
X! /*	keypad(stdscr,TRUE); -- gl */
X  	filpos = 0;			/* set global position to 0 */
X  	length = 0;
X  	command();
X***************
X*** 64,69
X  	filpos = 0;			/* set global position to 0 */
X  	length = 0;
X  	command();
X  	endwin();
X  	close(path);
X  }
X
X--- 69,75 -----
X  	filpos = 0;			/* set global position to 0 */
X  	length = 0;
X  	command();
X+ 	nocrmode();
X  	endwin();
X  	close(path);
X  }
X***************
X*** 83,88
X  		switch (inval) {
X  			case 'q':
X  			case 'Q':
X  				break;
X  			case 'h':
X  			case 'H':
X
X--- 89,96 -----
X  		switch (inval) {
X  			case 'q':
X  			case 'Q':
X+ 				move(23,0);
X+ 				refresh();
X  				break;
X  			case 'h':
X  			case 'H':
X***************
X*** 144,149
X  	move(2,0);
X  	clrtoeol();
X  	printw("End editing with CNTRL-C");
X  	curx = cury = 0;
X  	while (inval != 0x03) {
X  		move(ASCY+cury,ASCX+curx);
X
X--- 152,158 -----
X  	move(2,0);
X  	clrtoeol();
X  	printw("End editing with CNTRL-C");
X+ 	raw();
X  	curx = cury = 0;
X  	while (inval != 0x03) {
X  		move(ASCY+cury,ASCX+curx);
X***************
X*** 189,194
X  				break;
X  			}
X  		}
X  	move(2,0);
X  	clrtoeol();
X  }
X
X--- 198,204 -----
X  				break;
X  			}
X  		}
X+ 	noraw();
X  	move(2,0);
X  	clrtoeol();
X  }
X***************
X*** 242,247
X  	move(2,0);
X  	clrtoeol();
X  	printw("End editing with CNTRL-C");
X  	curx = cury = 0;
X  	while (inval != -1) {
X  		move(HEXY+cury,HEXX+curx*3);
X
X--- 252,258 -----
X  	move(2,0);
X  	clrtoeol();
X  	printw("End editing with CNTRL-C");
X+ 	raw();
X  	curx = cury = 0;
X  	while (inval != -1) {
X  		move(HEXY+cury,HEXX+curx*3);
X***************
X*** 287,292
X  				break;
X  			}
X  		}
X  	move(2,0);
X  	clrtoeol();
X  }
X
X--- 298,304 -----
X  				break;
X  			}
X  		}
X+ 	noraw();
X  	move(2,0);
X  	clrtoeol();
X  }
X***************
X*** 487,489
X  {
X  	signal(sig,donix);
X  }
X
X--- 499,507 -----
X  {
X  	signal(sig,donix);
X  }
X+ 
X+ beep()
X+ {
X+ 	putchar(7);
X+ }
X+ 
END_OF_FILE
if test 3492 -ne `wc -c <'bpe.patch'`; then
    echo shar: \"'bpe.patch'\" unpacked with wrong size!
fi
# end of 'bpe.patch'
fi
echo shar: End of archive 1 \(of 1\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have the archive.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0