home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / NLS / NLSINIT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  710 b   |  30 lines

  1. /* nlsinit.c (emx+gcc) -- Copyright (c) 1992-1993 by Eberhard Mattes */
  2.  
  3. #define _NLSINIT_C
  4.  
  5. #include <sys/emx.h>
  6. #include <sys/nls.h>
  7.  
  8. unsigned char _nls_toupper_tab[256];
  9. unsigned char _nls_tolower_tab[256];
  10.  
  11. int _nls_init_flag = 0;
  12.  
  13. void _nls_init (void)
  14. {
  15.   int i;
  16.  
  17.   for (i = 0; i < 256; ++i)
  18.     {
  19.       _nls_toupper_tab[i] = (unsigned char)i;
  20.       _nls_tolower_tab[i] = (unsigned char)i;
  21.     }
  22.   __nls_memupr (_nls_toupper_tab, 256);
  23.   for (i = 0; i < 256; ++i)
  24.     if (_nls_toupper_tab[i] != i)
  25.       _nls_tolower_tab[_nls_toupper_tab[i]] = (unsigned char)i;
  26.   for (i = 'A'; i <= 'Z'; ++i)
  27.     _nls_tolower_tab[i] = (unsigned char)(i - 'A' + 'a');
  28.   _nls_init_flag = 1;
  29. }
  30.