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