[comp.sources.misc] v16i051: ECU async comm package rev 3.0, Part27/35

wht@n4hgf.uucp (Warren Tucker) (01/06/91)

Submitted-by: wht@n4hgf.uucp (Warren Tucker)
Posting-number: Volume 16, Issue 51
Archive-name: ecu3/part27

---- Cut Here and feed the following to sh ----
#!/bin/sh
# This is part 27 of ecu3
if touch 2>&1 | fgrep 'amc' > /dev/null
 then TOUCH=touch
 else TOUCH=true
fi
# ============= gendial/dceT1000.c ==============
if test ! -d 'gendial'; then
    echo 'x - creating directory gendial'
    mkdir 'gendial'
fi
echo 'x - extracting gendial/dceT1000.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'gendial/dceT1000.c' &&
X/* CHK=0xFF53 */
X#define WHT
X/*+-------------------------------------------------------------------------
X	dceTBPlus.c - DCE-specific portion of generic SCO UUCP dialer
X	Driver for Telebit Trailblazer Plus
X	wht@n4hgf.Mt-Park.GA.US
X--------------------------------------------------------------------------*/
X/*+:EDITS:*/
X/*:11-29-1990-18:31-r@n4hgf-revision/1st releasable */
X/*:07-20-1990-00:10-wht@n4hgf-creation */
X
X#include "dialer.h"
X
X/*
X * DCE_DTR_low_msec - milliseconds to hold DTR low to ensure DCE
X *                    sees the transition; this value may be changed
X *                    as necessary before each call to ltoggleDTR(),
X * but, generally, a constant value will do.
X */
Xlong DCE_DTR_low_msec = 500;
X
X/*
X * DCE_DTR_high_msec - milliseconds DTR must remain high before the
X *                     DCE may be expected to be ready to be commanded
X */
Xlong DCE_DTR_high_msec = 500;
X
X/*
X * DCE_write_pase_msec - milliseconds to pause between each character
X *                       sent to the DCE (zero if streaming I/O is
X *                       permitted); this value may be changed as
X * necessary before each call to lwrite(), but, generally, a constant
X * value will do.  Note that this value is used to feed a value to nap(),
X * which has a granularity of .010 seconds on UNIX/386, .020 on XENIX/286
X * and .050 seconds on XENIX/86.
X */
Xlong DCE_write_pace_msec = 0;
X
X/*
X * DCE_name     - short name for DCE
X * DCE_revision - revision number for this module
X */
Xchar *DCE_name = "Telebit T1000";
Xchar *DCE_revision = "1.00";
X
X/*
X * DCE_hangup_CBAUD - baud rate to use for hanging up DCE
X *                    and readying it for dial in access
X *                    (BXXX mask); use a value of zero if the speed
X *                    specified by the invoker is to be used.
X * This value is useful for DCEs such as the early Hayes 2400
X * which are so unfortunately compatible with their 1200 predecessor
X * that they refuse to answer at 2400 baud unless you last spoke to
X * them at that rate. For such bad boys, use B2400 below.
X */
Xint DCE_hangup_CBAUD = 0;
X/* int DCE_hangup_CBAUD = B2400; */
X
X/*
X * DCE_results - a table of DCE response strings and a token
X *               code for each; when you call lread() or lread_ignore(),
X *               if the read routine detects one of the strings,
X * the appropriate code is returned.  If no string matches, then
X * lread()/lread_ignore examines the DCE result string for a
X * numeric value; if one is found, the numeric value or'd with
X * 0x40000000 is returned (in this way, e.g., you can read "modem
X * S registers").  If nothing agrees with this search, lread()
X * will abort the program with RC|FAIL|RCE_TIMOUT, lread_ignore()
X * will return -1.  You may use any value between 0 and 0x3FFFFFFF.
X * This module is the only consumer  of the codes, although they
X * are decoded by gendial.c's _lread()
X */
X
X/* flag bits */
X#define rfConnect		0x00800000
X#define rfREL			0x00400000
X#define rfFAST			0x00200000
X#define rfMASK			0x0000FFFF	/* mask off rfBits */
X
X/* unique codes */
X#define rOk				0
X#define rNoCarrier		1
X#define rError			2
X#define rNoDialTone 	3
X#define rBusy			4
X#define rNoAnswer		5
X#define rRring			6
X#define rConnect300		(  300  | rfConnect)
X#define rConnect1200	( 1200  | rfConnect)
X#define rConnect2400	( 2400  | rfConnect)
X#define rConnect300R	(  300  | rfConnect | rfREL)
X#define rConnect1200R	( 1200  | rfConnect | rfREL)
X#define rConnect2400R	( 2400  | rfConnect | rfREL)
X#define rConnectFASTK	(19200  | rfConnect | rfFAST)	/* may be 9600 */
X#define rConnectFASTX	(19200  | rfConnect | rfFAST)
X#define rConnectFASTU	(19200  | rfConnect | rfFAST)
X#define rConnectFAST	(19200  | rfConnect | rfFAST)
X
XDCE_RESULT DCE_results[] =
X{
X	{ "OK",						rOk,			},
X	{ "NO CARRIER",				rNoCarrier,		},
X	{ "ERROR",					rError			},
X	{ "NO DIALTONE",			rNoDialTone,	},
X	{ "BUSY",					rBusy			},
X	{ "NO ANSWER",				rNoAnswer		},
X	{ "RRING",					rRring			},
X	{ "CONNECT 300/REL",		rConnect300R	},
X	{ "CONNECT 1200/REL",		rConnect1200R	},
X	{ "CONNECT 2400/REL",		rConnect2400R	},
X	{ "CONNECT 300",			rConnect300		},
X	{ "CONNECT 1200",			rConnect1200	},
X	{ "CONNECT 2400",			rConnect2400	},
X	{ "CONNECT FAST/KERM",		rConnectFASTK	},
X	{ "CONNECT FAST/XMDM",		rConnectFASTX	},
X	{ "CONNECT FAST/UUCP",		rConnectFASTU	},
X	{ "CONNECT FAST",			rConnectFAST	},
X	{ (char *)0,				-1				}		/* end table */
X};
X
X/*+-------------------------------------------------------------------------
X	DCE_baud_to_CBAUD(baud) - check for valid baud rates supported by DCE
X
X  DCE dependent function must validate baud rates supported by DCE
X  returns baud rate in struct termio c_cflag fashion
X  or terminates program with error
X--------------------------------------------------------------------------*/
Xint
XDCE_baud_to_CBAUD(baud)
Xunsigned int baud;
X{
X	switch(baud)
X	{
X		case 110:  return(B110);
X		case 300:  return(B300);
X		case 1200: return(B1200);
X		case 2400: return(B2400);
X		case 9600: return(B9600);
X
X#if defined(B19200)
X		case 19200: return(B19200);
X#else
X#ifdef EXTA
X		case 19200: return(EXTA);
X#endif
X#endif
X
X#if defined(B38400)
X		case 38400: return(B38400);
X#else
X#ifdef EXTB
X		case 38400: return(EXTB);
X#endif
X#endif
X
X	}
X	myexit(RC_FAIL | RCE_SPEED);
X}	/* end of DCE_baud_to_CBAUD */
X
X/*+-------------------------------------------------------------------------
X	sync_Telebit() - sync modem with our DTE speed
X--------------------------------------------------------------------------*/
Xvoid
Xsync_Telebit()
X{
Xregister int maxretry = 8;
Xregister int count;
Xunsigned char rdchar;
X
X	while(maxretry--)
X	{
X		lflush();
X		write(fddce,"a",1);
X		count = 5;
X		while(count)	/* wait 50-200 msec for character, depending on HZ */
X		{
X			if(rdchk(fddce))
X				break;
X			nap(50L);
X			count--;
X		}
X		if(count && (read(fddce,&rdchar,1) == 1) && (rdchar == 'a'))
X			return;
X	}
X
X	DEBUG(1,"Telebit SYNC FAILED\n",0);
X	myexit(RC_FAIL | RCE_TIMOUT);
X
X}	/* end of sync_Telebit */
X
X/*+-------------------------------------------------------------------------
X	init_TBPlus() - init TBPlus from scratch, assuming nothing
X
X	reset to factory defaults, then set
X    E0          no local echo in command mode
X    F1          no local echo in data transfer mode
X    M0          speaker off
X    Q4          generate reult codes, but not RING
X    V1          verbal result codes
X    X3          extended result codes
X    S0=1        answer on first ring
X    S2=1        escape to "unusual" value
X    S11=50      50 msec DTMF timing
X    S45=1       enable remote access
X    S48=1       all 8 bits are significant
X    S50=0       use automatic connect speed determination
X    S51=255     default to 9600 and typeahead
X    S52=2       go on hook when dtr drops and reset to NV-RAM
X    S53=1       DCD signal follows remote carrier, DSR on when modem ready
X    S54=3       pass BREAK signal to remote modem
X    S55=0       respond to command escape sequence
X    S58=2       DTE uses CTS/RTS flow control.
X    S64=1       ignore characters sent by DTE while answering
X    S66=0       don't lock interface speed, just go with the flow.
X    S68=255     DCE uses whatever flow control DTE uses
X    S92=1       PEP tones at the end of answer sequence
X    S95=0       no MNP
X    S110=255    use data compression when the remote modem requests it.
X    S111=255    accept any protocol
X--------------------------------------------------------------------------*/
Xvoid
Xinit_TBPlus()
X{
Xregister itmp;
Xint maxretry = 4;
Xchar *init0 = "AT&FE0F1M0Q4V1X3\r";
Xchar *init1 = "ATS0=1S2=1S11=50S45=1S48=1S50=0S51=255S52=2S53=1S54=3\r";
Xchar *init2 = "ATS55=0S58=2S64=1S66=0S68=255S92=1S95=0S110=255S111=255\r";
X
X	DEBUG(7,"INITIALIZING %s\n",dce_name);
X
X	ltoggleDTR(0L);
X
X	sync_Telebit();
X
X	/*
X	 * set to factory default (bless them for this command)
X	 * and a few initial beachhead values
X	 */
X	for(itmp = 0; itmp < maxretry; itmp++)
X	{
X		lwrite("AT&FE0F1M0Q4V1X3\r");
X		if(lread(2) == rOk)
X			break;
X	}
X	if(itmp == maxretry)
X	{
X		DEBUG(1,"INIT FAILED (init0)\n",0);
X		myexit(RC_FAIL | RCE_TIMOUT);
X	}
X
X	/*
X	 * send initialization string 1
X	 */
X	for(itmp = 0; itmp < maxretry; itmp++)
X	{
X		lwrite(init1);
X		if(lread(2) == rOk)
X			break;
X	}
X	if(itmp == maxretry)
X	{
X		DEBUG(1,"INIT FAILED (init1)\n",0);
X		myexit(RC_FAIL | RCE_TIMOUT);
X	}
X
X	/*
X	 * send initialization string 2
X	 */
X	for(itmp = 0; itmp < maxretry; itmp++)
X	{
X		lwrite(init2);
X		if(lread(2) == rOk)
X			break;
X	}
X	if(itmp == maxretry)
X	{
X		DEBUG(1,"INIT FAILED (init2)\n",0);
X		myexit(RC_FAIL | RCE_TIMOUT);
X	}
X
X}	/* end of init_TBPlus */
X
X/*+-------------------------------------------------------------------------
X	DCE_hangup() - issue hangup command to DCE
X
XThis function should do whatever is necessary to ensure
X1) any active connection is terminated
X2) the DCE is ready to receive an incoming call if DTR is asserted
X3) the DCE will not accept an incoming call if DTR is false
X
XThe function should return when done.
X
XAny necessary switch setting or other configuration necessary for this
Xfunction to succeed should be documented at the top of the module.
X--------------------------------------------------------------------------*/
Xvoid
XDCE_hangup()
X{
X	DEBUG(7,"RESETING %s\n",dce_name);
X	ltoggle_DTR(0L);
X	nap(100L);
X	init_TBPlus();
X
X}	/* end of DCE_hangup */
X
X/*+-------------------------------------------------------------------------
X	DCE_dial(telno) - dial a remote DCE
X
XThis function should connect to the remote DCE and use any success
Xindication to modify the tty baud rate if necessary before returning.
X
XUpon successful connection, return 0.
X
XUpon unsuccessful connection, return RC_FAIL or'd with an appropriate
XRCE_XXX value from dialer.h.
X
Xlwrite() is used to write to the DCE.
X
Xlread() and lread_ignore() are used to read from the DCE.  Read timeouts
Xfrom calling lread() will result automatically in the proper error
Xtermination of the program.  Read timeouts from calling lread_ignore()
Xreturn -1; you handle the execption here.
X
XAny necessary coding of phone numbers, switch settings or other
Xconfiguration necessary for this function to succeed should be
Xdocumented at the top of the module.
X
XTelebit Plus-specific comments:
X S0=0        dont allow connect while dialing
X S54=3       pass BREAK signal to remote modem
X S64=0       abort dialing if characters sent by DTE
X S66=1       lock the interface speed
X S110=0      disable data compression unless requested otherwise
X--------------------------------------------------------------------------*/
Xint
XDCE_dial(telno)
Xchar *telno;
X{
Xchar cmd[128];
Xchar phone[50];
Xint s50_set = 0;
Xint s111_set = 0;
Xint timeout;
Xint result;
Xint rrings = 0;
Xlong then;
Xlong now;
Xchar *cptr;
Xchar *dialout_default = "ATS0=0S7=40S54=3S64=0S66=1S110=0\r";
X#define MDVALID	 "0123456789CcEeFfKkMmNnPpRrSsUuWwXx*#,!/()-"
X
X/* preliminary setup */
X	translate("=,-,",telno);
X	if(strspn(telno,MDVALID) != strlen(telno))
X	{
X		DEBUG(1,"phone number has invalid characters\n",0);
X		return(RC_FAIL | RCE_PHNO);
X	}
X	if(decode_phone_number(telno,phone,sizeof(phone)))
X	{
X		DEBUG(1,"phone number too long\n",0);
X		return(RC_FAIL | RCE_PHNO);
X	}
X
X/* walk through dialer codes, doing custom setup */
X	strcpy(cmd,"AT");
X	cptr = cmd + strlen(cmd);
X	if(dialer_codes['C' - 'A'])
X	{
X		DEBUG(5,"COMPRESSION requested\n",0);
X		strcat(cmd,"S110=1");
X	}
X	if(dialer_codes['E' - 'A'])
X	{
X		DEBUG(5,"ECHO SUPPRESSION requested\n",0);
X		strcat(cmd,"S121=1");
X	}
X	if(dialer_codes['F' - 'A'])
X	{
X		DEBUG(5,"XON/XOFF FLOW CONTROL requested\n",0);
X		strcat(cmd,"S58=3");
X	}
X	if(dialer_codes['K' - 'A'])
X	{
X		DEBUG(5,"KERMIT requested\n",0);
X		strcat(cmd,"S111=10");
X		s111_set++;
X	}
X	if(dialer_codes['X' - 'A'])
X	{
X		DEBUG(5,"XMODEM requested\n",0);
X		strcat(cmd,"S111=20");
X		s111_set++;
X	}
X	if(dialer_codes['U' - 'A'])
X	{
X		DEBUG(5,"UUCP requested\n",0);
X		strcat(cmd,"S111=30");
X		s111_set++;
X	}
X	if(dialer_codes['M' - 'A'])
X	{
X		DEBUG(5,"MNP requested\n",0);
X		strcat(cmd,"S95=1");
X	}
X
X	if((dialer_codes['P' - 'A']) || s111_set || (hiCBAUD >= B9600))
X	{
X		if(hiCBAUD < B9600)
X		{
X			DEBUG(1,"baud rate not high enough for PEP\n",0);
X			return(RC_FAIL | RCE_SPEED);
X		}
X		if(dialer_codes['P' - 'A'])
X			DEBUG(5,"PEP requested\n",0);
X		else
X			DEBUG(5,"PEP inferred: speed >= 9600\n",0);
X
X		dialer_codes['P' - 'A'] = 1;
X		strcat(cmd,"S50=255");
X	}
X
X
X	DEBUG(6,"--> issuing default setup command\n",0);
X	sync_Telebit();
X	lwrite(dialout_default);
X	if(lread(2) != rOk)
X	{
X		DEBUG(1,"default dialout setup failed\n",0);
X		return(RC_FAIL | RCE_NULL);
X	}
X
X/* issue the custom setup command */
X	if(*cptr)
X	{
X		DEBUG(5,"--> issuing custom setup cmd\n",0);
X		strcat(cmd,"\r");
X		sync_Telebit();
X		lwrite(cmd);
X		if(lread(2) != rOk)
X		{
X			DEBUG(1,"custom modem setup failed\n",0);
X			return(RC_FAIL | RCE_NULL);
X		}
X	}
X
X/*
X * calculate a timeout for the connect
X * allow a minimum of 40 seconds, but if PEP, 90
X * also if long distance (North American calculation here)
X * make it 132 (S7 is calculated as timeout * .9)
X */
X	timeout = 40;
X	if((phone[0] == '1') && (phone[0] != '0'))
X		timeout = 132;
X	if((timeout < 90) && dialer_codes['P' - 'A'])
X		timeout = 90;
X	for(cptr = phone; cptr = strchr(cptr,','); cptr++)
X		timeout += 2;	/* add extra time for pause characters */
X	DEBUG(6,"timeout waiting for connect = %d seconds\n",timeout);
X
X/* indicate non-root should not see DTE->DCE traffic */
X	secure = 1;
X
X/*
X * build and issue the actual dialing command
X * if root, let him see number, otherwise just say "remote system"
X */
X	DEBUG(1,"--> dialing %s\n", (uid) ? "remote system" : telno);
X#ifdef WHT
X	if(!strncmp(*gargv,"ECU",3))
X		dialer_codes['S' - 'A'] = 1;
X#endif
X	sprintf(cmd,"ATM%dS7=%dDT%s\r",
X		((dialer_codes['S' - 'A']) && !(dialer_codes['N' - 'A'])) ? 1 : 0,
X		(timeout * 9) / 10,telno);
X
X	/* cmd string can only be 80 characters including "AT" */
X	if(strlen(cmd) > 80)
X	{
X		DEBUG(1,"phone number string too long\n",0);
X		cleanup(RC_FAIL | RCE_PHNO);
X	}
X
X	sync_Telebit();
X	lwrite(cmd);
X
X/* indicate non-root can see DTE->DCE traffic */
X	secure = 0;
X
X/* wait for connect */
XWAIT_FOR_CONNECT:
X	time(&then);
X	result = lread(timeout);
X	if(!(result & rfConnect))
X	{
X		switch(result & rfMASK)
X		{
X		case rNoCarrier:
X			return(RC_FAIL | ((rrings > 2) ? RCE_ANSWER : RCE_NOTONE));
X		case rNoDialTone:
X			return(RC_FAIL | RCE_NOTONE);
X		case rBusy:
X			return(RC_FAIL | RCE_BUSY);
X		case rNoAnswer:
X			return(RC_FAIL | RCE_ANSWER);
X		case rRring:
X			if(rrings++ > 7)
X				return(RC_FAIL | RCE_ANSWER);
X			time(&now);
X			if((timeout -= ((int)(then - now))) > 0)
X				goto WAIT_FOR_CONNECT;
X		case rError:
X		default:
X			return(RC_FAIL | RCE_NULL);
X		}
X	}
X
X	return(0);		/* succeeded */
X
X}	/* end of DCE_dial */
X
X/**********************************************************
X*  You probably do not need to modify the code below here *
X**********************************************************/
X
X/*+-------------------------------------------------------------------------
X	DCE_abort(sig) - dial attempt aborted
X
X sig =  0 if non-signal abort (read timeout, most likely)
X     != 0 if non-SIGALRM signal caught
X
X extern int dialing set  1 if dialing request was active,
X                    else 0 if hangup request was active
X
XThis is a chance for the DCE-specific code to do anything it
Xneeds to cl,ean up after a failure.  Note that if a dialing
Xcall fails, it is the responsibility of the higher-level
Xprogram calling the dialer to call it again with a hangup request, so
Xthis function is usually a no-op.
X--------------------------------------------------------------------------*/
Xvoid
XDCE_abort(sig)
Xint sig;
X{
X	DEBUG(10,"DCE_abort(%d);\n",sig);
X}	/* end of DCE_abort */
X
X/*+-------------------------------------------------------------------------
X	DCE_exit(exitcode) - "last chance for gas" in this incarnation
X
XThe independent portion of the dialer program calls this routine in
Xlieu of exit() in every case except one (see DCE_argv_hook() below).
XNormally, this function just passes it's argument to exit(), but
Xany necessary post-processing can be done.  The function must,
Xhowever, eventually call exit(exitcode);
X--------------------------------------------------------------------------*/
Xvoid
XDCE_exit(exitcode)
Xint exitcode;
X{
X	DEBUG(10,"DCE_exit(%d);\n",exitcode);
X	exit(exitcode);
X}	/* end of DCE_exit */
X
X/*+-------------------------------------------------------------------------
X	DCE_argv_hook(argc,argv,optind,unrecognized_switches)
X
XThis hook gives DCE-specific code a chance to look over the entire
Xcommand line, such as for -z Telebit processing.
X
Xargc andf argv are the same values passed to main(),
X
Xoptind is the value of optind at the end of normal getopt processing.
X
Xunrecognized_switches is the count of switches not handled by main().
XSpecifically, -h and -x are standard switches.
X
XNormally, this function should just return RC_FAIL|RCE_ARGS if there are
Xany unrecognized switches, otherwise zero.  If you keep your nose clean
Xthough, you can do anything you need to do here and exit the program.
X
XNote: only simple switches (with no argument) may be used with this
Xfacility if the functrion is to return,' since main()'s getopt() will
Xstop processing switches if it runs into an unrecognized switch with an
Xargument.
X
XIf the function returns a non-zero value, then the value will be passed
XDIRECTLY to exit() with no further ado.  Thus, a non-zero value must be
Xof the format expected by dialer program callers, with RC_FAIL set as a
Xminimum.
X--------------------------------------------------------------------------*/
Xint
XDCE_argv_hook(argc,argv,optind,unrecognized_switches)
Xint argc;
Xchar **argv;
Xint optind;
Xint unrecognized_switches;
X{
X	if(unrecognized_switches)
X		return(RC_FAIL | RCE_ARGS);
X	return(0);
X}	/* end of DCE_argv_hook */
X
X/* vi: set tabstop=4 shiftwidth=4: */
SHAR_EOF
$TOUCH -am 1226050290 'gendial/dceT1000.c' &&
chmod 0644 gendial/dceT1000.c ||
echo 'restore of gendial/dceT1000.c failed'
Wc_c="`wc -c < 'gendial/dceT1000.c'`"
test 17704 -eq "$Wc_c" ||
	echo 'gendial/dceT1000.c: original size 17704, current size' "$Wc_c"
