/* Copyright (c) 1993 Xerox Corporation. All rights reserved. */ /* $Id$ $Date$ * * PCR stdlib.h ANSI C 4.10 */ /* Chauser, October 28, 1993 3:29 pm PDT */ #ifndef __PCR_stdlib_h #define __PCR_stdlib_h 1 #include /* * 4.10.1 String conversion * * Not overridden: atof strtod */ extern int PCR_atoi(const char *s); extern long PCR_atol(const char *s); extern long PCR_strtol(const char *s, char **endp, int base); extern unsigned long PCR_strtoul(const char *s, char **endp, int base); #ifndef PCR_NO_RENAME #undef atoi #define atoi PCR_atoi #undef atol #define atol PCR_atol #undef strtol #define strtol PCR_strtol #undef strtoul #define strtoul PCR_strtoul #endif /* !PCR_NO_RENAME */ /* * 4.10.2 Random Numbers */ extern int PCR_rand(void); extern void PCR_srand(unsigned int seed); #ifndef PCR_NO_RENAME #undef rand #define rand PCR_rand #undef srand #define srand PCR_srand #endif /* !PCR_NO_RENAME */ /* * 4.10.3 Memory Management */ #ifndef PCR_calloc extern void *PCR_calloc(size_t nmemb, size_t size); #endif #ifndef PCR_free extern void PCR_free(void *ptr); #endif #ifndef PCR_malloc extern void *PCR_malloc(size_t size); #endif #ifndef PCR_realloc extern void *PCR_realloc(void *ptr, size_t size); #endif #ifndef PCR_NO_RENAME #undef calloc #define calloc PCR_calloc #undef free #define free PCR_free #undef malloc #define malloc PCR_malloc #undef realloc #define realloc PCR_realloc #endif /* !PCR_NO_RENAME */ /* * 4.10.4 Communication with the environment */ extern void PCR_abort(void); /* per-thread */ extern int PCR_atexit(void (*func)(void)); extern void PCR_exit(int status); /* per-thread */ extern char *PCR_getenv(const char *name); extern void PCR_setenv(const char *name, const char *value); /* not ANSI */ /* * The environment is per-thread, initialized to UNIX environment * and inherited across thread fork. */ extern int PCR_system(const char *string); #ifndef PCR_NO_RENAME #undef abort #define abort PCR_abort #undef atexit #define atexit PCR_atexit #undef exit #define exit PCR_exit #undef getenv #define getenv PCR_getenv #undef system #define system PCR_system #endif /* !PCR_NO_RENAME */ /* * 4.10.5 Searching and Sorting * * Not overridden: bsearch qsort */ /* * 4.10.6 Integer Arithmetic * * Not overridden: abs div labs ldiv */ /* * 4.10.7 Multibyte characters * * Not overridden: mblen mbtowc wctomb */ /* * 4.10.8 Multibyte strings * * Not overridden: mbstowcs wcstombs */ #endif /* !__PCR_stdlib_h */ /* $Log$ */