Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

170 lines
3.0 KiB

  1. /***
  2. *locale.h - definitions/declarations for localization routines
  3. *
  4. * Copyright (c) 1988-1995, 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. #ifndef _INC_LOCALE
  14. #define _INC_LOCALE
  15. #if !defined(_WIN32) && !defined(_MAC)
  16. #error ERROR: Only Mac or Win32 targets supported!
  17. #endif
  18. #ifdef _MSC_VER
  19. /*
  20. * Currently, all MS C compilers for Win32 platforms default to 8 byte
  21. * alignment.
  22. */
  23. #pragma pack(push,8)
  24. #endif /* _MSC_VER */
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  29. #ifndef _CRTAPI1
  30. #if _MSC_VER >= 800 && _M_IX86 >= 300
  31. #define _CRTAPI1 __cdecl
  32. #else
  33. #define _CRTAPI1
  34. #endif
  35. #endif
  36. /* Define _CRTAPI2 (for compatibility with the NT SDK) */
  37. #ifndef _CRTAPI2
  38. #if _MSC_VER >= 800 && _M_IX86 >= 300
  39. #define _CRTAPI2 __cdecl
  40. #else
  41. #define _CRTAPI2
  42. #endif
  43. #endif
  44. /* Define _CRTIMP */
  45. #ifndef _CRTIMP
  46. #ifdef _NTSDK
  47. /* definition compatible with NT SDK */
  48. #define _CRTIMP
  49. #else /* ndef _NTSDK */
  50. /* current definition */
  51. #ifdef _DLL
  52. #define _CRTIMP __declspec(dllimport)
  53. #else /* ndef _DLL */
  54. #define _CRTIMP
  55. #endif /* _DLL */
  56. #endif /* _NTSDK */
  57. #endif /* _CRTIMP */
  58. /* Define __cdecl for non-Microsoft compilers */
  59. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  60. #define __cdecl
  61. #endif
  62. #ifndef _MAC
  63. #ifndef _WCHAR_T_DEFINED
  64. typedef unsigned short wchar_t;
  65. #define _WCHAR_T_DEFINED
  66. #endif
  67. #endif /* ndef _MAC */
  68. /* define NULL pointer value */
  69. #ifndef NULL
  70. #ifdef __cplusplus
  71. #define NULL 0
  72. #else
  73. #define NULL ((void *)0)
  74. #endif
  75. #endif
  76. /* Locale categories */
  77. #define LC_ALL 0
  78. #define LC_COLLATE 1
  79. #define LC_CTYPE 2
  80. #define LC_MONETARY 3
  81. #define LC_NUMERIC 4
  82. #define LC_TIME 5
  83. #define LC_MIN LC_ALL
  84. #define LC_MAX LC_TIME
  85. /* Locale convention structure */
  86. #ifndef _LCONV_DEFINED
  87. struct lconv {
  88. char *decimal_point;
  89. char *thousands_sep;
  90. char *grouping;
  91. char *int_curr_symbol;
  92. char *currency_symbol;
  93. char *mon_decimal_point;
  94. char *mon_thousands_sep;
  95. char *mon_grouping;
  96. char *positive_sign;
  97. char *negative_sign;
  98. char int_frac_digits;
  99. char frac_digits;
  100. char p_cs_precedes;
  101. char p_sep_by_space;
  102. char n_cs_precedes;
  103. char n_sep_by_space;
  104. char p_sign_posn;
  105. char n_sign_posn;
  106. };
  107. #define _LCONV_DEFINED
  108. #endif
  109. /* ANSI: char lconv members default is CHAR_MAX which is compile time
  110. dependent. Defining and using _charmax here causes CRT startup code
  111. to initialize lconv members properly */
  112. #ifdef _CHAR_UNSIGNED
  113. extern int _charmax;
  114. extern __inline int __dummy() { return _charmax; }
  115. #endif
  116. /* function prototypes */
  117. _CRTIMP char * __cdecl setlocale(int, const char *);
  118. _CRTIMP struct lconv * __cdecl localeconv(void);
  119. #ifndef _MAC
  120. #ifndef _WLOCALE_DEFINED
  121. /* wide function prototypes, also declared in wchar.h */
  122. _CRTIMP wchar_t * __cdecl _wsetlocale(int, const wchar_t *);
  123. #define _WLOCALE_DEFINED
  124. #endif
  125. #endif /* ndef _MAC */
  126. #ifdef __cplusplus
  127. }
  128. #endif
  129. #ifdef _MSC_VER
  130. #pragma pack(pop)
  131. #endif /* _MSC_VER */
  132. #endif /* _INC_LOCALE */