Module Name: src Committed By: tnozaki Date: Mon Jun 7 13:52:31 UTC 2010
Modified Files: src/distrib/sets/lists/base: ad.mips64eb ad.mips64el md.amd64 md.sparc64 shl.mi src/distrib/sets/lists/comp: md.amd64 md.sparc64 shl.mi src/include: limits.h locale.h src/lib/libc: shlib_version src/lib/libc/citrus: citrus_lc_ctype.c src/lib/libc/compat: Makefile Makefile.inc src/lib/libc/locale: Makefile.inc setlocale.c setlocale_local.h src/sys/arch/alpha/include: limits.h src/sys/arch/amd64/include: limits.h src/sys/arch/arm/include: limits.h src/sys/arch/hpc/stand/include/machine: limits.h src/sys/arch/hppa/include: limits.h src/sys/arch/i386/include: limits.h src/sys/arch/ia64/include: limits.h src/sys/arch/m68k/include: limits.h src/sys/arch/mips/include: limits.h src/sys/arch/powerpc/include: limits.h src/sys/arch/sh3/include: limits.h src/sys/arch/sparc/include: limits.h src/sys/arch/vax/include: limits.h Added Files: src/lib/libc/compat/arch/hppa/locale: compat_setlocale32.c src/lib/libc/compat/include: locale.h src/lib/libc/compat/locale: Makefile.inc compat_setlocale1.c compat_setlocale32.c Removed Files: src/lib/libc/locale: setlocale1.c setlocale32.c Log Message: 1. MB_LEN_MAX switch MD to MI. 2. unfortunately hppa's MB_LEN_MAX is defined incorrectly 6 instead of 32 so we have to add more setlocale(3) __RENAME func, __setlocale50. 3. move setlocale1.c and setlocale32.c to lib/libc/compat/locale/* prepareing for next libc major crunk. 4. bump libc minor version. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/distrib/sets/lists/base/ad.mips64eb \ src/distrib/sets/lists/base/ad.mips64el cvs rdiff -u -r1.89 -r1.90 src/distrib/sets/lists/base/md.amd64 cvs rdiff -u -r1.83 -r1.84 src/distrib/sets/lists/base/md.sparc64 cvs rdiff -u -r1.537 -r1.538 src/distrib/sets/lists/base/shl.mi cvs rdiff -u -r1.67 -r1.68 src/distrib/sets/lists/comp/md.amd64 cvs rdiff -u -r1.57 -r1.58 src/distrib/sets/lists/comp/md.sparc64 cvs rdiff -u -r1.118 -r1.119 src/distrib/sets/lists/comp/shl.mi cvs rdiff -u -r1.28 -r1.29 src/include/limits.h cvs rdiff -u -r1.16 -r1.17 src/include/locale.h cvs rdiff -u -r1.217 -r1.218 src/lib/libc/shlib_version cvs rdiff -u -r1.6 -r1.7 src/lib/libc/citrus/citrus_lc_ctype.c cvs rdiff -u -r1.4 -r1.5 src/lib/libc/compat/Makefile cvs rdiff -u -r1.5 -r1.6 src/lib/libc/compat/Makefile.inc cvs rdiff -u -r0 -r1.1 \ src/lib/libc/compat/arch/hppa/locale/compat_setlocale32.c cvs rdiff -u -r0 -r1.1 src/lib/libc/compat/include/locale.h cvs rdiff -u -r0 -r1.1 src/lib/libc/compat/locale/Makefile.inc \ src/lib/libc/compat/locale/compat_setlocale1.c \ src/lib/libc/compat/locale/compat_setlocale32.c cvs rdiff -u -r1.56 -r1.57 src/lib/libc/locale/Makefile.inc cvs rdiff -u -r1.57 -r1.58 src/lib/libc/locale/setlocale.c cvs rdiff -u -r1.4 -r0 src/lib/libc/locale/setlocale1.c cvs rdiff -u -r1.6 -r0 src/lib/libc/locale/setlocale32.c cvs rdiff -u -r1.6 -r1.7 src/lib/libc/locale/setlocale_local.h cvs rdiff -u -r1.12 -r1.13 src/sys/arch/alpha/include/limits.h cvs rdiff -u -r1.10 -r1.11 src/sys/arch/amd64/include/limits.h cvs rdiff -u -r1.9 -r1.10 src/sys/arch/arm/include/limits.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hpc/stand/include/machine/limits.h cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hppa/include/limits.h cvs rdiff -u -r1.21 -r1.22 src/sys/arch/i386/include/limits.h cvs rdiff -u -r1.4 -r1.5 src/sys/arch/ia64/include/limits.h cvs rdiff -u -r1.19 -r1.20 src/sys/arch/m68k/include/limits.h cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mips/include/limits.h cvs rdiff -u -r1.15 -r1.16 src/sys/arch/powerpc/include/limits.h cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sh3/include/limits.h cvs rdiff -u -r1.18 -r1.19 src/sys/arch/sparc/include/limits.h cvs rdiff -u -r1.17 -r1.18 src/sys/arch/vax/include/limits.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/distrib/sets/lists/base/ad.mips64eb diff -u src/distrib/sets/lists/base/ad.mips64eb:1.14 src/distrib/sets/lists/base/ad.mips64eb:1.15 --- src/distrib/sets/lists/base/ad.mips64eb:1.14 Fri May 21 11:07:20 2010 +++ src/distrib/sets/lists/base/ad.mips64eb Mon Jun 7 13:52:28 2010 @@ -1,4 +1,4 @@ -# $NetBSD: ad.mips64eb,v 1.14 2010/05/21 11:07:20 pooka Exp $ +# $NetBSD: ad.mips64eb,v 1.15 2010/06/07 13:52:28 tnozaki Exp $ ./libexec/ld.elf_so-64 base-compat-shlib compat,pic ./libexec/ld.elf_so-o32 base-sysutil-bin compat,pic ./usr/lib/64 base-compat-lib compat @@ -62,7 +62,7 @@ ./usr/lib/64/libbz2.so.1 base-compat-shlib compat,pic ./usr/lib/64/libbz2.so.1.1 base-compat-shlib compat,pic ./usr/lib/64/libc.so.12 base-compat-shlib compat,pic -./usr/lib/64/libc.so.12.172 base-compat-shlib compat,pic +./usr/lib/64/libc.so.12.173 base-compat-shlib compat,pic ./usr/lib/64/libcom_err.so.6 base-compat-shlib compat,pic ./usr/lib/64/libcom_err.so.6.0 base-compat-shlib compat,pic ./usr/lib/64/libcrypt.so.1 base-compat-shlib compat,pic @@ -294,7 +294,7 @@ ./usr/lib/o32/libbz2.so.1 base-compat-shlib compat,pic ./usr/lib/o32/libbz2.so.1.1 base-compat-shlib compat,pic ./usr/lib/o32/libc.so.12 base-compat-shlib compat,pic -./usr/lib/o32/libc.so.12.172 base-compat-shlib compat,pic +./usr/lib/o32/libc.so.12.173 base-compat-shlib compat,pic ./usr/lib/o32/libcom_err.so.6 base-compat-shlib compat,pic ./usr/lib/o32/libcom_err.so.6.0 base-compat-shlib compat,pic ./usr/lib/o32/libcrypt.so.1 base-compat-shlib compat,pic Index: src/distrib/sets/lists/base/ad.mips64el diff -u src/distrib/sets/lists/base/ad.mips64el:1.14 src/distrib/sets/lists/base/ad.mips64el:1.15 --- src/distrib/sets/lists/base/ad.mips64el:1.14 Fri May 21 11:07:20 2010 +++ src/distrib/sets/lists/base/ad.mips64el Mon Jun 7 13:52:28 2010 @@ -1,4 +1,4 @@ -# $NetBSD: ad.mips64el,v 1.14 2010/05/21 11:07:20 pooka Exp $ +# $NetBSD: ad.mips64el,v 1.15 2010/06/07 13:52:28 tnozaki Exp $ ./libexec/ld.elf_so-64 base-compat-shlib compat,pic ./libexec/ld.elf_so-o32 base-sysutil-bin compat,pic ./usr/lib/64 base-compat-lib compat @@ -62,7 +62,7 @@ ./usr/lib/64/libbz2.so.1 base-compat-shlib compat,pic ./usr/lib/64/libbz2.so.1.1 base-compat-shlib compat,pic ./usr/lib/64/libc.so.12 base-compat-shlib compat,pic -./usr/lib/64/libc.so.12.172 base-compat-shlib compat,pic +./usr/lib/64/libc.so.12.173 base-compat-shlib compat,pic ./usr/lib/64/libcom_err.so.6 base-compat-shlib compat,pic ./usr/lib/64/libcom_err.so.6.0 base-compat-shlib compat,pic ./usr/lib/64/libcrypt.so.1 base-compat-shlib compat,pic @@ -294,7 +294,7 @@ ./usr/lib/o32/libbz2.so.1 base-compat-shlib compat,pic ./usr/lib/o32/libbz2.so.1.1 base-compat-shlib compat,pic ./usr/lib/o32/libc.so.12 base-compat-shlib compat,pic -./usr/lib/o32/libc.so.12.172 base-compat-shlib compat,pic +./usr/lib/o32/libc.so.12.173 base-compat-shlib compat,pic ./usr/lib/o32/libcom_err.so.6 base-compat-shlib compat,pic ./usr/lib/o32/libcom_err.so.6.0 base-compat-shlib compat,pic ./usr/lib/o32/libcrypt.so.1 base-compat-shlib compat,pic Index: src/distrib/sets/lists/base/md.amd64 diff -u src/distrib/sets/lists/base/md.amd64:1.89 src/distrib/sets/lists/base/md.amd64:1.90 --- src/distrib/sets/lists/base/md.amd64:1.89 Fri May 21 11:07:20 2010 +++ src/distrib/sets/lists/base/md.amd64 Mon Jun 7 13:52:29 2010 @@ -1,4 +1,4 @@ -# $NetBSD: md.amd64,v 1.89 2010/05/21 11:07:20 pooka Exp $ +# $NetBSD: md.amd64,v 1.90 2010/06/07 13:52:29 tnozaki Exp $ ./dev/lms0 base-obsolete obsolete ./dev/mms0 base-obsolete obsolete ./libexec/ld.elf_so-i386 base-sys-shlib compat,pic @@ -65,7 +65,7 @@ ./usr/lib/i386/libbz2.so.1 base-compat-shlib compat,pic ./usr/lib/i386/libbz2.so.1.1 base-compat-shlib compat,pic ./usr/lib/i386/libc.so.12 base-compat-shlib compat,pic -./usr/lib/i386/libc.so.12.172 base-compat-shlib compat,pic +./usr/lib/i386/libc.so.12.173 base-compat-shlib compat,pic ./usr/lib/i386/libcom_err.so.6 base-compat-shlib compat,pic,kerberos ./usr/lib/i386/libcom_err.so.6.0 base-compat-shlib compat,pic,kerberos ./usr/lib/i386/libcrypt.so.1 base-compat-shlib compat,pic Index: src/distrib/sets/lists/base/md.sparc64 diff -u src/distrib/sets/lists/base/md.sparc64:1.83 src/distrib/sets/lists/base/md.sparc64:1.84 --- src/distrib/sets/lists/base/md.sparc64:1.83 Fri May 21 11:07:20 2010 +++ src/distrib/sets/lists/base/md.sparc64 Mon Jun 7 13:52:29 2010 @@ -1,4 +1,4 @@ -# $NetBSD: md.sparc64,v 1.83 2010/05/21 11:07:20 pooka Exp $ +# $NetBSD: md.sparc64,v 1.84 2010/06/07 13:52:29 tnozaki Exp $ ./libexec/ld.elf_so-sparc base-sysutil-bin compat,pic ./sbin/edlabel base-sysutil-root obsolete ./usr/bin/fdformat base-util-bin @@ -63,7 +63,7 @@ ./usr/lib/sparc/libbz2.so.1 base-compat-shlib compat,pic ./usr/lib/sparc/libbz2.so.1.1 base-compat-shlib compat,pic ./usr/lib/sparc/libc.so.12 base-compat-shlib compat,pic -./usr/lib/sparc/libc.so.12.172 base-compat-shlib compat,pic +./usr/lib/sparc/libc.so.12.173 base-compat-shlib compat,pic ./usr/lib/sparc/libcom_err.so.6 base-compat-shlib compat,pic ./usr/lib/sparc/libcom_err.so.6.0 base-compat-shlib compat,pic ./usr/lib/sparc/libcrypt.so.1 base-compat-shlib compat,pic Index: src/distrib/sets/lists/base/shl.mi diff -u src/distrib/sets/lists/base/shl.mi:1.537 src/distrib/sets/lists/base/shl.mi:1.538 --- src/distrib/sets/lists/base/shl.mi:1.537 Fri May 21 11:07:20 2010 +++ src/distrib/sets/lists/base/shl.mi Mon Jun 7 13:52:29 2010 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.537 2010/05/21 11:07:20 pooka Exp $ +# $NetBSD: shl.mi,v 1.538 2010/06/07 13:52:29 tnozaki Exp $ # # Note: Don't delete entries from here - mark them as "obsolete" instead, # unless otherwise stated below. @@ -13,7 +13,7 @@ # # Note: libtermcap and libtermlib are hardlinked and share the same version. # -./lib/libc.so.12.172 base-sys-shlib dynamicroot +./lib/libc.so.12.173 base-sys-shlib dynamicroot ./lib/libcrypt.so.1.0 base-sys-shlib dynamicroot ./lib/libcrypto.so.6.1 base-crypto-shlib crypto,dynamicroot ./lib/libdevmapper.so.1.0 base-lvm-shlib lvm,dynamicroot @@ -63,7 +63,7 @@ ./usr/lib/libbluetooth.so.4.2 base-sys-shlib ./usr/lib/libbsdmalloc.so.0.0 base-sys-shlib ./usr/lib/libbz2.so.1.1 base-sys-shlib -./usr/lib/libc.so.12.172 base-sys-shlib +./usr/lib/libc.so.12.173 base-sys-shlib ./usr/lib/libcom_err.so.6.0 base-krb5-shlib kerberos ./usr/lib/libcrypt.so.1.0 base-sys-shlib ./usr/lib/libcrypto.so.6.1 base-crypto-shlib crypto Index: src/distrib/sets/lists/comp/md.amd64 diff -u src/distrib/sets/lists/comp/md.amd64:1.67 src/distrib/sets/lists/comp/md.amd64:1.68 --- src/distrib/sets/lists/comp/md.amd64:1.67 Fri May 21 11:07:21 2010 +++ src/distrib/sets/lists/comp/md.amd64 Mon Jun 7 13:52:29 2010 @@ -1,4 +1,4 @@ -# $NetBSD: md.amd64,v 1.67 2010/05/21 11:07:21 pooka Exp $ +# $NetBSD: md.amd64,v 1.68 2010/06/07 13:52:29 tnozaki Exp $ ./usr/include/amd64 comp-c-include ./usr/include/amd64/ansi.h comp-c-include ./usr/include/amd64/aout_machdep.h comp-c-include @@ -847,7 +847,7 @@ ./usr/libdata/debug/usr/lib/i386/libbluetooth.so.4.2.debug comp-compat-shlib compat,pic,debug ./usr/libdata/debug/usr/lib/i386/libbsdmalloc.so.0.0.debug comp-compat-shlib compat,pic,debug ./usr/libdata/debug/usr/lib/i386/libbz2.so.1.1.debug comp-compat-shlib compat,pic,debug -./usr/libdata/debug/usr/lib/i386/libc.so.12.172.debug comp-compat-shlib compat,pic,debug +./usr/libdata/debug/usr/lib/i386/libc.so.12.173.debug comp-compat-shlib compat,pic,debug ./usr/libdata/debug/usr/lib/i386/libcom_err.so.6.0.debug comp-compat-shlib compat,pic,kerberos,debug ./usr/libdata/debug/usr/lib/i386/libcrypt.so.1.0.debug comp-compat-shlib compat,pic,debug ./usr/libdata/debug/usr/lib/i386/libcrypto.so.6.1.debug comp-compat-shlib compat,pic,debug Index: src/distrib/sets/lists/comp/md.sparc64 diff -u src/distrib/sets/lists/comp/md.sparc64:1.57 src/distrib/sets/lists/comp/md.sparc64:1.58 --- src/distrib/sets/lists/comp/md.sparc64:1.57 Fri May 21 11:07:21 2010 +++ src/distrib/sets/lists/comp/md.sparc64 Mon Jun 7 13:52:29 2010 @@ -1,4 +1,4 @@ -# $NetBSD: md.sparc64,v 1.57 2010/05/21 11:07:21 pooka Exp $ +# $NetBSD: md.sparc64,v 1.58 2010/06/07 13:52:29 tnozaki Exp $ ./usr/include/ieeefp.h comp-c-include ./usr/include/sparc comp-c-include ./usr/include/sparc/_G_config.h comp-obsolete obsolete @@ -628,7 +628,7 @@ ./usr/libdata/debug/usr/lib/sparc/libbluetooth.so.4.2.debug comp-compat-shlib compat,pic,debug ./usr/libdata/debug/usr/lib/sparc/libbsdmalloc.so.0.0.debug comp-compat-shlib compat,pic,debug ./usr/libdata/debug/usr/lib/sparc/libbz2.so.1.1.debug comp-compat-shlib compat,pic,debug -./usr/libdata/debug/usr/lib/sparc/libc.so.12.172.debug comp-compat-shlib compat,pic,debug +./usr/libdata/debug/usr/lib/sparc/libc.so.12.173.debug comp-compat-shlib compat,pic,debug ./usr/libdata/debug/usr/lib/sparc/libcom_err.so.6.0.debug comp-compat-shlib compat,pic,debug ./usr/libdata/debug/usr/lib/sparc/libcrypt.so.1.0.debug comp-compat-shlib compat,pic,debug ./usr/libdata/debug/usr/lib/sparc/libcrypto.so.6.1.debug comp-compat-shlib compat,pic,debug Index: src/distrib/sets/lists/comp/shl.mi diff -u src/distrib/sets/lists/comp/shl.mi:1.118 src/distrib/sets/lists/comp/shl.mi:1.119 --- src/distrib/sets/lists/comp/shl.mi:1.118 Fri May 21 11:07:21 2010 +++ src/distrib/sets/lists/comp/shl.mi Mon Jun 7 13:52:29 2010 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.118 2010/05/21 11:07:21 pooka Exp $ +# $NetBSD: shl.mi,v 1.119 2010/06/07 13:52:29 tnozaki Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -198,7 +198,7 @@ ./usr/libdata/debug/usr/lib/libbluetooth.so.4.2.debug comp-sys-debug debug ./usr/libdata/debug/usr/lib/libbsdmalloc.so.0.0.debug comp-sys-debug debug ./usr/libdata/debug/usr/lib/libbz2.so.1.1.debug comp-sys-debug debug -./usr/libdata/debug/usr/lib/libc.so.12.172.debug comp-sys-debug debug +./usr/libdata/debug/usr/lib/libc.so.12.173.debug comp-sys-debug debug ./usr/libdata/debug/usr/lib/libcom_err.so.6.0.debug comp-krb5-debug kerberos,debug ./usr/libdata/debug/usr/lib/libcrypt.so.1.0.debug comp-sys-debug debug ./usr/libdata/debug/usr/lib/libcrypto.so.6.1.debug comp-crypto-debug crypto,debug Index: src/include/limits.h diff -u src/include/limits.h:1.28 src/include/limits.h:1.29 --- src/include/limits.h:1.28 Wed Aug 27 08:53:55 2008 +++ src/include/limits.h Mon Jun 7 13:52:29 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: limits.h,v 1.28 2008/08/27 08:53:55 christos Exp $ */ +/* $NetBSD: limits.h,v 1.29 2010/06/07 13:52:29 tnozaki Exp $ */ /* * Copyright (c) 1988, 1993 @@ -108,6 +108,8 @@ #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */ +#define MB_LEN_MAX 32 /* Allow ISO/IEC 2022 */ + #include <machine/limits.h> #include <sys/syslimits.h> Index: src/include/locale.h diff -u src/include/locale.h:1.16 src/include/locale.h:1.17 --- src/include/locale.h:1.16 Sun Jan 11 03:04:12 2009 +++ src/include/locale.h Mon Jun 7 13:52:29 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: locale.h,v 1.16 2009/01/11 03:04:12 christos Exp $ */ +/* $NetBSD: locale.h,v 1.17 2010/06/07 13:52:29 tnozaki Exp $ */ /* * Copyright (c) 1991, 1993 @@ -84,14 +84,8 @@ #endif __BEGIN_DECLS -struct lconv *localeconv(void); -#ifdef __SETLOCALE_SOURCE__ -char *setlocale(int, const char *); -char *__setlocale_mb_len_max_32(int, const char *); -char *__setlocale(int, const char *); -#else /* !__SETLOCALE_SOURCE__ */ -char *setlocale(int, const char *) __RENAME(__setlocale_mb_len_max_32); -#endif /* !__SETLOCALE_SOURCE__ */ +struct lconv *localeconv(void); +char *setlocale(int, const char *) __RENAME(__setlocale50); __END_DECLS #endif /* _LOCALE_H_ */ Index: src/lib/libc/shlib_version diff -u src/lib/libc/shlib_version:1.217 src/lib/libc/shlib_version:1.218 --- src/lib/libc/shlib_version:1.217 Sun Apr 25 00:54:46 2010 +++ src/lib/libc/shlib_version Mon Jun 7 13:52:29 2010 @@ -1,4 +1,4 @@ -# $NetBSD: shlib_version,v 1.217 2010/04/25 00:54:46 joerg Exp $ +# $NetBSD: shlib_version,v 1.218 2010/06/07 13:52:29 tnozaki Exp $ # Remember to update distrib/sets/lists/base/shl.* when changing # # things we wish to do on next major version bump: @@ -19,10 +19,6 @@ # - libc/stdio: make fpos_t larger. see BUGS section in fgetpos(3). # probably s/fpos_t/off_t/ in __sFILE and __sseek(). it involves # funopen(3) api change. -# - libc/locale/{__mb_cur_max.c,rune.h}: remove __mb_len_max_runtime -# - libc/locale/setlocale.c: __setlocale -> setlocale -# - libc/locale/setlocale{1,32}.c: remove -# - libc/citrus/citrus_lc_ctype.c: __MB_LEN_MAX_RUNTIME -> MB_LEN_MAX # - remove frexp, ldexp, modf: they belong to libm. # - make sure we can support thread local [on arm don't use r9 for example, # consider other risc architectures: mips, powerpc, sparc, etc] @@ -34,7 +30,5 @@ # - change _ctype_ table in ctype.h and gen/ctype_.c 8bit -> 16 or 32bit. # it's insufficient bitwidth to implement all ctype class. # see isblank's comment in ctype.h. -# - increase MB_LEN_MAX 6 -> 32 sys/arch/hppa/include/limits.h -# and make it's definition MD -> MI. major=12 -minor=172 +minor=173 Index: src/lib/libc/citrus/citrus_lc_ctype.c diff -u src/lib/libc/citrus/citrus_lc_ctype.c:1.6 src/lib/libc/citrus/citrus_lc_ctype.c:1.7 --- src/lib/libc/citrus/citrus_lc_ctype.c:1.6 Tue Jun 1 13:52:08 2010 +++ src/lib/libc/citrus/citrus_lc_ctype.c Mon Jun 7 13:52:29 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: citrus_lc_ctype.c,v 1.6 2010/06/01 13:52:08 tnozaki Exp $ */ +/* $NetBSD: citrus_lc_ctype.c,v 1.7 2010/06/07 13:52:29 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,7 +28,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: citrus_lc_ctype.c,v 1.6 2010/06/01 13:52:08 tnozaki Exp $"); +__RCSID("$NetBSD: citrus_lc_ctype.c,v 1.7 2010/06/07 13:52:29 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ #include "reentrant.h" @@ -103,7 +103,7 @@ data->rl_variable, data->rl_variable_len, _PRIVSIZE); if (!ret) ret = __runetable_to_netbsd_ctype(data); - if (ret || __MB_LEN_MAX_RUNTIME < + if (ret || __mb_len_max_runtime < _citrus_ctype_get_mb_cur_max(data->rl_citrus_ctype)) { _NukeRune(data); return EINVAL; Index: src/lib/libc/compat/Makefile diff -u src/lib/libc/compat/Makefile:1.4 src/lib/libc/compat/Makefile:1.5 --- src/lib/libc/compat/Makefile:1.4 Sun Jan 11 02:46:24 2009 +++ src/lib/libc/compat/Makefile Mon Jun 7 13:52:29 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.4 2009/01/11 02:46:24 christos Exp $ +# $NetBSD: Makefile,v 1.5 2010/06/07 13:52:29 tnozaki Exp $ # @(#)Makefile 8.2 (Berkeley) 2/3/94 # @@ -14,6 +14,7 @@ .include "${.CURDIR}/db/Makefile.inc" .include "${.CURDIR}/gen/Makefile.inc" +.include "${.CURDIR}/locale/Makefile.inc" .include "${.CURDIR}/net/Makefile.inc" .include "${.CURDIR}/rpc/Makefile.inc" .include "${.CURDIR}/stdlib/Makefile.inc" Index: src/lib/libc/compat/Makefile.inc diff -u src/lib/libc/compat/Makefile.inc:1.5 src/lib/libc/compat/Makefile.inc:1.6 --- src/lib/libc/compat/Makefile.inc:1.5 Sun Jan 11 02:46:24 2009 +++ src/lib/libc/compat/Makefile.inc Mon Jun 7 13:52:29 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.5 2009/01/11 02:46:24 christos Exp $ +# $NetBSD: Makefile.inc,v 1.6 2010/06/07 13:52:29 tnozaki Exp $ CPPFLAGS+= -I${NETBSDSRCDIR}/sys @@ -6,6 +6,7 @@ .PATH: ${COMPATARCHDIR}/gen ${COMPATARCHDIR}/sys .include "${COMPATDIR}/db/Makefile.inc" +.include "${COMPATDIR}/locale/Makefile.inc" .include "${COMPATDIR}/gen/Makefile.inc" .include "${COMPATDIR}/net/Makefile.inc" .include "${COMPATDIR}/rpc/Makefile.inc" Index: src/lib/libc/locale/Makefile.inc diff -u src/lib/libc/locale/Makefile.inc:1.56 src/lib/libc/locale/Makefile.inc:1.57 --- src/lib/libc/locale/Makefile.inc:1.56 Tue Jun 1 18:00:28 2010 +++ src/lib/libc/locale/Makefile.inc Mon Jun 7 13:52:30 2010 @@ -1,11 +1,11 @@ # from: @(#)Makefile.inc 5.1 (Berkeley) 2/18/91 -# $NetBSD: Makefile.inc,v 1.56 2010/06/01 18:00:28 tnozaki Exp $ +# $NetBSD: Makefile.inc,v 1.57 2010/06/07 13:52:30 tnozaki Exp $ # locale sources .PATH: ${ARCHDIR}/locale ${.CURDIR}/locale SRCS+= _def_messages.c _def_monetary.c _def_numeric.c _def_time.c \ - setlocale.c setlocale1.c setlocale32.c __mb_cur_max.c \ + setlocale.c __mb_cur_max.c \ current_locale.c global_locale.c fix_grouping.c \ localeconv.c nl_langinfo.c \ generic_lc_all.c dummy_lc_collate.c \ Index: src/lib/libc/locale/setlocale.c diff -u src/lib/libc/locale/setlocale.c:1.57 src/lib/libc/locale/setlocale.c:1.58 --- src/lib/libc/locale/setlocale.c:1.57 Mon Mar 9 02:22:25 2009 +++ src/lib/libc/locale/setlocale.c Mon Jun 7 13:52:30 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: setlocale.c,v 1.57 2009/03/09 02:22:25 tnozaki Exp $ */ +/* $NetBSD: setlocale.c,v 1.58 2010/06/07 13:52:30 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -28,14 +28,12 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: setlocale.c,v 1.57 2009/03/09 02:22:25 tnozaki Exp $"); +__RCSID("$NetBSD: setlocale.c,v 1.58 2010/06/07 13:52:30 tnozaki Exp $"); #endif /* LIBC_SCCS and not lint */ -#include <sys/cdefs.h> #include <sys/types.h> -#include <langinfo.h> -#define __SETLOCALE_SOURCE__ #include <locale.h> +#include <limits.h> #include <paths.h> #include <stdlib.h> #include <string.h> @@ -131,3 +129,13 @@ } return NULL; } + +char * +setlocale(int category, const char *locale) +{ + + /* locale may be NULL */ + + __mb_len_max_runtime = MB_LEN_MAX; + return __setlocale(category, locale); +} Index: src/lib/libc/locale/setlocale_local.h diff -u src/lib/libc/locale/setlocale_local.h:1.6 src/lib/libc/locale/setlocale_local.h:1.7 --- src/lib/libc/locale/setlocale_local.h:1.6 Sat May 22 13:50:02 2010 +++ src/lib/libc/locale/setlocale_local.h Mon Jun 7 13:52:30 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: setlocale_local.h,v 1.6 2010/05/22 13:50:02 tnozaki Exp $ */ +/* $NetBSD: setlocale_local.h,v 1.7 2010/06/07 13:52:30 tnozaki Exp $ */ /*- * Copyright (c)2008 Citrus Project, @@ -67,8 +67,8 @@ __BEGIN_DECLS _locale_category_t *_find_category(int); const char *_get_locale_env(const char *); -extern struct _locale_impl_t _global_locale; struct _locale_impl_t **_current_locale(void); +char *__setlocale(int, const char *); __END_DECLS static __inline struct _locale_cache_t * @@ -77,7 +77,7 @@ return (*_current_locale())->cache; } +extern struct _locale_impl_t _global_locale; extern size_t __mb_len_max_runtime; -#define __MB_LEN_MAX_RUNTIME __mb_len_max_runtime #endif /*_SETLOCALE_LOCAL_H_*/ Index: src/sys/arch/alpha/include/limits.h diff -u src/sys/arch/alpha/include/limits.h:1.12 src/sys/arch/alpha/include/limits.h:1.13 --- src/sys/arch/alpha/include/limits.h:1.12 Wed Oct 17 19:52:58 2007 +++ src/sys/arch/alpha/include/limits.h Mon Jun 7 13:52:30 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: limits.h,v 1.12 2007/10/17 19:52:58 garbled Exp $ */ +/* $NetBSD: limits.h,v 1.13 2010/06/07 13:52:30 tnozaki Exp $ */ /* * Copyright (c) 1988, 1993 @@ -37,7 +37,6 @@ #include <sys/featuretest.h> #define CHAR_BIT 8 /* number of bits in a char */ -#define MB_LEN_MAX 32 /* Allow 31 bit UTF2 */ /* * According to ANSI (section 2.2.4.2), the values below must be usable by Index: src/sys/arch/amd64/include/limits.h diff -u src/sys/arch/amd64/include/limits.h:1.10 src/sys/arch/amd64/include/limits.h:1.11 --- src/sys/arch/amd64/include/limits.h:1.10 Sun Oct 26 00:08:15 2008 +++ src/sys/arch/amd64/include/limits.h Mon Jun 7 13:52:30 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: limits.h,v 1.10 2008/10/26 00:08:15 mrg Exp $ */ +/* $NetBSD: limits.h,v 1.11 2010/06/07 13:52:30 tnozaki Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -39,7 +39,6 @@ #include <sys/featuretest.h> #define CHAR_BIT 8 /* number of bits in a char */ -#define MB_LEN_MAX 32 /* no multibyte characters */ #define SCHAR_MAX 0x7f /* max value for a signed char */ #define SCHAR_MIN (-0x7f-1) /* min value for a signed char */ Index: src/sys/arch/arm/include/limits.h diff -u src/sys/arch/arm/include/limits.h:1.9 src/sys/arch/arm/include/limits.h:1.10 --- src/sys/arch/arm/include/limits.h:1.9 Fri Aug 29 19:08:29 2008 +++ src/sys/arch/arm/include/limits.h Mon Jun 7 13:52:30 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: limits.h,v 1.9 2008/08/29 19:08:29 matt Exp $ */ +/* $NetBSD: limits.h,v 1.10 2010/06/07 13:52:30 tnozaki Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -37,7 +37,6 @@ #include <sys/featuretest.h> #define CHAR_BIT 8 /* number of bits in a char */ -#define MB_LEN_MAX 32 /* no multibyte characters */ #define SCHAR_MIN (-0x7f-1) /* max value for a signed char */ #define SCHAR_MAX 0x7f /* min value for a signed char */ Index: src/sys/arch/hpc/stand/include/machine/limits.h diff -u src/sys/arch/hpc/stand/include/machine/limits.h:1.1 src/sys/arch/hpc/stand/include/machine/limits.h:1.2 --- src/sys/arch/hpc/stand/include/machine/limits.h:1.1 Fri Feb 9 18:35:29 2001 +++ src/sys/arch/hpc/stand/include/machine/limits.h Mon Jun 7 13:52:30 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: limits.h,v 1.1 2001/02/09 18:35:29 uch Exp $ */ +/* $NetBSD: limits.h,v 1.2 2010/06/07 13:52:30 tnozaki Exp $ */ /* Windows CE architecture */ @@ -6,7 +6,6 @@ #define _MACHINE_LIMITS_H_ #define CHAR_BIT 8 /* number of bits in a char */ -#define MB_LEN_MAX 32 /* Allow 31 bit UTF2 */ #define SCHAR_MAX 127 /* min value for a signed char */ #define SCHAR_MIN (-128) /* max value for a signed char */ Index: src/sys/arch/hppa/include/limits.h diff -u src/sys/arch/hppa/include/limits.h:1.11 src/sys/arch/hppa/include/limits.h:1.12 --- src/sys/arch/hppa/include/limits.h:1.11 Sat Sep 13 07:33:26 2008 +++ src/sys/arch/hppa/include/limits.h Mon Jun 7 13:52:30 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: limits.h,v 1.11 2008/09/13 07:33:26 skrll Exp $ */ +/* $NetBSD: limits.h,v 1.12 2010/06/07 13:52:30 tnozaki Exp $ */ /* $OpenBSD: limits.h,v 1.2 2000/07/31 20:06:02 millert Exp $ */ @@ -62,8 +62,6 @@ #include <sys/featuretest.h> #define CHAR_BIT 8 /* number of bits in a char */ -#define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */ - /* * According to ANSI (section 2.2.4.2), the values below must be usable by Index: src/sys/arch/i386/include/limits.h diff -u src/sys/arch/i386/include/limits.h:1.21 src/sys/arch/i386/include/limits.h:1.22 --- src/sys/arch/i386/include/limits.h:1.21 Sun Oct 26 06:57:30 2008 +++ src/sys/arch/i386/include/limits.h Mon Jun 7 13:52:30 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: limits.h,v 1.21 2008/10/26 06:57:30 mrg Exp $ */ +/* $NetBSD: limits.h,v 1.22 2010/06/07 13:52:30 tnozaki Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -37,7 +37,6 @@ #include <sys/featuretest.h> #define CHAR_BIT 8 /* number of bits in a char */ -#define MB_LEN_MAX 32 /* max multibyte character length */ #define SCHAR_MAX 0x7f /* max value for a signed char */ #define SCHAR_MIN (-0x7f-1) /* min value for a signed char */ Index: src/sys/arch/ia64/include/limits.h diff -u src/sys/arch/ia64/include/limits.h:1.4 src/sys/arch/ia64/include/limits.h:1.5 --- src/sys/arch/ia64/include/limits.h:1.4 Wed Oct 17 19:55:00 2007 +++ src/sys/arch/ia64/include/limits.h Mon Jun 7 13:52:31 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: limits.h,v 1.4 2007/10/17 19:55:00 garbled Exp $ */ +/* $NetBSD: limits.h,v 1.5 2010/06/07 13:52:31 tnozaki Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -35,7 +35,6 @@ #define _MACHINE_LIMITS_H_ #define CHAR_BIT 8 /* number of bits in a char */ -#define MB_LEN_MAX 32 /* no multibyte characters */ #define SCHAR_MIN (-0x7f-1) /* max value for a signed char */ #define SCHAR_MAX 0x7f /* min value for a signed char */ Index: src/sys/arch/m68k/include/limits.h diff -u src/sys/arch/m68k/include/limits.h:1.19 src/sys/arch/m68k/include/limits.h:1.20 --- src/sys/arch/m68k/include/limits.h:1.19 Wed Oct 17 19:55:05 2007 +++ src/sys/arch/m68k/include/limits.h Mon Jun 7 13:52:31 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: limits.h,v 1.19 2007/10/17 19:55:05 garbled Exp $ */ +/* $NetBSD: limits.h,v 1.20 2010/06/07 13:52:31 tnozaki Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -37,7 +37,6 @@ #include <sys/featuretest.h> #define CHAR_BIT 8 /* number of bits in a char */ -#define MB_LEN_MAX 32 /* no multibyte characters */ #define SCHAR_MIN (-0x7f-1) /* max value for a signed char */ #define SCHAR_MAX 0x7f /* min value for a signed char */ Index: src/sys/arch/mips/include/limits.h diff -u src/sys/arch/mips/include/limits.h:1.22 src/sys/arch/mips/include/limits.h:1.23 --- src/sys/arch/mips/include/limits.h:1.22 Wed Oct 17 19:55:36 2007 +++ src/sys/arch/mips/include/limits.h Mon Jun 7 13:52:31 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: limits.h,v 1.22 2007/10/17 19:55:36 garbled Exp $ */ +/* $NetBSD: limits.h,v 1.23 2010/06/07 13:52:31 tnozaki Exp $ */ /* * Copyright (c) 1988, 1993 @@ -37,7 +37,6 @@ #include <sys/featuretest.h> #define CHAR_BIT 8 /* number of bits in a char */ -#define MB_LEN_MAX 32 /* Allow 31 bit UTF2 */ /* * According to ANSI (section 2.2.4.2), the values below must be usable by Index: src/sys/arch/powerpc/include/limits.h diff -u src/sys/arch/powerpc/include/limits.h:1.15 src/sys/arch/powerpc/include/limits.h:1.16 --- src/sys/arch/powerpc/include/limits.h:1.15 Wed Oct 17 19:56:40 2007 +++ src/sys/arch/powerpc/include/limits.h Mon Jun 7 13:52:31 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: limits.h,v 1.15 2007/10/17 19:56:40 garbled Exp $ */ +/* $NetBSD: limits.h,v 1.16 2010/06/07 13:52:31 tnozaki Exp $ */ /* * Copyright (c) 1988, 1993 @@ -37,7 +37,6 @@ #include <sys/featuretest.h> #define CHAR_BIT 8 /* number of bits in a char */ -#define MB_LEN_MAX 32 /* Allow 31 bit UTF2 */ /* * According to ANSI (section 2.2.4.2), the values below must be usable by Index: src/sys/arch/sh3/include/limits.h diff -u src/sys/arch/sh3/include/limits.h:1.10 src/sys/arch/sh3/include/limits.h:1.11 --- src/sys/arch/sh3/include/limits.h:1.10 Wed Oct 17 19:57:07 2007 +++ src/sys/arch/sh3/include/limits.h Mon Jun 7 13:52:31 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: limits.h,v 1.10 2007/10/17 19:57:07 garbled Exp $ */ +/* $NetBSD: limits.h,v 1.11 2010/06/07 13:52:31 tnozaki Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -37,7 +37,6 @@ #include <sys/featuretest.h> #define CHAR_BIT 8 /* number of bits in a char */ -#define MB_LEN_MAX 32 /* no multibyte characters */ #define SCHAR_MAX 0x7f /* max value for a signed char */ #define SCHAR_MIN (-0x7f-1) /* min value for a signed char */ Index: src/sys/arch/sparc/include/limits.h diff -u src/sys/arch/sparc/include/limits.h:1.18 src/sys/arch/sparc/include/limits.h:1.19 --- src/sys/arch/sparc/include/limits.h:1.18 Wed Oct 17 19:57:13 2007 +++ src/sys/arch/sparc/include/limits.h Mon Jun 7 13:52:31 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: limits.h,v 1.18 2007/10/17 19:57:13 garbled Exp $ */ +/* $NetBSD: limits.h,v 1.19 2010/06/07 13:52:31 tnozaki Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -37,7 +37,6 @@ #include <sys/featuretest.h> #define CHAR_BIT 8 /* number of bits in a char */ -#define MB_LEN_MAX 32 /* no multibyte characters */ #define SCHAR_MIN (-0x7f-1) /* max value for a signed char */ #define SCHAR_MAX 0x7f /* min value for a signed char */ Index: src/sys/arch/vax/include/limits.h diff -u src/sys/arch/vax/include/limits.h:1.17 src/sys/arch/vax/include/limits.h:1.18 --- src/sys/arch/vax/include/limits.h:1.17 Fri Aug 29 18:25:01 2008 +++ src/sys/arch/vax/include/limits.h Mon Jun 7 13:52:31 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: limits.h,v 1.17 2008/08/29 18:25:01 matt Exp $ */ +/* $NetBSD: limits.h,v 1.18 2010/06/07 13:52:31 tnozaki Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -37,7 +37,6 @@ #include <sys/featuretest.h> #define CHAR_BIT 8 /* number of bits in a char */ -#define MB_LEN_MAX 32 /* no multibyte characters */ #define SCHAR_MAX 0x7f /* max value for a signed char */ #define SCHAR_MIN (-0x7f-1) /* min value for a signed char */ Added files: Index: src/lib/libc/compat/arch/hppa/locale/compat_setlocale32.c diff -u /dev/null src/lib/libc/compat/arch/hppa/locale/compat_setlocale32.c:1.1 --- /dev/null Mon Jun 7 13:52:32 2010 +++ src/lib/libc/compat/arch/hppa/locale/compat_setlocale32.c Mon Jun 7 13:52:29 2010 @@ -0,0 +1,53 @@ +/* $NetBSD: compat_setlocale32.c,v 1.1 2010/06/07 13:52:29 tnozaki Exp $ */ + +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * 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. + * + * NetBSD: setlocale32.c,v 1.6 2010/05/22 13:50:02 tnozaki Exp + */ + +#include <sys/cdefs.h> +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: compat_setlocale32.c,v 1.1 2010/06/07 13:52:29 tnozaki Exp $"); +#endif /* LIBC_SCCS and not lint */ + +#include <sys/types.h> +#include <compat/include/locale.h> + +#include "setlocale_local.h" + +__warn_references(__setlocale_mb_len_max_32, + "warning: reference to compatibility __setlocale_mb_len_max_32();" + "include <locale.h> for correct reference") + +char * +__setlocale_mb_len_max_32(int category, const char *locale) +{ + + /* locale may be NULL */ + + __mb_len_max_runtime = 6; + return __setlocale(category, locale); +} Index: src/lib/libc/compat/include/locale.h diff -u /dev/null src/lib/libc/compat/include/locale.h:1.1 --- /dev/null Mon Jun 7 13:52:32 2010 +++ src/lib/libc/compat/include/locale.h Mon Jun 7 13:52:30 2010 @@ -0,0 +1,44 @@ +/* $NetBSD: locale.h,v 1.1 2010/06/07 13:52:30 tnozaki Exp $ */ + +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * 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. + * + * @(#)locale.h 8.1 (Berkeley) 6/2/93 + */ + +#ifndef _COMPAT_LOCALE_H_ +#define _COMPAT_LOCALE_H_ + +#define _LC_LAST 7 /* marks end */ + +__BEGIN_DECLS +char *setlocale(int, const char *); +char *__setlocale_mb_len_max_32(int, const char *); +__END_DECLS + +#endif /* _COMPAT_LOCALE_H_ */ Index: src/lib/libc/compat/locale/Makefile.inc diff -u /dev/null src/lib/libc/compat/locale/Makefile.inc:1.1 --- /dev/null Mon Jun 7 13:52:32 2010 +++ src/lib/libc/compat/locale/Makefile.inc Mon Jun 7 13:52:30 2010 @@ -0,0 +1,6 @@ +# $NetBSD: Makefile.inc,v 1.1 2010/06/07 13:52:30 tnozaki Exp $ + +.PATH: ${COMPATDIR}/arch/${MACHINE_ARCH}/locale ${COMPATDIR}/locale + +CPPFLAGS+= -I${COMPATDIR}/../locale +SRCS+= compat_setlocale1.c compat_setlocale32.c Index: src/lib/libc/compat/locale/compat_setlocale1.c diff -u /dev/null src/lib/libc/compat/locale/compat_setlocale1.c:1.1 --- /dev/null Mon Jun 7 13:52:32 2010 +++ src/lib/libc/compat/locale/compat_setlocale1.c Mon Jun 7 13:52:30 2010 @@ -0,0 +1,57 @@ +/* $NetBSD: compat_setlocale1.c,v 1.1 2010/06/07 13:52:30 tnozaki Exp $ */ + +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * 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. + * + * NetBSD: setlocale1.c,v 1.4 2010/05/22 13:50:02 tnozaki Exp + */ + +#include <sys/cdefs.h> +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: compat_setlocale1.c,v 1.1 2010/06/07 13:52:30 tnozaki Exp $"); +#endif /* LIBC_SCCS and not lint */ + +#include <sys/types.h> +#include <compat/include/locale.h> + +#include "setlocale_local.h" + +__warn_references(setlocale, + "warning: reference to compatibility setlocale();" + "include <locale.h> for correct reference") + +/* + * Preparation for the future import of multibyte locale. + * This function will ensure binary compatibility for old executables. + */ +char * +setlocale(int category, const char *locale) +{ + + /* locale may be NULL */ + + __mb_len_max_runtime = 1; + return __setlocale(category, locale); +} Index: src/lib/libc/compat/locale/compat_setlocale32.c diff -u /dev/null src/lib/libc/compat/locale/compat_setlocale32.c:1.1 --- /dev/null Mon Jun 7 13:52:32 2010 +++ src/lib/libc/compat/locale/compat_setlocale32.c Mon Jun 7 13:52:30 2010 @@ -0,0 +1,53 @@ +/* $NetBSD: compat_setlocale32.c,v 1.1 2010/06/07 13:52:30 tnozaki Exp $ */ + +/*- + * Copyright (c)1999 Citrus Project, + * All rights reserved. + * + * 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. + * + * NetBSD: setlocale32.c,v 1.6 2010/05/22 13:50:02 tnozaki Exp + */ + +#include <sys/cdefs.h> +#if defined(LIBC_SCCS) && !defined(lint) +__RCSID("$NetBSD: compat_setlocale32.c,v 1.1 2010/06/07 13:52:30 tnozaki Exp $"); +#endif /* LIBC_SCCS and not lint */ + +#include <sys/types.h> +#include <compat/include/locale.h> + +#include "setlocale_local.h" + +__warn_references(__setlocale_mb_len_max_32, + "warning: reference to compatibility __setlocale_mb_len_max_32();" + "include <locale.h> for correct reference") + +char * +__setlocale_mb_len_max_32(int category, const char *locale) +{ + + /* locale may be NULL */ + + __mb_len_max_runtime = 32; + return __setlocale(category, locale); +}