1.1 --- a/epoc32/include/stdapis/stlport/stl/c_locale.h Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/stdapis/stlport/stl/c_locale.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,459 @@
1.4 -c_locale.h
1.5 +/*
1.6 + * © Portions copyright (c) 2006-2007 Nokia Corporation. All rights reserved.
1.7 + *
1.8 + * Copyright (c) 1999
1.9 + * Silicon Graphics Computer Systems, Inc.
1.10 + *
1.11 + * Copyright (c) 1999
1.12 + * Boris Fomitchev
1.13 + *
1.14 + * This material is provided "as is", with absolutely no warranty expressed
1.15 + * or implied. Any use is at your own risk.
1.16 + *
1.17 + * Permission to use or copy this software for any purpose is hereby granted
1.18 + * without fee, provided the above notices are retained on all copies.
1.19 + * Permission to modify the code and to distribute modified code is granted,
1.20 + * provided the above notices are retained, and a notice that the code was
1.21 + * modified is included with the above copyright notice.
1.22 + *
1.23 + */
1.24 +
1.25 +
1.26 +#ifndef _STLP_C_LOCALE_H
1.27 +# define _STLP_C_LOCALE_H
1.28 +
1.29 +/*
1.30 + * Implementation dependent definitions
1.31 + */
1.32 +#ifdef __cplusplus
1.33 +# include <stl/_config.h>
1.34 +#endif
1.35 +
1.36 +#if defined(__sgi)
1.37 +# if defined(ROOT_65) /* IRIX 6.5.x */
1.38 +# include <sgidefs.h>
1.39 +# include <standards.h>
1.40 +# include <wchar.h>
1.41 +# include <ctype.h>
1.42 +
1.43 +# else
1.44 + /* IRIX pre-6.5 */
1.45 +# include <sgidefs.h>
1.46 +# include <standards.h>
1.47 +
1.48 +# if !defined(_SIZE_T) && !defined(_SIZE_T_)
1.49 +# define _SIZE_T
1.50 +# if (_MIPS_SZLONG == 32)
1.51 +typedef unsigned int size_t;
1.52 +# endif
1.53 +# if (_MIPS_SZLONG == 64)
1.54 +typedef unsigned long size_t;
1.55 +# endif
1.56 +# endif
1.57 +
1.58 +# ifndef _WCHAR_T
1.59 +# define _WCHAR_T
1.60 +# if (_MIPS_SZLONG == 32)
1.61 +typedef long wchar_t;
1.62 +# endif
1.63 +# if (_MIPS_SZLONG == 64)
1.64 +typedef __int32_t wchar_t;
1.65 +# endif
1.66 +# endif /* _WCHAR_T */
1.67 +
1.68 +# ifndef _WINT_T
1.69 +# define _WINT_T
1.70 +# if (_MIPS_SZLONG == 32)
1.71 + typedef long wint_t;
1.72 +# endif
1.73 +# if (_MIPS_SZLONG == 64)
1.74 + typedef __int32_t wint_t;
1.75 +# endif
1.76 +# endif /* _WINT_T */
1.77 +
1.78 +# ifndef _MBSTATE_T
1.79 +# define _MBSTATE_T
1.80 +# ifdef _MSC_VER
1.81 + typedef int mbstate_t;
1.82 +# else
1.83 + typedef char mbstate_t;
1.84 +# endif
1.85 +# endif /* _MBSTATE_T */
1.86 +
1.87 +# endif /* ROOT65 */
1.88 +
1.89 +# else /* __sgi */
1.90 +
1.91 +# ifdef __cplusplus
1.92 +# ifndef _STLP_CSTDDEF
1.93 +# include <cstddef>
1.94 +# endif
1.95 +# ifndef _STLP_CWCHAR_H
1.96 +# include <stl/_cwchar.h>
1.97 +# endif
1.98 +# ifndef _STLP_CCTYPE
1.99 +# include <cctype>
1.100 +# endif
1.101 +# else
1.102 +# include <stddef.h>
1.103 +# include <wchar.h>
1.104 +# include <ctype.h>
1.105 +# endif
1.106 +
1.107 +#endif /* __sgi */
1.108 +
1.109 +/*
1.110 + * GENERAL FRAMEWORK
1.111 + */
1.112 +
1.113 +struct _Locale_ctype;
1.114 +struct _Locale_numeric;
1.115 +struct _Locale_time;
1.116 +struct _Locale_collate;
1.117 +struct _Locale_monetary;
1.118 +struct _Locale_messages;
1.119 +
1.120 +/*
1.121 + Bitmask macros.
1.122 +*/
1.123 +
1.124 +/*
1.125 + * For narrow characters, we expose the lookup table interface.
1.126 + */
1.127 +
1.128 +/* Internal bitmask macros, os-specific. */
1.129 +
1.130 +#if defined(__sgi) /* IRIX */
1.131 +
1.132 +#define _Locale_S 0x00000008 /* Spacing character */
1.133 +#define _Locale_A 0x00004000 /* Alphabetical characters only */
1.134 +#define _Locale_B 0x00000040 /* Obsolete: was space char only */
1.135 +#define _Locale_PR 0x00008000 /* Printable characters only */
1.136 +#define _Locale_G 0x40000000 /* Graphic characters only */
1.137 +#define _Locale_BL 0x80000000 /* The blank character class */
1.138 +
1.139 +/* Public bitmask macros, must be defined for every OS. These values, of
1.140 + * course, are specific to IRIX. */
1.141 +
1.142 +#define _Locale_CNTRL 0x00000020 /* Control character */
1.143 +#define _Locale_UPPER 0x00000001 /* Upper case */
1.144 +#define _Locale_LOWER 0x00000002 /* Lower case */
1.145 +#define _Locale_DIGIT 0x00000004 /* Numeral (digit) */
1.146 +#define _Locale_XDIGIT 0x00000080 /* heXadecimal digit */
1.147 +#define _Locale_PUNCT 0x00000010 /* Punctuation */
1.148 +#define _Locale_SPACE (_Locale_S | _Locale_BL)
1.149 +#define _Locale_PRINT (_Locale_PUNCT | _Locale_UPPER | _Locale_LOWER | \
1.150 + _Locale_DIGIT | _Locale_A | _Locale_XDIGIT | \
1.151 + _Locale_PR)
1.152 +#define _Locale_ALPHA _Locale_A
1.153 +
1.154 +/*
1.155 +* All of these except for graph and blank are from the C standard;
1.156 +* graph and blank are XPG4. (graph in XPG4 doesn't mean quite the
1.157 +* same thing as graph in the C++ library)
1.158 +*/
1.159 +
1.160 +#endif /* IRIX */
1.161 +
1.162 +
1.163 +#if defined( __Lynx__ )
1.164 + /* azov: On Lynx isalpha defined as (_U | _L), which gives us a mask
1.165 + * unusable in ctype_table. So we have to redefine it and use hard-coded
1.166 + * numbers (to avoid potential clashes if system headers change).
1.167 + *
1.168 + * P.S. Actually, I see no reason in using platform-specific masks -
1.169 + * having just one set of masks for all platforms should work just as
1.170 + * well - we only use them internally and they don't have to be equal
1.171 + * to whatever defined in local ctype.h
1.172 + *
1.173 + */
1.174 +# define _Locale_CNTRL 040 /* _C, Control character */
1.175 +# define _Locale_UPPER 01 /* _U, Upper case */
1.176 +# define _Locale_LOWER 02 /* _L, Lower case */
1.177 +# define _Locale_DIGIT 04 /* _N, Numeral (digit) */
1.178 +# define _Locale_XDIGIT 0200 /* _X, heXadecimal digit */
1.179 +# define _Locale_PUNCT 020 /* _P, Punctuation */
1.180 +# define _Locale_SPACE 010 /* _S, Spacing */
1.181 +# define _Locale_ALPHA 040000 /* none, Alphanumerical */
1.182 +# define _Locale_PRINT (_Locale_PUNCT | _Locale_UPPER | _Locale_LOWER | \
1.183 + _Locale_DIGIT | _Locale_ALPHA | _Locale_XDIGIT |\
1.184 + _Locale_SPACE ) /* Printable */
1.185 +# endif /* __Lynx__ */
1.186 +
1.187 +#if defined(__GNUC__) || defined (__BORLANDC__) || defined (__COMO__)
1.188 +
1.189 +# if defined (__CYGWIN__)
1.190 +
1.191 +# define _Locale_CNTRL 040
1.192 +# define _Locale_UPPER 02
1.193 +# define _Locale_LOWER 01
1.194 +# define _Locale_DIGIT 04
1.195 +# define _Locale_XDIGIT ( 0100 | _Locale_DIGIT )
1.196 +# define _Locale_PUNCT 020
1.197 +# define _Locale_SPACE 010
1.198 +# define _Locale_ALPHA (_Locale_UPPER | _Locale_LOWER)
1.199 +# define _Locale_PRINT (_Locale_ALPHA | _Locale_DIGIT | _Locale_PUNCT | 0200 )
1.200 +
1.201 +# elif defined (__FreeBSD__)
1.202 +
1.203 +# define _Locale_CNTRL _CTYPE_C
1.204 +# define _Locale_UPPER _CTYPE_U
1.205 +# define _Locale_LOWER _CTYPE_L
1.206 +# define _Locale_DIGIT _CTYPE_D
1.207 +# define _Locale_XDIGIT _CTYPE_X
1.208 +# define _Locale_PUNCT _CTYPE_P
1.209 +# define _Locale_SPACE _CTYPE_S
1.210 +# define _Locale_PRINT _CTYPE_R
1.211 +# define _Locale_ALPHA _CTYPE_A
1.212 +
1.213 +# elif defined (__NetBSD__) || defined (__amigaos__)
1.214 +
1.215 +# define _Locale_CNTRL _C
1.216 +# define _Locale_UPPER _U
1.217 +# define _Locale_LOWER _L
1.218 +# define _Locale_DIGIT _N
1.219 +# define _Locale_XDIGIT (_N|_X)
1.220 +# define _Locale_PUNCT _P
1.221 +# define _Locale_SPACE _S
1.222 +# define _Locale_PRINT (_P|_U|_L|_N|_B)
1.223 +# define _Locale_ALPHA (_U|_L)
1.224 +# elif defined(__EMX__) /* OS/2 with emx runtime */
1.225 +# define _Locale_CNTRL _CNTRL
1.226 +# define _Locale_UPPER _UPPER
1.227 +# define _Locale_LOWER _LOWER
1.228 +# define _Locale_DIGIT _DIGIT
1.229 +# define _Locale_XDIGIT _XDIGIT
1.230 +# define _Locale_PUNCT _PUNCT
1.231 +# define _Locale_SPACE _SPACE
1.232 +# define _Locale_PRINT _PRINT
1.233 +# define _Locale_ALPHA (_UPPER|_LOWER)
1.234 +
1.235 +# elif defined(_STLP_USE_GLIBC) /* linux, using the gnu compiler */
1.236 +
1.237 +/* This section uses macros defined in the gnu libc ctype.h header */
1.238 +
1.239 +# define _Locale_CNTRL _IScntrl
1.240 +# define _Locale_UPPER _ISupper
1.241 +# define _Locale_LOWER _ISlower
1.242 +# define _Locale_DIGIT _ISdigit
1.243 +# define _Locale_XDIGIT _ISxdigit
1.244 +# define _Locale_PUNCT _ISpunct
1.245 +# define _Locale_SPACE _ISspace
1.246 +# define _Locale_PRINT _ISprint
1.247 +# define _Locale_ALPHA _ISalpha
1.248 +
1.249 +# endif /* GLIBC */
1.250 +
1.251 +#endif /* gnu */
1.252 +
1.253 +#if ( defined(__sun) && defined (__SVR4) ) \
1.254 + || (defined (__digital__) && defined (__unix__)) \
1.255 + || defined(_AIX)
1.256 +/* fbp : condition from AT&T code*/
1.257 +#if !(defined(__XPG4_CHAR_CLASS__) || defined(_XPG4_2) || \
1.258 + (defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 == 4))) && ! defined (_ISCNTRL)
1.259 + /* fbp : on 2.5.1, the defines are different ;( */
1.260 + // # if ( defined (__sun) && defined (__SVR4) && ! defined (_ISCNTRL) )
1.261 +# define _ISCNTRL _C
1.262 +# define _ISUPPER _U
1.263 +# define _ISLOWER _L
1.264 +# define _ISDIGIT _N
1.265 +# define _ISXDIGIT _X
1.266 +# define _ISPUNCT _P
1.267 +# define _ISSPACE _S
1.268 +# define _ISPRINT (_P | _U | _L | _N | _B)
1.269 +# define _ISALPHA (_U | _L)
1.270 +# endif
1.271 +
1.272 +# define _Locale_CNTRL _ISCNTRL
1.273 +# define _Locale_UPPER _ISUPPER
1.274 +# define _Locale_LOWER _ISLOWER
1.275 +# define _Locale_DIGIT _ISDIGIT
1.276 +# define _Locale_XDIGIT _ISXDIGIT
1.277 +# define _Locale_PUNCT _ISPUNCT
1.278 +# define _Locale_SPACE _ISSPACE
1.279 +# define _Locale_PRINT _ISPRINT
1.280 +# define _Locale_ALPHA _ISALPHA
1.281 +# elif defined(__SYMBIAN32__)
1.282 +# define _Locale_CNTRL _CTYPE_C
1.283 +# define _Locale_UPPER _CTYPE_U
1.284 +# define _Locale_LOWER _CTYPE_L
1.285 +# define _Locale_DIGIT _CTYPE_D
1.286 +# define _Locale_XDIGIT _CTYPE_X
1.287 +# define _Locale_PUNCT _CTYPE_P
1.288 +# define _Locale_SPACE _CTYPE_S
1.289 +# define _Locale_PRINT _CTYPE_R
1.290 +# define _Locale_ALPHA _CTYPE_A
1.291 +
1.292 +#elif defined (__MWERKS__)
1.293 +# define _Locale_CNTRL __control_char
1.294 +# define _Locale_UPPER __upper_case
1.295 +# define _Locale_LOWER __lower_case
1.296 +# define _Locale_DIGIT __digit
1.297 +# define _Locale_XDIGIT __hex_digit
1.298 +# define _Locale_PUNCT __punctuation
1.299 +# define _Locale_SPACE __space_char
1.300 +# define _Locale_PRINT __printable
1.301 +# define _Locale_ALPHA __alphanumeric
1.302 +#elif defined (__BORLANDC__)
1.303 +# define _Locale_CNTRL _IS_CTL
1.304 +# define _Locale_UPPER _IS_UPP
1.305 +# define _Locale_LOWER _IS_LOW
1.306 +# define _Locale_DIGIT _IS_DIG
1.307 +# define _Locale_XDIGIT _IS_HEX
1.308 +# define _Locale_PUNCT _IS_PUN
1.309 +# define _Locale_SPACE _IS_SP
1.310 +# define _Locale_PRINT (_IS_SP|_IS_PUN|_IS_UPP|_IS_LOW|_IS_DIG)
1.311 +# define _Locale_ALPHA _IS_ALPHA
1.312 +#elif defined (_MSC_VER) || defined (__MINGW32__)
1.313 +# define _Locale_CNTRL _CONTROL
1.314 +# define _Locale_UPPER _UPPER
1.315 +# define _Locale_LOWER _LOWER
1.316 +# define _Locale_DIGIT _DIGIT
1.317 +# define _Locale_XDIGIT _HEX
1.318 +# define _Locale_PUNCT _PUNCT
1.319 +# define _Locale_SPACE _SPACE
1.320 +# define _Locale_PRINT (_ALPHA | _DIGIT | _BLANK | _PUNCT)
1.321 +// is this one has to be so complex ?
1.322 +# define _Locale_ALPHA ( _ALPHA & ~ (_UPPER | _LOWER ))
1.323 +#elif defined (__DMC__)
1.324 +# define _Locale_CNTRL _CONTROL
1.325 +# define _Locale_UPPER _UPPER
1.326 +# define _Locale_LOWER _LOWER
1.327 +# define _Locale_DIGIT _DIGIT
1.328 +# define _Locale_XDIGIT _HEX
1.329 +# define _Locale_PUNCT _PUNCT
1.330 +# define _Locale_SPACE _SPACE
1.331 +# define _Locale_PRINT (_UPPER | _LOWER | _DIGIT | _PUNCT | _SPACE)
1.332 +# define _Locale_ALPHA _ALPHA
1.333 +#elif defined(__MRC__) || defined(__SC__) //*TY 02/24/2000 - added support for MPW
1.334 +# define _Locale_CNTRL _CTL
1.335 +# define _Locale_UPPER _UPP
1.336 +# define _Locale_LOWER _LOW
1.337 +# define _Locale_DIGIT _DIG
1.338 +# define _Locale_XDIGIT _HEX
1.339 +# define _Locale_PUNCT _PUN
1.340 +# define _Locale_SPACE _BLA
1.341 +# define _Locale_PRINT (_UPP | _LOW | _DIG | _PUN | _BLA)
1.342 +# define _Locale_ALPHA (_UPP | _LOW)
1.343 +#elif defined(__MLCCPP__)
1.344 +# define _Locale_CNTRL 1
1.345 +# define _Locale_UPPER 2
1.346 +# define _Locale_LOWER 4
1.347 +# define _Locale_DIGIT 8
1.348 +# define _Locale_XDIGIT 16
1.349 +# define _Locale_PUNCT 32
1.350 +# define _Locale_SPACE 64
1.351 +# define _Locale_PRINT 128
1.352 +# define _Locale_ALPHA 256
1.353 +
1.354 +# elif defined (__GNUC__) && defined (__APPLE__)
1.355 +
1.356 +# define _Locale_CNTRL _C
1.357 +# define _Locale_UPPER _U
1.358 +# define _Locale_LOWER _L
1.359 +# define _Locale_DIGIT _D
1.360 +# define _Locale_XDIGIT _X
1.361 +# define _Locale_PUNCT _P
1.362 +# define _Locale_SPACE _S
1.363 +# define _Locale_PRINT _R
1.364 +# define _Locale_ALPHA _A
1.365 +
1.366 +# elif defined (__hpux) || defined (__osf__)
1.367 +
1.368 +# if defined(__HP_aCC) && !defined(_INCLUDE_HPUX_SOURCE)
1.369 +# define _ISALPHA 0x001
1.370 +# define _ISALNUM 0x002
1.371 +# define _ISBLANK 0x004
1.372 +# define _ISCNTRL 0x008
1.373 +# define _ISDIGIT 0x010
1.374 +# define _ISGRAPH 0x020
1.375 +# define _ISLOWER 0x040
1.376 +# define _ISPRINT 0x080
1.377 +# define _ISPUNCT 0x100
1.378 +# define _ISSPACE 0x200
1.379 +# define _ISUPPER 0x400
1.380 +# define _ISXDIGIT 0x800
1.381 +# endif
1.382 +# define _Locale_CNTRL _ISCNTRL
1.383 +# define _Locale_UPPER _ISUPPER
1.384 +# define _Locale_LOWER _ISLOWER
1.385 +# define _Locale_DIGIT _ISDIGIT
1.386 +# define _Locale_XDIGIT _ISXDIGIT
1.387 +# define _Locale_PUNCT _ISPUNCT
1.388 +# define _Locale_SPACE _ISSPACE
1.389 +# define _Locale_PRINT _ISPRINT
1.390 +# define _Locale_ALPHA _ISALPHA
1.391 +# elif defined (__MVS__) || defined(__OS400__)
1.392 +# define _Locale_CNTRL __ISCNTRL
1.393 +# define _Locale_UPPER __ISUPPER
1.394 +# define _Locale_LOWER __ISLOWER
1.395 +# define _Locale_DIGIT __ISDIGIT
1.396 +# define _Locale_XDIGIT __ISXDIGIT
1.397 +# define _Locale_PUNCT __ISPUNCT
1.398 +# define _Locale_SPACE __ISSPACE
1.399 +# define _Locale_PRINT __ISPRINT
1.400 +# define _Locale_ALPHA __ISALPHA
1.401 +# elif defined (__QNXNTO__) || defined (__WATCOMC__)
1.402 +# define _Locale_CNTRL _CNTRL
1.403 +# define _Locale_UPPER _UPPER
1.404 +# define _Locale_LOWER _LOWER
1.405 +# define _Locale_DIGIT _DIGIT
1.406 +# define _Locale_XDIGIT _XDIGT
1.407 +# define _Locale_PUNCT _PUNCT
1.408 +# define _Locale_SPACE _SPACE
1.409 +# define _Locale_PRINT _PRINT
1.410 +# define _Locale_ALPHA (_UPPER | _LOWER)
1.411 +#elif defined (__DJGPP)
1.412 +# define _Locale_CNTRL __dj_ISCNTRL
1.413 +# define _Locale_UPPER __dj_ISUPPER
1.414 +# define _Locale_LOWER __dj_ISLOWER
1.415 +# define _Locale_DIGIT __dj_ISDIGIT
1.416 +# define _Locale_XDIGIT __dj_ISXDIGIT
1.417 +# define _Locale_PUNCT __dj_ISPUNCT
1.418 +# define _Locale_SPACE __dj_ISSPACE
1.419 +# define _Locale_PRINT __dj_ISPRINT
1.420 +# define _Locale_ALPHA __dj_ISALPHA
1.421 +#elif defined (_STLP_SCO_OPENSERVER)
1.422 +# define _Locale_CNTRL _C
1.423 +# define _Locale_UPPER _U
1.424 +# define _Locale_LOWER _L
1.425 +# define _Locale_DIGIT _N
1.426 +# define _Locale_XDIGIT _X
1.427 +# define _Locale_PUNCT _P
1.428 +# define _Locale_SPACE _S
1.429 +# define _Locale_PRINT _R
1.430 +# define _Locale_ALPHA _A
1.431 +#elif defined (__NCR_SVR)
1.432 +# define _Locale_CNTRL _C
1.433 +# define _Locale_UPPER _U
1.434 +# define _Locale_LOWER _L
1.435 +# define _Locale_DIGIT _N
1.436 +# define _Locale_XDIGIT _X
1.437 +# define _Locale_PUNCT _P
1.438 +# define _Locale_SPACE _S
1.439 +# define _Locale_PRINT (_P | _U | _L | _N | _B)
1.440 +# define _Locale_ALPHA (_U | _L)
1.441 +#elif defined (_CRAY)
1.442 +# define _Locale_CNTRL _CNTRL
1.443 +# define _Locale_UPPER _UPPER
1.444 +# define _Locale_LOWER _LOWER
1.445 +# define _Locale_DIGIT _DIGIT
1.446 +# define _Locale_XDIGIT _XDIGIT
1.447 +# define _Locale_PUNCT _PUNCT
1.448 +# define _Locale_SPACE _SPACE
1.449 +# define _Locale_PRINT _PRINT
1.450 +# define _Locale_ALPHA _ALPHA
1.451 +#elif defined (_STLP_VXWORKS_TORNADO)
1.452 +#define _Locale_UPPER _C_UPPER /* 0x01 */
1.453 +#define _Locale_LOWER _C_LOWER /* 0x02 */
1.454 +#define _Locale_DIGIT _C_NUMBER /* 0x04 */
1.455 +#define _Locale_SPACE _C_WHITE_SPACE /* 0x08 */
1.456 +#define _Locale_PUNCT _C_PUNCT /* 0x10 */
1.457 +#define _Locale_CNTRL _C_CONTROL /* 0x20 */
1.458 +#define _Locale_XDIGIT _C_HEX_NUMBER /* 0x40 */
1.459 +#define _Locale_PRINT (_C_B | _C_UPPER | _C_LOWER | _C_NUMBER | _C_PUNCT)
1.460 +#define _Locale_ALPHA (_C_UPPER | _C_LOWER)
1.461 +#endif
1.462 +
1.463 +# endif /* _STLP_C_LOCALE_H */