locales, libconv: Sync with FreeBSD (extensive reach)
authorJohn Marino <draco@marino.st>
Sat, 21 Sep 2013 10:45:03 +0000 (12:45 +0200)
committerJohn Marino <draco@marino.st>
Sun, 29 Sep 2013 11:57:55 +0000 (13:57 +0200)
What started out as a relatively simply upgrade to libiconv finally
resulted in a simultaneous overhaul to locales, strings, and stdio.
All of these are interdependent and there is no way to upgrade them
individually or in steps.

These cases are similar to what happened with libm where significant
syncing came from NetBSD previously, rendering contributions from
FreeBSD difficult.  Libiconv and locales (both ancient) are now in
sync with FreeBSD HEAD.

As several headers were signficantly updated and the mtree was updated
to accommodate the new include/xlocale directory, this commit will
require a full world build.  It also may cause some dports to no longer
build due to prototype differences, but the dports will be adjusted.

The regexp library was not being used.  It was removed from FreeBSD four
years ago.  Since it required collate updates, I took the opportunity to
remove it completely by adding re_comp functionality to 4.3 compat
library like FreeBSD did.

__DragonFly_version has been bumped to 500300.

738 files changed:
Makefile_upgrade.inc
bin/date/date.c
contrib/gcc-4.4/libstdc++-v3/config/os/bsd/dragonfly/ctype_base.h
contrib/gcc-4.4/libstdc++-v3/config/os/bsd/dragonfly/ctype_inline.h
contrib/gcc-4.4/libstdc++-v3/config/os/bsd/dragonfly/ctype_noninline.h
contrib/gcc-4.7/libstdc++-v3/config/os/bsd/dragonfly/ctype_base.h
contrib/gcc-4.7/libstdc++-v3/config/os/bsd/dragonfly/ctype_inline.h
contrib/gdtoa/README.DELETED
contrib/gdtoa/README.DRAGONFLY [new file with mode: 0644]
contrib/gdtoa/gdtoaimp.h
contrib/gdtoa/strtod.c
contrib/gdtoa/strtodg.c
contrib/gdtoa/strtof.c
contrib/gdtoa/strtorQ.c [copied from contrib/gdtoa/strtorx.c with 64% similarity]
contrib/gdtoa/strtord.c
contrib/gdtoa/strtorx.c
etc/Makefile
etc/locale.alias [deleted file]
etc/locale.deprecated [deleted file]
etc/mtree/BSD.include.dist
etc/mtree/BSD.usr.dist
etc/nls.alias
gnu/usr.bin/grep/libgreputils/Makefile
include/Makefile
include/ctype.h
include/iconv.h
include/langinfo.h
include/locale.h
include/nl_types.h
include/paths.h
include/regexp.h [deleted file]
include/runetype.h [new file with mode: 0644]
include/stdlib.h
include/string.h
include/time.h
include/uchar.h [copied from include/iconv.h with 58% similarity]
include/wchar.h
include/wctype.h
include/xlocale.h [copied from lib/libc/citrus/citrus_esdb.h with 59% similarity]
include/xlocale/Makefile [new file with mode: 0644]
include/xlocale/_ctype.h [new file with mode: 0644]
include/xlocale/_inttypes.h [copied from lib/libc/stdio/getwc.c with 64% similarity]
include/xlocale/_langinfo.h [copied from lib/libc/citrus/citrus_mmap.h with 74% similarity]
include/xlocale/_locale.h [copied from lib/libc/citrus/citrus_mmap.h with 57% similarity]
include/xlocale/_monetary.h [moved from lib/libc/citrus/citrus_ctype_fallback.h with 68% similarity]
include/xlocale/_stdio.h [new file with mode: 0644]
include/xlocale/_stdlib.h [new file with mode: 0644]
include/xlocale/_string.h [copied from include/iconv.h with 58% similarity]
include/xlocale/_time.h [copied from include/iconv.h with 57% similarity]
include/xlocale/_uchar.h [copied from lib/libc/citrus/citrus_mmap.h with 65% similarity]
include/xlocale/_wchar.h [new file with mode: 0644]
lib/i18n_module/BIG5/Makefile
lib/i18n_module/BIG5/citrus_big5.c [moved from lib/libc/citrus/modules/citrus_big5.c with 72% similarity]
lib/i18n_module/BIG5/citrus_big5.h [moved from lib/libc/citrus/modules/citrus_big5.h with 86% similarity]
lib/i18n_module/DECHanyu/Makefile
lib/i18n_module/DECHanyu/citrus_dechanyu.c [moved from lib/libc/citrus/modules/citrus_dechanyu.c with 65% similarity]
lib/i18n_module/DECHanyu/citrus_dechanyu.h [moved from lib/libc/citrus/modules/citrus_dechanyu.h with 91% similarity]
lib/i18n_module/EUC/Makefile
lib/i18n_module/EUC/citrus_euc.c [moved from lib/libc/citrus/modules/citrus_euc.c with 75% similarity]
lib/i18n_module/EUC/citrus_euc.h [moved from lib/libc/citrus/modules/citrus_euc.h with 86% similarity]
lib/i18n_module/EUCTW/Makefile
lib/i18n_module/EUCTW/citrus_euctw.c [moved from lib/libc/citrus/modules/citrus_euctw.c with 72% similarity]
lib/i18n_module/EUCTW/citrus_euctw.h [moved from lib/libc/citrus/modules/citrus_euctw.h with 86% similarity]
lib/i18n_module/GBK2K/Makefile
lib/i18n_module/GBK2K/citrus_gbk2k.c [moved from lib/libc/citrus/modules/citrus_gbk2k.c with 66% similarity]
lib/i18n_module/GBK2K/citrus_gbk2k.h [moved from lib/libc/citrus/modules/citrus_gbk2k.h with 86% similarity]
lib/i18n_module/HZ/Makefile
lib/i18n_module/HZ/citrus_hz.c [moved from lib/libc/citrus/modules/citrus_hz.c with 75% similarity]
lib/i18n_module/HZ/citrus_hz.h [moved from lib/libc/citrus/modules/citrus_hz.h with 92% similarity]
lib/i18n_module/ISO2022/Makefile
lib/i18n_module/ISO2022/citrus_iso2022.c [moved from lib/libc/citrus/modules/citrus_iso2022.c with 78% similarity]
lib/i18n_module/ISO2022/citrus_iso2022.h [moved from lib/libc/citrus/modules/citrus_iso2022.h with 86% similarity]
lib/i18n_module/JOHAB/Makefile
lib/i18n_module/JOHAB/citrus_johab.c [moved from lib/libc/citrus/modules/citrus_johab.c with 61% similarity]
lib/i18n_module/JOHAB/citrus_johab.h [moved from lib/libc/citrus/modules/citrus_johab.h with 92% similarity]
lib/i18n_module/MSKanji/Makefile
lib/i18n_module/MSKanji/citrus_mskanji.c [moved from lib/libc/citrus/modules/citrus_mskanji.c with 74% similarity]
lib/i18n_module/MSKanji/citrus_mskanji.h [moved from lib/libc/citrus/modules/citrus_mskanji.h with 86% similarity]
lib/i18n_module/Makefile
lib/i18n_module/Makefile.inc
lib/i18n_module/Makefile.shlib [deleted file]
lib/i18n_module/UES/Makefile
lib/i18n_module/UES/citrus_ues.c [moved from lib/libc/citrus/modules/citrus_ues.c with 68% similarity]
lib/i18n_module/UES/citrus_ues.h [moved from lib/libc/citrus/modules/citrus_ues.h with 92% similarity]
lib/i18n_module/UTF1632/Makefile
lib/i18n_module/UTF1632/citrus_utf1632.c [moved from lib/libc/citrus/modules/citrus_utf1632.c with 71% similarity]
lib/i18n_module/UTF1632/citrus_utf1632.h [moved from lib/libc/citrus/modules/citrus_utf1632.h with 88% similarity]
lib/i18n_module/UTF7/Makefile
lib/i18n_module/UTF7/citrus_utf7.c [moved from lib/libc/citrus/modules/citrus_utf7.c with 70% similarity]
lib/i18n_module/UTF7/citrus_utf7.h [moved from lib/libc/citrus/modules/citrus_utf7.h with 86% similarity]
lib/i18n_module/UTF8/Makefile
lib/i18n_module/UTF8/citrus_utf8.c [moved from lib/libc/citrus/modules/citrus_utf8.c with 73% similarity]
lib/i18n_module/UTF8/citrus_utf8.h [moved from lib/libc/citrus/modules/citrus_utf8.h with 86% similarity]
lib/i18n_module/VIQR/Makefile
lib/i18n_module/VIQR/citrus_viqr.c [moved from lib/libc/citrus/modules/citrus_viqr.c with 71% similarity]
lib/i18n_module/VIQR/citrus_viqr.h [moved from lib/libc/citrus/modules/citrus_viqr.h with 92% similarity]
lib/i18n_module/ZW/Makefile
lib/i18n_module/ZW/citrus_zw.c [moved from lib/libc/citrus/modules/citrus_zw.c with 68% similarity]
lib/i18n_module/ZW/citrus_zw.h [moved from lib/libc/citrus/modules/citrus_zw.h with 92% similarity]
lib/i18n_module/iconv_none/Makefile
lib/i18n_module/iconv_none/citrus_iconv_none.c [moved from lib/libc/citrus/modules/citrus_iconv_none.c with 75% similarity]
lib/i18n_module/iconv_none/citrus_iconv_none.h [moved from lib/libc/citrus/modules/citrus_iconv_none.h with 87% similarity]
lib/i18n_module/iconv_std/Makefile
lib/i18n_module/iconv_std/citrus_iconv_std.c [moved from lib/libc/citrus/modules/citrus_iconv_std.c with 76% similarity]
lib/i18n_module/iconv_std/citrus_iconv_std.h [moved from lib/libc/citrus/modules/citrus_iconv_std.h with 87% similarity]
lib/i18n_module/iconv_std/citrus_iconv_std_local.h [moved from lib/libc/citrus/modules/citrus_iconv_std_local.h with 76% similarity]
lib/i18n_module/mapper_646/Makefile
lib/i18n_module/mapper_646/citrus_mapper_646.c [moved from lib/libc/citrus/modules/citrus_mapper_646.c with 72% similarity]
lib/i18n_module/mapper_646/citrus_mapper_646.h [moved from lib/libc/citrus/modules/citrus_mapper_646.h with 85% similarity]
lib/i18n_module/mapper_none/Makefile
lib/i18n_module/mapper_none/citrus_mapper_none.c [moved from lib/libc/citrus/modules/citrus_mapper_none.c with 73% similarity]
lib/i18n_module/mapper_none/citrus_mapper_none.h [moved from lib/libc/citrus/modules/citrus_mapper_none.h with 87% similarity]
lib/i18n_module/mapper_parallel/Makefile
lib/i18n_module/mapper_serial/Makefile
lib/i18n_module/mapper_serial/citrus_mapper_serial.c [moved from lib/libc/citrus/modules/citrus_mapper_serial.c with 74% similarity]
lib/i18n_module/mapper_serial/citrus_mapper_serial.h [moved from lib/libc/citrus/modules/citrus_mapper_serial.h with 87% similarity]
lib/i18n_module/mapper_std/Makefile
lib/i18n_module/mapper_std/citrus_mapper_std.c [moved from lib/libc/citrus/modules/citrus_mapper_std.c with 76% similarity]
lib/i18n_module/mapper_std/citrus_mapper_std.h [moved from lib/libc/citrus/modules/citrus_mapper_std.h with 88% similarity]
lib/i18n_module/mapper_std/citrus_mapper_std_file.h [moved from lib/libc/citrus/modules/citrus_mapper_std_file.h with 78% similarity]
lib/i18n_module/mapper_std/citrus_mapper_std_local.h [moved from lib/libc/citrus/modules/citrus_mapper_std_local.h with 89% similarity]
lib/i18n_module/mapper_zone/Makefile
lib/i18n_module/mapper_zone/citrus_mapper_zone.c [moved from lib/libc/citrus/modules/citrus_mapper_zone.c with 69% similarity]
lib/i18n_module/mapper_zone/citrus_mapper_zone.h [moved from lib/libc/citrus/modules/citrus_mapper_zone.h with 87% similarity]
lib/libarchive/config.h
lib/libc/citrus/Makefile.inc
lib/libc/citrus/Symbol.map
lib/libc/citrus/_strtol.h [moved from lib/libc/locale/_wcstol.h with 56% similarity]
lib/libc/citrus/_strtoul.h [moved from lib/libc/locale/_wcstoul.h with 66% similarity]
lib/libc/citrus/citrus_aliasname_local.h [copied from lib/libc/citrus/citrus_hash.c with 68% similarity]
lib/libc/citrus/citrus_bcs.c
lib/libc/citrus/citrus_bcs.h
lib/libc/citrus/citrus_bcs_strtol.c [copied from lib/libc/stdlib/strtoimax.c with 73% similarity]
lib/libc/citrus/citrus_bcs_strtoul.c [copied from lib/libc/stdlib/strtoumax.c with 72% similarity]
lib/libc/citrus/citrus_csmapper.c
lib/libc/citrus/citrus_csmapper.h
lib/libc/citrus/citrus_ctype.c [deleted file]
lib/libc/citrus/citrus_ctype.h [deleted file]
lib/libc/citrus/citrus_ctype_fallback.c [deleted file]
lib/libc/citrus/citrus_ctype_local.h [deleted file]
lib/libc/citrus/citrus_ctype_template.h [deleted file]
lib/libc/citrus/citrus_db.c
lib/libc/citrus/citrus_db.h
lib/libc/citrus/citrus_db_factory.c
lib/libc/citrus/citrus_db_factory.h
lib/libc/citrus/citrus_db_file.h
lib/libc/citrus/citrus_db_hash.c
lib/libc/citrus/citrus_db_hash.h
lib/libc/citrus/citrus_esdb.c
lib/libc/citrus/citrus_esdb.h
lib/libc/citrus/citrus_esdb_file.h
lib/libc/citrus/citrus_fix_grouping.h [moved from lib/libc/locale/rune_local.h with 60% similarity]
lib/libc/citrus/citrus_hash.c
lib/libc/citrus/citrus_hash.h
lib/libc/citrus/citrus_iconv.c
lib/libc/citrus/citrus_iconv.h
lib/libc/citrus/citrus_iconv_local.h
lib/libc/citrus/citrus_lock.h [moved from lib/libc/locale/aliasname_local.h with 80% similarity]
lib/libc/citrus/citrus_lookup.c
lib/libc/citrus/citrus_lookup.h
lib/libc/citrus/citrus_lookup_factory.c
lib/libc/citrus/citrus_lookup_factory.h
lib/libc/citrus/citrus_lookup_file.h
lib/libc/citrus/citrus_mapper.c
lib/libc/citrus/citrus_mapper.h
lib/libc/citrus/citrus_mapper_local.h
lib/libc/citrus/citrus_memstream.c
lib/libc/citrus/citrus_memstream.h
lib/libc/citrus/citrus_mmap.c
lib/libc/citrus/citrus_mmap.h
lib/libc/citrus/citrus_module.c
lib/libc/citrus/citrus_module.h
lib/libc/citrus/citrus_namespace.h
lib/libc/citrus/citrus_none.c
lib/libc/citrus/citrus_none.h
lib/libc/citrus/citrus_pivot_factory.c
lib/libc/citrus/citrus_pivot_factory.h
lib/libc/citrus/citrus_pivot_file.h
lib/libc/citrus/citrus_prop.c
lib/libc/citrus/citrus_prop.h
lib/libc/citrus/citrus_region.h
lib/libc/citrus/citrus_stdenc.c
lib/libc/citrus/citrus_stdenc.h
lib/libc/citrus/citrus_stdenc_local.h
lib/libc/citrus/citrus_stdenc_template.h
lib/libc/citrus/citrus_types.h
lib/libc/gdtoa/machdep_ldisx.c
lib/libc/gen/Makefile.inc
lib/libc/gen/Symbol.map
lib/libc/gen/_once_stub.c [copied from lib/libc/stdio/fputws.c with 56% similarity]
lib/libc/gen/ctype.c [deleted file]
lib/libc/gen/fnmatch.3
lib/libc/gen/fnmatch.c
lib/libc/gen/glob.3
lib/libc/gen/glob.c
lib/libc/gen/isascii.c [deleted file]
lib/libc/gen/isgraph.3 [deleted file]
lib/libc/gen/libc_dlopen.c [copied from lib/libc/stdio/getwc.c with 74% similarity]
lib/libc/gen/tolower.c [deleted file]
lib/libc/gen/toupper.c [deleted file]
lib/libc/iconv/Makefile.inc
lib/libc/iconv/Symbol.map
lib/libc/iconv/__iconv_get_list.3 [copied from usr.bin/mkcsmapper/mkcsmapper.1 with 60% similarity]
lib/libc/iconv/iconv.3
lib/libc/iconv/iconv.c
lib/libc/iconv/iconv_canonicalize.3 [copied from usr.bin/mkcsmapper/mkcsmapper.1 with 66% similarity]
lib/libc/iconv/iconvctl.3 [new file with mode: 0644]
lib/libc/iconv/iconvlist.3 [copied from usr.bin/mkcsmapper/mkcsmapper.1 with 63% similarity]
lib/libc/include/libc_private.h
lib/libc/locale/DESIGN.xlocale [new file with mode: 0644]
lib/libc/locale/Makefile.inc
lib/libc/locale/Symbol.map
lib/libc/locale/__mb_cur_max.c [deleted file]
lib/libc/locale/__wctoint.h [deleted file]
lib/libc/locale/_def_messages.c [deleted file]
lib/libc/locale/_def_monetary.c [deleted file]
lib/libc/locale/_def_numeric.c [deleted file]
lib/libc/locale/_def_time.c [deleted file]
lib/libc/locale/_wcstod.h [deleted file]
lib/libc/locale/_wctrans.c [deleted file]
lib/libc/locale/_wctrans_local.h [deleted file]
lib/libc/locale/aliasname.c [deleted file]
lib/libc/locale/ascii.c [new file with mode: 0644]
lib/libc/locale/big5.5 [copied from lib/libc/locale/wcsftime.3 with 61% similarity]
lib/libc/locale/big5.c [new file with mode: 0644]
lib/libc/locale/btowc.3
lib/libc/locale/btowc.c [copied from lib/libc/stdio/getwc.c with 63% similarity]
lib/libc/locale/c16rtomb.c [moved from lib/libc/locale/multibyte_c90.c with 51% similarity]
lib/libc/locale/c16rtomb_iconv.c [new file with mode: 0644]
lib/libc/locale/c32rtomb.c [copied from lib/libc/locale/wcstoimax.c with 65% similarity]
lib/libc/locale/c32rtomb_iconv.c [new file with mode: 0644]
lib/libc/locale/cXXrtomb_iconv.h [new file with mode: 0644]
lib/libc/locale/collate.c
lib/libc/locale/collate.h
lib/libc/locale/collcmp.c
lib/libc/locale/ctype.3 [moved from lib/libc/gen/ctype.3 with 79% similarity]
lib/libc/locale/ctype.c [copied from lib/libc/string/wcscasecmp.c with 58% similarity]
lib/libc/locale/ctype_l.3 [new file with mode: 0644]
lib/libc/locale/digittoint.3 [copied from lib/libc/gen/toascii.3 with 64% similarity]
lib/libc/locale/duplocale.3 [copied from lib/libc/locale/towlower.3 with 51% similarity]
lib/libc/locale/euc.5 [new file with mode: 0644]
lib/libc/locale/euc.c [new file with mode: 0644]
lib/libc/locale/fix_grouping.c [copied from lib/libc/stdio/fputwc.c with 53% similarity]
lib/libc/locale/freelocale.3 [copied from lib/libc/gen/isascii.3 with 60% similarity]
lib/libc/locale/gb18030.5 [new file with mode: 0644]
lib/libc/locale/gb18030.c [new file with mode: 0644]
lib/libc/locale/gb2312.5 [copied from lib/libc/locale/wcsftime.3 with 62% similarity]
lib/libc/locale/gb2312.c [new file with mode: 0644]
lib/libc/locale/gbk.5 [copied from lib/libc/locale/wcsftime.3 with 55% similarity]
lib/libc/locale/gbk.c [new file with mode: 0644]
lib/libc/locale/isalnum.3 [moved from lib/libc/gen/isalnum.3 with 57% similarity]
lib/libc/locale/isalpha.3 [moved from lib/libc/gen/isalpha.3 with 59% similarity]
lib/libc/locale/isascii.3 [copied from lib/libc/gen/isascii.3 with 85% similarity]
lib/libc/locale/isblank.3 [moved from lib/libc/gen/isblank.3 with 65% similarity]
lib/libc/locale/iscntrl.3 [moved from lib/libc/gen/iscntrl.3 with 65% similarity]
lib/libc/locale/isctype.c [moved from lib/libc/gen/isctype.c with 52% similarity]
lib/libc/locale/isdigit.3 [moved from lib/libc/gen/isdigit.3 with 57% similarity]
lib/libc/locale/isgraph.3 [new file with mode: 0644]
lib/libc/locale/isideogram.3 [copied from lib/libc/string/wcswidth.3 with 63% similarity]
lib/libc/locale/islower.3 [moved from lib/libc/gen/islower.3 with 63% similarity]
lib/libc/locale/isphonogram.3 [copied from lib/libc/string/wcswidth.3 with 63% similarity]
lib/libc/locale/isprint.3 [moved from lib/libc/gen/isprint.3 with 52% similarity]
lib/libc/locale/ispunct.3 [moved from lib/libc/gen/ispunct.3 with 60% similarity]
lib/libc/locale/isrune.3 [copied from lib/libc/string/wcswidth.3 with 63% similarity]
lib/libc/locale/isspace.3 [moved from lib/libc/gen/isspace.3 with 62% similarity]
lib/libc/locale/isspecial.3 [copied from lib/libc/string/wcswidth.3 with 63% similarity]
lib/libc/locale/isupper.3 [moved from lib/libc/gen/isupper.3 with 71% similarity]
lib/libc/locale/iswalnum.3
lib/libc/locale/iswalnum_l.3 [new file with mode: 0644]
lib/libc/locale/iswctype.3 [deleted file]
lib/libc/locale/iswctype.c
lib/libc/locale/isxdigit.3 [moved from lib/libc/gen/isxdigit.3 with 64% similarity]
lib/libc/locale/ldpart.c [new file with mode: 0644]
lib/libc/locale/ldpart.h [copied from lib/libc/string/stpncpy.c with 78% similarity]
lib/libc/locale/lmessages.c [new file with mode: 0644]
lib/libc/locale/lmessages.h [copied from lib/libkiconv/quirks.h with 67% similarity]
lib/libc/locale/lmonetary.c [new file with mode: 0644]
lib/libc/locale/lmonetary.h [copied from lib/libc/citrus/citrus_esdb.h with 50% similarity]
lib/libc/locale/lnumeric.c [new file with mode: 0644]
lib/libc/locale/lnumeric.h [copied from lib/libc/string/wmemcmp.c with 64% similarity]
lib/libc/locale/localeconv.3 [new file with mode: 0644]
lib/libc/locale/localeconv.c
lib/libc/locale/mblen.3
lib/libc/locale/mblen.c [copied from lib/libc/string/wcsdup.c with 63% similarity]
lib/libc/locale/mblocal.h [new file with mode: 0644]
lib/libc/locale/mbrlen.3
lib/libc/locale/mbrlen.c [copied from lib/libc/string/wcsspn.c with 67% similarity]
lib/libc/locale/mbrtoc16.c [new file with mode: 0644]
lib/libc/locale/mbrtoc16_iconv.c [new file with mode: 0644]
lib/libc/locale/mbrtoc32.c [copied from lib/libc/string/wcscspn.c with 68% similarity]
lib/libc/locale/mbrtoc32_iconv.c [new file with mode: 0644]
lib/libc/locale/mbrtocXX_iconv.h [new file with mode: 0644]
lib/libc/locale/mbrtowc.3
lib/libc/locale/mbrtowc.c [copied from lib/libc/string/wcsspn.c with 64% similarity]
lib/libc/locale/mbsinit.3
lib/libc/locale/mbsinit.c [copied from lib/libc/stdio/fwprintf.c with 72% similarity]
lib/libc/locale/mbsnrtowcs.c [new file with mode: 0644]
lib/libc/locale/mbsrtowcs.3
lib/libc/locale/mbsrtowcs.c [copied from lib/libc/locale/wcstoll.c with 63% similarity]
lib/libc/locale/mbstowcs.3
lib/libc/locale/mbstowcs.c [copied from lib/libc/locale/wcstoll.c with 64% similarity]
lib/libc/locale/mbtowc.3
lib/libc/locale/mbtowc.c [copied from lib/libc/stdio/fgetwln.c with 61% similarity]
lib/libc/locale/mskanji.5 [copied from lib/libc/locale/wcstod.3 with 58% similarity]
lib/libc/locale/mskanji.c [new file with mode: 0644]
lib/libc/locale/multibyte.3 [new file with mode: 0644]
lib/libc/locale/multibyte.h [deleted file]
lib/libc/locale/multibyte_amd1.c [deleted file]
lib/libc/locale/newlocale.3 [new file with mode: 0644]
lib/libc/locale/nextwctype.3 [copied from lib/libc/string/wcswidth.3 with 63% similarity]
lib/libc/locale/nextwctype.c [new file with mode: 0644]
lib/libc/locale/nl_langinfo.3
lib/libc/locale/nl_langinfo.c
lib/libc/locale/nomacros.c [new file with mode: 0644]
lib/libc/locale/none.c [new file with mode: 0644]
lib/libc/locale/querylocale.3 [copied from lib/libc/gen/isascii.3 with 62% similarity]
lib/libc/locale/rpmatch.3 [copied from lib/libc/string/wcswidth.3 with 63% similarity]
lib/libc/locale/rpmatch.c [copied from lib/libc/stdio/fwprintf.c with 69% similarity]
lib/libc/locale/rune.c
lib/libc/locale/rune.h [deleted file]
lib/libc/locale/runefile.h [copied from lib/libc/string/wcsrchr.c with 66% similarity]
lib/libc/locale/runeglue.c [deleted file]
lib/libc/locale/runetable.c [deleted file]
lib/libc/locale/runetype.c [copied from lib/libc/locale/___runetype_mb.c with 56% similarity]
lib/libc/locale/runetype.h [deleted file]
lib/libc/locale/setlocale.3
lib/libc/locale/setlocale.c
lib/libc/locale/setlocale.h [copied from lib/libc/string/strchrnul.c with 70% similarity]
lib/libc/locale/setrunelocale.c
lib/libc/locale/table.c [new file with mode: 0644]
lib/libc/locale/toascii.3 [moved from lib/libc/gen/toascii.3 with 90% similarity]
lib/libc/locale/tolower.3 [moved from lib/libc/gen/tolower.3 with 78% similarity]
lib/libc/locale/tolower.c [copied from lib/libc/locale/___runetype_mb.c with 61% similarity]
lib/libc/locale/toupper.3 [copied from lib/libc/gen/toupper.3 with 78% similarity]
lib/libc/locale/toupper.c [moved from lib/libc/locale/___runetype_mb.c with 61% similarity]
lib/libc/locale/towctrans.3 [deleted file]
lib/libc/locale/towlower.3
lib/libc/locale/towupper.3 [moved from lib/libc/gen/toupper.3 with 73% similarity]
lib/libc/locale/uselocale.3 [moved from lib/libc/gen/isascii.3 with 62% similarity]
lib/libc/locale/utf8.5 [new file with mode: 0644]
lib/libc/locale/utf8.c [new file with mode: 0644]
lib/libc/locale/wcrtomb.3
lib/libc/locale/wcrtomb.c [copied from lib/libc/string/wcsspn.c with 67% similarity]
lib/libc/locale/wcsftime.3
lib/libc/locale/wcsftime.c
lib/libc/locale/wcsnrtombs.c [new file with mode: 0644]
lib/libc/locale/wcsrtombs.3
lib/libc/locale/wcsrtombs.c [copied from lib/libc/locale/wcstoimax.c with 62% similarity]
lib/libc/locale/wcstod.3
lib/libc/locale/wcstod.c
lib/libc/locale/wcstof.c
lib/libc/locale/wcstoimax.c
lib/libc/locale/wcstol.3
lib/libc/locale/wcstol.c
lib/libc/locale/wcstold.c
lib/libc/locale/wcstoll.c
lib/libc/locale/wcstombs.3
lib/libc/locale/wcstombs.c [copied from lib/libc/locale/wcstoll.c with 64% similarity]
lib/libc/locale/wcstoul.c
lib/libc/locale/wcstoull.c
lib/libc/locale/wcstoumax.c
lib/libc/locale/wctob.3 [deleted file]
lib/libc/locale/wctob.c [copied from lib/libc/stdio/fwprintf.c with 67% similarity]
lib/libc/locale/wctomb.3
lib/libc/locale/wctomb.c [copied from lib/libc/string/wcsdup.c with 63% similarity]
lib/libc/locale/wctrans.3
lib/libc/locale/wctrans.c [copied from lib/libc/stdio/fgetws.c with 50% similarity]
lib/libc/locale/wctype.3
lib/libc/locale/wctype.c [new file with mode: 0644]
lib/libc/locale/wcwidth.3
lib/libc/locale/wcwidth.c [moved from lib/libc/gen/toascii.c with 71% similarity]
lib/libc/locale/xlocale.3 [new file with mode: 0644]
lib/libc/locale/xlocale.c [new file with mode: 0644]
lib/libc/locale/xlocale_private.h [new file with mode: 0644]
lib/libc/nls/C.msg [new file with mode: 0644]
lib/libc/nls/Makefile.inc
lib/libc/nls/be_BY.UTF-8.msg [new file with mode: 0644]
lib/libc/nls/ca_ES.ISO8859-1.msg [new file with mode: 0644]
lib/libc/nls/catclose.3
lib/libc/nls/catclose.c [deleted file]
lib/libc/nls/catgets.3
lib/libc/nls/catgets.c [deleted file]
lib/libc/nls/catopen.3
lib/libc/nls/catopen.c [deleted file]
lib/libc/nls/de_DE.ISO8859-1.msg [new file with mode: 0644]
lib/libc/nls/el_GR.ISO8859-7.msg [new file with mode: 0644]
lib/libc/nls/es_ES.ISO8859-1.msg [new file with mode: 0644]
lib/libc/nls/fi_FI.ISO8859-1.msg [new file with mode: 0644]
lib/libc/nls/fr_FR.ISO8859-1.msg [new file with mode: 0644]
lib/libc/nls/gl_ES.ISO8859-1.msg [new file with mode: 0644]
lib/libc/nls/hu_HU.ISO8859-2.msg [new file with mode: 0644]
lib/libc/nls/it_IT.ISO8859-15.msg [new file with mode: 0644]
lib/libc/nls/ja_JP.UTF-8.msg [new file with mode: 0644]
lib/libc/nls/ja_JP.eucJP.msg [new file with mode: 0644]
lib/libc/nls/ko_KR.UTF-8.msg [new file with mode: 0644]
lib/libc/nls/ko_KR.eucKR.msg [new file with mode: 0644]
lib/libc/nls/mn_MN.UTF-8.msg [new file with mode: 0644]
lib/libc/nls/msgcat.c [new file with mode: 0644]
lib/libc/nls/nl_NL.ISO8859-1.msg [new file with mode: 0644]
lib/libc/nls/no_NO.ISO8859-1.msg [new file with mode: 0644]
lib/libc/nls/pl_PL.ISO8859-2.msg [new file with mode: 0644]
lib/libc/nls/pt_BR.ISO8859-1.msg [new file with mode: 0644]
lib/libc/nls/ru_RU.KOI8-R.msg [new file with mode: 0644]
lib/libc/nls/sk_SK.ISO8859-2.msg [new file with mode: 0644]
lib/libc/nls/sv_SE.ISO8859-1.msg [new file with mode: 0644]
lib/libc/nls/uk_UA.UTF-8.msg [new file with mode: 0644]
lib/libc/nls/zh_CN.GB18030.msg [new file with mode: 0644]
lib/libc/nls/zh_CN.GB2312.msg [new file with mode: 0644]
lib/libc/nls/zh_CN.UTF-8.msg [new file with mode: 0644]
lib/libc/regex/regcomp.c
lib/libc/stdio/Symbol.map
lib/libc/stdio/__fpending.c
lib/libc/stdio/_flock_stub.c
lib/libc/stdio/asprintf.c
lib/libc/stdio/fclose.c
lib/libc/stdio/fdopen.c
lib/libc/stdio/fflush.c
lib/libc/stdio/fgetln.c
lib/libc/stdio/fgets.c
lib/libc/stdio/fgetwc.c
lib/libc/stdio/fgetwln.3
lib/libc/stdio/fgetwln.c
lib/libc/stdio/fgetws.3
lib/libc/stdio/fgetws.c
lib/libc/stdio/findfp.c
lib/libc/stdio/fmemopen.c
lib/libc/stdio/fopen.c
lib/libc/stdio/fprintf.c
lib/libc/stdio/fpurge.c
lib/libc/stdio/fputs.c
lib/libc/stdio/fputwc.c
lib/libc/stdio/fputws.3
lib/libc/stdio/fputws.c
lib/libc/stdio/fread.c
lib/libc/stdio/freopen.c
lib/libc/stdio/fscanf.c
lib/libc/stdio/fseek.c
lib/libc/stdio/ftell.c
lib/libc/stdio/funopen.c
lib/libc/stdio/fvwrite.c
lib/libc/stdio/fwalk.c
lib/libc/stdio/fwide.c
lib/libc/stdio/fwprintf.c
lib/libc/stdio/fwrite.c
lib/libc/stdio/fwscanf.c
lib/libc/stdio/getdelim.c
lib/libc/stdio/gets.c
lib/libc/stdio/getwc.c
lib/libc/stdio/getwchar.c
lib/libc/stdio/local.h
lib/libc/stdio/makebuf.c
lib/libc/stdio/perror.c
lib/libc/stdio/printf.c
lib/libc/stdio/printfcommon.h
lib/libc/stdio/puts.c
lib/libc/stdio/putwc.c
lib/libc/stdio/putwchar.c
lib/libc/stdio/refill.c
lib/libc/stdio/rget.c
lib/libc/stdio/scanf.3
lib/libc/stdio/scanf.c
lib/libc/stdio/setvbuf.c
lib/libc/stdio/snprintf.c
lib/libc/stdio/sprintf.c
lib/libc/stdio/sreadahead.c
lib/libc/stdio/sscanf.c
lib/libc/stdio/stdio.c
lib/libc/stdio/ungetc.c
lib/libc/stdio/ungetwc.3
lib/libc/stdio/ungetwc.c
lib/libc/stdio/vasprintf.c
lib/libc/stdio/vdprintf.c
lib/libc/stdio/vfprintf.c
lib/libc/stdio/vfscanf.c
lib/libc/stdio/vfwprintf.c
lib/libc/stdio/vfwscanf.c
lib/libc/stdio/vscanf.c
lib/libc/stdio/vsnprintf.c
lib/libc/stdio/vsprintf.c
lib/libc/stdio/vsscanf.c
lib/libc/stdio/vswprintf.c
lib/libc/stdio/vswscanf.c
lib/libc/stdio/wbuf.c
lib/libc/stdio/wprintf.3
lib/libc/stdio/wprintf.c
lib/libc/stdio/wscanf.3
lib/libc/stdio/wscanf.c
lib/libc/stdio/wsetup.c
lib/libc/stdlib/strtoimax.c
lib/libc/stdlib/strtol.c
lib/libc/stdlib/strtoumax.c
lib/libc/stdtime/Makefile.inc
lib/libc/stdtime/Symbol.map
lib/libc/stdtime/asctime.c
lib/libc/stdtime/ctime.3
lib/libc/stdtime/difftime.c
lib/libc/stdtime/localtime.c
lib/libc/stdtime/private.h
lib/libc/stdtime/strftime.3
lib/libc/stdtime/strftime.c
lib/libc/stdtime/strptime.3
lib/libc/stdtime/strptime.c
lib/libc/stdtime/time2posix.3
lib/libc/stdtime/time32.c
lib/libc/stdtime/timelocal.c [new file with mode: 0644]
lib/libc/stdtime/timelocal.h [copied from lib/libc/gdtoa/machdep_ldisx.c with 59% similarity]
lib/libc/stdtime/tzfile.5
lib/libc/stdtime/tzfile.h
lib/libc/string/Makefile.inc
lib/libc/string/Symbol.map
lib/libc/string/bcmp.3
lib/libc/string/bcmp.c
lib/libc/string/bcopy.3
lib/libc/string/bcopy.c
lib/libc/string/bstring.3
lib/libc/string/bzero.3
lib/libc/string/ffs.3
lib/libc/string/ffs.c
lib/libc/string/ffsl.c
lib/libc/string/ffsll.c
lib/libc/string/fls.c
lib/libc/string/flsl.c
lib/libc/string/flsll.c
lib/libc/string/index.3
lib/libc/string/memccpy.3
lib/libc/string/memccpy.c
lib/libc/string/memchr.3
lib/libc/string/memchr.c
lib/libc/string/memcmp.3
lib/libc/string/memcmp.c
lib/libc/string/memcpy.3
lib/libc/string/memmem.3
lib/libc/string/memmem.c
lib/libc/string/memmove.3
lib/libc/string/memrchr.c
lib/libc/string/memset.3
lib/libc/string/memset.c
lib/libc/string/stpcpy.c
lib/libc/string/stpncpy.c
lib/libc/string/strcasecmp.3
lib/libc/string/strcasecmp.c
lib/libc/string/strcasestr.c
lib/libc/string/strcat.3
lib/libc/string/strcat.c
lib/libc/string/strchr.3
lib/libc/string/strchr.c
lib/libc/string/strchrnul.c
lib/libc/string/strcmp.3
lib/libc/string/strcmp.c
lib/libc/string/strcoll.3
lib/libc/string/strcoll.c
lib/libc/string/strcpy.3
lib/libc/string/strdup.3
lib/libc/string/strdup.c
lib/libc/string/strerror.3
lib/libc/string/strerror.c
lib/libc/string/strlcat.c
lib/libc/string/strlcpy.3
lib/libc/string/strlcpy.c
lib/libc/string/strncmp.c
lib/libc/string/strncpy.c
lib/libc/string/strndup.c
lib/libc/string/strnlen.c
lib/libc/string/strnstr.c
lib/libc/string/strpbrk.3
lib/libc/string/strpbrk.c
lib/libc/string/strrchr.c
lib/libc/string/strsep.3
lib/libc/string/strsep.c
lib/libc/string/strsignal.c
lib/libc/string/strstr.3
lib/libc/string/strstr.c
lib/libc/string/strtok.3
lib/libc/string/strtok.c
lib/libc/string/strxfrm.3
lib/libc/string/strxfrm.c
lib/libc/string/swab.3
lib/libc/string/swab.c
lib/libc/string/wcpcpy.c [copied from lib/libc/string/stpcpy.c with 91% similarity]
lib/libc/string/wcpncpy.c [copied from lib/libc/string/stpncpy.c with 84% similarity]
lib/libc/string/wcscasecmp.c
lib/libc/string/wcscat.c
lib/libc/string/wcschr.c
lib/libc/string/wcscmp.c
lib/libc/string/wcscoll.3
lib/libc/string/wcscoll.c
lib/libc/string/wcscpy.c
lib/libc/string/wcscspn.c
lib/libc/string/wcsdup.c
lib/libc/string/wcslcat.c
lib/libc/string/wcslcpy.c
lib/libc/string/wcslen.c
lib/libc/string/wcsncasecmp.c
lib/libc/string/wcsncat.c
lib/libc/string/wcsncmp.c
lib/libc/string/wcsncpy.c
lib/libc/string/wcsnlen.c
lib/libc/string/wcspbrk.c
lib/libc/string/wcsrchr.c
lib/libc/string/wcsspn.c
lib/libc/string/wcsstr.c
lib/libc/string/wcstok.3
lib/libc/string/wcstok.c
lib/libc/string/wcswidth.3
lib/libc/string/wcswidth.c
lib/libc/string/wcsxfrm.3
lib/libc/string/wcsxfrm.c
lib/libc/string/wmemchr.3
lib/libc/string/wmemchr.c
lib/libc/string/wmemcmp.c
lib/libc/string/wmemcpy.c
lib/libc/string/wmemmove.c
lib/libc/string/wmemset.c
lib/libcompat/4.3/re_comp.3
lib/libcompat/4.3/re_comp.c [moved from lib/libcompat/4.3/regex.c with 72% similarity]
lib/libcompat/Makefile
lib/libcompat/regexp/COPYRIGHT [deleted file]
lib/libcompat/regexp/README [deleted file]
lib/libcompat/regexp/regerror.c [deleted file]
lib/libcompat/regexp/regexp.3 [deleted file]
lib/libcompat/regexp/regexp.c [deleted file]
lib/libcompat/regexp/regmagic.h [deleted file]
lib/libcompat/regexp/regsub.c [deleted file]
lib/libkiconv/kiconv.3
lib/libkiconv/quirks.c
lib/libkiconv/quirks.h
lib/libkiconv/xlat16_iconv.c
lib/libkiconv/xlat16_sysctl.c
lib/libm/src/s_nan.c
secure/usr.bin/sftp/Makefile
share/Makefile
share/colldef/Makefile
share/colldef/la_LN.UTF-8.src [deleted file]
share/locale/Makefile [deleted file]
share/locale/ctype/Makefile [deleted file]
share/locale/ctype/charset/ASCII [deleted file]
share/locale/ctype/charset/GB2312 [deleted file]
share/locale/ctype/charset/JISX0201-left [deleted file]
share/locale/ctype/charset/JISX0201-right [deleted file]
share/locale/ctype/charset/JISX0208-1978 [deleted file]
share/locale/ctype/charset/JISX0208-1983 [deleted file]
share/locale/ctype/charset/KSC5601 [deleted file]
share/locale/ctype/charset/Latin-1 [deleted file]
share/locale/ctype/charset/Latin-2 [deleted file]
share/locale/ctype/charset/Latin-3 [deleted file]
share/locale/ctype/charset/Latin-4 [deleted file]
share/locale/ctype/charset/Latin-5 [deleted file]
share/locale/ctype/charset/Latin-6 [deleted file]
share/locale/ctype/charset/Latin-6+ [deleted file]
share/locale/ctype/charset/Latin-Cyrillic [deleted file]
share/locale/ctype/charset/Latin-Greek [deleted file]
share/locale/ctype/charset/Latin-Hebrew [deleted file]
share/locale/ctype/ja_JP.CTEXT.src [deleted file]
share/locale/ctype/ja_JP.ISO-2022-JP-2.src [deleted file]
share/locale/ctype/ja_JP.ISO-2022-JP.src [deleted file]
share/locale/ctype/ja_JP.eucJP.src [deleted file]
share/locale/ctype/kk_KZ.PT154.src [deleted file]
share/locale/ctype/ru_RU.ISO_8859-5.src [deleted file]
share/locale/ctype/tr_TR.ISO8859-9.src [deleted file]
share/locale/ctype/zh_CN.GB18030.src [deleted file]
share/locale/ctype/zh_TW.eucTW.src [deleted file]
share/locale/locale.alias [deleted file]
share/mklocale/Makefile [new file with mode: 0644]
share/mklocale/README.locale_name [new file with mode: 0644]
share/mklocale/UTF-8.src [moved from share/locale/ctype/en_US.UTF-8.src with 96% similarity]
share/mklocale/am_ET.UTF-8.src [new file with mode: 0644]
share/mklocale/be_BY.CP1131.src [moved from share/locale/ctype/be_BY.CP1131.src with 90% similarity]
share/mklocale/bg_BG.CP1251.src [moved from share/locale/ctype/bg_BG.CP1251.src with 91% similarity]
share/mklocale/el_GR.ISO8859-7.src [moved from share/locale/ctype/el_GR.ISO8859-7.src with 84% similarity]
share/mklocale/hi_IN.ISCII-DEV.src [new file with mode: 0644]
share/mklocale/hy_AM.ARMSCII-8.src [moved from share/locale/ctype/hy_AM.ARMSCII-8.src with 94% similarity]
share/mklocale/ja_JP.SJIS.src [moved from share/locale/ctype/ja_JP.SJIS.src with 94% similarity]
share/mklocale/ja_JP.eucJP.src [new file with mode: 0644]
share/mklocale/kk_KZ.PT154.src [new file with mode: 0644]
share/mklocale/ko_KR.CP949.src [new file with mode: 0644]
share/mklocale/ko_KR.eucKR.src [moved from share/locale/ctype/ko_KR.eucKR.src with 78% similarity]
share/mklocale/la_LN.ISO8859-1.src [copied from share/locale/ctype/en_US.ISO_8859-1.src with 78% similarity]
share/mklocale/la_LN.ISO8859-13.src [moved from share/locale/ctype/lt_LT.ISO8859-13.src with 79% similarity]
share/mklocale/la_LN.ISO8859-15.src [moved from share/locale/ctype/en_US.DIS_8859-15.src with 80% similarity]
share/mklocale/la_LN.ISO8859-2.src [moved from share/locale/ctype/en_US.ISO_8859-2.src with 66% similarity]
share/mklocale/la_LN.ISO8859-4.src [moved from share/locale/ctype/en_US.ISO_8859-4.src with 69% similarity]
share/mklocale/la_LN.US-ASCII.src [moved from share/locale/ctype/en_US.ASCII.src with 66% similarity]
share/mklocale/ru_RU.CP866.src [moved from share/locale/ctype/ru_RU.CP866.src with 50% similarity]
share/mklocale/ru_RU.ISO8859-5.src [new file with mode: 0644]
share/mklocale/ru_RU.KOI8-R.src [moved from share/locale/ctype/ru_RU.KOI8-R.src with 81% similarity]
share/mklocale/tr_TR.ISO8859-9.src [moved from share/locale/ctype/en_US.ISO_8859-1.src with 59% similarity]
share/mklocale/uk_UA.KOI8-U.src [moved from share/locale/ctype/uk_UA.KOI8-U.src with 81% similarity]
share/mklocale/zh_CN.GB18030.src [new file with mode: 0644]
share/mklocale/zh_CN.GB2312.src [new file with mode: 0644]
share/mklocale/zh_CN.GBK.src [new file with mode: 0644]
share/mklocale/zh_CN.eucCN.src [moved from share/locale/ctype/zh_CN.eucCN.src with 95% similarity]
share/mklocale/zh_HK.Big5HKSCS.src [moved from share/locale/ctype/zh_HK.Big5-HKSCS.src with 55% similarity]
share/mklocale/zh_TW.Big5.src [moved from share/locale/ctype/zh_TW.BIG5.src with 63% similarity]
share/monetdef/Makefile
share/monetdef/ca_ES.UTF-8.src [copied from share/monetdef/fo_FO.ISO8859-1.src with 78% similarity]
share/monetdef/de_AT.UTF-8.src [copied from share/monetdef/fo_FO.ISO8859-1.src with 79% similarity]
share/monetdef/de_DE.UTF-8.src [copied from share/monetdef/fo_FO.ISO8859-1.src with 79% similarity]
share/monetdef/el_GR.UTF-8.src [copied from share/monetdef/fo_FO.ISO8859-1.src with 73% similarity]
share/monetdef/es_ES.UTF-8.src [copied from share/monetdef/fo_FO.ISO8859-1.src with 79% similarity]
share/monetdef/fi_FI.UTF-8.src [copied from share/monetdef/fo_FO.ISO8859-1.src with 79% similarity]
share/monetdef/fr_BE.UTF-8.src [copied from share/monetdef/fo_FO.ISO8859-1.src with 79% similarity]
share/monetdef/fr_FR.UTF-8.src [copied from share/monetdef/fo_FO.ISO8859-1.src with 79% similarity]
share/monetdef/it_IT.UTF-8.src [copied from share/monetdef/fo_FO.ISO8859-1.src with 78% similarity]
share/monetdef/nl_BE.UTF-8.src [copied from share/monetdef/fo_FO.ISO8859-1.src with 79% similarity]
share/monetdef/nl_NL.UTF-8.src [moved from share/monetdef/fo_FO.ISO8859-1.src with 79% similarity]
share/numericdef/Makefile
share/numericdef/fo_FO.ISO8859-1.src [deleted file]
share/timedef/Makefile
share/timedef/fo_FO.ISO8859-1.src [deleted file]
sys/dev/disk/aic7xxx/aicasm/Makefile
sys/sys/_posix.h
sys/sys/cdefs.h
sys/sys/iconv.h
sys/sys/param.h
sys/sys/time.h
sys/sys/timespec.h [copied from usr.bin/mklocale/ldef.h with 64% similarity]
sys/sys/types.h
usr.bin/colldef/Makefile
usr.bin/colldef/colldef.1
usr.bin/colldef/common.h
usr.bin/colldef/parse.y
usr.bin/colldef/scan.l
usr.bin/gencat/Makefile
usr.bin/gencat/gencat.1
usr.bin/gencat/gencat.c
usr.bin/iconv/iconv.1
usr.bin/iconv/iconv.c
usr.bin/mkcsmapper/Makefile
usr.bin/mkcsmapper/ldef.h
usr.bin/mkcsmapper/lex.l
usr.bin/mkcsmapper/mkcsmapper.1
usr.bin/mkcsmapper/yacc.y
usr.bin/mklocale/Makefile
usr.bin/mklocale/extern.h [copied from usr.bin/mklocale/ldef.h with 59% similarity]
usr.bin/mklocale/ldef.h
usr.bin/mklocale/lex.l
usr.bin/mklocale/mklocale.1
usr.bin/mklocale/yacc.y

