home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / locale.h < prev    next >
C/C++ Source or Header  |  1998-06-17  |  4KB  |  172 lines

  1. /***
  2. *locale.h - definitions/declarations for localization routines
  3. *
  4. *       Copyright (c) 1988-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       This file defines the structures, values, macros, and functions
  8. *       used by the localization routines.
  9. *
  10. *       [Public]
  11. *
  12. ****/
  13.  
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif  /* _MSC_VER > 1000 */
  17.  
  18. #ifndef _INC_LOCALE
  19. #define _INC_LOCALE
  20.  
  21. #if !defined (_WIN32) && !defined (_MAC)
  22. #error ERROR: Only Mac or Win32 targets supported!
  23. #endif  /* !defined (_WIN32) && !defined (_MAC) */
  24.  
  25. #ifndef _CRTBLD
  26. /* This version of the header files is NOT for user programs.
  27.  * It is intended for use when building the C runtimes ONLY.
  28.  * The version intended for public use will not have this message.
  29.  */
  30. #error ERROR: Use of C runtime library internal header file.
  31. #endif  /* _CRTBLD */
  32.  
  33. #ifdef _MSC_VER
  34. /*
  35.  * Currently, all MS C compilers for Win32 platforms default to 8 byte
  36.  * alignment.
  37.  */
  38. #pragma pack(push,8)
  39. #endif  /* _MSC_VER */
  40.  
  41. #ifdef __cplusplus
  42. extern "C" {
  43. #endif  /* __cplusplus */
  44.  
  45. #ifndef _INTERNAL_IFSTRIP_
  46. #include <cruntime.h>
  47. #endif  /* _INTERNAL_IFSTRIP_ */
  48.  
  49.  
  50. /* Define _CRTIMP */
  51.  
  52. #ifndef _CRTIMP
  53. #ifdef CRTDLL
  54. #define _CRTIMP __declspec(dllexport)
  55. #else  /* CRTDLL */
  56. #ifdef _DLL
  57. #define _CRTIMP __declspec(dllimport)
  58. #else  /* _DLL */
  59. #define _CRTIMP
  60. #endif  /* _DLL */
  61. #endif  /* CRTDLL */
  62. #endif  /* _CRTIMP */
  63.  
  64.  
  65. /* Define __cdecl for non-Microsoft compilers */
  66.  
  67. #if (!defined (_MSC_VER) && !defined (__cdecl))
  68. #define __cdecl
  69. #endif  /* (!defined (_MSC_VER) && !defined (__cdecl)) */
  70.  
  71.  
  72. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  73.  
  74. #ifndef _CRTAPI1
  75. #if _MSC_VER >= 800 && _M_IX86 >= 300
  76. #define _CRTAPI1 __cdecl
  77. #else  /* _MSC_VER >= 800 && _M_IX86 >= 300 */
  78. #define _CRTAPI1
  79. #endif  /* _MSC_VER >= 800 && _M_IX86 >= 300 */
  80. #endif  /* _CRTAPI1 */
  81.  
  82. #ifndef _MAC
  83. #ifndef _WCHAR_T_DEFINED
  84. typedef unsigned short wchar_t;
  85. #define _WCHAR_T_DEFINED
  86. #endif  /* _WCHAR_T_DEFINED */
  87. #endif  /* _MAC */
  88.  
  89.  
  90. /* define NULL pointer value */
  91.  
  92. #ifndef NULL
  93. #ifdef __cplusplus
  94. #define NULL    0
  95. #else  /* __cplusplus */
  96. #define NULL    ((void *)0)
  97. #endif  /* __cplusplus */
  98. #endif  /* NULL */
  99.  
  100. /* Locale categories */
  101.  
  102. #define LC_ALL          0
  103. #define LC_COLLATE      1
  104. #define LC_CTYPE        2
  105. #define LC_MONETARY     3
  106. #define LC_NUMERIC      4
  107. #define LC_TIME         5
  108.  
  109. #define LC_MIN          LC_ALL
  110. #define LC_MAX          LC_TIME
  111.  
  112. /* Locale convention structure */
  113.  
  114. #ifndef _LCONV_DEFINED
  115. struct lconv {
  116.         char *decimal_point;
  117.         char *thousands_sep;
  118.         char *grouping;
  119.         char *int_curr_symbol;
  120.         char *currency_symbol;
  121.         char *mon_decimal_point;
  122.         char *mon_thousands_sep;
  123.         char *mon_grouping;
  124.         char *positive_sign;
  125.         char *negative_sign;
  126.         char int_frac_digits;
  127.         char frac_digits;
  128.         char p_cs_precedes;
  129.         char p_sep_by_space;
  130.         char n_cs_precedes;
  131.         char n_sep_by_space;
  132.         char p_sign_posn;
  133.         char n_sign_posn;
  134.         };
  135. #define _LCONV_DEFINED
  136. #endif  /* _LCONV_DEFINED */
  137.  
  138. /* ANSI: char lconv members default is CHAR_MAX which is compile time
  139.    dependent. Defining and using _charmax here causes CRT startup code
  140.    to initialize lconv members properly */
  141.  
  142. #ifdef _CHAR_UNSIGNED
  143. extern int _charmax;
  144. extern __inline int __dummy() { return _charmax; }
  145. #endif  /* _CHAR_UNSIGNED */
  146.  
  147. /* function prototypes */
  148.  
  149. _CRTIMP char * __cdecl setlocale(int, const char *);
  150. _CRTIMP struct lconv * __cdecl localeconv(void);
  151.  
  152. #ifndef _MAC
  153. #ifndef _WLOCALE_DEFINED
  154.  
  155. /* wide function prototypes, also declared in wchar.h  */
  156.  
  157. _CRTIMP wchar_t * __cdecl _wsetlocale(int, const wchar_t *);
  158.  
  159. #define _WLOCALE_DEFINED
  160. #endif  /* _WLOCALE_DEFINED */
  161. #endif  /* _MAC */
  162.  
  163. #ifdef __cplusplus
  164. }
  165. #endif  /* __cplusplus */
  166.  
  167. #ifdef _MSC_VER
  168. #pragma pack(pop)
  169. #endif  /* _MSC_VER */
  170.  
  171. #endif  /* _INC_LOCALE */
  172.