context diffs for vn on sysV (here they are)
Andrew H. Marrinson
andy at icom.UUCP
Sat Sep 6 01:06:15 AEST 1986
I've had many requests, so here are the context diffs to make vn work on
system V. The changes were made to the files tty_set.c and sig_set.c. In
addition, a change was made to storage.c to handle some NULL pointers that
were being handed to it; this change may be useful on other versions of Unix
as well. Also included is a makefile for system V.
These changes were made by our resident port-o-matic expert, Peter Kerrigan.
I have directed replies to him, however I make no guarantee that he will be
interested in answering questions...
--------------------------- cut here, run through sh ----------------------
#! /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 the files:
# makefile
# sig_set.c.diff
# storage.c.diff
# tty_set.c.diff
# This archive created: Thu Sep 4 20:43:16 1986
export PATH; PATH=/bin:$PATH
echo shar: extracting "'makefile'" '(298 characters)'
if test -f 'makefile'
then
echo shar: will not over-write existing file "'makefile'"
else
sed 's/^ X//' << \SHAR_EOF > 'makefile'
XCFLAGS= -O -Dregfree=free -Dindex=strchr -Drindex=strrchr
XREGLIB=
XLIBS= -ltermcap -lPW
X
XOBJS= hash.o groupdir.o envir_set.o newsrc.o pagefile.o reader.o \
Xstorage.o sig_set.o term_set.o tty_set.o userlist.o vn.o vnglob.o \
Xdigest.o strings.o
X
Xvn: $(OBJS)
X cc -z -g -o vn $(OBJS) $(REGLIB) $(LIBS)
SHAR_EOF
if test 298 -ne "`wc -c < 'makefile'`"
then
echo shar: error transmitting "'makefile'" '(should have been 298 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'sig_set.c.diff'" '(3188 characters)'
if test -f 'sig_set.c.diff'
then
echo shar: will not over-write existing file "'sig_set.c.diff'"
else
sed 's/^ X//' << \SHAR_EOF > 'sig_set.c.diff'
X*** sig_set.c.old Thu Sep 4 20:22:26 1986
X--- sig_set.c Thu Sep 4 20:22:26 1986
X***************
X*** 41,46
X case SIGINT:
X case SIGQUIT:
X break;
X case SIGTSTP:
X /* ignore SIGTTOU so we don't get stopped if [kc]sh grabs the tty */
X signal(SIGTTOU, SIG_IGN);
X
X--- 41,47 -----
X case SIGINT:
X case SIGQUIT:
X break;
X+ /* hack out
X case SIGTSTP:
X signal(SIGTTOU, SIG_IGN);
X tty_set (SAVEMODE);
X***************
X*** 42,48
X case SIGQUIT:
X break;
X case SIGTSTP:
X- /* ignore SIGTTOU so we don't get stopped if [kc]sh grabs the tty */
X signal(SIGTTOU, SIG_IGN);
X tty_set (SAVEMODE);
X term_set (MOVE,0,L_allow+RECBIAS-1);
X
X--- 43,48 -----
X break;
X /* hack out
X case SIGTSTP:
X signal(SIGTTOU, SIG_IGN);
X tty_set (SAVEMODE);
X term_set (MOVE,0,L_allow+RECBIAS-1);
X***************
X*** 52,58
X fflush (stderr);
X signal(SIGTTOU, SIG_DFL);
X
X! /* Send the TSTP signal to suspend our process group */
X signal(SIGTSTP, SIG_DFL);
X sigsetmask(0);
X kill (0, SIGTSTP);
X
X--- 52,58 -----
X fflush (stderr);
X signal(SIGTTOU, SIG_DFL);
X
X! * Send the TSTP signal to suspend our process group *
X signal(SIGTSTP, SIG_DFL);
X sigsetmask(0);
X kill (0, SIGTSTP);
X***************
X*** 57,63
X sigsetmask(0);
X kill (0, SIGTSTP);
X
X! /* WE ARE NOW STOPPED */
X
X /*
X WELCOME BACK!
X
X--- 57,63 -----
X sigsetmask(0);
X kill (0, SIGTSTP);
X
X! * WE ARE NOW STOPPED *
X
X *
X WELCOME BACK!
X***************
X*** 59,65
X
X /* WE ARE NOW STOPPED */
X
X! /*
X WELCOME BACK!
X if terminals process group is ours, we are foregrounded again
X and can turn newsgroup name printing back on
X
X--- 59,65 -----
X
X * WE ARE NOW STOPPED *
X
X! *
X WELCOME BACK!
X if terminals process group is ours, we are foregrounded again
X and can turn newsgroup name printing back on
X***************
X*** 63,69
X WELCOME BACK!
X if terminals process group is ours, we are foregrounded again
X and can turn newsgroup name printing back on
X! */
X tty_set (RESTORE);
X switch (Sigflag)
X {
X
X--- 63,69 -----
X WELCOME BACK!
X if terminals process group is ours, we are foregrounded again
X and can turn newsgroup name printing back on
X! *
X tty_set (RESTORE);
X switch (Sigflag)
X {
X***************
X*** 84,89
X }
X signal (SIGTSTP,sigcatch);
X return;
X default:
X printex (BRK_MSG,sig);
X }
X
X--- 84,90 -----
X }
X signal (SIGTSTP,sigcatch);
X return;
X+ hack in */
X default:
X printex (BRK_MSG,sig);
X }
X***************
X*** 129,135
X signal (SIGQUIT,sigcatch);
X signal (SIGHUP,sigcatch);
X signal (SIGTERM,sigcatch);
X! signal (SIGTSTP,sigcatch);
X ioctl (1,TIOCGPGRP,&pgrp);
X if (pgrp == getpgrp(0))
X {
X
X--- 130,136 -----
X signal (SIGQUIT,sigcatch);
X signal (SIGHUP,sigcatch);
X signal (SIGTERM,sigcatch);
X! /* signal (SIGTSTP,sigcatch);
X ioctl (1,TIOCGPGRP,&pgrp);
X if (pgrp == getpgrp(0))
X {
X***************
X*** 138,144
X }
X else
X Foreground = 0;
X! }
X switch (flag)
X {
X case BRK_IN:
X
X--- 139,145 -----
X }
X else
X Foreground = 0;
X! */ }
X switch (flag)
X {
X case BRK_IN:
SHAR_EOF
if test 3188 -ne "`wc -c < 'sig_set.c.diff'`"
then
echo shar: error transmitting "'sig_set.c.diff'" '(should have been 3188 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'storage.c.diff'" '(401 characters)'
if test -f 'storage.c.diff'
then
echo shar: will not over-write existing file "'storage.c.diff'"
else
sed 's/^ X//' << \SHAR_EOF > 'storage.c.diff'
X*** storage.c.old Thu Sep 4 20:24:39 1986
X--- storage.c Thu Sep 4 20:19:41 1986
X***************
X*** 17,22
X static char *avail;
X int len;
X
X if ((len = strlen(s)+1) > av_len)
X {
X if (len > STRBLKSIZE)
X
X--- 17,23 -----
X static char *avail;
X int len;
X
X+ if (s == 0) return(s); /* can't store null pointers, dude */
X if ((len = strlen(s)+1) > av_len)
X {
X if (len > STRBLKSIZE)
SHAR_EOF
if test 401 -ne "`wc -c < 'storage.c.diff'`"
then
echo shar: error transmitting "'storage.c.diff'" '(should have been 401 characters)'
fi
fi # end of overwriting check
echo shar: extracting "'tty_set.c.diff'" '(2352 characters)'
if test -f 'tty_set.c.diff'
then
echo shar: will not over-write existing file "'tty_set.c.diff'"
else
sed 's/^ X//' << \SHAR_EOF > 'tty_set.c.diff'
X*** tty_set.c.old Thu Sep 4 20:22:32 1986
X--- tty_set.c Thu Sep 4 20:22:32 1986
X***************
X*** 1,4
X! #include <sgtty.h>
X #include "tty.h"
X
X extern char Erasekey,Killkey;
X
X--- 1,4 -----
X! #include <termio.h>
X #include "tty.h"
X
X extern char Erasekey,Killkey;
X***************
X*** 3,9
X
X extern char Erasekey,Killkey;
X
X! static struct sgttyb C_tp;
X static unsigned short O_lflag;
X static unsigned S_flag=0;
X static int R_ignore=0; /* up/down counter of reset calls to ignore */
X
X--- 3,9 -----
X
X extern char Erasekey,Killkey;
X
X! static struct termio C_tp, C_sav;
X static unsigned short O_lflag;
X static unsigned S_flag=0;
X static int R_ignore=0; /* up/down counter of reset calls to ignore */
X***************
X*** 32,41
X switch (cmd)
X {
X case BACKSTOP:
X- if ((rc = ioctl(1,TIOCLGET,&mask)) != 0)
X- break;
X- mask |= LTOSTOP;
X- rc = ioctl(1,TIOCLSET,&mask);
X break;
X case RAWMODE:
X if ((S_flag & IO_RAW) != 0)
X
X--- 32,37 -----
X switch (cmd)
X {
X case BACKSTOP:
X break;
X case RAWMODE:
X if ((S_flag & IO_RAW) != 0)
X***************
X*** 45,54
X }
X if ((S_flag & IO_GOT) == 0)
X {
X! rc = ioctl(0,TIOCGETP,&C_tp);
X! O_lflag = C_tp.sg_flags;
X! Erasekey = C_tp.sg_erase;
X! Killkey = C_tp.sg_kill;
X }
X C_tp.sg_flags |= CBREAK;
X C_tp.sg_flags &= ~ECHO;
X
X--- 41,50 -----
X }
X if ((S_flag & IO_GOT) == 0)
X {
X! rc = ioctl(0,TCGETA,&C_tp);
X! C_sav = C_tp;
X! Erasekey = C_tp.c_cc[VERASE];
X! Killkey = C_tp.c_cc[VKILL];
X }
X C_tp.c_lflag = 0;
X C_tp.c_cc[VEOF]=1;
X***************
X*** 50,58
X Erasekey = C_tp.sg_erase;
X Killkey = C_tp.sg_kill;
X }
X! C_tp.sg_flags |= CBREAK;
X! C_tp.sg_flags &= ~ECHO;
X! rc = ioctl(0,TIOCSETP,&C_tp);
X S_flag = IO_GOT|IO_RAW;
X break;
X case COOKED:
X
X--- 46,54 -----
X Erasekey = C_tp.c_cc[VERASE];
X Killkey = C_tp.c_cc[VKILL];
X }
X! C_tp.c_lflag = 0;
X! C_tp.c_cc[VEOF]=1;
X! rc = ioctl(0,TCSETA,&C_tp);
X S_flag = IO_GOT|IO_RAW;
X break;
X case COOKED:
X***************
X*** 58,65
X case COOKED:
X if ((S_flag & IO_RAW) != 0)
X {
X! C_tp.sg_flags = O_lflag;
X! rc = ioctl(0,TIOCSETP,&C_tp);
X S_flag &= ~IO_RAW;
X }
X else
X
X--- 54,60 -----
X case COOKED:
X if ((S_flag & IO_RAW) != 0)
X {
X! rc = ioctl(0,TCSETA,&C_sav);
X S_flag &= ~IO_RAW;
X }
X else
SHAR_EOF
if test 2352 -ne "`wc -c < 'tty_set.c.diff'`"
then
echo shar: error transmitting "'tty_set.c.diff'" '(should have been 2352 characters)'
fi
fi # end of overwriting check
# End of shell archive
exit 0
--
andy at icom.UUCP
Or for those of Andrew H. Marrinson
you who wish to ICOM Systems, Inc.
play it the hard Arlington Heights, IL 60005
way: ihnp4!icom!andy
More information about the Comp.sources.unix
mailing list