index fa0c8b0..5c0c7fd 100644 (file)
@@ -347,7 +347,6 @@ TO_REMOVE+=/usr/include/machine/pcvt_ioctl.h
 TO_REMOVE+=/usr/include/net/bpf_compat.h
 TO_REMOVE+=/usr/include/netinet/ipprotosw.h
 TO_REMOVE+=/usr/include/rune.h
-TO_REMOVE+=/usr/include/runetype.h
 TO_REMOVE+=/modules/if_snc.ko
 TO_REMOVE+=/usr/include/machine/gencount.h
 TO_REMOVE+=/usr/sbin/cursor
@@ -2148,6 +2147,13 @@ TO_REMOVE+=/usr/share/man/man4/uhidev.4.gz
 TO_REMOVE+=/boot/kernel/drmn.ko
 TO_REMOVE+=/boot/kernel/i915.ko
 TO_REMOVE+=/usr/share/man/man4/i915drm.4.gz
+TO_REMOVE+=/usr/share/nls/eu_ES.ISO8859-1
+TO_REMOVE+=/usr/share/nls/eu_ES.ISO8859-15
+TO_REMOVE+=/usr/share/nls/eu_ES.UTF-8
+TO_REMOVE+=/usr/share/nls/fo_FO.ISO8859-1
+TO_REMOVE+=/usr/share/nls/fo_FO.UTF-8
+TO_REMOVE+=/usr/share/nls/hi_IN.UTF-8
+TO_REMOVE+=/usr/share/nls/la_LN.UTF-8
 
 .if ${MACHINE_ARCH} == "x86_64"
 TO_REMOVE+=/usr/sbin/stlstats
index 8167c75..54c6f0b 100644 (file)
@@ -135,7 +135,7 @@ main(int argc, char **argv)
        if (!rflag && time(&tval) == -1)
                err(1, "time");
 
-       format = nl_langinfo(_DATE_FMT);
+       format = nl_langinfo(D_FMT);
 
        /* allow the operands in any order */
        if (*argv && **argv == '+') {
index 4420337..ed978af 100644 (file)
@@ -27,8 +27,6 @@
 //
 
 // Information as gleaned from /usr/include/ctype.h on DragonFly.
-// Full details can be found from git repo at:
-// http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/include/ctype.h
 
 _GLIBCXX_BEGIN_NAMESPACE(std)
 
@@ -40,6 +38,22 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
     // NB: Offsets into ctype<char>::_M_table force a particular size
     // on the mask type. Because of this, we don't use an enum.
+#ifdef _CTYPE_S
+    // DragonFly 3.6 and later
+    typedef unsigned long      mask;
+    static const mask upper    = _CTYPE_U;
+    static const mask lower    = _CTYPE_L;
+    static const mask alpha    = _CTYPE_A;
+    static const mask digit    = _CTYPE_D;
+    static const mask xdigit   = _CTYPE_X;
+    static const mask space    = _CTYPE_S;
+    static const mask print    = _CTYPE_R;
+    static const mask graph    = _CTYPE_A | _CTYPE_D | _CTYPE_P;
+    static const mask cntrl    = _CTYPE_C;
+    static const mask punct    = _CTYPE_P;
+    static const mask alnum    = _CTYPE_A | _CTYPE_D;
+#else
+    // DragonFly 3.4 and older
     typedef uint16_t           mask;
     static const mask upper    = _CTYPEMASK_U;
     static const mask lower    = _CTYPEMASK_L;
@@ -52,6 +66,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     static const mask cntrl    = _CTYPEMASK_C;
     static const mask punct    = _CTYPEMASK_P;
     static const mask alnum    = _CTYPEMASK_A | _CTYPEMASK_D;
+#endif
   };
 
 _GLIBCXX_END_NAMESPACE
