Ada Programming/Pragmas/Interface

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Ada. Time-tested, safe and secure.
Ada. Time-tested, safe and secure.
pragma Interface (language_name, subprogram_name);

Summary[edit | edit source]

Interface is an Ada 83 interfacing pragma equivalent to pragma Import. However, it can be used just for subprograms while pragma Import allows also interfacing with global variables.

Some compilers for recent versions of the language still allow this pragma, but treat it just like pragma Import. In older code, pragma Import was usually followed by the implementation-defined pragma Interface_Name to specify the external name of the subprogram.

It is worth noting that "interface" is a new Ada 2005 keyword. However, a special exception is made in the standard to allow it as a pragma identifier for backwards compatibility.[1]

See also[edit | edit source]

Wikibook[edit | edit source]

Ada Reference Manual[edit | edit source]

Ada 83[edit | edit source]

Ada 2005[edit | edit source]

References[edit | edit source]

  1. "J.12 Pragma Interface (Annotated)". Ada 2005 Reference Manual. {{cite book}}: External link in |chapter= (help)