Changeset 2729


Ignore:
Timestamp:
Jul 18, 2006, 2:03:26 AM (19 years ago)
Author:
bird
Message:

Split out more OS/2 specific locale bits. (should be all)

Location:
trunk/libc
Files:
4 added
3 edited
7 moved

Legend:

Unmodified
Added
Removed
  • trunk/libc/include/InnoTekLIBC/locale.h

    r2672 r2729  
    3131
    3232#include <sys/cdefs.h>
    33 #include <sys/_types.h>
     33#include <sys/types.h>
    3434#include <locale.h>
    35 #include <uconv.h>
     35#ifdef __OS2__
     36# include <uconv.h>
     37#endif
    3638
    3739__BEGIN_DECLS
     
    242244extern const __LIBC_LOCALECTYPE     __libc_GLocaleCtypeDefault;
    243245/** Cached Unicode (__wchar_t) case conversion tables and flags. */
    244 extern __LIBC_LOCALEWCTYPE    __libc_GLocaleWCtype;
     246extern __LIBC_LOCALEWCTYPE          __libc_GLocaleWCtype;
    245247/** Locale information structure. */
    246248extern __LIBC_LOCALELCONV           __libc_gLocaleLconv;
     
    252254extern const __LIBC_LOCALETIME      __libc_gLocaleTimeDefault;
    253255/** Message locale information. */
    254 extern __LIBC_LOCALEMSG            __libc_gLocaleMsg;
     256extern __LIBC_LOCALEMSG             __libc_gLocaleMsg;
    255257/** Message locale information for the 'C'/'POSIX' locale. */
    256 extern const __LIBC_LOCALEMSG      __libc_gLocaleMsgDefault;
     258extern const __LIBC_LOCALEMSG       __libc_gLocaleMsgDefault;
    257259
    258260/** Macros to lock the different locale structures.
     
    267269/** @} */
    268270
    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 
    280271extern void __libc_localeFuncsSBCS(__LIBC_PLOCALECTYPEFUNCS pFuncs);
    281272extern void __libc_localeFuncsDBCS(__LIBC_PLOCALECTYPEFUNCS pFuncs);
     
    316307/** @} */
    317308
     309#ifdef __OS2__
    318310#include <ctype.h>
    319311
     
    356348}
    357349
     350/** Convert a string to Unicode, apply some transform and convert back. */
     351extern 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. */
     353extern int  __libc_ucs2To(UconvObject, const unsigned char *, size_t, UniChar *);
     354/** Convert a Unicode character to MBCS. */
     355extern int  __libc_ucs2From(UconvObject, UniChar, unsigned char *, size_t);
     356/** Converts a codepage string to unichar and something libuni might recognize. */
     357extern void __libc_TranslateCodepage(const char *cp, UniChar *ucp);
     358
     359extern int __libc_localeCreateObjects(const char *pszLocale, const char *pszCodepage, char *pszCodepageActual, LocaleObject *plobj, UconvObject *puobj);
     360#endif /* __OS2__ */
     361
     362
    358363__END_DECLS
    359364
  • trunk/libc/src/libc/locale/Makefile.kmk

    r2717 r2729  
    4646    $(PATH_LIBC_SRC)/libc/locale/nl_langinfo.c \
    4747    $(PATH_LIBC_SRC)/libc/locale/wctype.c \
    48     $(PATH_LIBC_SRC)/libc/locale/__convcp.c \
    4948
    5049libc_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
     59libc_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
    5763
    5864# configure the variants. */
  • trunk/libc/src/libc/locale/locale_ctype.c

    r2717 r2729  
    2828#define _DONT_USE_CTYPE_INLINE_
    2929#include "libc-alias.h"
    30 #define INCL_FSMACROS
    31 #include <os2emx.h>
    3230#include <InnoTekLIBC/locale.h>
    3331#include <ctype.h>
     
    216214#else
    217215/** @todo portable local */
    218 #endif 
     216#endif
    219217    .mbcs = 0,
    220218    .szCodeSet = "US-ASCII"
     
    401399}
    402400
    403 /**
    404  * Get unicode type.
    405  * ASSUMES that none of the locals differs from the unicode spec
    406  */
    407 unsigned ___wctype(__wchar_t wc)
    408 {
    409     if (    __libc_GLocaleWCtype.uMask != ~0x7f
    410         ||  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 == ~0x7f
    426         &&  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 == ~0x7f
    441         &&  wc > 127)
    442         return wc;
    443     FS_VAR_SAVE_LOAD();
    444     UniChar ucRet = UniToupper(wc);
    445     FS_RESTORE();
    446     return ucRet;
    447 }
    448 
    449 
    450401
    451402#ifdef LOCALE_CTYPE_GEN /* code for regenerating that table - link staticly! */
     
    581532#else
    582533/** @todo portable local */
    583 #endif 
     534#endif
    584535           "    .mbcs = %d,\n"
    585536           "    .szCodeSet = \"US-ASCII\"\n"
Note: See TracChangeset for help on using the changeset viewer.