Lines Matching refs:locale
27 * and a permanent locale namespace for pointer comparison
28 * and persistent private data for locale related functions
80 sfprintf(sfstderr, "locale %17s %16s %16s %16s %s\n", "CATEGORY", "AST", "SYSTEM", "PREVIOUS", "ATTRIBUTES");
96 * convert locale to native locale name in buf
100 native_locale(const char* locale, char* buf, size_t siz)
111 if (locale && *locale)
113 if (!(lc = lcmake(locale)))
150 * locale!=0 here
154 native_setlocale(int category, const char* locale)
160 if (!(usr = native_locale(locale, buf, sizeof(buf))))
168 return (char*)locale;
170 if (ast.locale.set & AST_LC_debug)
171 sfprintf(sfstderr, "locale uwin %17s %-24s %-24s\n", lc_categories[lcindex(category, 0)].name, usr, sys);
493 * default locale
2228 if ((ast.locale.set & (AST_LC_debug|AST_LC_setlocale)) && !(ast.locale.set & AST_LC_internal))
2229 sfprintf(sfstderr, "locale setf %17s %16s\n", cp->name, locales[cp->internal]->name);
2240 else if ((locales[cp->internal]->flags & LC_utf8) && !(ast.locale.set & AST_LC_test))
2302 if ((ast.locale.set & (AST_LC_debug|AST_LC_setlocale)) && !(ast.locale.set & AST_LC_internal))
2303 sfprintf(sfstderr, "locale setf %17s %16s\n", cp->name, locales[cp->internal]->name);
2372 ast.locale.set |= ((Unamval_t*)p)->value;
2374 ast.locale.set &= ~((Unamval_t*)p)->value;
2384 default_setlocale(int category, const char* locale)
2388 if (locale)
2390 if (!(lc = lcmake(locale)) || !(lc->flags & LC_default))
2411 _sys_setlocale(int category, const char* locale)
2417 r = setlocale(category, locale);
2427 * set a single AST_LC_* locale category
2439 if ((ast.locale.set & (AST_LC_debug|AST_LC_setlocale)) && !(ast.locale.set & AST_LC_internal))
2440 sfprintf(sfstderr, "locale single %16s %16s flags %04x\n", lc_categories[category].name, lc ? lc->name : 0, flags);
2444 if (!(ast.locale.set & AST_LC_internal))
2502 ast.locale.set &= ~(1<<category);
2504 ast.locale.set |= (1<<category);
2518 if ((ast.locale.set & (AST_LC_debug|AST_LC_setlocale)) && !(ast.locale.set & AST_LC_internal))
2521 sfprintf(sfstderr, "locale set %17s %16s %16s %16s", lc_categories[category].name, lc->name, sys, lc_categories[category].prev ? lc_categories[category].prev->name : NiL);
2555 * set composite AST_LC_ALL locale categories
2630 else if (!lc_categories[cat[i]].prev && !(ast.locale.set & AST_LC_internal))
2656 else if (!lc_categories[n].prev && !(ast.locale.set & AST_LC_internal))
2665 * locale:
2674 _ast_setlocale(int category, const char* locale)
2690 if (!locale)
2731 if (!ast.locale.serial++)
2736 if ((ast.locale.set & (AST_LC_debug|AST_LC_setlocale)) && !(ast.locale.set & AST_LC_internal))
2739 sfprintf(sfstderr, "locale user %17s %16s %16s %16s%s%s\n", category == AST_LC_LANG ? "LANG" : lc_categories[category].name, locale && !*locale ? "''" : locale, "", "", initialized ? "" : " initial", (ast.locale.set & AST_LC_setenv) ? " setenv" : "");
2741 if (ast.locale.set & AST_LC_setenv)
2744 p = *locale ? lcmake(locale) : (Lc_t*)0;
2746 else if (*locale)
2749 p = lcmake(locale);
2766 if (streq(s, local) && (u || (u = native_locale(locale, tmp, sizeof(tmp)))))
2774 if (streq(s, local) && (u || (u = native_locale(locale, tmp, sizeof(tmp)))))
2785 if (streq(s, local) && (u || (u = native_locale(locale, tmp, sizeof(tmp)))))
2798 if (ast.locale.set & AST_LC_debug)
2800 sfprintf(sfstderr, "locale env %17s %16s %16s %16s\n", lc_categories[i].name, locales[i]->name, "", lc_categories[i].prev ? lc_categories[i].prev->name : (char*)0);
2831 if (p && !(ast.locale.set & AST_LC_internal))
2835 else if (composite(locale, 0) < 0)