index 7f84b25..e712a69 100644 (file)
@@ -74,7 +74,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   ctype<wchar_t>::
   do_is(mask __m, wchar_t __c) const
   {
+#ifdef _CTYPE_S
+    return __istype (__c, __m);
+#else
     return __libc_ctype_ [__c + 1] & __m;
+#endif
   }
 
   inline const wchar_t*
@@ -82,6 +86,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
   {
     for (; __lo < __hi; ++__vec, ++__lo)
+#ifdef _CTYPE_S
+      *__vec = __maskrune (*__lo, upper | lower | alpha | digit | xdigit
+                          | space | print | graph | cntrl | punct | alnum);
+#else
     {
       mask __m = 0;
       if (isupper (*__lo)) __m |= _CTYPEMASK_U;
@@ -99,6 +107,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
       *__vec = __m;
     }
+#endif
     return __hi;
   }
 
@@ -106,7 +115,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   ctype<wchar_t>::
   do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
   {
+#ifdef _CTYPE_S
+    while (__lo < __hi && ! __istype (*__lo, __m))
+#else
     while (__lo < __hi && !(__libc_ctype_ [*__lo + 1] & __m))
+#endif
       ++__lo;
     return __lo;
   }
@@ -115,7 +128,11 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   ctype<wchar_t>::
   do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
   {
+#ifdef _CTYPE_S
+    while (__lo < __hi && __istype (*__lo, __m))
+#else
     while (__lo < __hi && (__libc_ctype_ [*__lo + 1] & __m))
+#endif
       ++__lo;
     return __lo;
   }
index f1dd10b..dd4e2e2 100644 (file)
 
 // Information as gleaned from /usr/include/ctype.h
 
+#ifdef _CTYPE_S
+  extern "C" const unsigned long __libc_C_ctype_[];
+#else
   extern "C" const __uint16_t __libc_C_ctype_[];
+#endif
 
   const ctype_base::mask*
   ctype<char>::classic_table() throw()
index bcbf553..ed0ba86 100644 (file)
@@ -27,8 +27,6 @@
 //
 
 // Information as gleaned from /usr/include/ctype.h on DragonFly.
-// Full details can be found from git repo at:
-// http://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/include/ctype.h
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
@@ -42,6 +40,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
     // NB: Offsets into ctype<char>::_M_table force a particular size
     // on the mask type. Because of this, we don't use an enum.
+#ifdef _CTYPE_S
+    // DragonFly 3.6 and later
+    typedef unsigned long      mask;
+    static const mask upper    = _CTYPE_U;
+    static const mask lower    = _CTYPE_L;
+    static const mask alpha    = _CTYPE_A;
+    static const mask digit    = _CTYPE_D;
+    static const mask xdigit   = _CTYPE_X;
+    static const mask space    = _CTYPE_S;
+    static const mask print    = _CTYPE_R;
+    static const mask graph    = _CTYPE_A | _CTYPE_D | _CTYPE_P;
+    static const mask cntrl    = _CTYPE_C;
+    static const mask punct    = _CTYPE_P;
+    static const mask alnum    = _CTYPE_A | _CTYPE_D;
+#else
+    // DragonFly 3.4 and older
     typedef uint16_t           mask;
     static const mask upper    = _CTYPEMASK_U;
     static const mask lower    = _CTYPEMASK_L;
@@ -54,6 +68,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     static const mask cntrl    = _CTYPEMASK_C;
     static const mask punct    = _CTYPEMASK_P;
     static const mask alnum    = _CTYPEMASK_A | _CTYPEMASK_D;
+#endif
   };
 
 _GLIBCXX_END_NAMESPACE_VERSION
index c6e4ffe..1cf38da 100644 (file)
@@ -46,7 +46,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     if (_M_table)
       return _M_table[static_cast<unsigned char>(__c)] & __m;
     else
+#ifdef _CTYPE_S
+      return __istype(__c, __m);
+#else
       return __libc_ctype_ [__c + 1] & __m;
+#endif
   }
 
   const char*
@@ -59,6 +63,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     else
       for (;__low < __high; ++__vec, ++__low)
        {
+#ifdef _CTYPE_S
+         *__vec = __maskrune (*__low, upper | lower | alpha | digit | xdigit
+                              | space | print | graph | cntrl | punct | alnum);
+#else
          mask __m = 0;
          if (this->is(upper, *__low))  __m |= upper;
          if (this->is(lower, *__low))  __m |= lower;
@@ -73,6 +81,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
          // Do not include explicit line for alnum mask since it is a
          // pure composite of masks on DragonFly.
          *__vec = __m;
+#endif
        }
     return __high;
   }
@@ -110,7 +119,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   ctype<wchar_t>::
   do_is(mask __m, wchar_t __c) const
   {
+#ifdef _CTYPE_S
+    return __istype (__c, __m);
+#else
     return __libc_ctype_ [__c + 1] & __m;
+#endif
   }
 
   inline const wchar_t*
@@ -118,6 +131,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
   {
     for (; __lo < __hi; ++__vec, ++__lo)
+#ifdef _CTYPE_S
+      *__vec = __maskrune (*__lo, upper | lower | alpha | digit | xdigit
+                          | space | print | graph | cntrl | punct | alnum);
+#else
     {
       mask __m = 0;
       if (isupper (*__lo)) __m |= _CTYPEMASK_U;
@@ -135,6 +152,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       *__vec = __m;
     }
+#endif
     return __hi;
   }
 
@@ -142,7 +160,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   ctype<wchar_t>::
   do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
   {
+#ifdef _CTYPE_S
+    while (__lo < __hi && ! __istype (*__lo, __m))
+#else
     while (__lo < __hi && !(__libc_ctype_ [*__lo + 1] & __m))
+#endif
       ++__lo;
     return __lo;
   }
@@ -151,7 +173,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   ctype<wchar_t>::
   do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
   {
+#ifdef _CTYPE_S
+    while (__lo < __hi && __istype (*__lo, __m))
+#else
     while (__lo < __hi && (__libc_ctype_ [*__lo + 1] & __m))
+#endif
       ++__lo;
     return __lo;
   }
index 07d57f0..5f48dbc 100644 (file)
@@ -26,7 +26,6 @@ strtopdd.c
 strtopf.c
 strtopx.c
 strtopxL.c
-strtorQ.c
 strtordd.c
 strtorf.c
 strtorxL.c
diff --git a/contrib/gdtoa/README.DRAGONFLY b/contrib/gdtoa/README.DRAGONFLY
new file mode 100644 (file)
index 0000000..30e9835
--- /dev/null
@@ -0,0 +1,18 @@
+GDTOA
+=====
+
+Original source can be downloaded from:
+TBW
+
+A list of files and directories removed is in README.DELETED
+
+Local modifications applied to following files for locale support:
+       gdtoaimp.h
+       strtod.c
+       strtodg.c
+       strtof.c
+       strtod.c
+       strtorx.c
+
+This file should have been in the vendor branch and has since been modified:
+       strtorQ.c
index dfeb2d1..5dfec12 100644 (file)
@@ -26,6 +26,8 @@ THIS SOFTWARE.
 
 ****************************************************************/
 
+/* $FreeBSD: head/contrib/gdtoa/gdtoaimp.h 227753 2011-11-20 14:45:42Z theraven $ */
+
 /* This is a variation on dtoa.c that converts arbitary binary
    floating-point formats to and from decimal notation.  It uses
    double-precision arithmetic internally, so there are still
@@ -89,8 +91,7 @@ THIS SOFTWARE.
  * #define IBM for IBM mainframe-style floating-point arithmetic.
  * #define VAX for VAX-style floating-point arithmetic (D_floating).
  * #define No_leftright to omit left-right logic in fast floating-point
- *     computation of dtoa and gdtoa.  This will cause modes 4 and 5 to be
- *     treated the same as modes 2 and 3 for some inputs.
+ *     computation of dtoa.
  * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3.
  * #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines
  *     that use extended-precision instructions to compute rounded
@@ -179,8 +180,7 @@ THIS SOFTWARE.
 #ifndef GDTOAIMP_H_INCLUDED
 #define GDTOAIMP_H_INCLUDED
 
-#define USE_LOCALE
-#define Honor_FLT_ROUNDS
+#define        Long    int
 
 #include "gdtoa.h"
 #include "gd_qnan.h"
@@ -201,6 +201,7 @@ THIS SOFTWARE.
 #include "namespace.h"
 #include <pthread.h>
 #include "un-namespace.h"
+#include "xlocale_private.h"
 
 #ifdef KR_headers
 #define Char char
@@ -214,6 +215,12 @@ extern Char *MALLOC ANSI((size_t));
 #define MALLOC malloc
 #endif
 
+#define INFNAN_CHECK
+#define USE_LOCALE
+#define NO_LOCALE_CACHE
+#define Honor_FLT_ROUNDS
+#define Trust_FLT_ROUNDS
+
 #undef IEEE_Arith
 #undef Avoid_Underflow
 #ifdef IEEE_MC68k
@@ -519,11 +526,11 @@ extern void memcpy_D2A ANSI((void*, const void*, size_t));
 #define        strtoIQ         __strtoIQ
 #define        strtoIx         __strtoIx
 #define        strtoIxL        __strtoIxL
-#define        strtord         __strtord
+#define        strtord_l               __strtord_l
 #define        strtordd        __strtordd
 #define        strtorf         __strtorf
-#define        strtorQ         __strtorQ
-#define        strtorx         __strtorx
+#define        strtorQ_l               __strtorQ_l
+#define        strtorx_l               __strtorx_l
 #define        strtorxL        __strtorxL
 #define        strtodI         __strtodI
 #define        strtopd         __strtopd
@@ -556,7 +563,7 @@ extern void memcpy_D2A ANSI((void*, const void*, size_t));
 #define        hexdig          __hexdig_D2A
 #define        hexdig_init_D2A __hexdig_init_D2A
 #define        hexnan          __hexnan_D2A
-#define        hi0bits(x)      __hi0bits_D2A((ULong)(x))
+#define        hi0bits         __hi0bits_D2A
 #define        hi0bits_D2A     __hi0bits_D2A
 #define        i2b             __i2b_D2A
 #define        increment       __increment_D2A
@@ -574,7 +581,7 @@ extern void memcpy_D2A ANSI((void*, const void*, size_t));
 #define        s2b             __s2b_D2A
 #define        set_ones        __set_ones_D2A
 #define        strcp           __strcp_D2A
-#define        strcp_D2A       __strcp_D2A
+#define        strcp_D2A       __strcp_D2A
 #define        strtoIg         __strtoIg_D2A
 #define        sum             __sum_D2A
 #define        tens            __tens_D2A
@@ -605,13 +612,13 @@ extern void memcpy_D2A ANSI((void*, const void*, size_t));
  extern char *dtoa ANSI((double d, int mode, int ndigits,
                        int *decpt, int *sign, char **rve));
  extern void freedtoa ANSI((char*));
- extern char *g__fmt ANSI((char*, char*, char*, int, ULong, size_t));
  extern char *gdtoa ANSI((FPI *fpi, int be, ULong *bits, int *kindp,
                          int mode, int ndigits, int *decpt, char **rve));
+ extern char *g__fmt ANSI((char*, char*, char*, int, ULong, size_t));
  extern int gethex ANSI((CONST char**, FPI*, Long*, Bigint**, int));
  extern void hexdig_init_D2A(Void);
  extern int hexnan ANSI((CONST char**, FPI*, ULong*));
- extern int hi0bits_D2A ANSI((ULong));
+ extern int hi0bits ANSI((ULong));
  extern Bigint *i2b ANSI((int));
  extern Bigint *increment ANSI((Bigint*));
  extern int lo0bits ANSI((ULong*));
@@ -628,7 +635,7 @@ extern void memcpy_D2A ANSI((void*, const void*, size_t));
  extern Bigint *s2b ANSI((CONST char*, int, int, ULong, int));
  extern Bigint *set_ones ANSI((Bigint*, int));
  extern char *strcp ANSI((char*, const char*));
- extern int strtodg ANSI((CONST char*, char**, FPI*, Long*, ULong*));
+ extern int strtodg_l ANSI((CONST char*, char**, FPI*, Long*, ULong*, locale_t));
 
  extern int strtoId ANSI((CONST char *, char **, double *, double *));
  extern int strtoIdd ANSI((CONST char *, char **, double *, double *));
@@ -638,17 +645,18 @@ extern void memcpy_D2A ANSI((void*, const void*, size_t));
  extern int strtoIx ANSI((CONST char *, char **, void *, void *));
  extern int strtoIxL ANSI((CONST char *, char **, void *, void *));
  extern double strtod ANSI((const char *s00, char **se));
+ extern double strtod_l ANSI((const char *s00, char **se, locale_t));
  extern int strtopQ ANSI((CONST char *, char **, Void *));
  extern int strtopf ANSI((CONST char *, char **, float *));
  extern int strtopd ANSI((CONST char *, char **, double *));
  extern int strtopdd ANSI((CONST char *, char **, double *));
  extern int strtopx ANSI((CONST char *, char **, Void *));
  extern int strtopxL ANSI((CONST char *, char **, Void *));
- extern int strtord ANSI((CONST char *, char **, int, double *));
+ extern int strtord_l ANSI((CONST char *, char **, int, double *, locale_t));
  extern int strtordd ANSI((CONST char *, char **, int, double *));
  extern int strtorf ANSI((CONST char *, char **, int, float *));
- extern int strtorQ ANSI((CONST char *, char **, int, void *));
- extern int strtorx ANSI((CONST char *, char **, int, void *));
+ extern int strtorQ_l ANSI((CONST char *, char **, int, void *, locale_t));
+ extern int strtorx_l ANSI((CONST char *, char **, int, void *, locale_t));
  extern int strtorxL ANSI((CONST char *, char **, int, void *));
  extern Bigint *sum ANSI((Bigint*, Bigint*));
  extern int trailz ANSI((Bigint*));
index 6adef8b..6c7fad5 100644 (file)
@@ -29,6 +29,8 @@ THIS SOFTWARE.
 /* Please send bug reports to David M. Gay (dmg at acm dot org,
  * with " at " changed at "@" and " dot " changed to ".").     */
 
+/* $FreeBSD: head/contrib/gdtoa/strtod.c 227753 2011-11-20 14:45:42Z theraven $ */
+
 #include "gdtoaimp.h"
 #ifndef NO_FENV_H
 #include <fenv.h>
@@ -80,11 +82,11 @@ sulp
 #endif /*}*/
 
  double
-strtod
+strtod_l
 #ifdef KR_headers
-       (s00, se) CONST char *s00; char **se;
+       (s00, se, loc) CONST char *s00; char **se; locale_t loc
 #else
