- /* Clear write mode */
- f->wbase = f->wpos = f->wstop = f->wend = 0;
-
- /* Put the file in read mode */
- if (!f->rpos) f->rpos = f->rend = f->buf;
-
- /* If unget buffer is already full, fail. */
- if (f->rpos <= f->buf - UNGET) {
- FUNLOCK(f);
- return EOF;
- }
-
- /* Put a byte back into the buffer */