sync with tizen_2.0
[platform/framework/native/appfw.git] / inc / FOspCompat.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18
19
20 #ifndef _FOSP_COMPAT_H_
21 #define _FOSP_COMPAT_H_
22
23 #ifndef _GNU_SOURCE
24 #define _GNU_SOURCE
25 #endif
26
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string.h>
30 #include <wchar.h>
31 #include <ctype.h>
32 #include <stdarg.h>
33 #include <math.h>
34 #include <FOspConfig.h>
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 typedef int (*funread)(void* _cookie, char* _buf, int _n);
41 typedef int (*funwrite)(void* _cookie, const char* _buf, int _n);
42 #ifdef __LARGE64_FILES
43 typedef _fpos64_t (*funseek)(void* _cookie, _fpos64_t _off, int _whence);
44 #else
45 typedef fpos_t (*funseek)(void* _cookie, fpos_t _off, int _whence);
46 #endif
47 typedef int (*funclose)(void* _cookie);
48
49 // String functions NewlibCompatString.cpp
50 _OSP_EXPORT_ char* strlwr(char* pcStr);
51 _OSP_EXPORT_ char* strupr(char* pcStr);
52 _OSP_EXPORT_ size_t wcslcat(wchar_t * wcDst, const wchar_t * wcSrc, size_t siz);
53 _OSP_EXPORT_ size_t wcslcpy( wchar_t* wcDst,    const wchar_t* wcSrc, size_t siz);
54
55 // String functions NewlibCompatStdlib.cpp
56 _OSP_EXPORT_ float atoff(const char* pstr);
57 _OSP_EXPORT_ char* ecvtf(float fval, int ndigit, int* decpt, int* sign);
58 _OSP_EXPORT_ char* ecvtbuf(double invalue, int ndigit, int* decpt, int* sign, char* ecvt_buf);
59 _OSP_EXPORT_ char* fcvtf( float fval, int ndigit, int* decpt, int* sign);
60 _OSP_EXPORT_ char* fcvtbuf(double invalue, int ndigit, int* decpt, int* sign, char* fcvt_buf);
61 _OSP_EXPORT_ char* gcvtf( float fval, int ndigit, char* buf);
62 _OSP_EXPORT_ void* reallocf (void* pstr, unsigned int size);
63
64 // String functions NewlibCompatStdio.cpp
65 _OSP_EXPORT_ char* asnprintf(char* buf, size_t* lenp, const char* format, ...);
66 _OSP_EXPORT_ char* vasnprintf(char *buf, size_t *lenp, const char *format, va_list ap);
67 _OSP_EXPORT_ int asiprintf(char **strp,const char *fmt0, ...);
68 _OSP_EXPORT_ char * asniprintf(char *buf, size_t *lenp, const char *fmt0, ... );
69 _OSP_EXPORT_ int iprintf(const char *fmt0, ...);
70 _OSP_EXPORT_ int fiprintf(FILE * fp, const char *fmt0, ...);
71 _OSP_EXPORT_ int siprintf(char *str, const char *fmt0, ...);
72 _OSP_EXPORT_ int sniprintf(char *str, size_t size, const char *fmt0, ...);
73 _OSP_EXPORT_ int vasiprintf(char **strp, const char *fmt0, va_list ap);
74 _OSP_EXPORT_ char* vasniprintf(char *buf, size_t *lenp, const char *fmt0, va_list ap);
75 _OSP_EXPORT_ int vfiprintf(FILE * fp, const char *fmt0, va_list ap);
76 _OSP_EXPORT_ int viprintf(const char *fmt0, va_list ap);
77 _OSP_EXPORT_ int vsiprintf(char *str, const char *fmt0, va_list ap);
78 _OSP_EXPORT_ int vsniprintf(char *str, size_t size, const char *fmt0, va_list ap);
79 _OSP_EXPORT_ int diprintf(int fd, const char *fmt0, ...);
80 _OSP_EXPORT_ int siscanf( const char* str, const char* fmt0, ...);
81 _OSP_EXPORT_ int vdiprintf(int fd, const char *fmt0, va_list ap);
82 _OSP_EXPORT_ int vfiscanf(FILE *fp, const char *fmt0, va_list ap);
83 _OSP_EXPORT_ int vsiscanf(const char *str, const char *fmt0, va_list ap);
84 _OSP_EXPORT_ int fiscanf(FILE *fp, const char *fmt0, ...);
85 _OSP_EXPORT_ FILE* funopen(const void* cookie, funread readfn, funwrite writefn, funseek seekfn, funclose closefn);
86 _OSP_EXPORT_ FILE*  fropen(const void* cookie , funread readfn);
87 _OSP_EXPORT_ FILE*  fwopen(const void* cookie,funwrite writefn);
88
89 // Miscellaneous functions NewlibCompatMisc.cpp
90 #define unctrllen(ch)           __unctrllen[(ch) & 0xff]
91 _OSP_EXPORT_ extern const char __unctrllen[256];
92
93 #ifdef __cplusplus
94 }; //extern "C"
95 #endif
96
97 typedef wchar_t mchar;
98
99 namespace Tizen {
100 // Add constant which has compatible issue on Tizen
101
102 namespace Ads {
103 // Add constant which has compatible issue on Tizen::Ads
104
105 }; // Tizen::Ads
106
107 namespace App
108 {
109 // Add constant which has compatible issue on Tizen::App
110
111 }; // Tizen::App
112
113 namespace Base
114 {
115 // Add constant which has compatible issue on Tizen::Base
116
117 template<class Type> class Buffer;
118
119 typedef Buffer <mchar> McharBuffer;
120
121 }; // Tizen::Base
122
123 namespace Commerce
124 {
125 // Add constant which has compatible issue on Tizen::Commerce
126
127 }; // Tizen::Commerce
128
129 namespace Content
130 {
131 // Add constant which has compatible issue on Tizen::Content
132
133 }; // Tizen::Content
134
135 namespace Graphics
136 {
137 // Add constant which has compatible issue on Tizen::Graphics
138
139 }; // Tizen::Graphics
140
141 namespace Io
142 {
143 // Add constant which has compatible issue on Tizen::Io
144
145 }; // Tizen::Io
146
147 namespace Locales
148 {
149 // Add constant which has compatible issue on Tizen::Locales
150
151 }; // Tizen::Locales
152
153 namespace Locations
154 {
155 // Add constant which has compatible issue on Tizen::Locations
156
157 }; // Tizen::Locations
158
159 namespace Media
160 {
161 // Add constant which has compatible issue on Tizen::Media
162
163 }; // Tizen::Media
164
165 namespace Messaging
166 {
167 // Add constant which has compatible issue on Tizen::Messaging
168
169 }; // Tizen::Messaging
170
171 namespace Net
172 {
173 // Add constant which has compatible issue on Tizen::Net
174
175 namespace Sockets
176 {
177
178 static const int NET_SOCKET_INADDR_ANY = 0;
179
180 }; // Tizen::Net::Sockets
181
182 namespace Wifi
183 {
184
185 static const int WIFI_DIRECT_MAX_CONNECTED_CLIENTS = 8;
186 static const int WIFI_DIRECT_MAX_GROUP_OWNER_INTENT = 15;
187
188 }; // Tizen::Net::Wifi
189
190 }; // Tizen::Net
191
192 namespace Security
193 {
194 // Add constant which has compatible issue on Tizen::Security
195
196 }; // Tizen::Security
197
198 namespace Social
199 {
200 // Add constant which has compatible issue on Tizen::Social
201
202 }; // Tizen::Social
203
204 namespace System
205 {
206 // Add constant which has compatible issue on Tizen::System
207
208 }; // Tizen::System
209
210 namespace Telephony
211 {
212 // Add constant which has compatible issue on Tizen::Telephony
213
214 }; // Tizen::Telephony
215
216 namespace Test
217 {
218 // Add constant which has compatible issue on Tizen::Test
219
220 }; // Tizen::Test
221
222 namespace Text
223 {
224 // Add constant which has compatible issue on Tizen::Text
225
226 }; // Tizen::Text
227
228 namespace Ui
229 {
230 // Add constant which has compatible issue on Tizen::Ui
231
232 namespace Animations
233 {
234 // Add constant which has compatible issue on Tizen::Ui::Animations
235 }
236
237 namespace Controls
238 {
239 #define MIN_FLASH_VOLUME                0
240 #define MAX_FLASH_VOLUME                100
241 #define DEFAULT_FLASH_VOLUME    50
242 }
243
244 }; // Tizen::Ui
245
246 namespace Uix
247 {
248 // Add constant which has compatible issue on Tizen::Uix
249
250 }; // Tizen::Uix
251
252 namespace Web
253 {
254 // Add constant which has compatible issue on Tizen::Web
255
256 }; // Tizen::Web
257 }; // Tizen
258
259 #endif // _FOSP_COMPAT_H_