[comp.sources.misc] Diffs for fnkey 1.2 upgrade

mark@cogent.UUCP (Captain Neptune) (09/04/87)

Enclosed is a shar file which contains diffs for both the source code
file and manual page for 'fnkey'.  Fnkey is a program for programming
function keys on HP-compatible terminals.  If you want it and missed it,
send me email.  The upgrade includes a new option '-q' which will make
'fnkey' run quietly (i.e. supress complaints and error messages), and a
bug where the '%' character was swallowed is now fixed.  A bug remains
where ^S cannot be part of the string programmed into a function key.
Maybe that'll be fixed in 1.3...

----------- cut here ----------------- cut here ----------------- cut here 
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	fnkey.1.diff
#	fnkey.c.diff
# This archive created: Fri Aug 21 15:19:38 1987
export PATH; PATH=/bin:/usr/bin:$PATH
echo shar: "extracting 'fnkey.1.diff'" '(868 characters)'
if test -f 'fnkey.1.diff'
then
	echo shar: "will not over-write existing file 'fnkey.1.diff'"
else
sed 's/^X//' << \SHAR_EOF > 'fnkey.1.diff'
X7c7
X< [ \fIfk_file\fR ]
X---
X> [ -q ] [ \fIfk_file\fR ]
X22c22,25
X< standard input is read instead.
X---
X> standard input is read instead.  When the optional '\fB\-q\fR'
X> argument is included,
X> .B fnkey
X> runs quietly, supressing error messages.
X137a141,147
X> .SH RETURN CODES
X> An exit code of zero is returned if
X> .B fnkey
X> runs uneventfully (even if some lines in the definition file are
X> rejected), and an exit code of one is returned if a hard error
X> occurs such as not finding a file or having an inadequate terminal
X> type.
X143a154,158
X> .PP
X> Some key sequences can be programmed into a function key, but will fail
X> to work due to an application discarding part of what was sent.
X> .B Fnkey
X> cannot help this.
X160a176,178
X> .PP
X> Don't include any '\fB^\S\fR' characters in the definition file (or
X> standard input).  It will probably hang your terminal.
SHAR_EOF
if test 868 -ne "`wc -c < 'fnkey.1.diff'`"
then
	echo shar: "error transmitting 'fnkey.1.diff'" '(should have been 868 characters)'
fi
fi
echo shar: "extracting 'fnkey.c.diff'" '(1627 characters)'
if test -f 'fnkey.c.diff'
then
	echo shar: "will not over-write existing file 'fnkey.c.diff'"
