home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 1.ddi / CLIBSRC.ZIP / LOCALE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-10  |  1.1 KB  |  65 lines

  1. /*-----------------------------------------------------------------------*
  2.  * filename - locale.c
  3.  *
  4.  * function(s)
  5.  *        setlocale  - set the locale specific info
  6.  *        localeconv - gets the locale specific info
  7.  *-----------------------------------------------------------------------*/
  8.  
  9. /*
  10.  *      C/C++ Run Time Library - Version 5.0
  11.  *
  12.  *      Copyright (c) 1987, 1992 by Borland International
  13.  *      All Rights Reserved.
  14.  *
  15.  */
  16.  
  17.  
  18. #include <locale.h>
  19. #include <limits.h>
  20. #include <string.h>
  21. #include <stdio.h>
  22.  
  23. static struct lconv locale =
  24.   {
  25.   ".",
  26.   "",
  27.   "",
  28.   "",
  29.   "",
  30.   "",
  31.   "",
  32.   "",
  33.   "",
  34.   "",
  35.   CHAR_MAX,
  36.   CHAR_MAX,
  37.   CHAR_MAX,
  38.   CHAR_MAX,
  39.   CHAR_MAX,
  40.   CHAR_MAX,
  41.   CHAR_MAX,
  42.   CHAR_MAX
  43.   };
  44.  
  45. /* At the present time we support only the C locale */
  46. #pragma argsused
  47. char * _FARFUNC setlocale( int category, const char *locale )
  48.   {
  49.   if( locale == NULL )
  50.     {
  51.     return( "C" );
  52.     }
  53.   else
  54.     {
  55.     return( *locale && strcmp( locale, "C" ) ? NULL : (char *) locale );
  56.     }
  57.   }
  58.  
  59.  
  60. struct lconv * _FARFUNC localeconv( void )
  61.   {
  62.   return( &locale );
  63.   }
  64.  
  65.