F.11.5 Creating a Spec for Ada DLLs

To use the services exported by the Ada DLL from another programming
language (e.g. C), you have to translate the specs of the exported Ada
entities in that language. For instance in the case of API.dll,
the corresponding C header file could look like:

It is important to understand that when building an Ada DLL to be used by
other Ada applications, you need two different specs for the packages
contained in the DLL: one for building the DLL and the other for using
the DLL. This is because the DLL calling convention is needed to
use a variable defined in a DLL, but when building the DLL, the variable
must have either the Ada or C calling convention. As an
example consider a DLL comprising the following package API: