Deleted Added
full compact
stdio.h (123257) stdio.h (127100)
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

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)stdio.h 8.5 (Berkeley) 4/29/95
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

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * @(#)stdio.h 8.5 (Berkeley) 4/29/95
37 * $FreeBSD: head/include/stdio.h 123257 2003-12-07 21:10:06Z marcel $
37 * $FreeBSD: head/include/stdio.h 127100 2004-03-17 01:43:08Z tjr $
38 */
39
40#ifndef _STDIO_H_
41#define _STDIO_H_
42
43#include <sys/cdefs.h>
44#include <sys/_null.h>
45#include <sys/_types.h>

--- 365 unchanged lines hidden (view full) ---

411 (*(p)->_p = (c), (int)*(p)->_p++))
412#endif
413
414#define __sfeof(p) (((p)->_flags & __SEOF) != 0)
415#define __sferror(p) (((p)->_flags & __SERR) != 0)
416#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF)))
417#define __sfileno(p) ((p)->_file)
418
38 */
39
40#ifndef _STDIO_H_
41#define _STDIO_H_
42
43#include <sys/cdefs.h>
44#include <sys/_null.h>
45#include <sys/_types.h>

--- 365 unchanged lines hidden (view full) ---

411 (*(p)->_p = (c), (int)*(p)->_p++))
412#endif
413
414#define __sfeof(p) (((p)->_flags & __SEOF) != 0)
415#define __sferror(p) (((p)->_flags & __SERR) != 0)
416#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF)))
417#define __sfileno(p) ((p)->_file)
418
419extern int __isthreaded;
420
421#define feof(p) (!__isthreaded ? __sfeof(p) : feof(p))
422#define ferror(p) (!__isthreaded ? __sferror(p) : ferror(p))
423#define clearerr(p) (!__isthreaded ? __sclearerr(p) : clearerr(p))
424
425#if __POSIX_VISIBLE
426#define fileno(p) (!__isthreaded ? __sfileno(p) : fileno(p))
427#endif
428
429#define getc(fp) (!__isthreaded ? __sgetc(fp) : getc(fp))
430#define putc(x, fp) (!__isthreaded ? __sputc(x, fp) : putc(x, fp))
431
432#define getchar() getc(stdin)
433#define putchar(x) putc(x, stdout)
434
419#if __BSD_VISIBLE
420/*
421 * See ISO/IEC 9945-1 ANSI/IEEE Std 1003.1 Second Edition 1996-07-12
422 * B.8.2.7 for the rationale behind the *_unlocked() macros.
423 */
424#define feof_unlocked(p) __sfeof(p)
425#define ferror_unlocked(p) __sferror(p)
426#define clearerr_unlocked(p) __sclearerr(p)

--- 12 unchanged lines hidden ---
435#if __BSD_VISIBLE
436/*
437 * See ISO/IEC 9945-1 ANSI/IEEE Std 1003.1 Second Edition 1996-07-12
438 * B.8.2.7 for the rationale behind the *_unlocked() macros.
439 */
440#define feof_unlocked(p) __sfeof(p)
441#define ferror_unlocked(p) __sferror(p)
442#define clearerr_unlocked(p) __sclearerr(p)

--- 12 unchanged lines hidden ---