First public contribution.
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Definitions for common types, variables, and functions.
35 #include "libc/_ansi.h"
38 #define __need_wchar_t
41 #include <sys/reent.h>
45 int quot; /* quotient */
46 int rem; /* remainder */
57 #define EXIT_FAILURE 1
58 #define EXIT_SUCCESS 0
59 #define RAND_MAX 0x7fffffff
63 Workaround a built-in prototype in MSVC 5.0
65 #define atexit _epoc32_atexit
66 IMPORT_C int _epoc32_atexit (void (*_func)(void));
69 IMPORT_C void abort (void);
71 IMPORT_C void abort (void);
74 IMPORT_C int abs (int);
75 IMPORT_C double atof (const char *_nptr) __SOFTFP;
76 IMPORT_C int atoi (const char *_nptr);
79 IMPORT_C void* bsearch (const void * _key,
83 int (*_compar)(const void *, const void *));
84 IMPORT_C void* calloc (size_t _nmemb, size_t _size);
85 IMPORT_C div_t div (int _numer, int _denom);
86 IMPORT_C void exit (int _status) _ATTRIBUTE((noreturn));
87 IMPORT_C void free (void *);
88 IMPORT_C char* getenv (const char *_string);
89 IMPORT_C wchar_t* wgetenv (const wchar_t *_string);
90 IMPORT_C void* malloc (size_t _size);
92 IMPORT_C int mbtowc (wchar_t *pwc, const char *s, size_t n);
93 IMPORT_C int wctomb (char *s, wchar_t wc);
94 IMPORT_C int mbstowcs (wchar_t *pwc, const char *s, size_t n);
95 IMPORT_C int wcstombs (char *s, const wchar_t *pwc, size_t n);
96 IMPORT_C int mblen (const char * string, size_t size);
98 IMPORT_C void qsort (void * _base, size_t _nmemb, size_t _size, int(*_compar)(const void *, const void *));
99 IMPORT_C int rand (void);
100 IMPORT_C void* realloc (void * _r, size_t _size);
101 IMPORT_C void srand (unsigned _seed);
102 IMPORT_C double strtod (const char *_n, char **_end_PTR) __SOFTFP;
103 IMPORT_C long strtol (const char *_n, char **_end_PTR, int _base);
104 IMPORT_C unsigned long strtoul (const char *_n_PTR, char **_end_PTR, int _base);
105 IMPORT_C int system (const char *_string);
106 IMPORT_C int wsystem (const wchar_t *_string);
109 not STRICT ANSI, but available anyway...
111 IMPORT_C int setenv (const char *_string, const char *_value, int _overwrite);
112 IMPORT_C void unsetenv (const char *_name);
113 IMPORT_C int wsetenv (const wchar_t *_string, const wchar_t *_value, int _overwrite);
114 IMPORT_C void wunsetenv (const wchar_t *_name);
117 float strtodf (const char *_n, char **_end_PTR);
118 float atoff (const char *_nptr);
120 void cfree (void *, void *);
121 int putenv (const char *_string);
123 char * gcvt (double,int,char *);
124 char * gcvtf (float,int,char *);
125 char * fcvt (double,int,int *,int *);
126 char * fcvtf (float, int,int *,int *);
127 char * ecvt (double, int,int *,int *);
128 char * ecvtbuf (double, int, int*, int*, char *);
129 char * fcvtbuf (double, int, int*, int*, char *);
130 char * ecvtf (float, int,int *,int *);
131 char * dtoa (double, int, int, int *, int*, char**);
132 #endif /* ! _STRICT_ANSI */
134 /* FIX THIS: 4.10.7: Multibyte character functions are missing. */
139 #endif /* _STDLIB_H_ */