csrc(8dce) — Maintenance
NAME
csrc — Builds a DCE character and code set registry on a host
SYNOPSIS
csrc [i source_filename] [m intermediate_cs_list] [o destination_filename]
Arguments
i source_filename
Reads code set values from the source file you specify rather than from the default code set registry source file /usr/lib/nls/csr/code_set_registry.txt.
m intermediate_cs_list
Adds code set names to the code set registry file’s intermediate code set priority list.
o destination_filename
Places the generated code set registry file in the location you specify rather than in the default location /usr/lib/nls/csr/code_set_registry.db.
Description
The code set registry compiler csrc creates a character and code set registry file from the information supplied in a character and code set registry source file.
A code set registry source file is composed of a series of code set records. Each record describes, in human-readable form, the mapping between an OSF-registered or (optionally) a user-defined unique code set value and the character string that a given operating system uses when referring to that code set (called the local code set name).
A code set registry file is the binary version of the source file; the DCE RPC routines for character and code set interoperability use the file to obtain a client’s or a server’s supported code sets and to translate between operating system-dependent names for code sets and the unique identifiers assigned to them. A code set registry file must exist on each host in an internationalized DCE cell (a DCE cell that supports applications that use the DCE RPC character and code set interoperability features).
Creating the Source File
Code set registry source files are created for input to csrc in the following two instances:
•By DCE licensees, when they are porting DCE to a specific operating system platform and plan for their DCE product to support internationalized DCE applications. In this instance, DCE licensees modify a template code set registry source file supplied on the DCE source tape to contain, for each code set that their platform supports, the local code set names for those supported code sets. Licensees can also add to this file any vendor-specific, nonOSF registered code set names and values that their platform supports.
•By cell administrators, when they are configuring machines that are part of an internationalized DCE cell. In this instance, the cell administrator adds the local code set names of any additional code sets that the site supports to the licensee-generated code set registry source file for each different operating system platform that exists in the cell. The cell administrator can also add to each platform-specific source file any site-specific, nonOSF registered code set names and values.
Each code set record specifies one code set, and has the following form:
start
field_list
end
where field_list consists of the following keyword-value or keyword-text pairs:
description text
A comment string that briefly describes the code set. The text field can contain multiple lines; use the backslash character (\^) to continue the line. Use this field to give a detailed description of the code set and character set(s).
loc_name text
A maximum 32-byte string (31 character data bytes plus a terminating NULL) that contains the operating system-specific name of a code set or the keyword NONE. Use this field to specify the name that your site uses to refer to this code set and the code set converters associated with it. For example, on UNIX platforms, code set converters are usually implemented under the iconv scheme. Check the iconv converter directory to determine the code set names.
rgy_value value
A 32-bit hexadecimal value that uniquely identifies this code set. A registry value can be one that OSF has assigned or one that a DCE licensee or cell administrator has assigned. Licensee or cell administrator-defined values must be in the range 0xf5000000 through 0xfffffff.
char_values value[:value]
One or more 16-bit hexadecimal values that uniquely identify each character set that this code set encodes. A character value can be one that OSF has assigned or one that a DCE licensee or a cell administrator has assigned. Use the : (colon) to separate multiple character set values.
max_bytes value
A 16-bit value that specifies the maximum number of bytes this code set uses to encode one character. The count should include any single-shift control characters, if used.
In the source file, braces ({!}) can be used as synonyms for the start and end keywords. Use one or more spaces or tabs to separate field names and values. introduces a comment; in this case, the csrc utility ignores everything between the comment character and the end of the line.
The OSF DCE source tape provides a partial version of a code set registry source file in the file /usr/lib/nls/csr/code_set_registry.txt. This source file contains records for all OSF-registered code sets, and assigns the text string NONE to loc_name fields intended for modification to a local code set name.
DCE licensees who port DCE to their operating system platform and who plan to support internationalized DCE RPC applications must replace the NONE text string with their local name for the code set, for each code set that their operating system platform supports. If their platform does not support a given code set, they must leave the NONE keyword in the code set record.
Cell administrators of internationalized DCE cells carry out the same procedure on the licensee-supplied, platform-specific source files that exist at their site. For each platform-specific source file, they replace the NONE keyword with the local code set names for any site-specific supported code sets.
DCE licensees and cell administrators can also add vendor-specific or site-specific code set values that have not been registered with OSF. These vendor or user-defined values must be in the range 0xf5000000 through 0xfffffff.
The following is an excerpt from the OSF-supplied code set registry source file:
start
descriptionISO 8859:1987; Latin Alphabet No. 1
loc_nameNONE
rgy_valueHx00010001
char_valuesHx0011
max_bytesI
end
start
descriptionISO 8859-2:1987; Latin Alphabet No. 2
loc_nameNONE
code_valueHx00010002
char_valuesHx0012
max_bytesI
end
start
descriptionISO 8859-3:1988; Latin Alphabet No. 3
loc_nameNONE
code_valueHx00010003
char_valuesHx0013
max_bytesI
end
start
descriptionISO 8859-6:1987; Latin-Arabic Alphabet
loc_nameNONE
code_valueHx00010006
char_valuesHx0016
max_bytesI
end
[...]
start
descriptionISO/IEC 10646-1:1993; UCS-2 Level 1
loc_nameNONE
code_valueHx00010100
char_valuesHx1000
max_bytesJ
end
[...]
start
descriptionJIS eucJP:1993; Japanese EUC
loc_nameNONE
code_valueHx00030010
char_valuesHx0011:0x0080:0x0081:0x0082
max_bytesK
end
Generating the Code Set Registry File
DCE licensees use csrc to create licensee-supplied code set registry files for their internationalized DCE product. Cell administrators of internationalized DCE cells use the csrc utility to create site-specific code set registry files for each host in the cell. The cell administrator runs the csrc program on each host in the cell.
When invoked with no options, csrc uses the default source file /usr/lib/nls/csr/code_set_registry.txt and creates the default output file /usr/lib/nls/csr/code_set_registry.db. Use the i and o options to redirect csrc to use a specific source file or generate a specific output file. The csrc utility also generates a log file named CSRC_LOG in the current directory.
Adding Intermediate Code Sets
Use the m option to add a maximum of five intermediate code set names to the code set registry file’s intermediate code set priority list. The order in which you specify intermediate code sets determines their order of precedence in the list; that is, the first intermediate code set you specify with m becomes the first intermediate code set in the priority list, and thus will be the first code set used should an intermediate code set be required for client-server communication. If you do not specify intermediate code sets with m , the universal code set ISO 10646 will be used as the default intermediate code set.
Restrictions
You need w (write) permission to the /usr/lib/nls/csr directory, which usually requires root privilege.
Examples
In the following example, the log file CSRC_LOG is created in the current working directory, testi18n_app:
csrc -i /test/i18n_app/code_set_registry.txt -o
code_set_registry.db -m euc -m sjis
Errors
A representative list of errors that might be returned is not shown here. Refer to the OSF DCE Problem Determination Guide for complete descriptions of all error messages.
Files
/usr/lib/nls/csr/code_set_registry.txt
Default pathname for code set registry source file.
/usr/lib/nls/csr/code_set_registry.db
Default pathname for code set registry object file
Related Information
Functions: dce_cf_get_csrgy_filename(3dce), dce_cs_loc_to_rgy(3rpc), dce_cs_rgy_to_loc(3rpc), rpc_rgy_get_codesets(3rpc).
Books: OSF DCE Administration Guide, OSF DCE Application Development Guide—Core Components.