Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/locale Remove support for the old BSDCTYPE format.
details: https://anonhg.NetBSD.org/src/rev/32da7d40db5f
branches: trunk
changeset: 763558:32da7d40db5f
user: joerg <joerg%NetBSD.org@localhost>
date: Fri Mar 25 00:45:24 2011 +0000
description:
Remove support for the old BSDCTYPE format.
diffstat:
lib/libc/locale/bsdctype.c | 36 +---------------------------
lib/libc/locale/bsdctype_file.h | 3 +-
lib/libc/locale/rune.c | 51 +----------------------------------------
3 files changed, 4 insertions(+), 86 deletions(-)
diffs (153 lines):
diff -r 21236a2d2e81 -r 32da7d40db5f lib/libc/locale/bsdctype.c
--- a/lib/libc/locale/bsdctype.c Fri Mar 25 00:03:27 2011 +0000
+++ b/lib/libc/locale/bsdctype.c Fri Mar 25 00:45:24 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bsdctype.c,v 1.9 2010/06/20 02:23:15 tnozaki Exp $ */
+/* $NetBSD: bsdctype.c,v 1.10 2011/03/25 00:45:24 joerg Exp $ */
/*-
* Copyright (c)2008 Citrus Project,
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: bsdctype.c,v 1.9 2010/06/20 02:23:15 tnozaki Exp $");
+__RCSID("$NetBSD: bsdctype.c,v 1.10 2011/03/25 00:45:24 joerg Exp $");
#endif /* LIBC_SCCS and not lint */
#include <sys/endian.h>
@@ -79,35 +79,6 @@
}
static __inline int
-_bsdctype_read_file(const char * __restrict var, size_t lenvar,
- _BSDCTypeLocalePriv * __restrict blp)
-{
- const _FileBSDCTypeLocale *fbl;
- uint32_t value;
- int i;
-
- _DIAGASSERT(blp != NULL);
-
- if (lenvar < sizeof(*fbl))
- return EFTYPE;
- fbl = (const _FileBSDCTypeLocale *)(const void *)var;
- if (memcmp(&fbl->fbl_id[0], _CTYPE_ID, sizeof(fbl->fbl_id)))
- return EFTYPE;
- value = be32toh(fbl->fbl_rev);
- if (value != _CTYPE_REV)
- return EFTYPE;
- value = be32toh(fbl->fbl_num_chars);
- if (value != _CTYPE_CACHE_SIZE)
- return EFTYPE;
- for (i = 0; i < _CTYPE_CACHE_SIZE; ++i) {
- blp->blp_ctype_tab [i + 1] = fbl->fbl_ctype_tab[i];
- blp->blp_tolower_tab[i + 1] = be16toh(fbl->fbl_tolower_tab[i]);
- blp->blp_toupper_tab[i + 1] = be16toh(fbl->fbl_toupper_tab[i]);
- }
- return 0;
-}
-
-static __inline int
_bsdctype_read_runetype(const char * __restrict var, size_t lenvar,
_BSDCTypeLocalePriv * __restrict blp)
{
@@ -161,9 +132,6 @@
return errno;
_bsdctype_init_priv(blp);
switch (*var) {
- case 'B':
- _bsdctype_read_file(var, lenvar, blp);
- break;
case 'R':
_bsdctype_read_runetype(var, lenvar, blp);
break;
diff -r 21236a2d2e81 -r 32da7d40db5f lib/libc/locale/bsdctype_file.h
--- a/lib/libc/locale/bsdctype_file.h Fri Mar 25 00:03:27 2011 +0000
+++ b/lib/libc/locale/bsdctype_file.h Fri Mar 25 00:45:24 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bsdctype_file.h,v 1.1 2010/06/13 04:14:57 tnozaki Exp $ */
+/* $NetBSD: bsdctype_file.h,v 1.2 2011/03/25 00:45:24 joerg Exp $ */
/*-
* Copyright (c)2008 Citrus Project,
@@ -40,7 +40,6 @@
int16_t fbl_toupper_tab[_CTYPE_CACHE_SIZE];
} __packed _FileBSDCTypeLocale;
-#define _CTYPE_ID "BSDCTYPE"
#define _CTYPE_REV 2
#endif /*_BSDCTYPE_FILE_H_*/
diff -r 21236a2d2e81 -r 32da7d40db5f lib/libc/locale/rune.c
--- a/lib/libc/locale/rune.c Fri Mar 25 00:03:27 2011 +0000
+++ b/lib/libc/locale/rune.c Fri Mar 25 00:45:24 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rune.c,v 1.41 2010/11/30 15:25:05 tnozaki Exp $ */
+/* $NetBSD: rune.c,v 1.42 2011/03/25 00:45:24 joerg Exp $ */
/*-
* Copyright (c)2010 Citrus Project,
@@ -280,52 +280,6 @@
return ret;
}
-static __inline int
-_rune_read_bsdctype(const char * __restrict var, size_t lenvar,
- _RuneLocale ** __restrict prl)
-{
- const _FileBSDCTypeLocale *fbl;
- uint32_t value;
- int i, bits;
- uint16_t lower, upper;
- _RuneLocalePriv *rlp;
- _RuneLocale *rl;
-
- if (lenvar < sizeof(*fbl))
- return EFTYPE;
- fbl = (const _FileBSDCTypeLocale *)(const void *)var;
- if (memcmp(&fbl->fbl_id[0], _CTYPE_ID, sizeof(fbl->fbl_id)))
- return EFTYPE;
- value = be32toh(fbl->fbl_rev);
- if (value != _CTYPE_REV)
- return EFTYPE;
- value = be32toh(fbl->fbl_num_chars);
- if (value != _CTYPE_CACHE_SIZE)
- return EFTYPE;
- rlp = (_RuneLocalePriv *)malloc(sizeof(*rlp));
- if (rlp == NULL)
- return ENOMEM;
- _rune_init_priv(rlp);
- rlp->rlp_codeset[0] = '\0';
-
- rl = &rlp->rl;
- for (i = 0; i < _CTYPE_CACHE_SIZE; ++i) {
- bits = fbl->fbl_ctype_tab[i];
- lower = be16toh(fbl->fbl_tolower_tab[i]);
- upper = be16toh(fbl->fbl_toupper_tab[i]);
-
- rlp->rlp_ctype_tab [i + 1] = (unsigned char)bits;
- rlp->rlp_tolower_tab[i + 1] = (short)lower;
- rlp->rlp_toupper_tab[i + 1] = (short)upper;
-
- rl->rl_runetype[i] = _runetype_from_ctype(bits, i);
- rl->rl_maplower[i] = (__nbrune_t)lower;
- rl->rl_mapupper[i] = (__nbrune_t)upper;
- }
- *prl = rl;
- return 0;
-}
-
int
_rune_load(const char * __restrict var, size_t lenvar,
_RuneLocale ** __restrict prl)
@@ -341,9 +295,6 @@
case 'R':
ret = _rune_read_file(var, lenvar, prl);
break;
- case 'B':
- ret = _rune_read_bsdctype(var, lenvar, prl);
- break;
default:
ret = EFTYPE;
}
Home |
Main Index |
Thread Index |
Old Index