Files
Digital-Research-Source-Code/CPM OPERATING SYSTEMS/CPM 68K/1.2 SOURCE/6/SGTTY.C
Sepp J Morris 31738079c4 Upload
Digital Research
2020-11-06 18:50:37 +01:00

49 lines
1.2 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*************************************************************************
*
* stty / gtty Functions
* -----------------------
* Copyright 1983 by Digital Reserach Inc. All rights reserved.
*
* "stty(fd,argp)" sets the bits for CON: file opened on 'fd'
* "gtty(fd,argp)" gets the bits for CON: file opened on 'fd'
*
* Where:
* fd = file descriptor returned by 'open'
* argp pts to struct 'sgttyb' (see "sgtty.h")
*
**************************************************************************/
#include "portab.h"
#include "osif.h"
#include "sgtty.h"
VOID stty(fd,argp) /* CLEAR FUNCTION ***********/
WORD fd; /* opened file descriptor */
struct sgttyb *argp; /* ptr to control info */
{
REG FD *fp; FD *_chkc();
if( (fp=_chkc(fd)) == NULLFD ||
(fp->flags & ISTTY) == 0 )
return -1;
blkmove(argp,&(fp->fcb),sizeof(*argp)); /* no checks: do whatever */
return 0;
}
VOID gtty(fd,argp) /* CLEAR FUNCTION ***********/
WORD fd; /* opened file descriptor */
struct sgttyb *argp; /* ptr to control info */
{
REG FD *fp; FD *_chkc();
if( (fp=_chkc(fd)) == NULLFD ||
(fp->flags & ISTTY) == 0 )
return -1;
blkmove(&(fp->fcb),argp,sizeof(*argp)); /* no checks: do whatever */
return 0;
}
turn 0;
}
turn 0;
}