]> git.cworth.org Git - tar/blob - gnu/unlocked-io.h
upstream: Fix extraction of device nodes.
[tar] / gnu / unlocked-io.h
1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* Prefer faster, non-thread-safe stdio functions if available.
4
5    Copyright (C) 2001-2004, 2009-2010 Free Software Foundation, Inc.
6
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.
11
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.
16
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/>.  */
19
20 /* Written by Jim Meyering.  */
21
22 #ifndef UNLOCKED_IO_H
23 # define UNLOCKED_IO_H 1
24
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.
27
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.
31
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.  */
35
36 # include <stdio.h>
37
38 # if HAVE_DECL_CLEARERR_UNLOCKED
39 #  undef clearerr
40 #  define clearerr(x) clearerr_unlocked (x)
41 # else
42 #  define clearerr_unlocked(x) clearerr (x)
43 # endif
44
45 # if HAVE_DECL_FEOF_UNLOCKED
46 #  undef feof
47 #  define feof(x) feof_unlocked (x)
48 # else
49 #  define feof_unlocked(x) feof (x)
50 # endif
51
52 # if HAVE_DECL_FERROR_UNLOCKED
53 #  undef ferror
54 #  define ferror(x) ferror_unlocked (x)
55 # else
56 #  define ferror_unlocked(x) ferror (x)
57 # endif
58
59 # if HAVE_DECL_FFLUSH_UNLOCKED
60 #  undef fflush
61 #  define fflush(x) fflush_unlocked (x)
62 # else
63 #  define fflush_unlocked(x) fflush (x)
64 # endif
65
66 # if HAVE_DECL_FGETS_UNLOCKED
67 #  undef fgets
68 #  define fgets(x,y,z) fgets_unlocked (x,y,z)
69 # else
70 #  define fgets_unlocked(x,y,z) fgets (x,y,z)
71 # endif
72
73 # if HAVE_DECL_FPUTC_UNLOCKED
74 #  undef fputc
75 #  define fputc(x,y) fputc_unlocked (x,y)
76 # else
77 #  define fputc_unlocked(x,y) fputc (x,y)
78 # endif
79
80 # if HAVE_DECL_FPUTS_UNLOCKED
81 #  undef fputs
82 #  define fputs(x,y) fputs_unlocked (x,y)
83 # else
84 #  define fputs_unlocked(x,y) fputs (x,y)
85 # endif
86
87 # if HAVE_DECL_FREAD_UNLOCKED
88 #  undef fread
89 #  define fread(w,x,y,z) fread_unlocked (w,x,y,z)
90 # else
91 #  define fread_unlocked(w,x,y,z) fread (w,x,y,z)
92 # endif
93
94 # if HAVE_DECL_FWRITE_UNLOCKED
95 #  undef fwrite
96 #  define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z)
97 # else
98 #  define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z)
99 # endif
100
101 # if HAVE_DECL_GETC_UNLOCKED
102 #  undef getc
103 #  define getc(x) getc_unlocked (x)
104 # else
105 #  define getc_unlocked(x) getc (x)
106 # endif
107
108 # if HAVE_DECL_GETCHAR_UNLOCKED
109 #  undef getchar
110 #  define getchar() getchar_unlocked ()
111 # else
112 #  define getchar_unlocked() getchar ()
113 # endif
114
115 # if HAVE_DECL_PUTC_UNLOCKED
116 #  undef putc
117 #  define putc(x,y) putc_unlocked (x,y)
118 # else
119 #  define putc_unlocked(x,y) putc (x,y)
120 # endif
121
122 # if HAVE_DECL_PUTCHAR_UNLOCKED
123 #  undef putchar
124 #  define putchar(x) putchar_unlocked (x)
125 # else
126 #  define putchar_unlocked(x) putchar (x)
127 # endif
128
129 # undef flockfile
130 # define flockfile(x) ((void) 0)
131
132 # undef ftrylockfile
133 # define ftrylockfile(x) 0
134
135 # undef funlockfile
136 # define funlockfile(x) ((void) 0)
137
138 #endif /* UNLOCKED_IO_H */