2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
20 #ifndef _FOSP_COMPAT_H_
21 #define _FOSP_COMPAT_H_
34 #include <FOspConfig.h>
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);
45 typedef fpos_t (*funseek)(void* _cookie, fpos_t _off, int _whence);
47 typedef int (*funclose)(void* _cookie);
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);
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);
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);
89 // Miscellaneous functions NewlibCompatMisc.cpp
90 #define unctrllen(ch) __unctrllen[(ch) & 0xff]
91 _OSP_EXPORT_ extern const char __unctrllen[256];
97 typedef wchar_t mchar;
100 // Add constant which has compatible issue on Tizen
103 // Add constant which has compatible issue on Tizen::Ads
109 // Add constant which has compatible issue on Tizen::App
115 // Add constant which has compatible issue on Tizen::Base
117 template<class Type> class Buffer;
119 typedef Buffer <mchar> McharBuffer;
125 // Add constant which has compatible issue on Tizen::Commerce
127 }; // Tizen::Commerce
131 // Add constant which has compatible issue on Tizen::Content
137 // Add constant which has compatible issue on Tizen::Graphics
139 }; // Tizen::Graphics
143 // Add constant which has compatible issue on Tizen::Io
149 // Add constant which has compatible issue on Tizen::Locales
155 // Add constant which has compatible issue on Tizen::Locations
157 }; // Tizen::Locations
161 // Add constant which has compatible issue on Tizen::Media
167 // Add constant which has compatible issue on Tizen::Messaging
169 }; // Tizen::Messaging
173 // Add constant which has compatible issue on Tizen::Net
178 static const int NET_SOCKET_INADDR_ANY = 0;
180 }; // Tizen::Net::Sockets
185 static const int WIFI_DIRECT_MAX_CONNECTED_CLIENTS = 8;
186 static const int WIFI_DIRECT_MAX_GROUP_OWNER_INTENT = 15;
188 }; // Tizen::Net::Wifi
194 // Add constant which has compatible issue on Tizen::Security
196 }; // Tizen::Security
200 // Add constant which has compatible issue on Tizen::Social
206 // Add constant which has compatible issue on Tizen::System
212 // Add constant which has compatible issue on Tizen::Telephony
214 }; // Tizen::Telephony
218 // Add constant which has compatible issue on Tizen::Test
224 // Add constant which has compatible issue on Tizen::Text
230 // Add constant which has compatible issue on Tizen::Ui
234 // Add constant which has compatible issue on Tizen::Ui::Animations
239 #define MIN_FLASH_VOLUME 0
240 #define MAX_FLASH_VOLUME 100
241 #define DEFAULT_FLASH_VOLUME 50
248 // Add constant which has compatible issue on Tizen::Uix
254 // Add constant which has compatible issue on Tizen::Web
259 #endif // _FOSP_COMPAT_H_