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