home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c065 / 1.ddi / CLIB1.ZIP / LOCALE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-07  |  1.6 KB  |  66 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. /*|                                                              |*/
  11. /*|     Turbo C Run Time Library - Version 3.0                   |*/
  12. /*|                                                              |*/
  13. /*|                                                              |*/
  14. /*|     Copyright (c) 1987,1988,1990 by Borland International    |*/
  15. /*|     All Rights Reserved.                                     |*/
  16. /*|                                                              |*/
  17. /*[]------------------------------------------------------------[]*/
  18.  
  19. #include <locale.h>
  20. #include <limits.h>
  21. #include <string.h>
  22. #include <stdio.h>
  23.  
  24. static struct lconv locale =
  25.   {
  26.   ".",
  27.   "",
  28.   "",
  29.   "",
  30.   "",
  31.   "",
  32.   "",
  33.   "",
  34.   "",
  35.   "",
  36.   CHAR_MAX,
  37.   CHAR_MAX,
  38.   CHAR_MAX,
  39.   CHAR_MAX,
  40.   CHAR_MAX,
  41.   CHAR_MAX,
  42.   CHAR_MAX,
  43.   CHAR_MAX
  44.   };
  45.  
  46. /* At the present time we support only the C locale */
  47. #pragma argsused
  48. char *setlocale( int category, const char *locale )
  49.   {
  50.   if( locale == NULL )
  51.     {
  52.     return( "C" );
  53.     }
  54.   else
  55.     {
  56.     return( *locale && strcmp( locale, "C" ) ? NULL : (char *) locale );
  57.     }
  58.   }
  59.  
  60.  
  61. struct lconv *localeconv( void )
  62.   {
  63.   return( &locale );
  64.   }
  65.  
  66.