Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src more split ctype.h -> sys/ctype_inline.h, sys/ctype_bits.h



details:   https://anonhg.NetBSD.org/src/rev/5a1526f9b830
branches:  trunk
changeset: 755323:5a1526f9b830
user:      tnozaki <tnozaki%NetBSD.org@localhost>
date:      Tue Jun 01 13:52:07 2010 +0000

description:
more split ctype.h -> sys/ctype_inline.h, sys/ctype_bits.h

diffstat:

 distrib/sets/lists/comp/mi          |   4 +-
 include/ctype.h                     |  50 +---------------------
 lib/libc/citrus/citrus_lc_ctype.c   |   6 +-
 lib/libc/gen/ctype_.c               |   6 +-
 lib/libc/gen/isascii.c              |   6 +-
 lib/libc/gen/isctype.c              |  23 +--------
 lib/libc/gen/tolower_.c             |   6 +-
 lib/libc/gen/toupper_.c             |   6 +-
 lib/libc/locale/_wctrans.c          |  10 ++-
 lib/libc/locale/_wctype.c           |   9 +--
 lib/libc/locale/ctypeio.c           |   5 +-
 lib/libc/locale/fix_grouping.c      |   6 +-
 lib/libc/locale/global_locale.c     |   6 +-
 lib/libc/locale/iswctype_mb.c       |   7 +--
 lib/libc/locale/iswctype_sb.c       |   8 +--
 lib/libc/locale/localeio_lc_ctype.c |   6 +-
 lib/libc/locale/rune.c              |  16 +++----
 lib/libc/locale/runeglue.c          |   7 +-
 lib/libc/locale/runetable.c         |   8 +--
 sys/sys/Makefile                    |   4 +-
 sys/sys/ctype_bits.h                |  56 +++++++++++++++++++++++++
 sys/sys/ctype_inline.h              |  82 +++++++++++++++++++++++++++++++++++++
 22 files changed, 203 insertions(+), 134 deletions(-)

diffs (truncated from 770 to 300 lines):

diff -r e81a3b03cc89 -r 5a1526f9b830 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Tue Jun 01 11:34:02 2010 +0000
+++ b/distrib/sets/lists/comp/mi        Tue Jun 01 13:52:07 2010 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.1454 2010/05/21 21:46:48 njoly Exp $
+#      $NetBSD: mi,v 1.1455 2010/06/01 13:52:07 tnozaki Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -1973,6 +1973,8 @@
 ./usr/include/sys/core.h                       comp-c-include
 ./usr/include/sys/cpu_data.h                   comp-obsolete           obsolete
 ./usr/include/sys/cpuio.h                      comp-c-include
+./usr/include/sys/ctype_bits.h                 comp-c-include
+./usr/include/sys/ctype_inline.h               comp-c-include
 ./usr/include/sys/device.h                     comp-c-include
 ./usr/include/sys/device_if.h                  comp-c-include
 ./usr/include/sys/dir.h                                comp-c-include
diff -r e81a3b03cc89 -r 5a1526f9b830 include/ctype.h
--- a/include/ctype.h   Tue Jun 01 11:34:02 2010 +0000
+++ b/include/ctype.h   Tue Jun 01 13:52:07 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ctype.h,v 1.30 2010/05/22 06:38:15 tnozaki Exp $       */
+/*     $NetBSD: ctype.h,v 1.31 2010/06/01 13:52:08 tnozaki Exp $       */
 
 /*
  * Copyright (c) 1989 The Regents of the University of California.
@@ -42,20 +42,6 @@
 #include <sys/cdefs.h>
 #include <sys/featuretest.h>
 
-#define        _U      0x01
-#define        _L      0x02
-#define        _N      0x04
-#define        _S      0x08
-#define        _P      0x10
-#define        _C      0x20
-#define        _X      0x40
-#define        _B      0x80
-
-extern const unsigned char     *_ctype_;
-extern const short     *_tolower_tab_;
-extern const short     *_toupper_tab_;
-
-
 __BEGIN_DECLS
 int    isalnum(int);
 int    isalpha(int);
@@ -84,38 +70,8 @@
 #endif
 __END_DECLS
 
-#define        isdigit(c)      ((int)((_ctype_ + 1)[(c)] & _N))
-#define        islower(c)      ((int)((_ctype_ + 1)[(c)] & _L))
-#define        isspace(c)      ((int)((_ctype_ + 1)[(c)] & _S))
-#define        ispunct(c)      ((int)((_ctype_ + 1)[(c)] & _P))
-#define        isupper(c)      ((int)((_ctype_ + 1)[(c)] & _U))
-#define        isalpha(c)      ((int)((_ctype_ + 1)[(c)] & (_U|_L)))
-#define        isxdigit(c)     ((int)((_ctype_ + 1)[(c)] & (_N|_X)))
-#define        isalnum(c)      ((int)((_ctype_ + 1)[(c)] & (_U|_L|_N)))
-#define        isprint(c)      ((int)((_ctype_ + 1)[(c)] & (_P|_U|_L|_N|_B)))
-#define        isgraph(c)      ((int)((_ctype_ + 1)[(c)] & (_P|_U|_L|_N)))
-#define        iscntrl(c)      ((int)((_ctype_ + 1)[(c)] & _C))
-#define        tolower(c)      ((int)((_tolower_tab_ + 1)[(c)]))
-#define        toupper(c)      ((int)((_toupper_tab_ + 1)[(c)]))
-
-#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
-#define        isascii(c)      ((unsigned)(c) <= 0177)
-#define        toascii(c)      ((c) & 0177)
-#define _tolower(c)    ((c) - 'A' + 'a')
-#define _toupper(c)    ((c) - 'a' + 'A')
-#endif
-
-#if defined(_ISO_C99_SOURCE) || (_POSIX_C_SOURCE - 0) > 200112L || \
-    (_XOPEN_SOURCE - 0) > 600 || defined(_NETBSD_SOURCE)
-
-/*
- * isblank() is implemented as C function, due to insufficient bitwidth in
- * _ctype_.  Note that _B does not mean isblank - it means isprint && !isgraph.
- */
-#if 0
-#define isblank(c)     ((int)((_ctype_ + 1)[(c)] & _B))
-#endif
-
+#if defined(_NETBSD_SOURCE) && !defined(_CTYPE_NOINLINE)
+#include <sys/ctype_inline.h>
 #endif
 
 #endif /* !_CTYPE_H_ */
