14887Schin /*********************************************************************** 24887Schin * * 34887Schin * This software is part of the ast package * 4*8462SApril.Chin@Sun.COM * Copyright (c) 1985-2008 AT&T Intellectual Property * 54887Schin * and is licensed under the * 64887Schin * Common Public License, Version 1.0 * 7*8462SApril.Chin@Sun.COM * by AT&T Intellectual Property * 84887Schin * * 94887Schin * A copy of the License is available at * 104887Schin * http://www.opensource.org/licenses/cpl1.0.txt * 114887Schin * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 124887Schin * * 134887Schin * Information and Software Systems Research * 144887Schin * AT&T Research * 154887Schin * Florham Park NJ * 164887Schin * * 174887Schin * Glenn Fowler <gsf@research.att.com> * 184887Schin * David Korn <dgk@research.att.com> * 194887Schin * Phong Vo <kpv@research.att.com> * 204887Schin * * 214887Schin ***********************************************************************/ 224887Schin #pragma prototyped 234887Schin 244887Schin /* 254887Schin * some systems may pull in <ast_common.h> and its <ast_map.h> 264887Schin * which we are in the process of generating ... this prevents it 274887Schin */ 284887Schin 294887Schin #define _def_map_ast 1 304887Schin 314887Schin #include "FEATURE/lib" 324887Schin #include "FEATURE/mmap" 334887Schin #include "FEATURE/vmalloc" 344887Schin 354887Schin int 364887Schin main() 374887Schin { 384887Schin printf("#pragma prototyped\n"); 394887Schin printf("\n"); 404887Schin printf("/*\n"); 414887Schin printf(" * prototypes provided for standard interfaces hijacked\n"); 424887Schin printf(" * by ast and mapped to _ast_* but already prototyped\n"); 434887Schin printf(" * unmapped in native headers included by <ast_std.h>\n"); 444887Schin printf(" */\n"); 454887Schin printf("\n"); 464887Schin printf("#if _BLD_ast && defined(__EXPORT__)\n"); 474887Schin printf("#define extern __EXPORT__\n"); 484887Schin printf("#endif\n"); 494887Schin printf("\n"); 504887Schin #if __MVS__ 514887Schin #undef _map_libc 524887Schin #define _map_libc 1 534887Schin printf("\n"); 544887Schin printf("/* mvs.390 libc.dll routines can't be intercepted by user dlls */\n"); 554887Schin printf("#undef _mem_dd_fd_DIR\n"); 564887Schin printf("#undef _typ_long_double\n"); 574887Schin #endif 584887Schin #if _map_libc 594887Schin #undef _map_malloc 604887Schin #define _map_malloc 1 614887Schin printf("\n"); 624887Schin printf("#define _map_libc 1\n"); 634887Schin printf("#undef basename\n"); 644887Schin printf("#define basename _ast_basename\n"); 654887Schin printf("#undef dirname\n"); 664887Schin printf("#define dirname _ast_dirname\n"); 674887Schin printf("#undef eaccess\n"); 684887Schin printf("#define eaccess _ast_eaccess\n"); 694887Schin #if !_lib_execvpe 704887Schin printf("#undef execvpe\n"); 714887Schin printf("#define execvpe _ast_execvpe\n"); 724887Schin printf("extern int execvpe(const char*, char* const[], char* const[]);\n"); 734887Schin #endif 744887Schin printf("#undef fnmatch\n"); 754887Schin printf("#define fnmatch _ast_fnmatch\n"); 764887Schin printf("#undef fts_children\n"); 774887Schin printf("#define fts_children _ast_fts_children\n"); 784887Schin printf("#undef fts_close\n"); 794887Schin printf("#define fts_close _ast_fts_close\n"); 804887Schin printf("#undef fts_flags\n"); 814887Schin printf("#define fts_flags _ast_fts_flags\n"); 824887Schin printf("#undef fts_notify\n"); 834887Schin printf("#define fts_notify _ast_fts_notify\n"); 844887Schin printf("#undef fts_open\n"); 854887Schin printf("#define fts_open _ast_fts_open\n"); 864887Schin printf("#undef fts_read\n"); 874887Schin printf("#define fts_read _ast_fts_read\n"); 884887Schin printf("#undef fts_set\n"); 894887Schin printf("#define fts_set _ast_fts_set\n"); 904887Schin printf("#undef ftw\n"); 914887Schin printf("#define ftw _ast_ftw\n"); 924887Schin printf("#undef ftwalk\n"); 934887Schin printf("#define ftwalk _ast_ftwalk\n"); 944887Schin printf("#undef ftwflags\n"); 954887Schin printf("#define ftwflags _ast_ftwflags\n"); 964887Schin #if !_WINIX 974887Schin printf("#undef getcwd\n"); 984887Schin printf("#define getcwd _ast_getcwd\n"); 994887Schin printf("extern char* getcwd(char*, size_t);\n"); 1004887Schin #endif 1014887Schin printf("#undef getdate\n"); 1024887Schin printf("#define getdate _ast_getdate\n"); 1034887Schin #if _lib_getopt || _lib_getsubopt || _lib_getopt_long || _lib_getopt_long_only 1044887Schin printf("#undef getopt\n"); 1054887Schin printf("#define getopt _ast_getopt\n"); 1064887Schin printf("#undef getsubopt\n"); 1074887Schin printf("#define getsubopt _ast_getsubopt\n"); 1084887Schin printf("#undef getopt_long\n"); 1094887Schin printf("#define getopt_long _ast_getopt_long\n"); 1104887Schin printf("#undef getopt_long_only\n"); 1114887Schin printf("#define getopt_long_only _ast_getopt_long_only\n"); 112*8462SApril.Chin@Sun.COM printf("#undef optopt\n"); 113*8462SApril.Chin@Sun.COM printf("#define optopt _ast_optopt\n"); 114*8462SApril.Chin@Sun.COM printf("#undef optarg\n"); 115*8462SApril.Chin@Sun.COM printf("#define optarg _ast_optarg\n"); 116*8462SApril.Chin@Sun.COM printf("#undef optind\n"); 117*8462SApril.Chin@Sun.COM printf("#define optind _ast_optind\n"); 118*8462SApril.Chin@Sun.COM printf("#undef opterr\n"); 119*8462SApril.Chin@Sun.COM printf("#define opterr _ast_opterr\n"); 1204887Schin #endif 1214887Schin printf("#undef getwd\n"); 1224887Schin printf("#define getwd _ast_getwd\n"); 1234887Schin printf("extern char* getwd(char*);\n"); 1244887Schin printf("#undef glob\n"); 1254887Schin printf("#define glob _ast_glob\n"); 1264887Schin printf("#undef globfree\n"); 1274887Schin printf("#define globfree _ast_globfree\n"); 1284887Schin printf("#undef memdup\n"); 1294887Schin printf("#define memdup _ast_memdup\n"); 1304887Schin printf("#undef memfatal\n"); 1314887Schin printf("#define memfatal _ast_memfatal\n"); 1324887Schin printf("#undef memhash\n"); 1334887Schin printf("#define memhash _ast_memhash\n"); 1344887Schin printf("#undef memsum\n"); 1354887Schin printf("#define memsum _ast_memsum\n"); 1364887Schin printf("#undef mkstemp\n"); 1374887Schin printf("#define mkstemp _ast_mkstemp\n"); 1384887Schin printf("extern int mkstemp(char*);\n"); 1394887Schin printf("#undef mktemp\n"); 1404887Schin printf("#define mktemp _ast_mktemp\n"); 1414887Schin printf("extern char* mktemp(char*);\n"); 1424887Schin printf("#undef mktime\n"); 1434887Schin printf("#define mktime _ast_mktime\n"); 1444887Schin printf("#undef nftw\n"); 1454887Schin printf("#define nftw _ast_nftw\n"); 146*8462SApril.Chin@Sun.COM printf("#undef optctx\n"); 147*8462SApril.Chin@Sun.COM printf("#define optctx _ast_optctx\n"); 1484887Schin printf("#undef optesc\n"); 1494887Schin printf("#define optesc _ast_optesc\n"); 1504887Schin printf("#undef optget\n"); 1514887Schin printf("#define optget _ast_optget\n"); 1524887Schin printf("#undef opthelp\n"); 1534887Schin printf("#define opthelp _ast_opthelp\n"); 1544887Schin printf("#undef optjoin\n"); 1554887Schin printf("#define optjoin _ast_optjoin\n"); 1564887Schin printf("#undef optstr\n"); 1574887Schin printf("#define optstr _ast_optstr\n"); 1584887Schin printf("#undef optusage\n"); 1594887Schin printf("#define optusage _ast_optusage\n"); 1604887Schin printf("#undef pathaccess\n"); 1614887Schin printf("#define pathaccess _ast_pathaccess\n"); 1624887Schin printf("#undef pathbin\n"); 1634887Schin printf("#define pathbin _ast_pathbin\n"); 1644887Schin printf("#undef pathcanon\n"); 1654887Schin printf("#define pathcanon _ast_pathcanon\n"); 1664887Schin printf("#undef pathcat\n"); 1674887Schin printf("#define pathcat _ast_pathcat\n"); 1684887Schin printf("#undef pathcd\n"); 1694887Schin printf("#define pathcd _ast_pathcd\n"); 1704887Schin printf("#undef pathcheck\n"); 1714887Schin printf("#define pathcheck _ast_pathcheck\n"); 1724887Schin printf("#undef pathexists\n"); 1734887Schin printf("#define pathexists _ast_pathexists\n"); 1744887Schin printf("#undef pathfind\n"); 1754887Schin printf("#define pathfind _ast_pathfind\n"); 1764887Schin printf("#undef pathgetlink\n"); 1774887Schin printf("#define pathgetlink _ast_pathgetlink\n"); 1784887Schin printf("#undef pathinclude\n"); 1794887Schin printf("#define pathinclude _ast_pathinclude\n"); 1804887Schin printf("#undef pathkey\n"); 1814887Schin printf("#define pathkey _ast_pathkey\n"); 1824887Schin printf("#undef pathnative\n"); 1834887Schin printf("#define pathnative _ast_pathnative\n"); 1844887Schin printf("#undef pathpath\n"); 1854887Schin printf("#define pathpath _ast_pathpath\n"); 1864887Schin printf("#undef pathposix\n"); 1874887Schin printf("#define pathposix _ast_pathposix\n"); 1884887Schin printf("#undef pathprobe\n"); 1894887Schin printf("#define pathprobe _ast_pathprobe\n"); 1904887Schin printf("#undef pathrepl\n"); 1914887Schin printf("#define pathrepl _ast_pathrepl\n"); 1924887Schin printf("#undef pathsetlink\n"); 1934887Schin printf("#define pathsetlink _ast_pathsetlink\n"); 1944887Schin printf("#undef pathshell\n"); 1954887Schin printf("#define pathshell _ast_pathshell\n"); 1964887Schin printf("#undef pathstat\n"); 1974887Schin printf("#define pathstat _ast_pathstat\n"); 1984887Schin printf("#undef pathtemp\n"); 1994887Schin printf("#define pathtemp _ast_pathtemp\n"); 2004887Schin printf("#undef pathtmp\n"); 2014887Schin printf("#define pathtmp _ast_pathtmp\n"); 2024887Schin printf("#undef procclose\n"); 2034887Schin printf("#define procclose _ast_procclose\n"); 2044887Schin printf("#undef procfree\n"); 2054887Schin printf("#define procfree _ast_procfree\n"); 2064887Schin printf("#undef procopen\n"); 2074887Schin printf("#define procopen _ast_procopen\n"); 2084887Schin printf("#undef procrun\n"); 2094887Schin printf("#define procrun _ast_procrun\n"); 2104887Schin printf("#undef putenv\n"); 2114887Schin printf("#define putenv _ast_putenv\n"); 2124887Schin printf("#undef re_comp\n"); 2134887Schin printf("#define re_comp _ast_re_comp\n"); 2144887Schin printf("#undef re_exec\n"); 2154887Schin printf("#define re_exec _ast_re_exec\n"); 2164887Schin printf("#undef realpath\n"); 2174887Schin printf("#define realpath _ast_realpath\n"); 2184887Schin printf("extern char* realpath(const char*, char*);\n"); 2194887Schin printf("#undef regaddclass\n"); 2204887Schin printf("#define regaddclass _ast_regaddclass\n"); 2214887Schin printf("#undef regalloc\n"); 2224887Schin printf("#define regalloc _ast_regalloc\n"); 2234887Schin printf("#undef regcache\n"); 2244887Schin printf("#define regcache _ast_regcache\n"); 2254887Schin printf("#undef regclass\n"); 2264887Schin printf("#define regclass _ast_regclass\n"); 2274887Schin printf("#undef regcmp\n"); 2284887Schin printf("#define regcmp _ast_regcmp\n"); 2294887Schin printf("#undef regcollate\n"); 2304887Schin printf("#define regcollate _ast_regcollate\n"); 2314887Schin printf("#undef regcomb\n"); 2324887Schin printf("#define regcomb _ast_regcomb\n"); 2334887Schin printf("#undef regcomp\n"); 2344887Schin printf("#define regcomp _ast_regcomp\n"); 2354887Schin printf("#undef regdecomp\n"); 2364887Schin printf("#define regdecomp _ast_regdecomp\n"); 2374887Schin printf("#undef regdup\n"); 2384887Schin printf("#define regdup _ast_regdup\n"); 2394887Schin printf("#undef regerror\n"); 2404887Schin printf("#define regerror _ast_regerror\n"); 2414887Schin printf("#undef regex\n"); 2424887Schin printf("#define regex _ast_regex\n"); 2434887Schin printf("#undef regexec\n"); 2444887Schin printf("#define regexec _ast_regexec\n"); 2454887Schin printf("#undef regfatal\n"); 2464887Schin printf("#define regfatal _ast_regfatal\n"); 2474887Schin printf("#undef regfatalpat\n"); 2484887Schin printf("#define regfatalpat _ast_regfatalpat\n"); 2494887Schin printf("#undef regfree\n"); 2504887Schin printf("#define regfree _ast_regfree\n"); 2514887Schin printf("#undef regncomp\n"); 2524887Schin printf("#define regncomp _ast_regncomp\n"); 2534887Schin printf("#undef regnexec\n"); 2544887Schin printf("#define regnexec _ast_regnexec\n"); 2554887Schin printf("#undef regrecord\n"); 2564887Schin printf("#define regrecord _ast_regrecord\n"); 2574887Schin printf("#undef regrexec\n"); 2584887Schin printf("#define regrexec _ast_regrexec\n"); 2594887Schin printf("#undef regstat\n"); 2604887Schin printf("#define regstat _ast_regstat\n"); 2614887Schin printf("#undef regsub\n"); 2624887Schin printf("#define regsub _ast_regsub\n"); 2634887Schin printf("#undef regsubcomp\n"); 2644887Schin printf("#define regsubcomp _ast_regsubcomp\n"); 2654887Schin printf("#undef regsubexec\n"); 2664887Schin printf("#define regsubexec _ast_regsubexec\n"); 2674887Schin printf("#undef regsubflags\n"); 2684887Schin printf("#define regsubflags _ast_regsubflags\n"); 2694887Schin printf("#undef regsubfree\n"); 2704887Schin printf("#define regsubfree _ast_regsubfree\n"); 2714887Schin printf("#undef remove\n"); 2724887Schin printf("#define remove _ast_remove\n"); 2734887Schin printf("extern int remove(const char*);\n"); 2744887Schin printf("#undef resolvepath\n"); 2754887Schin printf("#define resolvepath _ast_resolvepath\n"); 276*8462SApril.Chin@Sun.COM printf("extern int resolvepath(const char*, char*, size_t);\n"); 2774887Schin printf("#undef setenv\n"); 2784887Schin printf("#define setenv _ast_setenv\n"); 2794887Schin printf("extern int setenv(const char*, const char*, int);\n"); 2804887Schin printf("#undef setenviron\n"); 2814887Schin printf("#define setenviron _ast_setenviron\n"); 2824887Schin printf("#undef sigcritical\n"); 2834887Schin printf("#define sigcritical _ast_sigcritical\n"); 2844887Schin printf("#undef signal\n"); 2854887Schin printf("#define signal _ast_signal\n"); 2864887Schin printf("#undef sigunblock\n"); 2874887Schin printf("#define sigunblock _ast_sigunblock\n"); 2884887Schin printf("#undef stracmp\n"); 2894887Schin printf("#define stracmp _ast_stracmp\n"); 2904887Schin printf("#undef strcopy\n"); 2914887Schin printf("#define strcopy _ast_strcopy\n"); 2924887Schin printf("#undef strelapsed\n"); 2934887Schin printf("#define strelapsed _ast_strelapsed\n"); 2944887Schin printf("#undef stresc\n"); 2954887Schin printf("#define stresc _ast_stresc\n"); 2964887Schin printf("#undef streval\n"); 2974887Schin printf("#define streval _ast_streval\n"); 2984887Schin printf("#undef strexpr\n"); 2994887Schin printf("#define strexpr _ast_strexpr\n"); 3004887Schin printf("#undef strftime\n"); 3014887Schin printf("#define strftime _ast_strftime\n"); 3024887Schin printf("#undef strgid\n"); 3034887Schin printf("#define strgid _ast_strgid\n"); 3044887Schin printf("#undef strgrpmatch\n"); 3054887Schin printf("#define strgrpmatch _ast_strgrpmatch\n"); 3064887Schin printf("#undef strhash\n"); 3074887Schin printf("#define strhash _ast_strhash\n"); 3084887Schin printf("#undef strkey\n"); 3094887Schin printf("#define strkey _ast_strkey\n"); 3104887Schin printf("#undef strlcat\n"); 3114887Schin printf("#define strlcat _ast_strlcat\n"); 3124887Schin printf("extern size_t strlcat(char*, const char*, size_t);\n"); 3134887Schin printf("#undef strlcpy\n"); 3144887Schin printf("#define strlcpy _ast_strlcpy\n"); 3154887Schin printf("extern size_t strlcpy(char*, const char*, size_t);\n"); 3164887Schin printf("#undef strlook\n"); 3174887Schin printf("#define strlook _ast_strlook\n"); 3184887Schin printf("#undef strmatch\n"); 3194887Schin printf("#define strmatch _ast_strmatch\n"); 3204887Schin #endif 3214887Schin #if _map_libc || _lib_strmode 3224887Schin printf("#undef strmode\n"); 3234887Schin printf("#define strmode _ast_strmode\n"); 3244887Schin #endif 3254887Schin #if _map_libc 3264887Schin printf("#undef strnacmp\n"); 3274887Schin printf("#define strnacmp _ast_strnacmp\n"); 3284887Schin printf("#undef strncopy\n"); 3294887Schin printf("#define strncopy _ast_strncopy\n"); 3304887Schin printf("#undef strntod\n"); 3314887Schin printf("#define strntod _ast_strntod\n"); 3324887Schin printf("#undef strntol\n"); 3334887Schin printf("#define strntol _ast_strntol\n"); 3344887Schin printf("#undef strntold\n"); 3354887Schin printf("#define strntold _ast_strntold\n"); 3364887Schin printf("#undef strntoll\n"); 3374887Schin printf("#define strntoll _ast_strntoll\n"); 3384887Schin printf("#undef strntoul\n"); 3394887Schin printf("#define strntoul _ast_strntoul\n"); 3404887Schin printf("#undef strntoull\n"); 3414887Schin printf("#define strntoull _ast_strntoull\n"); 3424887Schin printf("#undef stropt\n"); 3434887Schin printf("#define stropt _ast_stropt\n"); 3444887Schin printf("#undef strperm\n"); 3454887Schin printf("#define strperm _ast_strperm\n"); 3464887Schin printf("#undef strpsearch\n"); 3474887Schin printf("#define strpsearch _ast_strpsearch\n"); 3484887Schin #if !_lib_strptime 3494887Schin printf("#undef strptime\n"); 3504887Schin printf("#define strptime _ast_strptime\n"); 3514887Schin #endif 3524887Schin printf("#undef strsearch\n"); 3534887Schin printf("#define strsearch _ast_strsearch\n"); 3544887Schin printf("#undef strsort\n"); 3554887Schin printf("#define strsort _ast_strsort\n"); 3564887Schin printf("#undef strsubmatch\n"); 3574887Schin printf("#define strsubmatch _ast_strsubmatch\n"); 3584887Schin printf("#undef strsum\n"); 3594887Schin printf("#define strsum _ast_strsum\n"); 3604887Schin printf("#undef strtape\n"); 3614887Schin printf("#define strtape _ast_strtape\n"); 3624887Schin printf("#undef strtoip4\n"); 3634887Schin printf("#define strtoip4 _ast_strtoip4\n"); 3644887Schin printf("#undef strton\n"); 3654887Schin printf("#define strton _ast_strton\n"); 3664887Schin printf("#undef strtonll\n"); 3674887Schin printf("#define strtonll _ast_strtonll\n"); 3684887Schin printf("#undef struid\n"); 3694887Schin printf("#define struid _ast_struid\n"); 3704887Schin printf("#undef struniq\n"); 3714887Schin printf("#define struniq _ast_struniq\n"); 3724887Schin printf("#undef system\n"); 3734887Schin printf("#define system _ast_system\n"); 3744887Schin printf("extern int system(const char*);\n"); 3754887Schin printf("#undef tempnam\n"); 3764887Schin printf("#define tempnam _ast_tempnam\n"); 3774887Schin printf("extern char* tempnam(const char*, const char*);\n"); 3784887Schin printf("#undef tmpnam\n"); 3794887Schin printf("#define tmpnam _ast_tmpnam\n"); 3804887Schin printf("extern char* tmpnam(char*);\n"); 3814887Schin printf("#undef touch\n"); 3824887Schin printf("#define touch _ast_touch\n"); 3834887Schin printf("#undef wordexp\n"); 3844887Schin printf("#define wordexp _ast_wordexp\n"); 3854887Schin printf("#undef wordfree\n"); 3864887Schin printf("#define wordfree _ast_wordfree\n"); 3874887Schin printf("#undef unsetenv\n"); 3884887Schin printf("#define unsetenv _ast_unsetenv\n"); 3894887Schin #endif 3904887Schin #if _std_malloc 3914887Schin printf("\n"); 3924887Schin printf("/* no local malloc override */\n"); 3934887Schin printf("#define _std_malloc 1\n"); 3944887Schin #else 3954887Schin #if _map_malloc 3964887Schin printf("\n"); 3974887Schin printf("/* cannot override local malloc */\n"); 3984887Schin printf("#define _map_malloc 1\n"); 3994887Schin printf("#undef calloc\n"); 4004887Schin printf("#define calloc _ast_calloc\n"); 4014887Schin printf("extern void* calloc(size_t, size_t);\n"); 4024887Schin printf("#undef cfree\n"); 4034887Schin printf("#define cfree _ast_cfree\n"); 4044887Schin printf("extern void cfree(void*);\n"); 4054887Schin printf("#undef free\n"); 4064887Schin printf("#define free _ast_free\n"); 4074887Schin printf("extern void free(void*);\n"); 4084887Schin #if _lib_mallinfo 4094887Schin printf("#undef mallinfo\n"); 4104887Schin printf("#define mallinfo _ast_mallinfo\n"); 4114887Schin #endif 4124887Schin printf("#undef malloc\n"); 4134887Schin printf("#define malloc _ast_malloc\n"); 4144887Schin printf("extern void* malloc(size_t);\n"); 4154887Schin #if _lib_mallopt 4164887Schin printf("#undef mallopt\n"); 4174887Schin printf("#define mallopt _ast_mallopt\n"); 4184887Schin #endif 4194887Schin #if _lib_memalign 4204887Schin printf("#undef memalign\n"); 4214887Schin printf("#define memalign _ast_memalign\n"); 4224887Schin printf("extern void* memalign(size_t, size_t);\n"); 4234887Schin #endif 4244887Schin #if _lib_mstats 4254887Schin printf("#undef mstats\n"); 4264887Schin printf("#define mstats _ast_mstats\n"); 4274887Schin #endif 4284887Schin #if _lib_pvalloc 4294887Schin printf("#undef pvalloc\n"); 4304887Schin printf("#define pvalloc _ast_pvalloc\n"); 4314887Schin #endif 4324887Schin printf("#undef realloc\n"); 4334887Schin printf("#define realloc _ast_realloc\n"); 4344887Schin printf("extern void* realloc(void*, size_t);\n"); 4354887Schin printf("#undef strdup\n"); 4364887Schin printf("#define strdup _ast_strdup\n"); 4374887Schin printf("extern char* strdup(const char*);\n"); 4384887Schin #if _lib_valloc 4394887Schin printf("#undef valloc\n"); 4404887Schin printf("#define valloc _ast_valloc\n"); 4414887Schin printf("extern void* valloc(size_t);\n"); 4424887Schin #endif 4434887Schin #endif 4444887Schin #endif 4454887Schin 4464887Schin /* 4474887Schin * overriding <stdlib.h> strto*() is problematic to say the least 4484887Schin */ 4494887Schin 4504887Schin #if _map_libc || _std_strtol 4514887Schin #if !__CYGWIN__ 4524887Schin printf("#undef strtol\n"); 4534887Schin printf("#define strtol _ast_strtol\n"); 4544887Schin printf("#undef strtoul\n"); 4554887Schin printf("#define strtoul _ast_strtoul\n"); 4564887Schin #endif 4574887Schin printf("#undef strtoll\n"); 4584887Schin printf("#define strtoll _ast_strtoll\n"); 4594887Schin printf("#undef strtoull\n"); 4604887Schin printf("#define strtoull _ast_strtoull\n"); 4614887Schin #endif 4624887Schin #if _map_libc || _std_strtod 4634887Schin printf("#undef strtod\n"); 4644887Schin printf("#define strtod _ast_strtod\n"); 4654887Schin #endif 4664887Schin #if _map_libc || _std_strtold 4674887Schin printf("#undef strtold\n"); 4684887Schin printf("#define strtold _ast_strtold\n"); 4694887Schin #endif 4704887Schin #if !__CYGWIN__ 4714887Schin #if _npt_strtol || _map_libc || _std_strtol 4724887Schin #if _npt_strtol && !_map_libc && !_std_strtol 4734887Schin printf("#ifndef _ISOC99_SOURCE\n"); 4744887Schin #endif 4754887Schin printf("extern long strtol(const char*, char**, int);\n"); 4764887Schin #if _npt_strtol && !_map_libc && !_std_strtol 4774887Schin printf("#endif\n"); 4784887Schin #endif 4794887Schin #endif 4804887Schin #if _npt_strtoul || _map_libc || _std_strtol 4814887Schin #if _npt_strtoul && !_map_libc && !_std_strtol 4824887Schin printf("#ifndef _ISOC99_SOURCE\n"); 4834887Schin #endif 4844887Schin printf("extern unsigned long strtoul(const char*, char**, int);\n"); 4854887Schin #if _npt_strtoul && !_map_libc && !_std_strtol 4864887Schin printf("#endif\n"); 4874887Schin #endif 4884887Schin #endif 4894887Schin #endif 4904887Schin #if _npt_strtod || _map_libc || _std_strtod 4914887Schin #if _npt_strtod && !_map_libc && !_std_strtod 4924887Schin printf("#ifndef _ISOC99_SOURCE\n"); 4934887Schin #endif 4944887Schin printf("extern double strtod(const char*, char**);\n"); 4954887Schin #if _npt_strtod && !_map_libc && !_std_strtod 4964887Schin printf("#endif\n"); 4974887Schin #endif 4984887Schin #endif 4994887Schin printf("#if !_UWIN\n"); 5004887Schin printf("#undef extern\n"); 5014887Schin printf("#endif\n"); 5024887Schin #if _npt_strtold || _map_libc || _std_strtold 5034887Schin #if _npt_strtold && !_map_libc && !_std_strtold 5044887Schin printf("#ifndef _ISOC99_SOURCE\n"); 5054887Schin #endif 5064887Schin printf("extern _ast_fltmax_t strtold(const char*, char**);\n"); 5074887Schin #if _npt_strtold && !_map_libc && !_std_strtold 5084887Schin printf("#endif\n"); 5094887Schin #endif 5104887Schin #endif 5114887Schin printf("#undef extern\n"); 5124887Schin #if _npt_strtoll || _map_libc || _std_strtol 5134887Schin #if _npt_strtoll && !_map_libc && !_std_strtol 5144887Schin printf("#ifndef _ISOC99_SOURCE\n"); 5154887Schin #endif 5164887Schin printf("extern _ast_intmax_t strtoll(const char*, char**, int);\n"); 5174887Schin #if _npt_strtoll && !_map_libc && !_std_strtol 5184887Schin printf("#endif\n"); 5194887Schin #endif 5204887Schin #endif 5214887Schin #if _npt_strtoull || _map_libc || _std_strtol 5224887Schin #if _npt_strtoull && !_map_libc && !_std_strtol 5234887Schin printf("#ifndef _ISOC99_SOURCE\n"); 5244887Schin #endif 5254887Schin printf("extern unsigned _ast_intmax_t strtoull(const char*, char**, int);\n"); 5264887Schin #if _npt_strtoull && !_map_libc && !_std_strtoul 5274887Schin printf("#endif\n"); 5284887Schin #endif 5294887Schin #endif 5304887Schin printf("\n"); 5314887Schin printf("#undef extern\n"); 5324887Schin return 0; 5334887Schin } 534