The panel described in this topic allows you to select the physical properties that you want.
C header file
When you choose
to create a new message definition file from an existing C header file, you
are presented with the following panels:
Panel properties
- Source platform
- This property sets the defaults for Codepage, Floating point format, and Byte order.
- (Unspecified)
- Msvc
- icc
- AIXgcc
- AIXxlc
- OS390
- Codepage
- This property shows the default for what has been set using the Source platform property. Do not change this value.
- Floating point format
- This property shows the default for what has been set using the Source platform property. Do not change this value.
- IEEE Extended INTEL
- IEEE Extended AIX®
- IEEE Extended OS/390®
- IEEE Non-Extended
- IBM® 390 Hexadecimal
Storage layout
- Address size
- Select the size matching that of the program producing or consuming CWF messages.
- 32 bit - the default
- 64 bit
Specify the native address size of the hardware for which the C header was designed. This property affects:
- The CWF length of an imported pointer (32-bit requires 4 bytes, 64-bit requires 8 bytes)
- The CWF length of a long (32-bit requires 4 bytes, 64-bit requires 8 bytes)
- Size of long double
- This property shows the default for what has been set using the Source platform property. Do not change this value.
- 64 bit - the default
- 128 bit
- Byte order
- Little endian - the default
- Big endian
- Pack level
- This property affects the CWF Byte Alignment, Leading Skip Count, and Trailing Skip Count of assigned elements. A C importer aligns a variable on a boundary equal to its own size (a 4-byte integer aligns on a 4-byte boundary). The compiler adds slack space between variables in a structure to allow this alignment. The Pack level setting gives a maximum alignment value for a variable. If your messages contain slack space, select the Pack level matching that of the program producing or consuming CWF messages. Select '1' if no slack space is desired. For example:
/* Test data alignment
* Struct containing an int (naturally aligns on word boundary)
*
* +---------------------------------------------------
* | a,b,c = a byte of the element
* | _ = a byte of padding
* |---------------------------------------------------
* | 111 |
* | pack | 1234 5678 9012 | Total structure size
* | ----------+----------------+----------------------
* | 1-byte | abbb bc | 6 bytes
* | 2-byte | a_bb bbc_ | 8 bytes
* | 4-byte | a___ bbbb c___ | 12 bytes
* | 8-byte | a___ bbbb c___ | 12 bytes
* +---------------------------------------------------
*****************************************************/
struct _align01 {
char align_01_a;
int align_01_b;
char align_01_c;
};
- Enum size
- Size (in bytes) of an enum. This property relates directly to the CWF Length Count. If you select Compact, the smallest size that contains the largest value in the enumeration is set. Select the size matching that of the program producing or consuming CWF messages.
- 1
- 2
- 4
- Compact - the default
- String encoding
- Null Terminated. When you select Null Terminated, a C char array of size n is imported as an element of type xsd:string with a maxLength facet of n-1. If a CWF physical format is defined for the message set, the CWF physical type of the element is Null Terminated String.
- Fixed Length. When you select Fixed Length (the default), a C char array of size n is imported as an element of type xsd:string with a maxLength facet of n. If a CWF physical format is defined for the message set, the CWF physical type of the element is Fixed Length String with a Length Count of n. You must also select a value for Padding Char for String (see below for details).
This option only applies to character arrays that are currently imported as xsd:string. For example, it does not include "unsigned char[2]" or "signed char[2]" both of which are imported as restrictions of xsd:integer.
- Padding Char for String
- Specify the padding character that is to be used when importing the C header file. Either select from one of the predefined entries in the list, or type the character into the field. The value must resolve to a single character. Set this character in one of the following ways:
- Select SPACE, NUL (the default), 0x00, or 0xFF from the drop-down list.
- Type a character between quotes, for example "c" or 'c', where c is any alphanumeric character.
- Type a hexadecimal character code in the form 0xYY, where YY is a hexadecimal value.
- Type a decimal character code in the form YY, where YY is a decimal value.
- Type a Unicode value in the form U+xxxx, where xxxx is a Unicode value specified in hexadecimal.
This option is available only if String encoding is set to Fixed Length.