Leaked source code of windows server 2003
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.

152 lines
3.3 KiB

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