# ============= gendial/dceMPAD.c ==============
echo 'x - extracting gendial/dceMPAD.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'gendial/dceMPAD.c' &&
X/* CHK=0xFF53 */
X#define WHT
X/*+-------------------------------------------------------------------------
X	dceMPAD.c - DCE-specific portion of generic SCO UUCP dialer
X	Driver for ATT Tridom MPAD VSAT modem emulation
X	wht@n4hgf.Mt-Park.GA.US
X--------------------------------------------------------------------------*/
X/*+:EDITS:*/
X/*:11-29-1990-18:31-r@n4hgf-revision/1st releasable */
X/*:11-29-1990-17:48-wht@n4hgf-creation */
X
X#include "dialer.h"
X
X/*
X * DCE_DTR_low_msec - milliseconds to hold DTR low to ensure DCE
X *                    sees the transition; this value may be changed
X *                    as necessary before each call to ltoggleDTR(),
X * but, generally, a constant value will do.
X */
Xlong DCE_DTR_low_msec = 50;
X
X/*
X * DCE_DTR_high_msec - milliseconds DTR must remain high before the
X *                     DCE may be expected to be ready to be commanded
X */
Xlong DCE_DTR_high_msec = 50;
X
X/*
X * DCE_write_pase_msec - milliseconds to pause between each character
X *                       sent to the DCE (zero if streaming I/O is
X *                       permitted); this value may be changed as
X * necessary before each call to lwrite(), but, generally, a constant
X * value will do.  Note that this value is used to feed a value to nap(),
X * which has a granularity of .010 seconds on UNIX/386, .020 on XENIX/286
X * and .050 seconds on XENIX/86.
X */
Xlong DCE_write_pace_msec = 0;
X
X/*
X * DCE_name     - short name for DCE
X * DCE_revision - revision number for this module
X */
Xchar *DCE_name = "ATT Tridom MPAD";
Xchar *DCE_revision = "x1.00";
X
X/*
X * DCE_hangup_CBAUD - baud rate to use for hanging up DCE
X *                    and readying it for dial in access
X *                    (BXXX mask); use a value of zero if the speed
X *                    specified by the invoker is to be used.
X * This value is useful for DCEs such as the early Hayes 2400
X * which are so unfortunately compatible with their 1200 predecessor
X * that they refuse to answer at 2400 baud unless you last spoke to
X * them at that rate. For such bad boys, use B2400 below.
X */
Xint DCE_hangup_CBAUD = 0;
X/* int DCE_hangup_CBAUD = B2400; */
X
X/*
X * DCE_results - a table of DCE response strings and a token
X *               code for each; when you call lread() or lread_ignore(),
X *               if the read routine detects one of the strings,
X * the appropriate code is returned.  If no string matches, then
X * lread()/lread_ignore examines the DCE result string for a
X * numeric value; if one is found, the numeric value or'd with
X * 0x40000000 is returned (in this way, e.g., you can read "modem
X * S registers").  If nothing agrees with this search, lread()
X * will abort the program with RC|FAIL|RCE_TIMOUT, lread_ignore()
X * will return -1.  You may use any value between 0 and 0x3FFFFFFF.
X * This module is the only consumer  of the codes, although they
X * are decoded by gendial.c's _lread()
X */
X
X/* flag bits */
X#define rfConnect		0x00800000
X#define rfMASK			0x0000FFFF	/* mask off rfBits */
X
X/* unique codes */
X#define rOk				0
X#define rNoCarrier		1
X#define rError			2
X#define rNoDialTone 	3
X#define rBusy			4
X#define rNoAnswer		5
X#define rRring			6
X#define rConnect300		(  300  | rfConnect)
X#define rConnect1200	( 1200  | rfConnect)
X#define rConnect2400	( 2400  | rfConnect)
X#define rConnect4800	( 4800  | rfConnect)
X#define rConnect9600	( 9600  | rfConnect)
X#define rConnect9600	( 9600  | rfConnect)
X#define rConnect19200	(19200  | rfConnect)
X#define rConnect38400	(38400  | rfConnect)
X
XDCE_RESULT DCE_results[] =
X{
X	{ "OK",					rOk,			},
X	{ "NO CARRIER",			rNoCarrier,		},
X	{ "ERROR",				rError			},
X	{ "BUSY",				rBusy			},
X	{ "NO ANSWER",			rNoAnswer		},
X    { "NO DIAL TONE",       rNoDialTone     },
X    { "KDIR SENDX ERROR",   rNoDialTone     },  /* MPAD software error */
X    { "KDIR UNRESPONSIVE",  rNoDialTone     },
X    { "KDIR BUSY",          rBusy           },
X    { "KDIR BAD REQUEST",   rError          },  /* number 0 or >11 length */
X    { "NO SUCH NUMBER",     rNoAnswer       },
X    { "KDIR LOGIC ERROR",   rNoDialTone     },  /* MPAD software error */
X    { "KDIR NOT AVAIL",     rNoDialTone     },
X    { "TP4 STATE ERROR",    rNoDialTone     },  /* rain fade */
X    { "TP4 GIVE UP",        rBusy           },  /* rain fade */
X    { "TP4 ERROR RESP",     rBusy           },  /* transient problem */
X    { "NET DEACT",          rNoDialTone     },  /* net op deactivated port */
X	{ "CONNECT 300",		rConnect300		},
X	{ "CONNECT 1200",		rConnect1200	},
X	{ "CONNECT 4800",		rConnect4800	},
X	{ "CONNECT 9600",		rConnect9600	},
X	{ "CONNECT 19200",		rConnect19200	},
X	{ "CONNECT 38400",		rConnect38400	},
X	{ (char *)0,			-1				}		/* end table */
X};
X
X/*+-------------------------------------------------------------------------
X	DCE_baud_to_CBAUD(baud) - check for valid baud rates supported by DCE
X
X  DCE dependent function must validate baud rates supported by DCE
X  returns baud rate in struct termio c_cflag fashion
X  or terminates program with error
X--------------------------------------------------------------------------*/
Xint
XDCE_baud_to_CBAUD(baud)
Xunsigned int baud;
X{
X	switch(baud)
X	{
X		case 110:  return(B110);
X		case 300:  return(B300);
X		case 1200: return(B1200);
X		case 2400: return(B2400);
X		case 9600: return(B9600);
X
X#if defined(B19200)
X		case 19200: return(B19200);
X#else
X#ifdef EXTA
X		case 19200: return(EXTA);
X#endif
X#endif
X
X#if defined(B38400)
X		case 38400: return(B38400);
X#else
X#ifdef EXTB
X		case 38400: return(EXTB);
X#endif
X#endif
X
X	}
X	myexit(RC_FAIL | RCE_SPEED);
X}	/* end of DCE_baud_to_CBAUD */
X
X/*+-------------------------------------------------------------------------
X	sync_MPAD() - sync modem with our DTE speed
X--------------------------------------------------------------------------*/
Xvoid
Xsync_MPAD()
X{
Xregister int maxretry = 8;
Xregister int count;
Xunsigned char rdchar;
X
X	while(maxretry--)
X	{
X		lflush();
X		write(fddce,"a",1);
X		count = 5;
X		while(count)	/* wait 50-200 msec for character, depending on HZ */
X		{
X			if(rdchk(fddce))
X				break;
X			nap(50L);
X			count--;
X		}
X		if(count && (read(fddce,&rdchar,1) == 1) && (rdchar == 'a'))
X			return;
X		write(fddce,"atq0v1e1\r",9);
X		nap(500L);
X	}
X
X	DEBUG(1,"MPAD SYNC FAILED\n",0);
X	myexit(RC_FAIL | RCE_TIMOUT);
X
X}	/* end of sync_MPAD */
X
X/*+-------------------------------------------------------------------------
X	init_MPAD() - init MPAD from scratch, assuming nothing
X--------------------------------------------------------------------------*/
Xvoid
Xinit_MPAD()
X{
Xregister itmp;
Xint maxretry = 4;
Xchar *init0 = "ATE0Q0V1X99S0=1S2=1\r";
X
X	DEBUG(7,"INITIALIZING %s\n",dce_name);
X	ltoggleDTR(0L);
X	sync_MPAD();
X
X	/*
X	 * set to factory default (bless them for this command)
X	 * and a few initial beachhead values
X	 */
X	for(itmp = 0; itmp < maxretry; itmp++)
X	{
X		lwrite("AT&FE0F1M0Q4V1X3\r");
X		if(lread(2) == rOk)
X			break;
X	}
X	if(itmp == maxretry)
X	{
X		DEBUG(1,"INIT FAILED (init0)\n",0);
X		myexit(RC_FAIL | RCE_TIMOUT);
X	}
X
X}	/* end of init_MPAD */
X
X/*+-------------------------------------------------------------------------
X	DCE_hangup() - issue hangup command to DCE
X
XThis function should do whatever is necessary to ensure
X1) any active connection is terminated
X2) the DCE is ready to receive an incoming call if DTR is asserted
X3) the DCE will not accept an incoming call if DTR is false
X
XThe function should return when done.
X
XAny necessary switch setting or other configuration necessary for this
Xfunction to succeed should be documented at the top of the module.
X--------------------------------------------------------------------------*/
Xvoid
XDCE_hangup()
X{
X	ltoggleDTR(0L);
X	init_MPAD();
X
X}	/* end of DCE_hangup */
X
X/*+-------------------------------------------------------------------------
X	DCE_dial(telno) - dial a remote DCE
X
XThis function should connect to the remote DCE and use any success
Xindication to modify the tty baud rate if necessary before returning.
X
XUpon successful connection, return 0.
X
XUpon unsuccessful connection, return RC_FAIL or'd with an appropriate
XRCE_XXX value from dialer.h.
X
Xlwrite() is used to write to the DCE.
X
Xlread() and lread_ignore() are used to read from the DCE.  Read timeouts
Xfrom calling lread() will result automatically in the proper error
Xtermination of the program.  Read timeouts from calling lread_ignore()
Xreturn -1; you handle the execption here.
X
XAny necessary coding of phone numbers, switch settings or other
Xconfiguration necessary for this function to succeed should be
Xdocumented at the top of the module.
X
XMPAD Plus-specific comments:
X Q0          do not be quiet
X E0          do not echo
X V1          verbal result codes
X S0=0        dont allow connect while dialing
X X99         full result codes
X--------------------------------------------------------------------------*/
Xint
XDCE_dial(telno)
Xchar *telno;
X{
Xchar cmd[128];
Xchar phone[50];
Xint s50_set = 0;
Xint s111_set = 0;
Xint timeout;
Xint result;
Xint rrings = 0;
Xlong then;
Xlong now;
Xchar *cptr;
Xchar *dialout_default = "ATQ0E0V1E0S0=0X99\r";
X#define MDVALID	 "0123456789NnSs()-"
X
X/* preliminary setup */
X	translate("=,-,",telno);
X	if(strspn(telno,MDVALID) != strlen(telno))
X	{
X		DEBUG(1,"phone number has invalid characters\n",0);
X		return(RC_FAIL | RCE_PHNO);
X	}
X	if(decode_phone_number(telno,phone,sizeof(phone)))
X	{
X		DEBUG(1,"phone number too long\n",0);
X		return(RC_FAIL | RCE_PHNO);
X	}
X
X/* walk through dialer codes, doing custom setup */
X	strcpy(cmd,"AT");
X	cptr = cmd + strlen(cmd);
X
X	DEBUG(6,"--> issuing default setup command\n",0);
X	sync_MPAD();
X	lwrite(dialout_default);
X	if(lread(2) != rOk)
X	{
X		DEBUG(1,"default dialout setup failed\n",0);
X		return(RC_FAIL | RCE_NULL);
X	}
X
X/* issue the custom setup command */
X	if(*cptr)
X	{
X		DEBUG(5,"--> issuing custom setup cmd\n",0);
X		strcat(cmd,"\r");
X		sync_MPAD();
X		lwrite(cmd);
X		if(lread(2) != rOk)
X		{
X			DEBUG(1,"custom modem setup failed\n",0);
X			return(RC_FAIL | RCE_NULL);
X		}
X	}
X
X/*
X * calculate a timeout for the connect
X */
X	timeout = 20;
X	DEBUG(6,"timeout waiting for connect = %d seconds\n",timeout);
X
X/* indicate non-root should not see DTE->DCE traffic */
X	secure = 1;
X
X/*
X * build and issue the actual dialing command
X * if root, let him see number, otherwise just say "remote system"
X */
X	DEBUG(1,"--> dialing %s\n", (uid) ? "remote system" : telno);
X	sprintf(cmd,"ATS7=%dDT%s\r",(timeout * 9) / 10,telno);
X
X	/* cmd string can only be 40 characters including "AT" */
X	if(strlen(cmd) > 40)
X	{
X		DEBUG(1,"phone number string too long\n",0);
X		cleanup(RC_FAIL | RCE_PHNO);
X	}
X
X	sync_MPAD();
X	lwrite(cmd);
X
X/* indicate non-root can see DTE->DCE traffic */
X	secure = 0;
X
X/* wait for connect */
XWAIT_FOR_CONNECT:
X	time(&then);
X	result = lread(timeout);
X	if(!(result & rfConnect))
X	{
X		switch(result & rfMASK)
X		{
X		case rNoCarrier:
X			return(RC_FAIL | ((rrings > 2) ? RCE_ANSWER : RCE_NOTONE));
X		case rNoDialTone:
X			return(RC_FAIL | RCE_NOTONE);
X		case rBusy:
X			return(RC_FAIL | RCE_BUSY);
X		case rNoAnswer:
X			return(RC_FAIL | RCE_ANSWER);
X		case rRring:
X			if(rrings++ > 7)
X				return(RC_FAIL | RCE_ANSWER);
X			time(&now);
X			if((timeout -= ((int)(then - now))) > 0)
X				goto WAIT_FOR_CONNECT;
X		case rError:
X		default:
X			return(RC_FAIL | RCE_NULL);
X		}
X	}
X
X	return(0);		/* succeeded */
X
X}	/* end of DCE_dial */
X
X/**********************************************************
X*  You probably do not need to modify the code below here *
X**********************************************************/
X
X/*+-------------------------------------------------------------------------
X	DCE_abort(sig) - dial attempt aborted
X
X sig =  0 if non-signal abort (read timeout, most likely)
X     != 0 if non-SIGALRM signal caught
X
X extern int dialing set  1 if dialing request was active,
X                    else 0 if hangup request was active
X
XThis is a chance for the DCE-specific code to do anything it
Xneeds to cl,ean up after a failure.  Note that if a dialing
Xcall fails, it is the responsibility of the higher-level
Xprogram calling the dialer to call it again with a hangup request, so
Xthis function is usually a no-op.
X--------------------------------------------------------------------------*/
Xvoid
XDCE_abort(sig)
Xint sig;
X{
X	DEBUG(10,"DCE_abort(%d);\n",sig);
X}	/* end of DCE_abort */
X
X/*+-------------------------------------------------------------------------
X	DCE_exit(exitcode) - "last chance for gas" in this incarnation
X
XThe independent portion of the dialer program calls this routine in
Xlieu of exit() in every case except one (see DCE_argv_hook() below).
XNormally, this function just passes it's argument to exit(), but
Xany necessary post-processing can be done.  The function must,
Xhowever, eventually call exit(exitcode);
X--------------------------------------------------------------------------*/
Xvoid
XDCE_exit(exitcode)
Xint exitcode;
X{
X	DEBUG(10,"DCE_exit(%d);\n",exitcode);
X	exit(exitcode);
X}	/* end of DCE_exit */
X
X/*+-------------------------------------------------------------------------
X	DCE_argv_hook(argc,argv,optind,unrecognized_switches)
X
XThis hook gives DCE-specific code a chance to look over the entire
Xcommand line, such as for -z processing.
X
Xargc andf argv are the same values passed to main(),
X
Xoptind is the value of optind at the end of normal getopt processing.
X
Xunrecognized_switches is the count of switches not handled by main().
XSpecifically, -h and -x are standard switches.
X
XNormally, this function should just return RC_FAIL|RCE_ARGS if there are
Xany unrecognized switches, otherwise zero.  If you keep your nose clean
Xthough, you can do anything you need to do here and exit the program.
X
XNote: only simple switches (with no argument) may be used with this
Xfacility if the functrion is to return,' since main()'s getopt() will
Xstop processing switches if it runs into an unrecognized switch with an
Xargument.
X
XIf the function returns a non-zero value, then the value will be passed
XDIRECTLY to exit() with no further ado.  Thus, a non-zero value must be
Xof the format expected by dialer program callers, with RC_FAIL set as a
Xminimum.
X--------------------------------------------------------------------------*/
Xint
XDCE_argv_hook(argc,argv,optind,unrecognized_switches)
Xint argc;
Xchar **argv;
Xint optind;
Xint unrecognized_switches;
X{
X	if(unrecognized_switches)
X		return(RC_FAIL | RCE_ARGS);
X	return(0);
X}	/* end of DCE_argv_hook */
X
X/* vi: set tabstop=4 shiftwidth=4: */
SHAR_EOF
$TOUCH -am 1226050090 'gendial/dceMPAD.c' &&
chmod 0644 gendial/dceMPAD.c ||
echo 'restore of gendial/dceMPAD.c failed'
Wc_c="`wc -c < 'gendial/dceMPAD.c'`"
test 14315 -eq "$Wc_c" ||
	echo 'gendial/dceMPAD.c: original size 14315, current size' "$Wc_c"
