The C importer uses default values when mapping C data types to message model elements.
The following table shows how the C definitions influence the XML schema settings in the message model. Some xsd types are enclosed in angle brackets (< >). The brackets indicate 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 type | 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 | maxOccurs=2 |
signed char | xsd:byte | |
signed char[2] | xsd:byte | maxOccurs=2 |
int | xsd:int | |
int[2] | xsd:int | maxOccurs=2 |
int[2][3] | xsd:int | maxOccurs=6 |
unsigned int | xsd:unsignedInt | |
short | xsd:short | |
unsigned short | xsd:unsignedShort | |
|
xsd:int | |
|
xsd:unsignedInt | |
|
xsd:long | |
|
xsd:unsignedLong | |
float | xsd:float | |
double | xsd:double | |
long double | xsd:double | |
<any pointer type> | xsd:hexBinary | |
<any enum> | (see note 1) |
The following table shows how C definitions influence the DFDL properties of the elements that are generated in the message model.
C data type | DFDL properties |
---|---|
char | Length = 1 Length Units = bytes |
char[10] | Length = 10 Length Units = bytes String Justification = left |
char[10][3] | Length = 3 (and Max Occurs = 10) Length Units = bytes String Justification = left |
char[10][3][6] | Length =6 (and Max Occurs = 30) Length Units = bytes String Justification = left |
unsigned char | Length = 1 Length Units = bytes |
unsigned char[2] | Length = 1 (and Max Occurs = 2) Length Units = bytes |
signed char | Length = 1 Length Units = bytes |
signed char[2] | Length = 1 (and Max Occurs = 2) Length Units = bytes |
int | Length = 4 Length Units = bytes |
int[2] | Length = 4 (and Max Occurs = 2) Length Units = bytes |
int[2][3] | Length = 4 (and Max Occurs = 6) Length Units = bytes |
unsigned int | Length = 4 Length Units = bytes |
short | Length = 2 Length Units = bytes |
unsigned short | Length = 2 Length Units = bytes |
|
Length = 4 (see note 2) Length Units = bytes |
|
Length = 4 (see note 2) Length Units = bytes |
|
Length = 8 Length Units = bytes |
|
Length=8 Length Units = bytes |
float | Length = 4 Length Units = bytes |
double | Length = 8 Length Units = bytes |
long double | Length = 8 Length Units = bytes |
<any pointer type> | Length = 4 Length Units = bytes |
<any enum> | (see note 1) |