-       (CONST char *s00, char **se)
+       (CONST char *s00, char **se, locale_t loc)
 #endif
 {
 #ifdef Avoid_Underflow
@@ -106,14 +108,14 @@ strtod
 #endif
 #ifdef USE_LOCALE /*{{*/
 #ifdef NO_LOCALE_CACHE
-       char *decimalpoint = localeconv()->decimal_point;
+       char *decimalpoint = localeconv_l(loc)->decimal_point;
        int dplen = strlen(decimalpoint);
 #else
        char *decimalpoint;
        static char *decimalpoint_cache;
        static int dplen;
        if (!(s0 = decimalpoint_cache)) {
-               s0 = localeconv()->decimal_point;
+               s0 = localeconv_l(loc)->decimal_point;
                if ((decimalpoint_cache = (char*)MALLOC(strlen(s0) + 1))) {
                        strcpy(decimalpoint_cache, s0);
                        s0 = decimalpoint_cache;
@@ -315,7 +317,7 @@ strtod
                                        if (*s == '(' /*)*/
                                         && hexnan(&s, &fpinan, bits)
                                                        == STRTOG_NaNbits) {
-                                               word0(&rv) = 0x7ff00000 | bits[1];
+                                               word0(&rv) = 0x7ff80000 | bits[1];
                                                word1(&rv) = bits[0];
                                                }
                                        else {
@@ -1072,3 +1074,14 @@ strtod
        return sign ? -dval(&rv) : dval(&rv);
        }
 
+ double
+strtod
+#ifdef KR_headers
+       (s00, se, loc) CONST char *s00; char **se; locale_t
+#else
+       (CONST char *s00, char **se)
+#endif
+{
+       return strtod_l(s00, se, __get_locale());
+}
+
index 5059869..37832b4 100644 (file)
@@ -313,12 +313,12 @@ mantbits(U *d)
        }
 
  int
-strtodg
+strtodg_l
 #ifdef KR_headers
-       (s00, se, fpi, exp, bits)
-       CONST char *s00; char **se; FPI *fpi; Long *exp; ULong *bits;
+       (s00, se, fpi, exp, bits, loc)
+       CONST char *s00; char **se; FPI *fpi; Long *exp; ULong *bits; locale_t loc;
 #else
-       (CONST char *s00, char **se, FPI *fpi, Long *exp, ULong *bits)
+       (CONST char *s00, char **se, FPI *fpi, Long *exp, ULong *bits, locale_t loc)
 #endif
 {
        int abe, abits, asub;
@@ -334,14 +334,14 @@ strtodg
        Bigint *ab, *bb, *bb1, *bd, *bd0, *bs, *delta, *rvb, *rvb0;
 #ifdef USE_LOCALE /*{{*/
 #ifdef NO_LOCALE_CACHE
-       char *decimalpoint = localeconv()->decimal_point;
+       char *decimalpoint = localeconv_l(loc)->decimal_point;
        int dplen = strlen(decimalpoint);
 #else
        char *decimalpoint;
        static char *decimalpoint_cache;
        static int dplen;
        if (!(s0 = decimalpoint_cache)) {
-               s0 = localeconv()->decimal_point;
+               s0 = localeconv_l(loc)->decimal_point;
                if ((decimalpoint_cache = (char*)MALLOC(strlen(s0) + 1))) {
                        strcpy(decimalpoint_cache, s0);
                        s0 = decimalpoint_cache;
index a8beb35..60283d4 100644 (file)
@@ -29,13 +29,15 @@ THIS SOFTWARE.
 /* Please send bug reports to David M. Gay (dmg at acm dot org,
  * with " at " changed at "@" and " dot " changed to ".").     */
 
+/* $FreeBSD: head/contrib/gdtoa/strtof.c 227753 2011-11-20 14:45:42Z theraven $ */
+
 #include "gdtoaimp.h"
 
  float
 #ifdef KR_headers
-strtof(s, sp) CONST char *s; char **sp;
+strtof_l(s, sp, loc) CONST char *s; char **sp; locale_t loc;
 #else
-strtof(CONST char *s, char **sp)
+strtof_l(CONST char *s, char **sp, locale_t loc)
 #endif
 {
        static FPI fpi0 = { 24, 1-127-24+1,  254-127-24+1, 1, SI };
@@ -49,7 +51,7 @@ strtof(CONST char *s, char **sp)
 #define fpi &fpi0
 #endif
 
-       k = strtodg(s, sp, fpi, &exp, bits);
+       k = strtodg_l(s, sp, fpi, &exp, bits, loc);
        switch(k & STRTOG_Retmask) {
          case STRTOG_NoNumber:
          case STRTOG_Zero:
@@ -57,10 +59,14 @@ strtof(CONST char *s, char **sp)
                break;
 
          case STRTOG_Normal:
-         case STRTOG_NaNbits:
                u.L[0] = (bits[0] & 0x7fffff) | ((exp + 0x7f + 23) << 23);
                break;
 
+         case STRTOG_NaNbits:
+               /* FreeBSD local: always return a quiet NaN */
+               u.L[0] = bits[0] | 0x7fc00000;
+               break;
+
          case STRTOG_Denormal:
                u.L[0] = bits[0];
                break;
@@ -76,3 +82,13 @@ strtof(CONST char *s, char **sp)
                u.L[0] |= 0x80000000L;
        return u.f;
        }
+ float
+#ifdef KR_headers
+strtof(s, sp) CONST char *s; char **sp;
+#else
+strtof(CONST char *s, char **sp)
+#endif
+{
+       return strtof_l(s, sp, __get_locale());
+}
+
similarity index 64%
copy from contrib/gdtoa/strtorx.c
copy to contrib/gdtoa/strtorQ.c
index d2f9472..641f8ca 100644 (file)
@@ -29,6 +29,8 @@ THIS SOFTWARE.
 /* Please send bug reports to David M. Gay (dmg at acm dot org,
  * with " at " changed at "@" and " dot " changed to ".").     */
 
+/* $FreeBSD: head/contrib/gdtoa/strtorQ.c 227753 2011-11-20 14:45:42Z theraven $ */
+
 #include "gdtoaimp.h"
 
 #undef _0
@@ -41,70 +43,75 @@ THIS SOFTWARE.
 #define _1 1
 #define _2 2
 #define _3 3
-#define _4 4
 #endif
 #ifdef IEEE_8087
-#define _0 4
-#define _1 3
-#define _2 2
-#define _3 1
-#define _4 0
+#define _0 3
+#define _1 2
+#define _2 1
+#define _3 0
 #endif
 
  void
 #ifdef KR_headers
-ULtox(L, bits, exp, k) UShort *L; ULong *bits; Long exp; int k;
+ULtoQ(L, bits, exp, k) ULong *L; ULong *bits; Long exp; int k;
 #else
-ULtox(UShort *L, ULong *bits, Long exp, int k)
+ULtoQ(ULong *L, ULong *bits, Long exp, int k)
 #endif
 {
        switch(k & STRTOG_Retmask) {
          case STRTOG_NoNumber:
          case STRTOG_Zero:
-               L[0] = L[1] = L[2] = L[3] = L[4] = 0;
+               L[0] = L[1] = L[2] = L[3] = 0;
                break;
 
-         case STRTOG_Denormal:
-               L[_0] = 0;
-               goto normal_bits;
-
          case STRTOG_Normal:
+               L[_3] = bits[0];
+               L[_2] = bits[1];
+               L[_1] = bits[2];
+               L[_0] = (bits[3] & ~0x10000) | ((exp + 0x3fff + 112) << 16);
+               break;
+
          case STRTOG_NaNbits:
-               L[_0] = exp + 0x3fff + 63;
- normal_bits:
-               L[_4] = (UShort)bits[0];
-               L[_3] = (UShort)(bits[0] >> 16);
-               L[_2] = (UShort)bits[1];
-               L[_1] = (UShort)(bits[1] >> 16);
+               L[_3] = bits[0];
+               L[_2] = bits[1];
+               L[_1] = bits[2];
+               L[_0] = (bits[3] & ~0x10000)
+                   | (((exp + 0x3fff + 112) << 16) | (1 << 15));
+               break;
+
+         case STRTOG_Denormal:
+               L[_3] = bits[0];
+               L[_2] = bits[1];
+               L[_1] = bits[2];
+               L[_0] = bits[3];
                break;
 
          case STRTOG_Infinite:
-               L[_0] = 0x7fff;
-               L[_1] = 0x8000;
-               L[_2] = L[_3] = L[_4] = 0;
+               L[_0] = 0x7fff0000;
+               L[_1] = L[_2] = L[_3] = 0;
                break;
 
          case STRTOG_NaN:
-               L[0] = ldus_QNAN0;
-               L[1] = ldus_QNAN1;
-               L[2] = ldus_QNAN2;
-               L[3] = ldus_QNAN3;
-               L[4] = ldus_QNAN4;
+               L[0] = ld_QNAN0;
+               L[1] = ld_QNAN1;
+               L[2] = ld_QNAN2;
+               L[3] = ld_QNAN3;
          }
        if (k & STRTOG_Neg)
-               L[_0] |= 0x8000;
+               L[_0] |= 0x80000000L;
        }
 
  int
 #ifdef KR_headers
-strtorx(s, sp, rounding, L) CONST char *s; char **sp; int rounding; void *L;
+strtorQ_l(s, sp, rounding, L, locale) CONST char *s; char **sp; int rounding;
+void *L; locale_t locale;
 #else
-strtorx(CONST char *s, char **sp, int rounding, void *L)
+strtorQ_l(CONST char *s, char **sp, int rounding, void *L, locale_t locale)
 #endif
 {
-       static FPI fpi0 = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, SI };
+       static FPI fpi0 = { 113, 1-16383-113+1, 32766-16383-113+1, 1, SI };
        FPI *fpi, fpi1;
-       ULong bits[2];
+       ULong bits[4];
        Long exp;
        int k;
 
@@ -114,7 +121,7 @@ strtorx(CONST char *s, char **sp, int rounding, void *L)
                fpi1.rounding = rounding;
                fpi = &fpi1;
                }
-       k = strtodg(s, sp, fpi, &exp, bits);
-       ULtox((UShort*)L, bits, exp, k);
+       k = strtodg_l(s, sp, fpi, &exp, bits, locale);
+       ULtoQ((ULong*)L, bits, exp, k);
        return k;
        }
index 709af4c..490f3e1 100644 (file)
@@ -70,9 +70,10 @@ ULtod(ULong *L, ULong *bits, Long exp, int k)
 
  int
 #ifdef KR_headers
-strtord(s, sp, rounding, d) CONST char *s; char **sp; int rounding; double *d;
+strtord_l(s, sp, rounding, d, locale) CONST char *s; char **sp; int rounding;
+double *d; locale_t locale;
 #else
-strtord(CONST char *s, char **sp, int rounding, double *d)
+strtord_l(CONST char *s, char **sp, int rounding, double *d, locale_t locale)
 #endif
 {
        static FPI fpi0 = { 53, 1-1023-53+1, 2046-1023-53+1, 1, SI };
@@ -87,7 +88,8 @@ strtord(CONST char *s, char **sp, int rounding, double *d)
                fpi1.rounding = rounding;
                fpi = &fpi1;
                }
-       k = strtodg(s, sp, fpi, &exp, bits);
+       k = strtodg_l(s, sp, fpi, &exp, bits, locale);
        ULtod((ULong*)d, bits, exp, k);
        return k;
        }
+
index d2f9472..50453ce 100644 (file)
@@ -29,6 +29,8 @@ THIS SOFTWARE.
 /* Please send bug reports to David M. Gay (dmg at acm dot org,
  * with " at " changed at "@" and " dot " changed to ".").     */
 
+/* $FreeBSD: head/contrib/gdtoa/strtorx.c 227753 2011-11-20 14:45:42Z theraven $ */
+
 #include "gdtoaimp.h"
 
 #undef _0
@@ -69,7 +71,6 @@ ULtox(UShort *L, ULong *bits, Long exp, int k)
                goto normal_bits;
 
          case STRTOG_Normal:
-         case STRTOG_NaNbits:
                L[_0] = exp + 0x3fff + 63;
  normal_bits:
                L[_4] = (UShort)bits[0];
@@ -78,6 +79,14 @@ ULtox(UShort *L, ULong *bits, Long exp, int k)
                L[_1] = (UShort)(bits[1] >> 16);
                break;
 
+         case STRTOG_NaNbits:
+               L[_0] = exp + 0x3fff + 63;
+               L[_4] = (UShort)bits[0];
+               L[_3] = (UShort)(bits[0] >> 16);
+               L[_2] = (UShort)bits[1];
+               L[_1] = (UShort)((bits[1] >> 16) | (3 << 14));
+               break;
+
          case STRTOG_Infinite:
                L[_0] = 0x7fff;
                L[_1] = 0x8000;
@@ -97,9 +106,10 @@ ULtox(UShort *L, ULong *bits, Long exp, int k)
 
  int
 #ifdef KR_headers
-strtorx(s, sp, rounding, L) CONST char *s; char **sp; int rounding; void *L;
+strtorx_l(s, sp, rounding, L, locale) CONST char *s; char **sp; int rounding;
+void *L; locale_t locale;
 #else
-strtorx(CONST char *s, char **sp, int rounding, void *L)
+strtorx_l(CONST char *s, char **sp, int rounding, void *L, locale_t locale)
 #endif
 {
        static FPI fpi0 = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, SI };
@@ -114,7 +124,7 @@ strtorx(CONST char *s, char **sp, int rounding, void *L)
                fpi1.rounding = rounding;
                fpi = &fpi1;
                }
-       k = strtodg(s, sp, fpi, &exp, bits);
+       k = strtodg_l(s, sp, fpi, &exp, bits, locale);
        ULtox((UShort*)L, bits, exp, k);
        return k;
        }
index 1fc9e2d..d73c67d 100644 (file)
@@ -357,19 +357,6 @@ distribution:
 .endif
 
 distrib-dirs:
-       -set - `grep "^[a-zA-Z]" ${.CURDIR}/locale.deprecated`; \
-       while [ $$# -gt 0 ] ; \
-       do \
-               for dir in /usr/share/locale \
-                          /usr/share/nls \
-                          /usr/local/share/nls; \
-               do \
-                       test -d ${DESTDIR}/$${dir} && cd ${DESTDIR}/$${dir}; \
-                       test -L "$$2" && rm -rf "$$2"; \
-                       test \! -L "$$1" && test -d "$$1" && mv "$$1" "$$2"; \
-               done; \
-               shift; shift; \
-       done
        mtree -deU -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
        mtree -deU -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
        mtree -deU -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
@@ -388,14 +375,6 @@ distrib-dirs:
                ${LN} -s "$$2" "$$1"; \
                shift; shift; \
        done
-       cd ${DESTDIR}/usr/share/locale; \
-       set - `grep "^[a-zA-Z]" ${.CURDIR}/locale.alias`; \
-       while [ $$# -gt 0 ] ; \
-       do \
-               rm -rf "$$1"; \
-               ${LN} -s "$$2" "$$1"; \
-               shift; shift; \
-       done
        cd ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1; ${LN} -sf ../man* .
        cd ${DESTDIR}/usr/share/nls; \
        set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
diff --git a/etc/locale.alias b/etc/locale.alias
deleted file mode 100644 (file)
index 59efb4f..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-# $FreeBSD: src/etc/locale.alias,v 1.7.2.6 2002/04/15 00:44:13 dougb Exp $
-# $DragonFly: src/etc/locale.alias,v 1.2 2003/06/17 04:24:45 dillon Exp $
-
-ASCII                   en_US.US-ASCII
-US-ASCII                en_US.US-ASCII
-af_ZA.ISO_8859-1        af_ZA.ISO8859-1
-af_ZA.ISO_8859-15       af_ZA.ISO8859-15
-cs_CZ.ISO_8859-2        cs_CZ.ISO8859-2
-da_DK.ISO_8859-1        da_DK.ISO8859-1
-da_DK.ISO_8859-15       da_DK.ISO8859-15
-de_AT.ISO_8859-1        de_AT.ISO8859-1
-de_AT.ISO_8859-15       de_AT.ISO8859-15
-de_CH.ISO_8859-1        de_CH.ISO8859-1
-de_CH.ISO_8859-15       de_CH.ISO8859-15
-de_DE.ISO_8859-1        de_DE.ISO8859-1
-de_DE.ISO_8859-15       de_DE.ISO8859-15
-el_GR.ISO_8859-7        el_GR.ISO8859-7
-en_AU.ISO_8859-1        en_AU.ISO8859-1
-en_AU.ISO_8859-15       en_AU.ISO8859-15
-en_CA.ISO_8859-1        en_CA.ISO8859-1
-en_CA.ISO_8859-15       en_CA.ISO8859-15
-en_GB.ISO_8859-1        en_GB.ISO8859-1
-en_GB.ISO_8859-15       en_GB.ISO8859-15
-en_NZ.ISO_8859-1        en_NZ.ISO8859-1
-en_NZ.ISO_8859-15       en_NZ.ISO8859-15
-en_US.ISO_8859-1        en_US.ISO8859-1
-en_US.ISO_8859-15       en_US.ISO8859-15
-es_ES.ISO_8859-1        es_ES.ISO8859-1
-es_ES.ISO_8859-15       es_ES.ISO8859-15
-et_EE.ISO_8859-15       et_EE.ISO8859-15
-fi_FI.ISO_8859-1        fi_FI.ISO8859-1
-fi_FI.ISO_8859-15       fi_FI.ISO8859-15
-fr_BE.ISO_8859-1        fr_BE.ISO8859-1
-fr_BE.ISO_8859-15       fr_BE.ISO8859-15
-fr_CA.ISO_8859-1        fr_CA.ISO8859-1
-fr_CA.ISO_8859-15       fr_CA.ISO8859-15
-fr_CH.ISO_8859-1        fr_CH.ISO8859-1
-fr_CH.ISO_8859-15       fr_CH.ISO8859-15
-fr_FR.ISO_8859-1        fr_FR.ISO8859-1
-fr_FR.ISO_8859-15       fr_FR.ISO8859-15
-hr_HR.ISO_8859-2        hr_HR.ISO8859-2
-hu_HU.ISO_8859-2        hu_HU.ISO8859-2
-is_IS.ISO_8859-1        is_IS.ISO8859-1
-is_IS.ISO_8859-15       is_IS.ISO8859-15
-it_CH.ISO_8859-1        it_CH.ISO8859-1
-it_CH.ISO_8859-15       it_CH.ISO8859-15
-it_IT.ISO_8859-1        it_IT.ISO8859-1
-it_IT.ISO_8859-15       it_IT.ISO8859-15
-ja_JP.EUC               ja_JP.eucJP
-ja_JP.Shift_JIS         ja_JP.SJIS
-ko_KR.EUC               ko_KR.eucKR
-la_LN.ASCII             la_LN.US-ASCII
-la_LN.ISO_8859-1        la_LN.ISO8859-1
-la_LN.ISO_8859-15       la_LN.ISO8859-15
-la_LN.ISO_8859-2        la_LN.ISO8859-2
-la_LN.ISO_8859-4        la_LN.ISO8859-4
-lt_LT.ISO_8859-4        lt_LT.ISO8859-4
-nl_BE.ISO_8859-1        nl_BE.ISO8859-1
-nl_BE.ISO_8859-15       nl_BE.ISO8859-15
-nl_NL.ISO_8859-1        nl_NL.ISO8859-1
-nl_NL.ISO_8859-15       nl_NL.ISO8859-15
-no_NO.ISO_8859-1        no_NO.ISO8859-1
-no_NO.ISO_8859-15       no_NO.ISO8859-15
-pl_PL.ISO_8859-2        pl_PL.ISO8859-2
-pt_PT.ISO_8859-1        pt_PT.ISO8859-1
-pt_PT.ISO_8859-15       pt_PT.ISO8859-15
-ru_SU.CP866             ru_RU.CP866
-ru_RU.ISO_8859-5        ru_RU.ISO8859-5
-ru_SU.ISO8859-5         ru_RU.ISO8859-5
-ru_SU.ISO_8859-5        ru_RU.ISO8859-5
-ru_SU.KOI8-R            ru_RU.KOI8-R
-sk_SK.ISO_8859-2        sk_SK.ISO8859-2
-sl_SI.ISO_8859-2        sl_SI.ISO8859-2
-sv_SE.ISO_8859-1        sv_SE.ISO8859-1
-sv_SE.ISO_8859-15       sv_SE.ISO8859-15
-tr_TR.ISO_8859-9        tr_TR.ISO8859-9
-zh_CN.EUC               zh_CN.eucCN
diff --git a/etc/locale.deprecated b/etc/locale.deprecated
deleted file mode 100644 (file)
index 536bf3a..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-# $FreeBSD: src/etc/locale.deprecated,v 1.2.2.6 2002/04/15 07:54:19 phantom Exp $
-# $DragonFly: src/etc/locale.deprecated,v 1.2 2003/06/17 04:24:45 dillon Exp $
-#
-# List of deprecated locales
-#
-# Make sure that deprecated locale directories and their replacements
-# are set up correctly.
-#
-# Format:
-# <deprecated_locale>  <new_locale>
-#
-ja_JP.EUC              ja_JP.eucJP
-ko_KR.EUC              ko_KR.eucKR
-ru_SU.CP866            ru_RU.CP866
-ru_SU.ISO_8859-5       ru_RU.ISO8859-5
-ru_SU.KOI8-R           ru_RU.KOI8-R
-zh_CN.EUC              zh_CN.eucCN
index bc4c94e..3c98362 100644 (file)
     ..
     vm
     ..
+    xlocale
+    ..
 ..
index 7b901ff..20ce7fd 100644 (file)
             ..
             fr_FR.UTF-8
             ..
+            gl_ES.ISO8859-1
+            ..
             he_IL.UTF-8
             ..
             hi_IN.ISCII-DEV
             ..
             et_EE.UTF-8
             ..
-            eu_ES.ISO8859-1
-            ..
-            eu_ES.ISO8859-15
-            ..
-            eu_ES.UTF-8
-            ..
             fi_FI.ISO8859-1
             ..
             fi_FI.ISO8859-15
             ..
             fi_FI.UTF-8
             ..
-            fo_FO.ISO8859-1
-            ..
-            fo_FO.UTF-8
-            ..
             fr_BE.ISO8859-1
             ..
             fr_BE.ISO8859-15
             ..
             fr_FR.UTF-8
             ..
+            gl_ES.ISO8859-1
+            ..
             he_IL.UTF-8
             ..
             hi_IN.ISCII-DEV
             ..
-            hi_IN.UTF-8
-            ..
             hr_HR.ISO8859-2
             ..
             hr_HR.UTF-8
             ..
             la_LN.ISO8859-1
             ..
+            la_LN.ISO8859-13
+            ..
             la_LN.ISO8859-15
             ..
             la_LN.ISO8859-2
             ..
             la_LN.US-ASCII
             ..
-            la_LN.UTF-8
-            ..
             lt_LT.ISO8859-13
             ..
             lt_LT.ISO8859-4
             ..
             lt_LT.UTF-8
             ..
+            lv_LV.ISO8859-13
+            ..
+            lv_LV.UTF-8
+            ..
+            mn_MN.UTF-8
+            ..
             nl_BE.ISO8859-1
             ..
             nl_BE.ISO8859-15
index 567d8f1..ea4e210 100644 (file)
@@ -1,79 +1,4 @@
-# $FreeBSD: src/etc/nls.alias,v 1.2.2.6 2002/04/15 00:44:13 dougb Exp $
-# $DragonFly: src/etc/nls.alias,v 1.2 2003/06/17 04:24:45 dillon Exp $
+# $FreeBSD: head/etc/nls.alias 116133 2003-06-10 01:22:30Z ache $
 
-ASCII                   C
 POSIX                   C
-US-ASCII                C
-af_ZA.ISO_8859-1        af_ZA.ISO8859-1
-af_ZA.ISO_8859-15       af_ZA.ISO8859-15
-cs_CZ.ISO_8859-2        cs_CZ.ISO8859-2
-da_DK.ISO_8859-1        da_DK.ISO8859-1
-da_DK.ISO_8859-15       da_DK.ISO8859-15
-de_AT.ISO_8859-1        de_AT.ISO8859-1
-de_AT.ISO_8859-15       de_AT.ISO8859-15
-de_CH.ISO_8859-1        de_CH.ISO8859-1
-de_CH.ISO_8859-15       de_CH.ISO8859-15
-de_DE.ISO_8859-1        de_DE.ISO8859-1
-de_DE.ISO_8859-15       de_DE.ISO8859-15
-el_GR.ISO_8859-7        el_GR.ISO8859-7
-en_AU.ISO_8859-1        en_AU.ISO8859-1
-en_AU.ISO_8859-15       en_AU.ISO8859-15
-en_CA.ISO_8859-1        en_CA.ISO8859-1
-en_CA.ISO_8859-15       en_CA.ISO8859-15
-en_GB.ISO_8859-1        en_GB.ISO8859-1
-en_GB.ISO_8859-15       en_GB.ISO8859-15
-en_NZ.ISO_8859-1        en_NZ.ISO8859-1
-en_NZ.ISO_8859-15       en_NZ.ISO8859-15
-en_US.ISO_8859-1        en_US.ISO8859-1
-en_US.ISO_8859-15       en_US.ISO8859-15
 en_US.US-ASCII          C
-es_ES.ISO_8859-1        es_ES.ISO8859-1
-es_ES.ISO_8859-15       es_ES.ISO8859-15
-et_EE.ISO_8859-15       et_EE.ISO8859-15
-fi_FI.ISO_8859-1        fi_FI.ISO8859-1
-fi_FI.ISO_8859-15       fi_FI.ISO8859-15
-fr_BE.ISO_8859-1        fr_BE.ISO8859-1
-fr_BE.ISO_8859-15       fr_BE.ISO8859-15
-fr_CA.ISO_8859-1        fr_CA.ISO8859-1
-fr_CA.ISO_8859-15       fr_CA.ISO8859-15
-fr_CH.ISO_8859-1        fr_CH.ISO8859-1
-fr_CH.ISO_8859-15       fr_CH.ISO8859-15
-fr_FR.ISO_8859-1        fr_FR.ISO8859-1
-fr_FR.ISO_8859-15       fr_FR.ISO8859-15
-hr_HR.ISO_8859-2        hr_HR.ISO8859-2
-hu_HU.ISO_8859-2        hu_HU.ISO8859-2
-is_IS.ISO_8859-1        is_IS.ISO8859-1
-is_IS.ISO_8859-15       is_IS.ISO8859-15
-it_CH.ISO_8859-1        it_CH.ISO8859-1
-it_CH.ISO_8859-15       it_CH.ISO8859-15
-it_IT.ISO_8859-1        it_IT.ISO8859-1
-it_IT.ISO_8859-15       it_IT.ISO8859-15
-ja_JP.EUC               ja_JP.eucJP
-ja_JP.Shift_JIS         ja_JP.SJIS
-ko_KR.EUC               ko_KR.eucKR
-la_LN.ASCII             la_LN.US-ASCII
-la_LN.ISO_8859-1        la_LN.ISO8859-1
-la_LN.ISO_8859-15       la_LN.ISO8859-15
-la_LN.ISO_8859-2        la_LN.ISO8859-2
-la_LN.ISO_8859-4        la_LN.ISO8859-4
-lt_LT.ISO_8859-4        lt_LT.ISO8859-4
-nl_BE.ISO_8859-1        nl_BE.ISO8859-1
-nl_BE.ISO_8859-15       nl_BE.ISO8859-15
-nl_NL.ISO_8859-1        nl_NL.ISO8859-1
-nl_NL.ISO_8859-15       nl_NL.ISO8859-15
-no_NO.ISO_8859-1        no_NO.ISO8859-1
-no_NO.ISO_8859-15       no_NO.ISO8859-15
-pl_PL.ISO_8859-2        pl_PL.ISO8859-2
-pt_PT.ISO_8859-1        pt_PT.ISO8859-1
-pt_PT.ISO_8859-15       pt_PT.ISO8859-15
-ru_RU.ISO_8859-5        ru_RU.ISO8859-5
-ru_SU.CP866             ru_RU.CP866
-ru_SU.ISO_8859-5        ru_RU.ISO8859-5
-ru_SU.ISO8859-5         ru_RU.ISO8859-5
-ru_SU.KOI8-R            ru_RU.KOI8-R
-sk_SK.ISO_8859-2        sk_SK.ISO8859-2
-sl_SI.ISO_8859-2        sl_SI.ISO8859-2
-sv_SE.ISO_8859-1        sv_SE.ISO8859-1
-sv_SE.ISO_8859-15       sv_SE.ISO8859-15
-tr_TR.ISO_8859-9        tr_TR.ISO8859-9
-zh_CN.EUC               zh_CN.eucCN
index 1194eaa..97d8c89 100644 (file)
@@ -72,7 +72,9 @@ SRCS=         argmatch.c \
                openat-proc.c \
                regex.c \
                strerror.c \
-               strerror-override.c \
-               wcwidth.c
+               strerror-override.c
+
+# no longer needed
+#              wcwidth.c
 
 .include <bsd.lib.mk>
index 3b367fb..a625f6b 100644 (file)
@@ -7,7 +7,7 @@
 # links.
 
 CLEANFILES= osreldate.h version vers.c vers.txt
-SUBDIR= arpa protocols rpc rpcsvc
+SUBDIR= arpa protocols rpc rpcsvc xlocale
 INCS=  a.out.h ar.h assert.h bitstring.h cpio.h ctype.h db.h \
        dirent.h disktab.h \
        dlfcn.h elf.h elf-hints.h err.h float.h fmtmsg.h fnmatch.h fstab.h \
@@ -17,17 +17,18 @@ INCS=       a.out.h ar.h assert.h bitstring.h cpio.h ctype.h db.h \
        mntopts.h mpool.h mqueue.h monetary.h ndbm.h netconfig.h \
        netdb.h nl_types.h nlist.h nss.h nsswitch.h objformat.h \
        paths.h printf.h pthread.h pthread_np.h pwd.h \
-       ranlib.h readpassphrase.h regex.h regexp.h \
+       ranlib.h readpassphrase.h regex.h \
        res_update.h resolv.h re_comp.h rmd160.h \
-       search.h setjmp.h sgtty.h \
+       runetype.h search.h setjmp.h sgtty.h \
        signal.h spawn.h stab.h stdarg.h stdbool.h \
        stddef.h stdint.h stdio.h stdlib.h \
        string.h stringlist.h strings.h struct.h sysexits.h \
        tar.h tgmath.h time.h \
        timeconv.h \
-       timers.h ttyent.h tzfile.h unistd.h ulimit.h utime.h utmp.h utmpx.h \
+       timers.h ttyent.h tzfile.h \
+       uchar.h unistd.h ulimit.h utime.h utmp.h utmpx.h \
        uuid.h vis.h \
-       wchar.h wctype.h wordexp.h
+       wchar.h wctype.h wordexp.h xlocale.h
 
 .if defined(WANT_HESIOD)
 INCS+= hesiod.h
index 572358e..71e4a86 100644 (file)
@@ -1,12 +1,15 @@
 /*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 1993
+ *     The Regents of the University of California.  All rights reserved.
  * (c) UNIX System Laboratories, Inc.
  * All or some portions of this file are derived from material licensed
  * to the University of California by American Telephone and Telegraph
  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
  * the permission of UNIX System Laboratories, Inc.
  *
+ * This code is derived from software contributed to Berkeley by
+ * Paul Borman at Krystal Technologies.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     @(#)ctype.h     5.3 (Berkeley) 4/3/91
- *     $NetBSD: src/include/ctype.h,v 1.25 2003/10/22 15:51:18 kleink Exp $
- *     $DragonFly: src/include/ctype.h,v 1.17 2006/03/06 02:54:12 swildner Exp $
+ *     @(#)ctype.h     8.4 (Berkeley) 1/21/94
+ *      $FreeBSD: head/include/ctype.h 233600 2012-03-28 12:11:54Z theraven $
  */
 
 #ifndef _CTYPE_H_
 #define _CTYPE_H_
 
 #include <sys/cdefs.h>
-#include <machine/stdint.h>
-
-#define        _CTYPEMASK_U    0x0001
-#define        _CTYPEMASK_L    0x0002
-#define        _CTYPEMASK_D    0x0004
-#define        _CTYPEMASK_S    0x0008
-#define        _CTYPEMASK_P    0x0010
-#define        _CTYPEMASK_C    0x0020
-#define        _CTYPEMASK_X    0x0040
-#define        _CTYPEMASK_B    0x0080
-#define        _CTYPEMASK_A    0x0100
-#define        _CTYPEMASK_G    0x0200
-#define        _CTYPEMASK_R    0x0400
-
-extern const __uint16_t        *__libc_ctype_;
-extern const __int16_t *__libc_tolower_tab_;
-extern const __int16_t *__libc_toupper_tab_;
+#include <sys/types.h>
+
+#define        _CTYPE_A        0x00000100L             /* Alpha */
+#define        _CTYPE_C        0x00000200L             /* Control */
+#define        _CTYPE_D        0x00000400L             /* Digit */
+#define        _CTYPE_G        0x00000800L             /* Graph */
+#define        _CTYPE_L        0x00001000L             /* Lower */
+#define        _CTYPE_P        0x00002000L             /* Punct */
+#define        _CTYPE_S        0x00004000L             /* Space */
+#define        _CTYPE_U        0x00008000L             /* Upper */
+#define        _CTYPE_X        0x00010000L             /* X digit */
+#define        _CTYPE_B        0x00020000L             /* Blank */
+#define        _CTYPE_R        0x00040000L             /* Print */
+#define        _CTYPE_I        0x00080000L             /* Ideogram */
+#define        _CTYPE_T        0x00100000L             /* Special */
+#define        _CTYPE_Q        0x00200000L             /* Phonogram */
+#define        _CTYPE_SW0      0x20000000L             /* 0 width character */
+#define        _CTYPE_SW1      0x40000000L             /* 1 width character */
+#define        _CTYPE_SW2      0x80000000L             /* 2 width character */
+#define        _CTYPE_SW3      0xc0000000L             /* 3 width character */
+#define        _CTYPE_SWM      0xe0000000L             /* Mask for screen width data */
+#define        _CTYPE_SWS      30                      /* Bits to shift to get width */
+
+/* See comments in <sys/_types.h> about __ct_rune_t. */
+__BEGIN_DECLS
+unsigned long  ___runetype(__ct_rune_t) __pure;
+__ct_rune_t    ___tolower(__ct_rune_t) __pure;
+__ct_rune_t    ___toupper(__ct_rune_t) __pure;
+__END_DECLS
+
+/*
+ * _EXTERNALIZE_CTYPE_INLINES_ is defined in locale/nomacros.c to tell us
+ * to generate code for extern versions of all our inline functions.
+ */
+#ifdef _EXTERNALIZE_CTYPE_INLINES_
+#define        _USE_CTYPE_INLINE_
+#define        static
+#define        __inline
+#endif
+
+extern int __mb_sb_limit;
+
+/*
+ * Use inline functions if we are allowed to and the compiler supports them.
+ */
+#if !defined(_DONT_USE_CTYPE_INLINE_) && \
+    (defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
+
+#include <runetype.h>
+
+static __inline int
+__maskrune(__ct_rune_t _c, unsigned long _f)
+{
+       return ((_c < 0 || _c >= _CACHED_RUNES) ? ___runetype(_c) :
+               _CurrentRuneLocale->__runetype[_c]) & _f;
+}
+
+static __inline int
+__sbmaskrune(__ct_rune_t _c, unsigned long _f)
+{
+       return (_c < 0 || _c >= __mb_sb_limit) ? 0 :
+              _CurrentRuneLocale->__runetype[_c] & _f;
+}
+
+static __inline int
+__istype(__ct_rune_t _c, unsigned long _f)
+{
+       return (!!__maskrune(_c, _f));
+}
+
+static __inline int
+__sbistype(__ct_rune_t _c, unsigned long _f)
+{
+       return (!!__sbmaskrune(_c, _f));
+}
+
+static __inline int
+__isctype(__ct_rune_t _c, unsigned long _f)
+{
+       return (_c < 0 || _c >= 128) ? 0 :
+              !!(_DefaultRuneLocale.__runetype[_c] & _f);
+}
+
+static __inline __ct_rune_t
+__toupper(__ct_rune_t _c)
+{
+       return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) :
+              _CurrentRuneLocale->__mapupper[_c];
+}
+
+static __inline __ct_rune_t
+__sbtoupper(__ct_rune_t _c)
+{
+       return (_c < 0 || _c >= __mb_sb_limit) ? _c :
+              _CurrentRuneLocale->__mapupper[_c];
+}
+
+static __inline __ct_rune_t
+__tolower(__ct_rune_t _c)
+{
+       return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) :
+              _CurrentRuneLocale->__maplower[_c];
+}
+
+static __inline __ct_rune_t
+__sbtolower(__ct_rune_t _c)
+{
+       return (_c < 0 || _c >= __mb_sb_limit) ? _c :
+              _CurrentRuneLocale->__maplower[_c];
+}
+
+static __inline int
+__wcwidth(__ct_rune_t _c)
+{
+       unsigned int _x;
+
+       if (_c == 0)
+               return (0);
+       _x = (unsigned int)__maskrune(_c, _CTYPE_SWM|_CTYPE_R);
+       if ((_x & _CTYPE_SWM) != 0)
+               return ((_x & _CTYPE_SWM) >> _CTYPE_SWS);
+       return ((_x & _CTYPE_R) != 0 ? 1 : -1);
+}
+
+#else /* not using inlines */
+
+__BEGIN_DECLS
+int            __maskrune(__ct_rune_t, unsigned long);
+int            __sbmaskrune(__ct_rune_t, unsigned long);
+int            __istype(__ct_rune_t, unsigned long);
+int            __sbistype(__ct_rune_t, unsigned long);
+int            __isctype(__ct_rune_t, unsigned long);
+__ct_rune_t    __toupper(__ct_rune_t);
+__ct_rune_t    __sbtoupper(__ct_rune_t);
+__ct_rune_t    __tolower(__ct_rune_t);
+__ct_rune_t    __sbtolower(__ct_rune_t);
+int            __wcwidth(__ct_rune_t);
+__END_DECLS
+#endif /* using inlines */
+
 
 __BEGIN_DECLS
 int    isalnum(int);
@@ -73,79 +198,76 @@ int        isxdigit(int);
 int    tolower(int);
 int    toupper(int);
 
-#if defined(__XSI_VISIBLE)
+#if __XSI_VISIBLE
 int    isascii(int);
 int    toascii(int);
-int    _tolower(int);
-int    _toupper(int);
 #endif
 
-#if __ISO_C_VISIBLE >= 1999 || __POSIX_VISIBLE >= 200112L || \
-    __XSI_VISIBLE >= 600
+#if __ISO_C_VISIBLE >= 1999
 int    isblank(int);
 #endif
-__END_DECLS
 
-#ifdef _CTYPE_PRIVATE
-extern const __uint16_t        __libc_C_ctype_[];
-extern const __int16_t __libc_C_toupper_[];
-extern const __int16_t __libc_C_tolower_[];
+#if __BSD_VISIBLE
+int    digittoint(int);
+int    ishexnumber(int);
+int    isideogram(int);
+int    isnumber(int);
+int    isphonogram(int);
+int    isrune(int);
+int    isspecial(int);
 #endif
 
-/*
- * don't get all wishy washy and try to support architectures where
- * char isn't 8 bits.   It's 8 bits, period.
- */
-#if !defined(_CTYPE_H_DISABLE_MACROS_)
-
-#define _CTYPE_NUM_CHARS       (1 << (8*sizeof(char)))
-
-static __inline int
-__libc_ctype_index(__uint16_t mask, int c)
-{
-       if (c < -1 || c >= _CTYPE_NUM_CHARS)
-               return(0);      /* XXX maybe assert instead? */
-       return(__libc_ctype_[c + 1] & mask);
-}
+#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
+#include <xlocale/_ctype.h>
+#endif
+__END_DECLS
 
-static __inline int
-__libc_ctype_convert(const __int16_t *array, int c)
-{
-       if (c < -1 || c >= _CTYPE_NUM_CHARS)
-               return(c);      /* XXX maybe assert instead? */
-       return(array[c + 1]);
-}
+#ifndef __cplusplus
+#define        isalnum(c)      __sbistype((c), _CTYPE_A|_CTYPE_D)
+#define        isalpha(c)      __sbistype((c), _CTYPE_A)
+#define        iscntrl(c)      __sbistype((c), _CTYPE_C)
+#define        isdigit(c)      __isctype((c), _CTYPE_D) /* ANSI -- locale independent */
+#define        isgraph(c)      __sbistype((c), _CTYPE_G)
+#define        islower(c)      __sbistype((c), _CTYPE_L)
+#define        isprint(c)      __sbistype((c), _CTYPE_R)
+#define        ispunct(c)      __sbistype((c), _CTYPE_P)
+#define        isspace(c)      __sbistype((c), _CTYPE_S)
+#define        isupper(c)      __sbistype((c), _CTYPE_U)
+#define        isxdigit(c)     __isctype((c), _CTYPE_X) /* ANSI -- locale independent */
+#define        tolower(c)      __sbtolower(c)
+#define        toupper(c)      __sbtoupper(c)
+#endif /* !__cplusplus */
 
-#ifndef _CTYPE_PRIVATE
-#undef _CTYPE_NUM_CHARS
+#if __XSI_VISIBLE
+/*
+ * POSIX.1-2001 specifies _tolower() and _toupper() to be macros equivalent to
+ * tolower() and toupper() respectively, minus extra checking to ensure that
+ * the argument is a lower or uppercase letter respectively.  We've chosen to
+ * implement these macros with the same error checking as tolower() and
+ * toupper() since this doesn't violate the specification itself, only its
+ * intent.  We purposely leave _tolower() and _toupper() undocumented to
+ * discourage their use.
+ *
+ * XXX isascii() and toascii() should similarly be undocumented.
+ */
+#define        _tolower(c)     __sbtolower(c)
+#define        _toupper(c)     __sbtoupper(c)
+#define        isascii(c)      (((c) & ~0x7F) == 0)
+#define        toascii(c)      ((c) & 0x7F)
 #endif
 
-#define        isdigit(c)      __libc_ctype_index(_CTYPEMASK_D, c)
-#define        islower(c)      __libc_ctype_index(_CTYPEMASK_L, c)
-#define        isspace(c)      __libc_ctype_index(_CTYPEMASK_S, c)
-#define        ispunct(c)      __libc_ctype_index(_CTYPEMASK_P, c)
-#define        isupper(c)      __libc_ctype_index(_CTYPEMASK_U, c)
-#define        isalpha(c)      __libc_ctype_index(_CTYPEMASK_A, c)
-#define        isxdigit(c)     __libc_ctype_index(_CTYPEMASK_X, c)
-#define        isalnum(c)      __libc_ctype_index(_CTYPEMASK_A|_CTYPEMASK_D, c)
-#define        isprint(c)      __libc_ctype_index(_CTYPEMASK_R, c)
-#define        isgraph(c)      __libc_ctype_index(_CTYPEMASK_G, c)
-#define        iscntrl(c)      __libc_ctype_index(_CTYPEMASK_C, c)
-#define        tolower(c)      __libc_ctype_convert(__libc_tolower_tab_, c)
-#define        toupper(c)      __libc_ctype_convert(__libc_toupper_tab_, c)
-
-#if defined(__XSI_VISIBLE)
-#define        isascii(c)      ((unsigned)(c) <= 0177)
-#define        toascii(c)      ((c) & 0177)
-#define _tolower(c)    ((c) - 'A' + 'a')
-#define _toupper(c)    ((c) - 'a' + 'A')
+#if __ISO_C_VISIBLE >= 1999 && !defined(__cplusplus)
+#define        isblank(c)      __sbistype((c), _CTYPE_B)
 #endif
 
-#if __ISO_C_VISIBLE >= 1999 || __POSIX_VISIBLE >= 200112L || \
-    __XSI_VISIBLE >= 600
-#define isblank(c)     __libc_ctype_index(_CTYPEMASK_B, c)
+#if __BSD_VISIBLE
+#define        digittoint(c)   __sbmaskrune((c), 0xFF)
+#define        ishexnumber(c)  __sbistype((c), _CTYPE_X)
+#define        isideogram(c)   __sbistype((c), _CTYPE_I)
+#define        isnumber(c)     __sbistype((c), _CTYPE_D)
+#define        isphonogram(c)  __sbistype((c), _CTYPE_Q)
+#define        isrune(c)       __sbistype((c), 0xFFFFFF00L)
+#define        isspecial(c)    __sbistype((c), _CTYPE_T)
 #endif
 
-#endif /* !_CTYPE_H_DISABLE_MACROS_ */
-
 #endif /* !_CTYPE_H_ */
index 29dee16..b8767e3 100644 (file)
@@ -1,8 +1,9 @@
-/*     $NetBSD: iconv.h,v 1.3 2003/08/22 14:05:03 kleink Exp $ */
-/*     $DragonFly: src/include/iconv.h,v 1.1 2005/03/11 23:33:53 joerg Exp $ */
+/*     $FreeBSD: head/include/iconv.h 255297 2013-09-06 09:46:44Z theraven $   */
+/*     $NetBSD: iconv.h,v 1.6 2005/02/03 04:39:32 perry Exp $  */
 
 /*-
- * Copyright (c)2003 Citrus Project,
+ * Copyright (c) 2003 Citrus Project,
+ * Copyright (c) 2009, 2010 Gabor Kovesdan <gabor@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #ifndef _ICONV_H_
 #define _ICONV_H_
 
+#include <sys/cdefs.h>
 #include <sys/types.h>
 
+#include <wchar.h>
+#include <sys/types.h>
+
+#ifdef __LIBICONV_COMPAT
+#define libiconv_open          iconv_open
+#define libiconv_close         iconv_close
+#define libiconv               iconv
+#define libiconv_t             iconv_t
+#endif
+#ifdef __cplusplus
+typedef        bool    __iconv_bool;
+#elif __STDC_VERSION__ >= 199901L
+typedef        _Bool   __iconv_bool;
+#else
+typedef        int     __iconv_bool;
+#endif
+
 struct __tag_iconv_t;
 typedef        struct __tag_iconv_t    *iconv_t;
 
 __BEGIN_DECLS
 iconv_t        iconv_open(const char *, const char *);
-size_t iconv(iconv_t, char ** __restrict, size_t * __restrict,
-             char ** __restrict, size_t * __restrict);
+size_t iconv(iconv_t, const char ** __restrict,
+             size_t * __restrict, char ** __restrict,
+             size_t * __restrict);
 int    iconv_close(iconv_t);
 /*
  * non-portable interfaces for iconv
  */
-int    __iconv_get_list(char ***, size_t *);
+int    __iconv_get_list(char ***, size_t *, __iconv_bool);
 void   __iconv_free_list(char **, size_t);
-size_t __iconv(iconv_t, const char **, size_t *, char **, size_t *,
-               __uint32_t, size_t *);
+size_t __iconv(iconv_t, const char **, size_t *, char **,
+                    size_t *, __uint32_t, size_t *);
 #define __ICONV_F_HIDE_INVALID 0x0001
+
+/*
+ * GNU interfaces for iconv
+ */
+#ifdef __LIBICONV_COMPAT
+#define libiconv_open_into             iconv_open_into
+#define libiconvctl                    iconvctl
+#define libiconvlist                   iconvlist
+#define libiconv_set_relocation_prefix iconv_set_relocation_prefix
+#endif
+
+/* We have iconvctl() */
+#define _ICONV_VERSION 0x0108
+extern int _iconv_version;
+
+#ifdef __LIBICONV_COMPAT
+#define _libiconv_version              _iconv_version
+#define _LIBICONV_VERSION              _ICONV_VERSION
+#endif
+
+typedef struct {
+       void    *spaceholder[64];
+} iconv_allocation_t;
+
+int     iconv_open_into(const char *, const char *, iconv_allocation_t *);
+void    iconv_set_relocation_prefix(const char *orig_prefix,
+            const char *curr_prefix);
+
+/*
+ * iconvctl() request macros
+ */
+#define ICONV_TRIVIALP         0
+#define        ICONV_GET_TRANSLITERATE 1
+#define        ICONV_SET_TRANSLITERATE 2
+#define ICONV_GET_DISCARD_ILSEQ        3
+#define ICONV_SET_DISCARD_ILSEQ        4
+#define ICONV_SET_HOOKS                5
+#define ICONV_SET_FALLBACKS    6
+
+typedef void (*iconv_unicode_char_hook) (unsigned int mbr, void *data);
+typedef void (*iconv_wide_char_hook) (wchar_t wc, void *data);
+
+struct iconv_hooks {
+       iconv_unicode_char_hook          uc_hook;
+       iconv_wide_char_hook             wc_hook;
+       void                            *data;
+};
+
+/*
+ * Fallbacks aren't supported but type definitions are provided for
+ * source compatibility.
+ */
+typedef void (*iconv_unicode_mb_to_uc_fallback) (const char*,
+               size_t, void (*write_replacement) (const unsigned int *,
+               size_t, void*), void*, void*);
+typedef void (*iconv_unicode_uc_to_mb_fallback) (unsigned int,
+               void (*write_replacement) (const char *, size_t, void*),
+               void*, void*);
+typedef void (*iconv_wchar_mb_to_wc_fallback) (const char*, size_t,
+               void (*write_replacement) (const wchar_t *, size_t, void*),
+               void*, void*);
+typedef void (*iconv_wchar_wc_to_mb_fallback) (wchar_t,
+               void (*write_replacement) (const char *, size_t, void*),
+               void*, void*);
+
+struct iconv_fallbacks {
+       iconv_unicode_mb_to_uc_fallback  mb_to_uc_fallback;
+       iconv_unicode_uc_to_mb_fallback  uc_to_mb_fallback;
+       iconv_wchar_mb_to_wc_fallback    mb_to_wc_fallback;
+       iconv_wchar_wc_to_mb_fallback    wc_to_mb_fallback;
+       void                            *data;
+};
+
+
+void            iconvlist(int (*do_one) (unsigned int, const char * const *,
+                   void *), void *);
+const char     *iconv_canonicalize(const char *);
+int             iconvctl(iconv_t, int, void *);
 __END_DECLS
 
 #endif /* !_ICONV_H_ */
index f9ea77b..343cd8d 100644 (file)
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/include/langinfo.h,v 1.4.2.1 2002/03/12 17:12:24 phantom Exp $
- * $DragonFly: src/include/langinfo.h,v 1.4 2005/04/21 07:28:59 joerg Exp $
+ * $FreeBSD: head/include/langinfo.h 233600 2012-03-28 12:11:54Z theraven $
  */
 
 #ifndef _LANGINFO_H_
 #define        _LANGINFO_H_
 
 #include <sys/cdefs.h>
-#include <nl_types.h>
+#include <sys/types.h>
+
+#ifndef _NL_ITEM_DECLARED
+typedef        __nl_item       nl_item;
+#define        _NL_ITEM_DECLARED
+#endif
 
 #define        CODESET         0       /* codeset name */
 #define        D_T_FMT         1       /* string for formatting date and time */
 
 #define        YESEXPR         52      /* affirmative response expression */
 #define        NOEXPR          53      /* negative response expression */
+
+#if __BSD_VISIBLE || __XSI_VISIBLE <= 500
 #define        YESSTR          54      /* affirmative response for yes/no queries */
 #define        NOSTR           55      /* negative response for yes/no queries */
+#endif
 
 #define        CRNCYSTR        56      /* currency symbol */
 
+#if __BSD_VISIBLE
 #define        D_MD_ORDER      57      /* month/day order (local extension) */
-#define        _DATE_FMT       58      /* date(1) format string (local extension) */
+#endif
+
+/* standalone months forms for %OB */
+#define        ALTMON_1        58
+#define        ALTMON_2        59
+#define        ALTMON_3        60
+#define        ALTMON_4        61
+#define        ALTMON_5        62
+#define        ALTMON_6        63
+#define        ALTMON_7        64
+#define        ALTMON_8        65
+#define        ALTMON_9        66
+#define        ALTMON_10       67
+#define        ALTMON_11       68
+#define        ALTMON_12       69
 
 __BEGIN_DECLS
-char   *nl_langinfo (nl_item);
+char   *nl_langinfo(nl_item);
+
+#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
+#include <xlocale/_langinfo.h>
+#endif
 __END_DECLS
 
 #endif /* !_LANGINFO_H_ */
index cfcb6c3..05bc37a 100644 (file)
@@ -1,6 +1,3 @@
-/*     $NetBSD: src/include/locale.h,v 1.13 2003/08/07 09:44:10 agc Exp $      */
-/*     $DragonFly: src/include/locale.h,v 1.5 2008/06/05 17:53:10 swildner Exp $ */
-
 /*
  * Copyright (c) 1991, 1993
  *     The Regents of the University of California.  All rights reserved.
  * SUCH DAMAGE.
  *
  *     @(#)locale.h    8.1 (Berkeley) 6/2/93
+ * $FreeBSD: head/include/locale.h 232498 2012-03-04 15:31:13Z theraven $
  */
 
 #ifndef _LOCALE_H_
 #define _LOCALE_H_
 
+#include <sys/_null.h>
+
 struct lconv {
        char    *decimal_point;
        char    *thousands_sep;
@@ -62,8 +62,6 @@ struct lconv {
        char    int_n_sign_posn;
 };
 
-#include <sys/_null.h>
-
 #define        LC_ALL          0
 #define        LC_COLLATE      1
 #define        LC_CTYPE        2
@@ -79,6 +77,11 @@ struct lconv {
 __BEGIN_DECLS
 struct lconv   *localeconv(void);
 char           *setlocale(int, const char *);
+
+#if __POSIX_VISIBLE >= 200809
+#include <xlocale/_locale.h>
+#endif
 __END_DECLS
 
+
 #endif /* _LOCALE_H_ */
index 6ac4606..2bf19e4 100644 (file)
@@ -1,5 +1,4 @@
-/*     $NetBSD: src/include/nl_types.h,v 1.10 2001/12/06 23:04:06 wiz Exp $    */
-/*     $DragonFly: src/include/nl_types.h,v 1.4 2005/04/21 16:36:34 joerg Exp $ */
+/*     $NetBSD: nl_types.h,v 1.9 2000/10/03 19:53:32 sommerfeld Exp $  */
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD: head/include/nl_types.h 203963 2010-02-16 19:28:10Z imp $
  */
 
 #ifndef _NL_TYPES_H_
 #define _NL_TYPES_H_
+
 #include <sys/cdefs.h>
-#include <machine/stdint.h>
+#include <sys/types.h>
 
 #ifdef _NLS_PRIVATE
 /*
  * MESSAGE CATALOG FILE FORMAT.
  *
- * The NetBSD message catalog format is similar to the format used by
+ * The NetBSD/FreeBSD message catalog format is similar to the format used by
  * Svr4 systems.  The differences are:
  *   * fixed byte order (big endian)
  *   * fixed data field sizes
@@ -78,21 +73,24 @@ struct _nls_msg_hdr {
        int32_t __offset;
 } ;
 
-#endif
+#endif /* _NLS_PRIVATE */
 
-#define        NL_SETD         1
-#define NL_CAT_LOCALE   1
+#define        NL_SETD         0
+#define        NL_CAT_LOCALE   1
 
 typedef struct __nl_cat_d {
-       void            *__data;
-       __size_t         __size;
+       void    *__data;
+       int     __size;
 } *nl_catd;
 
-typedef long   nl_item;
+#ifndef _NL_ITEM_DECLARED
+typedef        __nl_item       nl_item;
+#define        _NL_ITEM_DECLARED
+#endif
 
 __BEGIN_DECLS
-nl_catd         catopen(const char *, int);
-char   *catgets(nl_catd, int, int, const char *);
+nl_catd  catopen(const char *, int);
+char    *catgets(nl_catd, int, int, const char *) __format_arg(4);
 int     catclose(nl_catd);
 __END_DECLS
 
index 56b933b..7ddfaba 100644 (file)
 #define        _PATH_CONSOLE   __SYS_PATH_CONSOLE
 #define        _PATH_CP        "/bin/cp"
 #define        _PATH_CSHELL    "/bin/csh"
+#define        _PATH_CSMAPPER  "/usr/share/i18n/csmapper"
 #define        _PATH_DEFTAPE   __SYS_PATH_DEFTAPE
 #define        _PATH_DEVDB     "/var/run/dev.db"
 #define        _PATH_DEVNULL   __SYS_PATH_DEVNULL
 #define        _PATH_DEVZERO   __SYS_PATH_DEVZERO
 #define        _PATH_DRUM      __SYS_PATH_DRUM
+#define        _PATH_ESDB      "/usr/share/i18n/esdb"
 #define        _PATH_ETC       "/etc"
 #define        _PATH_FTPUSERS  "/etc/ftpusers"
 #define        _PATH_I18NMODULE        "/usr/lib/i18n"
-#define        _PATH_ESDB      "/usr/share/i18n/esdb"
-#define        _PATH_ICONV     "/usr/share/i18n/iconv"
-#define        _PATH_CSMAPPER  "/usr/share/i18n/csmapper"
 #define        _PATH_KMEM      __SYS_PATH_KMEM
 #define        _PATH_LIBMAP_CONF       "/etc/libmap.conf"
 #define        _PATH_LOCALE    "/usr/share/locale"
diff --git a/include/regexp.h b/include/regexp.h
deleted file mode 100644 (file)
index c77b0d7..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 1986 by University of Toronto.
- * Copyright (c) 1989, 1993
- *     The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley
- * by Henry Spencer.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *     @(#)regexp.h    8.1 (Berkeley) 6/2/93
- * $DragonFly: src/include/regexp.h,v 1.2 2003/11/14 01:01:43 dillon Exp $
- */
-
-#ifndef        _REGEXP_H_
-#define        _REGEXP_H_
-
-/*
- * Definitions etc. for regexp(3) routines.
- *
- * Caveat:  this is V8 regexp(3) [actually, a reimplementation thereof],
- * not the System V one.
- */
-#define NSUBEXP  10
-typedef struct regexp {
-       char *startp[NSUBEXP];
-       char *endp[NSUBEXP];
-       char regstart;          /* Internal use only. */
-       char reganch;           /* Internal use only. */
-       char *regmust;          /* Internal use only. */
-       int regmlen;            /* Internal use only. */
-       char program[1];        /* Unwarranted chumminess with compiler. */
-} regexp;
-
-#include <sys/cdefs.h>
-
-__BEGIN_DECLS
-regexp *regcomp (const char *);
-int regexec (const  regexp *, const char *);
-void regsub (const  regexp *, const char *, char *);
-void regerror (const char *);
-__END_DECLS
-
-#endif /* !_REGEXP_H_ */
diff --git a/include/runetype.h b/include/runetype.h
new file mode 100644 (file)
index 0000000..e18687f
--- /dev/null
@@ -0,0 +1,106 @@
+/*-
+ * Copyright (c) 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Paul Borman at Krystal Technologies.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)runetype.h  8.1 (Berkeley) 6/2/93
+ * $FreeBSD: head/include/runetype.h 232620 2012-03-06 20:15:23Z dim $
+ */
+
+#ifndef        _RUNETYPE_H_
+#define        _RUNETYPE_H_
+
+#include <sys/cdefs.h>
+#include <sys/types.h>
+
+#define        _CACHED_RUNES   (1 <<8 )        /* Must be a power of 2 */
+#define        _CRMASK         (~(_CACHED_RUNES - 1))
+
+/*
+ * The lower 8 bits of runetype[] contain the digit value of the rune.
+ */
+typedef struct {
+       __rune_t        __min;          /* First rune of the range */
+       __rune_t        __max;          /* Last rune (inclusive) of the range */
+       __rune_t        __map;          /* What first maps to in maps */
+       unsigned long   *__types;       /* Array of types in range */
+} _RuneEntry;
+
+typedef struct {
+       int             __nranges;      /* Number of ranges stored */
+       _RuneEntry      *__ranges;      /* Pointer to the ranges */
+} _RuneRange;
+
+typedef struct {
+       char            __magic[8];     /* Magic saying what version we are */
+       char            __encoding[32]; /* ASCII name of this encoding */
+
+       __rune_t        (*__sgetrune)(const char *, __size_t, char const **);
+       int             (*__sputrune)(__rune_t, char *, __size_t, char **);
+       __rune_t        __invalid_rune;
+
+       unsigned long   __runetype[_CACHED_RUNES];
+       __rune_t        __maplower[_CACHED_RUNES];
+       __rune_t        __mapupper[_CACHED_RUNES];
+
+       /*
+        * The following are to deal with Runes larger than _CACHED_RUNES - 1.
+        * Their data is actually contiguous with this structure so as to make
+        * it easier to read/write from/to disk.
+        */
+       _RuneRange      __runetype_ext;
+       _RuneRange      __maplower_ext;
+       _RuneRange      __mapupper_ext;
+
+       void            *__variable;    /* Data which depends on the encoding */
+       int             __variable_len; /* how long that data is */
+} _RuneLocale;
+
+#define        _RUNE_MAGIC_1   "RuneMagi"      /* Indicates version 0 of RuneLocale */
+__BEGIN_DECLS
+extern const _RuneLocale _DefaultRuneLocale;
+extern const _RuneLocale *_CurrentRuneLocale;
+#if defined(__NO_TLS) || defined(__RUNETYPE_INTERNAL)
+extern const _RuneLocale *__getCurrentRuneLocale(void);
+#else
+extern __thread const _RuneLocale *_ThreadRuneLocale;
+static __inline const _RuneLocale *__getCurrentRuneLocale(void)
+{
+
+       if (_ThreadRuneLocale) 
+               return _ThreadRuneLocale;
+       if (_CurrentRuneLocale) 
+               return _CurrentRuneLocale;
+       return &_DefaultRuneLocale;
+}
+#endif /* __NO_TLS || __RUNETYPE_INTERNAL */
+#define _CurrentRuneLocale (__getCurrentRuneLocale())
+__END_DECLS
+
+#endif /* !_RUNETYPE_H_ */
index e3245ce..59978bd 100644 (file)
 #include <sys/_null.h>
 #include <sys/types.h>
 
+#if __BSD_VISIBLE
+#ifndef _RUNE_T_DECLARED
+typedef        __rune_t        rune_t;
+#define        _RUNE_T_DECLARED
+#endif
+#endif
+
 #ifndef _SIZE_T_DECLARED
 typedef        __size_t        size_t;
 #define        _SIZE_T_DECLARED
@@ -68,10 +75,14 @@ typedef struct {
 
 #define        RAND_MAX        0x7fffffff
 
+__BEGIN_DECLS
+#ifdef _XLOCALE_H_
+#include <xlocale/_stdlib.h>
+#endif
 extern int __mb_cur_max;
-#define        MB_CUR_MAX      __mb_cur_max
+extern int ___mb_cur_max(void);
+#define        MB_CUR_MAX      (___mb_cur_max())
 
-__BEGIN_DECLS
 void    abort(void) __dead2;
 /* void         abort2(const char *, int, void **) __dead2; */
 #if !defined(_KERNEL_VIRTUAL)
index 71cd7eb..fd79d2b 100644 (file)
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
@@ -31,8 +27,7 @@
  * SUCH DAMAGE.
  *
  *     @(#)string.h    8.1 (Berkeley) 6/2/93
- * $FreeBSD: src/include/string.h,v 1.27 2008/12/08 21:04:24 kib Exp $
- * $DragonFly: src/include/string.h,v 1.9 2008/06/05 17:53:10 swildner Exp $
+ * $FreeBSD: head/include/string.h 246803 2013-02-14 19:26:58Z zeising $
  */
 
 #ifndef _STRING_H_
@@ -56,17 +51,19 @@ typedef     __size_t        size_t;
 #endif
 
 __BEGIN_DECLS
-#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
+#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 600
 void   *memccpy(void * __restrict, const void * __restrict, int, size_t);
 #endif
 void   *memchr(const void *, int, size_t) __pure;
+#if __BSD_VISIBLE
 void   *memrchr(const void *, int, size_t) __pure;
+#endif
 #if !defined(_KERNEL_VIRTUAL)
 int     memcmp(const void *, const void *, size_t) __pure;
 void   *memcpy(void * __restrict, const void * __restrict, size_t);
 #endif
 #if __BSD_VISIBLE
-void   *memmem(const void *, size_t, const void *, size_t);
+void   *memmem(const void *, size_t, const void *, size_t) __pure;
 void   *mempcpy(void *, const void *, size_t);
 #endif
 #if !defined(_KERNEL_VIRTUAL)
@@ -74,18 +71,20 @@ void        *memmove(void *, const void *, size_t);
 void   *memset(void *, int, size_t);
 #endif
 #if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE
-char    *stpcpy(char *, const char *);
-char    *stpncpy(char * __restrict, const char * __restrict, size_t);
+char   *stpcpy(char * __restrict, const char * __restrict);
+char   *stpncpy(char * __restrict, const char * __restrict, size_t);
 #endif
 #if __BSD_VISIBLE
 char   *strcasestr(const char *, const char *) __pure;
-char   *strchrnul(const char *, int) __pure;
 #endif
 #if !defined(_KERNEL_VIRTUAL)
 char   *strcat(char * __restrict, const char * __restrict);
 char   *strchr(const char *, int) __pure;
 int     strcmp(const char *, const char *) __pure;
 #endif
+#if __BSD_VISIBLE
+char   *strchrnul(const char*, int) __pure;
+#endif
 int     strcoll(const char *, const char *);
 #if !defined(_KERNEL_VIRTUAL)
 char   *strcpy(char * __restrict, const char * __restrict);
@@ -100,9 +99,9 @@ int   strerror_r(int, char *, size_t);
 #endif
 #if !defined(_KERNEL_VIRTUAL)
 #if __BSD_VISIBLE
-size_t  strlcat(char *, const char *, size_t);
-size_t  strlcpy(char *, const char *, size_t);
-#endif /* __BSD_VISIBLE */
+size_t  strlcat(char * __restrict, const char * __restrict, size_t);
+size_t  strlcpy(char * __restrict, const char * __restrict, size_t);
+#endif
 size_t  strlen(const char *) __pure;
 #endif /* !_KERNEL_VIRTUAL */
 #if __BSD_VISIBLE
@@ -113,9 +112,11 @@ char       *strncat(char * __restrict, const char * __restrict, size_t);
 int     strncmp(const char *, const char *, size_t) __pure;
 char   *strncpy(char * __restrict, const char * __restrict, size_t);
 #endif
-#if __BSD_VISIBLE
+#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE
 char   *strndup(const char *, size_t);
 size_t  strnlen(const char *, size_t) __pure;
+#endif
+#if __BSD_VISIBLE
 char   *strnstr(const char *, const char *, size_t) __pure;
 #endif
 char   *strpbrk(const char *, const char *) __pure;
@@ -126,6 +127,8 @@ char        *strrchr(const char *, int) __pure;
 #if !defined(_KERNEL_VIRTUAL)
 char   *strsep(char **, const char *);
 #endif
+#endif
+#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE
 char   *strsignal(int);
 #endif
 size_t  strspn(const char *, const char *) __pure;
@@ -149,6 +152,10 @@ void        swab(const void * __restrict, void * __restrict, ssize_t);
 #endif /* _SWAB_DECLARED */
 
 #endif /* __BSD_VISIBLE */
+
+#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
+#include <xlocale/_string.h>
+#endif
 __END_DECLS
 
 #endif /* _STRING_H_ */
index 14180fa..ccd7b65 100644 (file)
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
  *     @(#)time.h      8.3 (Berkeley) 1/21/94
  */
 
+/*
+ * $FreeBSD: head/include/time.h 245428 2013-01-14 18:01:19Z dim $
+ */
+
 #ifndef _TIME_H_
 #define        _TIME_H_
 
 #include <sys/cdefs.h>
-
-#include <machine/stdint.h>
-#include <sys/_posix.h>
+#include <sys/_null.h>
+#include <sys/types.h>
 
 #if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE
 /*
@@ -57,8 +56,6 @@
 /* Frequency of the clock ticks reported by clock().  */
 #define        CLOCKS_PER_SEC  128
 
-#include <sys/_null.h>
-
 #ifndef _CLOCK_T_DECLARED
 #define _CLOCK_T_DECLARED
 typedef        __clock_t       clock_t;
@@ -88,10 +85,17 @@ typedef     __clockid_t     clockid_t;
 typedef        __timer_t       timer_t;
 #endif
 
-#include <sys/_timespec.h>
+#include <sys/timespec.h>
 
 #endif /* __POSIX_VISIBLE >= 199309 */
 
+#if __POSIX_VISIBLE >= 200112
+#ifndef _PID_T_DECLARED
+#define        _PID_T_DECLARED
+typedef        __pid_t         pid_t;
+#endif
+#endif
+
 /* These macros are also in sys/time.h. */
 #if !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112
 #define CLOCK_REALTIME         0
@@ -99,18 +103,17 @@ typedef    __timer_t       timer_t;
 #define CLOCK_VIRTUAL          1
 #define CLOCK_PROF             2
 #endif
-#define CLOCK_MONOTONIC                4       /* from freebsd */
-#define CLOCK_UPTIME           5       /* from freebsd */
-#define CLOCK_UPTIME_PRECISE   7       /* from freebsd */
-#define CLOCK_UPTIME_FAST      8       /* from freebsd */
-#define CLOCK_REALTIME_PRECISE 9       /* from freebsd */
-#define CLOCK_REALTIME_FAST    10      /* from freebsd */
-#define CLOCK_MONOTONIC_PRECISE        11      /* from freebsd */
-#define CLOCK_MONOTONIC_FAST   12      /* from freebsd */
-#define CLOCK_SECOND           13      /* from freebsd */
-#define CLOCK_THREAD_CPUTIME_ID                14
-#define CLOCK_PROCESS_CPUTIME_ID       15
-
+#define CLOCK_MONOTONIC                4
+#define CLOCK_UPTIME           5       /* FreeBSD-specific. */
+#define CLOCK_UPTIME_PRECISE   7       /* FreeBSD-specific. */
+#define CLOCK_UPTIME_FAST      8       /* FreeBSD-specific. */
+#define CLOCK_REALTIME_PRECISE 9       /* FreeBSD-specific. */
+#define CLOCK_REALTIME_FAST    10      /* FreeBSD-specific. */
+#define CLOCK_MONOTONIC_PRECISE        11      /* FreeBSD-specific. */
+#define CLOCK_MONOTONIC_FAST   12      /* FreeBSD-specific. */
+#define CLOCK_SECOND           13      /* FreeBSD-specific. */
+#define CLOCK_THREAD_CPUTIME_ID        14
+#define        CLOCK_PROCESS_CPUTIME_ID        15
 #endif /* !defined(CLOCK_REALTIME) && __POSIX_VISIBLE >= 200112 */
 
 #if !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112
@@ -118,7 +121,7 @@ typedef     __timer_t       timer_t;
 #define TIMER_RELTIME  0x0     /* relative timer */
 #endif
 #define TIMER_ABSTIME  0x1     /* absolute timer */
-#endif
+#endif /* !defined(TIMER_ABSTIME) && __POSIX_VISIBLE >= 200112 */
 
 struct tm {
        int     tm_sec;         /* seconds after the minute [0-60] */
@@ -130,7 +133,7 @@ struct tm {
        int     tm_wday;        /* days since Sunday [0-6] */
        int     tm_yday;        /* days since January 1 [0-365] */
        int     tm_isdst;       /* Daylight Savings Time flag */
-       long    tm_gmtoff;      /* offset from CUT in seconds */
+       long    tm_gmtoff;      /* offset from UTC in seconds */
        char    *tm_zone;       /* timezone abbreviation */
 };
 
@@ -139,48 +142,65 @@ extern char *tzname[];
 #endif
 
 __BEGIN_DECLS
-char *asctime (const struct tm *);
-clock_t clock (void);
-char *ctime (const time_t *);
-double difftime (time_t, time_t);
-struct tm *gmtime (const time_t *);
-struct tm *localtime (const time_t *);
-time_t mktime (struct tm *);
-size_t strftime (char * __restrict, size_t, const char * __restrict,
-                const struct tm * __restrict);
-time_t time (time_t *);
-
-#if __POSIX_VISIBLE
-void tzset (void);
+char *asctime(const struct tm *);
+clock_t clock(void);
+char *ctime(const time_t *);
+double difftime(time_t, time_t);
+/* XXX missing: getdate() */
+struct tm *gmtime(const time_t *);
+struct tm *localtime(const time_t *);
+time_t mktime(struct tm *);
+size_t strftime(char * __restrict, size_t, const char * __restrict,
+    const struct tm * __restrict);
+time_t time(time_t *);
+#if __POSIX_VISIBLE >= 200112
+struct sigevent;
+int timer_create(clockid_t, struct sigevent *__restrict, timer_t *__restrict);
+int timer_delete(timer_t);
+int timer_gettime(timer_t, struct itimerspec *);
+int timer_getoverrun(timer_t);
+int timer_settime(timer_t, int, const struct itimerspec *__restrict,
+       struct itimerspec *__restrict);
 #endif
-
-#if __POSIX_VISIBLE >= 199506
-char *asctime_r (const struct tm *, char *);
-char *ctime_r (const time_t *, char *);
-struct tm *gmtime_r (const time_t *, struct tm *);
-struct tm *localtime_r (const time_t *, struct tm *);
+#if __POSIX_VISIBLE
+void tzset(void);
 #endif
 
 #if __POSIX_VISIBLE >= 199309
-/* Introduced in POSIX 1003.1b-1993, not part of 1003.1-1990. */
-int clock_getres (clockid_t, struct timespec *);
-int clock_gettime (clockid_t, struct timespec *);
-int clock_settime (clockid_t, const struct timespec *);
-int nanosleep (const struct timespec *, struct timespec *);
+int clock_getres(clockid_t, struct timespec *);
+int clock_gettime(clockid_t, struct timespec *);
+int clock_settime(clockid_t, const struct timespec *);
+/* XXX missing: clock_nanosleep() */
+int nanosleep(const struct timespec *, struct timespec *);
 #endif /* __POSIX_VISIBLE >= 199309 */
 
+#if __POSIX_VISIBLE >= 200112
+int clock_getcpuclockid(pid_t, clockid_t *);
+#endif
+
+#if __POSIX_VISIBLE >= 199506
+char *asctime_r(const struct tm *, char *);
+char *ctime_r(const time_t *, char *);
+struct tm *gmtime_r(const time_t *, struct tm *);
+struct tm *localtime_r(const time_t *, struct tm *);
+#endif
+
 #if __XSI_VISIBLE
 extern int daylight;
 extern long timezone;
-char *strptime (const char * __restrict, const char * __restrict,
-               struct tm * __restrict);
+char *strptime(const char * __restrict, const char * __restrict,
+    struct tm * __restrict);
 #endif
 
 #if __BSD_VISIBLE
-void tzsetwall (void);
-time_t timelocal (struct tm * const);
-time_t timegm (struct tm * const);
+void tzsetwall(void);
+time_t timelocal(struct tm * const);
+time_t timegm(struct tm * const);
 #endif /* __BSD_VISIBLE */
+
+#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
+#include <xlocale/_time.h>
+#endif
 __END_DECLS
 
 #endif /* !_TIME_H_ */
similarity index 58%
copy from include/iconv.h
copy to include/uchar.h
index 29dee16..7dccba3 100644 (file)
@@ -1,8 +1,5 @@
-/*     $NetBSD: iconv.h,v 1.3 2003/08/22 14:05:03 kleink Exp $ */
-/*     $DragonFly: src/include/iconv.h,v 1.1 2005/03/11 23:33:53 joerg Exp $ */
-
 /*-
- * Copyright (c)2003 Citrus Project,
+ * Copyright (c) 2013 Ed Schouten <ed@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
+ * $FreeBSD: head/include/uchar.h 250985 2013-05-25 16:58:12Z ed $
  */
 
-#ifndef _ICONV_H_
-#define _ICONV_H_
+#ifndef _UCHAR_H_
+#define        _UCHAR_H_
 
+#include <sys/cdefs.h>
 #include <sys/types.h>
 
-struct __tag_iconv_t;
-typedef        struct __tag_iconv_t    *iconv_t;
+#ifndef _CHAR16_T_DECLARED
+typedef        __char16_t      char16_t;
+#define        _CHAR16_T_DECLARED
+#endif
+
+#ifndef _CHAR32_T_DECLARED
+typedef        __char32_t      char32_t;
+#define        _CHAR32_T_DECLARED
+#endif
+
+#ifndef _MBSTATE_T_DECLARED
+typedef        __mbstate_t     mbstate_t;
+#define        _MBSTATE_T_DECLARED
+#endif
+
+#ifndef _SIZE_T_DECLARED
+typedef        __size_t        size_t;
+#define        _SIZE_T_DECLARED
+#endif
 
 __BEGIN_DECLS
-iconv_t        iconv_open(const char *, const char *);
-size_t iconv(iconv_t, char ** __restrict, size_t * __restrict,
-             char ** __restrict, size_t * __restrict);
-int    iconv_close(iconv_t);
-/*
- * non-portable interfaces for iconv
- */
-int    __iconv_get_list(char ***, size_t *);
-void   __iconv_free_list(char **, size_t);
-size_t __iconv(iconv_t, const char **, size_t *, char **, size_t *,
-               __uint32_t, size_t *);
-#define __ICONV_F_HIDE_INVALID 0x0001
+size_t c16rtomb(char * __restrict, char16_t, mbstate_t * __restrict);
+size_t c32rtomb(char * __restrict, char32_t, mbstate_t * __restrict);
+size_t mbrtoc16(char16_t * __restrict, const char * __restrict, size_t,
+    mbstate_t * __restrict);
+size_t mbrtoc32(char32_t * __restrict, const char * __restrict, size_t,
+    mbstate_t * __restrict);
+#if __BSD_VISIBLE || defined(_XLOCALE_H_)
+#include <xlocale/_uchar.h>
+#endif
 __END_DECLS
 
-#endif /* !_ICONV_H_ */
+#endif /* !_UCHAR_H_ */
index 4895b26..fe27e7e 100644 (file)
@@ -1,5 +1,3 @@
-/*     $NetBSD: src/include/wchar.h,v 1.20 2004/05/08 21:57:05 kleink Exp $    */
-
 /*-
  * Copyright (c)1999 Citrus Project,
  * All rights reserved.
@@ -24,6 +22,8 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
+ *
+ * $FreeBSD: head/include/wchar.h 247411 2013-02-27 19:50:46Z jhb $
  */
 
 /*-
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  * POSSIBILITY OF SUCH DAMAGE.
+ *
+ *     $NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $
  */
 
 #ifndef _WCHAR_H_
 #define _WCHAR_H_
 
-#include <sys/stdint.h>
-/* XXX namespace pollution */
-#include <machine/limits.h>
-
 #include <stdio.h> /* for FILE* */
 #include <sys/_null.h>
+#include <sys/types.h>
+#include <machine/limits.h>
+#include <ctype.h>
 
 #ifndef __cplusplus
 #ifndef _WCHAR_T_DECLARED
@@ -92,14 +86,6 @@ typedef      __wchar_t       wchar_t;
 typedef __wint_t       wint_t;
 #endif
 
-#ifndef WINT_MIN
-#define        WINT_MIN        INT_MIN
-#endif
-
-#ifndef WINT_MAX
-#define        WINT_MAX        INT_MAX
-#endif
-
 #ifndef _MBSTATE_T_DECLARED
 #define        _MBSTATE_T_DECLARED
 typedef __mbstate_t    mbstate_t;
@@ -118,103 +104,130 @@ struct tm;
 
 __BEGIN_DECLS
 wint_t btowc(int);
+wint_t fgetwc(FILE *);
+wchar_t        *
+       fgetws(wchar_t * __restrict, int, FILE * __restrict);
+wint_t fputwc(wchar_t, FILE *);
+int    fputws(const wchar_t * __restrict, FILE * __restrict);
+int    fwide(FILE *, int);
+int    fwprintf(FILE * __restrict, const wchar_t * __restrict, ...);
+int    fwscanf(FILE * __restrict, const wchar_t * __restrict, ...);
+wint_t getwc(FILE *);
+wint_t getwchar(void);
 size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
 size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
            mbstate_t * __restrict);
 int    mbsinit(const mbstate_t *);
 size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
            mbstate_t * __restrict);
+wint_t putwc(wchar_t, FILE *);
+wint_t putwchar(wchar_t);
+int    swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict,
+           ...);
+int    swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...);
+wint_t ungetwc(wint_t, FILE *);
+int    vfwprintf(FILE * __restrict, const wchar_t * __restrict,
+           __va_list);
+int    vswprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict,
+           __va_list);
+int    vwprintf(const wchar_t * __restrict, __va_list);
 size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
 wchar_t        *wcscat(wchar_t * __restrict, const wchar_t * __restrict);
-wchar_t        *wcschr(const wchar_t *, wchar_t);
-int    wcscmp(const wchar_t *, const wchar_t *);
+wchar_t        *wcschr(const wchar_t *, wchar_t) __pure;
+int    wcscmp(const wchar_t *, const wchar_t *) __pure;
 int    wcscoll(const wchar_t *, const wchar_t *);
 wchar_t        *wcscpy(wchar_t * __restrict, const wchar_t * __restrict);
-size_t wcscspn(const wchar_t *, const wchar_t *);
+size_t wcscspn(const wchar_t *, const wchar_t *) __pure;
 size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
-                const struct tm * __restrict);
-int    wcscasecmp(const wchar_t *, const wchar_t *);
-int    wcsncasecmp(const wchar_t *, const wchar_t *, size_t n);
-size_t wcslen(const wchar_t *);
-wchar_t        *wcsncat(wchar_t * __restrict, const wchar_t * __restrict, size_t);
-int    wcsncmp(const wchar_t *, const wchar_t *, size_t);
+           const struct tm * __restrict);
+size_t wcslen(const wchar_t *) __pure;
+wchar_t        *wcsncat(wchar_t * __restrict, const wchar_t * __restrict,
+           size_t);
+int    wcsncmp(const wchar_t *, const wchar_t *, size_t) __pure;
 wchar_t        *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t);
-size_t  wcsnlen(const wchar_t *, size_t) __pure;
-wchar_t        *wcspbrk(const wchar_t *, const wchar_t *);
-wchar_t        *wcsrchr(const wchar_t *, wchar_t);
+wchar_t        *wcspbrk(const wchar_t *, const wchar_t *) __pure;
+wchar_t        *wcsrchr(const wchar_t *, wchar_t) __pure;
 size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
-                 mbstate_t * __restrict);
-size_t wcsspn(const wchar_t *, const wchar_t *);
-wchar_t        *wcsstr(const wchar_t *, const wchar_t *);
-wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict,
-               wchar_t ** __restrict);
-size_t wcsxfrm(wchar_t *, const wchar_t *, size_t);
-wchar_t        *wmemchr(const wchar_t *, wchar_t, size_t);
-int    wmemcmp(const wchar_t *, const wchar_t *, size_t);
+           mbstate_t * __restrict);
+size_t wcsspn(const wchar_t *, const wchar_t *) __pure;
+wchar_t        *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict)
+           __pure;
+size_t wcsxfrm(wchar_t * __restrict, const wchar_t * __restrict, size_t);
+int    wctob(wint_t);
+double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
+wchar_t        *wcstok(wchar_t * __restrict, const wchar_t * __restrict,
+           wchar_t ** __restrict);
+long    wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int);
+unsigned long
+        wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int);
+wchar_t        *wmemchr(const wchar_t *, wchar_t, size_t) __pure;
+int    wmemcmp(const wchar_t *, const wchar_t *, size_t) __pure;
 wchar_t        *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
 wchar_t        *wmemmove(wchar_t *, const wchar_t *, size_t);
 wchar_t        *wmemset(wchar_t *, wchar_t, size_t);
+int    wprintf(const wchar_t * __restrict, ...);
+int    wscanf(const wchar_t * __restrict, ...);
 
-size_t wcslcat(wchar_t *, const wchar_t *, size_t);
-size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
-int    wcswidth(const wchar_t *, size_t);
-int    wctob(wint_t);
-int    wcwidth(wchar_t);
+#ifndef _STDSTREAM_DECLARED
+extern FILE *__stdinp;
+extern FILE *__stdoutp;
+extern FILE *__stderrp;
+#define        _STDSTREAM_DECLARED
+#endif
 
-unsigned long wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int);
-long   wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int);
-double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
+#define        getwc(fp)       fgetwc(fp)
+#define        getwchar()      fgetwc(__stdinp)
+#define        putwc(wc, fp)   fputwc(wc, fp)
+#define        putwchar(wc)    fputwc(wc, __stdoutp)
 
-#if __ISO_C_VISIBLE >= 1999 || __DF_VISIBLE
+#if __ISO_C_VISIBLE >= 1999
+int    vfwscanf(FILE * __restrict, const wchar_t * __restrict,
+           __va_list);
+int    vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
+           __va_list);
+int    vwscanf(const wchar_t * __restrict, __va_list);
 float  wcstof(const wchar_t * __restrict, wchar_t ** __restrict);
