Data Definition Language (DDL) Reference Manual

Definition Attributes
Data Definition Language (DDL) Reference Manual529431-004
6-58
Specifying TYPE data-type
In Example 6-47 on page 6-58, a simple variable of type bit_1_def has a different
size from the field bits_0 in a variable having the type bit_struct_def.
Example 6-47. Bit Field Output for C
DDL Type C Type
DEF Bit-1 TYPE BIT 1
DEF New-Bit-1 TYPE Bit-1
DEF Bit-10 TYPE BIT 10
UNSIGNED.
DEF Bit-Map.
2 Bits-8 TYPE BIT 8.
2 Bits-3 TYPE BIT 3 UNSIGNED.
2 Bits-10 TYPE BIT 10.
End.
DEF Bit-Struct.
2 Bits-0 TYPE Bit-1.
2 Bits-1-To-10 TYPE Bit-10.
End.
typedef unsigned short bit_1_def;
typedef bit_1_def new_bit_1_def;
typedef unsigned short bit_10_def;
#pragma fieldalign shared2 __bit_map
typedef struct __bit_map
{
short bits_8:8;
unsigned short bits_3:3;
short bits_10:10;
} bit_map_def;
#pragma fieldalign shared2 __bit_struct
typedef struct
{
unsigned short bits_0:1;
unsigned short bits_1_to_10:10;
} bit_struct_def;
Example 6-48. Bit Field Output for C (page 1 of 2)
DDL Type C Type
DEF Bit-Fillers
2 Field-1 TYPE CHARACTER 3.
2 Filler TYPE BIT 4.
2 Bit-Field-1 TYPE BIT 5.
2 Filler TYPE BINARY.
2 Field-2 TYPE BINARY 32.
End.
#pragma fieldalign shared2 __bit_fillers
typedef struct
{
char field_1[3];
short filler_0:4;
short bit_field_1:5;
short filler_1[2];
long field_2;
} bit_fillers_def;
DEF Enum-Spec Begin
TYPE ENUM.
89 Val-1 Value 1.
89 Val-2 Value 3.
89 Val-3 Value 0.
End.
enum
{
val_1 = 1,
val_2 = 3,
val_3 = 0