Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ montbl(1M) — CX/UX 6.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

localeconv(3C)

setlocale(3C)

lconv(4)

chrtbl(1M)

montbl(1M)

NAME

montbl − create monetary database

SYNOPSIS

montbl [ −o outfile ] [ −d ] [ −v ] infile

DESCRIPTION

The montbl command takes as input a specification file, infile, that describes the formatting conventions for monetary and numeric quantities for a specific locale. 

−o outfile Write the monetary output on outfile; otherwise, write the output on a file named LC_MONETARY. 

−d Display the constructed lconv structure on stdout.  If no infile is specified, display the lconv structure obtained using localeconv(3C) in the current locale. 

−v Display information about input and output files. 

The output of montbl is suitable for use by the localeconv(3C) function.  Before outfile can be used by localeconv(), it must be installed in the /usr/lib/locale/locale directory with the name LC_MONETARY by someone who is super-user or a member of group bin.  locale is the locale whose monetary formatting conventions are described in infile.  This file must be readable by user, group, and other; no other permissions should be set.  To use formatting conventions for monetary quantities described in this file, use setlocale(3C) to change the locale for category LC_MONETARY to locale. 

Once installed, this file will be used by the localeconv() function to initialize the monetary specific fields of a structure of type struct lconv.  For a description of each field in this structure, see lconv(4).  The following illustration shows the default values in the C locale. 

struct lconv {
char ∗decimal_point;/∗ "." ∗/
char ∗thousands_sep;/∗ "" (zero length string) ∗/
char ∗grouping;/∗ "" ∗/
char ∗int_curr_symbol;/∗ "" ∗/
char ∗currency_symbol;/∗ "" ∗/
char ∗mon_decimal_point;/∗ "" ∗/
char ∗mon_thousands_sep;/∗ "" ∗/
char ∗mon_grouping;/∗ "" ∗/
char ∗positive_sign;/∗ "" ∗/
char ∗negative_sign;/∗ "" ∗/
char int_frac_digits;/∗ CHAR_MAX ∗/
char frac_digits;/∗ CHAR_MAX ∗/
char p_cs_precedes;/∗ CHAR_MAX ∗/
char p_sep_by_space;/∗ CHAR_MAX ∗/
char n_cs_precedes;/∗ CHAR_MAX ∗/
char n_sep_by_space;/∗ CHAR_MAX ∗/
char p_sign_posn;/∗ CHAR_MAX ∗/
char n_sign_posn;/∗ CHAR_MAX ∗/
};

The specification file may also specify the values for the first three members of the lconv structure: decimal_point, thousands_sep, and grouping, which are set by the LC_NUMERIC category of setlocale(3C).  If any numeric quantities are specified, a separate output file is produced.  This separate output file, usually named LC_NUMERIC, must be installed as /usr/lib/locale/locale/LC_NUMERIC before it can be used by setlocale(3C) and localeconv(3C). 

If no monetary specifications are provided in infile , then no monetary output file will be produced. 

Each member’s value is given on a line with the following format:

 keyword <white space> value
 

where keyword is identical to the struct lconv field name and value is a quoted string for those fields that are a char ∗ and an integer for those fields that are an int. For example,

 int_curr_symbol"ITL."
int_frac_digits0
 

will set the international currency symbol and the number of fractional digits to be displayed in an internationally formatted monetary quantity to ITL. and 0, respectively. 

CHAR_MAX may be specified by using “∗” instead of an integer value or “\∗” within quoted strings. 

Blank lines and lines starting with a # are taken to be comments and are ignored.  A character in a string may be in octal or hex representation.  For example, \141 or \x61 could be used to represent the letter ’a’.  If there is no specification line for a given structure member, then an empty string or CHAR_MAX is used for that member, as appropriate. 

Two additional keywords are recognized. 

LC_MONETARY
can be followed by the name of the output file to use for monetary information when outfile is not provided on the command line. 

LC_NUMERIC
can be followed by the name of the output file to use for numeric information.  If this is not specified and any numeric information is provided, the file LC_NUMERIC will be created in the current directory. 

EXAMPLE

Given below is an example of what the monetary specification file for Italy would look like:

# Italy
 int_curr_symbol"ITL."
currency_symbol"L."
mon_decimal_point""
mon_thousands_sep"."
mon_grouping"\3"
positive_sign""
negative_sign"-"
int_frac_digits0
frac_digits0
p_cs_precedes1
p_sep_by_space0
n_cs_precedes1
n_sep_by_space0
p_sign_posn1
n_sign_posn1

FILES

/usr/lib/locale/locale/LC_MONETARY
LC_MONETARY database for locale

/usr/lib/locale/locale/LC_NUMERIC
LC_NUMERIC database for locale

/usr/lib/locale/src/montbl_C
input file used to construct LC_MONETARY in the default locale. 

/usr/lib/locale/src/numtbl_C
input file used to construct LC_NUMERIC in the default locale. 

SEE ALSO

localeconv(3C), setlocale(3C), lconv(4) in the CX/UX Programmer’s Reference Manual.  chrtbl(1M) in the CX/UX System Administrator’s Reference Manual. 

NOTES

Support for numeric information, the LC_MONETARY and LC_NUMERIC keywords, and synonyms for CHAR_MAX are CX/UX extensions.  Other systems use chrtbl(1M) to specify numeric information; either facility can be used in CX/UX. 

CX/UX Administrator’s Reference

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026