WebSphere Message Brokers
File: ad06890_
Writer: Terry Cowling

Reference topic

This build: July 31, 2007 21:22:56

Importing from C: supported features

This section describes the defaults that the C importer uses when mapping C data types to MRM data types.

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 length restriction; for numeric types the purpose is to add a minimum and/or maximum value restriction.

The Packed data structure data type is outside the scope of the C importer.

C data type Logical type Notes
Char xsd:string- length=1
Char[10] xsd:string- length=10
Char[10][3] xsd:string- length=3
Char[10][3][6] xsd:string- length=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- length=(see note 2)
<any enum>   (see note 3)

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

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

Length Units = Bytes

 
Char[10] Fixed Length Length Count = 10

Length Units = Bytes

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

(and Max Occurs = 10)

Length Units = bytes

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

(and Max Occurs = 30)

Length Units = bytes

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

(and Max Occurs = 2)

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

(and Max Occurs = 2)

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

(and Max Occurs = 2)

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

(and Max Occurs = 6)

Signed = yes
Unsigned Int Integer Length Count = 4 Signed = no
Short Integer Length Count = 2 Signed = yes
Unsigned Short Integer Length Count = 2 Signed = no
Long Integer Length Count = 4 (see note 4) Signed = yes
Long Long Int Integer Length Count = 8 Signed = yes
Float Float Length Count = 4  
Double Float Length Count = 8  
Long Double (see note 1) Float Length Count = 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 count is affected by the Address Size C importer option as follows:
    • For 32 bit, CWF length count = 4 bytes.
    • For 64 bit, CWF length count = 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 count = 1 byte.
    • For 2: Logical type = xsd:short, CWF physical type = Integer, CWF length count = 2 bytes.
    • For 4: Logical type = xsd:int, CWF physical type = Integer, CWF length count = 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 count = 4 bytes.
    • For 64 bit: CWF length count = 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 count 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, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:22:56

ad06890_ This topic's URL is: