home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / C / SMALL_C / UNGETC.C < prev    next >
Text File  |  1987-10-04  |  384b  |  14 lines

  1. #define NOCCARGC  /* no argument count passing */
  2. #include stdio.h
  3. extern Unextc[];
  4. /*
  5. ** Put c back into file fd.
  6. ** Entry:  c = character to put back
  7. **        fd = file descriptor
  8. ** Returns c if successful, else EOF.
  9. */
  10. ungetc(c, fd) int c, fd; {
  11.   if(!Umode(fd) || Unextc[fd]!=EOF || c==EOF) return (EOF);
  12.   return (Unextc[fd] = c);
  13.   }
  14.