Changeset 2729
- Timestamp:
- Jul 18, 2006, 2:03:26 AM (19 years ago)
- Location:
- trunk/libc
- Files:
-
- 4 added
- 3 edited
- 7 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/include/InnoTekLIBC/locale.h
r2672 r2729 31 31 32 32 #include <sys/cdefs.h> 33 #include <sys/ _types.h>33 #include <sys/types.h> 34 34 #include <locale.h> 35 #include <uconv.h> 35 #ifdef __OS2__ 36 # include <uconv.h> 37 #endif 36 38 37 39 __BEGIN_DECLS … … 242 244 extern const __LIBC_LOCALECTYPE __libc_GLocaleCtypeDefault; 243 245 /** Cached Unicode (__wchar_t) case conversion tables and flags. */ 244 extern __LIBC_LOCALEWCTYPE __libc_GLocaleWCtype;246 extern __LIBC_LOCALEWCTYPE __libc_GLocaleWCtype; 245 247 /** Locale information structure. */ 246 248 extern __LIBC_LOCALELCONV __libc_gLocaleLconv; … … 252 254 extern const __LIBC_LOCALETIME __libc_gLocaleTimeDefault; 253 255 /** Message locale information. */ 254 extern __LIBC_LOCALEMSG __libc_gLocaleMsg;256 extern __LIBC_LOCALEMSG __libc_gLocaleMsg; 255 257 /** Message locale information for the 'C'/'POSIX' locale. */ 256 extern const __LIBC_LOCALEMSG __libc_gLocaleMsgDefault;258 extern const __LIBC_LOCALEMSG __libc_gLocaleMsgDefault; 257 259 258 260 /** Macros to lock the different locale structures. … … 267 269 /** @} */ 268 270 269 /** Convert a string to Unicode, apply some transform and convert back. */270 extern void __libc_ucs2Do(UconvObject *uconv, char *s, void *arg, int (*xform)(UniChar *, void *));271 /** Convert a MBCS character to Unicode; returns number of bytes in MBCS char. */272 extern int __libc_ucs2To(UconvObject, const unsigned char *, size_t, UniChar *);273 /** Convert a Unicode character to MBCS. */274 extern int __libc_ucs2From(UconvObject, UniChar, unsigned char *, size_t);275 /** Converts a codepage string to unichar and something libuni might recognize. */276 extern void __libc_TranslateCodepage(const char *cp, UniChar *ucp);277 278 extern int __libc_localeCreateObjects(const char *pszLocale, const char *pszCodepage, char *pszCodepageActual, LocaleObject *plobj, UconvObject *puobj);279 280 271 extern void __libc_localeFuncsSBCS(__LIBC_PLOCALECTYPEFUNCS pFuncs); 281 272 extern void __libc_localeFuncsDBCS(__LIBC_PLOCALECTYPEFUNCS pFuncs); … … 316 307 /** @} */ 317 308 309 #ifdef __OS2__ 318 310 #include <ctype.h> 319 311 … … 356 348 } 357 349 350 /** Convert a string to Unicode, apply some transform and convert back. */ 351 extern void __libc_ucs2Do(UconvObject *uconv, char *s, void *arg, int (*xform)(UniChar *, void *)); 352 /** Convert a MBCS character to Unicode; returns number of bytes in MBCS char. */ 353 extern int __libc_ucs2To(UconvObject, const unsigned char *, size_t, UniChar *); 354 /** Convert a Unicode character to MBCS. */ 355 extern int __libc_ucs2From(UconvObject, UniChar, unsigned char *, size_t); 356 /** Converts a codepage string to unichar and something libuni might recognize. */ 357 extern void __libc_TranslateCodepage(const char *cp, UniChar *ucp); 358 359 extern int __libc_localeCreateObjects(const char *pszLocale, const char *pszCodepage, char *pszCodepageActual, LocaleObject *plobj, UconvObject *puobj); 360 #endif /* __OS2__ */ 361 362 358 363 __END_DECLS 359 364 -
trunk/libc/src/libc/locale/Makefile.kmk
r2717 r2729 46 46 $(PATH_LIBC_SRC)/libc/locale/nl_langinfo.c \ 47 47 $(PATH_LIBC_SRC)/libc/locale/wctype.c \ 48 $(PATH_LIBC_SRC)/libc/locale/__convcp.c \49 48 50 49 libc_libc_locale_SOURCES.os2 = \ 51 $(PATH_LIBC_SRC)/libc/locale/iconv.c \ 52 $(PATH_LIBC_SRC)/libc/locale/mb_libuni.c \ 53 $(PATH_LIBC_SRC)/libc/locale/setlocale.c \ 54 $(PATH_LIBC_SRC)/libc/locale/__from_ucs.c \ 55 $(PATH_LIBC_SRC)/libc/locale/__to_ucs.c \ 56 $(PATH_LIBC_SRC)/libc/locale/__do_uni.c \ 50 $(PATH_LIBC_SRC)/libc/locale/os2/iconv.c \ 51 $(PATH_LIBC_SRC)/libc/locale/os2/locale_ctype-os2.c \ 52 $(PATH_LIBC_SRC)/libc/locale/os2/mb_libuni.c \ 53 $(PATH_LIBC_SRC)/libc/locale/os2/setlocale.c \ 54 $(PATH_LIBC_SRC)/libc/locale/os2/__convcp.c \ 55 $(PATH_LIBC_SRC)/libc/locale/os2/__do_uni.c \ 56 $(PATH_LIBC_SRC)/libc/locale/os2/__from_ucs.c \ 57 $(PATH_LIBC_SRC)/libc/locale/os2/__to_ucs.c \ 58 59 libc_libc_locale_SOURCES.win32 = \ 60 $(PATH_LIBC_SRC)/libc/locale/generic/locale_ctype-generic.c \ 61 $(PATH_LIBC_SRC)/libc/locale/generic/setlocale-generic.c \ 62 57 63 58 64 # configure the variants. */ -
trunk/libc/src/libc/locale/locale_ctype.c
r2717 r2729 28 28 #define _DONT_USE_CTYPE_INLINE_ 29 29 #include "libc-alias.h" 30 #define INCL_FSMACROS31 #include <os2emx.h>32 30 #include <InnoTekLIBC/locale.h> 33 31 #include <ctype.h> … … 216 214 #else 217 215 /** @todo portable local */ 218 #endif 216 #endif 219 217 .mbcs = 0, 220 218 .szCodeSet = "US-ASCII" … … 401 399 } 402 400 403 /**404 * Get unicode type.405 * ASSUMES that none of the locals differs from the unicode spec406 */407 unsigned ___wctype(__wchar_t wc)408 {409 if ( __libc_GLocaleWCtype.uMask != ~0x7f410 || wc <= 127)411 {412 UNICTYPE *pUniType = UniQueryCharType(wc);413 if (pUniType)414 return ___wctype_uni(pUniType, wc);415 }416 return 0;417 }418 419 /**420 * Fold char to lowercase.421 * ASSUMES that none of the locals differs from the unicode spec.422 */423 __wchar_t ___towlower(__wchar_t wc)424 {425 if ( __libc_GLocaleWCtype.uMask == ~0x7f426 && wc > 127)427 return wc;428 FS_VAR_SAVE_LOAD();429 UniChar ucRet = UniTolower(wc);430 FS_RESTORE();431 return ucRet;432 }433 434 /**435 * Fold char to lowercase.436 * ASSUMES that none of the locals differs from the unicode spec.437 */438 __wchar_t ___towupper(__wchar_t wc)439 {440 if ( __libc_GLocaleWCtype.uMask == ~0x7f441 && wc > 127)442 return wc;443 FS_VAR_SAVE_LOAD();444 UniChar ucRet = UniToupper(wc);445 FS_RESTORE();446 return ucRet;447 }448 449 450 401 451 402 #ifdef LOCALE_CTYPE_GEN /* code for regenerating that table - link staticly! */ … … 581 532 #else 582 533 /** @todo portable local */ 583 #endif 534 #endif 584 535 " .mbcs = %d,\n" 585 536 " .szCodeSet = \"US-ASCII\"\n"
Note:
See TracChangeset
for help on using the changeset viewer.