-long double wcstold(const wchar_t * __restrict, wchar_t ** __restrict);
-
+long double
+       wcstold(const wchar_t * __restrict, wchar_t ** __restrict);
+#ifdef __LONG_LONG_SUPPORTED
 /* LONGLONG */
-long long wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int);
+long long
+       wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int);
 /* LONGLONG */
-unsigned long long wcstoull(const wchar_t * __restrict,
-                           wchar_t ** __restrict, int);
+unsigned long long
+        wcstoull(const wchar_t * __restrict, wchar_t ** __restrict, int);
 #endif
+#endif /* __ISO_C_VISIBLE >= 1999 */
 
-wint_t ungetwc(wint_t, FILE *);
-wint_t fgetwc(FILE *);
-wchar_t        *fgetws(wchar_t * __restrict, int, FILE * __restrict);
-wint_t getwc(FILE *);
-wint_t getwchar(void);
-wint_t fputwc(wchar_t, FILE *);
-int    fputws(const wchar_t * __restrict, FILE * __restrict);
-wint_t putwc(wchar_t, FILE *);
-wint_t putwchar(wchar_t);
+#if __XSI_VISIBLE
+int    wcswidth(const wchar_t *, size_t);
+int    wcwidth(wchar_t);
+#define        wcwidth(_c)     __wcwidth(_c)
+#endif
 
-int    fwide(FILE *, int);
+#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE
+size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
+           size_t, mbstate_t * __restrict);
+FILE   *open_wmemstream(wchar_t **, size_t *);
+wchar_t        *wcpcpy(wchar_t * __restrict, const wchar_t * __restrict);
+wchar_t        *wcpncpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
+wchar_t        *wcsdup(const wchar_t *);
+int    wcscasecmp(const wchar_t *, const wchar_t *);
+int    wcsncasecmp(const wchar_t *, const wchar_t *, size_t n);
+size_t wcsnlen(const wchar_t *, size_t) __pure;
+size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
+           size_t, mbstate_t * __restrict);
+#endif
 
+#if __BSD_VISIBLE
 wchar_t        *fgetwln(FILE * __restrict, size_t * __restrict);
-int    fwprintf(FILE * __restrict, const wchar_t * __restrict, ...);
-int    fwscanf(FILE * __restrict, const wchar_t * __restrict, ...);
-int    swprintf(wchar_t * __restrict, size_t n,
-                const wchar_t * __restrict, ...);
-int    swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...);
-int    vfwprintf(FILE * __restrict, const wchar_t * __restrict, __va_list);
-int    vswprintf(wchar_t * __restrict, size_t, const wchar_t * __restrict,
-             __va_list);
-int    vwprintf(const wchar_t * __restrict, __va_list);
-int    wprintf(const wchar_t * __restrict, ...);
-int    wscanf(const wchar_t * __restrict, ...);
-#if __ISO_C_VISIBLE >= 1999 || __DF_VISIBLE
-int    vfwscanf(FILE * __restrict, const wchar_t * __restrict, __va_list);
-int    vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
-                __va_list);
-int    vwscanf(const wchar_t * __restrict, __va_list);
+size_t wcslcat(wchar_t *, const wchar_t *, size_t);
+size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
 #endif
 
-#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE
-wchar_t        *wcsdup(const wchar_t *);
+#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
+#include <xlocale/_wchar.h>
 #endif
 __END_DECLS
 
-#define getwc(f) fgetwc(f)
-#define getwchar() getwc(stdin)
-#define putwc(wc, f) fputwc((wc), (f))
-#define putwchar(wc) putwc((wc), stdout)
-
 #endif /* !_WCHAR_H_ */
index 13f3fd4..f7fd4f0 100644 (file)
@@ -1,6 +1,3 @@
-/*     $NetBSD: src/include/wctype.h,v 1.5 2003/03/02 22:18:11 tshiozak Exp $  */
-/*     $DragonFly: src/include/wctype.h,v 1.6 2005/04/21 16:36:34 joerg Exp $ */
-
 /*-
  * Copyright (c)1999 Citrus Project,
  * All rights reserved.
  * SUCH DAMAGE.
  *
  *     citrus Id: wctype.h,v 1.4 2000/12/21 01:50:21 itojun Exp
+ *     $NetBSD: wctype.h,v 1.3 2000/12/22 14:16:16 itojun Exp $
+ * $FreeBSD: head/include/wctype.h 232498 2012-03-04 15:31:13Z theraven $
  */
 
 #ifndef _WCTYPE_H_
 #define        _WCTYPE_H_
 
-#include <sys/stdint.h>
+#include <sys/cdefs.h>
+#include <sys/types.h>
 
-#ifndef _WINT_T_DECLARED
-#define        _WINT_T_DECLARED
-typedef        __wint_t        wint_t;
+#include <ctype.h>
+
+#ifndef _WCTRANS_T
+typedef        int     wctrans_t;
+#define        _WCTRANS_T
 #endif
 
-#ifndef _WCTRANS_T_DECLARED
-#define        _WCTRANS_T_DECLARED
-typedef        __wctrans_t     wctrans_t;
+#ifndef _WCTYPE_T
+typedef        unsigned long   wctype_t;
+#define        _WCTYPE_T
 #endif
 
-#ifndef _WCTYPE_T_DECLARED
-#define        _WCTYPE_T_DECLARED
-typedef __wctype_t     wctype_t;
+#ifndef _WINT_T_DECLARED
+typedef        __wint_t        wint_t;
+#define        _WINT_T_DECLARED
 #endif
 
 #ifndef WEOF
@@ -58,6 +60,7 @@ int   iswalnum(wint_t);
 int    iswalpha(wint_t);
 int    iswblank(wint_t);
 int    iswcntrl(wint_t);
+int    iswctype(wint_t, wctype_t);
 int    iswdigit(wint_t);
 int    iswgraph(wint_t);
 int    iswlower(wint_t);
