summaryrefslogtreecommitdiffstats
path: root/5/sources/cxx-stl/stlport/stlport/stl/c_locale.h
blob: cadd2bc1023755255b2ec5643c0017e6d1ae9318 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
/*
 * Copyright (c) 1999
 * Silicon Graphics Computer Systems, Inc.
 *
 * Copyright (c) 1999
 * Boris Fomitchev
 *
 * This material is provided "as is", with absolutely no warranty expressed
 * or implied. Any use is at your own risk.
 *
 * Permission to use or copy this software for any purpose is hereby granted
 * without fee, provided the above notices are retained on all copies.
 * Permission to modify the code and to distribute modified code is granted,
 * provided the above notices are retained, and a notice that the code was
 * modified is included with the above copyright notice.
 *
 */

#ifndef _STLP_C_LOCALE_H
#define _STLP_C_LOCALE_H

/*
 * Implementation dependent definitions.
 * Beware: This header is not a purely internal header, it is also included
 * from the outside world when building the STLport library. So this header
 * should not reference internal headers (stlport/stl/_*.h) directly.
 */
#if defined (__sgi)
#  if defined (ROOT_65) /* IRIX 6.5.x */
#    include <sgidefs.h>
#    include <standards.h>
#    include <wchar.h>
#    include <ctype.h>
#  else /* IRIX pre-6.5 */
#    include <sgidefs.h>
#    include <standards.h>
#    if !defined(_SIZE_T) && !defined(_SIZE_T_)
#      define _SIZE_T
#      if (_MIPS_SZLONG == 32)
typedef unsigned int size_t;
#      endif
#      if (_MIPS_SZLONG == 64)
typedef unsigned long size_t;
#      endif
#    endif
#    if !defined (_WCHAR_T)
#      define _WCHAR_T
#      if (_MIPS_SZLONG == 32)
typedef long wchar_t;
#      endif
#      if (_MIPS_SZLONG == 64)
typedef __int32_t wchar_t;
#      endif
#    endif /* _WCHAR_T */
#    if !defined (_WINT_T)
#      define _WINT_T
#      if (_MIPS_SZLONG == 32)
typedef long wint_t;
#      endif
#      if (_MIPS_SZLONG == 64)
typedef __int32_t wint_t;
#      endif
#    endif /* _WINT_T */
#    if !defined (_MBSTATE_T)
#      define _MBSTATE_T
/* _MSC_VER check is here for historical reason and seems wrong as it is the macro defined
 * by Microsoft compilers to give their version. But we are in a SGI platform section so it
 * is weird. However _MSC_VER might also be a SGI compiler macro so we keep it this way.*/
#      if defined (_MSC_VER)
typedef int mbstate_t;
#      else
typedef char mbstate_t;
#      endif
#    endif /* _MBSTATE_T */
#  endif /* ROOT65 */
#elif defined (_STLP_USE_GLIBC)
#  include <ctype.h>
#endif

/*
 * GENERAL FRAMEWORK
 */

/*
 * Opaque types, implementation (if there is one) depends
 * on platform localisation API.
 */
struct _Locale_ctype;
struct _Locale_codecvt;
struct _Locale_numeric;
struct _Locale_time;
struct _Locale_collate;
struct _Locale_monetary;
struct _Locale_messages;

/*
  Bitmask macros.
*/

/*
 * For narrow characters, we expose the lookup table interface.
 */

#if defined (_STLP_USE_GLIBC)
/* This section uses macros defined in the gnu libc ctype.h header */
#  define _Locale_CNTRL  _IScntrl
#  define _Locale_UPPER  _ISupper
#  define _Locale_LOWER  _ISlower
#  define _Locale_DIGIT  _ISdigit
#  define _Locale_XDIGIT _ISxdigit
#  define _Locale_PUNCT  _ISpunct
#  define _Locale_SPACE  _ISspace
#  define _Locale_PRINT  _ISprint
#  define _Locale_ALPHA  _ISalpha
#else
/* Default values based on C++ Standard 22.2.1.
 * Under Windows the localisation implementation take care of mapping its
 * mask values to those internal values. For other platforms without real
 * localization support we are free to use the most suitable values.*/
#  define _Locale_SPACE  0x0001
#  define _Locale_PRINT  0x0002
#  define _Locale_CNTRL  0x0004
#  define _Locale_UPPER  0x0008
#  define _Locale_LOWER  0x0010
#  define _Locale_ALPHA  0x0020
#  define _Locale_DIGIT  0x0040
#  define _Locale_PUNCT  0x0080
#  define _Locale_XDIGIT 0x0100
#endif

#endif /* _STLP_C_LOCALE_H */