diff -r e81a3b03cc89 -r 5a1526f9b830 lib/libc/citrus/citrus_lc_ctype.c
--- a/lib/libc/citrus/citrus_lc_ctype.c Tue Jun 01 11:34:02 2010 +0000
+++ b/lib/libc/citrus/citrus_lc_ctype.c Tue Jun 01 13:52:07 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: citrus_lc_ctype.c,v 1.5 2010/05/22 08:13:18 tnozaki Exp $ */
+/* $NetBSD: citrus_lc_ctype.c,v 1.6 2010/06/01 13:52:08 tnozaki Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,14 +28,14 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: citrus_lc_ctype.c,v 1.5 2010/05/22 08:13:18 tnozaki Exp $");
+__RCSID("$NetBSD: citrus_lc_ctype.c,v 1.6 2010/06/01 13:52:08 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "reentrant.h"
 #include <sys/types.h>
+#include <sys/ctype_bits.h>
 #include <sys/queue.h>
 #include <assert.h>
-#include <ctype.h>
 #include <errno.h>
 #include <langinfo.h>
 #include <limits.h>
diff -r e81a3b03cc89 -r 5a1526f9b830 lib/libc/gen/ctype_.c
--- a/lib/libc/gen/ctype_.c     Tue Jun 01 11:34:02 2010 +0000
+++ b/lib/libc/gen/ctype_.c     Tue Jun 01 13:52:07 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ctype_.c,v 1.17 2010/05/22 06:38:15 tnozaki Exp $      */
+/*     $NetBSD: ctype_.c,v 1.18 2010/06/01 13:52:08 tnozaki Exp $      */
 
 /*
  * Copyright (c) 1989 The Regents of the University of California.
@@ -39,11 +39,11 @@
 #if 0
 /*static char *sccsid = "from: @(#)ctype_.c    5.6 (Berkeley) 6/1/90";*/
 #else