@@ -66,12 +69,57 @@ int iswpunct(wint_t);
 int    iswspace(wint_t);
 int    iswupper(wint_t);
 int    iswxdigit(wint_t);
-int    iswctype(wint_t, wctype_t);
 wint_t towctrans(wint_t, wctrans_t);
 wint_t towlower(wint_t);
 wint_t towupper(wint_t);
-wctrans_t wctrans(const char *);
-wctype_t wctype(const char *);
+wctrans_t
+       wctrans(const char *);
+wctype_t
+       wctype(const char *);
+
+#if __BSD_VISIBLE
+wint_t iswascii(wint_t);
+wint_t iswhexnumber(wint_t);
+wint_t iswideogram(wint_t);
+wint_t iswnumber(wint_t);
+wint_t iswphonogram(wint_t);
+wint_t iswrune(wint_t);
+wint_t iswspecial(wint_t);
+wint_t nextwctype(wint_t, wctype_t);
+#endif
+
+#if __POSIX_VISIBLE >= 200809
+#define _XLOCALE_WCTYPES 1
+#include <xlocale/_ctype.h>
+#endif /* __POSIX_VISIBLE >= 200809 */
 __END_DECLS
 
+#ifndef __cplusplus
+#define        iswalnum(wc)            __istype((wc), _CTYPE_A|_CTYPE_D)
+#define        iswalpha(wc)            __istype((wc), _CTYPE_A)
+#define        iswblank(wc)            __istype((wc), _CTYPE_B)
+#define        iswcntrl(wc)            __istype((wc), _CTYPE_C)
+#define        iswctype(wc, charclass) __istype((wc), (charclass))
+#define        iswdigit(wc)            __isctype((wc), _CTYPE_D)
+#define        iswgraph(wc)            __istype((wc), _CTYPE_G)
+#define        iswlower(wc)            __istype((wc), _CTYPE_L)
+#define        iswprint(wc)            __istype((wc), _CTYPE_R)
+#define        iswpunct(wc)            __istype((wc), _CTYPE_P)
+#define        iswspace(wc)            __istype((wc), _CTYPE_S)
+#define        iswupper(wc)            __istype((wc), _CTYPE_U)
+#define        iswxdigit(wc)           __isctype((wc), _CTYPE_X)
+#define        towlower(wc)            __tolower(wc)
+#define        towupper(wc)            __toupper(wc)
+
+#if __BSD_VISIBLE
+#define        iswascii(wc)            (((wc) & ~0x7F) == 0)
+#define        iswhexnumber(wc)        __istype((wc), _CTYPE_X)
+#define        iswideogram(wc)         __istype((wc), _CTYPE_I)
+#define        iswnumber(wc)           __istype((wc), _CTYPE_D)
+#define        iswphonogram(wc)        __istype((wc), _CTYPE_Q)
+#define        iswrune(wc)             __istype((wc), 0xFFFFFF00L)
+#define        iswspecial(wc)          __istype((wc), _CTYPE_T)
+#endif /* __BSD_VISIBLE */
+#endif /* __cplusplus */
+
 #endif         /* _WCTYPE_H_ */
similarity index 59%
copy from lib/libc/citrus/citrus_esdb.h
copy to include/xlocale.h
index 117f9c6..2d214be 100644 (file)
@@ -1,11 +1,10 @@
-/* $NetBSD: src/lib/libc/citrus/citrus_esdb.h,v 1.1 2003/06/25 09:51:32 tshiozak Exp $ */
-/* $DragonFly: src/lib/libc/citrus/citrus_esdb.h,v 1.2 2008/04/10 10:21:01 hasso Exp $ */
-
-
 /*-
- * Copyright (c)2003 Citrus Project,
+ * Copyright (c) 2011, 2012 The FreeBSD Foundation
  * All rights reserved.
  *
+ * This software was developed by David Chisnall under sponsorship from
+ * the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
+ *
+ * $FreeBSD: head/include/xlocale.h 232498 2012-03-04 15:31:13Z theraven $
  */
 
-#ifndef _CITRUS_ESDB_H_
-#define _CITRUS_ESDB_H_
+#ifndef _XLOCALE_H_
+#define _XLOCALE_H_
 
-struct _citrus_esdb_charset {
-       _citrus_csid_t                  ec_csid;
-       char                            *ec_csname;
-};
+#include <locale.h>
+__BEGIN_DECLS
+#include <xlocale/_locale.h>
 
-struct _citrus_esdb {
-       char                            *db_encname;
-       void                            *db_variable;
-       size_t                          db_len_variable;
-       int                             db_num_charsets;
-       struct  _citrus_esdb_charset    *db_charsets;
-       int                             db_use_invalid;
-       _citrus_wc_t                    db_invalid;
-};
+#ifdef _STRING_H_
+#include <xlocale/_string.h>
+#endif
 
-__BEGIN_DECLS
-const char     *_citrus_esdb_alias(const char *, char *, size_t);
-int            _citrus_esdb_open(struct _citrus_esdb *, const char *);
-void           _citrus_esdb_close(struct _citrus_esdb *);
-void           _citrus_esdb_free_list(char **, size_t);
-int            _citrus_esdb_get_list(char ***, size_t *);
+#ifdef _INTTYPES_H_
+#include <xlocale/_inttypes.h>
+#endif
+
+#ifdef _MONETARY_H_
+#include <xlocale/_monetary.h>
+#endif
+
+#ifdef _STDLIB_H_
+#include <xlocale/_stdlib.h>
+#endif
+
+#ifdef _TIME_H_
+#include <xlocale/_time.h>
+#endif
+
+#ifdef _LANGINFO_H_
+#include <xlocale/_langinfo.h>
+#endif
+
+#ifdef _CTYPE_H_
+#include <xlocale/_ctype.h>
+#endif
+
+#ifdef _WCTYPE_H_
+#define _XLOCALE_WCTYPES 1
+#include <xlocale/_ctype.h>
+#endif
+
+#ifdef _STDIO_H_
+#include <xlocale/_stdio.h>
+#endif
+
+#ifdef _WCHAR_H_
+#include <xlocale/_wchar.h>
+#endif
+
+
+
+struct lconv   *localeconv_l(locale_t);
 __END_DECLS
 
 #endif
diff --git a/include/xlocale/Makefile b/include/xlocale/Makefile
new file mode 100644 (file)
index 0000000..5bf7a24
--- /dev/null
@@ -0,0 +1,8 @@
+# $FreeBSD: head/include/xlocale/Makefile 250883 2013-05-21 19:59:37Z ed $ 
+
+NO_OBJ=
+INCS=  _ctype.h _inttypes.h _langinfo.h _locale.h _monetary.h _stdio.h \
+       _stdlib.h _string.h _time.h _uchar.h _wchar.h
+INCSDIR=${INCLUDEDIR}/xlocale
+
+.include <bsd.prog.mk>
diff --git a/include/xlocale/_ctype.h b/include/xlocale/_ctype.h
new file mode 100644 (file)
index 0000000..3d4857e
--- /dev/null
@@ -0,0 +1,203 @@
+/*-
+ * Copyright (c) 2011 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by David Chisnall under sponsorship from
+ * the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: head/include/xlocale/_ctype.h 243032 2012-11-14 17:44:37Z demon $
+ */
+
+
+#if    (defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_WCTYPE_H)) || \
+       (!defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_CTYPE_H))
+
+#ifdef _XLOCALE_WCTYPES
+#define _XLOCALE_WCTYPE_H
+#else
+#define _XLOCALE_CTYPE_H
+#endif
+
+#ifndef _LOCALE_T_DEFINED
+#define _LOCALE_T_DEFINED
+typedef struct _xlocale *locale_t;
+#endif
+
+#ifndef _XLOCALE_RUN_FUNCTIONS_DEFINED
+#define _XLOCALE_RUN_FUNCTIONS_DEFINED 1
+unsigned long   ___runetype_l(__ct_rune_t, locale_t) __pure;
+__ct_rune_t     ___tolower_l(__ct_rune_t, locale_t) __pure;
+__ct_rune_t     ___toupper_l(__ct_rune_t, locale_t) __pure;
+_RuneLocale    *__runes_for_locale(locale_t, int*);
+#endif
+
+#ifndef _XLOCALE_INLINE
+#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
+/* GNU89 inline has nonstandard semantics. */
+#define _XLOCALE_INLINE extern __inline
+#else
+/* Hack to work around people who define inline away */
+#ifdef inline
+#define _XLOCALE_INLINE static __inline
+#else
+/* Define with C++ / C99 compatible semantics */
+#define _XLOCALE_INLINE inline
+#endif
+#endif
+#endif /* _XLOCALE_INLINE */
+
+#ifdef _XLOCALE_WCTYPES
+_XLOCALE_INLINE int
+__maskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc);
+_XLOCALE_INLINE int
+__istype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc);
+
+_XLOCALE_INLINE int
+__maskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc)
+{
+       int __limit;
+       _RuneLocale *runes = __runes_for_locale(__loc, &__limit);
+       return ((__c < 0 || __c >= _CACHED_RUNES) ? ___runetype_l(__c, __loc) :
+               runes->__runetype[__c]) & __f;
+}
+
+_XLOCALE_INLINE int
+__istype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc)
+{
+       return (!!__maskrune_l(__c, __f, __loc));
+}
+
+#define XLOCALE_ISCTYPE(fname, cat) \
+               _XLOCALE_INLINE int isw##fname##_l(int, locale_t);\
+               _XLOCALE_INLINE int isw##fname##_l(int __c, locale_t __l)\
+               { return __istype_l(__c, cat, __l); }
+#else
+_XLOCALE_INLINE int
+__sbmaskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc);
+_XLOCALE_INLINE int
+__sbistype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc);
+
+_XLOCALE_INLINE int
+__sbmaskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc)
+{
+       int __limit;
+       _RuneLocale *runes = __runes_for_locale(__loc, &__limit);
+       return (__c < 0 || __c >= __limit) ? 0 :
+              runes->__runetype[__c] & __f;
+}
+
+_XLOCALE_INLINE int
+__sbistype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc)
+{
+       return (!!__sbmaskrune_l(__c, __f, __loc));
+}
+
+#define XLOCALE_ISCTYPE(__fname, __cat) \
+               _XLOCALE_INLINE int is##__fname##_l(int, locale_t); \
+               _XLOCALE_INLINE int is##__fname##_l(int __c, locale_t __l)\
+               { return __sbistype_l(__c, __cat, __l); }
+#endif
+
+XLOCALE_ISCTYPE(alnum, _CTYPE_A|_CTYPE_D)
+XLOCALE_ISCTYPE(alpha, _CTYPE_A)
+XLOCALE_ISCTYPE(blank, _CTYPE_B)
+XLOCALE_ISCTYPE(cntrl, _CTYPE_C)
+XLOCALE_ISCTYPE(digit, _CTYPE_D)
+XLOCALE_ISCTYPE(graph, _CTYPE_G)
+XLOCALE_ISCTYPE(hexnumber, _CTYPE_X)
+XLOCALE_ISCTYPE(ideogram, _CTYPE_I)
+XLOCALE_ISCTYPE(lower, _CTYPE_L)
+XLOCALE_ISCTYPE(number, _CTYPE_D)
+XLOCALE_ISCTYPE(phonogram, _CTYPE_Q)
+XLOCALE_ISCTYPE(print, _CTYPE_R)
+XLOCALE_ISCTYPE(punct, _CTYPE_P)
+XLOCALE_ISCTYPE(rune, 0xFFFFFF00L)
+XLOCALE_ISCTYPE(space, _CTYPE_S)
+XLOCALE_ISCTYPE(special, _CTYPE_T)
+XLOCALE_ISCTYPE(upper, _CTYPE_U)
+XLOCALE_ISCTYPE(xdigit, _CTYPE_X)
+#undef XLOCALE_ISCTYPE
+
+#ifdef _XLOCALE_WCTYPES
+_XLOCALE_INLINE int towlower_l(int, locale_t);
+_XLOCALE_INLINE int __wcwidth_l(__ct_rune_t, locale_t);
+_XLOCALE_INLINE int towupper_l(int, locale_t);
+
+_XLOCALE_INLINE int towlower_l(int __c, locale_t __l)
+{
+       int __limit;
+       _RuneLocale *__runes = __runes_for_locale(__l, &__limit);
+       return (__c < 0 || __c >= _CACHED_RUNES) ? ___tolower_l(__c, __l) :
+              __runes->__maplower[__c];
+}
+_XLOCALE_INLINE int towupper_l(int __c, locale_t __l)
+{
+       int __limit;
+       _RuneLocale *__runes = __runes_for_locale(__l, &__limit);
+       return (__c < 0 || __c >= _CACHED_RUNES) ? ___toupper_l(__c, __l) :
+              __runes->__mapupper[__c];
+}
+_XLOCALE_INLINE int
+__wcwidth_l(__ct_rune_t _c, locale_t __l)
+{
+       unsigned int _x;
+
+       if (_c == 0)
+               return (0);
+       _x = (unsigned int)__maskrune_l(_c, _CTYPE_SWM|_CTYPE_R, __l);
+       if ((_x & _CTYPE_SWM) != 0)
+               return ((_x & _CTYPE_SWM) >> _CTYPE_SWS);
+       return ((_x & _CTYPE_R) != 0 ? 1 : -1);
+}
+int iswctype_l(wint_t __wc, wctype_t __charclass, locale_t __l);
+wctype_t wctype_l(const char *property, locale_t __l);
+wint_t towctrans_l(wint_t __wc, wctrans_t desc, locale_t __l);
+wint_t nextwctype_l(wint_t __wc, wctype_t wct, locale_t __l);
+wctrans_t wctrans_l(const char *__charclass, locale_t __l);
+#undef _XLOCALE_WCTYPES
+#else
+_XLOCALE_INLINE int digittoint_l(int, locale_t);
+_XLOCALE_INLINE int tolower_l(int, locale_t);
+_XLOCALE_INLINE int toupper_l(int, locale_t);
+
+_XLOCALE_INLINE int digittoint_l(int __c, locale_t __l)
+{ return __sbmaskrune_l((__c), 0xFF, __l); }
+
+_XLOCALE_INLINE int tolower_l(int __c, locale_t __l)
+{
+       int __limit;
+       _RuneLocale *__runes = __runes_for_locale(__l, &__limit);
+       return (__c < 0 || __c >= __limit) ? __c :
+              __runes->__maplower[__c];
+}
+_XLOCALE_INLINE int toupper_l(int __c, locale_t __l)
+{
+       int __limit;
+       _RuneLocale *__runes = __runes_for_locale(__l, &__limit);
+       return (__c < 0 || __c >= __limit) ? __c :
+              __runes->__mapupper[__c];
+}
+#endif
+#endif /* (defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_WCTYPE_H)) || \
+       (!defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_CTYPE_H)) */
similarity index 64%
copy from lib/libc/stdio/getwc.c
copy to include/xlocale/_inttypes.h
index 4eb88d0..3c59005 100644 (file)
@@ -1,7 +1,10 @@
 /*-
- * Copyright (c) 2002 Tim J. Robbins.
+ * Copyright (c) 2011, 2012 The FreeBSD Foundation
  * All rights reserved.
  *
+ * This software was developed by David Chisnall under sponsorship from
+ * the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/lib/libc/stdio/getwc.c,v 1.3 2004/05/25 10:42:52 tjr Exp $
- * $DragonFly: src/lib/libc/stdio/getwc.c,v 1.1 2005/07/25 00:37:41 joerg Exp $
+ * $FreeBSD: head/include/xlocale/_inttypes.h 231673 2012-02-14 12:03:23Z theraven $
  */
 
-#include "namespace.h"
-#include <stdio.h>
-#include <wchar.h>
-#include "un-namespace.h"
-#include "libc_private.h"
-#include "local.h"
-
-#undef getwc
 
 /*
- * Synonym for fgetwc(). The only difference is that getwc(), if it is a
- * macro, may evaluate `fp' more than once.
+ * Extended locale versions of the locale-aware functions from inttypes.h.
+ * Include <inttypes.h> before <xlocale.h> to expose these.
  */
-wint_t
-getwc(FILE *fp)
-{
-
-       return (fgetwc(fp));
-}
+intmax_t       strtoimax_l(const char * __restrict, char ** __restrict,
+                   int, locale_t);
+uintmax_t      strtoumax_l(const char * __restrict, char ** __restrict, int,
+                   locale_t);
+intmax_t       wcstoimax_l(const wchar_t * __restrict, wchar_t ** __restrict,
+                   int , locale_t);
+uintmax_t      wcstoumax_l(const wchar_t * __restrict, wchar_t ** __restrict,
+                   int, locale_t);
similarity index 74%
copy from lib/libc/citrus/citrus_mmap.h
copy to include/xlocale/_langinfo.h
index 03d995f..a60eac8 100644 (file)
@@ -1,10 +1,10 @@
-/* $NetBSD: src/lib/libc/citrus/citrus_mmap.h,v 1.1 2003/06/25 09:51:38 tshiozak Exp $ */
-/* $DragonFly: src/lib/libc/citrus/citrus_mmap.h,v 1.2 2008/04/10 10:21:01 hasso Exp $ */
-
 /*-
- * Copyright (c)2003 Citrus Project,
+ * Copyright (c) 2011, 2012 The FreeBSD Foundation
  * All rights reserved.
  *
+ * This software was developed by David Chisnall under sponsorship from
+ * the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
+ * $FreeBSD: head/include/xlocale/_langinfo.h 231673 2012-02-14 12:03:23Z theraven $
  */
 
-#ifndef _CITRUS_MMAP_H_
-#define _CITRUS_MMAP_H_
-
-__BEGIN_DECLS
-int _citrus_map_file(struct _citrus_region * __restrict,
-                    const char * __restrict);
-void _citrus_unmap_file(struct _citrus_region *);
-__END_DECLS
+#ifndef _XLOCALE_LANGINFO_H
+#define _XLOCALE_LANGINFO_H
 
+#ifndef _LOCALE_T_DEFINED
+#define _LOCALE_T_DEFINED
+typedef struct _xlocale *locale_t;
 #endif
+
+char   *nl_langinfo_l(nl_item, locale_t);
+
+#endif /* _XLOCALE_LANGINFO_H */
similarity index 57%
copy from lib/libc/citrus/citrus_mmap.h
copy to include/xlocale/_locale.h
index 03d995f..ff53b3e 100644 (file)
@@ -1,10 +1,10 @@
-/* $NetBSD: src/lib/libc/citrus/citrus_mmap.h,v 1.1 2003/06/25 09:51:38 tshiozak Exp $ */
-/* $DragonFly: src/lib/libc/citrus/citrus_mmap.h,v 1.2 2008/04/10 10:21:01 hasso Exp $ */
-
 /*-
- * Copyright (c)2003 Citrus Project,
+ * Copyright (c) 2011, 2012 The FreeBSD Foundation
  * All rights reserved.
  *
+ * This software was developed by David Chisnall under sponsorship from
+ * the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
+ * $FreeBSD: head/include/xlocale/_locale.h 231673 2012-02-14 12:03:23Z theraven $
  */
 
-#ifndef _CITRUS_MMAP_H_
-#define _CITRUS_MMAP_H_
+#ifndef _XLOCALE_LOCALE_H
+#define _XLOCALE_LOCALE_H
 
-__BEGIN_DECLS
-int _citrus_map_file(struct _citrus_region * __restrict,
-                    const char * __restrict);
-void _citrus_unmap_file(struct _citrus_region *);
-__END_DECLS
+#define LC_COLLATE_MASK  (1<<0)
+#define LC_CTYPE_MASK    (1<<1)
+#define LC_MESSAGES_MASK (1<<2)
+#define LC_MONETARY_MASK (1<<3)
+#define LC_NUMERIC_MASK  (1<<4)
+#define LC_TIME_MASK     (1<<5)
+#define LC_ALL_MASK      (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MESSAGES_MASK | \
+                         LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK)
+#define LC_GLOBAL_LOCALE ((locale_t)-1)
 
+#ifndef _LOCALE_T_DEFINED
+#define _LOCALE_T_DEFINED
+typedef struct _xlocale *locale_t;
 #endif
+
+locale_t        duplocale(locale_t base);
+int             freelocale(locale_t loc);
+locale_t        newlocale(int mask, const char *locale, locale_t base);
+const char     *querylocale(int mask, locale_t loc);
+locale_t        uselocale(locale_t loc);
+
+#endif /* _XLOCALE_LOCALE_H */
similarity index 68%
rename from lib/libc/citrus/citrus_ctype_fallback.h
rename to include/xlocale/_monetary.h
index 3353524..9af2097 100644 (file)
@@ -1,10 +1,10 @@
-/* $NetBSD: src/lib/libc/citrus/citrus_ctype_fallback.h,v 1.1 2003/03/05 20:18:15 tshiozak Exp $ */
-/* $DragonFly: src/lib/libc/citrus/citrus_ctype_fallback.h,v 1.2 2008/04/10 10:21:01 hasso Exp $ */
-
 /*-
- * Copyright (c)2003 Citrus Project,
+ * Copyright (c) 2011, 2012 The FreeBSD Foundation
  * All rights reserved.
  *
+ * This software was developed by David Chisnall under sponsorship from
+ * the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
+ *
+ * $FreeBSD: head/include/xlocale/_monetary.h 231673 2012-02-14 12:03:23Z theraven $
  */
 
-#ifndef _CITRUS_CTYPE_FALLBACK_H_
-#define _CITRUS_CTYPE_FALLBACK_H_
+#ifndef _LOCALE_T_DEFINED
+#define _LOCALE_T_DEFINED
+typedef struct _xlocale *locale_t;
+#endif
 
-/* fallback functions for 0x00000002 */
-int _citrus_ctype_btowc_fallback(_citrus_ctype_rec_t * __restrict,
-                                int, wint_t * __restrict);
-int _citrus_ctype_wctob_fallback(_citrus_ctype_rec_t * __restrict,
-                                wint_t, int * __restrict);
+#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
+#ifndef _XLOCALE_MONETARY_H
+#define _XLOCALE_MONETARY_H
 
-#endif
+ssize_t strfmon_l(char *, size_t, locale_t, const char *, ...)
+    __strfmonlike(4, 5);
+
+#endif /* _XLOCALE_MONETARY_H */
+#endif /* __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) */
diff --git a/include/xlocale/_stdio.h b/include/xlocale/_stdio.h
new file mode 100644 (file)
index 0000000..1eead2f
--- /dev/null
@@ -0,0 +1,64 @@
+/*-
+ * Copyright (c) 2011, 2012 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by David Chisnall under sponsorship from
+ * the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: head/include/xlocale/_stdio.h 231673 2012-02-14 12:03:23Z theraven $
+ */
+
+int     asprintf_l(char **, locale_t, const char *, ...) __printflike(3, 4);
+int     dprintf_l(int, locale_t, const char * __restrict, ...)
+           __printflike(3, 4);
+int     fprintf_l(FILE * __restrict, locale_t, const char * __restrict, ...)
+           __printflike(3, 4);
+int     fscanf_l(FILE * __restrict, locale_t, const char * __restrict, ...)
+           __scanflike(3, 4);
+int     printf_l(locale_t, const char * __restrict, ...) __printflike(2, 3);
+int     scanf_l(locale_t, const char * __restrict, ...) __scanflike(2, 3);
+int     snprintf_l(char * __restrict, size_t, locale_t,
+           const char * __restrict, ...) __printflike(4, 5);
+int     sprintf_l(char * __restrict, locale_t, const char * __restrict, ...)
+           __printflike(3, 4);
+int     sscanf_l(const char * __restrict, locale_t, const char * __restrict,
+           ...) __scanflike(3, 4);
+int     vfprintf_l(FILE * __restrict, locale_t, const char * __restrict,
+           __va_list) __printflike(3, 0);
+int     vprintf_l(locale_t, const char * __restrict, __va_list)
+           __printflike(2, 0);
+int     vsprintf_l(char * __restrict, locale_t, const char * __restrict,
+           __va_list) __printflike(3, 0);
+int     vfscanf_l(FILE * __restrict, locale_t, const char * __restrict,
+           __va_list) __scanflike(3, 0);
+int     vscanf_l(locale_t, const char * __restrict, __va_list)
+           __scanflike(2, 0);
+int     vsnprintf_l(char * __restrict, size_t, locale_t,
+           const char * __restrict, __va_list) __printflike(4, 0);
+int     vsscanf_l(const char * __restrict, locale_t, const char * __restrict,
+           __va_list) __scanflike(3, 0);
+int     vdprintf_l(int, locale_t, const char * __restrict, __va_list)
+           __printflike(3, 0);
+int     vasprintf_l(char **, locale_t, const char *, __va_list)
+           __printflike(3, 0);
diff --git a/include/xlocale/_stdlib.h b/include/xlocale/_stdlib.h
new file mode 100644 (file)
index 0000000..bde781c
--- /dev/null
@@ -0,0 +1,59 @@
+/*-
+ * Copyright (c) 2011, 2012 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by David Chisnall under sponsorship from
+ * the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: head/include/xlocale/_stdlib.h 231673 2012-02-14 12:03:23Z theraven $
+ */
+
+/*
+ * Extended locale versions of the locale-aware functions from stdlib.h.
+ *
+ * Include <stdlib.h> before <xlocale.h> to expose these.
+ */
+double                  atof_l(const char *, locale_t);
+int                     atoi_l(const char *, locale_t);
+long                    atol_l(const char *, locale_t);
+long long               atoll_l(const char *, locale_t);
+int                     mblen_l(const char *, size_t, locale_t);
+size_t                  mbstowcs_l(wchar_t * __restrict,
+                           const char * __restrict, size_t, locale_t);
+int                     mbtowc_l(wchar_t * __restrict,
+                           const char * __restrict, size_t, locale_t);
+double                  strtod_l(const char *, char **, locale_t);
+float                   strtof_l(const char *, char **, locale_t);
+long                    strtol_l(const char *, char **, int, locale_t);
+long double             strtold_l(const char *, char **, locale_t);
+long long               strtoll_l(const char *, char **, int, locale_t);
+unsigned long           strtoul_l(const char *, char **, int, locale_t);
+unsigned long long      strtoull_l(const char *, char **, int, locale_t);
+size_t                  wcstombs_l(char * __restrict,
+                           const wchar_t * __restrict, size_t, locale_t);
+int                     wctomb_l(char *, wchar_t, locale_t);
+
+int                     ___mb_cur_max_l(locale_t);
+#define MB_CUR_MAX_L(x) (___mb_cur_max_l(x))
+
similarity index 58%
copy from include/iconv.h
copy to include/xlocale/_string.h
index 29dee16..2c6acd6 100644 (file)
@@ -1,8 +1,5 @@
-/*     $NetBSD: iconv.h,v 1.3 2003/08/22 14:05:03 kleink Exp $ */
-/*     $DragonFly: src/include/iconv.h,v 1.1 2005/03/11 23:33:53 joerg Exp $ */
-
 /*-
- * Copyright (c)2003 Citrus Project,
+ * Copyright (c) 2011, 2012 The FreeBSD Foundation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
+ * $FreeBSD: head/include/xlocale/_string.h 231673 2012-02-14 12:03:23Z theraven $
  */
 
