146111Sbostic /*- 2*61180Sbostic * Copyright (c) 1990, 1993 3*61180Sbostic * The Regents of the University of California. All rights reserved. 446111Sbostic * 546111Sbostic * This code is derived from software contributed to Berkeley by 646111Sbostic * Chris Torek. 746111Sbostic * 846111Sbostic * %sccs.include.redist.c% 946111Sbostic */ 1046111Sbostic 1146111Sbostic #if defined(LIBC_SCCS) && !defined(lint) 12*61180Sbostic static char sccsid[] = "@(#)rget.c 8.1 (Berkeley) 06/04/93"; 1346111Sbostic #endif /* LIBC_SCCS and not lint */ 1446111Sbostic 1546111Sbostic #include <stdio.h> 1646111Sbostic 1746111Sbostic /* 1846111Sbostic * Handle getc() when the buffer ran out: 1946111Sbostic * Refill, then return the first character 2046111Sbostic * in the newly-filled buffer. 2146111Sbostic */ __srget(fp)2246111Sbostic__srget(fp) 2346111Sbostic register FILE *fp; 2446111Sbostic { 2546111Sbostic if (__srefill(fp) == 0) { 2646111Sbostic fp->_r--; 2746111Sbostic return (*fp->_p++); 2846111Sbostic } 2946111Sbostic return (EOF); 3046111Sbostic } 31