sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
* Definitions for common types, variables, and functions.
|
sl@0
|
16 |
*
|
sl@0
|
17 |
*
|
sl@0
|
18 |
*/
|
sl@0
|
19 |
|
sl@0
|
20 |
|
sl@0
|
21 |
|
sl@0
|
22 |
/**
|
sl@0
|
23 |
@file
|
sl@0
|
24 |
@publishedAll
|
sl@0
|
25 |
@released
|
sl@0
|
26 |
*/
|
sl@0
|
27 |
|
sl@0
|
28 |
|
sl@0
|
29 |
#ifndef _STDLIB_H_
|
sl@0
|
30 |
#ifdef __cplusplus
|
sl@0
|
31 |
extern "C" {
|
sl@0
|
32 |
#endif
|
sl@0
|
33 |
#define _STDLIB_H_
|
sl@0
|
34 |
|
sl@0
|
35 |
#include "libc/_ansi.h"
|
sl@0
|
36 |
|
sl@0
|
37 |
#define __need_size_t
|
sl@0
|
38 |
#define __need_wchar_t
|
sl@0
|
39 |
#include <stddef.h>
|
sl@0
|
40 |
|
sl@0
|
41 |
#include <sys/reent.h>
|
sl@0
|
42 |
|
sl@0
|
43 |
typedef struct
|
sl@0
|
44 |
{
|
sl@0
|
45 |
int quot; /* quotient */
|
sl@0
|
46 |
int rem; /* remainder */
|
sl@0
|
47 |
} div_t;
|
sl@0
|
48 |
|
sl@0
|
49 |
#define labs abs
|
sl@0
|
50 |
#define ldiv div
|
sl@0
|
51 |
#define ldiv_t div_t
|
sl@0
|
52 |
|
sl@0
|
53 |
#ifndef NULL
|
sl@0
|
54 |
#define NULL 0L
|
sl@0
|
55 |
#endif
|
sl@0
|
56 |
|
sl@0
|
57 |
#define EXIT_FAILURE 1
|
sl@0
|
58 |
#define EXIT_SUCCESS 0
|
sl@0
|
59 |
#define RAND_MAX 0x7fffffff
|
sl@0
|
60 |
#define MB_CUR_MAX 3
|
sl@0
|
61 |
|
sl@0
|
62 |
/**
|
sl@0
|
63 |
Workaround a built-in prototype in MSVC 5.0
|
sl@0
|
64 |
*/
|
sl@0
|
65 |
#define atexit _epoc32_atexit
|
sl@0
|
66 |
IMPORT_C int _epoc32_atexit (void (*_func)(void));
|
sl@0
|
67 |
|
sl@0
|
68 |
#ifdef EKA2
|
sl@0
|
69 |
IMPORT_C void abort (void);
|
sl@0
|
70 |
#else
|
sl@0
|
71 |
IMPORT_C void abort (void);
|
sl@0
|
72 |
#endif
|
sl@0
|
73 |
|
sl@0
|
74 |
IMPORT_C int abs (int);
|
sl@0
|
75 |
IMPORT_C double atof (const char *_nptr) __SOFTFP;
|
sl@0
|
76 |
IMPORT_C int atoi (const char *_nptr);
|
sl@0
|
77 |
|
sl@0
|
78 |
#define atol atoi
|
sl@0
|
79 |
IMPORT_C void* bsearch (const void * _key,
|
sl@0
|
80 |
const void * _base,
|
sl@0
|
81 |
size_t _nmemb,
|
sl@0
|
82 |
size_t _size,
|
sl@0
|
83 |
int (*_compar)(const void *, const void *));
|
sl@0
|
84 |
IMPORT_C void* calloc (size_t _nmemb, size_t _size);
|
sl@0
|
85 |
IMPORT_C div_t div (int _numer, int _denom);
|
sl@0
|
86 |
IMPORT_C void exit (int _status) _ATTRIBUTE((noreturn));
|
sl@0
|
87 |
IMPORT_C void free (void *);
|
sl@0
|
88 |
IMPORT_C char* getenv (const char *_string);
|
sl@0
|
89 |
IMPORT_C wchar_t* wgetenv (const wchar_t *_string);
|
sl@0
|
90 |
IMPORT_C void* malloc (size_t _size);
|
sl@0
|
91 |
|
sl@0
|
92 |
IMPORT_C int mbtowc (wchar_t *pwc, const char *s, size_t n);
|
sl@0
|
93 |
IMPORT_C int wctomb (char *s, wchar_t wc);
|
sl@0
|
94 |
IMPORT_C int mbstowcs (wchar_t *pwc, const char *s, size_t n);
|
sl@0
|
95 |
IMPORT_C int wcstombs (char *s, const wchar_t *pwc, size_t n);
|
sl@0
|
96 |
IMPORT_C int mblen (const char * string, size_t size);
|
sl@0
|
97 |
|
sl@0
|
98 |
IMPORT_C void qsort (void * _base, size_t _nmemb, size_t _size, int(*_compar)(const void *, const void *));
|
sl@0
|
99 |
IMPORT_C int rand (void);
|
sl@0
|
100 |
IMPORT_C void* realloc (void * _r, size_t _size);
|
sl@0
|
101 |
IMPORT_C void srand (unsigned _seed);
|
sl@0
|
102 |
IMPORT_C double strtod (const char *_n, char **_end_PTR) __SOFTFP;
|
sl@0
|
103 |
IMPORT_C long strtol (const char *_n, char **_end_PTR, int _base);
|
sl@0
|
104 |
IMPORT_C unsigned long strtoul (const char *_n_PTR, char **_end_PTR, int _base);
|
sl@0
|
105 |
IMPORT_C int system (const char *_string);
|
sl@0
|
106 |
IMPORT_C int wsystem (const wchar_t *_string);
|
sl@0
|
107 |
|
sl@0
|
108 |
/**
|
sl@0
|
109 |
not STRICT ANSI, but available anyway...
|
sl@0
|
110 |
*/
|
sl@0
|
111 |
IMPORT_C int setenv (const char *_string, const char *_value, int _overwrite);
|
sl@0
|
112 |
IMPORT_C void unsetenv (const char *_name);
|
sl@0
|
113 |
IMPORT_C int wsetenv (const wchar_t *_string, const wchar_t *_value, int _overwrite);
|
sl@0
|
114 |
IMPORT_C void wunsetenv (const wchar_t *_name);
|
sl@0
|
115 |
|
sl@0
|
116 |
#ifndef _STRICT_ANSI
|
sl@0
|
117 |
float strtodf (const char *_n, char **_end_PTR);
|
sl@0
|
118 |
float atoff (const char *_nptr);
|
sl@0
|
119 |
|
sl@0
|
120 |
void cfree (void *, void *);
|
sl@0
|
121 |
int putenv (const char *_string);
|
sl@0
|
122 |
|
sl@0
|
123 |
char * gcvt (double,int,char *);
|
sl@0
|
124 |
char * gcvtf (float,int,char *);
|
sl@0
|
125 |
char * fcvt (double,int,int *,int *);
|
sl@0
|
126 |
char * fcvtf (float, int,int *,int *);
|
sl@0
|
127 |
char * ecvt (double, int,int *,int *);
|
sl@0
|
128 |
char * ecvtbuf (double, int, int*, int*, char *);
|
sl@0
|
129 |
char * fcvtbuf (double, int, int*, int*, char *);
|
sl@0
|
130 |
char * ecvtf (float, int,int *,int *);
|
sl@0
|
131 |
char * dtoa (double, int, int, int *, int*, char**);
|
sl@0
|
132 |
#endif /* ! _STRICT_ANSI */
|
sl@0
|
133 |
|
sl@0
|
134 |
/* FIX THIS: 4.10.7: Multibyte character functions are missing. */
|
sl@0
|
135 |
|
sl@0
|
136 |
#ifdef __cplusplus
|
sl@0
|
137 |
}
|
sl@0
|
138 |
#endif
|
sl@0
|
139 |
#endif /* _STDLIB_H_ */
|