locale.h 1.6 KB

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