|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T c
Length: 1685 (0x695) Types: TextFile Names: »checkio.c«
└─⟦87ddcff64⟧ Bits:30001253 CPHDIST85 Tape, 1985 Autumn Conference Copenhagen └─⟦this⟧ »cph85dist/stat/src/checkio.c«
/* LINTLIBRARY */ #include "unixstat.h" FUN(checkio,check input,5.0,1985) /* Copyright (c) 1982 Gary Perlman (see Copyright file) */ /* This file contains some basic io routines. isatty: true if the argument file descriptor is a tty checkstdin: prints prompt if input is from tty keyboard No longer in this file (moved out because they are seldom used)" checkargv: used by regress/corr & pair/biplot canwrite: used by dm confirm: used by io and dm */ #ifndef MSDOS /* isatty */ #include <sgtty.h> isatty (fd) { struct sgttyb ttybuf; return (gtty (fd, &ttybuf) == 0); } #else /* MSDOS version of isatty */ /* ISATTY is an approxiamation to the UNIX isatty function. ISATTY querries the operating system through a function call to 44hex to determine if file in question is directed toward console input or output. If yes, ISATTY returns a 1. Else, ISATTY returns a 0. Fred Horan @ cornell */ #include "dos.h" isatty(fd) int fd; /* file descriptor */ { union REGS iREG, oREG; struct SREGS exmem; iREG.x.ax = 0x4400; /* pass function 44hex in ah */ iREG.x.bx = fp; /* pass file handle in bx */ iREG.x.cx = iREG.x.dx = 0; /* zero out remaining registers */ segread(&exmem); /* assume large model... */ intdosx(&iREG, &oREG, &exmem); /* make the operating system call */ /* x81 = check for ISDEV and console input; x82 ISDEV, console output */ if ((oREG.x.dx & 0x81) == 0x81) return(1); return(0); } #endif checkstdin (program) char *program; { if (isatty (fileno (stdin))) { fprintf (stderr,"\007%s: Reading input from terminal:\n", program); return (1); } return (0); }