10.12.2012 Views

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

Oracle C++ Call Interface Programmer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

OTT Utility Reference<br />

Once the OTT utility has read the name of a database entity, it translates the name<br />

from the character set used by the OTT utility to the compiler's character set. If a<br />

translation of the name appears in the INTYPE file, then the OTT utility uses that<br />

translation.<br />

Otherwise, the OTT utility attempts to translate the name as follows:<br />

1. If the OTT character set is a multibyte character set, all multibyte characters in<br />

the name that have single-byte equivalents are converted to those single-byte<br />

equivalents.<br />

2. The name is converted from the OTT character set to the compiler character set.<br />

The compiler character set is a single-byte character set such as US7ASCII.<br />

3. The case of letters is set according to how the CASE parameter is defined, and<br />

any character that is not legal in a C or <strong>C++</strong> identifier, or that has no translation<br />

in the compiler character set, is replaced by an underscore character (_). If at<br />

least one character is replaced by an underscore, then the OTT utility gives a<br />

warning message. If all the characters in a name are replaced by underscores,<br />

the OTT utility gives an error message.<br />

Character-by-character name translation does not alter underscores, digits, or<br />

single-byte letters that appear in the compiler character set, so legal C or <strong>C++</strong><br />

identifiers are not altered.<br />

Name translation may, for example, translate accented single-byte characters such<br />

as o with an umlaut or an a with an accent grave to o or a, with no accent, and may<br />

translate a multibyte letter to its single-byte equivalent. Name translation will<br />

typically fail if the name contains multibyte characters that lack single-byte<br />

equivalents. In this case, the user must specify name translations in the INTYPE file.<br />

The OTT utility will not detect a naming clash caused by two or more database<br />

identifiers being mapped to the same C name, nor will it detect a naming problem<br />

where a database identifier is mapped to a C keyword.<br />

Restriction Affecting the OTT Utility: File Name Comparison<br />

Currently, the OTT utility determines if two files are the same by comparing the<br />

filenames provided by the user either on the command line or in the INTYPE file.<br />

But one potential problem can occur when the OTT utility needs to know if two<br />

filenames refer to the same file. For example, if the OTT-generated file foo.h requires<br />

a type declaration written to foo1.h, and another type declaration written to<br />

/private/smith/foo1.h, then the OTT utility should generate one #include if<br />

the two files are the same, and two #includes if the files are different. In practice,<br />

How to Use the Object Type Translator Utility 7-135

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!