Next: , Previous: Pragma Implicit_Packing, Up: Implementation Defined Pragmas


2.72 Pragma Import_Function

Syntax:

    pragma Import_Function (
         [Internal                 =>] LOCAL_NAME,
      [, [External                 =>] EXTERNAL_SYMBOL]
      [, [Parameter_Types          =>] PARAMETER_TYPES]
      [, [Result_Type              =>] SUBTYPE_MARK]
      [, [Mechanism                =>] MECHANISM]
      [, [Result_Mechanism         =>] MECHANISM_NAME]);
    
    EXTERNAL_SYMBOL ::=
      IDENTIFIER
    | static_string_EXPRESSION
    
    PARAMETER_TYPES ::=
      null
    | TYPE_DESIGNATOR {, TYPE_DESIGNATOR}
    
    TYPE_DESIGNATOR ::=
      subtype_NAME
    | subtype_Name ' Access
    
    MECHANISM ::=
      MECHANISM_NAME
    | (MECHANISM_ASSOCIATION {, MECHANISM_ASSOCIATION})
    
    MECHANISM_ASSOCIATION ::=
      [formal_parameter_NAME =>] MECHANISM_NAME
    
    MECHANISM_NAME ::=
      Value
    | Reference

This pragma is used in conjunction with a pragma Import to specify additional information for an imported function. The pragma Import (or equivalent pragma Interface) must precede the Import_Function pragma and both must appear in the same declarative part as the function specification.

The Internal argument must uniquely designate the function to which the pragma applies. If more than one function name exists of this name in the declarative part you must use the Parameter_Types and Result_Type parameters to achieve the required unique designation. Subtype marks in these parameters must exactly match the subtypes in the corresponding function specification, using positional notation to match parameters with subtype marks. The form with an 'Access attribute can be used to match an anonymous access parameter.

You may optionally use the Mechanism and Result_Mechanism parameters to specify passing mechanisms for the parameters and result. If you specify a single mechanism name, it applies to all parameters. Otherwise you may specify a mechanism on a parameter by parameter basis using either positional or named notation. If the mechanism is not specified, the default mechanism is used.