locale.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*****************************************************************************/
  2. /* locale.h v8.2.2 */
  3. /* */
  4. /* Copyright (c) 1993-2017 Texas Instruments Incorporated */
  5. /* http://www.ti.com/ */
  6. /* */
  7. /* Redistribution and use in source and binary forms, with or without */
  8. /* modification, are permitted provided that the following conditions */
  9. /* are met: */
  10. /* */
  11. /* Redistributions of source code must retain the above copyright */
  12. /* notice, this list of conditions and the following disclaimer. */
  13. /* */
  14. /* Redistributions in binary form must reproduce the above copyright */
  15. /* notice, this list of conditions and the following disclaimer in */
  16. /* the documentation and/or other materials provided with the */
  17. /* distribution. */
  18. /* */
  19. /* Neither the name of Texas Instruments Incorporated nor the names */
  20. /* of its contributors may be used to endorse or promote products */
  21. /* derived from this software without specific prior written */
  22. /* permission. */
  23. /* */
  24. /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
  25. /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
  26. /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR */
  27. /* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
  28. /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
  29. /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */
  30. /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, */
  31. /* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY */
  32. /* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
  33. /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE */
  34. /* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
  35. /* */
  36. /*****************************************************************************/
  37. #ifndef _LOCALE
  38. #define _LOCALE
  39. #pragma diag_push
  40. #pragma CHECK_MISRA("-6.3") /* standard types required for standard headers */
  41. #pragma CHECK_MISRA("-20.1") /* standard headers must define standard names */
  42. #pragma CHECK_MISRA("-20.2") /* standard headers must define standard names */
  43. #ifdef __cplusplus
  44. extern "C" namespace std {
  45. #endif
  46. #ifndef NULL
  47. #define NULL 0
  48. #endif
  49. /* LOCALE CATEGORY INDEXES */
  50. #define LC_ALL 0
  51. #define LC_COLLATE 1
  52. #define LC_CTYPE 2
  53. #define LC_MONETARY 3
  54. #define LC_NUMERIC 4
  55. #define LC_TIME 5
  56. #define LC_MESSAGES 6
  57. /* TYPE DEFINITIONS */
  58. struct lconv
  59. {
  60. /* LC_NUMERIC */
  61. char *decimal_point;
  62. char *grouping;
  63. char *thousands_sep;
  64. /* LC_MONETARY */
  65. char *mon_decimal_point;
  66. char *mon_grouping;
  67. char *mon_thousands_sep;
  68. char *negative_sign;
  69. char *positive_sign;
  70. char *currency_symbol;
  71. char frac_digits;
  72. char n_cs_precedes;
  73. char n_sep_by_space;
  74. char n_sign_posn;
  75. char p_cs_precedes;
  76. char p_sep_by_space;
  77. char p_sign_posn;
  78. char *int_curr_symbol;
  79. char int_frac_digits;
  80. };
  81. /* DECLARATIONS */
  82. struct lconv *localeconv(void);
  83. char *setlocale(int category, const char *locale);
  84. #ifdef __cplusplus
  85. } /* extern "C" namespace std */
  86. #endif /* __cplusplus */
  87. #pragma diag_pop
  88. #endif /* _LOCALE */
  89. #pragma diag_push
  90. /* using declarations must occur outside header guard to support including both
  91. C and C++-wrapped version of header; see _CPP_STYLE_HEADER check */
  92. /* this code is for C++ mode only and thus also not relevant for MISRA */
  93. #pragma CHECK_MISRA("-19.15")
  94. #if defined(__cplusplus) && !defined(_CPP_STYLE_HEADER)
  95. using std::lconv; using std::localeconv; using std::setlocale;
  96. #endif /* _CPP_STYLE_HEADER */
  97. #pragma diag_pop