Definition Attributes
Data Definition Language (DDL) Reference Manual — 426798-002
6- 64
TYPE Clause
In the preceding examples, note that 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
.
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
DEF Bits-With-Enums.
02 Bit-Field-1 TYPE BIT 8
ENUM Enum-Spec.
02 Bit-Field-2 TYPE BIT 4.
End.
typedef short enum_spec_def;
#pragma fieldalign shared2 __bits_with_enums
typedef struct __bits_with_enums
{
short bit_field_1:8;
short bit_field_2:4;
} bits_with_enums_def;
DEF Reused-Bits.
02 Data-Item Type Binary.
02 Bits-Layout-1
Redefines Data-Item.
03 F-11 TYPE BIT 5.
03 F-12 TYPE BIT 6.
03 F-13 TYPE BIT 4.
02 Bits-Layout-2
Redefines Data-Item.
03 F-21 TYPE BIT 4.
03 F-22 TYPE BIT 3.
End.
#pragma fieldalign shared2 __reused_bits
typedef struct __reused_bits
{
union
{
short data_item;
struct
{
short f_11:5;
short f_12:6;
short f_13:4;
} bits_layout_1;
struct
{
short f_21:4;
short f_22:3;
} bits_layout_2;
} u_data_item;
} reused_bits_def;
Содержание DDL D40
Страница 36: ...Introduction to DDL Data Definition Language DDL Reference Manual 426798 002 1 14 Examining a Dictionary ...
Страница 66: ...Named Constants Data Definition Language DDL Reference Manual 426798 002 4 10 Standard SPI Constants ...
Страница 230: ...Dictionary Manipulation Statements Data Definition Language DDL Reference Manual 426798 002 8 14 SHOW USE OF Statement ...
Страница 370: ...Dictionary Maintenance Data Definition Language DDL Reference Manual 426798 002 10 24 Converting a Dictionary ...
Страница 456: ...Sample Schemas Data Definition Language DDL Reference Manual 426798 002 B 12 ASSNDDL Statements ...
Страница 470: ...DDL Data Translation Data Definition Language DDL Reference Manual 426798 002 C 14 ...
Страница 528: ...Dictionary Reports Data Definition Language DDL Reference Manual 426798 002 E 8 Requesting Reports ...
Страница 552: ...DDL Alignment Rules Data Definition Language DDL Reference Manual 426798 002 H 4 FIELDALIGN_SHARED8 Alignment Rules ...
Страница 576: ...Index Data Definition Language DDL Reference Manual 426798 002 Index 22 Special Characters ...