xref: /reactos/sdk/include/c++/stlport/stl/c_locale.h (revision c2c66aff)
1*c2c66affSColin Finck /*
2*c2c66affSColin Finck  * Copyright (c) 1999
3*c2c66affSColin Finck  * Silicon Graphics Computer Systems, Inc.
4*c2c66affSColin Finck  *
5*c2c66affSColin Finck  * Copyright (c) 1999
6*c2c66affSColin Finck  * Boris Fomitchev
7*c2c66affSColin Finck  *
8*c2c66affSColin Finck  * This material is provided "as is", with absolutely no warranty expressed
9*c2c66affSColin Finck  * or implied. Any use is at your own risk.
10*c2c66affSColin Finck  *
11*c2c66affSColin Finck  * Permission to use or copy this software for any purpose is hereby granted
12*c2c66affSColin Finck  * without fee, provided the above notices are retained on all copies.
13*c2c66affSColin Finck  * Permission to modify the code and to distribute modified code is granted,
14*c2c66affSColin Finck  * provided the above notices are retained, and a notice that the code was
15*c2c66affSColin Finck  * modified is included with the above copyright notice.
16*c2c66affSColin Finck  *
17*c2c66affSColin Finck  */
18*c2c66affSColin Finck 
19*c2c66affSColin Finck #ifndef _STLP_C_LOCALE_H
20*c2c66affSColin Finck #define _STLP_C_LOCALE_H
21*c2c66affSColin Finck 
22*c2c66affSColin Finck /*
23*c2c66affSColin Finck  * Implementation dependent definitions.
24*c2c66affSColin Finck  * Beware: This header is not a purely internal header, it is also included
25*c2c66affSColin Finck  * from the outside world when building the STLport library. So this header
26*c2c66affSColin Finck  * should not reference internal headers (stlport/stl/_*.h) directly.
27*c2c66affSColin Finck  */
28*c2c66affSColin Finck #if defined (__sgi)
29*c2c66affSColin Finck #  if defined (ROOT_65) /* IRIX 6.5.x */
30*c2c66affSColin Finck #    include <sgidefs.h>
31*c2c66affSColin Finck #    include <standards.h>
32*c2c66affSColin Finck #    include <wchar.h>
33*c2c66affSColin Finck #    include <ctype.h>
34*c2c66affSColin Finck #  else /* IRIX pre-6.5 */
35*c2c66affSColin Finck #    include <sgidefs.h>
36*c2c66affSColin Finck #    include <standards.h>
37*c2c66affSColin Finck #    if !defined(_SIZE_T) && !defined(_SIZE_T_)
38*c2c66affSColin Finck #      define _SIZE_T
39*c2c66affSColin Finck #      if (_MIPS_SZLONG == 32)
40*c2c66affSColin Finck typedef unsigned int size_t;
41*c2c66affSColin Finck #      endif
42*c2c66affSColin Finck #      if (_MIPS_SZLONG == 64)
43*c2c66affSColin Finck typedef unsigned long size_t;
44*c2c66affSColin Finck #      endif
45*c2c66affSColin Finck #    endif
46*c2c66affSColin Finck #    if !defined (_WCHAR_T)
47*c2c66affSColin Finck #      define _WCHAR_T
48*c2c66affSColin Finck #      if (_MIPS_SZLONG == 32)
49*c2c66affSColin Finck typedef long wchar_t;
50*c2c66affSColin Finck #      endif
51*c2c66affSColin Finck #      if (_MIPS_SZLONG == 64)
52*c2c66affSColin Finck typedef __int32_t wchar_t;
53*c2c66affSColin Finck #      endif
54*c2c66affSColin Finck #    endif /* _WCHAR_T */
55*c2c66affSColin Finck #    if !defined (_WINT_T)
56*c2c66affSColin Finck #      define _WINT_T
57*c2c66affSColin Finck #      if (_MIPS_SZLONG == 32)
58*c2c66affSColin Finck typedef long wint_t;
59*c2c66affSColin Finck #      endif
60*c2c66affSColin Finck #      if (_MIPS_SZLONG == 64)
61*c2c66affSColin Finck typedef __int32_t wint_t;
62*c2c66affSColin Finck #      endif
63*c2c66affSColin Finck #    endif /* _WINT_T */
64*c2c66affSColin Finck #    if !defined (_MBSTATE_T)
65*c2c66affSColin Finck #      define _MBSTATE_T
66*c2c66affSColin Finck /* _MSC_VER check is here for historical reason and seems wrong as it is the macro defined
67*c2c66affSColin Finck  * by Microsoft compilers to give their version. But we are in a SGI platform section so it
68*c2c66affSColin Finck  * is weird. However _MSC_VER might also be a SGI compiler macro so we keep it this way.*/
69*c2c66affSColin Finck #      if defined (_MSC_VER)
70*c2c66affSColin Finck typedef int mbstate_t;
71*c2c66affSColin Finck #      else
72*c2c66affSColin Finck typedef char mbstate_t;
73*c2c66affSColin Finck #      endif
74*c2c66affSColin Finck #    endif /* _MBSTATE_T */
75*c2c66affSColin Finck #  endif /* ROOT65 */
76*c2c66affSColin Finck #elif defined (_STLP_USE_GLIBC)
77*c2c66affSColin Finck #  include <ctype.h>
78*c2c66affSColin Finck #endif
79*c2c66affSColin Finck 
80*c2c66affSColin Finck /*
81*c2c66affSColin Finck  * GENERAL FRAMEWORK
82*c2c66affSColin Finck  */
83*c2c66affSColin Finck 
84*c2c66affSColin Finck /*
85*c2c66affSColin Finck  * Opaque types, implementation (if there is one) depends
86*c2c66affSColin Finck  * on platform localisation API.
87*c2c66affSColin Finck  */
88*c2c66affSColin Finck struct _Locale_ctype;
89*c2c66affSColin Finck struct _Locale_codecvt;
90*c2c66affSColin Finck struct _Locale_numeric;
91*c2c66affSColin Finck struct _Locale_time;
92*c2c66affSColin Finck struct _Locale_collate;
93*c2c66affSColin Finck struct _Locale_monetary;
94*c2c66affSColin Finck struct _Locale_messages;
95*c2c66affSColin Finck 
96*c2c66affSColin Finck /*
97*c2c66affSColin Finck   Bitmask macros.
98*c2c66affSColin Finck */
99*c2c66affSColin Finck 
100*c2c66affSColin Finck /*
101*c2c66affSColin Finck  * For narrow characters, we expose the lookup table interface.
102*c2c66affSColin Finck  */
103*c2c66affSColin Finck 
104*c2c66affSColin Finck #if defined (_STLP_USE_GLIBC)
105*c2c66affSColin Finck /* This section uses macros defined in the gnu libc ctype.h header */
106*c2c66affSColin Finck #  define _Locale_CNTRL  _IScntrl
107*c2c66affSColin Finck #  define _Locale_UPPER  _ISupper
108*c2c66affSColin Finck #  define _Locale_LOWER  _ISlower
109*c2c66affSColin Finck #  define _Locale_DIGIT  _ISdigit
110*c2c66affSColin Finck #  define _Locale_XDIGIT _ISxdigit
111*c2c66affSColin Finck #  define _Locale_PUNCT  _ISpunct
112*c2c66affSColin Finck #  define _Locale_SPACE  _ISspace
113*c2c66affSColin Finck #  define _Locale_PRINT  _ISprint
114*c2c66affSColin Finck #  define _Locale_ALPHA  _ISalpha
115*c2c66affSColin Finck #else
116*c2c66affSColin Finck /* Default values based on C++ Standard 22.2.1.
117*c2c66affSColin Finck  * Under Windows the localisation implementation take care of mapping its
118*c2c66affSColin Finck  * mask values to those internal values. For other platforms without real
119*c2c66affSColin Finck  * localization support we are free to use the most suitable values.*/
120*c2c66affSColin Finck #  define _Locale_SPACE  0x0001
121*c2c66affSColin Finck #  define _Locale_PRINT  0x0002
122*c2c66affSColin Finck #  define _Locale_CNTRL  0x0004
123*c2c66affSColin Finck #  define _Locale_UPPER  0x0008
124*c2c66affSColin Finck #  define _Locale_LOWER  0x0010
125*c2c66affSColin Finck #  define _Locale_ALPHA  0x0020
126*c2c66affSColin Finck #  define _Locale_DIGIT  0x0040
127*c2c66affSColin Finck #  define _Locale_PUNCT  0x0080
128*c2c66affSColin Finck #  define _Locale_XDIGIT 0x0100
129*c2c66affSColin Finck #endif
130*c2c66affSColin Finck 
131*c2c66affSColin Finck #endif /* _STLP_C_LOCALE_H */
132