C header file: Select the physical properties

New message definition file wizard, C header file option, select target message set reference material.

C header file

When you are using the option C header file in the New message definition file wizard to create a message definition, the following are the list of panels you will be presented with:

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 shows the default for what has been set using the Source platform property. This should not be adjusted.
  • ISO8859-1
  • Cp037
  • Cp1252
Floating point format
This shows the default for what has been set using the Source platform property. This should not be adjusted.
  • IEEE Extended INTEL
  • IEEE Extended AIX
  • IEEE Extended OS/390
  • IEEE Non-Extended
  • IBM 390 Hexadecimal

Storage layout

Address size
Specify the native address size of the hardware that the C header was designed for. This affects:
  • the CWF length of an imported pointer (4|8 bytes)
  • the CWF length of a 'long' (4|8 bytes)

Select the size matching that of the program producing or consuming CWF messages.

  • 32 bit - the default
  • 64 bit
Size of long double
This shows the default for what has been set using the Source platform property. This should not be adjusted.
  • 64 bit - the default
  • 128 bit
Byte order
  • Little Endian - the default
  • Big Endian
Pack level
This affects the CWF Byte Alignment and Leading and Trailing Skip Count of assigned elements. A C importer would naturally align a variable on a boundary equal to its own size (a 4 byte integer aligns on a 4 byte boundary). The compiler would add slack space between variables in a structure to allow this. The Pack 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;
};
  • 1
  • 2
  • 3
  • 8 - the default
  • 16
Enum size
Size (in bytes) of an enum. This relates directly to the CWF Length Count. Setting Compact will set the smallest size that contains the largest value in the enumeration. Select the size matching that of the program producing or consuming CWF messages
  • 1
  • 2
  • 4
  • Compact - the default
String encoding
  • Null terminated. When Null terminated is selected, 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 Fixed length is selected (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.

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
Enter the padding character that is to be used when importing the C header file. Either select from one of the predefined entries in the listed, or specify one by typing it into the field. The value must resolve to a single character. Set this character in one of the following ways:
  • Select NUL (the default), SPACE, or ‘0’ from the drop-down list.
  • Enter a character between quotes, for example "c" or 'c', where c is any alphanumeric character.
  • Enter a hexadecimal character code in the form 0xYY where YY is a hexadecimal value.
  • Enter a decimal character code in the form YY where YY is a decimal value.
  • Enter a Unicode value in the form U+xxxx where xxxx is a Unicode value specified in hexadecimal.

This option is greyed out if the String Encoding option is other than Fixed length.

Related tasks
Importing from C
Related reference
New message definition file wizard
New message definition file wizard: C header file