# ============= xsel386/fixttiocom.c ==============
if test ! -d 'xsel386'; then
    echo 'x - creating directory xsel386'
    mkdir 'xsel386'
fi
echo 'x - extracting xsel386/fixttiocom.c (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'xsel386/fixttiocom.c' &&
X/*+-------------------------------------------------------------------------
X	fixttiocom.c - change ttiocom to Ttiocom calls in /usr/sys/sys/libsys.a
XThis program patched my Xenix 386 2.3.1 system library (a copy of which
Xhad been named libfix.a, fixed, verified, then moved to libsys.a)
X--------------------------------------------------------------------------*/
X/*+:EDITS:*/
X/*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
X
X#include <stdio.h>
X#include <sys/types.h>
X#include <fcntl.h>
X
Xchar *lib = "libfix.a";
X
X/* file positions where names needed changing */
X#define PLACE1 0xdcaL
X#define PLACE2 0x1b1cbL
X#define PLACE3 0x1c41bL
X
X/*+-------------------------------------------------------------------------
X	main(argc,argv,envp)
X--------------------------------------------------------------------------*/
Xmain(argc,argv,envp)
Xint argc;
Xchar **argv;
Xchar **envp;
X{
Xint fd = open(lib,O_RDWR,0);
Xunsigned char ch1,ch2,ch3;
Xlong lseek();
X
X	if(fd < 0)
X	{
X		perror(lib);
X		exit(9);
X	}
X
X	if(lseek(fd,PLACE1,0) != PLACE1)
X	{
X		perror("seek1");
X		exit(1);
X	}
X	if(read(fd,&ch1,1) != 1)
X	{
X		perror("read1");
X		exit(1);
X	}
X	printf("char 1 = %02x\n",ch1);
X
X	if(lseek(fd,PLACE2,0) != PLACE2)
X	{
X		perror("seek2");
X		exit(2);
X	}
X	if(read(fd,&ch2,2) != 2)
X	{
X		perror("read2");
X		exit(2);
X	}
X	printf("char 2 = %02x\n",ch2);
X
X
X	if(lseek(fd,PLACE3,0) != PLACE3)
X	{
X		perror("seek3");
X		exit(3);
X	}
X	if(read(fd,&ch3,1) != 1)
X	{
X		perror("read3");
X		exit(3);
X	}
X	printf("char 3 = %02x\n",ch3);
X
X	if((ch1 != 't') || (ch2 != 't') || (ch3 != 't'))
X		exit(8);
X	if(lseek(fd,PLACE1,0) != PLACE1)
X	{
X		perror("seek1");
X		exit(1);
X	}
X	write(fd,"T",1);
X	if(lseek(fd,PLACE2,0) != PLACE2)
X	{
X		perror("seek1");
X		exit(1);
X	}
X	write(fd,"T",1);
X	if(lseek(fd,PLACE3,0) != PLACE3)
X	{
X		perror("seek1");
X		exit(1);
X	}
X	write(fd,"T",1);
X	printf("done\n");
X	close(fd);
X
X	exit(0);
X}	/* end of main */
X
X/* vi: set tabstop=4 shiftwidth=4: */
X/* end of fixttiocom.c */
SHAR_EOF
$TOUCH -am 0814204290 'xsel386/fixttiocom.c' &&
chmod 0644 xsel386/fixttiocom.c ||
echo 'restore of xsel386/fixttiocom.c failed'
Wc_c="`wc -c < 'xsel386/fixttiocom.c'`"
test 1949 -eq "$Wc_c" ||
	echo 'xsel386/fixttiocom.c: original size 1949, current size' "$Wc_c"
