modernc.org/cc@v1.0.1/v2/headers/linux_386/usr/include/locale.h (about)

     1  /* Copyright (C) 1991-2018 Free Software Foundation, Inc.
     2     This file is part of the GNU C Library.
     3  
     4     The GNU C Library is free software; you can redistribute it and/or
     5     modify it under the terms of the GNU Lesser General Public
     6     License as published by the Free Software Foundation; either
     7     version 2.1 of the License, or (at your option) any later version.
     8  
     9     The GNU C Library is distributed in the hope that it will be useful,
    10     but WITHOUT ANY WARRANTY; without even the implied warranty of
    11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    12     Lesser General Public License for more details.
    13  
    14     You should have received a copy of the GNU Lesser General Public
    15     License along with the GNU C Library; if not, see
    16     <http://www.gnu.org/licenses/>.  */
    17  
    18  /*
    19   *	ISO C99 Standard: 7.11 Localization	<locale.h>
    20   */
    21  
    22  #ifndef	_LOCALE_H
    23  #define	_LOCALE_H	1
    24  
    25  #include <features.h>
    26  
    27  #define __need_NULL
    28  #include <stddef.h>
    29  #include <bits/locale.h>
    30  
    31  __BEGIN_DECLS
    32  /* These are the possibilities for the first argument to setlocale.
    33     The code assumes that the lowest LC_* symbol has the value zero.  */
    34  #define LC_CTYPE          __LC_CTYPE
    35  #define LC_NUMERIC        __LC_NUMERIC
    36  #define LC_TIME           __LC_TIME
    37  #define LC_COLLATE        __LC_COLLATE
    38  #define LC_MONETARY       __LC_MONETARY
    39  #define LC_MESSAGES       __LC_MESSAGES
    40  #define	LC_ALL		  __LC_ALL
    41  #define LC_PAPER	  __LC_PAPER
    42  #define LC_NAME		  __LC_NAME
    43  #define LC_ADDRESS	  __LC_ADDRESS
    44  #define LC_TELEPHONE	  __LC_TELEPHONE
    45  #define LC_MEASUREMENT	  __LC_MEASUREMENT
    46  #define LC_IDENTIFICATION __LC_IDENTIFICATION
    47  /* Structure giving information about numeric and monetary notation.  */
    48      struct lconv {
    49  	/* Numeric (non-monetary) information.  */
    50  
    51  	char *decimal_point;	/* Decimal point character.  */
    52  	char *thousands_sep;	/* Thousands separator.  */
    53  	/* Each element is the number of digits in each group;
    54  	   elements with higher indices are farther left.
    55  	   An element with value CHAR_MAX means that no further grouping is done.
    56  	   An element with value 0 means that the previous element is used
    57  	   for all groups farther left.  */
    58  	char *grouping;
    59  
    60  	/* Monetary information.  */
    61  
    62  	/* First three chars are a currency symbol from ISO 4217.
    63  	   Fourth char is the separator.  Fifth char is '\0'.  */
    64  	char *int_curr_symbol;
    65  	char *currency_symbol;	/* Local currency symbol.  */
    66  	char *mon_decimal_point;	/* Decimal point character.  */
    67  	char *mon_thousands_sep;	/* Thousands separator.  */
    68  	char *mon_grouping;	/* Like `grouping' element (above).  */
    69  	char *positive_sign;	/* Sign for positive values.  */
    70  	char *negative_sign;	/* Sign for negative values.  */
    71  	char int_frac_digits;	/* Int'l fractional digits.  */
    72  	char frac_digits;	/* Local fractional digits.  */
    73  	/* 1 if currency_symbol precedes a positive value, 0 if succeeds.  */
    74  	char p_cs_precedes;
    75  	/* 1 iff a space separates currency_symbol from a positive value.  */
    76  	char p_sep_by_space;
    77  	/* 1 if currency_symbol precedes a negative value, 0 if succeeds.  */
    78  	char n_cs_precedes;
    79  	/* 1 iff a space separates currency_symbol from a negative value.  */
    80  	char n_sep_by_space;
    81  	/* Positive and negative sign positions:
    82  	   0 Parentheses surround the quantity and currency_symbol.
    83  	   1 The sign string precedes the quantity and currency_symbol.
    84  	   2 The sign string follows the quantity and currency_symbol.
    85  	   3 The sign string immediately precedes the currency_symbol.
    86  	   4 The sign string immediately follows the currency_symbol.  */
    87  	char p_sign_posn;
    88  	char n_sign_posn;
    89  #ifdef __USE_ISOC99
    90  	/* 1 if int_curr_symbol precedes a positive value, 0 if succeeds.  */
    91  	char int_p_cs_precedes;
    92  	/* 1 iff a space separates int_curr_symbol from a positive value.  */
    93  	char int_p_sep_by_space;
    94  	/* 1 if int_curr_symbol precedes a negative value, 0 if succeeds.  */
    95  	char int_n_cs_precedes;
    96  	/* 1 iff a space separates int_curr_symbol from a negative value.  */
    97  	char int_n_sep_by_space;
    98  	/* Positive and negative sign positions:
    99  	   0 Parentheses surround the quantity and int_curr_symbol.
   100  	   1 The sign string precedes the quantity and int_curr_symbol.
   101  	   2 The sign string follows the quantity and int_curr_symbol.
   102  	   3 The sign string immediately precedes the int_curr_symbol.
   103  	   4 The sign string immediately follows the int_curr_symbol.  */
   104  	char int_p_sign_posn;
   105  	char int_n_sign_posn;
   106  #else
   107  	char __int_p_cs_precedes;
   108  	char __int_p_sep_by_space;
   109  	char __int_n_cs_precedes;
   110  	char __int_n_sep_by_space;
   111  	char __int_p_sign_posn;
   112  	char __int_n_sign_posn;
   113  #endif
   114  };
   115  
   116  /* Set and/or return the current locale.  */
   117  extern char *setlocale(int __category, const char *__locale) __THROW;
   118  
   119  /* Return the numeric/monetary information for the current locale.  */
   120  extern struct lconv *localeconv(void) __THROW;
   121  
   122  #ifdef	__USE_XOPEN2K8
   123  /* POSIX.1-2008 extends the locale interface with functions for
   124     explicit creation and manipulation of 'locale_t' objects
   125     representing locale contexts, and a set of parallel
   126     locale-sensitive text processing functions that take a locale_t
   127     argument.  This enables applications to work with data from
   128     multiple locales simultaneously and thread-safely.  */
   129  # include <bits/types/locale_t.h>
   130  
   131  /* Return a reference to a data structure representing a set of locale
   132     datasets.  Unlike for the CATEGORY parameter for `setlocale' the
   133     CATEGORY_MASK parameter here uses a single bit for each category,
   134     made by OR'ing together LC_*_MASK bits above.  */
   135  extern locale_t newlocale(int __category_mask, const char *__locale, locale_t __base) __THROW;
   136  
   137  /* These are the bits that can be set in the CATEGORY_MASK argument to
   138     `newlocale'.  In the GNU implementation, LC_FOO_MASK has the value
   139     of (1 << LC_FOO), but this is not a part of the interface that
   140     callers can assume will be true.  */
   141  # define LC_CTYPE_MASK		(1 << __LC_CTYPE)
   142  # define LC_NUMERIC_MASK	(1 << __LC_NUMERIC)
   143  # define LC_TIME_MASK		(1 << __LC_TIME)
   144  # define LC_COLLATE_MASK	(1 << __LC_COLLATE)
   145  # define LC_MONETARY_MASK	(1 << __LC_MONETARY)
   146  # define LC_MESSAGES_MASK	(1 << __LC_MESSAGES)
   147  # define LC_PAPER_MASK		(1 << __LC_PAPER)
   148  # define LC_NAME_MASK		(1 << __LC_NAME)
   149  # define LC_ADDRESS_MASK	(1 << __LC_ADDRESS)
   150  # define LC_TELEPHONE_MASK	(1 << __LC_TELEPHONE)
   151  # define LC_MEASUREMENT_MASK	(1 << __LC_MEASUREMENT)
   152  # define LC_IDENTIFICATION_MASK	(1 << __LC_IDENTIFICATION)
   153  # define LC_ALL_MASK		(LC_CTYPE_MASK \
   154  				 | LC_NUMERIC_MASK \
   155  				 | LC_TIME_MASK \
   156  				 | LC_COLLATE_MASK \
   157  				 | LC_MONETARY_MASK \
   158  				 | LC_MESSAGES_MASK \
   159  				 | LC_PAPER_MASK \
   160  				 | LC_NAME_MASK \
   161  				 | LC_ADDRESS_MASK \
   162  				 | LC_TELEPHONE_MASK \
   163  				 | LC_MEASUREMENT_MASK \
   164  				 | LC_IDENTIFICATION_MASK \
   165  				 )
   166  
   167  /* Return a duplicate of the set of locale in DATASET.  All usage
   168     counters are increased if necessary.  */
   169  extern locale_t duplocale(locale_t __dataset) __THROW;
   170  
   171  /* Free the data associated with a locale dataset previously returned
   172     by a call to `setlocale_r'.  */
   173  extern void freelocale(locale_t __dataset) __THROW;
   174  
   175  /* Switch the current thread's locale to DATASET.
   176     If DATASET is null, instead just return the current setting.
   177     The special value LC_GLOBAL_LOCALE is the initial setting
   178     for all threads and can also be installed any time, meaning
   179     the thread uses the global settings controlled by `setlocale'.  */
   180  extern locale_t uselocale(locale_t __dataset) __THROW;
   181  
   182  /* This value can be passed to `uselocale' and may be returned by it.
   183     Passing this value to any other function has undefined behavior.  */
   184  # define LC_GLOBAL_LOCALE	((locale_t) -1L)
   185  
   186  #endif
   187  
   188  __END_DECLS
   189  #endif				/* locale.h  */