1169691Skan// Locale support -*- C++ -*-
2169691Skan
3169691Skan// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
4169691Skan//
5169691Skan// This file is part of the GNU ISO C++ Library.  This library is free
6169691Skan// software; you can redistribute it and/or modify it under the
7169691Skan// terms of the GNU General Public License as published by the
8169691Skan// Free Software Foundation; either version 2, or (at your option)
9169691Skan// any later version.
10169691Skan
11169691Skan// This library is distributed in the hope that it will be useful,
12169691Skan// but WITHOUT ANY WARRANTY; without even the implied warranty of
13169691Skan// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14169691Skan// GNU General Public License for more details.
15169691Skan
16169691Skan// You should have received a copy of the GNU General Public License along
17169691Skan// with this library; see the file COPYING.  If not, write to the Free
18169691Skan// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
19169691Skan// USA.
20169691Skan
21169691Skan// As a special exception, you may use this file as part of a free software
22169691Skan// library without restriction.  Specifically, if other files instantiate
23169691Skan// templates or use macros or inline functions from this file, or you compile
24169691Skan// this file and link it with other files to produce an executable, this
25169691Skan// file does not by itself cause the resulting executable to be covered by
26169691Skan// the GNU General Public License.  This exception does not however
27169691Skan// invalidate any other reasons why the executable file might be covered by
28169691Skan// the GNU General Public License.
29169691Skan
30169691Skan/** @file ctype_noninline.h
31169691Skan *  This is an internal header file, included by other library headers.
32169691Skan *  You should not attempt to use it directly.
33169691Skan */
34169691Skan
35169691Skan//
36169691Skan// ISO C++ 14882: 22.1  Locales
37169691Skan//
38169691Skan
39169691Skan// Information as gleaned from /usr/include/ctype.h
40169691Skan
41169691Skan  const ctype_base::mask*
42169691Skan  ctype<char>::classic_table() throw()
43169691Skan  { return 0; }
44169691Skan
45169691Skan  ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
46169691Skan		     size_t __refs)
47169691Skan  : facet(__refs), _M_del(__table != 0 && __del),
48169691Skan  _M_toupper(NULL), _M_tolower(NULL),
49169691Skan  _M_table(__table ? __table : classic_table())
50169691Skan  {
51169691Skan    memset(_M_widen, 0, sizeof(_M_widen));
52169691Skan    _M_widen_ok = 0;
53169691Skan    memset(_M_narrow, 0, sizeof(_M_narrow));
54169691Skan    _M_narrow_ok = 0;
55169691Skan  }
56169691Skan
57169691Skan  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
58169691Skan  : facet(__refs), _M_del(__table != 0 && __del),
59169691Skan  _M_toupper(NULL), _M_tolower(NULL),
60169691Skan  _M_table(__table ? __table : classic_table())
61169691Skan  {
62169691Skan    memset(_M_widen, 0, sizeof(_M_widen));
63169691Skan    _M_widen_ok = 0;
64169691Skan    memset(_M_narrow, 0, sizeof(_M_narrow));
65169691Skan    _M_narrow_ok = 0;
66169691Skan  }
67169691Skan
68169691Skan  char
69169691Skan  ctype<char>::do_toupper(char __c) const
70169691Skan  { return ::toupper((int) __c); }
71169691Skan
72169691Skan  const char*
73169691Skan  ctype<char>::do_toupper(char* __low, const char* __high) const
74169691Skan  {
75169691Skan    while (__low < __high)
76169691Skan      {
77169691Skan	*__low = ::toupper((int) *__low);
78169691Skan	++__low;
79169691Skan      }
80169691Skan    return __high;
81169691Skan  }
82169691Skan
83169691Skan  char
84169691Skan  ctype<char>::do_tolower(char __c) const
85169691Skan  { return ::tolower((int) __c); }
86169691Skan
87169691Skan  const char*
88169691Skan  ctype<char>::do_tolower(char* __low, const char* __high) const
89169691Skan  {
90169691Skan    while (__low < __high)
91169691Skan      {
92169691Skan	*__low = ::tolower((int) *__low);
93169691Skan	++__low;
94169691Skan      }
95169691Skan    return __high;
96169691Skan  }
97