-
A pragma Import is used to import an entity defined in a foreign
language into an Ada program, thus allowing a foreign-language
subprogram to be called from Ada, or a foreign-language variable to be
accessed from Ada. In contrast, a pragma Export is used to export an Ada
entity to a foreign language, thus allowing an Ada subprogram to be
called from a foreign language, or an Ada object to be accessed from a
foreign language. The pragmas Import and Export are intended primarily
for objects and subprograms, although implementations are allowed to
support other entities.
-
A pragma Convention is used to specify that an Ada entity should use the
conventions of another language. It is intended primarily for types and
"callback" subprograms. For example, "pragma Convention(Fortran,
Matrix);" implies that Matrix should be represented according to the
conventions of the supported Fortran implementation, namely column-major
order.
-
A pragma Linker_Options is used to specify the system linker parameters
needed when a given compilation unit is included in a partition.
Syntax
-
An interfacing pragma is a representation pragma that is one of the
pragmas Import, Export, or Convention. Their forms, together with that
of the related pragma Linker_Options, are as follows:
-
pragma Import
([Convention =>] convention_identifier,
[Entity =>] local_name [,
[External_Name =>] string_expression] [,
[Link_Name =>] string_expression]);
-
pragma Export
([Convention =>] convention_identifier,
[Entity =>] local_name [,
[External_Name =>] string_expression] [,
[Link_Name =>] string_expression]);
-
pragma Convention
([Convention =>] convention_identifier,
[Entity =>] local_name);
-
pragma Linker_Options(string_expression);
-
A pragma Linker_Options is allowed only at the place of a
declarative_item.