home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 387b.lha / dice_v2.02 / lib / stdio / finitdesc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-30  |  446 b   |  29 lines

  1.  
  2. /*
  3.  *  Initialize a zerod file pointer
  4.  *
  5.  *  if interactive set line buffering
  6.  *
  7.  *  (c)Copyright 1990, Matthew Dillon, All Rights Reserved
  8.  */
  9.  
  10. #include <stdio.h>
  11.  
  12. void
  13. _finitdesc(fi, fd, flags)
  14. FILE *fi;
  15. int fd;
  16. short flags;
  17. {
  18.     fi->sd_UC = -1;
  19.     fi->sd_Fd = fd;
  20.     fi->sd_Flags = flags | __SIF_OPEN;
  21.     fi->sd_BufSiz = BUFSIZ;
  22.     fi->sd_WLeft = -1;
  23.     fi->sd_RLeft = -1;
  24.  
  25.     if (isatty(fi->sd_Fd))
  26.     fi->sd_Flags |= __SIF_IOLBF;
  27. }
  28.  
  29.