-#ifndef _ICONV_H_
-#define _ICONV_H_
+#ifndef _LOCALE_T_DEFINED
+#define _LOCALE_T_DEFINED
+typedef struct _xlocale *locale_t;
+#endif
+
+/*
+ * This file is included from both string.h and xlocale.h.  We need to expose
+ * the declarations unconditionally if we are included from xlocale.h, but only
+ * if we are in POSIX2008 mode if included from string.h.
+ */
 
-#include <sys/types.h>
+#ifndef _XLOCALE_STRING1_H
+#define _XLOCALE_STRING1_H
 
-struct __tag_iconv_t;
-typedef        struct __tag_iconv_t    *iconv_t;
+/*
+ * POSIX2008 functions
+ */
+int     strcoll_l(const char *, const char *, locale_t);
+size_t  strxfrm_l(char *, const char *, size_t, locale_t);
+#endif /* _XLOCALE_STRING1_H */
 
-__BEGIN_DECLS
-iconv_t        iconv_open(const char *, const char *);
-size_t iconv(iconv_t, char ** __restrict, size_t * __restrict,
-             char ** __restrict, size_t * __restrict);
-int    iconv_close(iconv_t);
 /*
- * non-portable interfaces for iconv
+ * xlocale extensions
  */
-int    __iconv_get_list(char ***, size_t *);
-void   __iconv_free_list(char **, size_t);
-size_t __iconv(iconv_t, const char **, size_t *, char **, size_t *,
-               __uint32_t, size_t *);
-#define __ICONV_F_HIDE_INVALID 0x0001
-__END_DECLS
+#ifdef _XLOCALE_H_
+#ifndef _XLOCALE_STRING2_H
+#define _XLOCALE_STRING2_H
+int     strcasecmp_l(const char *, const char *, locale_t);
+char   *strcasestr_l(const char *, const char *, locale_t);
+int     strncasecmp_l(const char *, const char *, size_t, locale_t);
 
-#endif /* !_ICONV_H_ */
+#endif /* _XLOCALE_STRING2_H */
+#endif /* _XLOCALE_H_ */
similarity index 57%
copy from include/iconv.h
copy to include/xlocale/_time.h
index 29dee16..043c343 100644 (file)
@@ -1,10 +1,10 @@
-/*     $NetBSD: iconv.h,v 1.3 2003/08/22 14:05:03 kleink Exp $ */
-/*     $DragonFly: src/include/iconv.h,v 1.1 2005/03/11 23:33:53 joerg Exp $ */
-
 /*-
- * Copyright (c)2003 Citrus Project,
+ * Copyright (c) 2011, 2012 The FreeBSD Foundation
  * All rights reserved.
  *
+ * This software was developed by David Chisnall under sponsorship from
+ * the FreeBSD Foundation.
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * are met:
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
+ * $FreeBSD: head/include/xlocale/_time.h 231673 2012-02-14 12:03:23Z theraven $
  */
 
-#ifndef _ICONV_H_
-#define _ICONV_H_
-
-#include <sys/types.h>
-
-struct __tag_iconv_t;
-typedef        struct __tag_iconv_t    *iconv_t;
+#ifndef _LOCALE_T_DEFINED
+#define _LOCALE_T_DEFINED
+typedef struct _xlocale *locale_t;
+#endif
 
-__BEGIN_DECLS
-iconv_t        iconv_open(const char *, const char *);
-size_t iconv(iconv_t, char ** __restrict, size_t * __restrict,
-             char ** __restrict, size_t * __restrict);
-int    iconv_close(iconv_t);
 /*
- * non-portable interfaces for iconv
+ * This file is included from both locale.h and xlocale.h.  We need to expose
+ * the declarations unconditionally if we are included from xlocale.h, but only
+ * if we are in POSIX2008 mode if included from locale.h.
  */
-int    __iconv_get_list(char ***, size_t *);
-void   __iconv_free_list(char **, size_t);
-size_t __iconv(iconv_t, const char **, size_t *, char **, size_t *,
-               __uint32_t, size_t *);
-#define __ICONV_F_HIDE_INVALID 0x0001
-__END_DECLS
+#ifndef _XLOCALE_LOCALE1_H
+#define _XLOCALE_LOCALE1_H
+
+size_t  strftime_l(char * __restrict, size_t, const char * __restrict,
+           const struct tm * __restrict, locale_t);
+
+#endif /* _XLOCALE_LOCALE1_H */
+
+#ifdef _XLOCALE_H_
+#ifndef _XLOCALE_LOCALE2_H
+#define _XLOCALE_LOCALE2_H
+
+char   *strptime_l(const char * __restrict, const char * __restrict,
+           struct tm * __restrict, locale_t);
 
-#endif /* !_ICONV_H_ */
+#endif /* _XLOCALE_LOCALE2_H */
+#endif /* _XLOCALE_H_ */
similarity index 65%
copy from lib/libc/citrus/citrus_mmap.h
copy to include/xlocale/_uchar.h
index 03d995f..597c356 100644 (file)
@@ -1,8 +1,5 @@
-/* $NetBSD: src/lib/libc/citrus/citrus_mmap.h,v 1.1 2003/06/25 09:51:38 tshiozak Exp $ */
-/* $DragonFly: src/lib/libc/citrus/citrus_mmap.h,v 1.2 2008/04/10 10:21:01 hasso Exp $ */
-
 /*-
- * Copyright (c)2003 Citrus Project,
+ * Copyright (c) 2013 Ed Schouten <ed@FreeBSD.org>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
+ * $FreeBSD: head/include/xlocale/_uchar.h 250883 2013-05-21 19:59:37Z ed $
  */
 
-#ifndef _CITRUS_MMAP_H_
-#define _CITRUS_MMAP_H_
+#ifndef _LOCALE_T_DEFINED
+#define _LOCALE_T_DEFINED
+typedef struct _xlocale *locale_t;
+#endif
+
+#ifndef _XLOCALE_UCHAR_H_
+#define _XLOCALE_UCHAR_H_
 
-__BEGIN_DECLS
-int _citrus_map_file(struct _citrus_region * __restrict,
-                    const char * __restrict);
-void _citrus_unmap_file(struct _citrus_region *);
-__END_DECLS
+size_t c16rtomb_l(char * __restrict, char16_t, mbstate_t * __restrict,
+    locale_t);
+size_t c32rtomb_l(char * __restrict, char32_t, mbstate_t * __restrict,
+    locale_t);
+size_t mbrtoc16_l(char16_t * __restrict, const char * __restrict, size_t,
+    mbstate_t * __restrict, locale_t);
+size_t mbrtoc32_l(char32_t * __restrict, const char * __restrict, size_t,
+    mbstate_t * __restrict, locale_t);
 
-#endif
+#endif /* _XLOCALE_UCHAR_H_ */
diff --git a/include/xlocale/_wchar.h b/include/xlocale/_wchar.h
new file mode 100644 (file)
index 0000000..d96c0dc
--- /dev/null
@@ -0,0 +1,133 @@
+/*-
+ * Copyright (c) 2011, 2012 The FreeBSD Foundation
+ * All rights reserved.
+ *
+ * This software was developed by David Chisnall under sponsorship from
+ * the FreeBSD Foundation.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: head/include/xlocale/_wchar.h 231673 2012-02-14 12:03:23Z theraven $
+ */
+
+#ifndef _LOCALE_T_DEFINED
+#define _LOCALE_T_DEFINED
+typedef struct _xlocale *locale_t;
+#endif
+
+#ifndef _XLOCALE_WCHAR1_H
+#define _XLOCALE_WCHAR1_H
+int                     wcscasecmp_l(const wchar_t *, const wchar_t *,
+                          locale_t);
+int                     wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t,
+                          locale_t);
+int                     wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
+size_t                  wcsxfrm_l(wchar_t * __restrict,
+                          const wchar_t * __restrict, size_t, locale_t);
+
+#endif /* _XLOCALE_WCHAR1_H */
+
+/*
+ * Only declare the non-POSIX functions if we're included from xlocale.h.
+ */
+
+#ifdef _XLOCALE_H_
+#ifndef _XLOCALE_WCHAR2_H
+#define _XLOCALE_WCHAR2_H
+
+wint_t                  btowc_l(int, locale_t);
+wint_t                  fgetwc_l(FILE *, locale_t);
+wchar_t                        *fgetws_l(wchar_t * __restrict, int, FILE * __restrict,
+                           locale_t);
+wint_t                  fputwc_l(wchar_t, FILE *, locale_t);
+int                     fputws_l(const wchar_t * __restrict, FILE * __restrict,
+                          locale_t);
+int                     fwprintf_l(FILE * __restrict, locale_t,
+                           const wchar_t * __restrict, ...);
+int                     fwscanf_l(FILE * __restrict, locale_t,
+                           const wchar_t * __restrict, ...);
+wint_t                  getwc_l(FILE *, locale_t);
+wint_t                  getwchar_l(locale_t);
+size_t                  mbrlen_l(const char * __restrict, size_t,
+                          mbstate_t * __restrict, locale_t);
+size_t                  mbrtowc_l(wchar_t * __restrict,
+                           const char * __restrict, size_t,
+                           mbstate_t * __restrict, locale_t);
+int                     mbsinit_l(const mbstate_t *, locale_t);
+size_t                  mbsrtowcs_l(wchar_t * __restrict,
+                           const char ** __restrict, size_t,
+                           mbstate_t * __restrict, locale_t);
+wint_t                  putwc_l(wchar_t, FILE *, locale_t);
+wint_t                  putwchar_l(wchar_t, locale_t);
+int                     swprintf_l(wchar_t * __restrict, size_t n, locale_t,
+                           const wchar_t * __restrict, ...);
+int                     swscanf_l(const wchar_t * __restrict, locale_t,
+                          const wchar_t * __restrict, ...);
+wint_t                  ungetwc_l(wint_t, FILE *, locale_t);
+int                     vfwprintf_l(FILE * __restrict, locale_t,
+                           const wchar_t * __restrict, __va_list);
+int                     vswprintf_l(wchar_t * __restrict, size_t n, locale_t,
+                           const wchar_t * __restrict, __va_list);
+int                     vwprintf_l(locale_t, const wchar_t * __restrict,
+                           __va_list);
+size_t                  wcrtomb_l(char * __restrict, wchar_t,
+                           mbstate_t * __restrict, locale_t);
+size_t                  wcsftime_l(wchar_t * __restrict, size_t,
+                           const wchar_t * __restrict,
+                           const struct tm * __restrict, locale_t);
+size_t                  wcsrtombs_l(char * __restrict,
+                           const wchar_t ** __restrict, size_t,
+                           mbstate_t * __restrict, locale_t);
+double                  wcstod_l(const wchar_t * __restrict,
+                           wchar_t ** __restrict, locale_t);
+long                    wcstol_l(const wchar_t * __restrict,
+                           wchar_t ** __restrict, int, locale_t);
+unsigned long           wcstoul_l(const wchar_t * __restrict,
+                           wchar_t ** __restrict, int, locale_t);
+int                     wcswidth_l(const wchar_t *, size_t, locale_t);
+int                     wctob_l(wint_t, locale_t);
+int                     wcwidth_l(wchar_t, locale_t);
+int                     wprintf_l(locale_t, const wchar_t * __restrict, ...);
+int                     wscanf_l(locale_t, const wchar_t * __restrict, ...);
+int                     vfwscanf_l(FILE * __restrict, locale_t,
+                           const wchar_t * __restrict, __va_list);
+int                     vswscanf_l(const wchar_t * __restrict, locale_t,
+                           const wchar_t *__restrict, __va_list);
+int                     vwscanf_l(locale_t, const wchar_t * __restrict,
+                           __va_list);
+float                   wcstof_l(const wchar_t * __restrict,
+                           wchar_t ** __restrict, locale_t);
+long double             wcstold_l(const wchar_t * __restrict,
+                           wchar_t ** __restrict, locale_t);
+long long               wcstoll_l(const wchar_t * __restrict,
+                           wchar_t ** __restrict, int, locale_t);
+unsigned long long      wcstoull_l(const wchar_t * __restrict,
+                           wchar_t ** __restrict, int, locale_t);
+size_t                  mbsnrtowcs_l(wchar_t * __restrict,
+                           const char ** __restrict, size_t, size_t,
+                           mbstate_t * __restrict, locale_t);
+size_t                  wcsnrtombs_l(char * __restrict,
+                           const wchar_t ** __restrict, size_t, size_t,
+                           mbstate_t * __restrict, locale_t);
+
+#endif /* _XLOCALE_WCHAR_H */
+#endif /* _XLOCALE_H_ */
index 9935cc2..cdde968 100644 (file)
@@ -1,6 +1,7 @@
-# $DragonFly: src/lib/i18n_module/BIG5/Makefile,v 1.2 2008/04/10 10:21:00 hasso Exp $
+# $FreeBSD: head/lib/libiconv_modules/BIG5/Makefile 219019 2011-02-25 00:04:39Z gabor $
 
-SRCPRE=        citrus_
-SRCS+= citrus_big5.c citrus_prop.c
+LIB=   BIG5
+SRCS+= citrus_big5.c
+CFLAGS+= --param max-inline-insns-single=32
 
 .include <bsd.lib.mk>
similarity index 72%
rename from lib/libc/citrus/modules/citrus_big5.c
rename to lib/i18n_module/BIG5/citrus_big5.c
index 2eabd9c..f112306 100644 (file)
@@ -1,4 +1,5 @@
-/* $NetBSD: citrus_big5.c,v 1.11 2006/11/22 23:38:27 tnozaki Exp $ */
+/* $FreeBSD: head/lib/libiconv_modules/BIG5/citrus_big5.c 252583 2013-07-03 18:27:45Z peter $ */
+/*     $NetBSD: citrus_big5.c,v 1.12 2008/06/14 16:01:07 tnozaki Exp $ */
 
 /*-
  * Copyright (c)2002, 2006 Citrus Project,
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
 #include <sys/queue.h>
 #include <sys/types.h>
+
 #include <assert.h>
 #include <errno.h>
 #include <limits.h>
-#include <locale.h>
 #include <stddef.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <wchar.h>
 
 #include "citrus_namespace.h"
+#include "citrus_prop.h"
 #include "citrus_types.h"
 #include "citrus_bcs.h"
 #include "citrus_module.h"
-#include "citrus_ctype.h"
 #include "citrus_stdenc.h"
 #include "citrus_big5.h"
 
-#include "citrus_prop.h"
-
 /* ----------------------------------------------------------------------
  * private stuffs used by templates
  */
 
 typedef struct {
-       char ch[2];
-       int chlen;
+       int      chlen;
+       char     ch[2];
 } _BIG5State;
 
 typedef struct _BIG5Exclude {
-       TAILQ_ENTRY(_BIG5Exclude) entry;
-       wint_t start, end;
+       TAILQ_ENTRY(_BIG5Exclude)        entry;
+       wint_t                           end;
+       wint_t                           start;
 } _BIG5Exclude;
 
 typedef TAILQ_HEAD(_BIG5ExcludeList, _BIG5Exclude) _BIG5ExcludeList;
 
 typedef struct {
-       int cell[0x100];
-       _BIG5ExcludeList excludes;
+       _BIG5ExcludeList         excludes;
+       int                      cell[0x100];
 } _BIG5EncodingInfo;
 
-typedef struct {
-       _BIG5EncodingInfo       ei;
-       struct {
-               /* for future multi-locale facility */
-               _BIG5State      s_mblen;
-               _BIG5State      s_mbrlen;
-               _BIG5State      s_mbrtowc;
-               _BIG5State      s_mbtowc;
-               _BIG5State      s_mbsrtowcs;
-               _BIG5State      s_wcrtomb;
-               _BIG5State      s_wcsrtombs;
-               _BIG5State      s_wctomb;
-       } states;
-} _BIG5CTypeInfo;
-
 #define _CEI_TO_EI(_cei_)              (&(_cei_)->ei)
 #define _CEI_TO_STATE(_cei_, _func_)   (_cei_)->states.s_##_func_
 
 #define _FUNCNAME(m)                   _citrus_BIG5_##m
 #define _ENCODING_INFO                 _BIG5EncodingInfo
-#define _CTYPE_INFO                    _BIG5CTypeInfo
 #define _ENCODING_STATE                        _BIG5State
 #define _ENCODING_MB_CUR_MAX(_ei_)     2
 #define _ENCODING_IS_STATE_DEPENDENT   0
@@ -131,44 +116,45 @@ typedef struct {
 
 static __inline void
 /*ARGSUSED*/
-_citrus_BIG5_init_state(_BIG5EncodingInfo * __restrict ei,
-                       _BIG5State * __restrict s)
+_citrus_BIG5_init_state(_BIG5EncodingInfo * __restrict ei __unused,
+    _BIG5State * __restrict s)
 {
+
        memset(s, 0, sizeof(*s));
 }
 
 static __inline void
 /*ARGSUSED*/
-_citrus_BIG5_pack_state(_BIG5EncodingInfo * __restrict ei,
-                       void * __restrict pspriv,
-                       const _BIG5State * __restrict s)
+_citrus_BIG5_pack_state(_BIG5EncodingInfo * __restrict ei __unused,
+    void * __restrict pspriv,
+    const _BIG5State * __restrict s)
 {
+
        memcpy(pspriv, (const void *)s, sizeof(*s));
 }
 
 static __inline void
 /*ARGSUSED*/
-_citrus_BIG5_unpack_state(_BIG5EncodingInfo * __restrict ei,
-                         _BIG5State * __restrict s,
-                         const void * __restrict pspriv)
+_citrus_BIG5_unpack_state(_BIG5EncodingInfo * __restrict ei __unused,
+    _BIG5State * __restrict s,
+    const void * __restrict pspriv)
 {
+
        memcpy((void *)s, pspriv, sizeof(*s));
 }
 
 static __inline int
-_citrus_BIG5_check(_BIG5EncodingInfo *ei, u_int c)
+_citrus_BIG5_check(_BIG5EncodingInfo *ei, unsigned int c)
 {
-       _DIAGASSERT(ei != NULL);
 
-       return (ei->cell[c & 0xFF] & 0x1) ? 2 : 1;
+       return ((ei->cell[c & 0xFF] & 0x1) ? 2 : 1);
 }
 
 static __inline int
-_citrus_BIG5_check2(_BIG5EncodingInfo *ei, u_int c)
+_citrus_BIG5_check2(_BIG5EncodingInfo *ei, unsigned int c)
 {
-       _DIAGASSERT(ei != NULL);
 
-       return (ei->cell[c & 0xFF] & 0x2) ? 1 : 0;
+       return ((ei->cell[c & 0xFF] & 0x2) ? 1 : 0);
 }
 
 static __inline int
@@ -176,59 +162,53 @@ _citrus_BIG5_check_excludes(_BIG5EncodingInfo *ei, wint_t c)
 {
        _BIG5Exclude *exclude;
 
-       _DIAGASSERT(ei != NULL);
-
        TAILQ_FOREACH(exclude, &ei->excludes, entry) {
                if (c >= exclude->start && c <= exclude->end)
-                       return EILSEQ;
+                       return (EILSEQ);
        }
-       return 0;
+       return (0);
 }
 
 static int
 _citrus_BIG5_fill_rowcol(void ** __restrict ctx, const char * __restrict s,
-       uint64_t start, uint64_t end)
+    uint64_t start, uint64_t end)
 {
        _BIG5EncodingInfo *ei;
-       int i;
        uint64_t n;
-
-       _DIAGASSERT(ctx != NULL && *ctx != NULL);
+       int i;
 
        if (start > 0xFF || end > 0xFF)
-               return EINVAL;
-       ei = (_BIG5EncodingInfo *)*ctx;
+               return (EINVAL);
+       ei = (_BIG5EncodingInfo *)ctx;
        i = strcmp("row", s) ? 1 : 0;
        i = 1 << i;
        for (n = start; n <= end; ++n)
                ei->cell[n & 0xFF] |= i;
-       return 0;
+       return (0);
 }
 
 static int
 /*ARGSUSED*/
-_citrus_BIG5_fill_excludes(void ** __restrict ctx, const char * __restrict s,
-       uint64_t start, uint64_t end)
+_citrus_BIG5_fill_excludes(void ** __restrict ctx,
+    const char * __restrict s __unused, uint64_t start, uint64_t end)
 {
        _BIG5EncodingInfo *ei;
        _BIG5Exclude *exclude;
 
-       _DIAGASSERT(ctx != NULL && *ctx != NULL);
-
        if (start > 0xFFFF || end > 0xFFFF)
-               return EINVAL;
-       ei = (_BIG5EncodingInfo *)*ctx;
+               return (EINVAL);
+       ei = (_BIG5EncodingInfo *)ctx;
        exclude = TAILQ_LAST(&ei->excludes, _BIG5ExcludeList);
        if (exclude != NULL && (wint_t)start <= exclude->end)
-               return EINVAL;
+               return (EINVAL);
        exclude = (void *)malloc(sizeof(*exclude));
        if (exclude == NULL)
-               return ENOMEM;
+               return (ENOMEM);
        exclude->start = (wint_t)start;
        exclude->end = (wint_t)end;
        TAILQ_INSERT_TAIL(&ei->excludes, exclude, entry);
 
-       return 0;
+       return (0);
 }
 
 static const _citrus_prop_hint_t root_hints[] = {
@@ -244,8 +224,6 @@ _citrus_BIG5_encoding_module_uninit(_BIG5EncodingInfo *ei)
 {
        _BIG5Exclude *exclude;
 
-       _DIAGASSERT(ei != NULL);
-
        while ((exclude = TAILQ_FIRST(&ei->excludes)) != NULL) {
                TAILQ_REMOVE(&ei->excludes, exclude, entry);
                free(exclude);
@@ -255,12 +233,11 @@ _citrus_BIG5_encoding_module_uninit(_BIG5EncodingInfo *ei)
 static int
 /*ARGSUSED*/
 _citrus_BIG5_encoding_module_init(_BIG5EncodingInfo * __restrict ei,
-                                 const void * __restrict var, size_t lenvar)
+    const void * __restrict var, size_t lenvar)
 {
-       int err;
+       void *ctx = (void *)ei;
        const char *s;
-
-       _DIAGASSERT(ei != NULL);
+       int err;
 
        memset((void *)ei, 0, sizeof(*ei));
        TAILQ_INIT(&ei->excludes);
@@ -271,7 +248,7 @@ _citrus_BIG5_encoding_module_init(_BIG5EncodingInfo * __restrict ei,
                        err = _citrus_prop_parse_variable(
                            root_hints, (void *)ei, s, lenvar);
                        if (err == 0)
-                               return 0;
+                               return (0);
 
                        _citrus_BIG5_encoding_module_uninit(ei);
                        memset((void *)ei, 0, sizeof(*ei));
@@ -280,30 +257,24 @@ _citrus_BIG5_encoding_module_init(_BIG5EncodingInfo * __restrict ei,
        }
 
        /* fallback Big5-1984, for backward compatibility. */
-       _citrus_BIG5_fill_rowcol((void **)&ei, "row", 0xA1, 0xFE);
-       _citrus_BIG5_fill_rowcol((void **)&ei, "col", 0x40, 0x7E);
-       _citrus_BIG5_fill_rowcol((void **)&ei, "col", 0xA1, 0xFE);
+       _citrus_BIG5_fill_rowcol((void **)&ctx, "row", 0xA1, 0xFE);
+       _citrus_BIG5_fill_rowcol((void **)&ctx, "col", 0x40, 0x7E);
+       _citrus_BIG5_fill_rowcol((void **)&ctx, "col", 0xA1, 0xFE);
 
-       return 0;
+       return (0);
 }
 
 static int
 /*ARGSUSED*/
 _citrus_BIG5_mbrtowc_priv(_BIG5EncodingInfo * __restrict ei,
-                         wchar_t * __restrict pwc,
-                         const char ** __restrict s, size_t n,
-                         _BIG5State * __restrict psenc,
-                         size_t * __restrict nresult)
+    wchar_t * __restrict pwc,
+    const char ** __restrict s, size_t n,
+    _BIG5State * __restrict psenc,
+    size_t * __restrict nresult)
 {
        wchar_t wchar;
-       int c;
-       int chlenbak;
        const char *s0;
-
-       _DIAGASSERT(nresult != NULL);
-       _DIAGASSERT(ei != NULL);
-       _DIAGASSERT(psenc != NULL);
-       _DIAGASSERT(s != NULL && *s != NULL);
+       int c, chlenbak;
 
        s0 = *s;
 
@@ -364,10 +335,7 @@ _citrus_BIG5_mbrtowc_priv(_BIG5EncodingInfo * __restrict ei,
        psenc->chlen = 0;
        if (pwc)
                *pwc = wchar;
-       if (!wchar)
-               *nresult = 0;
-       else
-               *nresult = c - chlenbak;
+       *nresult = wchar ? c - chlenbak : 0;
 
        return (0);
 
@@ -385,15 +353,12 @@ restart:
 static int
 /*ARGSUSED*/
 _citrus_BIG5_wcrtomb_priv(_BIG5EncodingInfo * __restrict ei,
-                         char * __restrict s,
-                         size_t n, wchar_t wc, _BIG5State * __restrict psenc,
-                         size_t * __restrict nresult)
+    char * __restrict s,
+    size_t n, wchar_t wc, _BIG5State * __restrict psenc __unused,
+    size_t * __restrict nresult)
 {
-       int l, ret;
-
-       _DIAGASSERT(ei != NULL);
-       _DIAGASSERT(nresult != NULL);
-       _DIAGASSERT(s != NULL);
+       unsigned char l;
+       int ret;
 
        /* check invalid sequence */
        if (wc & ~0xffff ||
@@ -431,35 +396,32 @@ _citrus_BIG5_wcrtomb_priv(_BIG5EncodingInfo * __restrict ei,
 
        *nresult = l;
 
-       return 0;
+       return (0);
 
 err:
        *nresult = (size_t)-1;
-       return ret;
+       return (ret);
 }
 
 static __inline int
 /*ARGSUSED*/
-_citrus_BIG5_stdenc_wctocs(_BIG5EncodingInfo * __restrict ei,
-  &n