home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / LOCALE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-16  |  3.2 KB  |  146 lines

  1. /*  locale.h
  2.  
  3. */
  4.  
  5. /* $Copyright: 1987$ */
  6. /* $Revision:   8.8  $ */
  7.  
  8. #ifndef __LOCALE_H
  9. #define __LOCALE_H
  10.  
  11. #if !defined(___DEFS_H)
  12. #include <_defs.h>
  13. #endif
  14.  
  15. #if !defined(__STDDEF_H)
  16. #include <stddef.h>
  17. #endif
  18.  
  19. #ifndef NULL
  20. #include <_null.h>
  21. #endif
  22.  
  23.  
  24. #if !defined(RC_INVOKED)
  25.  
  26. #if defined(__STDC__)
  27. #pragma warn -nak
  28. #endif
  29.  
  30. #endif  /* !RC_INVOKED */
  31.  
  32.  
  33. #ifndef _SIZE_T
  34. #    define _SIZE_T
  35. typedef unsigned size_t;
  36. #endif
  37.  
  38. #if defined (__USELOCALES__) || defined (__FLAT__)
  39.  
  40. #define LOCALE_ERROR(code) 0x00000100 + code
  41. #define ERROR_LOCALE_INVALID   (APPLICATION_ERROR_MASK + LOCALE_ERROR(1))
  42. #define ERROR_CATEGORY_INVALID (APPLICATION_ERROR_MASK + LOCALE_ERROR(2))
  43. #define ERROR_LOCALE_NOTINSTALLED (APPLICATION_ERROR_MASK + LOCALE_ERROR(3))
  44. #define ERROR_LOCALE_NOTSUPPORTED (APPLICATION_ERROR_MASK + LOCALE_ERROR(4))
  45. #define ERROR_CATEGORY_NOTOPEN (APPLICATION_ERROR_MASK + LOCALE_ERROR(5))
  46.  
  47. #define LC_COLLATE  0x01
  48. #define LC_CTYPE    0x02
  49. #define LC_MONETARY 0x04
  50. #define LC_NUMERIC  0x10
  51. #define LC_TIME     0x20
  52. #define LC_ALL      0xFF
  53. #define LC_MIN      LC_COLLATE
  54. #define LC_MAX      LC_ALL
  55. #define LC_LAST     LC_MAX
  56.  
  57. #else
  58.  
  59. #define LC_ALL      0
  60. #define LC_COLLATE  1
  61. #define LC_CTYPE    2
  62. #define LC_MONETARY 3
  63. #define LC_NUMERIC  4
  64. #define LC_TIME     5
  65. #define LC_MESSAGES 6
  66. #define LC_userdef  7
  67. #define LC_LAST     LC_userdef
  68.  
  69. #endif /* __USELOCALES__ */
  70.  
  71. struct lconv {
  72.  
  73.    char _FAR *decimal_point;
  74.    char _FAR *thousands_sep;
  75.    char _FAR *grouping;
  76.    char _FAR *int_curr_symbol;
  77.    char _FAR *currency_symbol;
  78.    char _FAR *mon_decimal_point;
  79.    char _FAR *mon_thousands_sep;
  80.    char _FAR *mon_grouping;
  81.    char _FAR *positive_sign;
  82.    char _FAR *negative_sign;
  83.    char int_frac_digits;
  84.    char frac_digits;
  85.    char p_cs_precedes;
  86.    char p_sep_by_space;
  87.    char n_cs_precedes;
  88.    char n_sep_by_space;
  89.    char p_sign_posn;
  90.    char n_sign_posn;
  91. };
  92.  
  93. #if !defined(__FLAT__)
  94.  
  95. #ifdef __cplusplus
  96. extern "C" {
  97. #endif
  98. char _FAR * _CType _FARFUNC setlocale( int __category, const char _FAR *__locale );
  99. char _FAR * _CType _FARFUNC _lsetlocale( int __category, const char _FAR *__locale );
  100. struct lconv _FAR * _CType localeconv( void );
  101. struct lconv _FAR * _CType _FARFUNC _llocaleconv( void );
  102. #ifdef __cplusplus
  103. }
  104. #endif
  105.  
  106. #else  /* defined __FLAT__ */
  107.  
  108. #pragma pack(push, 1)
  109.  
  110. #ifdef __cplusplus
  111. extern "C" {
  112. #endif
  113. char *         _RTLENTRY _EXPFUNC setlocale( int __category, const char *__locale );
  114. char *         _RTLENTRY _EXPFUNC _lsetlocale( int __category, const char *__locale );
  115. struct lconv * _RTLENTRY _EXPFUNC localeconv( void );
  116. struct lconv * _RTLENTRY _EXPFUNC _llocaleconv( void );
  117. wchar_t *      _RTLENTRY _EXPFUNC _wsetlocale( int __category, const wchar_t *__locale );
  118. wchar_t *      _RTLENTRY _EXPFUNC _lwsetlocale( int __category, const wchar_t *__locale );
  119. #ifdef __cplusplus
  120. }
  121. #endif
  122.  
  123. #pragma pack(pop) /* restore default packing */
  124.  
  125. #endif  /* __FLAT__ */
  126.  
  127. #if defined( __USELOCALES__ )
  128. #ifndef UNICODE
  129.   #define setlocale  _lsetlocale
  130. #else
  131.   #define _wsetlocale  _lwsetlocale
  132. #endif
  133. #endif
  134.  
  135. #if !defined(RC_INVOKED)
  136.  
  137. #if defined(__STDC__)
  138. #pragma warn .nak
  139. #endif
  140.  
  141. #endif  /* !RC_INVOKED */
  142.  
  143.  
  144. #endif  /* __LOCALE_H */
  145.  
  146.