home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / locale.h < prev    next >
C/C++ Source or Header  |  1998-06-16  |  3KB  |  158 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
  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
  24.  
  25.  
  26. #ifdef  _MSC_VER
  27. /*
  28.  * Currently, all MS C compilers for Win32 platforms default to 8 byte
  29.  * alignment.
  30.  */
  31. #pragma pack(push,8)
  32. #endif  /* _MSC_VER */
  33.  
  34. #ifdef  __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38.  
  39.  
  40. /* Define _CRTIMP */
  41.  
  42. #ifndef _CRTIMP
  43. #ifdef  _DLL
  44. #define _CRTIMP __declspec(dllimport)
  45. #else   /* ndef _DLL */
  46. #define _CRTIMP
  47. #endif  /* _DLL */
  48. #endif  /* _CRTIMP */
  49.  
  50.  
  51. /* Define __cdecl for non-Microsoft compilers */
  52.  
  53. #if     ( !defined(_MSC_VER) && !defined(__cdecl) )
  54. #define __cdecl
  55. #endif
  56.  
  57.  
  58. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  59.  
  60. #ifndef _CRTAPI1
  61. #if    _MSC_VER >= 800 && _M_IX86 >= 300
  62. #define _CRTAPI1 __cdecl
  63. #else
  64. #define _CRTAPI1
  65. #endif
  66. #endif
  67.  
  68. #ifndef _MAC
  69. #ifndef _WCHAR_T_DEFINED
  70. typedef unsigned short wchar_t;
  71. #define _WCHAR_T_DEFINED
  72. #endif
  73. #endif  /* ndef _MAC */
  74.  
  75.  
  76. /* define NULL pointer value */
  77.  
  78. #ifndef NULL
  79. #ifdef  __cplusplus
  80. #define NULL    0
  81. #else
  82. #define NULL    ((void *)0)
  83. #endif
  84. #endif
  85.  
  86. /* Locale categories */
  87.  
  88. #define LC_ALL          0
  89. #define LC_COLLATE      1
  90. #define LC_CTYPE        2
  91. #define LC_MONETARY     3
  92. #define LC_NUMERIC      4
  93. #define LC_TIME         5
  94.  
  95. #define LC_MIN          LC_ALL
  96. #define LC_MAX          LC_TIME
  97.  
  98. /* Locale convention structure */
  99.  
  100. #ifndef _LCONV_DEFINED
  101. struct lconv {
  102.         char *decimal_point;
  103.         char *thousands_sep;
  104.         char *grouping;
  105.         char *int_curr_symbol;
  106.         char *currency_symbol;
  107.         char *mon_decimal_point;
  108.         char *mon_thousands_sep;
  109.         char *mon_grouping;
  110.         char *positive_sign;
  111.         char *negative_sign;
  112.         char int_frac_digits;
  113.         char frac_digits;
  114.         char p_cs_precedes;
  115.         char p_sep_by_space;
  116.         char n_cs_precedes;
  117.         char n_sep_by_space;
  118.         char p_sign_posn;
  119.         char n_sign_posn;
  120.         };
  121. #define _LCONV_DEFINED
  122. #endif
  123.  
  124. /* ANSI: char lconv members default is CHAR_MAX which is compile time
  125.    dependent. Defining and using _charmax here causes CRT startup code
  126.    to initialize lconv members properly */
  127.  
  128. #ifdef  _CHAR_UNSIGNED
  129. extern int _charmax;
  130. extern __inline int __dummy() { return _charmax; }
  131. #endif
  132.  
  133. /* function prototypes */
  134.  
  135. _CRTIMP char * __cdecl setlocale(int, const char *);
  136. _CRTIMP struct lconv * __cdecl localeconv(void);
  137.  
  138. #ifndef _MAC
  139. #ifndef _WLOCALE_DEFINED
  140.  
  141. /* wide function prototypes, also declared in wchar.h  */
  142.  
  143. _CRTIMP wchar_t * __cdecl _wsetlocale(int, const wchar_t *);
  144.  
  145. #define _WLOCALE_DEFINED
  146. #endif
  147. #endif  /* ndef _MAC */
  148.  
  149. #ifdef  __cplusplus
  150. }
  151. #endif
  152.  
  153. #ifdef  _MSC_VER
  154. #pragma pack(pop)
  155. #endif  /* _MSC_VER */
  156.  
  157. #endif  /* _INC_LOCALE */
  158.