Thread View: de.comp.sources.unix
1 messages
1 total messages
Started by Frank Kaefer
Wed, 22 Jul 1992 05:03
v01i001: Pcomm 2.0 - telecommunication program for Unix, Part01/08
Author: Frank Kaefer
Date: Wed, 22 Jul 1992 05:03
Date: Wed, 22 Jul 1992 05:03
3728 lines
97626 bytes
97626 bytes
Submitted-by: egray@osiris.cso.uiuc.edu (Emmet P. Gray)
Posting-number: Volume 1, Issue 1
Archive-name: pcomm/part01
[ Hier ist die neueste Version von Pcomm direkt vom Author: ]
Pcomm is a public domain telecommunication program for Unix designed to
operate similarly to the popular MSDOS program, ProComm. ProComm (TM)
is copyrighted by Datastorm Technologies Inc.
Some of the new features in v2.0 are:
o multiplexed I/O instead of a forked routine
o true scripting feature has been added
o support for baud rates up to 38400
o connected baud rates for v.32bis (7200, 12k, and 14.4k)
o optional modem configuration per dialing directory entry
o system configuration script
Emmet P. Gray US Army, HQ III Corps & Fort Hood
...!uunet!uiucuxc!fthood!egray Attn: AFZF-DE-ENV
fthood!egray@uxc.cso.uiuc.edu Directorate of Engineering & Housing
Environmental Management Office
Fort Hood, TX 76544-5057
#! /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 8)."
# Contents: pcomm-2.0 pcomm-2.0/Convert.sh pcomm-2.0/Matches.1
# pcomm-2.0/Matches.out pcomm-2.0/Pcomm.dial_dir
# pcomm-2.0/Pcomm.extrnl pcomm-2.0/Pcomm.modem pcomm-2.0/Pcomm.param
# pcomm-2.0/Sample pcomm-2.0/Waitfor.1 pcomm-2.0/Waitfor.out
# pcomm-2.0/chg_dir.c pcomm-2.0/cmd.h pcomm-2.0/config.h
# pcomm-2.0/config.h.sun pcomm-2.0/d_delete.c pcomm-2.0/d_manual.c
# pcomm-2.0/data_log.c pcomm-2.0/di_delay.c pcomm-2.0/dial_dir.h
# pcomm-2.0/expand.c pcomm-2.0/extrnl.h pcomm-2.0/getcwd.c
# pcomm-2.0/getopt.c pcomm-2.0/help.c pcomm-2.0/info.c
# pcomm-2.0/init.c pcomm-2.0/ipc.h pcomm-2.0/ipc_att.c
# pcomm-2.0/ipc_ucb.c pcomm-2.0/list_dir.c pcomm-2.0/matches.c
# pcomm-2.0/misc.h pcomm-2.0/modem.h pcomm-2.0/n_shell.c
# pcomm-2.0/param.h pcomm-2.0/passthru.c pcomm-2.0/patchlevel.h
# pcomm-2.0/pexit.c pcomm-2.0/redial.c pcomm-2.0/screen.c
# pcomm-2.0/st_line.c pcomm-2.0/status.h pcomm-2.0/vcs.h
# pcomm-2.0/waitfor.c pcomm-2.0/x_extrnl.c pcomm-2.0/x_win.c
# pcomm-2.0/xmodem.h
# Wrapped by fkk@stasys on Tue Jul 21 22:05:57 1992
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test ! -d 'pcomm-2.0' ; then
echo shar: Creating directory \"'pcomm-2.0'\"
mkdir 'pcomm-2.0'
fi
if test -f 'pcomm-2.0/Convert.sh' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/Convert.sh'\"
else
echo shar: Extracting \"'pcomm-2.0/Convert.sh'\" \(777 characters\)
sed "s/^X//" >'pcomm-2.0/Convert.sh' <<'END_OF_FILE'
X:
Xecho This shell script will convert your pre-v2.0 Pcomm support files.
Xecho You obviously must have write permissions on the files.
Xecho
Xecho "Enter the directory where the files are found : \c"
Xread DIR
Xif [ ! -d "$DIR" ] ;then
X echo oops... \"$DIR\" is not a directory
X exit
Xfi
Xif [ ! -f "$DIR/pcomm.param" ] ;then
X echo humm... no pcomm.param support file found in \"$DIR\"
X exit
Xfi
Xcd $DIR
Xecho editing pcomm.param...
Xex - pcomm.param << "EOF"
X1,$s/D_DBITS=/D_DATA_BITS=/
X1,$s/D_SBITS=/D_STOP_BITS=/
X1,$s/HOT=/HOT_KEY=/
X1,$s/FLOW=/FLOW_CTRL=/
X1,$s/LECHO=/LOCAL_ECHO=/
Xw
Xq
XEOF
Xif [ ! -f "$DIR/pcomm.modem" ] ;then
X echo humm... no pcomm.modem support file found in \"$DIR\"
X exit
Xfi
Xecho editing pcomm.modem...
Xex - pcomm.modem << "EOF"
X1,$g/MODEM_[1-9]b=/s/$/;/
Xw
Xq
XEOF
END_OF_FILE
if test 777 -ne `wc -c <'pcomm-2.0/Convert.sh'`; then
echo shar: \"'pcomm-2.0/Convert.sh'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/Convert.sh'
fi
if test -f 'pcomm-2.0/Matches.1' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/Matches.1'\"
else
echo shar: Extracting \"'pcomm-2.0/Matches.1'\" \(657 characters\)
sed "s/^X//" >'pcomm-2.0/Matches.1' <<'END_OF_FILE'
X.TH MATCHES 1 local
X.SH NAME
Xmatches \- test if string2 is contained in string1
X.SH SYNOPSIS
X.B matches string1 string2
X.SH DESCRIPTION
X.I Matches
Xreturns a 0 if string2 is contained in string1, otherwise it returns a 1.
X.PP
X.I Matches
Xis designed to be used by
X.I Pcomm
Xinside a shell script for automating keyboard input to log user onto a
Xremote system.
X.PP
X.SH EXAMPLE
X.nf
X.RS 5
X# read some input
Xread junk
X# test to see the string matches 'login failed'
Xmatches $junk 'login failed'
X# test the exit code of the matches command
Xif [ $? \-eq 0 ]
Xthen
X.RS 5
X exit 1
X.RE
Xfi
X.RE
X.fi
X.SH "SEE ALSO"
Xpcomm(1), pcomm_cmd(1), waitfor(1), Pcomm Reference Manual
END_OF_FILE
if test 657 -ne `wc -c <'pcomm-2.0/Matches.1'`; then
echo shar: \"'pcomm-2.0/Matches.1'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/Matches.1'
fi
if test -f 'pcomm-2.0/Matches.out' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/Matches.out'\"
else
echo shar: Extracting \"'pcomm-2.0/Matches.out'\" \(939 characters\)
sed "s/^X//" >'pcomm-2.0/Matches.out' <<'END_OF_FILE'
X
X
X
X MATCHES(1) (local) MATCHES(1)
X
X
X
X NAME
X matches - test if string2 is contained in string1
X
X SYNOPSIS
X matches string1 string2
X
X DESCRIPTION
X Matches returns a 0 if string2 is contained in string1,
X otherwise it returns a 1.
X
X Matches is designed to be used by Pcomm inside a shell
X script for automating keyboard input to log user onto a
X remote system.
X
X EXAMPLE
X # read some input
X read junk
X # test to see the string matches 'login failed'
X matches $junk 'login failed'
X # test the exit code of the matches command
X if [ $? -eq 0 ]
X then
X exit 1
X fi
X
X SEE ALSO
X pcomm(1), pcomm_cmd(1), waitfor(1), Pcomm Reference Manual
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X Page 1
X
X
X
END_OF_FILE
if test 939 -ne `wc -c <'pcomm-2.0/Matches.out'`; then
echo shar: \"'pcomm-2.0/Matches.out'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/Matches.out'
fi
if test -f 'pcomm-2.0/Pcomm.dial_dir' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/Pcomm.dial_dir'\"
else
echo shar: Extracting \"'pcomm-2.0/Pcomm.dial_dir'\" \(333 characters\)
sed "s/^X//" >'pcomm-2.0/Pcomm.dial_dir' <<'END_OF_FILE'
XDIR_1=Abbey Road;1 (512) 590-6036;2400-N-8-1;F;
XDIR_2=Tel-Med-Com;555-8686;9600-E-7-1;F;TELEBIT_V.32
XDIR_3=C Board;1 (619) 722-8724;2400-N-8-1;F;
XDIR_4=Crest;1 (213) 471-2518;2400-N-8-1;F;Sample
XDIR_5=Last Chance;1 (219) 762-8411;2400-E-7-1;F;
XDIR_6=Killer;1 (214) 827-1994;1200-E-7-1;F;
XDIR_7=System A (direct);;19200-E-7-1;F;tty12
END_OF_FILE
if test 333 -ne `wc -c <'pcomm-2.0/Pcomm.dial_dir'`; then
echo shar: \"'pcomm-2.0/Pcomm.dial_dir'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/Pcomm.dial_dir'
fi
if test -f 'pcomm-2.0/Pcomm.extrnl' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/Pcomm.extrnl'\"
else
echo shar: Extracting \"'pcomm-2.0/Pcomm.extrnl'\" \(113 characters\)
sed "s/^X//" >'pcomm-2.0/Pcomm.extrnl' <<'END_OF_FILE'
XSEND_1=zmodem;sz;Y
XSEND_2=kermit;kermit -ivs;Y
XSEND_3=;;N
XRCV_1=zmodem;rz;N
XRCV_2=kermit;kermit -ivr;Y
XRCV_3=;;N
END_OF_FILE
if test 113 -ne `wc -c <'pcomm-2.0/Pcomm.extrnl'`; then
echo shar: \"'pcomm-2.0/Pcomm.extrnl'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/Pcomm.extrnl'
fi
if test -f 'pcomm-2.0/Pcomm.modem' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/Pcomm.modem'\"
else
echo shar: Extracting \"'pcomm-2.0/Pcomm.modem'\" \(826 characters\)
sed "s/^X//" >'pcomm-2.0/Pcomm.modem' <<'END_OF_FILE'
XTTY_1=tty10;HAYES;0
XTTY_2=tty11;HAYES;0
XTTY_3=tty12;DIRECT;0
XTTY_4=tty13;TELEBIT;38400
XTTY_5=tty13;TELEBIT_V.32;38400
XTTY_6=tty13;TELEBIT_PEP;38400
XMODEM_1a=HAYES;ATS7=60S11=70E0Q0V1X4&D2!;ATDT;!;~~+++~~ATH0!
XMODEM_1b=Y;CONNECT!;CONNECT 1200;CONNECT 2400;;;;
XMODEM_1c=BUSY;VOICE;NO CARRIER;
XMODEM_2a=DIRECT;;;;
XMODEM_2b=N;;;;;;;
XMODEM_2c=;;;
XMODEM_3a=TELEBIT;ATZ!~~;ATDT;!;~~+++~~ATH0!
XMODEM_3b=Y;CONNECT 300;CONNECT 1200;CONNECT 2400;CONNECT 4800;CONNECT 9600;CONNECT FAST;
XMODEM_3c=BUSY;ERROR;NO CARRIER;NO DIALTONE
XMODEM_4a=TELEBIT_V.32;ATZ!~~;ATS180=0S50=6DT;!;~~+++~~ATH0!
XMODEM_4b=Y;CONNECT 300;CONNECT 1200;CONNECT 2400;CONNECT 4800;CONNECT 9600;;
XMODEM_4c=BUSY;ERROR;NO CARRIER;NO DIALTONE
XMODEM_5a=TELEBIT_PEP;ATZ!~~;ATS50=255DT;!;~~+++~~ATH0!
XMODEM_5b=Y;;;;;;CONNECT FAST;
XMODEM_5c=BUSY;ERROR;NO CARRIER;NO DIALTONE
END_OF_FILE
if test 826 -ne `wc -c <'pcomm-2.0/Pcomm.modem'`; then
echo shar: \"'pcomm-2.0/Pcomm.modem'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/Pcomm.modem'
fi
if test -f 'pcomm-2.0/Pcomm.param' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/Pcomm.param'\"
else
echo shar: Extracting \"'pcomm-2.0/Pcomm.param'\" \(487 characters\)
sed "s/^X//" >'pcomm-2.0/Pcomm.param' <<'END_OF_FILE'
XD_BAUD=1200
XD_PARITY=E
XD_DATA_BITS=7
XD_STOP_BITS=1
XHOT_KEY=1
XASCII_HOT=^A
XD_DUPLEX=FULL
XFLOW_CTRL=XON/XOFF
XCR_IN=CR
XCR_OUT=CR
XLOGFILE=pcomm.log
XDUMPFILE=pcomm.dump
XSTRIP=YES
XPAUSE_CHAR=~
XCR_CHAR=!
XCTRL_CHAR=^
XESC_CHAR=|
XBRK_CHAR=%
XABORT=KEEP
XC_DELAY=35
XR_DELAY=5
XLOCAL_ECHO=NO
XEXPAND=NO
XCR_DELAY=0
XPACE=NO
XCR_UP=NONE
XLF_UP=ADD CR
XTIMER=5
XCR_DN=STRIP
XLF_DN=NONE
XLD_PLUS=
XLD_MINUS=
XLD_AT=8,
XLD_POUND=9
XMAC_1=ls -alRF \| more!
XMAC_2=
XMAC_3=
XMAC_4=
XMAC_5=
XMAC_6=
XMAC_7=
XMAC_8=
XMAC_9=
XMAC_0=
END_OF_FILE
if test 487 -ne `wc -c <'pcomm-2.0/Pcomm.param'`; then
echo shar: \"'pcomm-2.0/Pcomm.param'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/Pcomm.param'
fi
if test -f 'pcomm-2.0/Sample' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/Sample'\"
else
echo shar: Extracting \"'pcomm-2.0/Sample'\" \(1004 characters\)
sed "s/^X//" >'pcomm-2.0/Sample' <<'END_OF_FILE'
X:
X#
X# This is a sample Bourne shell script to log a user onto a remote system.
X# Things to remember:
X# 1) Script files should have permissions of 700, to prevent others
X# from gaining access to your passwords to remote systems.
X# 2) The return codes for waitfor are: 0=success, 1=timed out, and
X# -1=error.
X#
Xecho ""
Xtry=0
X# loop until done
Xwhile true
Xdo
X # wait 5 seconds for the login prompt
X waitfor -5 ogin:
X # test the exit code of the waitfor command
X if [ "$?" -eq 0 ]
X then
X # send my user ID and exit the loop
X echo "egray"
X break
X fi
X
X # increment the number of attempts
X try=`expr $try + 1`
X # test to see if we should give up
X if [ "$try" -eq 5 ]
X then
X exit 1
X fi
X
X # send a modem break and loop again
X pcomm_cmd modem_break
X echo ""
Xdone
X# wait 5 seconds for the password prompt
Xwaitfor -5 assword:
X# test the return code from waifor
Xif [ "$?" -eq 0 ]
Xthen
X # send my password (you're crazy if you think that's my real password)
X echo "abcdefg"
Xelse
X exit 1
Xfi
X# return to Pcomm
Xexit 0
END_OF_FILE
if test 1004 -ne `wc -c <'pcomm-2.0/Sample'`; then
echo shar: \"'pcomm-2.0/Sample'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/Sample'
fi
if test -f 'pcomm-2.0/Waitfor.1' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/Waitfor.1'\"
else
echo shar: Extracting \"'pcomm-2.0/Waitfor.1'\" \(894 characters\)
sed "s/^X//" >'pcomm-2.0/Waitfor.1' <<'END_OF_FILE'
X.TH WAITFOR 1 local
X.SH NAME
Xwaitfor \- wait for a string to appear on the stdin
X.SH SYNOPSIS
X.B waitfor
X[
X.B \-n
X]
X.B string
X.SH DESCRIPTION
X.I Waitfor
Xreads the standard input and returns a 0 if the string argument is
Xfound, returns a 1 if the strings did not appear within the allotted
Xtime, or returns a \-1 on error. If the string is found,
X.I waitfor
Xreturns immediately.
X.PP
X.I Waitfor
Xis designed to be used by
X.I Pcomm
Xinside a shell script for automating keyboard input to log a user onto a
Xremote system.
X.PP
XThe
X.I \-n
Xoption is used to specify the length of time in seconds to wait. The
Xdefault is 10 seconds.
X.SH EXAMPLE
X.nf
X.RS 5
X# wait 5 seconds for the login prompt
Xwaitfor \-5 login:
X# test the exit code of the waitfor command
Xif [ $? \-eq 0 ]
Xthen
X.RS 5
X# send my user ID
Xecho egray
X.RE
Xfi
X.RE
X.fi
X.SH "SEE ALSO"
Xpcomm(1), pcomm_cmd(1), matches(1), Pcomm Reference Manual
END_OF_FILE
if test 894 -ne `wc -c <'pcomm-2.0/Waitfor.1'`; then
echo shar: \"'pcomm-2.0/Waitfor.1'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/Waitfor.1'
fi
if test -f 'pcomm-2.0/Waitfor.out' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/Waitfor.out'\"
else
echo shar: Extracting \"'pcomm-2.0/Waitfor.out'\" \(1182 characters\)
sed "s/^X//" >'pcomm-2.0/Waitfor.out' <<'END_OF_FILE'
X
X
X
X WAITFOR(1) (local) WAITFOR(1)
X
X
X
X NAME
X waitfor - wait for a string to appear on the stdin
X
X SYNOPSIS
X waitfor [ -n ] string
X
X DESCRIPTION
X Waitfor reads the standard input and returns a 0 if the
X string argument is found, returns a 1 if the strings did not
X appear within the allotted time, or returns a -1 on error.
X If the string is found, waitfor returns immediately.
X
X Waitfor is designed to be used by Pcomm inside a shell
X script for automating keyboard input to log a user onto a
X remote system.
X
X The -n option is used to specify the length of time in
X seconds to wait. The default is 10 seconds.
X
X EXAMPLE
X # wait 5 seconds for the login prompt
X waitfor -5 login:
X # test the exit code of the waitfor command
X if [ $? -eq 0 ]
X then
X # send my user ID
X echo egray
X fi
X
X SEE ALSO
X pcomm(1), pcomm_cmd(1), matches(1), Pcomm Reference Manual
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X Page 1
X
X
X
END_OF_FILE
if test 1182 -ne `wc -c <'pcomm-2.0/Waitfor.out'`; then
echo shar: \"'pcomm-2.0/Waitfor.out'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/Waitfor.out'
fi
if test -f 'pcomm-2.0/chg_dir.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/chg_dir.c'\"
else
echo shar: Extracting \"'pcomm-2.0/chg_dir.c'\" \(1514 characters\)
sed "s/^X//" >'pcomm-2.0/chg_dir.c' <<'END_OF_FILE'
X/*
X * Open a window to prompt for a new directory. Checks to see you have
X * search permission.
X */
X
X#include <curses.h>
X#include "config.h"
X#include "misc.h"
X
Xvoid
Xchg_dir()
X{
X extern int fd;
X WINDOW *ch_win, *newwin();
X char *ans, *dir, *expand(), *cwd, *getcwd(), cwdbuf[200];
X char *get_str();
X
X cwd = getcwd(cwdbuf, 200);
X
X ch_win = newwin(6, 70, 5, 5);
X
X mvwprintw(ch_win, 2, 4, "Current directory: %s", cwd);
X mvwaddstr(ch_win, 3, 4, "New directory: ");
X box(ch_win, VERT, HORZ);
X
X mvwattrstr(ch_win, 0, 3, A_BOLD, " Change Directory ");
X wmove(ch_win, 3, 19);
X wrefresh(ch_win);
X /* get the answer */
X while ((ans = get_str(ch_win, 80, "", " \t\n")) != NULL) {
X /* a CR means no change */
X if (*ans == '\0')
X break;
X /* expand the input */
X dir = expand(ans);
X /* if you have search permission */
X if (!access(dir, 1)) {
X if (!chdir(dir))
X break;
X }
X beep();
X mvwattrstr(ch_win, 4, 15, A_BOLD, "No such directory or no access permission");
X wrefresh(ch_win);
X wait_key(ch_win, 3);
X /* clean up the mess */
X clear_line(ch_win, 3, 19, TRUE);
X clear_line(ch_win, 4, 14, TRUE);
X wmove(ch_win, 3, 19);
X wrefresh(ch_win);
X }
X if (fd == -1) {
X werase(ch_win);
X wrefresh(ch_win);
X }
X delwin(ch_win);
X return;
X}
X
X#ifdef BSD
X/*
X * Get the current working directory, AT&T style. Well... not really, it
X * doesn't handle a NULL pointer for the buffer.
X */
X
X/* ARGSUSED */
Xchar *
Xgetcwd(buf, len)
Xchar *buf;
Xint len;
X{
X char *getwd();
X
X return(getwd(buf));
X}
X#endif /* BSD */
END_OF_FILE
if test 1514 -ne `wc -c <'pcomm-2.0/chg_dir.c'`; then
echo shar: \"'pcomm-2.0/chg_dir.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/chg_dir.c'
fi
if test -f 'pcomm-2.0/cmd.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/cmd.h'\"
else
echo shar: Extracting \"'pcomm-2.0/cmd.h'\" \(2290 characters\)
sed "s/^X//" >'pcomm-2.0/cmd.h' <<'END_OF_FILE'
X/*
X * Definitions for the pcomm_cmd program used inside script files.
X */
X
X/* the commands */
X
X#define SET 0 /* set a parameter */
X#define QUERY 1 /* ask a "string" question */
X#define IF 2 /* ask a binary question */
X#define DIAL 3 /* dial */
X#define REDIAL 4 /* redial queue */
X#define EXIT 5 /* exit Pcomm */
X#define CLEAR_SCREEN 6 /* clear the local screen */
X#define CHG_DIR 7 /* change the local directory */
X#define HANG_UP 8 /* hang up the phone */
X#define PRINTER 9 /* control printer logging */
X#define MODEM_BREAK 10 /* send a modem break */
X#define SEND 11 /* send a file */
X#define RECEIVE 12 /* recieve a file */
X#define SCREEN_DUMP 13 /* dump the screen contents to a file */
X#define DATA_LOG 14 /* control data logging */
X
X/* the SET arguments */
X
X#define BAUD 0 /* baud rate */
X#define PARITY 1 /* parity (EVEN, ODD, or NONE) */
X#define DATA_BITS 2 /* data bits (7 or 8) */
X#define STOP_BITS 3 /* stop bits (1 or 2) */
X#define DUPLEX 4 /* duplex mode (FULL or HALF) */
X#define AUX 5 /* the name of the auxiliary file */
X#define HOT_KEY 6 /* the "hot" key (numeric) */
X#define ASCII_HOT 7 /* ascii representation of hot key */
X#define FLOW_CTRL 8 /* flow control (XON/XOFF or NONE) */
X#define CR_IN 9 /* send as carriage return */
X#define CR_OUT 10 /* receive carriage return as */
X#define LOGFILE 11 /* default log file */
X#define DUMPFILE 12 /* default screen dump file */
X#define STRIP 13 /* strip high bit (translate table) */
X#define LOCAL_ECHO 14 /* ASCII xfer - echo locally? */
X#define EXPAND 15 /* ASCII xfer - expand blank lines? */
X#define CR_DELAY 16 /* ASCII xfer - carriage return delay (ms) */
X#define PACE 17 /* ASCII xfer - pace the output? */
X#define CR_UP 18 /* ASCII xfer - send carriage return as */
X#define LF_UP 19 /* ASCII xfer - send line feed as */
X#define TIMER 20 /* ASCII xfer - transfer timeout */
X#define CR_DN 21 /* ASCII xfer - receive carriage return as */
X#define LF_DN 22 /* ASCII xfer - receive line feed as */
X
X/* the QUERY arguments */
X#define TTY_NAME 0 /* what is the current tty? */
X#define MODEM_NAME 1 /* what modem do we have? */
X
X/* the IF arguments */
X
X#define CONNECTED 0 /* are we connected? */
X#define LOG_STATUS 1 /* status of log option */
X#define PRINTER_STATUS 2 /* status of print option */
X
END_OF_FILE
if test 2290 -ne `wc -c <'pcomm-2.0/cmd.h'`; then
echo shar: \"'pcomm-2.0/cmd.h'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/cmd.h'
fi
if test -f 'pcomm-2.0/config.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/config.h'\"
else
echo shar: Extracting \"'pcomm-2.0/config.h'\" \(2452 characters\)
sed "s/^X//" >'pcomm-2.0/config.h' <<'END_OF_FILE'
X/*
X * Various tunable parameters. This should appear before any other local
X * header file.
X */
X
X/* Are you using a Berkeley flavor of Unix? */
X#undef BSD
X
X/* Use the dialing routines specific to the AT&T Unix PC 7300/3b1 */
X#undef UNIXPC
X
X/* Older versions of curses(3) use termcap in lieu of terminfo */
X#undef OLDCURSES
X
X/* Should a missing video attribute be promoted to standout? */
X#define NOPROMOTE
X
X/* Should Pcomm make a log of all phone calls? */
X#undef LOG_CALLS
X
X/* The name of the log file (if used). */
X#define LOG_FILE "/usr/adm/phone.calls"
X
X/* Should long distance (toll) calls be limited to a specific group? */
X#undef LIMIT_LD
X
X/* The name of the privileged group for limiting long distance calls */
X#define GROUP_NAME "uucp"
X
X/* The path to the line printer program */
X#define LPR "lp -s"
X
X/* The path to the "pretty" printer program (if none, use "pr | lp") */
X#define LPRINT "pr | lp -s"
X
X/* The path to the default directory containing the Pcomm support files */
X#define DEFAULT_DIR "/usr/local/lib/pcomm"
X
X/* The path to the directory where UUCP locks are found */
X#define LOCK_DIR "/var/spool/locks"
X
X/* Do the lock files use ASCII encoded PID's? */
X#define ASCII_PID
X
X/* Fold the last character of the lock to lower case? */
X#undef XENIX_LOCKS
X
X/* Use the new SVR4 lock format? */
X#define SVR4_LOCKS
X
X/* Does the status line scroll up on "magic cookie" terminals? */
X#undef XMC_BROKE
X
X/* Does the alarm() system call work correctly with the wgetch() function? */
X#undef WGETCH_BROKE
X
X/* Does the O_NDELAY mode tend to stick around when asked to leave? */
X#undef O_NDELAY_BROKE
X
X/* The size of the serial port character buffer (or Stream buffer) */
X#define CLIST_SIZ 64
X
X/* The size of the input buffer (should be about the same as CLIST_SIZ) */
X#define INPUT_BUF 64
X
X/* The size of the output buffer (should be about one half INPUT_BUF) */
X#define OUTPUT_BUF 32
X
X/* Does memmove() exist or is memcpy() well behaved when overlapping? */
X#define MEMMOVE(a,b,c) memmove(a,b,c)
X/* #define MEMMOVE(a,b,c) memcpy(a,b,c) */
X/* #define MEMMOVE(a,b,c) bcopy(b,a,c) */
X
X/* Does your Unix allow flip-flop between real and effective user IDs? */
X#undef SETUID_BROKE
X
X/* Does your system have the strstr() function? */
X#define HAVE_STRSTR
X
X/* Does your system have the usleep() function? */
X#undef HAVE_USLEEP
X
Xtypedef void SIG_TYPE;
X/* typedef int SIG_TYPE; */
X
X#ifdef BSD
X#define strchr index
X#define strrchr rindex
X#endif /* BSD */
END_OF_FILE
if test 2452 -ne `wc -c <'pcomm-2.0/config.h'`; then
echo shar: \"'pcomm-2.0/config.h'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/config.h'
fi
if test -f 'pcomm-2.0/config.h.sun' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/config.h.sun'\"
else
echo shar: Extracting \"'pcomm-2.0/config.h.sun'\" \(2467 characters\)
sed "s/^X//" >'pcomm-2.0/config.h.sun' <<'END_OF_FILE'
X/*
X * Various tunable parameters. This should appear before any other local
X * header file.
X */
X
X/* Are you using a Berkeley flavor of Unix? */
X#undef BSD
X
X/* Use the dialing routines specific to the AT&T Unix PC 7300/3b1 */
X#undef UNIXPC
X
X/* Older versions of curses(3) use termcap in lieu of terminfo */
X#undef OLDCURSES
X
X/* Should a missing video attribute be promoted to standout? */
X#define NOPROMOTE
X
X/* Should Pcomm make a log of all phone calls? */
X#define LOG_CALLS
X
X/* The name of the log file (if used). */
X#define LOG_FILE "/usr/adm/phone.calls"
X
X/* Should long distance (toll) calls be limited to a specific group? */
X#define LIMIT_LD
X
X/* The name of the privileged group for limiting long distance calls */
X#define GROUP_NAME "uucp"
X
X/* The path to the line printer program */
X#define LPR "/local/bin/lpr"
X
X/* The path to the "pretty" printer program (if none, use "pr | lp") */
X#define LPRINT "/local/bin/lprint"
X
X/* The path to the default directory containing the Pcomm support files */
X#define DEFAULT_DIR "/local/lib/pcomm"
X
X/* The path to the directory where UUCP locks are found */
X#define LOCK_DIR "/usr/spool/locks"
X
X/* Do the lock files use ASCII encoded PID's? */
X#define ASCII_PID
X
X/* Fold the last character of the lock to lower case? */
X#undef XENIX_LOCKS
X
X/* Use the new SVR4 lock format? */
X#undef SVR4_LOCKS
X
X/* Does the status line scroll up on "magic cookie" terminals? */
X#undef XMC_BROKE
X
X/* Does the alarm() system call work correctly with the wgetch() function? */
X#undef WGETCH_BROKE
X
X/* Does the O_NDELAY mode tend to stick around when asked to leave? */
X#undef O_NDELAY_BROKE
X
X/* The size of the serial port character buffer (or Stream buffer) */
X#define CLIST_SIZ 64
X
X/* The size of the input buffer (should be about the same as CLIST_SIZ) */
X#define INPUT_BUF 64
X
X/* The size of the output buffer (should be about one half INPUT_BUF) */
X#define OUTPUT_BUF 32
X
X/* Does memmove() exist or is memcpy() well behaved when overlapping? */
X/* #define MEMMOVE(a,b,c) memmove(a,b,c) */
X#define MEMMOVE(a,b,c) memcpy(a,b,c)
X/* #define MEMMOVE(a,b,c) bcopy(b,a,c) */
X
X/* Does your Unix allow flip-flop between real and effective user IDs? */
X#undef SETUID_BROKE
X
X/* Does your system have the strstr() function? */
X#define HAVE_STRSTR
X
X/* Does your system have the usleep() function? */
X#define HAVE_USLEEP
X
Xtypedef void SIG_TYPE;
X/* typedef int SIG_TYPE; */
X
X#ifdef BSD
X#define strchr index
X#define strrchr rindex
X#endif /* BSD */
END_OF_FILE
if test 2467 -ne `wc -c <'pcomm-2.0/config.h.sun'`; then
echo shar: \"'pcomm-2.0/config.h.sun'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/config.h.sun'
fi
if test -f 'pcomm-2.0/d_delete.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/d_delete.c'\"
else
echo shar: Extracting \"'pcomm-2.0/d_delete.c'\" \(2005 characters\)
sed "s/^X//" >'pcomm-2.0/d_delete.c' <<'END_OF_FILE'
X/*
X * The delete option of the dialing directory. Prompts for saving
X * changes to disk. A non-zero return code means that entries were deleted.
X */
X
X#include <stdio.h>
X#include <curses.h>
X#include "dial_dir.h"
X#include "misc.h"
X#include "param.h"
X
Xint
Xdelete()
X{
X extern char *null_ptr;
X WINDOW *d_win, *newwin();
X int i, first, last;
X void free_ptr();
X
X d_win = newwin(6, 32, 10, 15);
X
X mvwaddstr(d_win, 2, 2, "Delete entry: thru:");
X box(d_win, VERT, HORZ);
X wmove(d_win, 2, 16);
X wrefresh(d_win);
X /* get the first of the range */
X while ((first = get_num(d_win, 3)) != -1) {
X if (first > 0 && first <= NUM_DIR)
X break;
X mvwaddstr(d_win, 2, 16, " ");
X wmove(d_win, 2, 16);
X beep();
X wrefresh(d_win);
X }
X if (first == -1) {
X delwin(d_win);
X return(0);
X }
X /* get the last of the range */
X wmove(d_win, 2, 26);
X wrefresh(d_win);
X while ((last = get_num(d_win, 3)) != -1) {
X if ((first <= last && last <= NUM_DIR) || last == 0)
X break;
X mvwaddstr(d_win, 2, 26, " ");
X wmove(d_win, 2, 26);
X beep();
X wrefresh(d_win);
X }
X if (last == -1) {
X delwin(d_win);
X return(0);
X }
X /* if "last" omitted, echo "first" */
X if (!last) {
X last = first;
X mvwprintw(d_win, 2, 26, "%d", first);
X wrefresh(d_win);
X }
X /* save to disk? */
X if (yes_prompt(d_win, 3, 2, A_BOLD, "Are you sure")) {
X /* delete from the physical file */
X if (del_dir(first, last)) {
X touchwin(d_win);
X wrefresh(d_win);
X }
X /*
X * We don't really care if del_dir() fails because we still
X * change the version in memory.
X */
X for (i=first; i<=last; i++) {
X free_ptr(dir->name[i]);
X free_ptr(dir->number[i]);
X free_ptr(dir->aux[i]);
X dir->name[i] = null_ptr;
X dir->number[i] = null_ptr;
X dir->baud[i] = param->d_baud;
X dir->parity[i] = param->d_parity;
X dir->data_bits[i] = param->d_data_bits;
X dir->stop_bits[i] = param->d_stop_bits;
X dir->duplex[i] = *param->d_duplex;
X dir->aux[i] = null_ptr;
X }
X delwin(d_win);
X return(1);
X }
X delwin(d_win);
X return(0);
X}
END_OF_FILE
if test 2005 -ne `wc -c <'pcomm-2.0/d_delete.c'`; then
echo shar: \"'pcomm-2.0/d_delete.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/d_delete.c'
fi
if test -f 'pcomm-2.0/d_manual.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/d_manual.c'\"
else
echo shar: Extracting \"'pcomm-2.0/d_manual.c'\" \(1951 characters\)
sed "s/^X//" >'pcomm-2.0/d_manual.c' <<'END_OF_FILE'
X/*
X * The manual dial option of the dialing directory. A non-zero return code
X * means we're ready to dial. Dialing directory entry 0 is reserved
X * for the manual dial option. No sanity checking is done on the input.
X */
X
X#include <stdio.h>
X#include <curses.h>
X#include "config.h"
X#include "dial_dir.h"
X#include "misc.h"
X
Xstatic void fix_xmc();
X
Xint
Xmanual()
X{
X extern int xmc;
X extern char *null_ptr;
X WINDOW *m_win, *newwin();
X char *number, *str_rep(), *get_str(), *strchr();
X void free_ptr();
X
X m_win = newwin(5, 50, 0, 20);
X
X box(m_win, VERT, HORZ);
X mvwaddstr(m_win, 2, 3, "Phone Number: ");
X wrefresh(m_win);
X /* get a phone number */
X if ((number = get_str(m_win, 30, "", "\n")) == NULL) {
X werase(m_win);
X wrefresh(m_win);
X delwin(m_win);
X if (xmc > 0)
X fix_xmc();
X return(0);
X }
X /* is first char an LD code? */
X dir->q_ld[0] = '\0';
X if (strchr("+-@#", *number)) {
X dir->q_ld[0] = *number;
X number++;
X }
X /* put it in the queue */
X dir->q_num[0] = 0;
X dir->q_num[1] = -1;
X dir->d_cur = 0;
X /* build the entry zero */
X dir->name[0] = str_rep(dir->name[0], number);
X free_ptr(dir->aux[0]);
X dir->aux[0] = null_ptr;
X /* if space, change to null_ptr */
X if (!strcmp(number, " ")) {
X free_ptr(dir->number[0]);
X dir->number[0] = null_ptr;
X }
X else
X dir->number[0] = str_rep(dir->number[0], number);
X /* it overlaps dm_win, so erase it */
X werase(m_win);
X wrefresh(m_win);
X delwin(m_win);
X if (xmc > 0)
X fix_xmc();
X return(1);
X}
X
X/*
X * Clear the end of the physical screen where the magic cookie got shifted
X * Geez, I hate magic cookie terminals... Wyse, are you listening?
X */
X
Xstatic void
Xfix_xmc()
X{
X WINDOW *cl_win, *newwin();
X
X /*
X * Since the cookie got shifted off the window, we have to
X * create a new window to cover where the cookie ended up.
X */
X cl_win = newwin(1, 2, 4, 78);
X /* have to touch, otherwise nothing! */
X touchwin(cl_win);
X wrefresh(cl_win);
X delwin(cl_win);
X
X return;
X}
END_OF_FILE
if test 1951 -ne `wc -c <'pcomm-2.0/d_manual.c'`; then
echo shar: \"'pcomm-2.0/d_manual.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/d_manual.c'
fi
if test -f 'pcomm-2.0/data_log.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/data_log.c'\"
else
echo shar: Extracting \"'pcomm-2.0/data_log.c'\" \(1475 characters\)
sed "s/^X//" >'pcomm-2.0/data_log.c' <<'END_OF_FILE'
X/*
X * Open a window to prompt for a path name to be used for the data logging
X * feature. Also turns on the data logging.
X */
X
X#include <stdio.h>
X#include <curses.h>
X#include "misc.h"
X#include "param.h"
X#include "status.h"
X
Xvoid
Xdata_logging()
X{
X extern int fd;
X WINDOW *dl_win, *newwin();
X char *ans, *path, *expand(), *get_str(), *str_rep();
X void log_toggle();
X
X dl_win = newwin(6, 70, 5, 5);
X
X mvwprintw(dl_win, 2, 4, "Default log file: %s", param->logfile);
X mvwaddstr(dl_win, 3, 4, "New log file: ");
X box(dl_win, VERT, HORZ);
X
X mvwattrstr(dl_win, 0, 3, A_BOLD, " Start Data Logging ");
X wmove(dl_win, 3, 18);
X wrefresh(dl_win);
X /* get the path */
X while ((ans = get_str(dl_win, 128, "", " \t\n")) != NULL) {
X /* give 'em the default */
X if (*ans == '\0')
X path = param->logfile;
X else
X path = expand(ans);
X
X /* test write permission */
X if (can_write(path)) {
X status->log_path = str_rep(status->log_path, path);
X /*
X * If already on, then cycle it off to close
X * the old (and perhaps different) logfile.
X */
X if (status->log_status)
X log_toggle();
X log_toggle();
X break;
X }
X
X beep();
X mvwattrstr(dl_win, 4, 24, A_BOLD, "No write permission");
X wrefresh(dl_win);
X wait_key(dl_win, 3);
X /* clean up the mess */
X clear_line(dl_win, 3, 18, TRUE);
X clear_line(dl_win, 4, 24, TRUE);
X wmove(dl_win, 3, 18);
X wrefresh(dl_win);
X }
X if (fd == -1) {
X werase(dl_win);
X wrefresh(dl_win);
X }
X delwin(dl_win);
X
X return;
X}
END_OF_FILE
if test 1475 -ne `wc -c <'pcomm-2.0/data_log.c'`; then
echo shar: \"'pcomm-2.0/data_log.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/data_log.c'
fi
if test -f 'pcomm-2.0/di_delay.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/di_delay.c'\"
else
echo shar: Extracting \"'pcomm-2.0/di_delay.c'\" \(1958 characters\)
sed "s/^X//" >'pcomm-2.0/di_delay.c' <<'END_OF_FILE'
X/*
X * Prompt for new delay times during a dialing session. Also, prompts
X * if changes should be saved to disk. Dialing is suspended during
X * this routine.
X */
X
X#include <stdio.h>
X#include <curses.h>
X#include "misc.h"
X#include "param.h"
X
Xvoid
Xdelay_times()
X{
X WINDOW *dt_win, *newwin();
X int cdelay, rdelay;
X
X dt_win = newwin(9, 45, 7, 15);
X
X mvwprintw(dt_win, 2, 4, "Current connect delay time: %d", param->c_delay);
X mvwprintw(dt_win, 3, 4, "Current redial delay time: %d", param->r_delay);
X mvwaddstr(dt_win, 5, 4, "New connect delay: ");
X mvwaddstr(dt_win, 6, 4, "New redial delay: ");
X box(dt_win, VERT, HORZ);
X
X mvwattrstr(dt_win, 0, 3, A_BOLD, " Change Delay Times ");
X wmove(dt_win, 5, 23);
X wrefresh(dt_win);
X /* get the cdelay number */
X if ((cdelay = get_num(dt_win, 3)) == -1) {
X delwin(dt_win);
X return;
X }
X /* give 'em the current settings */
X if (!cdelay) {
X cdelay = param->c_delay;
X wprintw(dt_win, "%-3d", cdelay);
X }
X else {
X /* some reasonable limit */
X if (cdelay > MAX_CDELAY || cdelay < MIN_CDELAY) {
X beep();
X if (cdelay > MAX_CDELAY)
X cdelay = MAX_CDELAY;
X else
X cdelay = MIN_CDELAY;
X mvwprintw(dt_win, 5, 23, "%-3d", cdelay);
X }
X }
X /* get the rdelay number */
X wmove(dt_win, 6, 22);
X wrefresh(dt_win);
X if ((rdelay = get_num(dt_win, 3)) == -1) {
X delwin(dt_win);
X return;
X }
X /* give 'em the current settings */
X if (!rdelay) {
X rdelay = param->r_delay;
X wprintw(dt_win, "%-3d", rdelay);
X }
X else {
X /* some reasonable limit */
X if (rdelay > MAX_PAUSE || rdelay < MIN_PAUSE) {
X beep();
X if (rdelay > MAX_PAUSE)
X rdelay = MAX_PAUSE;
X else
X rdelay = MIN_PAUSE;
X mvwprintw(dt_win, 6, 22, "%-3d", rdelay);
X }
X }
X /* set 'em */
X param->c_delay = cdelay;
X param->r_delay = rdelay;
X /* save 'em to disk? */
X if (yes_prompt(dt_win, 7, 12, A_BOLD, "Save to disk")) {
X if (up_param()) {
X touchwin(dt_win);
X wrefresh(dt_win);
X }
X }
X
X delwin(dt_win);
X return;
X}
END_OF_FILE
if test 1958 -ne `wc -c <'pcomm-2.0/di_delay.c'`; then
echo shar: \"'pcomm-2.0/di_delay.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/di_delay.c'
fi
if test -f 'pcomm-2.0/dial_dir.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/dial_dir.h'\"
else
echo shar: Extracting \"'pcomm-2.0/dial_dir.h'\" \(958 characters\)
sed "s/^X//" >'pcomm-2.0/dial_dir.h' <<'END_OF_FILE'
X/*
X * The dialing directory structure. The first eight elements are
X * contained in the pcomm.dial_dir file.
X */
X
X#define NUM_DIR 100
X#define NUM_QUEUE 10
X#define FAST 0
X#define SLOW 1
X#define QUIET 0
X#define VERBOSE 1
X
Xstruct DIAL_DIR {
X char *name[NUM_DIR+1]; /* name of system being called */
X char *number[NUM_DIR+1]; /* phone number */
X unsigned int baud[NUM_DIR+1];/* baud rate */
X char parity[NUM_DIR+1]; /* parity */
X int data_bits[NUM_DIR+1]; /* data bits */
X int stop_bits[NUM_DIR+1]; /* stop bits */
X char duplex[NUM_DIR+1]; /* duplex (F = full, H = half) */
X char *aux[NUM_DIR+1]; /* auxiliary (script, TTY, or modem) */
X
X int q_num[NUM_QUEUE]; /* entry numbers in the queue */
X char q_ld[NUM_QUEUE]; /* LD codes in the queue */
X
X int d_entries; /* number of entries in the file */
X int d_cur; /* the current entry */
X
X char *d_path; /* path to the pcomm.dial_dir file */
X};
X
X#ifndef MAIN
Xextern struct DIAL_DIR *dir;
X#endif /* MAIN */
END_OF_FILE
if test 958 -ne `wc -c <'pcomm-2.0/dial_dir.h'`; then
echo shar: \"'pcomm-2.0/dial_dir.h'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/dial_dir.h'
fi
if test -f 'pcomm-2.0/expand.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/expand.c'\"
else
echo shar: Extracting \"'pcomm-2.0/expand.c'\" \(2891 characters\)
sed "s/^X//" >'pcomm-2.0/expand.c' <<'END_OF_FILE'
X/*
X * Do file name expansion with "native" shell. Using the native shell
X * (as described in the SHELL environmental variable) allows for csh or
X * ksh abbreviations that sh doesn't recognize. Returns a pointer to
X * a static area.
X */
X
X#define EXPAND_BUF 2048
X
X#include <stdio.h>
X#include <signal.h>
X#include <fcntl.h>
X#include "config.h"
X
X#ifdef BSD
X#include <sys/file.h>
X#endif /* BSD */
X
Xchar *
Xexpand(input)
Xchar *input;
X{
X extern char *null_ptr;
X FILE *pfp, *n_popen();
X int last;
X char buf[1024], *strpbrk(), *strcpy();
X static char ans[EXPAND_BUF];
X
X /* same rules as str_dup() */
X if (input == NULL)
X return(NULL);
X if (*input == '\0')
X return(null_ptr);
X /* any thing to expand? */
X if (!strpbrk(input, "$*{}[]\\?~")) {
X strcpy(ans, input);
X return(ans);
X }
X /* popen an echo */
X sprintf(buf, "echo %s", input);
X
X pfp = n_popen(buf, "r");
X fgets(ans, EXPAND_BUF, pfp);
X n_pclose(pfp);
X
X if (!strlen(ans)) {
X strcpy(ans, input);
X return(ans);
X }
X /*
X * A horrible kludge... if the last character is not a line
X * feed, then the csh has returned an error message. Otherwise
X * zap the line feed.
X */
X last = strlen(ans) -1;
X if (ans[last] != '\n') {
X strcpy(ans, input);
X return(ans);
X }
X else
X ans[last] = '\0';
X
X return(ans);
X}
X
X#define tst(a,b) (*mode == 'r'? (b) : (a))
X#define RDR 0
X#define WTR 1
Xstatic int popen_pid[20];
X
XFILE *
Xn_popen(cmd, mode)
Xchar *cmd, *mode;
X{
X int myside, hisside, ppid, p[2];
X char *shellpath, *shell, *flags, *getenv(), *strrchr();
X void _exit();
X
X if (pipe(p) < 0)
X return NULL;
X
X myside = tst(p[WTR], p[RDR]);
X hisside = tst(p[RDR], p[WTR]);
X /* get the environmental variable */
X shellpath = getenv("SHELL");
X if (shellpath == NULL || *shellpath == '\0')
X shellpath = "/bin/sh";
X
X if (shell = strrchr(shellpath, '/'))
X shell++;
X else {
X shellpath = "/bin/sh";
X shell = "sh";
X }
X /* fix up the flags */
X if (!strcmp(shell, "csh"))
X flags = "-fc";
X else
X flags = "-c"; /* Korn shell too */
X
X if (!(ppid = fork())) {
X int stdio;
X /* no error messages please */
X close(2);
X open("/dev/null", O_WRONLY);
X
X setgid(getgid());
X setuid(getuid());
X
X stdio = tst(0, 1);
X close(myside);
X close(stdio);
X fcntl(hisside, F_DUPFD, stdio);
X close(hisside);
X
X execl(shellpath, shell, flags, cmd, (char *) 0);
X _exit(1);
X }
X if (ppid == -1) {
X close(myside);
X close(hisside);
X return NULL;
X }
X
X popen_pid[myside] = ppid;
X
X close(hisside);
X return(fdopen(myside, mode));
X}
X
Xn_pclose(ptr)
XFILE *ptr;
X{
X SIG_TYPE (*hstat)(), (*istat)(), (*qstat)();
X int f, r, sig_status;
X
X f = fileno(ptr);
X fclose(ptr);
X istat = signal(SIGINT, SIG_IGN);
X qstat = signal(SIGQUIT, SIG_IGN);
X hstat = signal(SIGHUP, SIG_IGN);
X
X while ((r = wait(&sig_status)) != popen_pid[f] && r != -1)
X ;
X
X if (r == -1)
X sig_status = -1;
X
X signal(SIGINT, istat);
X signal(SIGQUIT, qstat);
X signal(SIGHUP, hstat);
X return(sig_status);
X}
END_OF_FILE
if test 2891 -ne `wc -c <'pcomm-2.0/expand.c'`; then
echo shar: \"'pcomm-2.0/expand.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/expand.c'
fi
if test -f 'pcomm-2.0/extrnl.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/extrnl.h'\"
else
echo shar: Extracting \"'pcomm-2.0/extrnl.h'\" \(623 characters\)
sed "s/^X//" >'pcomm-2.0/extrnl.h' <<'END_OF_FILE'
X/*
X * The external file transfer program database. The list is limited to
X * 3 uploads and 3 downloads because the xfer_menu() routine uses single
X * character input (and these selections become 7, 8, and 9).
X */
X
Xstruct EXTRNL {
X char *name[2][3]; /* program name (for display only) */
X char *command[2][3]; /* the command line */
X char prompt[2][3]; /* need to prompt for names? */
X
X int up_entries; /* number of up entries in the file */
X int dn_entries; /* number of down entries in the file */
X
X char *e_path; /* path to the pcomm.extrnl file */
X};
X
X#ifndef MAIN
Xextern struct EXTRNL *extrnl;
X#endif /* MAIN */
END_OF_FILE
if test 623 -ne `wc -c <'pcomm-2.0/extrnl.h'`; then
echo shar: \"'pcomm-2.0/extrnl.h'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/extrnl.h'
fi
if test -f 'pcomm-2.0/getcwd.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/getcwd.c'\"
else
echo shar: Extracting \"'pcomm-2.0/getcwd.c'\" \(393 characters\)
sed "s/^X//" >'pcomm-2.0/getcwd.c' <<'END_OF_FILE'
X/*
X * Can you believe it??? Masscomps don't have a function to return the
X * current working directory while in the AT&T universe!
X */
X
X#include <stdio.h>
X
Xchar *
Xgetcwd(buf, size)
Xchar *buf;
Xint size;
X{
X FILE *pfp, *n_popen();
X
X if (!(pfp = n_popen("pwd", "r")))
X return(".");
X
X fgets(buf, size, pfp);
X n_pclose(pfp);
X /* zap the new line */
X buf[strlen(buf)-1] = '\0';
X return(buf);
X}
END_OF_FILE
if test 393 -ne `wc -c <'pcomm-2.0/getcwd.c'`; then
echo shar: \"'pcomm-2.0/getcwd.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/getcwd.c'
fi
if test -f 'pcomm-2.0/getopt.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/getopt.c'\"
else
echo shar: Extracting \"'pcomm-2.0/getopt.c'\" \(1055 characters\)
sed "s/^X//" >'pcomm-2.0/getopt.c' <<'END_OF_FILE'
X/*
X * Parse the command line and return option flags and arguments
X */
X
X#include <stdio.h>
X#include "config.h"
X
Xint optind = 1;
Xchar *optarg;
X
Xint
Xgetopt(argc, argv, opts)
Xint argc;
Xchar *argv[];
Xchar *opts;
X{
X static int sp = 1;
X int c, strcmp();
X char *cp, *strchr();
X
X if (sp == 1) {
X if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0')
X return(EOF);
X else if (strcmp(argv[optind], "--") == 0) {
X optind++;
X return(EOF);
X }
X }
X c = argv[optind][sp];
X if (c == ':' || (cp=strchr(opts, c)) == NULL) {
X fprintf(stderr, "%s: illegal option \"%c\"\n", argv[0], c);
X if (argv[optind][++sp] == '\0') {
X optind++;
X sp = 1;
X }
X return('?');
X }
X if (*++cp == ':') {
X if (argv[optind][sp+1] != '\0')
X optarg = &argv[optind++][sp+1];
X else if (++optind >= argc) {
X fprintf(stderr, "%s: option \"%c\" requires an argument\n", argv[0], c);
X sp = 1;
X return('?');
X } else
X optarg = argv[optind++];
X sp = 1;
X } else {
X if (argv[optind][++sp] == '\0') {
X sp = 1;
X optind++;
X }
X optarg = NULL;
X }
X return(c);
X}
END_OF_FILE
if test 1055 -ne `wc -c <'pcomm-2.0/getopt.c'`; then
echo shar: \"'pcomm-2.0/getopt.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/getopt.c'
fi
if test -f 'pcomm-2.0/help.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/help.c'\"
else
echo shar: Extracting \"'pcomm-2.0/help.c'\" \(2115 characters\)
sed "s/^X//" >'pcomm-2.0/help.c' <<'END_OF_FILE'
X/*
X * Display the help screen. Press any key to continue. If the ascii_hot
X * string is more than 4 characters wide, this screen will look silly.
X * Maybe one day, this will also contain full page descriptions of each
X * command.
X */
X
X#include <stdio.h>
X#include <curses.h>
X#include "config.h"
X#include "misc.h"
X
Xvoid
Xhelp_screen(hot)
Xchar *hot;
X{
X extern int fd;
X WINDOW *h_win, *newwin();
X
X h_win = newwin(17, 80, 0, 0);
X
X mvwattrstr(h_win, 1, 29, A_BOLD, "P C O M M H E L P\n");
X horizontal(h_win, 2, 0, 80);
X mvwattrstr(h_win, 4, 0, A_BOLD, " Major Functions Utility Functions File Functions\n\n");
X#ifdef OLDCURSES
X mvwprintw(h_win, 6, 2, "Dialing Directory.%4.4s-D Program Info ....%4.4s-I Send Files ....%4.4s-U", hot, hot, hot);
X mvwprintw(h_win, 7, 2, "Auto Redial ......%4.4s-R Setup Screen ....%4.4s-S Receive Files .%4.4s-N", hot, hot, hot);
X#else /* OLDCURSES */
X mvwprintw(h_win, 6, 2, "Dialing Directory.%4.4s-D Program Info ....%4.4s-I Send Files ....%4.4s-<up>", hot, hot, hot);
X mvwprintw(h_win, 7, 2, "Auto Redial ......%4.4s-R Setup Screen ....%4.4s-S Receive Files .%4.4s-<down>", hot, hot, hot);
X#endif /* OLDCURSES */
X mvwprintw(h_win, 8, 2, "Keyboard Macros ..%4.4s-M Change Directory.%4.4s-B Pass Thru Mode.%4.4s-T", hot, hot, hot);
X mvwprintw(h_win, 9, 2, "Line Settings ....%4.4s-P Clear Screen ....%4.4s-C Directory .....%4.4s-F", hot, hot, hot);
X mvwprintw(h_win, 10, 2, "Exit Pcomm .......%4.4s-X Toggle Duplex ...%4.4s-E Screen Dump ...%4.4s-G", hot, hot, hot);
X mvwprintw(h_win, 11, 2, "Unix Gateway .....%4.4s-4 Hang Up Phone ...%4.4s-H Start Data Log.%4.4s-1", hot, hot, hot);
X mvwprintw(h_win, 12, 2, "Command Files ....%4.4s-5 Printer On/Off ..%4.4s-L Toggle Log ....%4.4s-2", hot, hot, hot);
X mvwprintw(h_win, 13, 28, "Toggle CR-CR/LF .%4.4s-3", hot);
X mvwprintw(h_win, 14, 28, "Break Key .......%4.4s-7", hot);
X
X box(h_win, VERT, HORZ);
X mvwaddstr(h_win, 16, 26, " Press any key to continue ");
X wrefresh(h_win);
X
X wgetch(h_win);
X if (fd == -1) {
X werase(h_win);
X wrefresh(h_win);
X }
X delwin(h_win);
X return;
X}
END_OF_FILE
if test 2115 -ne `wc -c <'pcomm-2.0/help.c'`; then
echo shar: \"'pcomm-2.0/help.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/help.c'
fi
if test -f 'pcomm-2.0/info.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/info.c'\"
else
echo shar: Extracting \"'pcomm-2.0/info.c'\" \(1585 characters\)
sed "s/^X//" >'pcomm-2.0/info.c' <<'END_OF_FILE'
X/*
X * Display the initial welcome screen (to include all of the proper
X * acknowledgements). Press any key to continue.
X */
X
X#include <stdio.h>
X#include <curses.h>
X#include "patchlevel.h"
X
Xvoid
Xinfo(auto_clear)
Xint auto_clear;
X{
X extern int fd;
X WINDOW *w_win, *newwin();
X char buf[80];
X /* display the welcome screen */
X w_win = newwin(23, 80, 0, 0);
X mvwaddstr(w_win, 3, 18, "PPPPPP CCCC OOOO MM MM MM MM");
X mvwaddstr(w_win, 4, 18, "P P C O O M M M M M M M M");
X mvwaddstr(w_win, 5, 18, "PPPPPP C O O M M M M M M");
X mvwaddstr(w_win, 6, 18, "P C O O M M M M");
X mvwaddstr(w_win, 7, 18, "P CCCC OOOO M M M M");
X
X sprintf(buf, ">>> Pcomm Version %s <<<", VERSION);
X mvwaddstr(w_win, 10, (80-strlen(buf))/2, buf);
X sprintf(buf, "Release date: %s", DATE);
X mvwaddstr(w_win, 11, (80-strlen(buf))/2, buf);
X
X mvwaddstr(w_win, 13, 8, "Pcomm is a public domain telecommunication program for Unix that");
X mvwaddstr(w_win, 14, 8, "is designed to operate similarly to the MSDOS program, ProComm.");
X mvwaddstr(w_win, 15, 8, "ProComm (TM) is copyrighted by Datastorm Technologies, Inc.");
X mvwaddstr(w_win, 19, 45, "Emmet P. Gray");
X mvwaddstr(w_win, 20, 45, "...!uunet!uiucuxc!fthood!egray");
X mvwaddstr(w_win, 21, 45, "fthood!egray@uxc.cso.uiuc.edu");
X wmove(w_win, 22, 79);
X wrefresh(w_win);
X /* delay so you can read the herald */
X if (auto_clear)
X wait_key(w_win, 5);
X else
X wgetch(w_win);
X
X if (fd == -1) {
X werase(w_win);
X wrefresh(w_win);
X }
X delwin(w_win);
X return;
X}
END_OF_FILE
if test 1585 -ne `wc -c <'pcomm-2.0/info.c'`; then
echo shar: \"'pcomm-2.0/info.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/info.c'
fi
if test -f 'pcomm-2.0/init.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/init.c'\"
else
echo shar: Extracting \"'pcomm-2.0/init.c'\" \(1911 characters\)
sed "s/^X//" >'pcomm-2.0/init.c' <<'END_OF_FILE'
X/*
X * Display the welcome screen and find the Pcomm support files. Returns a
X * pointer to a static area containing the STATUS structure.
X */
X
X#include <stdio.h>
X#include <curses.h>
X#include "config.h"
X#include "misc.h"
X#include "status.h"
X
Xstatic char *extra_dir;
X
Xstruct STATUS *
Xinit(extra)
Xchar *extra;
X{
X int i;
X char *memset(), *str_dup();
X static struct STATUS s;
X /* some defaults */
X s.dup_fd = -1;
X s.cmd_ipc = -1;
X s.connected = 0;
X s.log_status = 0;
X s.log_path = str_dup("NOT_DEFINED");
X s.print_status = 0;
X s.row = 0;
X s.col = 0;
X for (i=0; i<MAX_ROW; i++)
X memset(s.vs[i], '\0', MAX_COL);
X s.max_row = (LINES > MAX_ROW) ? MAX_ROW : LINES;
X s.max_col = (COLS >= MAX_COL) ? MAX_COL -1 : COLS;
X
X extra_dir = str_dup(extra);
X return(&s);
X}
X
X/*
X * Search the extra directory (supplied on the command line), then the
X * directory in the PCOMM environmental variable, then the current working
X * directory, and lastly, the default directory.
X */
X
Xchar *
Xfindfile(name)
Xchar *name;
X{
X int i;
X char *pcomm, *getenv(), *path, pbuf[200], *getcwd(), *str_dup();
X char temp[200];
X
X /* see if PCOMM variable is set */
X pcomm = getenv("PCOMM");
X if (pcomm == NULL || *pcomm == '\0')
X pcomm = NULL;
X else {
X /* zap the trailing separator */
X if (pcomm[strlen(pcomm)-1] == '/')
X pcomm[strlen(pcomm)-1] = '\0';
X }
X
X for (i=0; i<4; i++) {
X /* directory search order */
X switch (i) {
X case 0: /* extra directory from command line */
X path = extra_dir;
X break;
X case 1: /* PCOMM environmental variable */
X path = pcomm;
X break;
X case 2: /* current working directory */
X path = getcwd(pbuf, 200);
X break;
X case 3: /* Pcomm's default directory */
X path = DEFAULT_DIR;
X break;
X }
X if (path == NULL)
X continue;
X
X sprintf(temp, "%s/%s", path, name);
X /* read permission checked */
X if (!access(temp, 4))
X return(str_dup(temp));
X }
X return(NULL);
X}
END_OF_FILE
if test 1911 -ne `wc -c <'pcomm-2.0/init.c'`; then
echo shar: \"'pcomm-2.0/init.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/init.c'
fi
if test -f 'pcomm-2.0/ipc.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/ipc.h'\"
else
echo shar: Extracting \"'pcomm-2.0/ipc.h'\" \(108 characters\)
sed "s/^X//" >'pcomm-2.0/ipc.h' <<'END_OF_FILE'
X/*
X * Header for the mupliplexed I/O stuff
X */
X
X#define KEY_READY 1
X#define TTY_READY 2
X#define CMD_READY 4
END_OF_FILE
if test 108 -ne `wc -c <'pcomm-2.0/ipc.h'`; then
echo shar: \"'pcomm-2.0/ipc.h'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/ipc.h'
fi
if test -f 'pcomm-2.0/ipc_att.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/ipc_att.c'\"
else
echo shar: Extracting \"'pcomm-2.0/ipc_att.c'\" \(2183 characters\)
sed "s/^X//" >'pcomm-2.0/ipc_att.c' <<'END_OF_FILE'
X/*
X * The IPC and multiplexed I/O routines for AT&T flavors of Unix
X */
X
X#include <stdio.h>
X#include <stropts.h>
X#include <poll.h>
X#include <fcntl.h>
X#include <sys/stream.h>
X#include "ipc.h"
X
X#ifndef MAIN
X#define PSEUDO_TTY "/dev/ptmx"
X
Xstatic struct pollfd fds[3];
Xstatic int time_out;
X
Xvoid
Xipc_init(tty_fd, cmd_fd)
Xint tty_fd, cmd_fd;
X{
X fds[0].fd = 0; /* the keyboard */
X fds[0].events = POLLIN;
X fds[0].revents = 0;
X fds[1].fd = tty_fd; /* the TTY */
X fds[1].events = POLLIN;
X fds[1].revents = 0;
X fds[2].fd = cmd_fd; /* the shell script */
X fds[2].events = POLLIN;
X fds[2].revents = 0;
X /* 1 sec loop, or wait forever */
X if (cmd_fd != -1)
X time_out = 1000000;
X else
X time_out = -1;
X return;
X}
X
X/* ARGSUSED */
Xint
Xipc_poll(tty_fd, cmd_fd)
Xint tty_fd, cmd_fd;
X{
X int ret_code;
X
X poll(fds, 3, time_out);
X
X ret_code = 0;
X if (fds[0].revents & POLLIN)
X ret_code |= KEY_READY;
X
X if (fds[1].revents & POLLIN)
X ret_code |= TTY_READY;
X
X if (fds[2].revents & POLLIN)
X ret_code |= CMD_READY;
X
X return(ret_code);
X}
X
X/*
X * Update the file descriptors for poll()/select() that might have changed.
X */
X
Xvoid
Xipc_update(tty_fd, cmd_fd)
Xint tty_fd, cmd_fd;
X{
X fds[1].fd = tty_fd;
X fds[2].fd = cmd_fd;
X
X if (cmd_fd != -1)
X time_out = 1000000;
X else
X time_out = -1;
X return;
X}
X
X/*
X * Open an IPC "channel"
X */
X
Xint
Xipc_open()
X{
X int fd;
X
X if ((fd = open(PSEUDO_TTY, O_RDWR)) < 0)
X return(-1);
X
X grantpt(fd);
X unlockpt(fd);
X return(fd);
X}
X
X/*
X * Close an IPC channel
X */
X
Xint
Xipc_close(fd)
Xint fd;
X{
X return(close(fd));
X}
X
X/*
X * Return a unique "key" to pass to the child process
X */
X
Xchar *
Xipc_key(fd)
Xint fd;
X{
X char *ptsname();
X
X return(ptsname(fd));
X}
X#endif /* MAIN */
X
X/*
X * Attach to an existing IPC channel
X */
X
Xint
Xipc_attach(dev, mode)
Xchar *dev;
Xint mode;
X{
X return(open(dev, mode));
X}
X
X/*
X * Detach from an IPC channel
X */
X
Xint
Xipc_detach(fd)
Xint fd;
X{
X return(close(fd));
X}
X
X/*
X * Read from an IPC channel
X */
X
Xint
Xipc_read(fd, buf, n)
Xint fd;
Xchar *buf;
Xint n;
X{
X if (read(fd, buf, n) != n)
X return(1);
X return(0);
X}
X
X/*
X * Write to an IPC channel
X */
X
Xint
Xipc_write(fd, buf, n)
Xint fd;
Xchar *buf;
Xint n;
X{
X if (write(fd, buf, n) != n)
X return(1);
X return(0);
X}
END_OF_FILE
if test 2183 -ne `wc -c <'pcomm-2.0/ipc_att.c'`; then
echo shar: \"'pcomm-2.0/ipc_att.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/ipc_att.c'
fi
if test -f 'pcomm-2.0/ipc_ucb.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/ipc_ucb.c'\"
else
echo shar: Extracting \"'pcomm-2.0/ipc_ucb.c'\" \(2903 characters\)
sed "s/^X//" >'pcomm-2.0/ipc_ucb.c' <<'END_OF_FILE'
X/*
X * The IPC and multiplexed I/O routines for Berkeley flavors of Unix
X */
X
X#include <stdio.h>
X#include <fcntl.h>
X#include <sys/time.h>
X#include <sys/types.h>
X#include <sys/stat.h>
X#include <sys/file.h>
X#include "ipc.h"
X
X#ifndef MAIN
Xstatic char pty_name[12];
Xstatic int fdin_mask, num_fds;
Xstatic struct timeval time_out = {1L, 0L};
Xstatic struct timeval *tp;
X
Xvoid
Xipc_init(tty_fd, cmd_fd)
Xint tty_fd, cmd_fd;
X{
X int fdout, fdin, fdex;
X
X fdout = 0;
X fdex = 0;
X fdin_mask = 1; /* the keyboard */
X num_fds = 1;
X if (tty_fd != -1) { /* the TTY */
X fdin_mask |= (1 << tty_fd);
X num_fds = tty_fd +1;
X }
X if (cmd_fd != -1) { /* the shell script */
X fdin_mask |= (1 << cmd_fd);
X if (cmd_fd > tty_fd)
X num_fds = cmd_fd +1;
X tp = &time_out;
X }
X else
X tp = (struct timeval *) NULL;
X return;
X}
X
Xint
Xipc_poll(tty_fd, cmd_fd)
Xint tty_fd, cmd_fd;
X{
X int ret_code, fdout, fdin, fdex;
X
X ret_code = 0;
X fdin = fdin_mask;
X select(num_fds, &fdin, &fdout, &fdex, tp);
X
X if (fdin & 1)
X ret_code |= KEY_READY;
X
X if (tty_fd != -1 && (fdin & (1 << tty_fd)))
X ret_code |= TTY_READY;
X
X if (cmd_fd != -1 && (fdin & (1 << cmd_fd)))
X ret_code |= CMD_READY;
X
X return(ret_code);
X}
X
X/*
X * Update the file descriptors for poll()/select() that might have changed.
X */
X
Xvoid
Xipc_update(tty_fd, cmd_fd)
Xint tty_fd, cmd_fd;
X{
X fdin_mask = 1;
X num_fds = 1;
X if (tty_fd != -1) {
X fdin_mask |= (1 << tty_fd);
X num_fds = tty_fd +1;
X }
X if (cmd_fd != -1) {
X fdin_mask |= (1 << cmd_fd);
X if (cmd_fd > tty_fd)
X num_fds = cmd_fd +1;
X tp = &time_out;
X }
X else
X tp = (struct timeval *) NULL;
X return;
X}
X
X/*
X * Open an IPC "channel"
X */
X
Xint
Xipc_open()
X{
X int fd, i, j;
X char *p, *strcpy();
X struct stat sbuf;
X static char letters[] = "pqrs";
X static char hex_num[] = "0123456789abcdef";
X
X strcpy(pty_name, "/dev/ptyxx");
X
X for (i=0; i<4; i++) {
X pty_name[8] = letters[i];
X for (j=0; j<16; j++) {
X pty_name[9] = hex_num[j];
X /* if it doesn't exist, quit */
X if (stat(pty_name, &sbuf) < 0)
X return(-1);
X
X if ((fd = open(pty_name, O_RDWR)) >= 0)
X return(fd);
X }
X }
X return(-1);
X}
X
X/*
X * Close an IPC channel
X */
X
Xint
Xipc_close(fd)
Xint fd;
X{
X return(close(fd));
X}
X
X/*
X * Return a unique "key" to pass to the child process
X */
X
X/* ARGSUSED */
Xchar *
Xipc_key(fd)
Xint fd;
X{
X static char tty_name[12];
X char *strcpy();
X
X strcpy(tty_name, pty_name);
X tty_name[5] = 't';
X return(tty_name);
X}
X#endif /* MAIN */
X
X/*
X * Attach to an existing IPC channel
X */
X
Xint
Xipc_attach(dev, mode)
Xchar *dev;
Xint mode;
X{
X return(open(dev, mode));
X}
X
X/*
X * Detach from an IPC channel
X */
X
Xint
Xipc_detach(fd)
Xint fd;
X{
X return(close(fd));
X}
X
X/*
X * Read from an IPC channel
X */
X
Xint
Xipc_read(fd, buf, n)
Xint fd;
Xchar *buf;
Xint n;
X{
X if (read(fd, buf, n) != n)
X return(1);
X return(0);
X}
X
X/*
X * Write to an IPC channel
X */
X
Xint
Xipc_write(fd, buf, n)
Xint fd;
Xchar *buf;
Xint n;
X{
X if (write(fd, buf, n) != n)
X return(1);
X return(0);
X}
END_OF_FILE
if test 2903 -ne `wc -c <'pcomm-2.0/ipc_ucb.c'`; then
echo shar: \"'pcomm-2.0/ipc_ucb.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/ipc_ucb.c'
fi
if test -f 'pcomm-2.0/list_dir.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/list_dir.c'\"
else
echo shar: Extracting \"'pcomm-2.0/list_dir.c'\" \(1615 characters\)
sed "s/^X//" >'pcomm-2.0/list_dir.c' <<'END_OF_FILE'
X/*
X * Do a shell escape with the "ls" command. Additional command line options
X * are allowed at run time.
X */
X
X#define LS_CMD "ls -aC"
X
X#include <stdio.h>
X#include <curses.h>
X#include "misc.h"
X
Xvoid
Xlist_dir()
X{
X extern int fd;
X WINDOW *ls_win, *newwin();
X FILE *pfp, *n_popen();
X int lines, oops;
X char *ans, *cwd, *getcwd(), buf[200], *get_str();
X
X ls_win = newwin(6, 70, 8, 5);
X
X cwd = getcwd(buf, 200);
X
X mvwprintw(ls_win, 2, 4, "Current directory: %s", cwd);
X mvwaddstr(ls_win, 3, 4, "File spec (wildcards allowed): ");
X box(ls_win, VERT, HORZ);
X
X mvwattrstr(ls_win, 0, 3, A_BOLD, " List Directory ");
X wmove(ls_win, 3, 35);
X wrefresh(ls_win);
X
X if ((ans = get_str(ls_win, 80, "", "\n")) == NULL) {
X if (fd == -1) {
X werase(ls_win);
X wrefresh(ls_win);
X }
X delwin(ls_win);
X return;
X }
X /* popen() an ls */
X sprintf(buf, "%s %s", LS_CMD, ans);
X pfp = n_popen(buf, "r");
X /* make a bigger window */
X werase(ls_win);
X wrefresh(ls_win);
X delwin(ls_win);
X ls_win = newwin(LINES-1, COLS, 0, 0);
X touchwin(ls_win);
X /* a crude kind of paging */
X oops = 0;
X lines = 0;
X while (fgets(buf, BUFSIZ, pfp) != NULL) {
X waddstr(ls_win, buf);
X lines++;
X if (lines == LINES-2) {
X lines = 0;
X mvwaddstr(ls_win, LINES-2, 28, "Press any key for more");
X wrefresh(ls_win);
X if (wgetch(ls_win) == ESC) {
X oops++;
X break;
X }
X werase(ls_win);
X wrefresh(ls_win);
X }
X }
X n_pclose(pfp);
X
X if (!oops) {
X mvwaddstr(ls_win, LINES-2, 25, "Press any key to continue");
X wrefresh(ls_win);
X wgetch(ls_win);
X }
X if (fd == -1) {
X werase(ls_win);
X wrefresh(ls_win);
X }
X delwin(ls_win);
X return;
X}
END_OF_FILE
if test 1615 -ne `wc -c <'pcomm-2.0/list_dir.c'`; then
echo shar: \"'pcomm-2.0/list_dir.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/list_dir.c'
fi
if test -f 'pcomm-2.0/matches.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/matches.c'\"
else
echo shar: Extracting \"'pcomm-2.0/matches.c'\" \(770 characters\)
sed "s/^X//" >'pcomm-2.0/matches.c' <<'END_OF_FILE'
X/*
X * See if two strings match. Returns a 0 on success, and a 1 on failure.
X * This is an external program to be used in shell scripts.
X */
X
X#include <stdio.h>
X#include "config.h"
X
Xmain(argc, argv)
Xint argc;
Xchar *argv[];
X{
X char *strstr();
X void exit();
X
X if (argc != 3) {
X fprintf(stderr, "Usage: matches string1 string2\n");
X exit(-1);
X }
X
X if (strstr(argv[1], argv[2]))
X exit(0);
X exit(1);
X}
X
X#ifndef HAVE_STRSTR
X/*
X * Return a pointer to the first occurrence of string str2 in str1.
X * Returns a NULL if str2 is not in str1.
X */
X
Xchar *
Xstrstr(str1, str2)
Xchar *str1, *str2;
X{
X int len;
X
X len = strlen(str2);
X while (*str1) {
X if (*str2 == *str1) {
X if (!strncmp(str2, str1, len))
X return(str1);
X }
X str1++;
X }
X return(NULL);
X}
X#endif /* HAVE_STRSTR */
END_OF_FILE
if test 770 -ne `wc -c <'pcomm-2.0/matches.c'`; then
echo shar: \"'pcomm-2.0/matches.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/matches.c'
fi
if test -f 'pcomm-2.0/misc.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/misc.h'\"
else
echo shar: Extracting \"'pcomm-2.0/misc.h'\" \(1465 characters\)
sed "s/^X//" >'pcomm-2.0/misc.h' <<'END_OF_FILE'
X/*
X * Definitions to support the home-grown curses(3) functions and to make
X * the old curses(3) routines happy.
X */
X
X#define mvwattrstr(w,y,x,a,s) (wmove(w,y,x)==ERR?ERR:wattrstr(w,a,s))
X#define mvwattrch(w,y,x,a,c) (wmove(w,y,x)==ERR?ERR:wattrch(w,a,c))
X#define mvwattrnum(w,y,x,a,n) (wmove(w,y,x)==ERR?ERR:wattrnum(w,a,n))
X#define mvattrstr(y,x,a,s) (wmove(stdscr,y,x)==ERR?ERR:wattrstr(stdscr,a,s))
X#define mvattrch(y,x,a,c) (wmove(stdscr,y,x)==ERR?ERR:wattrch(stdscr,a,c))
X#define mvattrnum(y,x,a,n) (wmove(stdscr,y,x)==ERR?ERR:wattrnum(stdscr,a,n))
X#define attrstr(a,s) wattrstr(stdscr,a,s)
X#define attrch(a,c) wattrch(stdscr,a,c)
X#define attrnum(a,n) wattrnum(stdscr,a,n)
X
X#ifndef A_BOLD
X#ifdef NOPROMOTE
X#define A_BOLD 0
X#define A_BLINK 0
X#define A_REVERSE 1
X#define A_DIM 0
X#define A_STANDOUT 1
X#define A_UNDERLINE 0
X#else /* NOPROMOTE */
X#define A_BOLD 1
X#define A_BLINK 1
X#define A_REVERSE 1
X#define A_DIM 1
X#define A_STANDOUT 1
X#define A_UNDERLINE 1
X#endif /* NOPROMOTE */
Xtypedef char chtype;
X#endif /* A_BOLD */
X
X#ifdef ACS_HLINE
X#define VERT (chtype)0
X#define HORZ (chtype)0
X#else /* ACS_HLINE */
X#define VERT (chtype)'|'
X#define HORZ (chtype)'-'
X#define ACS_VLINE (chtype)'|'
X#define ACS_HLINE (chtype)'-'
X#endif /* ACS_HLINE */
X
X/*
X * Other miscellaneous stuff
X */
X
X#define BEL 7
X#define BS 8
X#define ESC 27
X#define DEL 127
X
X#define MANUAL_CLEAR 0
X#define AUTO_CLEAR 1
X
X#define DENIED 0
X#define WRITE_OK 1
X#define OK_BUT_EXISTS 2
END_OF_FILE
if test 1465 -ne `wc -c <'pcomm-2.0/misc.h'`; then
echo shar: \"'pcomm-2.0/misc.h'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/misc.h'
fi
if test -f 'pcomm-2.0/modem.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/modem.h'\"
else
echo shar: Extracting \"'pcomm-2.0/modem.h'\" \(1652 characters\)
sed "s/^X//" >'pcomm-2.0/modem.h' <<'END_OF_FILE'
X/*
X * The modem and TTY databases. The first 3 elements make up the TTY
X * database, the next 16 make up the modem database. A "tname" in common
X * with a "mname" link the two together.
X */
X
X#define NUM_TTY 10
X#define NUM_MODEM 10
X
X#define IS_SCRIPT 0
X#define IS_TTY 1
X#define IS_MODEM 2
X
Xstruct MODEM {
X char *tty[NUM_TTY]; /* TTY names */
X char *tname[NUM_TTY]; /* modem name */
X int lock_sp[NUM_TTY]; /* DTE locked baud rate */
X
X char *mname[NUM_MODEM]; /* modem name (matches tname above) */
X char *init[NUM_MODEM]; /* initialization */
X char *dial[NUM_MODEM]; /* dial command */
X char *suffix[NUM_MODEM]; /* dialing command suffix */
X char *hang_up[NUM_MODEM]; /* hang up the modem */
X char auto_baud[NUM_MODEM]; /* should we sync baud rates? */
X char *con_3[NUM_MODEM]; /* 300 baud connect message */
X char *con_12[NUM_MODEM]; /* 1200 baud connect message */
X char *con_24[NUM_MODEM]; /* 2400 baud connect message */
X char *con_48[NUM_MODEM]; /* 4800 baud connect message */
X char *con_96[NUM_MODEM]; /* 9600 baud connect message */
X char *con_192[NUM_MODEM]; /* 19200 baud connect message */
X char *con_384[NUM_MODEM]; /* 38400 baud connect message */
X char *no_con1[NUM_MODEM]; /* no connect #1 */
X char *no_con2[NUM_MODEM]; /* no connect #2 */
X char *no_con3[NUM_MODEM]; /* no connect #3 */
X char *no_con4[NUM_MODEM]; /* no connect #4 */
X
X int t_entries; /* number of TTY entries */
X int m_entries; /* number of modem entries */
X int t_cur; /* current TTY entry number */
X int m_cur; /* current modem entry number */
X
X char *m_path; /* path to the pcomm.modem file */
X};
X
X#ifndef MAIN
Xextern struct MODEM *modem;
X#endif /* MAIN */
END_OF_FILE
if test 1652 -ne `wc -c <'pcomm-2.0/modem.h'`; then
echo shar: \"'pcomm-2.0/modem.h'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/modem.h'
fi
if test -f 'pcomm-2.0/n_shell.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/n_shell.c'\"
else
echo shar: Extracting \"'pcomm-2.0/n_shell.c'\" \(1302 characters\)
sed "s/^X//" >'pcomm-2.0/n_shell.c' <<'END_OF_FILE'
X/*
X * Spawn a "native" shell. Native means the shell found in the SHELL
X * environmental variable.
X */
X
X#include <stdio.h>
X#include <signal.h>
X#include <curses.h>
X#include "config.h"
X
Xvoid
Xn_shell()
X{
X WINDOW *sh_win, *newwin();
X SIG_TYPE (*istat)(), (*qstat)();
X int sig_status, spid, w;
X char *shell, *shellpath, *getenv(), *strrchr();
X unsigned int sleep();
X void _exit();
X /* a full window */
X sh_win = newwin(LINES, COLS, 0, 0);
X
X touchwin(sh_win);
X waddstr(sh_win, "Pcomm <=> Unix gateway, use ^D or 'exit' to return\n");
X wrefresh(sh_win);
X /* out of curses mode */
X resetterm();
X
X shellpath = getenv("SHELL");
X if (shellpath == NULL || *shellpath == '\0')
X shellpath = "/bin/sh";
X
X if (shell = strrchr(shellpath, '/'))
X shell++;
X else {
X shellpath = "/bin/sh";
X shell = "sh";
X }
X
X if (!(spid = fork())) {
X signal(SIGINT, SIG_DFL);
X signal(SIGQUIT, SIG_DFL);
X
X setgid(getgid());
X setuid(getuid());
X
X execl(shellpath, shell, "-i", (char *) 0);
X _exit(1);
X }
X istat = signal(SIGINT, SIG_IGN);
X qstat = signal(SIGQUIT, SIG_IGN);
X
X while ((w = wait(&sig_status)) != spid && w != -1)
X ;
X
X signal(SIGINT, istat);
X signal(SIGQUIT, qstat);
X /* back to curses mode */
X sleep(1);
X fixterm();
X
X clearok(curscr, TRUE);
X werase(sh_win);
X wrefresh(sh_win);
X delwin(sh_win);
X return;
X}
END_OF_FILE
if test 1302 -ne `wc -c <'pcomm-2.0/n_shell.c'`; then
echo shar: \"'pcomm-2.0/n_shell.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/n_shell.c'
fi
if test -f 'pcomm-2.0/param.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/param.h'\"
else
echo shar: Extracting \"'pcomm-2.0/param.h'\" \(2784 characters\)
sed "s/^X//" >'pcomm-2.0/param.h' <<'END_OF_FILE'
X/*
X * The standard Pcomm parameters. Everything can be altered by using one
X * of Pcomm's menus. Although editing by hand is not encouraged, the
X * pcomm.param file is just an ASCII file.
X */
X
X#define MAX_CDELAY 120
X#define MIN_CDELAY 10
X#define MAX_PAUSE 120
X#define MIN_PAUSE 1
X#define MAX_TIMER 20
X#define MIN_TIMER 2
X
X#define NUM_PARAM 44
X#define LINE_SET 0
X#define TERM_SETUP 4
X#define GEN_SETUP 10
X#define DELAY_TIMES 19
X#define ASCII_SETUP 21
X#define LD_CODES 30
X#define MACROS 34
X
Xstruct PARAM {
X /* 0-3 used in ls_menu() */
X unsigned int d_baud; /* default baud rate */
X char d_parity; /* default parity */
X int d_data_bits; /* default data bits */
X int d_stop_bits; /* default stop bits */
X
X /* 4-9 used in term_setup() */
X int hot_key; /* the decimal code for the hot key */
X char *ascii_hot; /* ascii representation of hot key */
X char *d_duplex; /* default duplex */
X char *flow_ctrl; /* flow control */
X char *cr_in; /* send as carriage return */
X char *cr_out; /* receive carriage return as */
X
X /* 10-18 used in gen_setup() */
X char *logfile; /* default log file */
X char *dumpfile; /* default screen dump file */
X char *strip; /* strip high bit (translate table) */
X char pause_char; /* pause char synonym */
X char cr_char; /* carriage return char synonym */
X char ctrl_char; /* ctrl char synonym */
X char esc_char; /* escape char synonym */
X char brk_char; /* modem break synonym */
X char *abort; /* destination of aborted downloads */
X
X /* 19-20 used in gen_setup() & delay_times() */
X int c_delay; /* connect delay time */
X int r_delay; /* redial delay time */
X
X /* 21-29 used in axfer_setup() */
X char *local_echo; /* echo locally? */
X char *expand; /* expand blank lines? */
X int cr_delay; /* carriage return delay (ms) */
X char *pace; /* pace the output? */
X char *cr_up; /* send carriage return as */
X char *lf_up; /* send line feed as */
X int timer; /* transfer timeout */
X char *cr_dn; /* receive carriage return as */
X char *lf_dn; /* receive line feed as */
X
X /* 30-33 used in d_revise() */
X char *ld_plus; /* + long distance code */
X char *ld_minus; /* - long distance code */
X char *ld_at; /* @ long distance code */
X char *ld_pound; /* # long distance code */
X
X /* 34-43 used in macro() */
X char *mac_1; /* shifted 1 macro */
X char *mac_2; /* shifted 2 macro */
X char *mac_3; /* shifted 3 macro */
X char *mac_4; /* shifted 4 macro */
X char *mac_5; /* shifted 5 macro */
X char *mac_6; /* shifted 6 macro */
X char *mac_7; /* shifted 7 macro */
X char *mac_8; /* shifted 8 macro */
X char *mac_9; /* shifted 9 macro */
X char *mac_0; /* shifted 0 macro */
X
X char *p_path; /* path to the pcomm.param file */
X};
X
X#ifndef MAIN
Xextern struct PARAM *param;
X#endif /* MAIN */
END_OF_FILE
if test 2784 -ne `wc -c <'pcomm-2.0/param.h'`; then
echo shar: \"'pcomm-2.0/param.h'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/param.h'
fi
if test -f 'pcomm-2.0/passthru.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/passthru.c'\"
else
echo shar: Extracting \"'pcomm-2.0/passthru.c'\" \(2488 characters\)
sed "s/^X//" >'pcomm-2.0/passthru.c' <<'END_OF_FILE'
X/*
X * A transparent "pass-thru" mode, designed to allow binary transfers
X * between 3 machines (with the middle machine in the pass-thru mode).
X */
X
X#include <stdio.h>
X#include <signal.h>
X#include <curses.h>
X#include "config.h"
X#include "misc.h"
X
X#ifdef BSD
X#include <setjmp.h>
Xjmp_buf cp_buf;
X#endif /* BSD */
X
Xstatic void cpio();
X
Xvoid
Xpass_thru()
X{
X extern int fd;
X WINDOW *pt_win, *newwin();
X int num;
X void error_win();
X
X pt_win = newwin(5, 70, 5, 5);
X
X mvwaddstr(pt_win, 2, 4, "Enter the expiration time (5-60 sec): ");
X box(pt_win, VERT, HORZ);
X
X mvwattrstr(pt_win, 0, 3, A_BOLD, " Pass Through Mode ");
X wmove(pt_win, 2, 43);
X wrefresh(pt_win);
X /* get the answer */
X while ((num = get_num(pt_win, 2)) != -1) {
X /* out of bounds */
X if (num < 5 || num > 60) {
X beep();
X clear_line(pt_win, 2, 43, TRUE);
X wmove(pt_win, 2, 43);
X wrefresh(pt_win);
X }
X else {
X werase(pt_win);
X wrefresh(pt_win);
X delwin(pt_win);
X
X if (fd == -1) {
X error_win(0, "Not currently connected to any host", "");
X return;
X }
X
X touchwin(stdscr);
X refresh();
X
X cpio((unsigned int) num);
X return;
X }
X }
X if (fd == -1) {
X werase(pt_win);
X wrefresh(pt_win);
X }
X delwin(pt_win);
X return;
X}
X
X/*
X * Copy the stdin to the TTYout and copy the TTYin to the stdout. Uses
X * multi character reads. I'm not too concerned about the excess baggage
X * caused by the entire image being forked... this feature won't be used
X * that often.
X */
X
Xstatic int cp_flag;
Xstatic int cp_force();
X
Xstatic void
Xcpio(num)
Xunsigned int num;
X{
X extern int fd;
X int cpid, n;
X char buf[CLIST_SIZ];
X unsigned int alarm(), sleep();
X void line_set(), xmodem_mode();
X
X /* out of curses mode */
X resetterm();
X
X xmodem_mode(0);
X xmodem_mode(fd);
X
X /* copy the TTYin to stdout */
X if (!(cpid = fork())) {
X /* CONSTCOND */
X while (1) {
X n = read(fd, buf, CLIST_SIZ);
X write(1, buf, n);
X }
X }
X
X cp_flag = 0;
X signal(SIGALRM, (SIG_TYPE(*) ()) cp_force);
X /* copy the stdin to TTYout */
X /* CONSTCOND */
X while (1) {
X alarm(num);
X#ifdef BSD
X if (setjmp(cp_buf))
X break;
X#endif /* BSD */
X n = read(0, buf, CLIST_SIZ);
X if (cp_flag)
X break;
X write(fd, buf, n);
X }
X kill(cpid, SIGKILL);
X /* back to curses mode */
X sleep(1);
X fixterm();
X beep();
X line_set();
X clearok(curscr, TRUE);
X return;
X}
X
X/* ARGSUSED */
Xstatic int
Xcp_force(dummy)
X{
X#ifdef BSD
X longjmp(cp_buf, 1);
X#else /* BSD */
X signal(SIGALRM, (SIG_TYPE(*) ()) cp_force);
X cp_flag = 1;
X return(0);
X#endif /* BSD */
X}
END_OF_FILE
if test 2488 -ne `wc -c <'pcomm-2.0/passthru.c'`; then
echo shar: \"'pcomm-2.0/passthru.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/passthru.c'
fi
if test -f 'pcomm-2.0/patchlevel.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/patchlevel.h'\"
else
echo shar: Extracting \"'pcomm-2.0/patchlevel.h'\" \(49 characters\)
sed "s/^X//" >'pcomm-2.0/patchlevel.h' <<'END_OF_FILE'
X#define VERSION "2.0.0"
X#define DATE "18 Jul 92"
END_OF_FILE
if test 49 -ne `wc -c <'pcomm-2.0/patchlevel.h'`; then
echo shar: \"'pcomm-2.0/patchlevel.h'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/patchlevel.h'
fi
if test -f 'pcomm-2.0/pexit.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/pexit.c'\"
else
echo shar: Extracting \"'pcomm-2.0/pexit.c'\" \(2176 characters\)
sed "s/^X//" >'pcomm-2.0/pexit.c' <<'END_OF_FILE'
X/*
X * Exit Pcomm. A user requested abort. There are a lot of things to do
X * before we exit!
X */
X
X#include <stdio.h>
X#include <curses.h>
X#include "dial_dir.h"
X#include "misc.h"
X#include "param.h"
X#include "status.h"
X
Xvoid
Xpexit()
X{
X extern int fd;
X WINDOW *ex_win, *newwin();
X void cleanup(), st_line();
X
X ex_win = newwin(5, 33, 3, 7);
X
X box(ex_win, VERT, HORZ);
X mvwattrstr(ex_win, 0, 3, A_BOLD, " Exit ");
X if (yes_prompt(ex_win, 2, 4, A_BLINK, "Exit to Unix")) {
X st_line(" exiting");
X cleanup(0);
X }
X if (fd == -1) {
X werase(ex_win);
X wrefresh(ex_win);
X }
X delwin(ex_win);
X return;
X}
X
X/*
X * Do the clean up detail before we exit. Only the status structure
X * is guaranteed to exit.
X */
X
Xvoid
Xcleanup(val)
Xint val;
X{
X extern int msg_status;
X void release_port(), exit();
X char *mytty, *ttyname();
X /* release the port */
X release_port(QUIET);
X
X /*
X * If we die an un-natural death (such as a SIGHUP on the loss of
X * the controlling terminal) we won't have a terminal to mess with.
X */
X if (isatty(0)) {
X touchwin(stdscr);
X clear();
X refresh();
X endwin();
X /* return the TTY chmod */
X if (mytty = ttyname(0))
X chmod(mytty, msg_status);
X }
X exit(val);
X}
X
X/*
X * Open a window to display an error message. Handles both fatal and
X * non-fatal errors
X */
X
Xvoid
Xerror_win(code, line_one, line_two)
Xint code;
Xchar *line_one, *line_two;
X{
X WINDOW *e_win, *newwin();
X void cleanup(), st_line();
X
X /* make sure we're in curses mode */
X fixterm();
X e_win = newwin(7, 70, 9, 5);
X /* display the nasty note */
X mvwaddstr(e_win, 2, 4, line_one);
X mvwaddstr(e_win, 3, 4, line_two);
X box(e_win, VERT, HORZ);
X
X if (code) {
X mvwattrstr(e_win, 0, 4, A_BOLD, " Error ");
X mvwattrstr(e_win, 5, 24, A_BLINK, "Press any key to exit");
X wmove(e_win, 5, 46);
X }
X else {
X mvwattrstr(e_win, 0, 4, A_BOLD, " Warning ");
X mvwattrstr(e_win, 5, 22, A_BLINK, "Press any key to continue");
X wmove(e_win, 5, 48);
X }
X beep();
X wrefresh(e_win);
X /* if inside a script */
X if (status->dup_fd != -1)
X wait_key(e_win, 5);
X else
X wgetch(e_win);
X werase(e_win);
X wrefresh(e_win);
X delwin(e_win);
X
X if (code) {
X st_line(" exiting");
X cleanup(code);
X }
X return;
X}
END_OF_FILE
if test 2176 -ne `wc -c <'pcomm-2.0/pexit.c'`; then
echo shar: \"'pcomm-2.0/pexit.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/pexit.c'
fi
if test -f 'pcomm-2.0/redial.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/redial.c'\"
else
echo shar: Extracting \"'pcomm-2.0/redial.c'\" \(2378 characters\)
sed "s/^X//" >'pcomm-2.0/redial.c' <<'END_OF_FILE'
X/*
X * The redial option (actually a misnomer, it's really a queuing system).
X * We expect a space-separated list of dialing directory entries (although
X * new users always try to put in a phone number). A non-zero return code
X * means we're ready to dial.
X */
X
X#include <stdio.h>
X#include <curses.h>
X#include "config.h"
X#include "dial_dir.h"
X#include "misc.h"
X
Xint
Xredial()
X{
X extern int fd;
X WINDOW *rd_win, *newwin();
X char *ans, *entry, *get_str(), *strchr(), *strtok(), ld_code, buf[256];
X int i, oops, number, ret_code;
X
X rd_win = newwin(6, 70, 5, 5);
X
X mvwaddstr(rd_win, 4, 23, "(<CR> for previous numbers)");
X mvwaddstr(rd_win, 2, 4, "Directory Entry Number(s): ");
X box(rd_win, VERT, HORZ);
X
X mvwattrstr(rd_win, 0, 3, A_BOLD, " Redial Queue ");
X wmove(rd_win, 2, 31);
X wrefresh(rd_win);
X /* get the string of numbers */
X ret_code = 0;
X while ((ans = get_str(rd_win, 35, "0123456789+-@# ", "")) != NULL) {
X oops = 0;
X if (*ans == '\0') {
X /* use previous queue */
X if (dir->q_num[0] != -1) {
X ret_code++;
X break;
X }
X /* there is no previous queue */
X beep();
X mvwattrstr(rd_win, 3, 4, A_BOLD, "No previous numbers");
X wrefresh(rd_win);
X wait_key(rd_win, 3);
X clear_line(rd_win, 3, 4, TRUE);
X wmove(rd_win, 2, 31);
X wrefresh(rd_win);
X continue;
X }
X /* parse the queue values */
X entry = strtok(ans, " \t");
X for (i=0; i<NUM_QUEUE; i++) {
X if (entry == NULL) {
X dir->q_num[i] = -1;
X continue;
X }
X /* is there a LD code? */
X ld_code = '\0';
X if (strchr("+-@#", *entry)) {
X ld_code = *entry;
X entry++;
X }
X
X /*
X * Zero is valid here, because it means use
X * the current entry information.
X */
X number = atoi(entry);
X if (number > NUM_DIR || *dir->number[number] == '\0') {
X beep();
X sprintf(buf, "Invalid or empty directory entry number %d", number);
X mvwattrstr(rd_win, 3, 14, A_BOLD, buf);
X wrefresh(rd_win);
X wait_key(rd_win, 3);
X clear_line(rd_win, 3, 4, TRUE);
X clear_line(rd_win, 2, 31, TRUE);
X wrefresh(rd_win);
X oops++;
X break;
X }
X /* store the number in the queue */
X dir->q_ld[i] = ld_code;
X dir->q_num[i] = number;
X entry = strtok((char *) NULL, " \t");
X }
X if (oops) {
X dir->q_num[0] = -1;
X continue;
X }
X ret_code++;
X break;
X }
X if (fd == -1) {
X werase(rd_win);
X wrefresh(rd_win);
X }
X delwin(rd_win);
X return(ret_code);
X}
END_OF_FILE
if test 2378 -ne `wc -c <'pcomm-2.0/redial.c'`; then
echo shar: \"'pcomm-2.0/redial.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/redial.c'
fi
if test -f 'pcomm-2.0/screen.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/screen.c'\"
else
echo shar: Extracting \"'pcomm-2.0/screen.c'\" \(1213 characters\)
sed "s/^X//" >'pcomm-2.0/screen.c' <<'END_OF_FILE'
X/*
X * Routines to read and copy the virtual screen image file.
X */
X
X#include <stdio.h>
X#include <curses.h>
X#include "param.h"
X#include "status.h"
X
X/*
X * Do a screen dump. Actually, the screen is already dumped, all we
X * do is copy the file.
X */
X
Xvoid
Xscreen_dump()
X{
X FILE *fp_out, *uid_fopen();
X char buf[128];
X void error_win();
X int i;
X /* open for append */
X if (!(fp_out = uid_fopen(param->dumpfile, "a"))) {
X sprintf(buf, "\"%s\" for write", param->dumpfile);
X error_win(0, "Can't open screen dump file", buf);
X return;
X }
X for (i=0; i<status->max_row; i++)
X fprintf(fp_out, "%s\n", status->vs[i]);
X
X fclose(fp_out);
X
X return;
X}
X
X/*
X * Read the virtual screen and paint its contents to the stdscr using
X * curses(3). Move the cursor where it belongs.
X */
X
Xvoid
Xload_vs()
X{
X register int i;
X
X clearok(curscr, TRUE);
X erase();
X
X for (i=0; i<status->max_row; i++)
X mvaddstr(i, 0, status->vs[i]);
X
X move(status->row, status->col);
X
X refresh();
X return;
X}
X
X/*
X * Clear the virtual screen.
X */
X
Xvoid
Xvs_clear(start_row)
Xint start_row;
X{
X int i;
X char *memset();
X
X for (i=0; i<status->max_row; i++)
X memset(status->vs[i], ' ', status->max_col);
X
X status->row = start_row;
X status->col = 0;
X return;
X}
END_OF_FILE
if test 1213 -ne `wc -c <'pcomm-2.0/screen.c'`; then
echo shar: \"'pcomm-2.0/screen.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/screen.c'
fi
if test -f 'pcomm-2.0/st_line.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/st_line.c'\"
else
echo shar: Extracting \"'pcomm-2.0/st_line.c'\" \(2072 characters\)
sed "s/^X//" >'pcomm-2.0/st_line.c' <<'END_OF_FILE'
X/*
X * Display the status line. Up to now, we've never really cared how
X * large the physical screen was... but now we want the status line
X * on the bottom.
X */
X
X#include <curses.h>
X#include "config.h"
X#include "dial_dir.h"
X#include "misc.h"
X#include "modem.h"
X#include "param.h"
X#include "status.h"
X
Xvoid
Xst_line(message)
Xchar *message;
X{
X extern int xmc;
X WINDOW *sl_win, *newwin();
X int d, x, y;
X static char *dn[2] = {"FDX", "HDX"};
X static char *ln[2] = {"LOG OFF", "LOG ON"};
X static char *pn[2] = {"PTR OFF", "PTR ON "};
X char buf[80], field_one[15], *cur_tty;
X
X /* is anybody missing? */
X if (dir == NULL || modem == NULL || param == NULL)
X return;
X /* remember where we parked the car.. */
X getyx(stdscr, y, x);
X
X sl_win = newwin(1, 80, LINES-1, 0);
X /* duplex message */
X d = 0;
X if (dir->duplex[0] == 'H')
X d++;
X /* the current TTY */
X cur_tty = "No TTY";
X if (modem->t_cur != -1)
X cur_tty = modem->tty[modem->t_cur];
X
X /*
X * The philosophy is: If you press a command sequence that
X * doesn't generate a window on the screen, then show the user
X * what's going on in the status line.
X */
X if (*message == '\0')
X sprintf(field_one, " %4.4s-0 HELP ", param->ascii_hot);
X else
X sprintf(field_one, " %-13.13s", message);
X
X#ifdef XMC_BROKE
X if (xmc > 0)
X sprintf(buf, "%s | %-9.9s| %s | %5d %c%d%d | %-7.7s | %-7.7s | %-5.5s|%-5.5s",
X field_one, cur_tty, dn[d], dir->baud[0], dir->parity[0],
X dir->data_bits[0], dir->stop_bits[0], ln[status->log_status],
X pn[status->print_status], param->cr_in, param->cr_out);
X else
X#endif /* XMC_BROKE */
X sprintf(buf, "%s | %-9.9s| %s | %5d %c%d%d | %-7.7s | %-7.7s | %-5.5s| %-5.5s",
X field_one, cur_tty, dn[d], dir->baud[0], dir->parity[0],
X dir->data_bits[0], dir->stop_bits[0], ln[status->log_status],
X pn[status->print_status], param->cr_in, param->cr_out);
X
X if (xmc > 0) {
X touchwin(sl_win);
X werase(sl_win);
X wrefresh(sl_win);
X }
X wattrstr(sl_win, A_STANDOUT, buf);
X wrefresh(sl_win);
X /* go ahead and delete it now */
X delwin(sl_win);
X move(y, x);
X refresh();
X return;
X}
END_OF_FILE
if test 2072 -ne `wc -c <'pcomm-2.0/st_line.c'`; then
echo shar: \"'pcomm-2.0/st_line.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/st_line.c'
fi
if test -f 'pcomm-2.0/status.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/status.h'\"
else
echo shar: Extracting \"'pcomm-2.0/status.h'\" \(701 characters\)
sed "s/^X//" >'pcomm-2.0/status.h' <<'END_OF_FILE'
X/*
X * The status flags, and other various changeable things.
X */
X
X#define MAX_ROW 64
X#define MAX_COL 133
X
Xstruct STATUS {
X int dup_fd; /* fd for duplicating input */
X int cmd_ipc; /* IPC for shell scripts */
X int connected; /* are we connected to a remote? */
X int log_status; /* status of log option */
X char *log_path; /* data logging file */
X int print_status; /* status of print option */
X int row; /* cursor row position */
X int col; /* cursor column position */
X char vs[MAX_ROW][MAX_COL]; /* the virtual screen */
X int max_row; /* the virtual screen demensions */
X int max_col; /* the virtual screen demensions */
X};
X
X#ifndef MAIN
Xextern struct STATUS *status;
X#endif /* MAIN */
END_OF_FILE
if test 701 -ne `wc -c <'pcomm-2.0/status.h'`; then
echo shar: \"'pcomm-2.0/status.h'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/status.h'
fi
if test -f 'pcomm-2.0/vcs.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/vcs.h'\"
else
echo shar: Extracting \"'pcomm-2.0/vcs.h'\" \(330 characters\)
sed "s/^X//" >'pcomm-2.0/vcs.h' <<'END_OF_FILE'
X/*
X * Definitions to support the detection of video command sequences
X */
X
X#define VCS_SIZE 25
X#define NUM_VCS 9
X
X#define HOME 0
X#define CLR_EOL 1
X#define CLR_EOS 2
X#define CLEAR 3
X#define MV_UP 4
X#define MV_DOWN 5
X#define MV_RIGHT 6
X#define MV_LEFT 7
X#define MV_DIRECT 8
X
X#define YES 1
X#define NO 0
X#define MAYBE (-1)
END_OF_FILE
if test 330 -ne `wc -c <'pcomm-2.0/vcs.h'`; then
echo shar: \"'pcomm-2.0/vcs.h'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/vcs.h'
fi
if test -f 'pcomm-2.0/waitfor.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/waitfor.c'\"
else
echo shar: Extracting \"'pcomm-2.0/waitfor.c'\" \(1891 characters\)
sed "s/^X//" >'pcomm-2.0/waitfor.c' <<'END_OF_FILE'
X/*
X * Wait for a string on the stdin. Returns a 0 on success, 1 on failure
X * and -1 on error. This is an external program designed to be used in
X * shell scripts.
X */
X
X#define TIMEOUT 10
X#define BUF_SIZ 1024
X
X#include <stdio.h>
X#include <signal.h>
X#include "config.h"
X
X#ifdef BSD
X#include <setjmp.h>
Xjmp_buf wf_buf;
X#endif /* BSD */
X
Xmain(argc, argv)
Xint argc;
Xchar *argv[];
X{
X int i, j, timeout, diff, length;
X char c, buf[BUF_SIZ], *string, *strcmp(), *strncpy();
X long t, time();
X void exit();
X
X if (argc < 2 || argc > 3) {
X fprintf(stderr, "Usage: waitfor -n string\n");
X exit(-1);
X }
X
X if (argv[1][0] == '-') {
X timeout = atoi(&argv[1][1]);
X if (argc != 3) {
X fprintf(stderr, "Usage: waitfor -n string\n");
X exit(-1);
X }
X string = argv[2];
X }
X else {
X timeout = TIMEOUT;
X string = argv[1];
X }
X /* here we go.. */
X i = 0;
X length = strlen(string);
X time(&t);
X while ((time((long *) 0) - t) < timeout) {
X if ((j = getc_line()) != -1) {
X c = j & 0x7f;
X /* no NULLs please */
X if (c == '\0')
X continue;
X
X buf[i++] = c;
X buf[i] = '\0';
X /* roll the buffer over */
X if (i == BUF_SIZ -1) {
X strncpy(buf, &buf[BUF_SIZ/2], BUF_SIZ/2);
X i = BUF_SIZ/2;
X }
X /* is it possible? */
X diff = i - length;
X if (diff < 0)
X continue;
X
X if (!strcmp(&buf[diff], string))
X exit(0);
X }
X }
X exit(1);
X}
X
Xstatic int wf_flag;
Xstatic int wf_force();
X
Xint
Xgetc_line()
X{
X char c;
X unsigned int alarm();
X
X signal(SIGALRM, (SIG_TYPE(*) ()) wf_force);
X wf_flag = 0;
X
X alarm(1);
X
X#ifdef BSD
X if (setjmp(wf_buf))
X return(-1);
X#endif /* BSD */
X
X if (read(0, &c, 1) <= 0) {
X alarm(0);
X return(-1);
X }
X if (wf_flag)
X return(-1);
X alarm(0);
X return(c & 0xff);
X}
X
X/* ARGSUSED */
Xstatic int
Xwf_force(dummy)
Xint dummy;
X{
X#ifdef BSD
X longjmp(wf_buf, 1);
X#else /* BSD */
X signal(SIGALRM, (SIG_TYPE(*) ()) wf_force);
X wf_flag = 1;
X return(0);
X#endif /* BSD */
X}
END_OF_FILE
if test 1891 -ne `wc -c <'pcomm-2.0/waitfor.c'`; then
echo shar: \"'pcomm-2.0/waitfor.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/waitfor.c'
fi
if test -f 'pcomm-2.0/x_extrnl.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/x_extrnl.c'\"
else
echo shar: Extracting \"'pcomm-2.0/x_extrnl.c'\" \(1963 characters\)
sed "s/^X//" >'pcomm-2.0/x_extrnl.c' <<'END_OF_FILE'
X/*
X * Spawn a shell with the stdin and stdout swapped with the remote
X * system, ie:
X * +----------+
X * TTYin ------------> stdin | |
X * | shell |
X * TTYout <---------- stdout | |
X * +----------+
X *
X * An undocumented feature: The external protocol gateway
X * can be used to pipe the output of a normal Unix command to the
X * remote system.
X */
X
X#include <stdio.h>
X#include <curses.h>
X#include <signal.h>
X#include <errno.h>
X#include "config.h"
X
Xvoid
Xdo_extrnl(cmd)
Xchar *cmd;
X{
X extern int fd, errno;
X WINDOW *xt_win, *newwin();
X int epid, want_out;
X unsigned int sleep();
X void _exit(), line_set();
X
X /* a full window */
X xt_win = newwin(LINES, COLS, 0, 0);
X nl();
X touchwin(xt_win);
X wrefresh(xt_win);
X
X if (!(epid = fork())) {
X /* create a new process group ID */
X#ifdef BSD
X setpgrp(0, getpid());
X#else /* BSD */
X setpgrp();
X#endif /* BSD */
X /* swap the stdin and stdout */
X close(0);
X dup(fd);
X close(1);
X dup(fd);
X
X setgid(getgid());
X setuid(getuid());
X
X execl("/bin/sh", "sh", "-c", cmd, (char *) 0);
X _exit(1);
X }
X
X /*
X * Check the keyboard while the external program is running. If
X * the user hits the <ESC> key, then kill the entire process
X * group associated with the new shell.
X */
X want_out = 0;
X /* CONSTCOND */
X while(1) {
X switch(wait_key(stdscr, 1)) {
X case -1: /* timed out */
X break;
X case 27: /* a user abort */
X#ifdef BSD
X killpg(epid, SIGKILL);
X#else /* BSD */
X kill(-epid, SIGKILL);
X#endif /* BSD */
X want_out++;
X break;
X default:
X beep();
X break;
X }
X if (want_out)
X break;
X /* see if the process it still active */
X if ((kill(epid, 0) == -1) && errno == ESRCH)
X break;
X }
X /* the tty may have been clobbered */
X sleep(1);
X fixterm();
X line_set();
X nonl();
X
X clearok(curscr, TRUE);
X werase(xt_win);
X wrefresh(xt_win);
X delwin(xt_win);
X return;
X}
END_OF_FILE
if test 1963 -ne `wc -c <'pcomm-2.0/x_extrnl.c'`; then
echo shar: \"'pcomm-2.0/x_extrnl.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/x_extrnl.c'
fi
if test -f 'pcomm-2.0/x_win.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/x_win.c'\"
else
echo shar: Extracting \"'pcomm-2.0/x_win.c'\" \(1944 characters\)
sed "s/^X//" >'pcomm-2.0/x_win.c' <<'END_OF_FILE'
X/*
X * Display the file transfer window, and invoke the transfer protocol.
X */
X
X#include <stdio.h>
X#include <curses.h>
X#include "dial_dir.h"
X#include "misc.h"
X#include "status.h"
X#include "xmodem.h"
X
Xvoid
Xxfer_win(list, up, type)
Xchar *list;
Xint up, type;
X{
X extern int fd;
X WINDOW *xf_win, *newwin();
X int ack_error;
X void xmodem_mode(), line_set(), st_line();
X
X touchwin(stdscr);
X refresh();
X st_line("");
X
X xf_win = newwin(15, 44, 2, 30);
X /*
X * This window should be in the non-blocking mode, so we can
X * scan the keyboard for input while transferring a file.
X */
X tty_noblock(0, TRUE);
X /* basic window stuff */
X mvwaddstr(xf_win, 2, 14, "Protocol:");
X mvwaddstr(xf_win, 3, 13, "File name:");
X mvwaddstr(xf_win, 4, 13, "File size:");
X mvwaddstr(xf_win, 5, 4, "Error check method:");
X mvwaddstr(xf_win, 6, 5, "Est transfer time:");
X mvwaddstr(xf_win, 7, 11, "Block count:");
X mvwaddstr(xf_win, 8, 6, "Percent complete:");
X mvwaddstr(xf_win, 9, 5, "Bytes transferred:");
X mvwaddstr(xf_win, 10, 5, "Errors this block:");
X mvwaddstr(xf_win, 11, 5, "Total error count:");
X mvwaddstr(xf_win, 12, 10, "Last message: NONE");
X box(xf_win, VERT, HORZ);
X
X if (up)
X mvwattrstr(xf_win, 0, 17, A_BOLD, " Uploading ");
X else
X mvwattrstr(xf_win, 0, 16, A_BOLD, " Downloading ");
X
X mvwaddstr(xf_win, 14, 11, " Press <ESC> to abort ");
X wrefresh(xf_win);
X /* fix up the terminal mode */
X xmodem_mode(fd);
X
X if (up)
X ack_error = send_xmodem(xf_win, list, type);
X else
X ack_error = rcv_xmodem(xf_win, list, type);
X
X tty_noblock(0, FALSE);
X /* prompt for a key on errors */
X if (ack_error) {
X beep();
X clear_line(xf_win, 13, 9, TRUE);
X wattrstr(xf_win, A_BOLD, "Press any key to continue");
X wrefresh(xf_win);
X /* if inside a script */
X if (status->dup_fd != -1)
X wait_key(xf_win, 5);
X else
X wgetch(xf_win);
X }
X werase(xf_win);
X wrefresh(xf_win);
X delwin(xf_win);
X /* undo what xmodem_mode() did */
X line_set();
X return;
X}
END_OF_FILE
if test 1944 -ne `wc -c <'pcomm-2.0/x_win.c'`; then
echo shar: \"'pcomm-2.0/x_win.c'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/x_win.c'
fi
if test -f 'pcomm-2.0/xmodem.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'pcomm-2.0/xmodem.h'\"
else
echo shar: Extracting \"'pcomm-2.0/xmodem.h'\" \(562 characters\)
sed "s/^X//" >'pcomm-2.0/xmodem.h' <<'END_OF_FILE'
X/*
X * Definitions for the xmodem stuff.
X */
X
X#define MAX_ERRORS 10
X
X#define SOH 1
X#define STX 2
X#define EOT 4
X#define ACK 6
X#define NAK 21
X#define CAN 24
X#define CTRLZ 26
X
X#define NUM_INTERNAL 6
X#define XMODEM 1
X#define XMODEM_1k 2
X#define MODEM7 3
X#define YMODEM 4
X#define YMODEM_G 5
X#define XASCII 6
X#define EXT_1 7
X#define EXT_2 8
X#define EXT_3 9
X#define EXT_MANUAL 10
X
X#define ABORT (-1)
X#define ERROR (-2)
X#define CANCEL (-3)
X
X#define CHECKSUM 0
X#define CRC_CHECKSUM 1
X#define CRC 2
X#define NONE 3
X
X#define DOWN_LOAD 0
X#define UP_LOAD 1
END_OF_FILE
if test 562 -ne `wc -c <'pcomm-2.0/xmodem.h'`; then
echo shar: \"'pcomm-2.0/xmodem.h'\" unpacked with wrong size!
fi
# end of 'pcomm-2.0/xmodem.h'
fi
echo shar: End of archive 1 \(of 8\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 8 archives.
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
--
Frank Kaefer # fkk@stasys.sta.sub.org # Starnberg, Germany
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads