rget.c (16586) | rget.c (72373) |
---|---|
1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Chris Torek. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 25 unchanged lines hidden (view full) --- 34 * SUCH DAMAGE. 35 */ 36 37#if defined(LIBC_SCCS) && !defined(lint) 38#if 0 39static char sccsid[] = "@(#)rget.c 8.1 (Berkeley) 6/4/93"; 40#endif 41static const char rcsid[] = | 1/*- 2 * Copyright (c) 1990, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Chris Torek. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 25 unchanged lines hidden (view full) --- 34 * SUCH DAMAGE. 35 */ 36 37#if defined(LIBC_SCCS) && !defined(lint) 38#if 0 39static char sccsid[] = "@(#)rget.c 8.1 (Berkeley) 6/4/93"; 40#endif 41static const char rcsid[] = |
42 "$Id"; | 42 "$FreeBSD: head/lib/libc/stdio/rget.c 72373 2001-02-11 22:06:43Z deischen $"; |
43#endif /* LIBC_SCCS and not lint */ 44 45#include <stdio.h> 46#include "local.h" 47 | 43#endif /* LIBC_SCCS and not lint */ 44 45#include <stdio.h> 46#include "local.h" 47 |
48int 49__srefill(FILE *); 50 | |
51/* 52 * Handle getc() when the buffer ran out: 53 * Refill, then return the first character 54 * in the newly-filled buffer. 55 */ | 48/* 49 * Handle getc() when the buffer ran out: 50 * Refill, then return the first character 51 * in the newly-filled buffer. 52 */ |
56int __srget(fp) 57 register FILE *fp; | 53int 54__srget(FILE *fp) |
58{ 59 if (__srefill(fp) == 0) { 60 fp->_r--; 61 return (*fp->_p++); 62 } 63 return (EOF); 64} | 55{ 56 if (__srefill(fp) == 0) { 57 fp->_r--; 58 return (*fp->_p++); 59 } 60 return (EOF); 61} |