Importing from C: supported features

This section describes the defaults that the C importer uses when mapping C data types to message model elements.

The table below shows how the C definitions influence the XML Schema settings in the message model. Some xsd types have '-' after the type. This indicates that it is an anonymous simple type based on this type. For strings, the purpose of the anonymous type is to add a maximum length restriction; for numeric types, the purpose of the anonymous type is to add either a minimum or a maximum value restriction.

C data type XML Schema data Notes
Char xsd:string- maxlength=1
Char[10] xsd:string- maxlength=10
Char[10][3] xsd:string- maxlength=3
Char[10][3][6] xsd:string- maxlength=6
Unsigned Char xsd:unsignedByte  
Unsigned Char[2] xsd:unsignedByte  
Signed Char xsd:byte  
Signed Char[2] xsd:byte  
Int xsd:int  
Int[2] xsd:int  
Int[2][3] xsd:int  
Unsigned Int xsd:unsignedInt  
Short xsd:short  
Unsigned Short xsd:unsignedShort  
Long xsd:int  
Long Long Int xsd:long  
Float xsd:float  
Double xsd:double  
Long Double (see note 1) xsd:double  
<any pointer type> xsd:hexBinary- maxlength=(see note 2)
<any enum>   (see note 3)

The following table shows how C definitions influence the physical MRM CWF characteristics of the elements that are generated in the message model.

C data type CWF Physical type CWF Length characteristics Other CWF characteristics
Char Fixed Length Length = 1

Length Units = Bytes

 
Char[10] Fixed Length Length = 10

Length Units = Bytes

Left justify
Char[10][3] Fixed Length Length = 3

(and Max Occurs = 10)

Length Units = bytes

Left justify
Char[10][3][6] Fixed Length Length =6

(and Max Occurs = 30)

Length Units = bytes

Left justify
Unsigned Char Integer Length = 1 Signed = no
Unsigned Char[2] Integer Length = 1

(and Max Occurs = 2)

Signed = no
Signed Char Integer Length = 1 Signed = yes
Signed Char[2] Integer Length = 1

(and Max Occurs = 2)

Signed = yes
Int Integer Length = 4 Signed = yes
Int[2] Integer Length = 4

(and Max Occurs = 2)

Signed = yes
Int[2][3] Integer Length = 4

(and Max Occurs = 6)

Signed = yes
Unsigned Int Integer Length = 4 Signed = no
Short Integer Length = 2 Signed = yes
Unsigned Short Integer Length = 2 Signed = no
Long Integer Length = 4 (see note 4) Signed = yes
Long Long Int Integer Length = 8 Signed = yes
Float Float Length = 4  
Double Float Length = 8  
Long Double (see note 1) Float Length = 8  
<any pointer type>   (see note 2)  
<any enum> Integer (see note 3)  
Notes:
  1. Do not set the value of C importer option size of long double to 128 bit. This will not import successfully. Please use the default 64 bit.
  2. The length is affected by the Address Size C importer option as follows:
    • For 32 bit, CWF length = 4 bytes.
    • For 64 bit, CWF length = 8 bytes.
  3. The type and length of an enum is affected by the Size of enum C importer option as follows:
    • For 1: Logical type = xsd:byte, CWF physical type = Integer, CWF length = 1 byte.
    • For 2: Logical type = xsd:short, CWF physical type = Integer, CWF length = 2 bytes.
    • For 4: Logical type = xsd:int, CWF physical type = Integer, CWF length = 4 bytes.
    • For Compact: The smallest representation is chosen that the enumeration fits into.
  4. The length of a long is affected by the Address Size C importer option as follows:
    • For 32 bit: CWF length = 4 bytes.
    • For 64 bit: CWF length = 8 bytes.
  5. Element names that clash with Java language keywords are modified by prefixing them with a single underscore character.
  6. The _Packed keyword is not supported. Only ANSI C declarations are supported.
  7. The C long long data type is not supported.
  8. C++ object oriented extensions are not supported. Only ANSI C declarations are supported.
  9. Pointers will be imported as xsd:integer with CWF length set to 4.
  10. Recursive C structures are not supported. If a nested structure contains a structure with a name that is the same as the parent structure, the import succeeds but the logical definitions are not correct. To avoid this problem, ensure that the name of the nested structure is not the same as that of the outer or parent structure.
Related concepts
Message modeling
The message model
Related tasks
Developing message models
Working with a message definition file
Working with message model objects
Related reference
Message model reference information
Message model object properties
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2009Copyright IBM Corporation 1999, 2009.
Last updated : 2009-01-07 15:20:54

ad06890_