aboutsummaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
Diffstat (limited to 'locale')
-rw-r--r--locale/C-ctype.c6
-rw-r--r--locale/categories.def52
-rw-r--r--locale/langinfo.h2
-rw-r--r--locale/programs/ld-ctype.c24
4 files changed, 80 insertions, 4 deletions
diff --git a/locale/C-ctype.c b/locale/C-ctype.c
index 4ab3f0171e..04eb091e62 100644
--- a/locale/C-ctype.c
+++ b/locale/C-ctype.c
@@ -345,7 +345,7 @@ const struct locale_data _nl_C_LC_CTYPE =
UNDELETABLE,
0,
NULL,
- 62,
+ 64,
{
{ string: _nl_C_LC_CTYPE_class },
{ string: (const char *) _nl_C_LC_CTYPE_toupper },
@@ -422,6 +422,8 @@ const struct locale_data _nl_C_LC_CTYPE =
{ string: "" },
{ string: "" },
{ string: "" },
- { string: "" }
+ { string: "" },
+ { wstr: (uint32_t *) L"?" },
+ { word: 1 }
}
};
diff --git a/locale/categories.def b/locale/categories.def
index 19e06879fd..e1f3f054b9 100644
--- a/locale/categories.def
+++ b/locale/categories.def
@@ -82,6 +82,58 @@ DEFINE_CATEGORY
DEFINE_ELEMENT (_NL_CTYPE_WIDTH, "ctype-width", std, bytearray)
DEFINE_ELEMENT (_NL_CTYPE_MB_CUR_MAX, "ctype-mb-cur-max", std, word)
DEFINE_ELEMENT (_NL_CTYPE_CODESET_NAME, "charmap", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_TOUPPER32, "ctype-toupper32", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_TOLOWER32, "ctype-tolower32", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS_MB_LEN, "ctype-indigits_mb-len", std, word)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS0_MB, "ctype-indigits0_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS1_MB, "ctype-indigits1_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS2_MB, "ctype-indigits2_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS3_MB, "ctype-indigits3_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS4_MB, "ctype-indigits4_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS5_MB, "ctype-indigits5_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS6_MB, "ctype-indigits6_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS7_MB, "ctype-indigits7_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS8_MB, "ctype-indigits8_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS9_MB, "ctype-indigits9_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS_WC_LEN, "ctype-indigits_wc-len", std, word)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS0_WC, "ctype-indigits0_wc", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS1_WC, "ctype-indigits1_wc", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS2_WC, "ctype-indigits2_wc", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS3_WC, "ctype-indigits3_wc", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS4_WC, "ctype-indigits4_wc", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS5_WC, "ctype-indigits5_wc", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS6_WC, "ctype-indigits6_wc", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS7_WC, "ctype-indigits7_wc", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS8_WC, "ctype-indigits8_wc", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_INDIGITS9_WC, "ctype-indigits9_wc", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT0_MB, "ctype-outdigit0_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT1_MB, "ctype-outdigit1_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT2_MB, "ctype-outdigit2_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT3_MB, "ctype-outdigit3_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT4_MB, "ctype-outdigit4_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT5_MB, "ctype-outdigit5_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT6_MB, "ctype-outdigit6_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT7_MB, "ctype-outdigit7_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT8_MB, "ctype-outdigit8_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT9_MB, "ctype-outdigit9_mb", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT0_WC, "ctype-outdigit0_wc", std, word)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT1_WC, "ctype-outdigit1_wc", std, word)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT2_WC, "ctype-outdigit2_wc", std, word)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT3_WC, "ctype-outdigit3_wc", std, word)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT4_WC, "ctype-outdigit4_wc", std, word)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT5_WC, "ctype-outdigit5_wc", std, word)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT6_WC, "ctype-outdigit6_wc", std, word)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT7_WC, "ctype-outdigit7_wc", std, word)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT8_WC, "ctype-outdigit8_wc", std, word)
+ DEFINE_ELEMENT (_NL_CTYPE_OUTDIGIT9_WC, "ctype-outdigit9_wc", std, word)
+ DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_HASH_SIZE, "ctype-translit-hash-size", std, word)
+ DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_HASH_LAYERS, "ctype-translit-hash-layers", std, word)
+ DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_FROM_IDX, "ctype-translit-from-idx", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_FROM_TBL, "ctype-translit-from-tbl", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_TO_IDX, "ctype-translit-to-idx", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_TO_TBL, "ctype-translit-to-tbl", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_DEFAULT_MISSING, "ctype-translit-default-missing", std, string)
+ DEFINE_ELEMENT (_NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN, "ctype-translit-default-missing-len", std, word)
), _nl_postload_ctype)
diff --git a/locale/langinfo.h b/locale/langinfo.h
index b5ccac6b88..11ab68ef63 100644
--- a/locale/langinfo.h
+++ b/locale/langinfo.h
@@ -319,6 +319,8 @@ enum
_NL_CTYPE_TRANSLIT_FROM_TBL,
_NL_CTYPE_TRANSLIT_TO_IDX,
_NL_CTYPE_TRANSLIT_TO_TBL,
+ _NL_CTYPE_TRANSLIT_DEFAULT_MISSING,
+ _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN,
_NL_NUM_LC_CTYPE,
/* LC_MONETARY category: formatting of monetary quantities.
diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
index 8839a9e8f8..e899649d65 100644
--- a/locale/programs/ld-ctype.c
+++ b/locale/programs/ld-ctype.c
@@ -788,6 +788,7 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap,
+ ctype->map_collection_nr];
struct locale_file data;
uint32_t idx[nelems + 1];
+ uint32_t default_missing_len;
size_t elem, cnt, offset, total;
char *cp;
@@ -814,8 +815,7 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap,
case _NL_ITEM_INDEX (name): \
iov[2 + elem + offset].iov_base = (base); \
iov[2 + elem + offset].iov_len = (len); \
- if (elem + 1 < nelems) \
- idx[elem + 1] = idx[elem] + iov[2 + elem + offset].iov_len; \
+ idx[elem + 1] = idx[elem] + iov[2 + elem + offset].iov_len; \
break
CTYPE_DATA (_NL_CTYPE_CLASS,
@@ -1007,6 +1007,26 @@ ctype_output (struct localedef_t *locale, struct charmap_t *charmap,
idx[elem + 1] = idx[elem] + iov[2 + elem + offset].iov_len;
break;
+ case _NL_ITEM_INDEX(_NL_CTYPE_TRANSLIT_DEFAULT_MISSING):
+ iov[2 + elem + offset].iov_base =
+ ctype->default_missing ?: (uint32_t *) L"";
+ iov[2 + elem + offset].iov_len =
+ wcslen (iov[2 + elem + offset].iov_base);
+ idx[elem + 1] = idx[elem] + iov[2 + elem + offset].iov_len;
+ break;
+
+ case _NL_ITEM_INDEX(_NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN):
+ default_missing_len = (ctype->default_missing
+ ? wcslen ((wchar_t *)ctype->default_missing)
+ : 1);
+ iov[2 + elem + offset].iov_base = &default_missing_len;
+ iov[2 + elem + offset].iov_len = sizeof (uint32_t);
+ /* Remove the following line in case a new entry is added
+ after _NL_CTYPE_TRANSLIT_DEFAULT_MISSING_LEN. */
+ if (elem < nelems)
+ idx[elem + 1] = idx[elem] + iov[2 + elem + offset].iov_len;
+ break;
+
default:
assert (! "unknown CTYPE element");
}