From c81a475f00bd63bcc907938e4bb0f9edb11f1fde Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Sat, 7 Oct 2000 18:39:06 +0000 Subject: [PATCH] acinclude.m4: Remove CPU_FLAGS 2000-10-07 Benjamin Kosnik * acinclude.m4: Remove CPU_FLAGS * libio/Makefile.am: Here too. * Makefile.am: Here too. * src/Makefile.am (CONFIG_INCLUDES): Remove. (INCLUDES): Remove CONFIG_INCLUDES. (cpu_headers): Remove. (myinstallheaders): Remove cpu_headers. (generated_headers): Rename to build_headers. (build_headers): Add atomicity.h, ctype_base.h, ctype_specializations.h. * config/os: New directory. * config/aix: Move to... * config/bsd: Move to... * config/generic: Move to... * config/gnu-linux: Move to... * config/irix: Move to... * config/newlib: Move to... * config/solaris: Move to... * config/os/*: Here. From-SVN: r36776 --- libstdc++-v3/config/os/aix/bits/atomicity.h | 72 +++++++++++++++ libstdc++-v3/config/os/aix/bits/ctype_base.h | 62 +++++++++++++ .../config/os/aix/bits/ctype_inline.h | 76 ++++++++++++++++ .../config/os/aix/bits/ctype_noninline.h | 71 +++++++++++++++ libstdc++-v3/config/os/bsd/bits/ctype_base.h | 78 ++++++++++++++++ .../config/os/bsd/bits/ctype_inline.h | 78 ++++++++++++++++ .../config/os/bsd/bits/ctype_noninline.h | 71 +++++++++++++++ .../config/os/generic/bits/ctype_base.h | 59 +++++++++++++ .../config/os/generic/bits/ctype_inline.h | 72 +++++++++++++++ .../config/os/generic/bits/ctype_noninline.h | 71 +++++++++++++++ .../config/os/gnu-linux/bits/ctype_base.h | 78 ++++++++++++++++ .../config/os/gnu-linux/bits/ctype_inline.h | 72 +++++++++++++++ .../os/gnu-linux/bits/ctype_noninline.h | 88 +++++++++++++++++++ libstdc++-v3/config/os/irix/bits/ctype_base.h | 60 +++++++++++++ .../config/os/irix/bits/ctype_inline.h | 73 +++++++++++++++ .../config/os/irix/bits/ctype_noninline.h | 45 ++++++++++ .../config/os/newlib/bits/ctype_base.h | 61 +++++++++++++ .../config/os/newlib/bits/ctype_inline.h | 73 +++++++++++++++ .../config/os/newlib/bits/ctype_noninline.h | 78 ++++++++++++++++ .../os/solaris/solaris2.5/bits/ctype_base.h | 56 ++++++++++++ .../os/solaris/solaris2.5/bits/ctype_inline.h | 73 +++++++++++++++ .../solaris/solaris2.5/bits/ctype_noninline.h | 72 +++++++++++++++ .../os/solaris/solaris2.6/bits/ctype_base.h | 58 ++++++++++++ .../os/solaris/solaris2.6/bits/ctype_inline.h | 73 +++++++++++++++ .../solaris/solaris2.6/bits/ctype_noninline.h | 71 +++++++++++++++ .../os/solaris/solaris2.7/bits/ctype_base.h | 58 ++++++++++++ .../os/solaris/solaris2.7/bits/ctype_inline.h | 73 +++++++++++++++ .../solaris/solaris2.7/bits/ctype_noninline.h | 73 +++++++++++++++ 28 files changed, 1945 insertions(+) create mode 100644 libstdc++-v3/config/os/aix/bits/atomicity.h create mode 100644 libstdc++-v3/config/os/aix/bits/ctype_base.h create mode 100644 libstdc++-v3/config/os/aix/bits/ctype_inline.h create mode 100644 libstdc++-v3/config/os/aix/bits/ctype_noninline.h create mode 100644 libstdc++-v3/config/os/bsd/bits/ctype_base.h create mode 100644 libstdc++-v3/config/os/bsd/bits/ctype_inline.h create mode 100644 libstdc++-v3/config/os/bsd/bits/ctype_noninline.h create mode 100644 libstdc++-v3/config/os/generic/bits/ctype_base.h create mode 100644 libstdc++-v3/config/os/generic/bits/ctype_inline.h create mode 100644 libstdc++-v3/config/os/generic/bits/ctype_noninline.h create mode 100644 libstdc++-v3/config/os/gnu-linux/bits/ctype_base.h create mode 100644 libstdc++-v3/config/os/gnu-linux/bits/ctype_inline.h create mode 100644 libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h create mode 100644 libstdc++-v3/config/os/irix/bits/ctype_base.h create mode 100644 libstdc++-v3/config/os/irix/bits/ctype_inline.h create mode 100644 libstdc++-v3/config/os/irix/bits/ctype_noninline.h create mode 100644 libstdc++-v3/config/os/newlib/bits/ctype_base.h create mode 100644 libstdc++-v3/config/os/newlib/bits/ctype_inline.h create mode 100644 libstdc++-v3/config/os/newlib/bits/ctype_noninline.h create mode 100644 libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_base.h create mode 100644 libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_inline.h create mode 100644 libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_noninline.h create mode 100644 libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_base.h create mode 100644 libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_inline.h create mode 100644 libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_noninline.h create mode 100644 libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_base.h create mode 100644 libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_inline.h create mode 100644 libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_noninline.h diff --git a/libstdc++-v3/config/os/aix/bits/atomicity.h b/libstdc++-v3/config/os/aix/bits/atomicity.h new file mode 100644 index 000000000000..14481806c6c3 --- /dev/null +++ b/libstdc++-v3/config/os/aix/bits/atomicity.h @@ -0,0 +1,72 @@ +/* Low-level functions for atomic operations. AIX version. + Copyright (C) 2000 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#ifndef _BITS_ATOMICITY_H +#define _BITS_ATOMICITY_H 1 + +/* Should this be type long so 64-bit word in 64-bit mode? */ +typedef int _Atomic_word; + +#include + +static inline int +__attribute__ ((unused)) +__exchange_and_add (atomic_p __mem, int __val) +{ + return fetch_and_add (__mem, __val); +} + +static inline void +__attribute__ ((unused)) +__atomic_add (atomic_p __mem, int __val) +{ + (void) fetch_and_add (__mem, __val); +} + +static inline int +__attribute__ ((unused)) +__compare_and_swap (atomic_l __p, long int __oldval, long int __newval) +{ + return compare_and_swaplp (__p, &__oldval, __newval); +} + +static inline long +__attribute__ ((unused)) +__always_swap (atomic_l __p, long int __newval) +{ + long __val = *__p; + + while (! compare_and_swaplp (__p, &__val, __newval)) + /* EMPTY */; + + return __val; +} + +static inline int +__attribute__ ((unused)) +__test_and_set (atomic_l __p, long int __newval) +{ + long __val = 0; + + (void) compare_and_swaplp (__p, &__val, __newval); + + return __val; +} + +#endif /* atomicity.h */ diff --git a/libstdc++-v3/config/os/aix/bits/ctype_base.h b/libstdc++-v3/config/os/aix/bits/ctype_base.h new file mode 100644 index 000000000000..bae6bb4a4583 --- /dev/null +++ b/libstdc++-v3/config/os/aix/bits/ctype_base.h @@ -0,0 +1,62 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000, 1999 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h + + struct ctype_base + { + typedef unsigned char mask; + // Non-standard typedefs. + typedef const int* __to_type; + + enum + { + space = _ISSPACE, + print = _ISPRINT, + cntrl = _ISCNTRL, + upper = _ISUPPER, + lower = _ISLOWER, + alpha = _ISALPHA, + digit = _ISDIGIT, + punct = _ISPUNCT, + xdigit = _ISXDIGIT, + alnum = _ISALNUM, + graph = _ISGRAPH + }; + }; + + + + + + diff --git a/libstdc++-v3/config/os/aix/bits/ctype_inline.h b/libstdc++-v3/config/os/aix/bits/ctype_inline.h new file mode 100644 index 000000000000..2083a174a4ba --- /dev/null +++ b/libstdc++-v3/config/os/aix/bits/ctype_inline.h @@ -0,0 +1,76 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) +// functions go in ctype.cc + + bool + ctype:: + is(mask __m, char __c) const throw() + { return _IS(__c, __m); } + + const char* + ctype:: + is(const char* __low, const char* __high, mask* __vec) const throw() + { + while (__low < __high) + *__vec++ = __OBJ_DATA(__lc_ctype)->mask[*__low++]; + return __high; + } + + const char* + ctype:: + scan_is(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high && !this->is(__m, *__low)) + ++__low; + return __low; + } + + const char* + ctype:: + scan_not(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high && this->is(__m, *__low) != 0) + ++__low; + return __low; + } + + + + + + + + + diff --git a/libstdc++-v3/config/os/aix/bits/ctype_noninline.h b/libstdc++-v3/config/os/aix/bits/ctype_noninline.h new file mode 100644 index 000000000000..67972999ee17 --- /dev/null +++ b/libstdc++-v3/config/os/aix/bits/ctype_noninline.h @@ -0,0 +1,71 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h + + ctype::ctype(const mask* __table = 0, bool __del = false, + size_t __refs = 0) throw() + : _Ctype_nois(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_ctable(NULL), _M_table(__table == 0 ? _M_ctable: __table) + { } + + char + ctype::do_toupper(char __c) const + { return _toupper(__c); } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = this->do_toupper(*__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return _tolower(__a); } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = this->do_tolower(*__low); + ++__low; + } + return __high; + } diff --git a/libstdc++-v3/config/os/bsd/bits/ctype_base.h b/libstdc++-v3/config/os/bsd/bits/ctype_base.h new file mode 100644 index 000000000000..145321f5fee4 --- /dev/null +++ b/libstdc++-v3/config/os/bsd/bits/ctype_base.h @@ -0,0 +1,78 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h on FreeBSD 3.4, +// 4.0 and all versions of the CVS managed file at: +// :pserver:anoncvs@anoncvs.freebsd.org:/home/ncvs/src/include/ctype.h +// which should cover most classic BSD configurations + + struct ctype_base + { + typedef unsigned long mask; + // Non-standard typedefs. + typedef const int* __to_type; + + enum + { +#ifdef _CTYPE_S + // FreeBSD 4.0 uses this style of define. + space = _CTYPE_S, + print = _CTYPE_R, + cntrl = _CTYPE_C, + upper = _CTYPE_U, + lower = _CTYPE_L, + alpha = _CTYPE_A, + digit = _CTYPE_D, + punct = _CTYPE_P, + xdigit = _CTYPE_X, + alnum = _CTYPE_A | _CTYPE_D, + graph = _CTYPE_G +#else + // Other BSD's, including Free BSD 3.4, uses this style of define. + space = _S, + print = _R, + cntrl = _C, + upper = _U, + lower = _L, + alpha = _A, + digit = _D, + punct = _P, + xdigit = _X, + alnum = _A | _D, + graph = _G +#endif + }; + }; + + + diff --git a/libstdc++-v3/config/os/bsd/bits/ctype_inline.h b/libstdc++-v3/config/os/bsd/bits/ctype_inline.h new file mode 100644 index 000000000000..c2a49c4025df --- /dev/null +++ b/libstdc++-v3/config/os/bsd/bits/ctype_inline.h @@ -0,0 +1,78 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) +// functions go in ctype.cc + + bool + ctype:: + is(mask __m, char __c) const throw() + { + if (__m & digit || __m & xdigit) + return __isctype(__c, __m); + else + return __istype(__c, __m); + } + + const char* + ctype:: + is(const char* __low, const char* __high, mask* __vec) const throw() + { + // XXX + while (__low < __high) + *__vec++ = _M_table[(unsigned char)(*__low++)]; + return __high; + } + + const char* + ctype:: + scan_is(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high && !this->is(__m, *__low)) + ++__low; + return __low; + } + + const char* + ctype:: + scan_not(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high && this->is(__m, *__low) != 0) + ++__low; + return __low; + } + + + + + diff --git a/libstdc++-v3/config/os/bsd/bits/ctype_noninline.h b/libstdc++-v3/config/os/bsd/bits/ctype_noninline.h new file mode 100644 index 000000000000..f41986576353 --- /dev/null +++ b/libstdc++-v3/config/os/bsd/bits/ctype_noninline.h @@ -0,0 +1,71 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h + + ctype::ctype(const mask* __table = 0, bool __del = false, + size_t __refs = 0) throw() + : _Ctype_nois(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_ctable(NULL), _M_table(__table == 0 ? _M_ctable: __table) + { } + + char + ctype::do_toupper(char __c) const + { return ::toupper((int) __c); } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::toupper((int) *__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return ::tolower((int) __c); } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::tolower((int) *__low); + ++__low; + } + return __high; + } diff --git a/libstdc++-v3/config/os/generic/bits/ctype_base.h b/libstdc++-v3/config/os/generic/bits/ctype_base.h new file mode 100644 index 000000000000..8b5e0a07252e --- /dev/null +++ b/libstdc++-v3/config/os/generic/bits/ctype_base.h @@ -0,0 +1,59 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 1997-1999 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Default information, may not be appropriate for specific host. + + struct ctype_base + { + typedef unsigned int mask; + // Non-standard typedefs. + typedef const int* __to_type; + + enum + { + space = (1 << 5), // Whitespace + print = (1 << 6), // Printing + cntrl = (1 << 9), // Control character + upper = (1 << 0), // UPPERCASE + lower = (1 << 1), // lowercase + alpha = (1 << 5), // Alphabetic + digit = (1 << 2), // Numeric + punct = (1 << 10),// Punctuation + xdigit = (1 << 4),// Hexadecimal numeric + alnum = (1 << 11),// Alphanumeric + graph = (1 << 7) // Graphical + }; + }; + + + diff --git a/libstdc++-v3/config/os/generic/bits/ctype_inline.h b/libstdc++-v3/config/os/generic/bits/ctype_inline.h new file mode 100644 index 000000000000..952b0da8c980 --- /dev/null +++ b/libstdc++-v3/config/os/generic/bits/ctype_inline.h @@ -0,0 +1,72 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) +// functions go in ctype.cc + + bool + ctype:: + is(mask __m, char __c) const throw() + { return _M_table[(unsigned char)(__c)] & __m; } + + const char* + ctype:: + is(const char* __low, const char* __high, mask* __vec) const throw() + { + while (__low < __high) + *__vec++ = _M_table[(unsigned char)(*__low++)]; + return __high; + } + + const char* + ctype:: + scan_is(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high && !this->is(__m, *__low)) + ++__low; + return __low; + } + + const char* + ctype:: + scan_not(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high && this->is(__m, *__low) != 0) + ++__low; + return __low; + } + + + + + diff --git a/libstdc++-v3/config/os/generic/bits/ctype_noninline.h b/libstdc++-v3/config/os/generic/bits/ctype_noninline.h new file mode 100644 index 000000000000..e4de5c2eae9b --- /dev/null +++ b/libstdc++-v3/config/os/generic/bits/ctype_noninline.h @@ -0,0 +1,71 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h + + ctype::ctype(const mask* __table = 0, bool __del = false, + size_t __refs = 0) throw() + : _Ctype_nois(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_ctable(NULL), _M_table(__table == 0 ? _M_ctable: __table) + { } + + char + ctype::do_toupper(char __c) const + { return ::toupper((int) __c); } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::toupper((int) *__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return ::tolower((int) __c); } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = ::tolower((int) *__low); + ++__low; + } + return __high; + } diff --git a/libstdc++-v3/config/os/gnu-linux/bits/ctype_base.h b/libstdc++-v3/config/os/gnu-linux/bits/ctype_base.h new file mode 100644 index 000000000000..dfd29fbc4da7 --- /dev/null +++ b/libstdc++-v3/config/os/gnu-linux/bits/ctype_base.h @@ -0,0 +1,78 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h + +#if _GLIBCPP_USE_SHADOW_HEADERS + using _C_legacy::_ISspace; + using _C_legacy::_ISprint; + using _C_legacy::_IScntrl; + using _C_legacy::_ISupper; + using _C_legacy::_ISlower; + using _C_legacy::_ISalpha; + using _C_legacy::_ISdigit; + using _C_legacy::_ISpunct; + using _C_legacy::_ISxdigit; + using _C_legacy::_ISalnum; + using _C_legacy::_ISgraph; +#endif + + struct ctype_base + { + // Non-standard typedefs. + // XXX + typedef unsigned short mask; + typedef unsigned short __table_type; + typedef const int* __to_type; + + // XXX + // enum mask + enum + { + space = _ISspace, + print = _ISprint, + cntrl = _IScntrl, + upper = _ISupper, + lower = _ISlower, + alpha = _ISalpha, + digit = _ISdigit, + punct = _ISpunct, + xdigit = _ISxdigit, + alnum = _ISalnum, + graph = _ISgraph + }; + }; + + + + diff --git a/libstdc++-v3/config/os/gnu-linux/bits/ctype_inline.h b/libstdc++-v3/config/os/gnu-linux/bits/ctype_inline.h new file mode 100644 index 000000000000..fdba4e7535ee --- /dev/null +++ b/libstdc++-v3/config/os/gnu-linux/bits/ctype_inline.h @@ -0,0 +1,72 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) +// functions go in ctype.cc + + bool + ctype:: + is(mask __m, char __c) const throw() + { return _M_table[(unsigned char)(__c)] & __m; } + + const char* + ctype:: + is(const char* __low, const char* __high, mask* __vec) const throw() + { + while (__low < __high) + *__vec++ = _M_table[(unsigned char)(*__low++)]; + return __high; + } + + const char* + ctype:: + scan_is(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high && !(_M_table[(unsigned char)(*__low)] & __m)) + ++__low; + return __low; + } + + const char* + ctype:: + scan_not(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high + && (_M_table[(unsigned char)(*__low)] & __m) != 0) + ++__low; + return __low; + } + + + + diff --git a/libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h b/libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h new file mode 100644 index 000000000000..63032425c702 --- /dev/null +++ b/libstdc++-v3/config/os/gnu-linux/bits/ctype_noninline.h @@ -0,0 +1,88 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h + +#if _GLIBCPP_USE_SHADOW_HEADERS + using _C_legacy::__ctype_toupper; + using _C_legacy::__ctype_tolower; + using _C_legacy::__ctype_b; +#endif + + ctype::ctype(const mask* __table, bool __del, size_t __refs) + : _Ctype_nois(__refs), _M_del(__table != 0 && __del), + _M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower), + _M_ctable(__ctype_b), _M_table(__table == 0 ? _M_ctable: __table) + { } + + char + ctype::do_toupper(char __c) const + { return _M_toupper[static_cast(__c)]; } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_toupper[static_cast(*__low)]; + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return _M_tolower[static_cast(__c)]; } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_tolower[static_cast(*__low)]; + ++__low; + } + return __high; + } + + + + + + + + + + + + diff --git a/libstdc++-v3/config/os/irix/bits/ctype_base.h b/libstdc++-v3/config/os/irix/bits/ctype_base.h new file mode 100644 index 000000000000..32394eb7a4a9 --- /dev/null +++ b/libstdc++-v3/config/os/irix/bits/ctype_base.h @@ -0,0 +1,60 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 1997-1999 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h on irix 6.5 + + struct ctype_base + { + typedef unsigned char mask; + // Non-standard typedefs. + typedef int* __to_type; + + enum + { + space = _ISspace, + print = _ISprint, + cntrl = _IScntrl, + upper = _ISupper, + lower = _ISlower, + alpha = _ISalpha, + digit = _ISdigit, + punct = _ISpunct, + xdigit = _ISxdigit, + alnum = _ISalnum, + graph = _ISgraph + }; + }; + + + + diff --git a/libstdc++-v3/config/os/irix/bits/ctype_inline.h b/libstdc++-v3/config/os/irix/bits/ctype_inline.h new file mode 100644 index 000000000000..88a93b4c7baf --- /dev/null +++ b/libstdc++-v3/config/os/irix/bits/ctype_inline.h @@ -0,0 +1,73 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000 Cygnus Solutions +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) +// functions go in ctype.cc + + bool + ctype:: + is(mask __m, char __c) const throw() + { return (_M_table + 1)[(unsigned char)(__c)] & __m; } + + const char* + ctype:: + is(const char* __low, const char* __high, mask* __vec) const throw() + { + while (__low < __high) + *__vec++ = (_M_table + 1)[(unsigned char)(*__low++)]; + return __high; + } + + const char* + ctype:: + scan_is(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high && !((_M_table + 1)[(unsigned char)(*__low)] & __m)) + ++__low; + return __low; + } + + const char* + ctype:: + scan_not(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high + && ((_M_table + 1)[(unsigned char)(*__low)] & __m) != 0) + ++__low; + return __low; + } + + + + + diff --git a/libstdc++-v3/config/os/irix/bits/ctype_noninline.h b/libstdc++-v3/config/os/irix/bits/ctype_noninline.h new file mode 100644 index 000000000000..553e776e1dd5 --- /dev/null +++ b/libstdc++-v3/config/os/irix/bits/ctype_noninline.h @@ -0,0 +1,45 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 1997-1999 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h + + ctype_base::__to_type const& ctype::_S_toupper = _toupper; + ctype_base::__to_type const& ctype::_S_tolower = _tolower; + const ctype_base::mask* const& ctype::_S_table = __ctype; + +#ifdef _GLIBCPP_USE_WCHAR_T + ctype_base::__to_type const& ctype::_S_toupper = _toupper; + ctype_base::__to_type const& ctype::_S_tolower = _tolower; + const ctype_base::mask* const& ctype::_S_table = __ctype; +#endif + diff --git a/libstdc++-v3/config/os/newlib/bits/ctype_base.h b/libstdc++-v3/config/os/newlib/bits/ctype_base.h new file mode 100644 index 000000000000..447073e2a046 --- /dev/null +++ b/libstdc++-v3/config/os/newlib/bits/ctype_base.h @@ -0,0 +1,61 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h, for solaris2.5.1 + +// Support for Solaris 2.5.1 + + struct ctype_base + { + typedef char mask; + // Non-standard typedefs. + typedef const int* __to_type; + + enum + { + space = 010, // Whitespace + print = 020 | 01 | 02 | 04 | 0200, // Printing + cntrl = 040, // Control character + upper = 01, // UPPERCASE + lower = 02, // lowercase + alpha = 01 | 02, // Alphabetic + digit = 04, // Numeric + punct = 020, // Punctuation + xdigit = 0200, // Hexadecimal numeric + alnum = 01 | 02 | 04, // Alphanumeric + graph = 020 | 01 | 02 | 04 // Graphical + }; + }; + + + diff --git a/libstdc++-v3/config/os/newlib/bits/ctype_inline.h b/libstdc++-v3/config/os/newlib/bits/ctype_inline.h new file mode 100644 index 000000000000..ff8bb67c1ede --- /dev/null +++ b/libstdc++-v3/config/os/newlib/bits/ctype_inline.h @@ -0,0 +1,73 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) +// functions go in ctype.cc + + bool + ctype:: + is(mask __m, char __c) const throw() + { return (_M_table + 1)[(unsigned char)(__c)] & __m; } + + const char* + ctype:: + is(const char* __low, const char* __high, mask* __vec) const throw() + { + while (__low < __high) + *__vec++ = (_M_table + 1)[(unsigned char)(*__low++)]; + return __high; + } + + const char* + ctype:: + scan_is(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high && !((_M_table + 1)[(unsigned char)(*__low)] & __m)) + ++__low; + return __low; + } + + const char* + ctype:: + scan_not(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high + && ((_M_table + 1)[(unsigned char)(*__low)] & __m) != 0) + ++__low; + return __low; + } + + + + + diff --git a/libstdc++-v3/config/os/newlib/bits/ctype_noninline.h b/libstdc++-v3/config/os/newlib/bits/ctype_noninline.h new file mode 100644 index 000000000000..1984d6543937 --- /dev/null +++ b/libstdc++-v3/config/os/newlib/bits/ctype_noninline.h @@ -0,0 +1,78 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h + + ctype::ctype(const mask* __table = 0, bool __del = false, + size_t __refs = 0) throw() + : _Ctype_nois(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_ctable(_ctype_), _M_table(__table == 0 ? _M_ctable: __table) + { } + + char + ctype::do_toupper(char __c) const + { + int __x = __c; + return (this->is(ctype_base::upper, __c) ? (__x - 'A' + 'a') : __x); + } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = this->do_toupper(*__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { + int __x = __c; + return (this->is(ctype_base::lower, __c) ? (__x - 'A' + 'a') : __x); + } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = this->do_tolower(*__low); + ++__low; + } + return __high; + } + diff --git a/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_base.h b/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_base.h new file mode 100644 index 000000000000..1f4e1d65d3d5 --- /dev/null +++ b/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_base.h @@ -0,0 +1,56 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 1997-1999 Cygnus Solutions +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h, for solaris2.5.1 + + struct ctype_base + { + typedef unsigned char mask; + // Non-standard typedefs. + typedef const int* __to_type; + + enum + { + space = 010, // Whitespace + print = 020 | 01 | 02 | 04 | 0200, // Printing + cntrl = 040, // Control character + upper = 01, // UPPERCASE + lower = 02, // lowercase + alpha = 01 | 02, // Alphabetic + digit = 04, // Numeric + punct = 020, // Punctuation + xdigit = 0200, // Hexadecimal numeric + alnum = 01 | 02 | 04, // Alphanumeric + graph = 020 | 01 | 02 | 04 // Graphical + }; + }; diff --git a/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_inline.h b/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_inline.h new file mode 100644 index 000000000000..88a93b4c7baf --- /dev/null +++ b/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_inline.h @@ -0,0 +1,73 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000 Cygnus Solutions +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) +// functions go in ctype.cc + + bool + ctype:: + is(mask __m, char __c) const throw() + { return (_M_table + 1)[(unsigned char)(__c)] & __m; } + + const char* + ctype:: + is(const char* __low, const char* __high, mask* __vec) const throw() + { + while (__low < __high) + *__vec++ = (_M_table + 1)[(unsigned char)(*__low++)]; + return __high; + } + + const char* + ctype:: + scan_is(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high && !((_M_table + 1)[(unsigned char)(*__low)] & __m)) + ++__low; + return __low; + } + + const char* + ctype:: + scan_not(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high + && ((_M_table + 1)[(unsigned char)(*__low)] & __m) != 0) + ++__low; + return __low; + } + + + + + diff --git a/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_noninline.h b/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_noninline.h new file mode 100644 index 000000000000..c02a31ead51c --- /dev/null +++ b/libstdc++-v3/config/os/solaris/solaris2.5/bits/ctype_noninline.h @@ -0,0 +1,72 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000 Cygnus Solutions +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h + + ctype::ctype(const mask* __table = 0, bool __del = false, + size_t __refs = 0) throw() + : _Ctype_nois(__refs), _M_del(__table != 0 && __del), + _M_toupper(NULL), _M_tolower(NULL), + _M_ctable(__ctype), _M_table(__table == 0 ? _M_ctable: __table) + { } + + char + ctype::do_toupper(char __c) const + { return ((_M_table + 258)[static_cast(__c)]); } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = this->do_toupper(*__low); + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return ((_M_table + 258)[static_cast(__c)]); } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = this->do_tolower(*__low); + ++__low; + } + return __high; + } + diff --git a/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_base.h b/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_base.h new file mode 100644 index 000000000000..4e2618f89e73 --- /dev/null +++ b/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_base.h @@ -0,0 +1,58 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 1997-1999 Cygnus Solutions +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h. Looks like this +// only works with solaris2.6 and solaris2.7, but not solaris2.5.1. + + struct ctype_base + { + typedef unsigned int mask; + // Non-standard typedefs. + typedef long* __to_type; + + enum + { + space = _ISSPACE, + print = _ISPRINT, + cntrl = _ISCNTRL, + upper = _ISUPPER, + lower = _ISLOWER, + alpha = _ISALPHA, + digit = _ISDIGIT, + punct = _ISPUNCT, + xdigit = _ISXDIGIT, + alnum = _ISALNUM, + graph = _ISGRAPH + }; + }; + diff --git a/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_inline.h b/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_inline.h new file mode 100644 index 000000000000..819fc19caed2 --- /dev/null +++ b/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_inline.h @@ -0,0 +1,73 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000 Cygnus Solutions +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) +// functions go in ctype.cc + + bool + ctype:: + is(mask __m, char __c) const throw() + { return _M_table[(unsigned char)(__c)] & __m; } + + const char* + ctype:: + is(const char* __low, const char* __high, mask* __vec) const throw() + { + while (__low < __high) + *__vec++ = _M_table[(unsigned char)(*__low++)]; + return __high; + } + + const char* + ctype:: + scan_is(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high && !(_M_table[(unsigned char)(*__low)] & __m)) + ++__low; + return __low; + } + + const char* + ctype:: + scan_not(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high + && (_M_table[(unsigned char)(*__low)] & __m) != 0) + ++__low; + return __low; + } + + + + + diff --git a/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_noninline.h b/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_noninline.h new file mode 100644 index 000000000000..f760ac934ae6 --- /dev/null +++ b/libstdc++-v3/config/os/solaris/solaris2.6/bits/ctype_noninline.h @@ -0,0 +1,71 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 1997-1999, 2000 Cygnus Solutions +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h + + ctype::ctype(const mask* __table = 0, bool __del = false, + size_t __refs = 0) throw() + : _Ctype_nois(__refs), _M_del(__table != 0 && __del), + _M_toupper(__trans_upper), _M_tolower(__trans_lower), + _M_ctable(__ctype_mask), _M_table(__table == 0 ? _M_ctable: __table) + { } + + char + ctype::do_toupper(char __c) const + { return _M_toupper[(int) __c]; } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_toupper[(int) *__low]; + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return _M_tolower[(int) __c]; } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_tolower[(int) *__low]; + ++__low; + } + return __high; + } diff --git a/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_base.h b/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_base.h new file mode 100644 index 000000000000..782a09b2fedf --- /dev/null +++ b/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_base.h @@ -0,0 +1,58 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 1997-1999 Cygnus Solutions +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h. Looks like this +// only works with solaris2.6 and solaris2.7, but not solaris2.5.1. + + struct ctype_base + { + typedef unsigned int mask; + // Non-standard typedefs. + typedef int* __to_type; + + enum + { + space = _ISSPACE, + print = _ISPRINT, + cntrl = _ISCNTRL, + upper = _ISUPPER, + lower = _ISLOWER, + alpha = _ISALPHA, + digit = _ISDIGIT, + punct = _ISPUNCT, + xdigit = _ISXDIGIT, + alnum = _ISALNUM, + graph = _ISGRAPH + }; + }; + diff --git a/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_inline.h b/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_inline.h new file mode 100644 index 000000000000..819fc19caed2 --- /dev/null +++ b/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_inline.h @@ -0,0 +1,73 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 2000 Cygnus Solutions +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) +// functions go in ctype.cc + + bool + ctype:: + is(mask __m, char __c) const throw() + { return _M_table[(unsigned char)(__c)] & __m; } + + const char* + ctype:: + is(const char* __low, const char* __high, mask* __vec) const throw() + { + while (__low < __high) + *__vec++ = _M_table[(unsigned char)(*__low++)]; + return __high; + } + + const char* + ctype:: + scan_is(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high && !(_M_table[(unsigned char)(*__low)] & __m)) + ++__low; + return __low; + } + + const char* + ctype:: + scan_not(mask __m, const char* __low, const char* __high) const throw() + { + while (__low < __high + && (_M_table[(unsigned char)(*__low)] & __m) != 0) + ++__low; + return __low; + } + + + + + diff --git a/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_noninline.h b/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_noninline.h new file mode 100644 index 000000000000..348495ecefb5 --- /dev/null +++ b/libstdc++-v3/config/os/solaris/solaris2.7/bits/ctype_noninline.h @@ -0,0 +1,73 @@ +// Locale support -*- C++ -*- + +// Copyright (C) 1997-1999, 2000 Cygnus Solutions +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 2, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING. If not, write to the Free +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, +// USA. + +// As a special exception, you may use this file as part of a free software +// library without restriction. Specifically, if other files instantiate +// templates or use macros or inline functions from this file, or you compile +// this file and link it with other files to produce an executable, this +// file does not by itself cause the resulting executable to be covered by +// the GNU General Public License. This exception does not however +// invalidate any other reasons why the executable file might be covered by +// the GNU General Public License. + +// +// ISO C++ 14882: 22.1 Locales +// + +// Information as gleaned from /usr/include/ctype.h + + ctype::ctype(const mask* __table = 0, bool __del = false, + size_t __refs = 0) throw() + : _Ctype_nois(__refs), _M_del(__table != 0 && __del), + _M_toupper(__trans_upper), _M_tolower(__trans_lower), + _M_ctable(__ctype_mask), _M_table(__table == 0 ? _M_ctable: __table) + { } + + char + ctype::do_toupper(char __c) const + { return _M_toupper[(int) __c]; } + + const char* + ctype::do_toupper(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_toupper[(int) *__low]; + ++__low; + } + return __high; + } + + char + ctype::do_tolower(char __c) const + { return _M_tolower[(int) __c]; } + + const char* + ctype::do_tolower(char* __low, const char* __high) const + { + while (__low < __high) + { + *__low = _M_tolower[(int) *__low]; + ++__low; + } + return __high; + } + + -- 2.43.5