Marinier, M. Claude, G. wrote:
Would it be sufficient to put function genbet(x,y:shortreal):shortreal;C; in the calling program? Is it necessary to have the wrapper unit? If yes, why is a wrapper needed?
The advantage of a "wrapper" unit is, if you have (or plan to have) several programs using the library, you'll have only one place which depends on the C code (i.e., only one place to change if the C interface changes). (And it's better modularization, anyway.)
The run-time efficiency will be the same for a wrapper unit with external declarations (unlike wrapper routines which suffer from a small overhead -- it depends on the routines if the overhead is relevant or neglectible).
Frank