Windows NT 4.0 source code leak
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.

86 lines
2.4 KiB

4 years ago
  1. /***
  2. *lconv.c - Contains the localeconv function
  3. *
  4. * Copyright (c) 1988-1991, 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. *
  21. *******************************************************************************/
  22. #include <cruntime.h>
  23. #include <limits.h>
  24. #include <locale.h>
  25. /* pointer to original static to avoid freeing */
  26. char _lconv_static_decimal[] = ".";
  27. char _lconv_static_null[] = "";
  28. /* lconv settings for "C" locale */
  29. struct lconv _lconv_c = {
  30. _lconv_static_decimal, /* decimal_point */
  31. _lconv_static_null, /* thousands_sep */
  32. _lconv_static_null, /* grouping */
  33. _lconv_static_null, /* int_curr_symbol */
  34. _lconv_static_null, /* currency_symbol */
  35. _lconv_static_null, /* mon_decimal_point */
  36. _lconv_static_null, /* mon_thousands_sep */
  37. _lconv_static_null, /* mon_grouping */
  38. _lconv_static_null, /* positive_sign */
  39. _lconv_static_null, /* negative_sign */
  40. CHAR_MAX, /* int_frac_digits */
  41. CHAR_MAX, /* frac_digits */
  42. CHAR_MAX, /* p_cs_precedes */
  43. CHAR_MAX, /* p_sep_by_space */
  44. CHAR_MAX, /* n_cs_precedes */
  45. CHAR_MAX, /* n_sep_by_space */
  46. CHAR_MAX, /* p_sign_posn */
  47. CHAR_MAX /* n_sign_posn */
  48. };
  49. /* pointer to current lconv structure */
  50. struct lconv *_lconv = &_lconv_c;
  51. /***
  52. *struct lconv *localeconv(void) - Return the numeric formatting convention
  53. *
  54. *Purpose:
  55. * The localeconv() routine returns the numeric formatting conventions
  56. * for the current locale setting. [ANSI]
  57. *
  58. *Entry:
  59. * void
  60. *
  61. *Exit:
  62. * struct lconv * = pointer to struct indicating current numeric
  63. * formatting conventions.
  64. *
  65. *Exceptions:
  66. *
  67. *******************************************************************************/
  68. struct lconv * _CALLTYPE1 localeconv (
  69. void
  70. )
  71. {
  72. /* the work is done by setlocale() */
  73. return(_lconv);
  74. }