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.

91 lines
3.4 KiB

  1. /***
  2. *lconv.c - Contains the localeconv function
  3. *
  4. * Copyright (c) 1988-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * Contains the localeconv() function.
  8. *
  9. *Revision History:
  10. * 03-21-89 JCR Module created.
  11. * 06-20-89 JCR Removed _LOAD_DGROUP code
  12. * 03-14-90 GJF Replaced _cdecl _LOAD_DS with _CALLTYPE1 and added
  13. * #include <cruntime.h>. Also, fixed the copyright.
  14. * 10-04-90 GJF New-style function declarator.
  15. * 10-04-91 ETC Changed _c_lconv to __lconv (locale support).
  16. * _lconv no longer static.
  17. * 12-20-91 ETC Changed _lconv to _lconv_c (C locale structure).
  18. * Created _lconv pointer to point to current lconv.
  19. * 02-08-93 CFW Added _lconv_static_*.
  20. * 04-06-93 SKS Replace _CRTAPI* with __cdecl
  21. * 09-15-93 CFW Use ANSI conformant "__" names.
  22. * 04-14-94 GJF Made definitions of __lconv and __lconv_c conditional
  23. * on ndef DLL_FOR_WIN32S. Include setlocal.h.
  24. * 01-07-95 CFW Mac merge.
  25. * 05-13-99 PML Remove Win32s
  26. * 05-17-99 PML Remove all Macintosh support.
  27. *
  28. *******************************************************************************/
  29. #include <cruntime.h>
  30. #include <limits.h>
  31. #include <locale.h>
  32. #include <setlocal.h>
  33. /* pointer to original static to avoid freeing */
  34. char __lconv_static_decimal[] = ".";
  35. char __lconv_static_null[] = "";
  36. /* lconv settings for "C" locale */
  37. struct lconv __lconv_c = {
  38. __lconv_static_decimal, /* decimal_point */
  39. __lconv_static_null, /* thousands_sep */
  40. __lconv_static_null, /* grouping */
  41. __lconv_static_null, /* int_curr_symbol */
  42. __lconv_static_null, /* currency_symbol */
  43. __lconv_static_null, /* mon_decimal_point */
  44. __lconv_static_null, /* mon_thousands_sep */
  45. __lconv_static_null, /* mon_grouping */
  46. __lconv_static_null, /* positive_sign */
  47. __lconv_static_null, /* negative_sign */
  48. CHAR_MAX, /* int_frac_digits */
  49. CHAR_MAX, /* frac_digits */
  50. CHAR_MAX, /* p_cs_precedes */
  51. CHAR_MAX, /* p_sep_by_space */
  52. CHAR_MAX, /* n_cs_precedes */
  53. CHAR_MAX, /* n_sep_by_space */
  54. CHAR_MAX, /* p_sign_posn */
  55. CHAR_MAX /* n_sign_posn */
  56. };
  57. /* pointer to current lconv structure */
  58. struct lconv *__lconv = &__lconv_c;
  59. /***
  60. *struct lconv *localeconv(void) - Return the numeric formatting convention
  61. *
  62. *Purpose:
  63. * The localeconv() routine returns the numeric formatting conventions
  64. * for the current locale setting. [ANSI]
  65. *
  66. *Entry:
  67. * void
  68. *
  69. *Exit:
  70. * struct lconv * = pointer to struct indicating current numeric
  71. * formatting conventions.
  72. *
  73. *Exceptions:
  74. *
  75. *******************************************************************************/
  76. struct lconv * __cdecl localeconv (
  77. void
  78. )
  79. {
  80. /* the work is done by setlocale() */
  81. return(__lconv);
  82. }