Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
_cstdlib.h
Go to the documentation of this file.
1// -*- C++ -*-
2
30#ifndef _RWSTD_CSTDLIB_H_INCLUDED
31#define _RWSTD_CSTDLIB_H_INCLUDED
32
33
34#include <rw/_defs.h>
35
36
38
39
40#ifndef EXIT_FAILURE
41# define EXIT_FAILURE 1
42#endif
43
44#ifndef EXIT_SUCCESS
45# define EXIT_SUCCESS 0
46#endif
47
48#ifndef MB_CUR_MAX
49# define MB_CUR_MAX _RWSTD_MB_CUR_MAX
50#endif
51
52#ifndef NULL
53# define NULL 0
54#endif
55
56#ifndef RAND_MAX
57# define RAND_MAX _RWSTD_RAND_MAX
58#endif
59
60
61extern "C" {
62
63
64struct div_t
65{
66 // traditional layout (e.g., HP-UX, Linux, Solaris)
67 int quot;
68 int rem;
69};
70
71struct ldiv_t
72{
73 // traditional layout (e.g., HP-UX, Linux, Solaris)
74 long quot;
75 long rem;
76};
77
78
79#ifdef _RWSTD_SIZE_T
80typedef _RWSTD_SIZE_T size_t;
81#else
82typedef unsigned long size_t;
83#endif // _RWSTD_SIZE_T
84
85
86double atof (const char*);
87int atoi (const char*);
88long int atol (const char*);
89double strtod (const char*, char**);
90long int strtol (const char*, char**, int);
91unsigned long int strtoul (const char*, char**, int);
92int rand (void);
93void srand (unsigned int);
94void* calloc (size_t, size_t);
95void free (void*);
96void* malloc (size_t) ;
97void* realloc (void*, size_t);
98void abort (void);
99int atexit (void (*) (void));
100void exit (int);
101char* getenv (const char*);
102int system (const char*);
103void* bsearch (const void*, const void*, size_t, size_t,
104 int (*) (const void*, const void*));
105void qsort (void*, size_t, size_t, int (*) (const void *, const void *));
106int abs (int);
107div_t div (int, int);
108long int labs (long int);
109ldiv_t ldiv (long int, long int);
110int mblen (const char*, size_t);
111int mbtowc (wchar_t*, const char*, size_t);
112int wctomb (char*, wchar_t);
113size_t mbstowcs (wchar_t*, const char*, size_t);
114size_t wcstombs (char*, const wchar_t*, size_t);
115
116
117} // extern "C"
118
119#ifndef _RWSTD_NO_EXTERN_C_COMPATIBILITY
120# ifndef _RWSTD_NO_EXTERN_C_OVERLOAD
121
122 extern "C" {
123 typedef int (*__rw_compar_t)(const void*, const void*);
124 }
125
126 extern "C++" {
127
128 // 25.4, p3 of ISO/IEC 14882:1998
129 inline void*
130 bsearch (const void *__key, const void *__base, size_t __n, size_t __size,
131 int (*__cmp)(const void*, const void*))
132 {
133 return bsearch (__key, __base, __n, __size,
134 _RWSTD_REINTERPRET_CAST (__rw_compar_t, __cmp));
135 }
136
137 // 25.4, p4 of ISO/IEC 14882:1998
138 inline void
139 qsort (void *__base, size_t __n, size_t __size,
140 int (*__cmp)(const void*, const void*))
141 {
142 return _RWSTD_C::qsort (__base, __n, __size,
143 _RWSTD_REINTERPRET_CAST (__rw_compar_t, __cmp));
144 }
145
146 inline long
147 abs (long __x)
148 {
149 return labs (__x);
150 }
151
152 inline ldiv_t
153 div (long __x, long __y)
154 {
155 return ldiv (__x, __y);
156 }
157
158 } // extern "C++"
159
160# endif // _RWSTD_NO_EXTERN_C_OVERLOAD
161#endif // _RWSTD_NO_EXTERN_C_COMPATIBILITY
162
163
164} // namespace std
165
166
167#endif // _RWSTD_CSTDLIB_H_INCLUDED
std::allocator< C > calloc
T abs(T t)
ldiv_t div(T, T)
int atoi(const char *)
IMPORT_C SInt32 atexit(Void(*function)(Void))
IMPORT_C SInt32 system(const Char *)
#define _RWSTD_REINTERPRET_CAST(T, x)
Definition _defs.h:535
#define _RWSTD_NAMESPACE(name)
Definition _defs.h:567
Definition json.h:5363