Lines Matching +full:- +full:c

3 <<setlocale>>, <<localeconv>>---select or query locale
16 <<setlocale>> is the facility defined by ANSI C to condition the
22 and <<"C">> values for <[locale]>; strings representing other locales are not
31 for a given language, a three character string per ISO 639-3.
37 <<"C-charset">>.
38 Instead of <<"C-">>, you can also specify <<"C.">>. Both variations allow
40 for instance <<"C.UTF-8">>, which keeps all settings as in the C locale,
41 but uses the UTF-8 charset.
44 <<"UTF-8">>, <<"JIS">>, <<"EUCJP">>, <<"SJIS">>, <<"KOI8-R">>, <<"KOI8-U">>,
45 <<"KOI8-T">>, <<"GEORGIAN-PS">>, <<"PT154">>, <<"TIS-620">>, <<"ISO-8859-x">>
53 <<"EUCKR">> are also recognized with dash, <<"EUC-JP">> and <<"EUC-KR">>.
73 These characters have a width of 1 for singlebyte charsets and UTF-8,
74 and a width of 2 for multibyte charsets other than UTF-8. Specifying
78 to enforce single-width character properties.
86 `<<locale.h>>') describing the locale-specific conventions currently
100 this implementation, always those of the C locale).
103 ANSI C requires <<setlocale>>, but the only locale required across all
104 implementations is the C locale.
107 There is no ISO-8859-12 codepage. It's also refused by this implementation.
114 * Copyright (c) 1996 - 2002 FreeBSD Project
115 * Copyright (c) 1991, 1993
179 * Default locale per POSIX. Can be overridden on a per-target base.
182 #define DEFAULT_LOCALE "C"
194 { "C", "C", "C", "C", "C", "C", "C", },
226 { "C", "C", DEFAULT_LOCALE, "C", "C", "C", "C", },
260 = "C";
274 if (strcmp (locale, "POSIX") && strcmp (locale, "C") in setlocale()
278 return "C"; in setlocale()
293 return category != LC_ALL ? __get_global_locale ()->categories[category] in setlocale()
300 strcpy (new_categories[i], __get_global_locale ()->categories[i]); in setlocale()
365 if ((len = r - locale) > ENCODING_LEN) in setlocale()
383 #pragma GCC diagnostic ignored "-Wpragmas" in setlocale()
384 #pragma GCC diagnostic ignored "-Wunknown-warning-option" in setlocale()
389 #pragma GCC diagnostic ignored "-Wanalyzer-overlapping-buffers" in setlocale()
391 strcpy (new_categories[i], new_categories[i-1]); in setlocale()
410 strcpy (saved_categories[i], __get_global_locale ()->categories[i]); in setlocale()
420 strcpy (new_categories[j], "C"); in setlocale()
438 strcpy (global_locale_string, __get_global_locale ()->categories[1]); in currentlocale()
441 if (strcmp (__get_global_locale ()->categories[1], in currentlocale()
442 __get_global_locale ()->categories[i])) in currentlocale()
448 __get_global_locale ()->categories[i]); in currentlocale()
458 /* At this point a full-featured system would just load the locale in __loadlocale()
462 one in POSIX-style, or one in the old newlib style to maintain in __loadlocale()
469 char *end, *c = NULL; in __loadlocale() local
482 if (!strcmp (new_locale, loc->categories[category])) in __loadlocale()
483 return loc->categories[category]; in __loadlocale()
488 /* "POSIX" is translated to "C", as on Linux. */ in __loadlocale()
490 strcpy (locale, "C"); in __loadlocale()
491 if (!strcmp (locale, "C")) /* Default "C" locale */ in __loadlocale()
493 else if (locale[0] == 'C' in __loadlocale()
494 && (locale[1] == '-' /* Old newlib style */ in __loadlocale()
495 || locale[1] == '.')) /* Extension for the C locale to allow in __loadlocale()
497 sticking to the C locale in terms in __loadlocale()
503 c = locale + 2; in __loadlocale()
504 strcpy (charset, c); in __loadlocale()
508 c += strlen (charset); in __loadlocale()
512 c = locale; in __loadlocale()
516 if (c[0] < 'a' || c[0] > 'z' in __loadlocale()
517 || c[1] < 'a' || c[1] > 'z') in __loadlocale()
519 c += 2; in __loadlocale()
520 /* Allow three character Language per ISO 639-3 */ in __loadlocale()
521 if (c[0] >= 'a' && c[0] <= 'z') in __loadlocale()
522 ++c; in __loadlocale()
523 if (c[0] == '_') in __loadlocale()
526 ++c; in __loadlocale()
527 if (c[0] < 'A' || c[0] > 'Z' in __loadlocale()
528 || c[1] < 'A' || c[1] > 'Z') in __loadlocale()
530 c += 2; in __loadlocale()
532 if (c[0] == '.') in __loadlocale()
537 ++c; in __loadlocale()
538 strcpy (charset, c); in __loadlocale()
542 c += strlen (charset); in __loadlocale()
544 else if (c[0] == '\0' || c[0] == '@') in __loadlocale()
546 strcpy (charset, "ISO-8859-1"); in __loadlocale()
551 if (c && c[0] == '@') in __loadlocale()
553 /* Modifier "cjksingle" is recognized to enforce single-width mode. */ in __loadlocale()
557 if (!strcmp (c + 1, "cjksingle")) in __loadlocale()
559 else if (!strcmp (c + 1, "cjknarrow")) in __loadlocale()
561 else if (!strcmp (c + 1, "cjkwide")) in __loadlocale()
569 if (strcasecmp (charset, "UTF-8") && strcasecmp (charset, "UTF8")) in __loadlocale()
571 strcpy (charset, "UTF-8"); in __loadlocale()
590 c = charset + 3; in __loadlocale()
591 if (*c == '-') in __loadlocale()
592 ++c; in __loadlocale()
593 if (!strcasecmp (c, "JP")) in __loadlocale()
614 /* Must be exactly one of ISO-8859-1, [...] ISO-8859-16, except for in __loadlocale()
615 ISO-8859-12. This code also recognizes the aliases without dashes. */ in __loadlocale()
618 c = charset + 3; in __loadlocale()
619 if (*c == '-') in __loadlocale()
620 ++c; in __loadlocale()
621 if (strncasecmp (c, "8859", 4)) in __loadlocale()
623 c += 4; in __loadlocale()
624 if (*c == '-') in __loadlocale()
625 ++c; in __loadlocale()
626 val = strtol (c, &end, 10); in __loadlocale()
629 strcpy (charset, "ISO-8859-"); in __loadlocale()
630 c = charset + 9; in __loadlocale()
632 *c++ = '1'; in __loadlocale()
633 *c++ = val % 10 + '0'; in __loadlocale()
634 *c = '\0'; in __loadlocale()
644 case 'C': in __loadlocale()
645 case 'c': in __loadlocale()
696 /* KOI8-R, KOI8-U, KOI8-T and the aliases without dash */ in __loadlocale()
699 c = charset + 4; in __loadlocale()
700 if (*c == '-') in __loadlocale()
701 ++c; in __loadlocale()
702 if (*c == 'R' || *c == 'r') in __loadlocale()
707 else if (*c == 'U' || *c == 'u') in __loadlocale()
712 else if (*c == 'T' || *c == 't') in __loadlocale()
739 /* GEORGIAN-PS and the alias without dash */ in __loadlocale()
742 c = charset + 8; in __loadlocale()
743 if (*c == '-') in __loadlocale()
744 ++c; in __loadlocale()
745 if (strcasecmp (c, "PS")) in __loadlocale()
781 c = charset + 3; in __loadlocale()
782 if (*c == '-') in __loadlocale()
783 ++c; in __loadlocale()
784 if (strcmp (c, "620")) in __loadlocale()
804 strcpy (loc->ctype_codeset, charset); in __loadlocale()
805 loc->mb_cur_max[0] = mbc_max; in __loadlocale()
807 loc->wctomb = l_wctomb; in __loadlocale()
808 loc->mbtowc = l_mbtowc; in __loadlocale()
810 /* Set CJK width mode (1: ambiguous-wide, 0: normal, -1: disabled). */ in __loadlocale()
813 single-byte charsets, and double width for multi-byte charsets in __loadlocale()
814 other than UTF-8. For UTF-8, use single width. in __loadlocale()
818 loc->cjk_lang = cjkwide || in __loadlocale()
821 loc->cjk_lang = -1; /* Disable CJK dual-width */ in __loadlocale()
830 return strcpy(loc->categories[category], new_locale); in __loadlocale()
861 return __get_current_ctype_locale ()->mb_cur_max[0]; in __locale_mb_cur_max()
863 return __get_current_locale ()->mb_cur_max[0]; in __locale_mb_cur_max()
871 return locale->ctype_ptr; in __locale_ctype_ptr_l()
877 return __get_current_locale ()->ctype_ptr; in __locale_ctype_ptr()