Next: RM B 4 95-98 Interfacing with COBOL, Previous: RM B 2 12-13 Package Interfaces, Up: Implementation Advice [Contents][Index]
"An implementation should support the following interface correspondences between Ada and C."
Followed.
"An Ada procedure corresponds to a void-returning C function."
Followed.
"An Ada function corresponds to a non-void C function."
Followed.
"An Ada
in
scalar parameter is passed as a scalar argument to a C function."
Followed.
"An Ada
in
parameter of an access-to-object type with designated typeT
is passed as at*
argument to a C function, wheret
is the C type corresponding to the Ada typeT
."
Followed.
"An Ada access
T
parameter, or an Adaout
orin out
parameter of an elementary typeT
, is passed as at*
argument to a C function, wheret
is the C type corresponding to the Ada typeT
. In the case of an elementaryout
orin out
parameter, a pointer to a temporary copy is used to preserve by-copy semantics."
Followed.
"An Ada parameter of a record type
T
, of any mode, is passed as at*
argument to a C function, wheret
is the C structure corresponding to the Ada typeT
."
Followed. This convention may be overridden by the use of the C_Pass_By_Copy pragma, or Convention, or by explicitly specifying the mechanism for a given call using an extended import or export pragma.
"An Ada parameter of an array type with component type
T
, of any mode, is passed as at*
argument to a C function, wheret
is the C type corresponding to the Ada typeT
."
Followed.
"An Ada parameter of an access-to-subprogram type is passed as a pointer to a C function whose prototype corresponds to the designated subprogram’s specification."
Followed.
Next: RM B 4 95-98 Interfacing with COBOL, Previous: RM B 2 12-13 Package Interfaces, Up: Implementation Advice [Contents][Index]