-__RCSID("$NetBSD: ctype_.c,v 1.17 2010/05/22 06:38:15 tnozaki Exp $");
+__RCSID("$NetBSD: ctype_.c,v 1.18 2010/06/01 13:52:08 tnozaki Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
-#include <ctype.h>
+#include <sys/ctype_bits.h>
 #include <stdio.h>
 #include "ctype_local.h"
 
diff -r e81a3b03cc89 -r 5a1526f9b830 lib/libc/gen/isascii.c
--- a/lib/libc/gen/isascii.c    Tue Jun 01 11:34:02 2010 +0000
+++ b/lib/libc/gen/isascii.c    Tue Jun 01 13:52:07 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: isascii.c,v 1.2 2003/08/07 16:42:51 agc Exp $  */
+/*     $NetBSD: isascii.c,v 1.3 2010/06/01 13:52:08 tnozaki Exp $      */
 
 /*
  * Copyright (c) 1989 The Regents of the University of California.
@@ -38,12 +38,12 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: isascii.c,v 1.2 2003/08/07 16:42:51 agc Exp $");
+__RCSID("$NetBSD: isascii.c,v 1.3 2010/06/01 13:52:08 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
+#define _CTYPE_NOINLINE
 #include <ctype.h>
 
-#undef isascii
 int
 isascii(c)
        int c;
diff -r e81a3b03cc89 -r 5a1526f9b830 lib/libc/gen/isctype.c
--- a/lib/libc/gen/isctype.c    Tue Jun 01 11:34:02 2010 +0000
+++ b/lib/libc/gen/isctype.c    Tue Jun 01 13:52:07 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: isctype.c,v 1.19 2010/05/22 13:15:59 tnozaki Exp $ */
+/* $NetBSD: isctype.c,v 1.20 2010/06/01 13:52:08 tnozaki Exp $ */
 
 /*-
  * Copyright (c)2008 Citrus Project,
@@ -28,11 +28,13 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: isctype.c,v 1.19 2010/05/22 13:15:59 tnozaki Exp $");
+__RCSID("$NetBSD: isctype.c,v 1.20 2010/06/01 13:52:08 tnozaki Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
 #include <sys/types.h>
+#include <sys/ctype_bits.h>
+#define _CTYPE_NOINLINE
 #include <ctype.h>
 #include <langinfo.h>
 #define __SETLOCALE_SOURCE__
@@ -46,18 +48,6 @@
 
 #define _CTYPE_TAB(table, i)   ((_current_cache()->table + 1)[i])
 
-#undef isalnum
-#undef isalpha
-#undef iscntrl
-#undef isdigit
-#undef isgraph
-#undef islower
-#undef isprint
-#undef ispunct
-#undef isspace
-#undef isupper
-#undef isxdigit
-
 #define _ISCTYPE_FUNC(name, bit) \
 int \
 is##name(int c) \
@@ -77,7 +67,6 @@
 _ISCTYPE_FUNC(upper,  _U            )
 _ISCTYPE_FUNC(xdigit, _N|_X         )
 
-#undef isblank
 int
 isblank(int c)
 {
@@ -85,28 +74,24 @@
         return c == ' ' || c == '\t';
 }
 
-#undef toupper
 int
 toupper(int c)
 {
        return (int)_CTYPE_TAB(toupper_tab, c);
 }
 
-#undef tolower
 int
 tolower(int c)
 {
        return (int)_CTYPE_TAB(tolower_tab, c);
 }
 
-#undef _toupper
 int
 _toupper(int c)
 {
        return (c - 'a' + 'A');
 }
 
-#undef _tolower
 int
 _tolower(int c)
 {
diff -r e81a3b03cc89 -r 5a1526f9b830 lib/libc/gen/tolower_.c
--- a/lib/libc/gen/tolower_.c   Tue Jun 01 11:34:02 2010 +0000
+++ b/lib/libc/gen/tolower_.c   Tue Jun 01 13:52:07 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tolower_.c,v 1.12 2010/05/22 06:38:15 tnozaki Exp $    */
+/*     $NetBSD: tolower_.c,v 1.13 2010/06/01 13:52:08 tnozaki Exp $    */
 
 /*
  * Written by J.T. Conklin <jtc%NetBSD.org@localhost>.
@@ -7,10 +7,10 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_RCS) && !defined(lint)
-__RCSID("$NetBSD: tolower_.c,v 1.12 2010/05/22 06:38:15 tnozaki Exp $");
+__RCSID("$NetBSD: tolower_.c,v 1.13 2010/06/01 13:52:08 tnozaki Exp $");
 #endif /* LIBC_RCS and not lint */
 
-#include <ctype.h>
+#include <sys/ctype_bits.h>
 #include <stdio.h>
 #include "ctype_local.h"
 
diff -r e81a3b03cc89 -r 5a1526f9b830 lib/libc/gen/toupper_.c
--- a/lib/libc/gen/toupper_.c   Tue Jun 01 11:34:02 2010 +0000
+++ b/lib/libc/gen/toupper_.c   Tue Jun 01 13:52:07 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: toupper_.c,v 1.12 2010/05/22 06:38:15 tnozaki Exp $    */
+/*     $NetBSD: toupper_.c,v 1.13 2010/06/01 13:52:08 tnozaki Exp $    */
 
 /*
  * Written by J.T. Conklin <jtc%NetBSD.org@localhost>.
@@ -7,10 +7,10 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_RCS) && !defined(lint)
-__RCSID("$NetBSD: toupper_.c,v 1.12 2010/05/22 06:38:15 tnozaki Exp $");
+__RCSID("$NetBSD: toupper_.c,v 1.13 2010/06/01 13:52:08 tnozaki Exp $");
 #endif /* LIBC_RCS and not lint */
 
-#include <ctype.h>
+#include <sys/ctype_bits.h>
 #include <stdio.h>
 #include "ctype_local.h"
 
diff -r e81a3b03cc89 -r 5a1526f9b830 lib/libc/locale/_wctrans.c
--- a/lib/libc/locale/_wctrans.c        Tue Jun 01 11:34:02 2010 +0000
+++ b/lib/libc/locale/_wctrans.c        Tue Jun 01 13:52:07 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: _wctrans.c,v 1.14 2010/05/22 07:18:43 tnozaki Exp $    */
+/*     $NetBSD: _wctrans.c,v 1.15 2010/06/01 13:52:08 tnozaki Exp $    */
 
 /*-
  * Copyright (c)2003 Citrus Project,
@@ -60,15 +60,15 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: _wctrans.c,v 1.14 2010/05/22 07:18:43 tnozaki Exp $");



Home | Main Index | Thread Index | Old Index