else
sed 's/^X//' << \SHAR_EOF > 'fnkey.c.diff'
X38a39,40
X> #include <ctype.h>	/* only needed on some systems to include toupper(), */
X> 			/* it can be commented out if compile problems arise */
X42a45
X> int	quiet = 0;
X46a50
X> 	"hp150",
X55c59,60
X< 	int	i, fd, termok = 0;
X---
X> 	int	i, fd, args, file_ok = 0, termok = 0;
X> 
X63,69c68,69
X< 	if (termok != 1) {
X< 		fprintf(stderr, "%s: Inadequate terminal type '%s'\n", argv[0], getenv("TERM"));
X< 		exit(1);
X< 	}
X< 
X< 	if (argc == 2) {
X< 		if (strcmp(argv[1], "-") == 0) {	/* hook stdin to fd */
X---
X> 	for (args = 1; args <= argc-1; args++) {
X> 		if (strcmp(argv[args], "-") == 0) {	/* hook stdin to fd */
X72c72,75
X< 		} else {		/* open normal file */
X---
X> 			file_ok = 1;
X> 		} else if (strcmp(argv[args], "-q") == 0) {	/* quiet mode */
X> 			quiet = 1;
X> 		} else {				/* open normal file */
X73a77
X> 			file_ok = 1;
X75c79,87
X< 	} else {
X---
X> 	}
X> 
X> 	if (termok != 1) {
X> 		if (quiet == 0)
X> 			fprintf(stderr, "%s: Inadequate terminal type '%s'\n", argv[0], getenv("TERM"));
X> 		exit(1);
X> 	}
X> 
X> 	if (file_ok == 0) {		/* open default file if needed */
X77a90
X> 
X79c92,93
X< 		fprintf(stderr, "%s: Cannot open any source file\n", argv[0]);
X---
X> 		if (quiet == 0)
X> 			fprintf(stderr, "%s: Cannot open any source file\n", argv[0]);
X128a143
X> 	int	i, j;
X139a155,163
X> 	i = 0;
X> 	do {
X> 		if (string[i] == '%') {
X> 			for (j=strlen(string)+1; j != i; j--)
X> 				string[j] = string[j-1];
X> 			i++;
X> 		}
X> 		i++;
X> 	} while (i < strlen(string));
X156c180,181
X< 	fprintf(stderr, "%s: Invalid entry for key '%s'\n", pgname, k);
X---
X> 	if (quiet == 0)
X> 		fprintf(stderr, "%s: Invalid entry for key '%s'\n", pgname, k);
X275d299
X< 
SHAR_EOF
if test 1627 -ne "`wc -c < 'fnkey.c.diff'`"
then
	echo shar: "error transmitting 'fnkey.c.diff'" '(should have been 1627 characters)'
fi
fi
exit 0
#	End of shell archive
----------- cut here ----------------- cut here ----------------- cut here 
Newsgroups: comp.sources.misc
Subject: Diffs for fnkey 1.2 upgrade
Expires: 
References: 
Sender: 
Reply-To: mark@cogent.UUCP (Mark Steven Jeghers)
Followup-To: 
Distribution: world
Organization: Cogent Software Solutions, Stockton, CA
Keywords: new feature + bug fix

Enclosed is a shar file which contains diffs for both the source code
file and manual page for 'fnkey'.  Fnkey is a program for programming
function keys on HP-compatible terminals.  If you want it and missed it,
send me email.  The upgrade includes a new option '-q' which will make
'fnkey' run quietly (i.e. supress complaints and error messages), and a
bug where the '%' character was swallowed is now fixed.  A bug remains
where ^S cannot be part of the string programmed into a function key.
Maybe that'll be fixed in 1.3...

----------- cut here ----------------- cut here ----------------- cut here 
#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	fnkey.1.diff
#	fnkey.c.diff
# This archive created: Fri Aug 21 15:19:38 1987
export PATH; PATH=/bin:/usr/bin:$PATH
echo shar: "extracting 'fnkey.1.diff'" '(868 characters)'
if test -f 'fnkey.1.diff'
then
	echo shar: "will not over-write existing file 'fnkey.1.diff'"
else
sed 's/^X//' << \SHAR_EOF > 'fnkey.1.diff'
X7c7
X< [ \fIfk_file\fR ]
X---
X> [ -q ] [ \fIfk_file\fR ]
X22c22,25
X< standard input is read instead.
X---
X> standard input is read instead.  When the optional '\fB\-q\fR'
X> argument is included,
X> .B fnkey
X> runs quietly, supressing error messages.
X137a141,147
X> .SH RETURN CODES
X> An exit code of zero is returned if
X> .B fnkey
X> runs uneventfully (even if some lines in the definition file are
X> rejected), and an exit code of one is returned if a hard error
X> occurs such as not finding a file or having an inadequate terminal
X> type.
X143a154,158
X> .PP
X> Some key sequences can be programmed into a function key, but will fail
X> to work due to an application discarding part of what was sent.
X> .B Fnkey
X> cannot help this.
X160a176,178
X> .PP
X> Don't include any '\fB^\S\fR' characters in the definition file (or
X> standard input).  It will probably hang your terminal.
SHAR_EOF
if test 868 -ne "`wc -c < 'fnkey.1.diff'`"
then
	echo shar: "error transmitting 'fnkey.1.diff'" '(should have been 868 characters)'
fi
fi
echo shar: "extracting 'fnkey.c.diff'" '(1627 characters)'
if test -f 'fnkey.c.diff'
then
	echo shar: "will not over-write existing file 'fnkey.c.diff'"
else
sed 's/^X//' << \SHAR_EOF > 'fnkey.c.diff'
X38a39,40
X> #include <ctype.h>	/* only needed on some systems to include toupper(), */
X> 			/* it can be commented out if compile problems arise */
X42a45
X> int	quiet = 0;
X46a50
X> 	"hp150",
X55c59,60
X< 	int	i, fd, termok = 0;
X---
X> 	int	i, fd, args, file_ok = 0, termok = 0;
X> 
X63,69c68,69
X< 	if (termok != 1) {
X< 		fprintf(stderr, "%s: Inadequate terminal type '%s'\n", argv[0], getenv("TERM"));
X< 		exit(1);
X< 	}
X< 
X< 	if (argc == 2) {
X< 		if (strcmp(argv[1], "-") == 0) {	/* hook stdin to fd */
X---
X> 	for (args = 1; args <= argc-1; args++) {
X> 		if (strcmp(argv[args], "-") == 0) {	/* hook stdin to fd */
X72c72,75
X< 		} else {		/* open normal file */
X---
X> 			file_ok = 1;
X> 		} else if (strcmp(argv[args], "-q") == 0) {	/* quiet mode */
X> 			quiet = 1;
X> 		} else {				/* open normal file */
X73a77
X> 			file_ok = 1;
X75c79,87
X< 	} else {
X---
X> 	}
X> 
X> 	if (termok != 1) {
X> 		if (quiet == 0)
X> 			fprintf(stderr, "%s: Inadequate terminal type '%s'\n", argv[0], getenv("TERM"));
X> 		exit(1);
X> 	}
X> 
X> 	if (file_ok == 0) {		/* open default file if needed */
X77a90
X> 
X79c92,93
X< 		fprintf(stderr, "%s: Cannot open any source file\n", argv[0]);
X---
X> 		if (quiet == 0)
X> 			fprintf(stderr, "%s: Cannot open any source file\n", argv[0]);
X128a143
X> 	int	i, j;
X139a155,163
X> 	i = 0;
X> 	do {
X> 		if (string[i] == '%') {
X> 			for (j=strlen(string)+1; j != i; j--)
X> 				string[j] = string[j-1];
X> 			i++;
X> 		}
X> 		i++;
X> 	} while (i < strlen(string));
X156c180,181
X< 	fprintf(stderr, "%s: Invalid entry for key '%s'\n", pgname, k);
X---
X> 	if (quiet == 0)
X> 		fprintf(stderr, "%s: Invalid entry for key '%s'\n", pgname, k);
X275d299
X< 
SHAR_EOF
if test 1627 -ne "`wc -c < 'fnkey.c.diff'`"
then
	echo shar: "error transmitting 'fnkey.c.diff'" '(should have been 1627 characters)'
fi
fi
exit 0
#	End of shell archive
----------- cut here ----------------- cut here ----------------- cut here