2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 #ifndef _FOSP_COMPAT_H_
20 #define _FOSP_COMPAT_H_
33 #include <FOspConfig.h>
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);
44 typedef fpos_t (*funseek)(void* _cookie, fpos_t _off, int _whence);
46 typedef int (*funclose)(void* _cookie);
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);
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);
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);
88 // Miscellaneous functions NewlibCompatMisc.cpp
89 #define unctrllen(ch) __unctrllen[(ch) & 0xff]
90 _OSP_EXPORT_ extern const char __unctrllen[256];
96 typedef wchar_t mchar;
99 // Add constant which has compatible issue on Tizen
102 // Add constant which has compatible issue on Tizen::Ads
108 // Add constant which has compatible issue on Tizen::App
114 // Add constant which has compatible issue on Tizen::Base
116 template<class Type> class Buffer;
118 typedef Buffer <mchar> McharBuffer;
124 // Add constant which has compatible issue on Tizen::Commerce
126 }; // Tizen::Commerce
130 // Add constant which has compatible issue on Tizen::Content
136 // Add constant which has compatible issue on Tizen::Graphics
138 }; // Tizen::Graphics
142 // Add constant which has compatible issue on Tizen::Io
148 // Add constant which has compatible issue on Tizen::Locales
154 // Add constant which has compatible issue on Tizen::Locations
156 }; // Tizen::Locations
160 // Add constant which has compatible issue on Tizen::Media
166 // Add constant which has compatible issue on Tizen::Messaging
168 }; // Tizen::Messaging
172 // Add constant which has compatible issue on Tizen::Net
177 static const int NET_SOCKET_INADDR_ANY = 0;
179 }; // Tizen::Net::Sockets
184 static const int WIFI_DIRECT_MAX_CONNECTED_CLIENTS = 8;
185 static const int WIFI_DIRECT_MAX_GROUP_OWNER_INTENT = 15;
187 }; // Tizen::Net::Wifi
193 // Add constant which has compatible issue on Tizen::Security
195 }; // Tizen::Security
199 // Add constant which has compatible issue on Tizen::Social
205 // Add constant which has compatible issue on Tizen::System
211 // Add constant which has compatible issue on Tizen::Telephony
213 }; // Tizen::Telephony
217 // Add constant which has compatible issue on Tizen::Test
223 // Add constant which has compatible issue on Tizen::Text
229 // Add constant which has compatible issue on Tizen::Ui
233 // Add constant which has compatible issue on Tizen::Ui::Animations
238 #define MIN_FLASH_VOLUME 0
239 #define MAX_FLASH_VOLUME 100
240 #define DEFAULT_FLASH_VOLUME 50
247 // Add constant which has compatible issue on Tizen::Uix
253 // Add constant which has compatible issue on Tizen::Web
258 #endif // _FOSP_COMPAT_H_