gnulib-tool.py: Reduce code duplication in file name transformations.
[gnulib.git] / modules / stdio
blob45ae9824ed69d690257de4eba59d110639f3ad58
1 Description:
2 A GNU-like <stdio.h>.
4 Files:
5 lib/stdio.in.h
6 lib/stdio-read.c
7 lib/stdio-write.c
8 m4/stdio_h.m4
9 m4/musl.m4
11 Depends-on:
12 extensions
13 gen-header
14 include_next
15 snippet/arg-nonnull
16 snippet/c++defs
17 snippet/warn-on-use
18 ssize_t
19 stddef
20 sys_types
22 configure.ac-early:
23 gl_STDIO_H_EARLY
25 configure.ac:
26 gl_STDIO_H
27 gl_STDIO_H_REQUIRE_DEFAULTS
28 AC_PROG_MKDIR_P
29 gl_CONDITIONAL([GL_COND_OBJ_STDIO_READ], [test $REPLACE_STDIO_READ_FUNCS = 1])
30 gl_CONDITIONAL([GL_COND_OBJ_STDIO_WRITE], [test $REPLACE_STDIO_WRITE_FUNCS = 1])
32 dnl No need to create extra modules for these functions. Everyone who uses
33 dnl <stdio.h> likely needs them.
34 gl_STDIO_MODULE_INDICATOR([fscanf])
35 gl_MODULE_INDICATOR([fscanf])
36 gl_STDIO_MODULE_INDICATOR([scanf])
37 gl_MODULE_INDICATOR([scanf])
38 gl_STDIO_MODULE_INDICATOR([fgetc])
39 gl_STDIO_MODULE_INDICATOR([getc])
40 gl_STDIO_MODULE_INDICATOR([getchar])
41 gl_STDIO_MODULE_INDICATOR([fgets])
42 gl_STDIO_MODULE_INDICATOR([fread])
44 dnl No need to create extra modules for these functions. Everyone who uses
45 dnl <stdio.h> likely needs them.
46 gl_STDIO_MODULE_INDICATOR([fprintf])
47 gl_STDIO_MODULE_INDICATOR([printf])
48 gl_STDIO_MODULE_INDICATOR([vfprintf])
49 gl_STDIO_MODULE_INDICATOR([vprintf])
50 gl_STDIO_MODULE_INDICATOR([fputc])
51 gl_STDIO_MODULE_INDICATOR([putc])
52 gl_STDIO_MODULE_INDICATOR([putchar])
53 gl_STDIO_MODULE_INDICATOR([fputs])
54 gl_STDIO_MODULE_INDICATOR([puts])
55 gl_STDIO_MODULE_INDICATOR([fwrite])
57 Makefile.am:
58 BUILT_SOURCES += stdio.h
60 # We need the following in order to create <stdio.h> when the system
61 # doesn't have one that works with the given compiler.
62 stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
63 @NMD@   $(AM_V_GEN)$(MKDIR_P) '%reldir%'
64         $(gl_V_at)$(SED_HEADER_STDOUT) \
65               -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \
66               -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
67               -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
68               -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
69               -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
70               -e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \
71               -e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \
72               -e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \
73               -e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \
74               -e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \
75               -e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \
76               -e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \
77               -e 's/@''GNULIB_FOPEN_GNU''@/$(GNULIB_FOPEN_GNU)/g' \
78               -e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \
79               -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \
80               -e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \
81               -e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \
82               -e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \
83               -e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \
84               -e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \
85               -e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \
86               -e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \
87               -e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \
88               -e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \
89               -e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \
90               -e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \
91               -e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \
92               -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \
93               -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \
94               -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \
95               -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \
96               -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \
97               -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \
98               -e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \
99               -e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \
100               -e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \
101               -e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \
102               -e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \
103               -e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \
104               -e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \
105               -e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \
106               -e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \
107               -e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \
108               -e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \
109               -e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \
110               -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \
111               -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \
112               -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \
113               -e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \
114               -e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \
115               -e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \
116               -e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \
117               -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \
118               -e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \
119               -e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \
120               -e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \
121               -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
122               -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
123               -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
124               -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GNULIB_MDA_FCLOSEALL)/g' \
125               -e 's/@''GNULIB_MDA_FDOPEN''@/$(GNULIB_MDA_FDOPEN)/g' \
126               -e 's/@''GNULIB_MDA_FILENO''@/$(GNULIB_MDA_FILENO)/g' \
127               -e 's/@''GNULIB_MDA_GETW''@/$(GNULIB_MDA_GETW)/g' \
128               -e 's/@''GNULIB_MDA_PUTW''@/$(GNULIB_MDA_PUTW)/g' \
129               -e 's/@''GNULIB_MDA_TEMPNAM''@/$(GNULIB_MDA_TEMPNAM)/g' \
130               < $(srcdir)/stdio.in.h > $@-t1
131         $(AM_V_at)sed \
132               -e 's|@''HAVE_DECL_FCLOSEALL''@|$(HAVE_DECL_FCLOSEALL)|g' \
133               -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
134               -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
135               -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
136               -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
137               -e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
138               -e 's|@''HAVE_DECL_GETW''@|$(HAVE_DECL_GETW)|g' \
139               -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \
140               -e 's|@''HAVE_DECL_PUTW''@|$(HAVE_DECL_PUTW)|g' \
141               -e 's|@''HAVE_DECL_SNPRINTF''@|$(HAVE_DECL_SNPRINTF)|g' \
142               -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \
143               -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \
144               -e 's|@''HAVE_FSEEKO''@|$(HAVE_FSEEKO)|g' \
145               -e 's|@''HAVE_FTELLO''@|$(HAVE_FTELLO)|g' \
146               -e 's|@''HAVE_PCLOSE''@|$(HAVE_PCLOSE)|g' \
147               -e 's|@''HAVE_POPEN''@|$(HAVE_POPEN)|g' \
148               -e 's|@''HAVE_RENAMEAT''@|$(HAVE_RENAMEAT)|g' \
149               -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \
150               -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \
151               < $@-t1 > $@-t2
152         $(AM_V_at)sed \
153               -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \
154               -e 's|@''REPLACE_FCLOSE''@|$(REPLACE_FCLOSE)|g' \
155               -e 's|@''REPLACE_FDOPEN''@|$(REPLACE_FDOPEN)|g' \
156               -e 's|@''REPLACE_FFLUSH''@|$(REPLACE_FFLUSH)|g' \
157               -e 's|@''REPLACE_FOPEN''@|$(REPLACE_FOPEN)|g' \
158               -e 's|@''REPLACE_FOPEN_FOR_FOPEN_GNU''@|$(REPLACE_FOPEN_FOR_FOPEN_GNU)|g' \
159               -e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
160               -e 's|@''REPLACE_FPURGE''@|$(REPLACE_FPURGE)|g' \
161               -e 's|@''REPLACE_FREOPEN''@|$(REPLACE_FREOPEN)|g' \
162               -e 's|@''REPLACE_FSEEK''@|$(REPLACE_FSEEK)|g' \
163               -e 's|@''REPLACE_FSEEKO''@|$(REPLACE_FSEEKO)|g' \
164               -e 's|@''REPLACE_FTELL''@|$(REPLACE_FTELL)|g' \
165               -e 's|@''REPLACE_FTELLO''@|$(REPLACE_FTELLO)|g' \
166               -e 's|@''REPLACE_GETDELIM''@|$(REPLACE_GETDELIM)|g' \
167               -e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
168               -e 's|@''REPLACE_OBSTACK_PRINTF''@|$(REPLACE_OBSTACK_PRINTF)|g' \
169               -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
170               -e 's|@''REPLACE_POPEN''@|$(REPLACE_POPEN)|g' \
171               -e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
172               -e 's|@''REPLACE_REMOVE''@|$(REPLACE_REMOVE)|g' \
173               -e 's|@''REPLACE_RENAME''@|$(REPLACE_RENAME)|g' \
174               -e 's|@''REPLACE_RENAMEAT''@|$(REPLACE_RENAMEAT)|g' \
175               -e 's|@''REPLACE_SNPRINTF''@|$(REPLACE_SNPRINTF)|g' \
176               -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \
177               -e 's|@''REPLACE_STDIO_READ_FUNCS''@|$(REPLACE_STDIO_READ_FUNCS)|g' \
178               -e 's|@''REPLACE_STDIO_WRITE_FUNCS''@|$(REPLACE_STDIO_WRITE_FUNCS)|g' \
179               -e 's|@''REPLACE_TMPFILE''@|$(REPLACE_TMPFILE)|g' \
180               -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \
181               -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \
182               -e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
183               -e 's|@''REPLACE_VPRINTF''@|$(REPLACE_VPRINTF)|g' \
184               -e 's|@''REPLACE_VSNPRINTF''@|$(REPLACE_VSNPRINTF)|g' \
185               -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \
186               -e 's|@''ASM_SYMBOL_PREFIX''@|$(ASM_SYMBOL_PREFIX)|g' \
187               -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
188               -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
189               -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
190               < $@-t2 > $@-t3
191         $(AM_V_at)rm -f $@-t1 $@-t2
192         $(AM_V_at)mv $@-t3 $@
193 MOSTLYCLEANFILES += stdio.h stdio.h-t1 stdio.h-t2 stdio.h-t3
195 if GL_COND_OBJ_STDIO_READ
196 lib_SOURCES += stdio-read.c
197 endif
198 if GL_COND_OBJ_STDIO_WRITE
199 lib_SOURCES += stdio-write.c
200 endif
202 Include:
203 <stdio.h>
205 License:
206 LGPLv2+
208 Maintainer: