2
0

locale.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #ifndef _LOCALE_H
  2. #define _LOCALE_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <features.h>
  7. #if __cplusplus >= 201103L
  8. #define NULL nullptr
  9. #elif defined(__cplusplus)
  10. #define NULL 0L
  11. #else
  12. #define NULL ((void*)0)
  13. #endif
  14. #define LC_CTYPE 0
  15. #define LC_NUMERIC 1
  16. #define LC_TIME 2
  17. #define LC_COLLATE 3
  18. #define LC_MONETARY 4
  19. #define LC_MESSAGES 5
  20. #define LC_ALL 6
  21. struct lconv {
  22. char *decimal_point;
  23. char *thousands_sep;
  24. char *grouping;
  25. char *int_curr_symbol;
  26. char *currency_symbol;
  27. char *mon_decimal_point;
  28. char *mon_thousands_sep;
  29. char *mon_grouping;
  30. char *positive_sign;
  31. char *negative_sign;
  32. char int_frac_digits;
  33. char frac_digits;
  34. char p_cs_precedes;
  35. char p_sep_by_space;
  36. char n_cs_precedes;
  37. char n_sep_by_space;
  38. char p_sign_posn;
  39. char n_sign_posn;
  40. char int_p_cs_precedes;
  41. char int_p_sep_by_space;
  42. char int_n_cs_precedes;
  43. char int_n_sep_by_space;
  44. char int_p_sign_posn;
  45. char int_n_sign_posn;
  46. };
  47. char *setlocale (int, const char *);
  48. struct lconv *localeconv(void);
  49. #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
  50. || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
  51. #define __NEED_locale_t
  52. #include <bits/alltypes.h>
  53. #define LC_GLOBAL_LOCALE ((locale_t)-1)
  54. #define LC_CTYPE_MASK (1<<LC_CTYPE)
  55. #define LC_NUMERIC_MASK (1<<LC_NUMERIC)
  56. #define LC_TIME_MASK (1<<LC_TIME)
  57. #define LC_COLLATE_MASK (1<<LC_COLLATE)
  58. #define LC_MONETARY_MASK (1<<LC_MONETARY)
  59. #define LC_MESSAGES_MASK (1<<LC_MESSAGES)
  60. #define LC_ALL_MASK 0x7fffffff
  61. locale_t duplocale(locale_t);
  62. void freelocale(locale_t);
  63. locale_t newlocale(int, const char *, locale_t);
  64. locale_t uselocale(locale_t);
  65. #endif
  66. #ifdef __cplusplus
  67. }
  68. #endif
  69. #endif