www.pudn.com > sdk_host_2520.rar > build_pdm.pl


#;/////////////////////////////////////////////////////////////////////////////// 
#; Copyright(C) SigmaTel, Inc. 2000-2001 
#; 
#; Filename: build_PDM.pl 
#; Description:  
#     Builds the Primary DBCS Map resource (prefix_PDM.src) 
#;/////////////////////////////////////////////////////////////////////////////// 
 
 
use strict; 
require "PDM_SDM.pl"; 
 
 
 
 
#;/////////////////////////////////////////////////////////////////////////////// 
#;> Name: build_PDM 
#; 
#;  Type: Function 
#   Prototype:   build_PDM($PrimaryDBCSMapRef, $CodePagePrefix, $defaultUnicodeChar) 
#;  Description: Builds the Primary DBCS Map resource (prefix_PDM.src) 
#;  Inputs:      $PrimaryDBCSMapRef - Reference to Primary DBCS Map (a hash) 
#                $CodePagePrefix    - First part of Code Page Filename (before the 
#                                     ".TXT").  Used in naming output files. 
#                                     Example: "CP1250" 
#                $defaultUnicodeChar - Default Unicode character: use when no 
#                                      mapping is defined. 
#;  Outputs:     Returns 1 for success, 0 for failure.  (May not return on some 
#                errors.) 
# 
#;  Notes:  
#     PrimaryDBCSMapRef is a reference to a hash that described the mapping 
#     of DBCS characters.  Hash keys are two digit hex values (0x00-0xff). 
#     If the value of the hash for some key is not defined, treat that key 
#     as a single byte character (SBC) and use the defaultUnicodeChar as its  
#     value. 
# 
#     If the hash at some key is a scalar, treat it as a SBC and use the scalar 
#     value as the Unicode character. 
# 
#     If the hash as some key is a reference, it should refer to another hash. 
#     Treat the key as a Lead Byte.  The referenced hash is indexed by a second 
#     set of two digit hex values (keys), which map the Trailing Byte to some 
#     Unicode character (following the same rules for SBCs, above - i.e. if 
#     not defined, use the defaultUnicodeChar). 
# 
#;< 
#;/////////////////////////////////////////////////////////////////////////////// 
sub build_PDM() { 
    my $pPrimaryDBCSMapRef = shift; 
    my $CodePagePrefix = shift; 
    my $defaultUnicodeCharacter = shift; 
 
    print STDERR "Creating the PDM resource\n"; 
 
    build_PDM_src("$CodePagePrefix\_PDM.src", $pPrimaryDBCSMapRef, $defaultUnicodeCharacter); 
 
    return 1; 
} 
 
 
1;	# Return TRUE for "require" 
 
#;/////////////////////////////////////////////////////////////////////////////// 
#;/////////////////////////////////////////////////////////////////////////////// 
#;///////////////////////////////////////////////////////////////////////////////