home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
rtsi.com
/
2014.01.www.rtsi.com.tar
/
www.rtsi.com
/
OS9
/
OSK
/
TELECOM
/
tterm_src.lzh
/
io.c
< prev
next >
Wrap
Text File
|
1996-03-04
|
28KB
|
1,074 lines
/*********************************************************************
io.c
*********************************************************************/
#include "common.h"
#include "io.h"
void
(*T_PutC)(int),
(*TrOn)(void),(*TrOff)(void),
(*OldTrOn)(void),(*OldTrOff)(void),
RTS_TrOn(void),RTS_TrOff(void),
X_TrOn(void),X_TrOff(void),
TrDoNothing(void);
static int t_enable=0; /* set if RTS enabled */
static int readoff; /* turn off read when this many waiting */
static int readon; /* turn back on when less than this many */
extern u_char filterbyte;
/*********************************************************************
signal TRAP function
rewritten to handle keyboard (KBD_SIG) and sio (SER_SIG) signals
now uses _os_intercept() [JSC]
*********************************************************************/
void trap(signal)
int signal;
{
switch(signal)
{
case SER_SIG:
g_sigmodem++;
break;
case KBD_SIG:
g_sigkb++;
break;
/* case SIGQUIT: /* ^E (debugging only) */
cleanup();
exit (signal);
case RESETTIMED:
g_sigreset++;
break;
default: /* default is ignore */
break;
}
_os_rte();
}
/*********************************************************************
RELEASE the MODEM SIGNALs - this is necessary so a program invoked from
a child shell will be able to use the modem port.
*********************************************************************/
ReleaseModemSignal()
{
_os_ss_relea(mp);
}
/*********************************************************************
WAIT for a SERIAL event - returns remaining tick count
*********************************************************************/
WaitSerial(seconds)
int seconds; /* sleep this long (0 == forever) */
{
u_int snooze=g_tickrate * seconds;
signal_code wakeup;
g_sigmodem=0;
g_sigkb=0;
_os_sigmask(1); /* */
_os_ss_sendsig(mp,SER_SIG); /* set modem signal */
_os_ss_sendsig(0,KBD_SIG); /* set keyboard signal */
TSleep(snooze,sigl); /* sleep (also unmasks interupts) */
return snooze;
}
/*********************************************************************
return MODEM ready READY status
*********************************************************************/
ModemReady()
{
FlushSerial();
return (oncall > 0 ? oncall : 0);
}
/*********************************************************************
return TERMinal data READY - returns g_sigkb
*********************************************************************/
TermReady()
{
return g_sigkb;
}
/*********************************************************************
MODem SETUP - returns zero or error number on error
*********************************************************************/
int modsetup(mport)
char *mport;
{
u_int32 size;
#ifdef _MPF68K
u_int32 scf_size = sizeof(struct scf_opt);
#endif
#ifdef _MPF386
u_int32 scf_size = sizeof(struct scf_path_opts);
u_int32 lu_size = sizeof(struct scf_lu_opts);
#endif
/* allocate ring buffer for incoming serial data */
serialbuff=malloc(RINGBUFF);
if(serialbuff == 0)
return errno;
ResetInputBuffer();
oncall = 0;
/* open a path to the modem */
errno=_os_open(mport,FAM_READ | FAM_WRITE,&mp);
if(errno)
{
fprintf(stderr,"Unable to open %s\n",mport);
return errno;
}
readoff=RINGBUFF-2048;
readon=0;
/* set path options */
#ifdef _MPF68K
_os_gs_popt(mp,&scf_size,&oldmod); /* get the pd_ stuff */
newmod=oldmod; /* save it */
FixMPath(&newmod);
_os_ss_popt(mp,scf_size,&newmod);
cur_baud = oldmod.pd_bau;
#endif
#ifdef _MPF386
_os_gs_popt(mp,&scf_size,&oldmod); /* get the pd_ stuff */
newmod=oldmod; /* save it */
FixMPath(&newmod);
_os_ss_popt(mp,scf_size,&newmod);
_os_gs_luopt(mp,&lu_size,&oldvmod); /* get the v_ stuff */
newvmod=oldvmod;
FixMPath1(&newvmod); /* fix the v_ stuff */
_os_ss_luopt(mp,lu_siz,&newvmod); /* set the v_ stuff */
cur_baud = oldvmod.v_baud;
#endif
/* check for RTS handshake */
errno=_os_ss_enrts(mp);
if(errno)
return errno;
else
{
TrOn=RTS_TrOn;
TrOff=RTS_TrOff;
t_enable=1; /* modem enabled */
}
FlushSerial(); /* get any leftover junk */
ResetInputBuffer(); /* reset buffer */
oncall=0;
return 0;
}
/*********************************************************************
TERMinal SETUP
*********************************************************************/
termsetup()
{
#ifdef _MPF386
u_int32 scf_size = sizeof(struct scf_path_opts);
#else /* _OSK */
u_int32 scf_size = sizeof(struct scf_opt);
#endif
screenbuff=malloc(SBUFFSIZE);
if(screenbuff == 0)
return 1;
screenptr=screenbuff;
screenwait=0;
if(find_tcent() != 0) /* iniz termcap stuff */
return 1;
_os_gs_popt(0,&scf_size,&oldterm);
newterm=oldterm;
FixTPath(&newterm);
raw_io();
return 0;
}
/*********************************************************************
CLEAR the LINE of any junk
*********************************************************************/
ClearLine()
{
while(FlushSerial())
WaitSerial(1);
ResetInputBuffer();
oncall = 0;
}
/*********************************************************************
COOKed term IO - for getting filenames and such
*********************************************************************/
cook_io()
{
#ifdef _MPF68K
u_int32 scf_size = sizeof(struct scf_opt);
#endif
#ifdef _MPF386
u_int32 scf_size = sizeof(struct scf_path_opts);
#endif
sig_off();
_os_ss_popt(0,scf_size,&oldterm);
}
/*********************************************************************
RAW term IO - for as-is data to/from term
*********************************************************************/
raw_io()
{
#ifdef _MPF68K
u_int32 scf_size = sizeof(struct scf_opt);
#endif
#ifdef _MPF386
u_int32 scf_size = sizeof(struct scf_path_opts);
#endif
_os_ss_popt(0,scf_size, &newterm);
sig_on();
}
/*********************************************************************
CLEANUP after ourself and make sure file are closed, term is restored
etc.
*********************************************************************/
cleanup()
{
#ifdef _MPF68K
u_int32 scf_size=sizeof(struct scf_opt);
#endif
#ifdef _MPF386
u_int32 scf_size=sizeof(struct scf_path_opts);
u_int32 lu_size=sizeof(struct lu_path_opts);
#endif
sig_off();
t_puts(SE);
t_puts("\n");
close_file(); /* Close any capture buffer that is opened */
UnloadTransfer(); /* unlink from transfer program */
_os_ss_popt(mp,scf_size, &oldmod);
_os_ss_popt(0,scf_size, &oldterm);
#ifdef _MPF386
_os_ss_luopt(mp,lu_opt,&oldvmod);
#endif
ReleaseModemSignal();
_os_close(mp); /* don't forget this */
}
/*********************************************************************
FIND the TC ENTry - sets up all the termcap stuff
return 0 if everything ok else retune number of errors
*********************************************************************/
find_tcent()
{
extern char tmp[];
extern char *mport;
int rtnval,cntr;
char *p, *crtname;
if ((crtname = getenv("TERM")) == NULL)
{
t_puts("Environment variable TERM not defined!\n");
return 1;
}
if ((temp_buf = (char *) malloc(1024)) == NULL)
{
t_puts("Can't malloc room for termcap buffer!\n");
return 1;
}
if (tgetent(temp_buf, crtname) <= 0)
{
sprintf(tmp,"\nUNKNOWN Terminal Type %s!", crtname);
t_puts(tmp);
return 1;
}
if ((tcbuf=(char *) malloc(strlen(temp_buf))) == NULL)
{
t_puts("Can't malloc room for termcap info!\n");
return 1;
}
#define BUFFADDR &tcbuf
rtnval = 0;
/* clear the screen */
CL = tgetstr("cl",BUFFADDR); rtnval += check(p,"cl");
/* cursor motion */
CM = tgetstr("cm",BUFFADDR); rtnval += check(p,"cm");
/* start reverse video */
SO = tgetstr("so",BUFFADDR); rtnval += check(p,"so");
/* end reverse video */
SE = tgetstr("se",BUFFADDR); rtnval += check(p,"se");
/* get the function key defs [SC] */
cntr = 0;
p = tgetstr("k1",BUFFADDR); makehash(p,cntr++); rtnval += check(p,"k1");
p = tgetstr("k2",BUFFADDR); makehash(p,cntr++); rtnval += check(p,"k2");
p = tgetstr("k3",BUFFADDR); makehash(p,cntr++); rtnval += check(p,"k3");
p = tgetstr("k4",BUFFADDR); makehash(p,cntr++); rtnval += check(p,"k4");
p = tgetstr("k5",BUFFADDR); makehash(p,cntr++); rtnval += check(p,"k5");
p = tgetstr("k6",BUFFADDR); makehash(p,cntr++); rtnval += check(p,"k6");
p = tgetstr("k7",BUFFADDR); makehash(p,cntr++); rtnval += check(p,"k7");
p = tgetstr("k8",BUFFADDR); makehash(p,cntr++); rtnval += check(p,"k8");
p = tgetstr("k9",BUFFADDR); makehash(p,cntr++); rtnval += check(p,"k9");
p = tgetstr("k0",BUFFADDR); makehash(p,cntr++); rtnval += check(p,"k0");
p = tgetstr("F1",BUFFADDR); makehash(p,cntr++); rtnval += check(p,"F1");
p = tgetstr("F2",BUFFADDR); makehash(p,cntr++); rtnval += check(p,"F2");
/* get the arrow keys - these need to be hashed and preserved so we
can send he correct sequence to the host [SC] */
p = tgetstr("ku",BUFFADDR); makehash(p,cntr++); rtnval += check(p,"ku");
KU = UP_ARROW;
p = tgetstr("kd",BUFFADDR); makehash(p,cntr++); rtnval += check(p,"kd");
KD = DOWN_ARROW;
p = tgetstr("kl",BUFFADDR); makehash(p,cntr++); rtnval += check(p,"kl");
KL = LEFT_ARROW;
p = tgetstr("kr",BUFFADDR); makehash(p,cntr++); rtnval += check(p,"kr");
KR = RIGHT_ARROW;
/*
* Termcap needs PC, BC, and UP, for certain terminal
* types. ++SrT
*
* PC, BC, and UP are already defined in the OS9/6809 version of the
* termcap library, so not needed here [MDG].
*/
p = tgetstr("pc",BUFFADDR);
PC_ = p ? *p : 0;
BC = tgetstr("le",BUFFADDR);
UP = tgetstr("up",BUFFADDR);
AC = tgetstr("ac",BUFFADDR);
rtnval += check(BC, "le");
rtnval += check(UP, "up");
free(temp_buf);
if (AC)
linegfx(AC);
else
default_linegfx();
return rtnval;
}
/*********************************************************************
MAKE a termcap entry a HASHed entry in keycodes
*********************************************************************/
makehash(char *entry,int offset)
{
u_int32 kp = 0;
while(*entry)
{
kp <<= HASHIFT;
kp += *entry++;
}
keycodes[offset] = kp;
}
/*********************************************************************
get the LINE GraFiX characters
*********************************************************************/
linegfx(ac)
char *ac;
{
int flag;
flag = 0;
while(*ac)
{
switch(*ac)
{
case '1':
SetGlyph(*++ac,0);
break;
case ':':
flag+=SetGlyph(*++ac,1);
break;
case ';':
flag+=SetGlyph(*++ac,2);
break;
case '<':
flag+=SetGlyph(*++ac,3);
break;
case 'H':
flag+=SetGlyph(*++ac,4);
break;
case 'I':
flag+=SetGlyph(*++ac,5);
break;
case 'M':
flag+=SetGlyph(*++ac,6);
break;
default: break;
}
ac++;
}
if(flag < 6)
default_linegfx();
}
/*********************************************************************
SET a GLYPH value if necessary returns 1 if set 0 if not
*********************************************************************/
SetGlyph(value,offset)
unsigned char value;
int offset;
{
if(glyph[offset]) /* if already set */
return 0;
glyph[offset] = (value | 0x80);
return 1;
}
/*********************************************************************
set the DEFAULT LINE GraFiX characters
*********************************************************************/
default_linegfx()
{
glyph[0] = defglyph[0];
glyph[1] = defglyph[1];
glyph[2] = defglyph[2];
glyph[3] = defglyph[3];
glyph[4] = defglyph[4];
glyph[5] = defglyph[5];
glyph[6] = defglyph[6];
}
/*********************************************************************
Modem PUT String
*********************************************************************/
m_puts(s)
register char *s;
{
u_int32 size=strlen(s);
_os_write(mp,s,&size);
}
/*********************************************************************
Modem PUT Character
*********************************************************************/
m_putc(c)
int c;
{
u_int32 size=1;
u_char khar = c;
if(c > 256)
return 0;
_os_write(mp,&khar,&size);
}
/*********************************************************************
Modem GET a Character
*********************************************************************/
int m_getc()
{
FlushSerial();
if(oncall <= 0)
return 0;
if (serialread >= serialend) /* check for buffer wrap */
serialread = serialbuff;
oncall--;
return *serialread++;
}
/*********************************************************************
FLUSH the SERIAL input buffer
this routine will read the incoming stream until it's empty
**********************************************************************/
int FlushSerial()
{
u_int32 waiting;
u_int32 toread;
int tally = 0;
if(oncall < readon)
TurnModemOn();
while(_os_gs_ready(mp,&waiting) == 0) /* get number of waiting characters */
{
tally = 0; /* DON'T TAKE THIS OUT! */
if((serialput+waiting) > serialend) /* if read will overrun buffer */
{
toread=serialend-serialput; /* get maximum read */
if(_os_read(mp,serialput,&toread) != 0)
continue;
waiting -= toread;
serialput = serialbuff; /* wrap input pointer */
tally+=toread;
}
if(waiting > 0) /* if still characters to read */
{
if(_os_read(mp,serialput,&waiting) != 0)
continue;
serialput += waiting;
tally+=waiting;
}
oncall+=tally;
if(oncall >= readoff)
TurnModemOff();
}
return tally;
}
/*********************************************************************
TURN the MODEM OFF
*********************************************************************/
TurnModemOff()
{
if(t_enable) /* only bother if modem is currently enabled */
{
TrOff();
TrOn=TrOff=TrDoNothing; /* set both to do nothing */
readon=oncall-2048; /* flush down 2K */
if(readon < 1) /* better not happen! */
readon=1;
t_enable=0;
}
}
/*********************************************************************
TURN the MODEM ON
*********************************************************************/
TurnModemOn()
{
if(!t_enable) /* only if currently disabled */
{
TrOn=RTS_TrOn; /* restore flowcontrol */
TrOff=RTS_TrOff;
readon=0;
TrOn(); /* restore flow */
t_enable=1;
}
}
/*********************************************************************
RESET the INPUT BUFFER
*********************************************************************/
void ResetInputBuffer()
{
serialread=serialput=serialbuff;
serialend=serialbuff+RINGBUFF-2;
}
/*********************************************************************
TRanfer control DO NOTHING module - used at near buffer full
*********************************************************************/
void TrDoNothing() { }
/*********************************************************************
RTS TRanss OFF
*********************************************************************/
void RTS_TrOff()
{
_os_ss_dsrts(mp);
}
/*********************************************************************
RTS TRans ON
*********************************************************************/
void RTS_TrOn()
{
_os_ss_enrts(mp);
}
/*********************************************************************
Send a string to the terminal
*********************************************************************/
t_puts(s)
register char *s;
{
u_int32 size=strlen(s);
while(size--)
ToScreen(*s++);
}
/*********************************************************************
Terminal PRINT function - does not go to the capture file
*********************************************************************/
tprint(char *s)
{
u_int32 size = strlen(s);
_os_write(1,s,&size);
}
/*********************************************************************
write a character TO the SCREEN
*********************************************************************/
void ToScreen(int c)
{
u_int32 size;
if(c > 255)
return;
c &= filterbyte;
/* save character */
*screenptr++=c;
screenwait++;
if(capflg)
dskout(c);
if(oncall == 0 || c == LF || screenwait >= SBUFFSIZE)
{
TrOff();
size=screenwait;
_os_write(1,screenbuff,&size); /* */
if(capflg)
dskout(-1); /* flush buffer */
screenptr=screenbuff;
screenwait=0;
TrOn();
}
}
/**********************************************************************
read the INput KEY sequence
**********************************************************************/
int inkey()
{
u_int32 size=1;
static unsigned char ch;
unsigned int kp,keys=0;
g_sigkb=0;
if(ch==0)
_os_read(0,&ch,&size);
kp=ch;
if(kp>0x1F) /* if not control */
{
ch=0;
sig_on();
return kp; /* send it back as is */
}
keys<<=HASHIFT;
keys+=kp;
#if 0
if(keys == metachar) /* if 2-key sequence start */
{
size = 1;
_os_read(0,&ch,&size);
kp=ch;
keys<<=HASHIFT;
keys+=kp;
}
#endif
while(delay())
{
size = 1;
_os_read(0,&ch,&size);
kp=ch;
if(kp == 0x1B) /* if new sequence start */
{
sig_on();
return keys;
}
keys<<=HASHIFT;
keys+=kp;
}
ch=0;
sig_on();
return keys;
}
/**********************************************************************
Key Press DELAY necessary for slow terminals
returns 1 if data ready
cycles a maximum if 6 times before assuming no more data to read
**********************************************************************/
int delay()
{
register int cntr;
u_int32 count;
signal_code signal;
for(cntr=0;cntr<6;cntr++)
{
if(_os_gs_ready(0,&count) == 0)
return 1;
count = 2;
TSleep(count,signal);
}
return 0;
}
/*********************************************************************
EAT any stuff at the TERMINAL
*********************************************************************/
eatterminal()
{
u_int32 n;
char cleaner[32];
if(_os_gs_ready(0,&n) == 0)
_os_read(0,cleaner,&n);
}
/*********************************************************************
Terminal GET String
*********************************************************************/
t_gets(s,n)
char *s;
u_int32 n;
{
ReleaseModemSignal();
cook_io();
if(_os_readln(0,s,&n) == 0)
s[n-1] = '\0';
raw_io();
eatterminal();
}
/*********************************************************************
READ with a single character TIMED out
*********************************************************************/
ReadTimed(tmax)
int tmax;
{
FlushSerial();
if(serialread == serialput) /* if nothing in buffer */
{
if(WaitSerial(tmax) == 0) /* and nothing arrives */
return -1;
if(g_sigmodem == 0) /* or woke up for the wrong reason */
return -1;
}
return (m_getc());
}
/*
* interface to the CIS B protocol package for aborting a file transfer
* this routine will eat all terminal input except ESC a
*/
want_abort()
{
static int seen_esc = FALSE;
int c;
if (g_sigkb > 0)
if ((c = inkey()) == ESC)
seen_esc = TRUE;
else
if (seen_esc)
{
if ((c == 'A') || (c == 'a'))
{
seen_esc = FALSE;
return (TRUE);
}
if ((c == 'Q') || (c == 'q'))
{
cleanup();
exit (0);
}
}
return (FALSE);
}
/*
* Baud rate routines
*/
get_baud(code)
int code;
{
return (baud_table[code]);
}
/*********************************************************************
GET the BAUD string - return baud rate string or "???" if unknown
*********************************************************************/
char *GetBaud()
{
int i;
for (i = 0; i < BDTB_SIZ; ++i)
{
if (cur_baud == baud_codes[i])
return baud_string[i];
}
return "???";
}
show_at(x, y, fmt, arg1, arg2, arg3)
int x, y; /* x, y coord on screen */
char *fmt; /* a printf format string */
int arg1, arg2, arg3; /* args for format srting */
{
char buf[132];
t_puts(tgoto(CM, x, y));
sprintf(buf, fmt, arg1, arg2, arg3);
t_puts(buf);
}
show_at1(x, y, fmt)
int x, y; /* x, y coord on screen */
char *fmt; /* a printf format string */
/* int arg1, arg2, arg3; /* args for format srting */
{
char buf[132];
t_puts(tgoto(CM, x, y));
sprintf(buf, fmt);
t_puts(buf);
}
/*********************************************************************
SHOW a BOX -
Characters have been changed to glyphs in this function
Ed Gresick rewrote this and I rewrote his rewrite [JSC]
*********************************************************************/
show_box(x1, x2, y1, y2)
int x1, x2, y1, y2;
{
char buf1[80], buf2[80], buf3[80];
char *p;
int j;
for (p = buf2, j = 0; j < 80; ++j)
*p++ = ' '; /* middle rows */
for (p = buf1, j = 0; j < 80; ++j)
*p++ = glyph[6]; /* top row */
for (p = buf3, j = 0; j < 80; ++j)
*p++ = glyph[6]; /* bottom row */
buf1[0] = glyph[5]; /* upper left hand corner */
buf1[x2 - x1] = glyph[2]; /* upper right hand corner */
buf1[x2 - x1 + 1] = '\0';
buf2[0] = glyph[1]; /* edges */
buf2[x2 - x1] = glyph[1];
buf2[x2 - x1 + 1] = '\0';
buf3[0] = glyph[4]; /* lower left hand corner */
buf3[x2 - x1] = glyph[3];
buf3[x2 - x1 + 1] = '\0'; /* lower right hand corner */
t_puts(CL); /* start with clean screen */
/* t_puts(SO); /* turn on inverse video */
show_at1(x1, y1, buf1); /* top row of box */
for (j = y1 + 1; j < y2; ++j)
show_at1(x1, j, buf2); /* middle rows of box */
show_at1(x1, y2, buf3); /* bottom row of box */
}
/* New function by [EG] - I changed this to return a 0 if OK a 1 if
entry is missing this lets the program check for _all_ entries
before exiting [SC] */
static check(char *p, char *parm)
{
if (p == 0) {
t_puts("Termcap entry - '"); t_puts(parm);
t_puts("' missing!\n");
return 1;
}
return 0;
}
/*********************************************************************
EXTRACT teh ring buffer SIZE if passed as an option
*********************************************************************/
ExtractSize(s)
char *s;
{
return RINGBUFF; /* maybe someday */
}
/*********************************************************************
FIX the Modem PATH options so they work for us
*********************************************************************/
FixMPath(pd)
#ifdef _MPF386
struct scf_path_opts *pd;
#else
struct scf_opt *pd;
#endif
{
#ifdef _MPF386
pd->pd_eorch =
pd->pd_eofch =
pd->pd_tabch =
pd->pd_bellch =
pd->pd_bspch =
pd->pd_case =
pd->pd_backsp =
pd->pd_delete =
pd->pd_echo =
pd->pd_alf =
pd->pd_pause =
pd->pd_nulls =
pd->pd_page =
pd->pd_tabsiz =
pd->pd_insm = 0;
/* pd->v_xoff = 0; */
#endif
#ifdef _MPF68K
/* pd->pd_dtp; /* device type */
pd->pd_upc=0; /* case (0=both, 1=upper only) */
pd->pd_bso=0; /* backsp (0=bse, 1=bse,sp,bse) */
pd->pd_dlo=0; /* delete (0=bse over line, 1=crlf) */
pd->pd_eko=0; /* echo (0=no echo) */
pd->pd_alf=0; /* autolf (0=no auto lf) */
pd->pd_nul=0; /* end of line null count */
pd->pd_pau=0; /* pause (0=no end of page pause)
pd->pd_pag=0; /* lines per page */
pd->pd_bsp=0; /* backspace character */
pd->pd_del=0; /* delete line character */
pd->pd_eor=0; /* end of record char (read only) */
pd->pd_eof=0; /* end of file char */
pd->pd_rpr=0; /* reprint line char */
pd->pd_dup=0; /* dup last line char */
pd->pd_psc=0; /* pause char */
pd->pd_int=0; /* kbd intr char (ctl c) */
pd->pd_qut=0; /* kbd quit char (ctl q) */
pd->pd_bse=0; /* backspace echo character */
pd->pd_ovf=0; /* line overflow char (bell) */
pd->pd_par=0; /* parity code */
/* pd->pd_bau; /* acia baud rate (color computer) */
/* pd->pd_d2p; /* dev2 output name offset */
pd->pd_xon=0; /* x-on char */
pd->pd_xoff=0; /* x-off char */
pd->pd_Tab=0; /* Tab character (0=none) */
pd->pd_Tabs=0; /* Tab field size */
/* pd->pd_tbl; /* Device table addr (copy) */
/* pd->pd_Col; /* current column number */
/* pd->pd_err; /* most recent I/O error status */
/* pd->pd_scfres2[61]; /* reserved for SCF usage */
/* pd->pd_gfmucm[32]; /* reserved for GFM/UCM usage */
#endif
}
/*********************************************************************
special FIX Modem PATH for lu_opts under OS9/x86
*********************************************************************/
#ifdef _MPF386
static FixMPath1(p)
struct scf_lu_opts *p;
{
p->v_intr =
p->v_quit =
p->v_psch =
p->v_xon =
p->v_xoff = 0;
}
#endif
/*********************************************************************
FIX the Terminal PATH options
*********************************************************************/
FixTPath(pd)
#ifdef _MPF386
struct scf_path_opts *pd;
#else
struct scf_opt *pd;
#endif
{
#ifdef _MPF386
pd->pd_eorch =
pd->pd_eofch =
pd->pd_tabch =
pd->pd_bellch =
pd->pd_bspch =
pd->pd_case =
pd->pd_backsp =
pd->pd_delete =
pd->pd_echo =
pd->pd_alf =
pd->pd_pause =
pd->pd_nulls =
pd->pd_page =
pd->pd_tabsiz =
pd->pd_insm = 0;
/* pd->v_xoff = 0; */
#endif
#ifdef _MPF68K
/* pd->pd_dtp; /* device type */
pd->pd_upc=0; /* case (0=both, 1=upper only) */
pd->pd_bso=0; /* backsp (0=bse, 1=bse,sp,bse) */
pd->pd_dlo=0; /* delete (0=bse over line, 1=crlf) */
pd->pd_eko=0; /* echo (0=no echo) */
pd->pd_alf=0; /* autolf (0=no auto lf) */
pd->pd_nul=0; /* end of line null count */
pd->pd_pau=0; /* pause (0=no end of page pause)
pd->pd_pag=0; /* lines per page */
pd->pd_bsp=0; /* backspace character */
pd->pd_del=0; /* delete line character */
pd->pd_eor=0; /* end of record char (read only) */
pd->pd_eof=0; /* end of file char */
pd->pd_rpr=0; /* reprint line char */
pd->pd_dup=0; /* dup last line char */
pd->pd_psc=0; /* pause char */
pd->pd_int=0; /* kbd intr char (ctl C) */
#ifndef DEBUG
pd->pd_qut=0; /* kbd quit char (ctl E) */
#endif
pd->pd_bse=0; /* backspace echo character */
pd->pd_ovf=0; /* line overflow char (bell) */
pd->pd_par=0; /* parity code */
/* pd->pd_bau; /* acia baud rate (color computer) */
/* pd->pd_d2p; /* dev2 output name offset */
pd->pd_xon=0; /* x-on char */
pd->pd_xoff=0; /* x-off char */
pd->pd_Tab=0; /* Tab character (0=none) */
pd->pd_Tabs=0; /* Tab field size */
/* pd->pd_tbl; /* Device table addr (copy) */
/* pd->pd_Col; /* current column number */
/* pd->pd_err; /* most recent I/O error status */
/* pd->pd_scfres2[61]; /* reserved for SCF usage */
/* pd->pd_gfmucm[32]; /* reserved for GFM/UCM usage */
#endif
}
/*********************************************************************
special FIXPATH for lu_opts under OS9/x86
*********************************************************************/
#ifdef _MPF386
static fixpath1(p)
struct scf_lu_opts *p;
{
p->v_intr =
#ifndef DEBUG
p->v_quit =
#endif
p->v_psch =
p->v_xon =
p->v_xoff = 0;
}
#endif