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.

195 lines
5.7 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. *Revision History:
  13. * 03-21-89 JCR Module created.
  14. * 03-11-89 JCR Modified for 386.
  15. * 04-06-89 JCR Corrected lconv definition (don't use typedef)
  16. * 04-18-89 JCR Added _LCONV_DEFINED so locale.h can be included twice
  17. * 05-03-89 JCR Added _INTERNAL_IFSTRIP for relinc usage
  18. * 08-04-89 GJF Cleanup, now specific to OS/2 2.0 (i.e., 386 flat model)
  19. * 10-30-89 GJF Fixed copyright, removed dummy args from prototype
  20. * 11-02-89 JCR Changed "DLL" to "_DLL"
  21. * 03-01-90 GJF Added #ifndef _INC_LOCALE and #include <cruntime.h>
  22. * stuff. Also, removed some (now) useless preprocessor
  23. * directives.
  24. * 03-15-90 GJF Replaced _cdecl with _CALLTYPE1 in prototypes.
  25. * 11-12-90 GJF Changed NULL to (void *)0.
  26. * 02-12-91 GJF Only #define NULL if it isn't #define-d.
  27. * 08-20-91 JCR C++ and ANSI naming
  28. * 08-05-92 GJF Function calling type and variable type macros.
  29. * 12-29-92 CFW Added _lc_time_data definition and supporting #defines.
  30. * 01-21-93 GJF Removed support for C6-386's _cdecl.
  31. * 02-01-93 CFW Removed __c_lconvinit vars to locale.h.
  32. * 02-08-93 CFW Removed time definitions to setlocal.h.
  33. * 04-06-93 SKS Replace _CRTAPI1/2 with __cdecl, _CRTVAR1 with nothing
  34. * 04-07-93 SKS Add _CRTIMP keyword for CRT DLL model
  35. * 04-13-93 CFW Add _charmax (when compiled -J, _CHAR_UNSIGNED is defined,
  36. * and _charmax yanks in module to allow lconv struct members
  37. * to be set to UCHAR_MAX).
  38. * 04-14-93 CFW Change _charmax from short to int.
  39. * 10-07-93 GJF Merged Cuda and NT versions.
  40. * 12-17-93 CFW Add wide char version protos.
  41. * 11-03-94 GJF Ensure 8 byte alignment.
  42. * 02-11-95 CFW Add _CRTBLD to avoid users getting wrong headers.
  43. * 02-14-95 CFW Clean up Mac merge.
  44. * 12-14-95 JWM Add "#pragma once".
  45. * 02-20-97 GJF Cleaned out obsolete support for _CRTAPI* and _NTSDK.
  46. * Also, detab-ed.
  47. * 09-30-97 JWM Restored not-so-obsolete _CRTAPI1 support.
  48. * 10-07-97 RDL Added IA64.
  49. * 05-13-99 PML Remove _CRTAPI1
  50. * 05-17-99 PML Remove all Macintosh support.
  51. *
  52. ****/
  53. #if _MSC_VER > 1000 /*IFSTRIP=IGN*/
  54. #pragma once
  55. #endif
  56. #ifndef _INC_LOCALE
  57. #define _INC_LOCALE
  58. #if !defined(_WIN32)
  59. #error ERROR: Only Win32 target supported!
  60. #endif
  61. #ifndef _CRTBLD
  62. /* This version of the header files is NOT for user programs.
  63. * It is intended for use when building the C runtimes ONLY.
  64. * The version intended for public use will not have this message.
  65. */
  66. #error ERROR: Use of C runtime library internal header file.
  67. #endif /* _CRTBLD */
  68. #ifdef _MSC_VER
  69. /*
  70. * Currently, all MS C compilers for Win32 platforms default to 8 byte
  71. * alignment.
  72. */
  73. #pragma pack(push,8)
  74. #endif /* _MSC_VER */
  75. #ifdef __cplusplus
  76. extern "C" {
  77. #endif
  78. #ifndef _INTERNAL_IFSTRIP_
  79. #include <cruntime.h>
  80. #endif /* _INTERNAL_IFSTRIP_ */
  81. /* Define _CRTIMP */
  82. #ifndef _CRTIMP
  83. #ifdef CRTDLL
  84. #define _CRTIMP __declspec(dllexport)
  85. #else /* ndef CRTDLL */
  86. #ifdef _DLL
  87. #define _CRTIMP __declspec(dllimport)
  88. #else /* ndef _DLL */
  89. #define _CRTIMP
  90. #endif /* _DLL */
  91. #endif /* CRTDLL */
  92. #endif /* _CRTIMP */
  93. /* Define __cdecl for non-Microsoft compilers */
  94. #if ( !defined(_MSC_VER) && !defined(__cdecl) )
  95. #define __cdecl
  96. #endif
  97. #ifndef _WCHAR_T_DEFINED
  98. typedef unsigned short wchar_t;
  99. #define _WCHAR_T_DEFINED
  100. #endif
  101. /* define NULL pointer value */
  102. #ifndef NULL
  103. #ifdef __cplusplus
  104. #define NULL 0
  105. #else
  106. #define NULL ((void *)0)
  107. #endif
  108. #endif
  109. /* Locale categories */
  110. #define LC_ALL 0
  111. #define LC_COLLATE 1
  112. #define LC_CTYPE 2
  113. #define LC_MONETARY 3
  114. #define LC_NUMERIC 4
  115. #define LC_TIME 5
  116. #define LC_MIN LC_ALL
  117. #define LC_MAX LC_TIME
  118. /* Locale convention structure */
  119. #ifndef _LCONV_DEFINED
  120. struct lconv {
  121. char *decimal_point;
  122. char *thousands_sep;
  123. char *grouping;
  124. char *int_curr_symbol;
  125. char *currency_symbol;
  126. char *mon_decimal_point;
  127. char *mon_thousands_sep;
  128. char *mon_grouping;
  129. char *positive_sign;
  130. char *negative_sign;
  131. char int_frac_digits;
  132. char frac_digits;
  133. char p_cs_precedes;
  134. char p_sep_by_space;
  135. char n_cs_precedes;
  136. char n_sep_by_space;
  137. char p_sign_posn;
  138. char n_sign_posn;
  139. };
  140. #define _LCONV_DEFINED
  141. #endif
  142. /* ANSI: char lconv members default is CHAR_MAX which is compile time
  143. dependent. Defining and using _charmax here causes CRT startup code
  144. to initialize lconv members properly */
  145. #ifdef _CHAR_UNSIGNED
  146. extern int _charmax;
  147. extern __inline int __dummy() { return _charmax; }
  148. #endif
  149. /* function prototypes */
  150. _CRTIMP char * __cdecl setlocale(int, const char *);
  151. _CRTIMP struct lconv * __cdecl localeconv(void);
  152. #ifndef _WLOCALE_DEFINED
  153. /* wide function prototypes, also declared in wchar.h */
  154. _CRTIMP wchar_t * __cdecl _wsetlocale(int, const wchar_t *);
  155. #define _WLOCALE_DEFINED
  156. #endif
  157. #ifdef __cplusplus
  158. }
  159. #endif
  160. #ifdef _MSC_VER
  161. #pragma pack(pop)
  162. #endif /* _MSC_VER */
  163. #endif /* _INC_LOCALE */