diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-06-17 03:08:26 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-06-17 03:08:26 +0000 |
commit | 1d96d74da7f6adccd82e4000efe38900b295467a (patch) | |
tree | e17bb7feb5740943051034b27028df9e72ed0132 /locale/programs/ld-ctype.c | |
parent | 323fb88dac799cddfaa33cb80f7fc3395c2297e5 (diff) | |
download | glibc-1d96d74da7f6adccd82e4000efe38900b295467a.zip glibc-1d96d74da7f6adccd82e4000efe38900b295467a.tar.gz glibc-1d96d74da7f6adccd82e4000efe38900b295467a.tar.bz2 |
Update.
* locale/langinfo.h: Add entries for default_missing information.
* locale/C-ctype.c: Add initializers for new fields.
* iconv/gconv_trans.c: If nothing matched, try to use default_missing
information.
* locale/categories.h: Add entries for all LC_CTYPE values.
* locale/programs/ld-ctype.c (ctype_output): Write out default_missing
information.
* localedata/tst-trans.c: Write out an error message if class is
not found.
Diffstat (limited to 'locale/programs/ld-ctype.c')
-rw-r--r-- | locale/programs/ld-ctype.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c index 8839a9e..e899649 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"); } |