home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / crt / src / lcnvinit.c < prev    next >
C/C++ Source or Header  |  1998-06-17  |  2KB  |  41 lines

  1. /***
  2. *lcnvinit.c - called at startup to initialize lconv structure
  3. *
  4. *       Copyright (c) 1993-1997, 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, the value of CHAR_MAX changes. To reflect this
  12. *       change in the lconv structure, we initialize the structure to SCHAR_MAX,
  13. *       and when any of the users modules are compiled -J, the structure is updated.
  14. *
  15. *       Files involved:
  16. *
  17. *       locale.h - if -J, generates an unresolved external to _charmax
  18. *       charmax.c - defines _charmax and sets to UCHAR_MAX (255), places
  19. *               __lconv_init in startup initializer table if pulled in by -J
  20. *       lconv.c - initializes lconv structure to SCHAR_MAX (127),
  21. *               since libraries built without -J
  22. *       lcnvinit.c - sets lconv members to 25.
  23. **
  24. *******************************************************************************/
  25.  
  26. #include <limits.h>
  27. #include <locale.h>
  28. #include <setlocal.h>
  29.  
  30. void __lconv_init(void)
  31. {
  32.         __lconv_c.int_frac_digits = (char)UCHAR_MAX;
  33.         __lconv_c.frac_digits = (char)UCHAR_MAX;
  34.         __lconv_c.p_cs_precedes = (char)UCHAR_MAX;
  35.         __lconv_c.p_sep_by_space = (char)UCHAR_MAX;
  36.         __lconv_c.n_cs_precedes = (char)UCHAR_MAX;
  37.         __lconv_c.n_sep_by_space = (char)UCHAR_MAX;
  38.         __lconv_c.p_sign_posn = (char)UCHAR_MAX;
  39.         __lconv_c.n_sign_posn = (char)UCHAR_MAX;
  40. }
  41.