filename | test/include/stdlib.h |
changeset | 185:6755a04c447f |
author | nkeynes |
date | Sun Jan 20 07:24:38 2008 +0000 (16 years ago) |
permissions | -rw-r--r-- |
last change | Fix broken asic_check_cleared_events() Handle changes to the event mask which may raise/clear an IRQ |
view | annotate | diff | log | raw |
1 /*
2 * stdlib.h
3 *
4 * Definitions for common types, variables, and functions.
5 */
7 #ifndef _STDLIB_H_
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 #define _STDLIB_H_
13 #include "_ansi.h"
15 #define __need_size_t
16 #define __need_wchar_t
17 #include <stddef.h>
19 #include <sys/reent.h>
21 typedef struct
22 {
23 int quot; /* quotient */
24 int rem; /* remainder */
25 } div_t;
27 typedef struct
28 {
29 long quot; /* quotient */
30 long rem; /* remainder */
31 } ldiv_t;
33 #ifndef NULL
34 #define NULL 0
35 #endif
37 #define EXIT_FAILURE 1
38 #define EXIT_SUCCESS 0
40 #define RAND_MAX 0x7fffffff
42 #if (defined(__CYGWIN__) || defined(__CYGWIN32__)) && ! defined(_COMPILING_NEWLIB)
43 extern __declspec(dllimport) int __mb_cur_max;
44 #else
45 extern int __mb_cur_max;
46 #endif
48 #define MB_CUR_MAX __mb_cur_max
50 _VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((noreturn)));
51 int _EXFUN(abs,(int));
52 int _EXFUN(atexit,(_VOID (*__func)(_VOID)));
53 double _EXFUN(atof,(const char *__nptr));
54 #ifndef __STRICT_ANSI__
55 float _EXFUN(atoff,(const char *__nptr));
56 #endif
57 int _EXFUN(atoi,(const char *__nptr));
58 long _EXFUN(atol,(const char *__nptr));
59 _PTR _EXFUN(bsearch,(const _PTR __key,
60 const _PTR __base,
61 size_t __nmemb,
62 size_t __size,
63 int _EXFUN((*_compar),(const _PTR, const _PTR))));
64 _PTR _EXFUN(calloc,(size_t __nmemb, size_t __size));
65 div_t _EXFUN(div,(int __numer, int __denom));
66 _VOID _EXFUN(exit,(int __status) _ATTRIBUTE ((noreturn)));
67 _VOID _EXFUN(free,(_PTR));
68 char * _EXFUN(getenv,(const char *__string));
69 char * _EXFUN(_getenv_r,(struct _reent *, const char *__string));
70 char * _EXFUN(_findenv,(_CONST char *, int *));
71 char * _EXFUN(_findenv_r,(struct _reent *, _CONST char *, int *));
72 long _EXFUN(labs,(long));
73 ldiv_t _EXFUN(ldiv,(long __numer, long __denom));
74 _PTR _EXFUN(malloc,(size_t __size));
75 int _EXFUN(mblen,(const char *, size_t));
76 int _EXFUN(_mblen_r,(struct _reent *, const char *, size_t, int *));
77 int _EXFUN(mbtowc,(wchar_t *, const char *, size_t));
78 int _EXFUN(_mbtowc_r,(struct _reent *, wchar_t *, const char *, size_t, int *));
79 int _EXFUN(wctomb,(char *, wchar_t));
80 int _EXFUN(_wctomb_r,(struct _reent *, char *, wchar_t, int *));
81 size_t _EXFUN(mbstowcs,(wchar_t *, const char *, size_t));
82 size_t _EXFUN(_mbstowcs_r,(struct _reent *, wchar_t *, const char *, size_t, int *));
83 size_t _EXFUN(wcstombs,(char *, const wchar_t *, size_t));
84 size_t _EXFUN(_wcstombs_r,(struct _reent *, char *, const wchar_t *, size_t, int *));
85 _VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, int(*_compar)(const _PTR, const _PTR)));
86 int _EXFUN(rand,(_VOID));
87 _PTR _EXFUN(realloc,(_PTR __r, size_t __size));
88 _VOID _EXFUN(srand,(unsigned __seed));
89 double _EXFUN(strtod,(const char *__n, char **_end_PTR));
90 #ifndef __STRICT_ANSI__
91 float _EXFUN(strtodf,(const char *__n, char **_end_PTR));
92 #endif
93 long _EXFUN(strtol,(const char *__n, char **_end_PTR, int __base));
94 unsigned long _EXFUN(strtoul,(const char *_n_PTR, char **_end_PTR, int __base));
95 unsigned long _EXFUN(_strtoul_r,(struct _reent *,const char *_n_PTR, char **_end_PTR, int __base));
96 int _EXFUN(system,(const char *__string));
98 #ifndef __STRICT_ANSI__
99 _VOID _EXFUN(cfree,(_PTR));
100 int _EXFUN(putenv,(const char *__string));
101 int _EXFUN(setenv,(const char *__string, const char *__value, int __overwrite));
102 int _EXFUN(_setenv_r,(struct _reent *, const char *__string, const char *__value, int __overwrite));
104 char * _EXFUN(gcvt,(double,int,char *));
105 char * _EXFUN(gcvtf,(float,int,char *));
106 char * _EXFUN(fcvt,(double,int,int *,int *));
107 char * _EXFUN(fcvtf,(float,int,int *,int *));
108 char * _EXFUN(ecvt,(double,int,int *,int *));
109 char * _EXFUN(ecvtbuf,(double, int, int*, int*, char *));
110 char * _EXFUN(fcvtbuf,(double, int, int*, int*, char *));
111 char * _EXFUN(ecvtf,(float,int,int *,int *));
112 char * _EXFUN(dtoa,(double, int, int, int *, int*, char**));
113 int _EXFUN(rand_r,(unsigned *__seed));
115 #ifdef __CYGWIN32__
116 char * _EXFUN(realpath,(const char *, char *));
117 void _EXFUN(unsetenv,(const char *__string));
118 int _EXFUN(random,(_VOID));
119 long _EXFUN(srandom,(unsigned __seed));
120 char * _EXFUN(ptsname, (int));
121 int _EXFUN(grantpt, (int));
122 int _EXFUN(unlockpt,(int));
123 #endif
125 #endif /* ! __STRICT_ANSI__ */
127 char * _EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**));
128 _PTR _EXFUN(_malloc_r,(struct _reent *, size_t));
129 _PTR _EXFUN(_calloc_r,(struct _reent *, size_t, size_t));
130 _VOID _EXFUN(_free_r,(struct _reent *, _PTR));
131 _PTR _EXFUN(_realloc_r,(struct _reent *, _PTR, size_t));
132 _VOID _EXFUN(_mstats_r,(struct _reent *, char *));
133 int _EXFUN(_system_r,(struct _reent *, const char *));
135 _VOID _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *));
137 #ifdef __cplusplus
138 }
139 #endif
140 #endif /* _STDLIB_H_ */
.