using C routines in pascal

Frank Heckenbach frank at g-n-u.de
Fri Jul 7 15:32:35 CEST 2000


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

-- 
Frank Heckenbach, frank at g-n-u.de, http://fjf.gnu.de/
GPC To-Do list, latest features, fixed bugs:
http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html




More information about the Gpc mailing list