Lines Matching refs:ltype
268 _Locale_lcid_t* _Locale_get_ctype_hint(_Locale_ctype_t* ltype)
269 { return (ltype != 0) ? <ype->lc : 0; }
314 _Locale_ctype_t *ltype = (_Locale_ctype_t*)malloc(sizeof(_Locale_ctype_t));
316 if (!ltype) { *__err_code = _STLP_LOC_NO_MEMORY; return ltype; }
317 memset(ltype, 0, sizeof(_Locale_ctype_t));
319 if (__GetLCIDFromName(name, <ype->lc.id, cp_name, lc_hint) == -1)
320 { free(ltype); *__err_code = _STLP_LOC_UNKNOWN_NAME; return NULL; }
323 if ( ltype->lc.id == INVARIANT_LCID && name[0] == 'C' && name[1] == 0 )
324 { ltype->lc.id = 0x409; }
327 ltype->cp = atoi(cp_name);
329 NativeCP = __GetDefaultCP(ltype->lc.id);
334 if (!GetCPInfo(NativeCP, &CPInfo)) { free(ltype); return NULL; }
341 if ((UINT)NativeCP != ltype->cp) {
347 BufferSize = MultiByteToWideChar(ltype->cp, MB_PRECOMPOSED, (const char*)Buffer, 256, NULL, 0);
348 if (!BufferSize) { free(ltype); *__err_code = _STLP_LOC_UNKNOWN_NAME; return NULL; }
350 if (!wbuffer) { free(ltype); *__err_code = _STLP_LOC_NO_MEMORY; return NULL; }
351 MultiByteToWideChar(ltype->cp, MB_PRECOMPOSED, (const char*)Buffer, 256, wbuffer, BufferSize);
353 GetStringTypeW(CT_CTYPE1, wbuffer, 256, ltype->ctable);
354 MapCtypeMasks(ltype->ctable, ltype->ctable + 256);
360 GetStringTypeA(ltype->lc.id, CT_CTYPE1, (const char*)Buffer, 256, ctable);
364 if (!BufferSize) { free(ltype); *__err_code = _STLP_LOC_UNKNOWN_NAME; return NULL; }
366 if (!wbuffer) { free(ltype); *__err_code = _STLP_LOC_NO_MEMORY; return NULL; }
368 if (!WideCharToMultiByte(ltype->cp, WC_COMPOSITECHECK | WC_SEPCHARS, wbuffer, BufferSize, (char*)TargetBuffer, 256, NULL, FALSE))
369 { free(wbuffer); free(ltype); *__err_code = _STLP_LOC_UNKNOWN_NAME; return NULL; }
376 ltype->ctable[TargetBuffer[i]] = MapCtypeMask(ctable[i]);
381 GetStringTypeA(ltype->lc.id, CT_CTYPE1, (const char*)Buffer, 256, ltype->ctable);
382 MapCtypeMasks(ltype->ctable, ltype->ctable + 256);
384 return ltype;
912 char const* _Locale_ctype_name(const _Locale_ctype_t* ltype, char* buf) {
914 my_ltoa(ltype->cp, cp_buf);
915 return __GetLocaleName(ltype->lc.id, cp_buf, buf);
936 void _Locale_ctype_destroy(_Locale_ctype_t* ltype) {
937 if (!ltype) return;
939 free(ltype);
1030 const _Locale_mask_t* _Locale_ctype_table(_Locale_ctype_t* ltype) {
1031 _STLP_STATIC_ASSERT(sizeof(_Locale_mask_t) == sizeof(ltype->ctable[0]))
1032 return (const _Locale_mask_t*)ltype->ctable;
1035 int _Locale_toupper(_Locale_ctype_t* ltype, int c) {
1038 if ((UINT)__GetDefaultCP(ltype->lc.id) == ltype->cp) {
1039 LCMapStringA(ltype->lc.id, LCMAP_LINGUISTIC_CASING | LCMAP_UPPERCASE, buf, 2, out_buf, 2);
1044 MultiByteToWideChar(ltype->cp, MB_PRECOMPOSED, buf, 2, wbuf, 2);
1045 WideCharToMultiByte(__GetDefaultCP(ltype->lc.id), WC_COMPOSITECHECK | WC_SEPCHARS, wbuf, 2, buf, 2, NULL, FALSE);
1047 LCMapStringA(ltype->lc.id, LCMAP_LINGUISTIC_CASING | LCMAP_UPPERCASE, buf, 2, out_buf, 2);
1049 MultiByteToWideChar(__GetDefaultCP(ltype->lc.id), MB_PRECOMPOSED, out_buf, 2, wbuf, 2);
1050 WideCharToMultiByte(ltype->cp, WC_COMPOSITECHECK | WC_SEPCHARS, wbuf, 2, out_buf, 2, NULL, FALSE);
1055 int _Locale_tolower(_Locale_ctype_t* ltype, int c) {
1058 if ((UINT)__GetDefaultCP(ltype->lc.id) == ltype->cp) {
1059 LCMapStringA(ltype->lc.id, LCMAP_LINGUISTIC_CASING | LCMAP_LOWERCASE, buf, 2, out_buf, 2);
1064 MultiByteToWideChar(ltype->cp, MB_PRECOMPOSED, buf, 2, wbuf, 2);
1065 WideCharToMultiByte(__GetDefaultCP(ltype->lc.id), WC_COMPOSITECHECK | WC_SEPCHARS, wbuf, 2, buf, 2, NULL, FALSE);
1067 LCMapStringA(ltype->lc.id, LCMAP_LINGUISTIC_CASING | LCMAP_LOWERCASE, buf, 2, out_buf, 2);
1069 MultiByteToWideChar(__GetDefaultCP(ltype->lc.id), MB_PRECOMPOSED, out_buf, 2, wbuf, 2);
1070 WideCharToMultiByte(ltype->cp, WC_COMPOSITECHECK | WC_SEPCHARS, wbuf, 2, out_buf, 2, NULL, FALSE);