1fdc4107cSJohn Marino // Locale support -*- C++ -*-
2fdc4107cSJohn Marino 
3fdc4107cSJohn Marino // Copyright (C) 2000, 2003, 2009, 2010 Free Software Foundation, Inc.
4fdc4107cSJohn Marino //
5fdc4107cSJohn Marino // This file is part of the GNU ISO C++ Library.  This library is free
6fdc4107cSJohn Marino // software; you can redistribute it and/or modify it under the
7fdc4107cSJohn Marino // terms of the GNU General Public License as published by the
8fdc4107cSJohn Marino // Free Software Foundation; either version 3, or (at your option)
9fdc4107cSJohn Marino // any later version.
10fdc4107cSJohn Marino 
11fdc4107cSJohn Marino // This library is distributed in the hope that it will be useful,
12fdc4107cSJohn Marino // but WITHOUT ANY WARRANTY; without even the implied warranty of
13fdc4107cSJohn Marino // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14fdc4107cSJohn Marino // GNU General Public License for more details.
15fdc4107cSJohn Marino 
16fdc4107cSJohn Marino // Under Section 7 of GPL version 3, you are granted additional
17fdc4107cSJohn Marino // permissions described in the GCC Runtime Library Exception, version
18fdc4107cSJohn Marino // 3.1, as published by the Free Software Foundation.
19fdc4107cSJohn Marino 
20fdc4107cSJohn Marino // You should have received a copy of the GNU General Public License and
21fdc4107cSJohn Marino // a copy of the GCC Runtime Library Exception along with this program;
22fdc4107cSJohn Marino // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
23fdc4107cSJohn Marino // <http://www.gnu.org/licenses/>.
24fdc4107cSJohn Marino 
25fdc4107cSJohn Marino //
26fdc4107cSJohn Marino // ISO C++ 14882: 22.1  Locales
27fdc4107cSJohn Marino //
28fdc4107cSJohn Marino 
29fdc4107cSJohn Marino // Information as gleaned from /usr/include/ctype.h on DragonFly.
30fdc4107cSJohn Marino 
_GLIBCXX_VISIBILITY(default)31fdc4107cSJohn Marino namespace std _GLIBCXX_VISIBILITY(default)
32fdc4107cSJohn Marino {
33fdc4107cSJohn Marino _GLIBCXX_BEGIN_NAMESPACE_VERSION
34fdc4107cSJohn Marino 
35fdc4107cSJohn Marino   /// @brief  Base class for ctype.
36fdc4107cSJohn Marino   struct ctype_base
37fdc4107cSJohn Marino   {
38fdc4107cSJohn Marino     // Non-standard typedefs.
39ae13b2e5SJohn Marino     typedef const int*		__to_type;
40fdc4107cSJohn Marino 
41fdc4107cSJohn Marino     // NB: Offsets into ctype<char>::_M_table force a particular size
42fdc4107cSJohn Marino     // on the mask type. Because of this, we don't use an enum.
43*0d5acd74SJohn Marino #ifdef _CTYPE_S
44*0d5acd74SJohn Marino     // DragonFly 3.6 and later
45*0d5acd74SJohn Marino     typedef unsigned long 	mask;
46*0d5acd74SJohn Marino     static const mask upper	= _CTYPE_U;
47*0d5acd74SJohn Marino     static const mask lower 	= _CTYPE_L;
48*0d5acd74SJohn Marino     static const mask alpha 	= _CTYPE_A;
49*0d5acd74SJohn Marino     static const mask digit 	= _CTYPE_D;
50*0d5acd74SJohn Marino     static const mask xdigit 	= _CTYPE_X;
51*0d5acd74SJohn Marino     static const mask space 	= _CTYPE_S;
52*0d5acd74SJohn Marino     static const mask print 	= _CTYPE_R;
53*0d5acd74SJohn Marino     static const mask graph 	= _CTYPE_A | _CTYPE_D | _CTYPE_P;
54*0d5acd74SJohn Marino     static const mask cntrl 	= _CTYPE_C;
55*0d5acd74SJohn Marino     static const mask punct 	= _CTYPE_P;
56*0d5acd74SJohn Marino     static const mask alnum 	= _CTYPE_A | _CTYPE_D;
57*0d5acd74SJohn Marino #else
58*0d5acd74SJohn Marino     // DragonFly 3.4 and older
59fdc4107cSJohn Marino     typedef uint16_t		mask;
60fdc4107cSJohn Marino     static const mask upper	= _CTYPEMASK_U;
61fdc4107cSJohn Marino     static const mask lower	= _CTYPEMASK_L;
62fdc4107cSJohn Marino     static const mask alpha	= _CTYPEMASK_A;
63fdc4107cSJohn Marino     static const mask digit	= _CTYPEMASK_D;
64fdc4107cSJohn Marino     static const mask xdigit	= _CTYPEMASK_X;
65fdc4107cSJohn Marino     static const mask space	= _CTYPEMASK_S;
66fdc4107cSJohn Marino     static const mask print	= _CTYPEMASK_R;
67fdc4107cSJohn Marino     static const mask graph	= _CTYPEMASK_G;
68fdc4107cSJohn Marino     static const mask cntrl	= _CTYPEMASK_C;
69fdc4107cSJohn Marino     static const mask punct	= _CTYPEMASK_P;
70fdc4107cSJohn Marino     static const mask alnum	= _CTYPEMASK_A | _CTYPEMASK_D;
71*0d5acd74SJohn Marino #endif
72fdc4107cSJohn Marino   };
73fdc4107cSJohn Marino 
74fdc4107cSJohn Marino _GLIBCXX_END_NAMESPACE_VERSION
75fdc4107cSJohn Marino } // namespace
76