# ============= xsel386/select-update ==============
echo 'x - extracting xsel386/select-update (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'xsel386/select-update' &&
XSubject: Re: Select(S) in Xenix 386 2.3.2
XNewsgroups: comp.unix.xenix
XKeywords: select, serial, pipes
XReferences: <117@accsys.acc.uu.no> <172@prmmbx.UUCP>
X
XIn article <172@prmmbx.UUCP>, csch@netcs.UUCP (Clemens Schrimpe) writes:
X> ivar@acc.uu.no (Ivar Hosteng) writes:
X> <> I have experienced some problems using the select call in Xenix 386 V2.3.2.
X> <> It does not seems to detect when a pipe gets ready to been read from.
X> This is, because there is no provision to select on pipes!
X> Why? The stuff is almost totally ported 1:1 from the Berkeley code and
X> in BSD pipes should consist of AF_UNIX sockets, on which you can naturally
X> select.
X> I was very angry, when I found this out after hours of digging with adb in
X> the kernel. But I also tried the same on a SUN under SunOS 4.0 and it doesn't
X> work either ... seems to be a common illness ???
X> (I wonder, because the code for that is very simple ... ??? ...)
X> 
X> <> I also 
X> <> have trouble using select on a serial port.  When I do that the input
X> <> turns into garbage.  This does not occur when I use select on the
X> <> multiscreen ttys (tty01-tty12).
X> Hehe - we had just the same!
X> Here is the solution (thanks to my colleague Stefan Koehler, who took one
X> look at my screen, into which I had starred for hours, to find it ...)
X> 
X> Select is implemented by an undocumented ioctl
X> 	(0xFFFF == IOC_SELECT -> [sys/slect.h])
X> which is handled by ttiocom() for all devices using the standard
X> SYS-V linediscipline!
X> 
X> The ioctl-routine for the serial devices [sioioctl()] just calls 
X> ttiocom() [after some undefinable VPIX stuff ???] and
X> if it returns NON-ZERO it calls sioparam(), which adjusts certain
X> parameters and garbles the output!
X> OK so far. Now: The Bug lies in the ttiocom-code within the check
X> for IOC_SELECT. After detecting the IOC_SELECT, the ttiocom calls
X> the select-code and returns NOTHING, which means that if EAX is
X> non-zero (randomly) sioparam() is called and garbles the output.
X> 
X> The Fix: (quick and dirty)
X> Write a routine called "ttiocom", which might look like this:
X> 
X> ttiocom(ttyp, com, arg, flag)
X> struct tty *ttyp;
X> int com, arg, flag;	/* there should be better types for this :-) */
X> {
X> 	if (com == IOC_SELECT)
X> 	{
X> 		ttselect(ttyp, flag);
X> 		return(0);	/*** THIS IS IMPORTANT ***/
X> 	}
X> 	return(Ttiocom(ttyp, com ,arg, flag));
X> }
X> 
X> Compile something like this, then use whatever you have (GNU-Emacs is
X> great in patching strings in binaries) to patch /usr/sys/sys/libsys.a
X> to change the original ttiocom into Ttiocom !
X> Link in your code and -by some magic reason- experience a full blown
X> select on your System V / Xenix machine!!!
X> 
X> Have fun playing around with it -
X> 
X> 	Clemens Schrimpe, netCS Informationstechnik GmbH Berlin
X> --
X> UUCP:		csch@netcs		BITNET:	csch@db0tui6.BITNET
X> ARPA/NSF:	csch@garp.mit.edu	PSI: PSI%45300033047::CSCH
X> PHONE:		+49-30-24 42 37		FAX: +49-30-24 38 00
X> BTX:		0303325016-0003		TELEX: 186672 net d
X
X
SHAR_EOF
$TOUCH -am 0626113689 'xsel386/select-update' &&
chmod 0644 xsel386/select-update ||
echo 'restore of xsel386/select-update failed'
Wc_c="`wc -c < 'xsel386/select-update'`"
test 2981 -eq "$Wc_c" ||
	echo 'xsel386/select-update: original size 2981, current size' "$Wc_c"
