3. Basic mapping tokens
Basic mapping tokens provide target specific detail for specific language features that are defined to be target dependent. This detail need not be fixed for a particular target architecture, but needs to provide compatibility with any external library with which an application program is to be linked.
Tokens specific to the C and Fortran language families are included. Like the target dependency tokens, it is again recommended that these tokens should not be used directly within application programs. They are designed for use within LPI definitions, which can provide a more appropriate interface for applications.
Every operating system variant of an installer should have associated with it, a capsule containing the definitions of all the tokens specificed within §3.
3.1. C mapping tokens
3.1.1. .~char_width
-> NAT
.~char_width
is the number of bits required to store values of the representation VARIETY
that corresponds to the C type char
.
3.1.2. .~short_width
-> NAT
.~short_width
is the number of bits required to store values of the representation VARIETY
that corresponds to the C type short int
.
3.1.3. .~int_width
-> NAT
.~int_width
is the number of bits required to store values of the representation VARIETY
that corresponds to the C type int
.
3.1.4. .~long_width
-> NAT
.~long_width
is the number of bits required to store values of the representation VARIETY
that corresponds to the C type long int
.
3.1.5. .~longlong_width
-> NAT
.~longlong_width
is the number of bits required to store values of the representation VARIETY
that corresponds to the C type long long int
.
3.1.6. .~size_t_width
-> NAT
.~size_t_width
is the number of bits required to store values of the representation VARIETY
that corresponds to the C type size_t
. It will be the same as one of .~short_width
, .~int_width
, or .~long_width
.
3.1.7. .~fl_rep
-> NAT
.~fl_rep
is the sequence number (see §2.1.3) of the floating point representation to be used for values of C type float
.
3.1.8. .~dbl_rep
-> NAT
.~dbl_rep
is the sequence number (see subsection 3.2) of the floating point representation to be used for values of C type double
.
3.1.9. .~ldbl_rep
-> NAT
.~ldbl_rep
is the sequence number (see subsection 3.2) of the floating point representation to be used for values of C type long double
.
3.1.10. .~pv_align
-> ALIGNMENT
.~pv_align
is the common alignment for all pointers that can be represented by the C generic pointer type void*
. For architecture independence, this would have to be a union of several alignments, but for many installers it can be simplified to alignment
(integer
(var_width
(false
, .~char_width
))).
3.1.11. .~min_struct_rep
-> NAT
.~min_struct_rep
is the number of bits required to store values of the smallest C integral type which share the same alignment properties as a structured value whose members are all of that same integral type. It will be the same as one of .~char_width
, .~short_width
, .~int_width
, or .~long_width
.
3.1.12. .~char_is_signed
-> BOOL
.~char_is_signed
is true
if the C type char
is treated as signed, or false
if it is unsigned.
3.1.13. .~bitfield_is_signed
-> BOOL
.~bitfield_is_signed
is true
if bitfield members of structures in C are treated as signed, or false
if unsigned.
3.2. Fortran mapping tokens
3.2.1. .~F_char_width
-> NAT
.~F_char_width
is the number of bits required to store values of the representation VARIETY
that corresponds to the Fortran77 type CHARACTER
.
In most cases, .~F_char_width
is the same as .~char_width
.
3.2.2. .~F_int_width
-> NAT
.~F_int_width
is the number of bits required to store values of the representation VARIETY
that corresponds to the Fortran77 type INTEGER
.
In most cases, .~F_int_width
is the same as .~int_width
.
3.2.3. .~F_fl_rep
-> NAT
.~F_fl_rep
is the sequence number (see §2.1.3) of the floating point representation to be used for values of Fortran77 type REAL
, with the constraint that .~rep_fv_width
(.~F_fl_rep
) = .~F_int_width
.
If this constraint cannot be met, .~F_fl_rep
will be 0.
3.2.4. .~F_dbl_rep
-> NAT
.~F_dbl_rep
is the sequence number (see subsection 3.2) of the floating point representation to be used for values of Fortran77 type DOUBLE PRECISION
, with the constraint that .~rep_fv_width
( .~F_dbl_rep
) = 2 * .~F_int_width
.
If this constraint cannot be met, .~F_dbl_rep
will be 0.