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.

53 lines
2.1 KiB

  1. /***
  2. *lcnvinit.c - called at startup to initialize lconv structure
  3. *
  4. * Copyright (c) 1993-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * initialize lconv structure to CHAR_MAX
  8. *
  9. * According to ANSI, certain elements of the lconv structure must be
  10. * initialized to CHAR_MAX and the value of CHAR_MAX changes when
  11. * the user compiles -J. To reflect this change in the lconv structure,
  12. * we initialize the structure to SCHAR_MAX, and when any of the users
  13. * modules are compiled -J, the structure is updated.
  14. *
  15. * Note that this is not done for DLLs linked to the CRT DLL, because
  16. * we do not want such DLLs to override the -J setting for an EXE
  17. * linked to the CRT DLL. See comments in crtexe.c.
  18. *
  19. * Files involved:
  20. *
  21. * locale.h - if -J, generates an unresolved external to _charmax
  22. * charmax.c - defines _charmax and sets to UCHAR_MAX (255), places
  23. * __lconv_init in startup initializer table if pulled in by -J
  24. * lconv.c - initializes lconv structure to SCHAR_MAX (127),
  25. * since libraries built without -J
  26. * lcnvinit.c - sets lconv members to 25.
  27. **
  28. *Revision History:
  29. * 04-06-93 CFW Module created.
  30. * 04-14-93 CFW Cleanup.
  31. * 09-15-93 CFW Use ANSI conformant "__" names, get rid of warnings.
  32. * 03-27-01 PML .CRT$XI routines must now return 0 or _RT_* fatal
  33. * error code (vs7#231220)
  34. *
  35. *******************************************************************************/
  36. #include <limits.h>
  37. #include <locale.h>
  38. #include <setlocal.h>
  39. int __lconv_init(void)
  40. {
  41. __lconv_c.int_frac_digits = (char)UCHAR_MAX;
  42. __lconv_c.frac_digits = (char)UCHAR_MAX;
  43. __lconv_c.p_cs_precedes = (char)UCHAR_MAX;
  44. __lconv_c.p_sep_by_space = (char)UCHAR_MAX;
  45. __lconv_c.n_cs_precedes = (char)UCHAR_MAX;
  46. __lconv_c.n_sep_by_space = (char)UCHAR_MAX;
  47. __lconv_c.p_sign_posn = (char)UCHAR_MAX;
  48. __lconv_c.n_sign_posn = (char)UCHAR_MAX;
  49. return 0;
  50. }