src/chardev.c
/************************************************************************/
/*                                                                      */
/*                         C H A R _ b i n                              */
/*                                                                      */
/*      Reads one character from the character file descriptor,         */
/*      and returns the value.  If no character is available,           */
/*      or an error happens, returns NIL and sets the errno FIXP        */
/*      cell to the Unix error number.                                  */
/*                                                                      */
/************************************************************************/
C H A R _ b i n

Reads one character from the character file descriptor,
and returns the value.  If no character is available,
or an error happens, returns NIL and sets the errno FIXP
cell to the Unix error number.
C H A R _ b i n Reads one character from the character file descriptor and returns the value . If no character is available or an error happens returns NIL and sets the errno FIXP cell to the Unix error number .
LispPTR CHAR_bin(int fd, LispPTR errn)
{
#ifndef DOS
  register int rval;
  unsigned char ch[4];
  Lisp_errno = (int *)(Addr68k_from_LADDR(errn));
  ERRSETJMP(NIL);
  fd = LispNumToCInt(fd);
  TIMEOUT(rval = read(fd, ch, 1));
  if (rval == 0) {
    *Lisp_errno = EWOULDBLOCK;
    return (NIL);
  }
  if (rval == -1) {
    *Lisp_errno = errno;
    return (NIL);
  }
  return (GetSmallp(ch[0]));
#endif 
}
LispPTR CHAR_bin ( int fd , LispPTR errn ) { #ifndef DOS register int rval ; unsigned char ch [ 4 ] ; Lisp_errno = ( int * ) ( Addr68k_from_LADDR ( errn ) ) ; ERRSETJMP ( NIL ) ; fd = LispNumToCInt ( fd ) ; TIMEOUT ( rval = read ( fd , ch , 1 ) ) ; if ( rval == 0 ) { * Lisp_errno = EWOULDBLOCK ; return ( NIL ) ; } if ( rval == -1 ) { * Lisp_errno = errno ; return ( NIL ) ; } return ( GetSmallp ( ch [ 0 ] ) ) ; #endif }
C H A R _ b i n
C H A R _ b i n
/* DOS */