# ============= xsel386/select.asm ==============
echo 'x - extracting xsel386/select.asm (Text)'
sed 's/^X//' << 'SHAR_EOF' > 'xsel386/select.asm' &&
X;  CHK=0x1E37
X;+----------------------------------------------------------
X; select(S)
X;
X;#include <stdio.h>
X;#include <sys/select.h>
X;#include <fcntl.h>
X;
X;main(argc,argv,envp)
X;int argc;
X;char **argv;
X;char **envp;
X;{
X;struct timeval t;
X;int readfds;
X;int fd = open("/dev/null",O_RDONLY,0);
X;
X;	readfds = 1<<fd | 1<<0;
X;
X;	t.tv_sec = 5;
X;	t.tv_usec = 0;
X;
X;	printf("%d\n",select(32,&readfds,0,0,&t));
X;	printf("%08x\n",readfds);
X;	exit(0);
X;}	/* end of main */
X;
X;-----------------------------------------------------------
X
X	title	select
X
X	.386
X
XSYSNUM	equ 	2428h
X
Xextrn	_errno:dword
X
Xpublic  _select
X
X_TEXT	segment  dword use32 public 'CODE'
X	assume   cs: _TEXT
X_select	proc near
X	mov	eax, SYSNUM		; Get system call number.
X
X	;
X	; I don't even pretend to understand masm syntax.  I tried
X	; the following line (and variations) without any success.
X	;
X
X;	call    far 7:0			; Switch to kernel and call SYSNUM.
X
X	;
X	; Don't laugh, it works.
X	;
X
X	db 9ah
X	dw 0,0
X	dw 7
X
X	jb	short _cerror		; below == error.
X
X;	xor	eax, eax		; zero return value (no error).
X	ret				; done.
X
X_cerror:
X	mov	_errno, eax		; Save error code in _errno.
X	mov	eax, -1			; Return -1 (as error).
X	ret				; done.
X
X_select	endp
X
X_TEXT	ends
X
X	end
X; vi: set tabstop=8 :
SHAR_EOF
$TOUCH -am 0507233990 'xsel386/select.asm' &&
chmod 0644 xsel386/select.asm ||
echo 'restore of xsel386/select.asm failed'
Wc_c="`wc -c < 'xsel386/select.asm'`"
test 1237 -eq "$Wc_c" ||
	echo 'xsel386/select.asm: original size 1237, current size' "$Wc_c"
true || echo 'restore of xsel386/select.txt failed'
echo End of part 27, continue with part 28
exit 0
--------------------------------------------------------------------
Warren Tucker, TuckerWare emory!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US
Hacker Extraordinaire  d' async PADs,  pods,  proteins and protocols

exit 0 # Just in case...
-- 
Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
Sterling Software, IMD           UUCP:     uunet!sparky!kent
Phone:    (402) 291-8300         FAX:      (402) 291-4362
Please send comp.sources.misc-related mail to kent@uunet.uu.net.