00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00028 #ifndef _RTXUTF8_H_
00029 #define _RTXUTF8_H_
00030
00031 #include "rtxsrc/rtxContext.h"
00032
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036
00037
00060 EXTERNRTX long rtxUTF8ToUnicode (OSCTXT* pctxt, const OSUTF8CHAR* inbuf,
00061 OSUNICHAR* outbuf, size_t outbufsiz);
00062
00073 EXTERNRTX int rtxValidateUTF8 (OSCTXT* pctxt, const OSUTF8CHAR* inbuf);
00074
00084 EXTERNRTX size_t rtxUTF8Len (const OSUTF8CHAR* inbuf);
00085 EXTERNRTX size_t rtxCalcUTF8Len (const OSUTF8CHAR* inbuf, size_t inbufBytes);
00086
00094 EXTERNRTX size_t rtxUTF8LenBytes (const OSUTF8CHAR* inbuf);
00095
00103 EXTERNRTX int rtxUTF8CharSize (OS32BITCHAR wc);
00104
00116 EXTERNRTX int rtxUTF8EncodeChar (OS32BITCHAR wc, OSOCTET* buf, size_t bufsiz);
00117
00128 EXTERNRTX int rtxUTF8DecodeChar
00129 (OSCTXT* pctxt, const OSUTF8CHAR* pinbuf, int* pInsize);
00130
00140 EXTERNRTX OS32BITCHAR rtxUTF8CharToWC (const OSUTF8CHAR* buf, OSUINT32* len);
00141
00151 EXTERNRTX OSUTF8CHAR* rtxUTF8StrChr (OSUTF8CHAR* utf8str,
00152 OS32BITCHAR utf8char);
00153
00163 EXTERNRTX OSUTF8CHAR* rtxUTF8Strdup (OSCTXT* pctxt, const OSUTF8CHAR* utf8str);
00164
00176 EXTERNRTX OSUTF8CHAR* rtxUTF8Strndup (OSCTXT* pctxt,
00177 const OSUTF8CHAR* utf8str,
00178 size_t nbytes);
00179
00187 EXTERNRTX OSBOOL rtxUTF8StrEqual (const OSUTF8CHAR* utf8str1,
00188 const OSUTF8CHAR* utf8str2);
00189
00200 EXTERNRTX OSBOOL rtxUTF8StrnEqual (const OSUTF8CHAR* utf8str1,
00201 const OSUTF8CHAR* utf8str2,
00202 size_t count);
00203
00215 EXTERNRTX int rtxUTF8Strcmp (const OSUTF8CHAR* utf8str1,
00216 const OSUTF8CHAR* utf8str2);
00217
00231 EXTERNRTX int rtxUTF8Strncmp (const OSUTF8CHAR* utf8str1,
00232 const OSUTF8CHAR* utf8str2,
00233 size_t count);
00244 EXTERNRTX OSUTF8CHAR* rtxUTF8Strcpy
00245 (OSUTF8CHAR* dest, size_t bufsiz, const OSUTF8CHAR* src);
00246
00259 EXTERNRTX OSUTF8CHAR* rtxUTF8Strncpy
00260 (OSUTF8CHAR* dest, size_t bufsiz, const OSUTF8CHAR* src, size_t nchars);
00261
00271 EXTERNRTX int rtxUTF8StrToBool (const OSUTF8CHAR* utf8str, OSBOOL* pvalue);
00272
00283 EXTERNRTX int rtxUTF8StrnToBool
00284 (const OSUTF8CHAR* utf8str, size_t nbytes, OSBOOL* pvalue);
00285
00299 EXTERNRTX int rtxUTF8StrToDouble (const OSUTF8CHAR* utf8str, OSREAL* pvalue);
00300
00315 EXTERNRTX int rtxUTF8StrnToDouble
00316 (const OSUTF8CHAR* utf8str, size_t nbytes, OSREAL* pvalue);
00317
00330 EXTERNRTX int rtxUTF8StrToInt (const OSUTF8CHAR* utf8str, OSINT32* pvalue);
00331
00332 #define rtxUTF8StrToInt32 rtxUTF8StrToInt
00333
00348 EXTERNRTX int rtxUTF8StrnToInt
00349 (const OSUTF8CHAR* utf8str, size_t nbytes, OSINT32* pvalue);
00350
00360 EXTERNRTX int rtxUTF8StrToUInt (const OSUTF8CHAR* utf8str, OSUINT32* pvalue);
00361
00362 #define rtxUTF8StrToUInt32 rtxUTF8StrToUInt
00363
00375 EXTERNRTX int rtxUTF8StrnToUInt
00376 (const OSUTF8CHAR* utf8str, size_t nbytes, OSUINT32* pvalue);
00377
00378 #ifndef _NO_INT64_SUPPORT
00379
00388 EXTERNRTX int rtxUTF8StrToInt64 (const OSUTF8CHAR* utf8str, OSINT64* pvalue);
00389
00401 EXTERNRTX int rtxUTF8StrnToInt64
00402 (const OSUTF8CHAR* utf8str, size_t nbytes, OSINT64* pvalue);
00403
00413 EXTERNRTX int rtxUTF8StrToUInt64 (const OSUTF8CHAR* utf8str, OSUINT64* pvalue);
00414
00426 EXTERNRTX int rtxUTF8StrnToUInt64
00427 (const OSUTF8CHAR* utf8str, size_t nbytes, OSUINT64* pvalue);
00428
00429 #endif
00430
00443 EXTERNRTX int rtxUTF8ToDynUniStr
00444 (OSCTXT* pctxt, const OSUTF8CHAR* utf8str,
00445 const OSUNICHAR** ppdata, OSUINT32* pnchars);
00446
00457 EXTERNRTX int rtxUTF8RemoveWhiteSpace
00458 (const OSUTF8CHAR* utf8instr, size_t nbytes, const OSUTF8CHAR** putf8outstr);
00459
00466 #define RTUTF8STRCMPL(name,lstr) \
00467 rtxUTF8Strcmp(name,(const OSUTF8CHAR*)lstr)
00468
00483 EXTERNRTX int rtxUTF8StrToDynHexStr
00484 (OSCTXT* pctxt, const OSUTF8CHAR* utf8str, OSDynOctStr* pvalue);
00485
00501 EXTERNRTX int rtxUTF8StrnToDynHexStr
00502 (OSCTXT* pctxt, const OSUTF8CHAR* utf8str, size_t nbytes, OSDynOctStr* pvalue);
00503
00522 EXTERNRTX const OSUTF8CHAR* rtxUTF8StrNextTok
00523 (OSUTF8CHAR* utf8str, OSUTF8CHAR** ppNext);
00524
00528 #ifdef __cplusplus
00529 }
00530 #endif
00531
00532 #endif