1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* Prefer faster, non-thread-safe stdio functions if available.
5 Copyright (C) 2001-2004, 2009-2013 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* Written by Jim Meyering. */
23 # define UNLOCKED_IO_H 1
25 /* These are wrappers for functions/macros from the GNU C library, and
26 from other C libraries supporting POSIX's optional thread-safe functions.
28 The standard I/O functions are thread-safe. These *_unlocked ones are
29 more efficient but not thread-safe. That they're not thread-safe is
30 fine since all of the applications in this package are single threaded.
32 Also, some code that is shared with the GNU C library may invoke
33 the *_unlocked functions directly. On hosts that lack those
34 functions, invoke the non-thread-safe versions instead. */
38 # if HAVE_DECL_CLEARERR_UNLOCKED
40 # define clearerr(x) clearerr_unlocked (x)
42 # define clearerr_unlocked(x) clearerr (x)
45 # if HAVE_DECL_FEOF_UNLOCKED
47 # define feof(x) feof_unlocked (x)
49 # define feof_unlocked(x) feof (x)
52 # if HAVE_DECL_FERROR_UNLOCKED
54 # define ferror(x) ferror_unlocked (x)
56 # define ferror_unlocked(x) ferror (x)
59 # if HAVE_DECL_FFLUSH_UNLOCKED
61 # define fflush(x) fflush_unlocked (x)
63 # define fflush_unlocked(x) fflush (x)
66 # if HAVE_DECL_FGETS_UNLOCKED
68 # define fgets(x,y,z) fgets_unlocked (x,y,z)
70 # define fgets_unlocked(x,y,z) fgets (x,y,z)
73 # if HAVE_DECL_FPUTC_UNLOCKED
75 # define fputc(x,y) fputc_unlocked (x,y)
77 # define fputc_unlocked(x,y) fputc (x,y)
80 # if HAVE_DECL_FPUTS_UNLOCKED
82 # define fputs(x,y) fputs_unlocked (x,y)
84 # define fputs_unlocked(x,y) fputs (x,y)
87 # if HAVE_DECL_FREAD_UNLOCKED
89 # define fread(w,x,y,z) fread_unlocked (w,x,y,z)
91 # define fread_unlocked(w,x,y,z) fread (w,x,y,z)
94 # if HAVE_DECL_FWRITE_UNLOCKED
96 # define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z)
98 # define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z)
101 # if HAVE_DECL_GETC_UNLOCKED
103 # define getc(x) getc_unlocked (x)
105 # define getc_unlocked(x) getc (x)
108 # if HAVE_DECL_GETCHAR_UNLOCKED
110 # define getchar() getchar_unlocked ()
112 # define getchar_unlocked() getchar ()
115 # if HAVE_DECL_PUTC_UNLOCKED
117 # define putc(x,y) putc_unlocked (x,y)
119 # define putc_unlocked(x,y) putc (x,y)
122 # if HAVE_DECL_PUTCHAR_UNLOCKED
124 # define putchar(x) putchar_unlocked (x)
126 # define putchar_unlocked(x) putchar (x)
130 # define flockfile(x) ((void) 0)
133 # define ftrylockfile(x) 0
136 # define funlockfile(x) ((void) 0)
138 #endif /* UNLOCKED_IO_H */