1da2e3ebdSchin /***********************************************************************
2da2e3ebdSchin * *
3da2e3ebdSchin * This software is part of the ast package *
4*3e14f97fSRoger A. Faulkner * Copyright (c) 1985-2010 AT&T Intellectual Property *
5da2e3ebdSchin * and is licensed under the *
6da2e3ebdSchin * Common Public License, Version 1.0 *
77c2fbfb3SApril Chin * by AT&T Intellectual Property *
8da2e3ebdSchin * *
9da2e3ebdSchin * A copy of the License is available at *
10da2e3ebdSchin * http://www.opensource.org/licenses/cpl1.0.txt *
11da2e3ebdSchin * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
12da2e3ebdSchin * *
13da2e3ebdSchin * Information and Software Systems Research *
14da2e3ebdSchin * AT&T Research *
15da2e3ebdSchin * Florham Park NJ *
16da2e3ebdSchin * *
17da2e3ebdSchin * Glenn Fowler <gsf@research.att.com> *
18da2e3ebdSchin * David Korn <dgk@research.att.com> *
19da2e3ebdSchin * Phong Vo <kpv@research.att.com> *
20da2e3ebdSchin * *
21da2e3ebdSchin ***********************************************************************/
22da2e3ebdSchin #pragma prototyped
23da2e3ebdSchin
24da2e3ebdSchin /*
25da2e3ebdSchin * some systems may pull in <ast_common.h> and its <ast_map.h>
26da2e3ebdSchin * which we are in the process of generating ... this prevents it
27da2e3ebdSchin */
28da2e3ebdSchin
29da2e3ebdSchin #define _def_map_ast 1
30da2e3ebdSchin
31da2e3ebdSchin #include "FEATURE/lib"
32da2e3ebdSchin #include "FEATURE/mmap"
33*3e14f97fSRoger A. Faulkner #include "FEATURE/options"
34da2e3ebdSchin #include "FEATURE/vmalloc"
35*3e14f97fSRoger A. Faulkner #include "FEATURE/eaccess"
36*3e14f97fSRoger A. Faulkner
37*3e14f97fSRoger A. Faulkner #if _opt_map_libc && !defined(_map_libc)
38*3e14f97fSRoger A. Faulkner #define _map_libc 1
39*3e14f97fSRoger A. Faulkner #endif
40da2e3ebdSchin
41da2e3ebdSchin int
main()42da2e3ebdSchin main()
43da2e3ebdSchin {
44da2e3ebdSchin printf("#pragma prototyped\n");
45da2e3ebdSchin printf("\n");
46da2e3ebdSchin printf("/*\n");
47da2e3ebdSchin printf(" * prototypes provided for standard interfaces hijacked\n");
48da2e3ebdSchin printf(" * by ast and mapped to _ast_* but already prototyped\n");
49da2e3ebdSchin printf(" * unmapped in native headers included by <ast_std.h>\n");
50da2e3ebdSchin printf(" */\n");
51da2e3ebdSchin printf("\n");
52da2e3ebdSchin printf("#if _BLD_ast && defined(__EXPORT__)\n");
53da2e3ebdSchin printf("#define extern __EXPORT__\n");
54da2e3ebdSchin printf("#endif\n");
55da2e3ebdSchin printf("\n");
56da2e3ebdSchin #if __MVS__
57da2e3ebdSchin #undef _map_libc
58da2e3ebdSchin #define _map_libc 1
59da2e3ebdSchin printf("\n");
60da2e3ebdSchin printf("/* mvs.390 libc.dll routines can't be intercepted by user dlls */\n");
61da2e3ebdSchin printf("#undef _mem_dd_fd_DIR\n");
62da2e3ebdSchin printf("#undef _typ_long_double\n");
63da2e3ebdSchin #endif
64da2e3ebdSchin #if _map_libc
65da2e3ebdSchin #undef _map_malloc
66da2e3ebdSchin #define _map_malloc 1
67da2e3ebdSchin printf("\n");
68da2e3ebdSchin printf("#define _map_libc 1\n");
69da2e3ebdSchin printf("#undef basename\n");
70da2e3ebdSchin printf("#define basename _ast_basename\n");
71da2e3ebdSchin printf("#undef dirname\n");
72da2e3ebdSchin printf("#define dirname _ast_dirname\n");
73*3e14f97fSRoger A. Faulkner #if !_lib_eaccess
74da2e3ebdSchin printf("#undef eaccess\n");
75da2e3ebdSchin printf("#define eaccess _ast_eaccess\n");
76*3e14f97fSRoger A. Faulkner #endif
77da2e3ebdSchin #if !_lib_execvpe
78da2e3ebdSchin printf("#undef execvpe\n");
79da2e3ebdSchin printf("#define execvpe _ast_execvpe\n");
80da2e3ebdSchin printf("extern int execvpe(const char*, char* const[], char* const[]);\n");
81da2e3ebdSchin #endif
82da2e3ebdSchin printf("#undef fnmatch\n");
83da2e3ebdSchin printf("#define fnmatch _ast_fnmatch\n");
84da2e3ebdSchin printf("#undef fts_children\n");
85da2e3ebdSchin printf("#define fts_children _ast_fts_children\n");
86da2e3ebdSchin printf("#undef fts_close\n");
87da2e3ebdSchin printf("#define fts_close _ast_fts_close\n");
88da2e3ebdSchin printf("#undef fts_flags\n");
89da2e3ebdSchin printf("#define fts_flags _ast_fts_flags\n");
90da2e3ebdSchin printf("#undef fts_notify\n");
91da2e3ebdSchin printf("#define fts_notify _ast_fts_notify\n");
92da2e3ebdSchin printf("#undef fts_open\n");
93da2e3ebdSchin printf("#define fts_open _ast_fts_open\n");
94da2e3ebdSchin printf("#undef fts_read\n");
95da2e3ebdSchin printf("#define fts_read _ast_fts_read\n");
96da2e3ebdSchin printf("#undef fts_set\n");
97da2e3ebdSchin printf("#define fts_set _ast_fts_set\n");
98da2e3ebdSchin printf("#undef ftw\n");
99da2e3ebdSchin printf("#define ftw _ast_ftw\n");
100da2e3ebdSchin printf("#undef ftwalk\n");
101da2e3ebdSchin printf("#define ftwalk _ast_ftwalk\n");
102da2e3ebdSchin printf("#undef ftwflags\n");
103da2e3ebdSchin printf("#define ftwflags _ast_ftwflags\n");
104da2e3ebdSchin #if !_WINIX
105da2e3ebdSchin printf("#undef getcwd\n");
106da2e3ebdSchin printf("#define getcwd _ast_getcwd\n");
107da2e3ebdSchin printf("extern char* getcwd(char*, size_t);\n");
108da2e3ebdSchin #endif
109da2e3ebdSchin printf("#undef getdate\n");
110da2e3ebdSchin printf("#define getdate _ast_getdate\n");
111da2e3ebdSchin #if _lib_getopt || _lib_getsubopt || _lib_getopt_long || _lib_getopt_long_only
112da2e3ebdSchin printf("#undef getopt\n");
113da2e3ebdSchin printf("#define getopt _ast_getopt\n");
114da2e3ebdSchin printf("#undef getsubopt\n");
115da2e3ebdSchin printf("#define getsubopt _ast_getsubopt\n");
116da2e3ebdSchin printf("#undef getopt_long\n");
117da2e3ebdSchin printf("#define getopt_long _ast_getopt_long\n");
118da2e3ebdSchin printf("#undef getopt_long_only\n");
119da2e3ebdSchin printf("#define getopt_long_only _ast_getopt_long_only\n");
1207c2fbfb3SApril Chin printf("#undef optopt\n");
1217c2fbfb3SApril Chin printf("#define optopt _ast_optopt\n");
1227c2fbfb3SApril Chin printf("#undef optarg\n");
1237c2fbfb3SApril Chin printf("#define optarg _ast_optarg\n");
1247c2fbfb3SApril Chin printf("#undef optind\n");
1257c2fbfb3SApril Chin printf("#define optind _ast_optind\n");
1267c2fbfb3SApril Chin printf("#undef opterr\n");
1277c2fbfb3SApril Chin printf("#define opterr _ast_opterr\n");
128da2e3ebdSchin #endif
129da2e3ebdSchin printf("#undef getwd\n");
130da2e3ebdSchin printf("#define getwd _ast_getwd\n");
131da2e3ebdSchin printf("extern char* getwd(char*);\n");
132da2e3ebdSchin printf("#undef glob\n");
133da2e3ebdSchin printf("#define glob _ast_glob\n");
134da2e3ebdSchin printf("#undef globfree\n");
135da2e3ebdSchin printf("#define globfree _ast_globfree\n");
136da2e3ebdSchin printf("#undef memdup\n");
137da2e3ebdSchin printf("#define memdup _ast_memdup\n");
138da2e3ebdSchin printf("#undef memfatal\n");
139da2e3ebdSchin printf("#define memfatal _ast_memfatal\n");
140da2e3ebdSchin printf("#undef memhash\n");
141da2e3ebdSchin printf("#define memhash _ast_memhash\n");
142da2e3ebdSchin printf("#undef memsum\n");
143da2e3ebdSchin printf("#define memsum _ast_memsum\n");
144da2e3ebdSchin printf("#undef mkstemp\n");
145da2e3ebdSchin printf("#define mkstemp _ast_mkstemp\n");
146da2e3ebdSchin printf("extern int mkstemp(char*);\n");
147da2e3ebdSchin printf("#undef mktemp\n");
148da2e3ebdSchin printf("#define mktemp _ast_mktemp\n");
149da2e3ebdSchin printf("extern char* mktemp(char*);\n");
150da2e3ebdSchin printf("#undef mktime\n");
151da2e3ebdSchin printf("#define mktime _ast_mktime\n");
152da2e3ebdSchin printf("#undef nftw\n");
153da2e3ebdSchin printf("#define nftw _ast_nftw\n");
1547c2fbfb3SApril Chin printf("#undef optctx\n");
1557c2fbfb3SApril Chin printf("#define optctx _ast_optctx\n");
156da2e3ebdSchin printf("#undef optesc\n");
157da2e3ebdSchin printf("#define optesc _ast_optesc\n");
158da2e3ebdSchin printf("#undef optget\n");
159da2e3ebdSchin printf("#define optget _ast_optget\n");
160da2e3ebdSchin printf("#undef opthelp\n");
161da2e3ebdSchin printf("#define opthelp _ast_opthelp\n");
162da2e3ebdSchin printf("#undef optjoin\n");
163da2e3ebdSchin printf("#define optjoin _ast_optjoin\n");
164da2e3ebdSchin printf("#undef optstr\n");
165da2e3ebdSchin printf("#define optstr _ast_optstr\n");
166da2e3ebdSchin printf("#undef optusage\n");
167da2e3ebdSchin printf("#define optusage _ast_optusage\n");
168da2e3ebdSchin printf("#undef pathaccess\n");
169da2e3ebdSchin printf("#define pathaccess _ast_pathaccess\n");
170da2e3ebdSchin printf("#undef pathbin\n");
171da2e3ebdSchin printf("#define pathbin _ast_pathbin\n");
172da2e3ebdSchin printf("#undef pathcanon\n");
173da2e3ebdSchin printf("#define pathcanon _ast_pathcanon\n");
174da2e3ebdSchin printf("#undef pathcat\n");
175da2e3ebdSchin printf("#define pathcat _ast_pathcat\n");
176da2e3ebdSchin printf("#undef pathcd\n");
177da2e3ebdSchin printf("#define pathcd _ast_pathcd\n");
178da2e3ebdSchin printf("#undef pathcheck\n");
179da2e3ebdSchin printf("#define pathcheck _ast_pathcheck\n");
180da2e3ebdSchin printf("#undef pathexists\n");
181da2e3ebdSchin printf("#define pathexists _ast_pathexists\n");
182da2e3ebdSchin printf("#undef pathfind\n");
183da2e3ebdSchin printf("#define pathfind _ast_pathfind\n");
184da2e3ebdSchin printf("#undef pathgetlink\n");
185da2e3ebdSchin printf("#define pathgetlink _ast_pathgetlink\n");
186da2e3ebdSchin printf("#undef pathinclude\n");
187da2e3ebdSchin printf("#define pathinclude _ast_pathinclude\n");
188da2e3ebdSchin printf("#undef pathkey\n");
189da2e3ebdSchin printf("#define pathkey _ast_pathkey\n");
190da2e3ebdSchin printf("#undef pathnative\n");
191da2e3ebdSchin printf("#define pathnative _ast_pathnative\n");
192da2e3ebdSchin printf("#undef pathpath\n");
193da2e3ebdSchin printf("#define pathpath _ast_pathpath\n");
194da2e3ebdSchin printf("#undef pathposix\n");
195da2e3ebdSchin printf("#define pathposix _ast_pathposix\n");
196da2e3ebdSchin printf("#undef pathprobe\n");
197da2e3ebdSchin printf("#define pathprobe _ast_pathprobe\n");
19834f9b3eeSRoland Mainz printf("#undef pathprog\n");
19934f9b3eeSRoland Mainz printf("#define pathprog _ast_pathprog\n");
200da2e3ebdSchin printf("#undef pathrepl\n");
201da2e3ebdSchin printf("#define pathrepl _ast_pathrepl\n");
202da2e3ebdSchin printf("#undef pathsetlink\n");
203da2e3ebdSchin printf("#define pathsetlink _ast_pathsetlink\n");
204da2e3ebdSchin printf("#undef pathshell\n");
205da2e3ebdSchin printf("#define pathshell _ast_pathshell\n");
206da2e3ebdSchin printf("#undef pathstat\n");
207da2e3ebdSchin printf("#define pathstat _ast_pathstat\n");
208da2e3ebdSchin printf("#undef pathtemp\n");
209da2e3ebdSchin printf("#define pathtemp _ast_pathtemp\n");
210da2e3ebdSchin printf("#undef pathtmp\n");
211da2e3ebdSchin printf("#define pathtmp _ast_pathtmp\n");
212da2e3ebdSchin printf("#undef procclose\n");
213da2e3ebdSchin printf("#define procclose _ast_procclose\n");
214da2e3ebdSchin printf("#undef procfree\n");
215da2e3ebdSchin printf("#define procfree _ast_procfree\n");
216da2e3ebdSchin printf("#undef procopen\n");
217da2e3ebdSchin printf("#define procopen _ast_procopen\n");
218da2e3ebdSchin printf("#undef procrun\n");
219da2e3ebdSchin printf("#define procrun _ast_procrun\n");
220da2e3ebdSchin printf("#undef putenv\n");
221da2e3ebdSchin printf("#define putenv _ast_putenv\n");
222da2e3ebdSchin printf("#undef re_comp\n");
223da2e3ebdSchin printf("#define re_comp _ast_re_comp\n");
224da2e3ebdSchin printf("#undef re_exec\n");
225da2e3ebdSchin printf("#define re_exec _ast_re_exec\n");
226da2e3ebdSchin printf("#undef realpath\n");
227da2e3ebdSchin printf("#define realpath _ast_realpath\n");
228da2e3ebdSchin printf("extern char* realpath(const char*, char*);\n");
229da2e3ebdSchin printf("#undef regaddclass\n");
230da2e3ebdSchin printf("#define regaddclass _ast_regaddclass\n");
231da2e3ebdSchin printf("#undef regalloc\n");
232da2e3ebdSchin printf("#define regalloc _ast_regalloc\n");
233da2e3ebdSchin printf("#undef regcache\n");
234da2e3ebdSchin printf("#define regcache _ast_regcache\n");
235da2e3ebdSchin printf("#undef regclass\n");
236da2e3ebdSchin printf("#define regclass _ast_regclass\n");
237da2e3ebdSchin printf("#undef regcmp\n");
238da2e3ebdSchin printf("#define regcmp _ast_regcmp\n");
239da2e3ebdSchin printf("#undef regcollate\n");
240da2e3ebdSchin printf("#define regcollate _ast_regcollate\n");
241da2e3ebdSchin printf("#undef regcomb\n");
242da2e3ebdSchin printf("#define regcomb _ast_regcomb\n");
243da2e3ebdSchin printf("#undef regcomp\n");
244da2e3ebdSchin printf("#define regcomp _ast_regcomp\n");
245da2e3ebdSchin printf("#undef regdecomp\n");
246da2e3ebdSchin printf("#define regdecomp _ast_regdecomp\n");
247da2e3ebdSchin printf("#undef regdup\n");
248da2e3ebdSchin printf("#define regdup _ast_regdup\n");
249da2e3ebdSchin printf("#undef regerror\n");
250da2e3ebdSchin printf("#define regerror _ast_regerror\n");
251da2e3ebdSchin printf("#undef regex\n");
252da2e3ebdSchin printf("#define regex _ast_regex\n");
253da2e3ebdSchin printf("#undef regexec\n");
254da2e3ebdSchin printf("#define regexec _ast_regexec\n");
255da2e3ebdSchin printf("#undef regfatal\n");
256da2e3ebdSchin printf("#define regfatal _ast_regfatal\n");
257da2e3ebdSchin printf("#undef regfatalpat\n");
258da2e3ebdSchin printf("#define regfatalpat _ast_regfatalpat\n");
259da2e3ebdSchin printf("#undef regfree\n");
260da2e3ebdSchin printf("#define regfree _ast_regfree\n");
261da2e3ebdSchin printf("#undef regncomp\n");
262da2e3ebdSchin printf("#define regncomp _ast_regncomp\n");
263da2e3ebdSchin printf("#undef regnexec\n");
264da2e3ebdSchin printf("#define regnexec _ast_regnexec\n");
265da2e3ebdSchin printf("#undef regrecord\n");
266da2e3ebdSchin printf("#define regrecord _ast_regrecord\n");
267da2e3ebdSchin printf("#undef regrexec\n");
268da2e3ebdSchin printf("#define regrexec _ast_regrexec\n");
269da2e3ebdSchin printf("#undef regstat\n");
270da2e3ebdSchin printf("#define regstat _ast_regstat\n");
271da2e3ebdSchin printf("#undef regsub\n");
272da2e3ebdSchin printf("#define regsub _ast_regsub\n");
273da2e3ebdSchin printf("#undef regsubcomp\n");
274da2e3ebdSchin printf("#define regsubcomp _ast_regsubcomp\n");
275da2e3ebdSchin printf("#undef regsubexec\n");
276da2e3ebdSchin printf("#define regsubexec _ast_regsubexec\n");
277da2e3ebdSchin printf("#undef regsubflags\n");
278da2e3ebdSchin printf("#define regsubflags _ast_regsubflags\n");
279da2e3ebdSchin printf("#undef regsubfree\n");
280da2e3ebdSchin printf("#define regsubfree _ast_regsubfree\n");
281da2e3ebdSchin printf("#undef remove\n");
282da2e3ebdSchin printf("#define remove _ast_remove\n");
283da2e3ebdSchin printf("extern int remove(const char*);\n");
284da2e3ebdSchin printf("#undef resolvepath\n");
285da2e3ebdSchin printf("#define resolvepath _ast_resolvepath\n");
2867c2fbfb3SApril Chin printf("extern int resolvepath(const char*, char*, size_t);\n");
287da2e3ebdSchin printf("#undef setenv\n");
288da2e3ebdSchin printf("#define setenv _ast_setenv\n");
289da2e3ebdSchin printf("extern int setenv(const char*, const char*, int);\n");
290da2e3ebdSchin printf("#undef setenviron\n");
291da2e3ebdSchin printf("#define setenviron _ast_setenviron\n");
292da2e3ebdSchin printf("#undef sigcritical\n");
293da2e3ebdSchin printf("#define sigcritical _ast_sigcritical\n");
294da2e3ebdSchin printf("#undef signal\n");
295da2e3ebdSchin printf("#define signal _ast_signal\n");
296da2e3ebdSchin printf("#undef sigunblock\n");
297da2e3ebdSchin printf("#define sigunblock _ast_sigunblock\n");
298da2e3ebdSchin printf("#undef stracmp\n");
299da2e3ebdSchin printf("#define stracmp _ast_stracmp\n");
300da2e3ebdSchin printf("#undef strcopy\n");
301da2e3ebdSchin printf("#define strcopy _ast_strcopy\n");
302da2e3ebdSchin printf("#undef strelapsed\n");
303da2e3ebdSchin printf("#define strelapsed _ast_strelapsed\n");
304da2e3ebdSchin printf("#undef stresc\n");
305da2e3ebdSchin printf("#define stresc _ast_stresc\n");
306da2e3ebdSchin printf("#undef streval\n");
307da2e3ebdSchin printf("#define streval _ast_streval\n");
308da2e3ebdSchin printf("#undef strexpr\n");
309da2e3ebdSchin printf("#define strexpr _ast_strexpr\n");
310da2e3ebdSchin printf("#undef strftime\n");
311da2e3ebdSchin printf("#define strftime _ast_strftime\n");
312da2e3ebdSchin printf("#undef strgid\n");
313da2e3ebdSchin printf("#define strgid _ast_strgid\n");
314da2e3ebdSchin printf("#undef strgrpmatch\n");
315da2e3ebdSchin printf("#define strgrpmatch _ast_strgrpmatch\n");
316da2e3ebdSchin printf("#undef strhash\n");
317da2e3ebdSchin printf("#define strhash _ast_strhash\n");
318da2e3ebdSchin printf("#undef strkey\n");
319da2e3ebdSchin printf("#define strkey _ast_strkey\n");
320da2e3ebdSchin printf("#undef strlcat\n");
321da2e3ebdSchin printf("#define strlcat _ast_strlcat\n");
322da2e3ebdSchin printf("extern size_t strlcat(char*, const char*, size_t);\n");
323da2e3ebdSchin printf("#undef strlcpy\n");
324da2e3ebdSchin printf("#define strlcpy _ast_strlcpy\n");
325da2e3ebdSchin printf("extern size_t strlcpy(char*, const char*, size_t);\n");
326da2e3ebdSchin printf("#undef strlook\n");
327da2e3ebdSchin printf("#define strlook _ast_strlook\n");
328da2e3ebdSchin printf("#undef strmatch\n");
329da2e3ebdSchin printf("#define strmatch _ast_strmatch\n");
330da2e3ebdSchin #endif
331da2e3ebdSchin #if _map_libc || _lib_strmode
332da2e3ebdSchin printf("#undef strmode\n");
333da2e3ebdSchin printf("#define strmode _ast_strmode\n");
334da2e3ebdSchin #endif
335da2e3ebdSchin #if _map_libc
336da2e3ebdSchin printf("#undef strnacmp\n");
337da2e3ebdSchin printf("#define strnacmp _ast_strnacmp\n");
338da2e3ebdSchin printf("#undef strncopy\n");
339da2e3ebdSchin printf("#define strncopy _ast_strncopy\n");
340da2e3ebdSchin printf("#undef strntod\n");
341da2e3ebdSchin printf("#define strntod _ast_strntod\n");
342da2e3ebdSchin printf("#undef strntol\n");
343da2e3ebdSchin printf("#define strntol _ast_strntol\n");
344da2e3ebdSchin printf("#undef strntold\n");
345da2e3ebdSchin printf("#define strntold _ast_strntold\n");
346da2e3ebdSchin printf("#undef strntoll\n");
347da2e3ebdSchin printf("#define strntoll _ast_strntoll\n");
348da2e3ebdSchin printf("#undef strntoul\n");
349da2e3ebdSchin printf("#define strntoul _ast_strntoul\n");
350da2e3ebdSchin printf("#undef strntoull\n");
351da2e3ebdSchin printf("#define strntoull _ast_strntoull\n");
352da2e3ebdSchin printf("#undef stropt\n");
353da2e3ebdSchin printf("#define stropt _ast_stropt\n");
354da2e3ebdSchin printf("#undef strperm\n");
355da2e3ebdSchin printf("#define strperm _ast_strperm\n");
356da2e3ebdSchin printf("#undef strpsearch\n");
357da2e3ebdSchin printf("#define strpsearch _ast_strpsearch\n");
358da2e3ebdSchin #if !_lib_strptime
359da2e3ebdSchin printf("#undef strptime\n");
360da2e3ebdSchin printf("#define strptime _ast_strptime\n");
361da2e3ebdSchin #endif
362da2e3ebdSchin printf("#undef strsearch\n");
363da2e3ebdSchin printf("#define strsearch _ast_strsearch\n");
364da2e3ebdSchin printf("#undef strsort\n");
365da2e3ebdSchin printf("#define strsort _ast_strsort\n");
366da2e3ebdSchin printf("#undef strsubmatch\n");
367da2e3ebdSchin printf("#define strsubmatch _ast_strsubmatch\n");
368da2e3ebdSchin printf("#undef strsum\n");
369da2e3ebdSchin printf("#define strsum _ast_strsum\n");
370da2e3ebdSchin printf("#undef strtape\n");
371da2e3ebdSchin printf("#define strtape _ast_strtape\n");
372da2e3ebdSchin printf("#undef strtoip4\n");
373da2e3ebdSchin printf("#define strtoip4 _ast_strtoip4\n");
374da2e3ebdSchin printf("#undef strton\n");
375da2e3ebdSchin printf("#define strton _ast_strton\n");
376da2e3ebdSchin printf("#undef strtonll\n");
377da2e3ebdSchin printf("#define strtonll _ast_strtonll\n");
378da2e3ebdSchin printf("#undef struid\n");
379da2e3ebdSchin printf("#define struid _ast_struid\n");
380da2e3ebdSchin printf("#undef struniq\n");
381da2e3ebdSchin printf("#define struniq _ast_struniq\n");
382da2e3ebdSchin printf("#undef system\n");
383da2e3ebdSchin printf("#define system _ast_system\n");
384da2e3ebdSchin printf("extern int system(const char*);\n");
385da2e3ebdSchin printf("#undef tempnam\n");
386da2e3ebdSchin printf("#define tempnam _ast_tempnam\n");
387da2e3ebdSchin printf("extern char* tempnam(const char*, const char*);\n");
388da2e3ebdSchin printf("#undef tmpnam\n");
389da2e3ebdSchin printf("#define tmpnam _ast_tmpnam\n");
390da2e3ebdSchin printf("extern char* tmpnam(char*);\n");
391da2e3ebdSchin printf("#undef touch\n");
392da2e3ebdSchin printf("#define touch _ast_touch\n");
393da2e3ebdSchin printf("#undef wordexp\n");
394da2e3ebdSchin printf("#define wordexp _ast_wordexp\n");
395da2e3ebdSchin printf("#undef wordfree\n");
396da2e3ebdSchin printf("#define wordfree _ast_wordfree\n");
397da2e3ebdSchin printf("#undef unsetenv\n");
398da2e3ebdSchin printf("#define unsetenv _ast_unsetenv\n");
399da2e3ebdSchin #endif
400da2e3ebdSchin #if _std_malloc
401da2e3ebdSchin printf("\n");
402da2e3ebdSchin printf("/* no local malloc override */\n");
403da2e3ebdSchin printf("#define _std_malloc 1\n");
404da2e3ebdSchin #else
405da2e3ebdSchin #if _map_malloc
406da2e3ebdSchin printf("\n");
407da2e3ebdSchin printf("/* cannot override local malloc */\n");
408da2e3ebdSchin printf("#define _map_malloc 1\n");
409da2e3ebdSchin printf("#undef calloc\n");
410da2e3ebdSchin printf("#define calloc _ast_calloc\n");
411da2e3ebdSchin printf("extern void* calloc(size_t, size_t);\n");
412da2e3ebdSchin printf("#undef cfree\n");
413da2e3ebdSchin printf("#define cfree _ast_cfree\n");
414da2e3ebdSchin printf("extern void cfree(void*);\n");
415da2e3ebdSchin printf("#undef free\n");
416da2e3ebdSchin printf("#define free _ast_free\n");
417da2e3ebdSchin printf("extern void free(void*);\n");
418da2e3ebdSchin #if _lib_mallinfo
419da2e3ebdSchin printf("#undef mallinfo\n");
420da2e3ebdSchin printf("#define mallinfo _ast_mallinfo\n");
421da2e3ebdSchin #endif
422da2e3ebdSchin printf("#undef malloc\n");
423da2e3ebdSchin printf("#define malloc _ast_malloc\n");
424da2e3ebdSchin printf("extern void* malloc(size_t);\n");
425da2e3ebdSchin #if _lib_mallopt
426da2e3ebdSchin printf("#undef mallopt\n");
427da2e3ebdSchin printf("#define mallopt _ast_mallopt\n");
428da2e3ebdSchin #endif
429da2e3ebdSchin #if _lib_memalign
430da2e3ebdSchin printf("#undef memalign\n");
431da2e3ebdSchin printf("#define memalign _ast_memalign\n");
432da2e3ebdSchin printf("extern void* memalign(size_t, size_t);\n");
433da2e3ebdSchin #endif
434da2e3ebdSchin #if _lib_mstats
435da2e3ebdSchin printf("#undef mstats\n");
436da2e3ebdSchin printf("#define mstats _ast_mstats\n");
437da2e3ebdSchin #endif
438da2e3ebdSchin #if _lib_pvalloc
439da2e3ebdSchin printf("#undef pvalloc\n");
440da2e3ebdSchin printf("#define pvalloc _ast_pvalloc\n");
441da2e3ebdSchin #endif
442da2e3ebdSchin printf("#undef realloc\n");
443da2e3ebdSchin printf("#define realloc _ast_realloc\n");
444da2e3ebdSchin printf("extern void* realloc(void*, size_t);\n");
445da2e3ebdSchin printf("#undef strdup\n");
446da2e3ebdSchin printf("#define strdup _ast_strdup\n");
447da2e3ebdSchin printf("extern char* strdup(const char*);\n");
448da2e3ebdSchin #if _lib_valloc
449da2e3ebdSchin printf("#undef valloc\n");
450da2e3ebdSchin printf("#define valloc _ast_valloc\n");
451da2e3ebdSchin printf("extern void* valloc(size_t);\n");
452da2e3ebdSchin #endif
453da2e3ebdSchin #endif
454da2e3ebdSchin #endif
455da2e3ebdSchin
456da2e3ebdSchin /*
457da2e3ebdSchin * overriding <stdlib.h> strto*() is problematic to say the least
458da2e3ebdSchin */
459da2e3ebdSchin
460da2e3ebdSchin #if _map_libc || _std_strtol
461da2e3ebdSchin #if !__CYGWIN__
462da2e3ebdSchin printf("#undef strtol\n");
463da2e3ebdSchin printf("#define strtol _ast_strtol\n");
464da2e3ebdSchin printf("#undef strtoul\n");
465da2e3ebdSchin printf("#define strtoul _ast_strtoul\n");
466da2e3ebdSchin #endif
467da2e3ebdSchin printf("#undef strtoll\n");
468da2e3ebdSchin printf("#define strtoll _ast_strtoll\n");
469da2e3ebdSchin printf("#undef strtoull\n");
470da2e3ebdSchin printf("#define strtoull _ast_strtoull\n");
471da2e3ebdSchin #endif
472da2e3ebdSchin #if _map_libc || _std_strtod
473da2e3ebdSchin printf("#undef strtod\n");
474da2e3ebdSchin printf("#define strtod _ast_strtod\n");
475da2e3ebdSchin #endif
476da2e3ebdSchin #if _map_libc || _std_strtold
477da2e3ebdSchin printf("#undef strtold\n");
478da2e3ebdSchin printf("#define strtold _ast_strtold\n");
479da2e3ebdSchin #endif
480da2e3ebdSchin #if !__CYGWIN__
481da2e3ebdSchin #if _npt_strtol || _map_libc || _std_strtol
482da2e3ebdSchin #if _npt_strtol && !_map_libc && !_std_strtol
483da2e3ebdSchin printf("#ifndef _ISOC99_SOURCE\n");
484da2e3ebdSchin #endif
485da2e3ebdSchin printf("extern long strtol(const char*, char**, int);\n");
486da2e3ebdSchin #if _npt_strtol && !_map_libc && !_std_strtol
487da2e3ebdSchin printf("#endif\n");
488da2e3ebdSchin #endif
489da2e3ebdSchin #endif
490da2e3ebdSchin #if _npt_strtoul || _map_libc || _std_strtol
491da2e3ebdSchin #if _npt_strtoul && !_map_libc && !_std_strtol
492da2e3ebdSchin printf("#ifndef _ISOC99_SOURCE\n");
493da2e3ebdSchin #endif
494da2e3ebdSchin printf("extern unsigned long strtoul(const char*, char**, int);\n");
495da2e3ebdSchin #if _npt_strtoul && !_map_libc && !_std_strtol
496da2e3ebdSchin printf("#endif\n");
497da2e3ebdSchin #endif
498da2e3ebdSchin #endif
499da2e3ebdSchin #endif
500da2e3ebdSchin #if _npt_strtod || _map_libc || _std_strtod
501da2e3ebdSchin #if _npt_strtod && !_map_libc && !_std_strtod
502da2e3ebdSchin printf("#ifndef _ISOC99_SOURCE\n");
503da2e3ebdSchin #endif
504da2e3ebdSchin printf("extern double strtod(const char*, char**);\n");
505da2e3ebdSchin #if _npt_strtod && !_map_libc && !_std_strtod
506da2e3ebdSchin printf("#endif\n");
507da2e3ebdSchin #endif
508da2e3ebdSchin #endif
509da2e3ebdSchin printf("#if !_UWIN\n");
510da2e3ebdSchin printf("#undef extern\n");
511da2e3ebdSchin printf("#endif\n");
512da2e3ebdSchin #if _npt_strtold || _map_libc || _std_strtold
513da2e3ebdSchin #if _npt_strtold && !_map_libc && !_std_strtold
514da2e3ebdSchin printf("#ifndef _ISOC99_SOURCE\n");
515da2e3ebdSchin #endif
516da2e3ebdSchin printf("extern _ast_fltmax_t strtold(const char*, char**);\n");
517da2e3ebdSchin #if _npt_strtold && !_map_libc && !_std_strtold
518da2e3ebdSchin printf("#endif\n");
519da2e3ebdSchin #endif
520da2e3ebdSchin #endif
521da2e3ebdSchin printf("#undef extern\n");
522da2e3ebdSchin #if _npt_strtoll || _map_libc || _std_strtol
523da2e3ebdSchin #if _npt_strtoll && !_map_libc && !_std_strtol
524da2e3ebdSchin printf("#ifndef _ISOC99_SOURCE\n");
525da2e3ebdSchin #endif
526da2e3ebdSchin printf("extern _ast_intmax_t strtoll(const char*, char**, int);\n");
527da2e3ebdSchin #if _npt_strtoll && !_map_libc && !_std_strtol
528da2e3ebdSchin printf("#endif\n");
529da2e3ebdSchin #endif
530da2e3ebdSchin #endif
531da2e3ebdSchin #if _npt_strtoull || _map_libc || _std_strtol
532da2e3ebdSchin #if _npt_strtoull && !_map_libc && !_std_strtol
533da2e3ebdSchin printf("#ifndef _ISOC99_SOURCE\n");
534da2e3ebdSchin #endif
535da2e3ebdSchin printf("extern unsigned _ast_intmax_t strtoull(const char*, char**, int);\n");
536da2e3ebdSchin #if _npt_strtoull && !_map_libc && !_std_strtoul
537da2e3ebdSchin printf("#endif\n");
538da2e3ebdSchin #endif
539da2e3ebdSchin #endif
540da2e3ebdSchin printf("\n");
541da2e3ebdSchin printf("#undef extern\n");
542da2e3ebdSchin return 0;
543da2e3ebdSchin }
544