home *** CD-ROM | disk | FTP | other *** search
/ Serving the Web / ServingTheWeb1995.disc1of1.iso / linux / slacksrce / d / libc / libc-4.6 / libc-4 / libc-linux / nls / msgcat-libc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-09  |  622 b   |  30 lines

  1. /* Some routines for Linux libc (and probably others).
  2.  * Covered by GNU LIBC LICENCE.
  3.  *
  4.  * Mitch D'Souza. (m.dsouza@mrc-apu.cam.ac.uk)
  5.  */
  6.  
  7. #ifdef __linux__
  8. #include <stdio.h>
  9. #include <locale.h>
  10. #include "nl_types.h"
  11. #define CATALOGUE "libc"
  12. nl_catd _libc_cat = 0;
  13.  
  14. void libc_nls_init(void) {
  15.     extern nl_catd _libc_cat;
  16.  
  17.     if (_libc_cat != 0)        /* 
  18.                  * Either a previous catopen() failed
  19.                  * or the libc catalog is already open
  20.                  */
  21.     return;
  22.                 /* This is the first time we try. */
  23.  
  24.     /* Get the environment setting for LC_MESSAGES */
  25.     setlocale(LC_MESSAGES,"");
  26.     _libc_cat=catopen(CATALOGUE,0);
  27. }
  28.  
  29. #endif
  30.