| 1 | /*- |
| 2 | * Copyright (c) 1990 The Regents of the University of California. |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * %sccs.include.redist.c% |
| 6 | * |
| 7 | * @(#)stdlib.h 5.3 (Berkeley) %G% |
| 8 | */ |
| 9 | |
| 10 | #ifndef _STDLIB_H_ |
| 11 | #define _STDLIB_H_ |
| 12 | #include <machine/machtypes.h> |
| 13 | |
| 14 | #ifdef _SIZE_T_ |
| 15 | typedef _SIZE_T_ size_t; |
| 16 | #undef _SIZE_T_ |
| 17 | #endif |
| 18 | |
| 19 | #ifdef _WCHAR_T_ |
| 20 | typedef _WCHAR_T_ wchar_t; |
| 21 | #undef _WCHAR_T_ |
| 22 | #endif |
| 23 | |
| 24 | typedef struct { |
| 25 | int quot; /* quotient */ |
| 26 | int rem; /* remainder */ |
| 27 | } div_t; |
| 28 | typedef struct { |
| 29 | long quot; /* quotient */ |
| 30 | long rem; /* remainder */ |
| 31 | } ldiv_t; |
| 32 | |
| 33 | #define EXIT_FAILURE 1 |
| 34 | #define EXIT_SUCCESS 0 |
| 35 | |
| 36 | #define RAND_MAX 0x7ffffffff |
| 37 | |
| 38 | #define MB_CUR_MAX 1 /* XXX */ |
| 39 | |
| 40 | #if __STDC__ || c_plusplus |
| 41 | |
| 42 | void abort(void); |
| 43 | int abs(int); |
| 44 | int atexit(void (*_func)(void)); |
| 45 | double atof(const char *_nptr); |
| 46 | int atoi(const char *_nptr); |
| 47 | long atol(const char *_nptr); |
| 48 | void *bsearch(const void *_key, const void *_base, size_t _nmemb, |
| 49 | size_t _size, int (*_compar)(const void *, const void *)); |
| 50 | void *calloc(size_t _nmemb, size_t _size); |
| 51 | div_t div(int _numer, int _denom); |
| 52 | void exit(int _status); |
| 53 | void free(void *_ptr); |
| 54 | char *getenv(const char *_string); |
| 55 | long labs(long); |
| 56 | ldiv_t ldiv(long _numer, long _denom); |
| 57 | void *malloc(size_t _size); |
| 58 | void qsort(void *_base, size_t _nmemb, size_t _size, |
| 59 | int (*_compar)(const void *, const void *)); |
| 60 | int rand(void); |
| 61 | void *realloc(void *_ptr, size_t _size); |
| 62 | void srand(unsigned _seed); |
| 63 | long strtol(const char *_nptr, char **_endptr, int _base); |
| 64 | unsigned long |
| 65 | strtoul(const char *_nptr, char **_endptr, int _base); |
| 66 | int system(const char *_string); |
| 67 | |
| 68 | #ifndef _ANSI_SOURCE |
| 69 | void cfree(void *_ptr); |
| 70 | int putenv(const char *_string); |
| 71 | int setenv(const char *_string, const char *_value, int _overwrite); |
| 72 | #endif |
| 73 | |
| 74 | #ifdef NOT_YET_IMPLEMENTED |
| 75 | int mblen(const char *_s, size_t _n); |
| 76 | size_t mbstowcs(wchar_t *_pwcs, const char *_s, size_t _n); |
| 77 | int wctomb(char *_s, wchar_t _wchar); |
| 78 | int mbtowc(wchar_t *_pwc, const char *_s, size_t _n); |
| 79 | double strtod(const char *_nptr, char **_endptr); |
| 80 | size_t wcstombs(char *_s, const wchar_t *_pwcs, size_t _n); |
| 81 | #endif |
| 82 | |
| 83 | #else |
| 84 | |
| 85 | void abort(); |
| 86 | int abs(); |
| 87 | int atexit(); |
| 88 | double atof(); |
| 89 | int atoi(); |
| 90 | long atol(); |
| 91 | void *bsearch(); |
| 92 | void *calloc(); |
| 93 | div_t div(); |
| 94 | void exit(); |
| 95 | void free(); |
| 96 | char *getenv(); |
| 97 | long labs(); |
| 98 | ldiv_t ldiv(); |
| 99 | void *malloc(); |
| 100 | void qsort(); |
| 101 | int rand(); |
| 102 | void *realloc(); |
| 103 | void srand(); |
| 104 | long strtol(); |
| 105 | unsigned long |
| 106 | strtoul(); |
| 107 | int system(); |
| 108 | |
| 109 | #ifndef _ANSI_SOURCE |
| 110 | void cfree(); |
| 111 | int putenv(); |
| 112 | int setenv(); |
| 113 | #endif |
| 114 | |
| 115 | #ifdef NOT_YET_IMPLEMENTED |
| 116 | int mblen(); |
| 117 | size_t mbstowcs(); |
| 118 | int wctomb(); |
| 119 | int mbtowc(); |
| 120 | double strtod(); |
| 121 | size_t wcstombs(); |
| 122 | #endif |
| 123 | |
| 124 | #endif |
| 125 | |
| 126 | #endif /* _STDLIB_H_ */ |