Digital Research
This commit is contained in:
2020-11-06 18:50:37 +01:00
parent 621ed8ccaf
commit 31738079c4
8481 changed files with 1888323 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
/*************************************************************************
*
* i s a t t y F u n c t i o n
* -----------------------------
* Copyright 1982 by Digital Reserach Inc. All rights reserved.
*
* "isatty" returns TRUE iff the file on channel fd is a 'CON:'
* device.
* Calling sequence:
* ret = isatty(fd)
* Where:
* fd = file descriptor returned by 'open'
* ret = TRUE iff the file is a 'CON:'
*
**************************************************************************/
#include <portab.h>
#include <cpm.h>
BOOLEAN isatty(fd) /****************************/
WORD fd; /* file des returned by open*/
{ /****************************/
REG FD *fp; /* ptr to ccb */
FD *_chkc(); /* validates fd, cvt to fp */
if((fp=_chkc(fd)) == NULL) /* make sure its open MGL */
return(FALSE); /* isno TTY ifnot open */
return( (fp->flags & ISTTY) != 0 ); /* test this flag */
} /****************************/