From: keie Date: Thu, 17 Jan 1985 13:22:49 +0000 (+0000) Subject: Added some documentation for the interface between C and Pascal. X-Git-Tag: release-5-5~5772 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=e75b8772ca7f5120aba3daf563b9cf901f6e8c22;p=ack.git Added some documentation for the interface between C and Pascal. This was necessary because the format of Pascal and C procedure pointers differ from now on. --- diff --git a/doc/pcref.doc b/doc/pcref.doc index 932619798..b2cd3c335 100644 --- a/doc/pcref.doc +++ b/doc/pcref.doc @@ -413,6 +413,36 @@ for parameters. Some EM implementations check this: \*(ONnot checked. .I2 not checked. +.IE +.PP +For those who wish the use the interface between C and Pascal we +give an incomplete list of corresponding formal parameters in C and Pascal. +.sp 1 +.ta 8 37 +.nf + Pascal C + a:integer int a + a:char int a + a:boolean int a + a:real double a + a:^type type *a + var a:type type *a + procedure a(pars) struct { + void (*a)() ; + char *static_link ; + } + function a(pars):type struct { + type (*a)() ; + char *static_link ; + } +.fi +The Pascal runtime system uses the following algorithm when calling +function/procedures passed as parameters. +.nf +.ta 8 16 + if ( static_link ) (*a)(static_link,pars) ; + else (*a)(pars) ; +.fi .IT 6.7.2.1 The order of evaluation of the operands of a dyadic operator shall be implementation-dependent.