OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [locale/] [locale.tex] - Diff between revs 1005 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 1005 Rev 1765
@node Locale
@node Locale
@chapter Locale (@file{locale.h})
@chapter Locale (@file{locale.h})
 
 
A @dfn{locale} is the name for a collection of parameters (affecting
A @dfn{locale} is the name for a collection of parameters (affecting
collating sequences and formatting conventions) that may be different
collating sequences and formatting conventions) that may be different
depending on location or culture.  The @code{"C"} locale is the only
depending on location or culture.  The @code{"C"} locale is the only
one defined in the ANSI C standard.
one defined in the ANSI C standard.
 
 
This is a minimal implementation, supporting only the required @code{``C''}
This is a minimal implementation, supporting only the required @code{``C''}
value for locale; strings representing other locales are not
value for locale; strings representing other locales are not
honored.  (@code{``''} is also accepted; it represents the default locale
honored.  (@code{``''} is also accepted; it represents the default locale
for an implementation, here equivalent to  @code{``C''}.
for an implementation, here equivalent to  @code{``C''}.
 
 
 
 
@file{locale.h} defines the structure @code{lconv} to collect the
@file{locale.h} defines the structure @code{lconv} to collect the
information on a locale, with the following fields:
information on a locale, with the following fields:
 
 
@table @code
@table @code
@item char *decimal_point
@item char *decimal_point
The decimal point character used to format ``ordinary'' numbers (all
The decimal point character used to format ``ordinary'' numbers (all
numbers except those referring to amounts of money).  @code{``.''} in the
numbers except those referring to amounts of money).  @code{``.''} in the
C locale.
C locale.
 
 
@item char *thousands_sep
@item char *thousands_sep
The character (if any) used to separate groups of digits, when
The character (if any) used to separate groups of digits, when
formatting ordinary numbers.
formatting ordinary numbers.
@code{``''} in the C locale.
@code{``''} in the C locale.
 
 
@item char *grouping
@item char *grouping
Specifications for how many digits to group (if any grouping is done at
Specifications for how many digits to group (if any grouping is done at
all) when formatting ordinary numbers.  The @emph{numeric value} of each
all) when formatting ordinary numbers.  The @emph{numeric value} of each
character in the string represents the number of digits for the next
character in the string represents the number of digits for the next
group, and a value of @code{0} (that is, the string's trailing
group, and a value of @code{0} (that is, the string's trailing
@code{NULL}) means to continue grouping digits using the last value
@code{NULL}) means to continue grouping digits using the last value
specified.  Use @code{CHAR_MAX} to indicate that no further grouping is
specified.  Use @code{CHAR_MAX} to indicate that no further grouping is
desired.  @code{``''} in the C locale.
desired.  @code{``''} in the C locale.
 
 
@item char *int_curr_symbol
@item char *int_curr_symbol
The international currency symbol (first three characters), if any, and
The international currency symbol (first three characters), if any, and
the character used to separate it from numbers.
the character used to separate it from numbers.
@code{``''} in the C locale.
@code{``''} in the C locale.
 
 
@item char *currency_symbol
@item char *currency_symbol
The local currency symbol, if any.
The local currency symbol, if any.
@code{``''} in the C locale.
@code{``''} in the C locale.
 
 
@item char *mon_decimal_point
@item char *mon_decimal_point
The symbol used to delimit fractions in amounts of money.
The symbol used to delimit fractions in amounts of money.
@code{``''} in the C locale.
@code{``''} in the C locale.
 
 
@item char *mon_thousands_sep
@item char *mon_thousands_sep
Similar to @code{thousands_sep}, but used for amounts of money.
Similar to @code{thousands_sep}, but used for amounts of money.
@code{``''} in the C locale.
@code{``''} in the C locale.
 
 
@item char *mon_grouping
@item char *mon_grouping
Similar to @code{grouping}, but used for amounts of money.
Similar to @code{grouping}, but used for amounts of money.
@code{``''} in the C locale.
@code{``''} in the C locale.
 
 
@item char *positive_sign
@item char *positive_sign
A string to flag positive amounts of money when formatting.
A string to flag positive amounts of money when formatting.
@code{``''} in the C locale.
@code{``''} in the C locale.
 
 
@item char *negative_sign
@item char *negative_sign
A string to flag negative amounts of money when formatting.
A string to flag negative amounts of money when formatting.
@code{``''} in the C locale.
@code{``''} in the C locale.
 
 
@item char int_frac_digits
@item char int_frac_digits
The number of digits to display when formatting amounts of money to
The number of digits to display when formatting amounts of money to
international conventions.
international conventions.
@code{CHAR_MAX} (the largest number representable as a @code{char}) in
@code{CHAR_MAX} (the largest number representable as a @code{char}) in
the C locale.
the C locale.
 
 
@item char frac_digits
@item char frac_digits
The number of digits to display when formatting amounts of money to
The number of digits to display when formatting amounts of money to
local conventions.
local conventions.
@code{CHAR_MAX} in the C locale.
@code{CHAR_MAX} in the C locale.
 
 
@item char p_cs_precedes
@item char p_cs_precedes
@code{1} indicates the local currency symbol is used before a
@code{1} indicates the local currency symbol is used before a
@emph{positive or zero} formatted amount of money; @code{0} indicates
@emph{positive or zero} formatted amount of money; @code{0} indicates
the currency symbol is placed after the formatted number.
the currency symbol is placed after the formatted number.
@code{CHAR_MAX} in the C locale.
@code{CHAR_MAX} in the C locale.
 
 
@item char p_sep_by_space
@item char p_sep_by_space
@code{1} indicates the local currency symbol must be separated from
@code{1} indicates the local currency symbol must be separated from
@emph{positive or zero} numbers by a space; @code{0} indicates that it
@emph{positive or zero} numbers by a space; @code{0} indicates that it
is immediately adjacent to numbers.
is immediately adjacent to numbers.
@code{CHAR_MAX} in the C locale.
@code{CHAR_MAX} in the C locale.
 
 
@item char n_cs_precedes
@item char n_cs_precedes
@code{1} indicates the local currency symbol is used before a
@code{1} indicates the local currency symbol is used before a
@emph{negative} formatted amount of money; @code{0} indicates
@emph{negative} formatted amount of money; @code{0} indicates
the currency symbol is placed after the formatted number.
the currency symbol is placed after the formatted number.
@code{CHAR_MAX} in the C locale.
@code{CHAR_MAX} in the C locale.
 
 
@item char n_sep_by_space
@item char n_sep_by_space
@code{1} indicates the local currency symbol must be separated from
@code{1} indicates the local currency symbol must be separated from
@emph{negative} numbers by a space; @code{0} indicates that it
@emph{negative} numbers by a space; @code{0} indicates that it
is immediately adjacent to numbers.
is immediately adjacent to numbers.
@code{CHAR_MAX} in the C locale.
@code{CHAR_MAX} in the C locale.
 
 
@item char p_sign_posn
@item char p_sign_posn
Controls the position of the @emph{positive} sign for
Controls the position of the @emph{positive} sign for
numbers representing money.  @code{0} means parentheses surround the
numbers representing money.  @code{0} means parentheses surround the
number; @code{1} means the sign is placed before both the number and the
number; @code{1} means the sign is placed before both the number and the
currency symbol; @code{2} means the sign is placed after both the number
currency symbol; @code{2} means the sign is placed after both the number
and the currency symbol; @code{3} means the sign is placed just before
and the currency symbol; @code{3} means the sign is placed just before
the currency symbol; and @code{4} means the sign is placed just after
the currency symbol; and @code{4} means the sign is placed just after
the currency symbol.
the currency symbol.
@code{CHAR_MAX} in the C locale.
@code{CHAR_MAX} in the C locale.
 
 
@item char n_sign_posn
@item char n_sign_posn
Controls the position of the @emph{negative} sign for numbers
Controls the position of the @emph{negative} sign for numbers
representing money, using the same rules as @code{p_sign_posn}.
representing money, using the same rules as @code{p_sign_posn}.
@code{CHAR_MAX} in the C locale.
@code{CHAR_MAX} in the C locale.
@end table
@end table
 
 
@menu
@menu
* setlocale::  Select or query locale
* setlocale::  Select or query locale
@end menu
@end menu
 
 
@page
@page
@include locale/locale.def
@include locale/locale.def
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.