Functions with variable number of parameters

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Functions with variable number of parameters

Felipe Monteiro de Carvalho
Hello,

While writing the apache pascal headers, I need to convert a c
function like this:

void ap_allow_methods(request_rec *r, int reset, ...);

I know we can implement a variable number of paramaters in pascal
using array of const type. But is that type compatible with a C
function with a variable number of parameters?

I mean, will it work when calling a function written in c in a DLL?

If not, what should I do?

thanks,
--
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Functions with variable number of parameters

Florian Klaempfl
Felipe Monteiro de Carvalho wrote:

> Hello,
>
> While writing the apache pascal headers, I need to convert a c
> function like this:
>
> void ap_allow_methods(request_rec *r, int reset, ...);
>
> I know we can implement a variable number of paramaters in pascal
> using array of const type. But is that type compatible with a C
> function with a variable number of parameters?

Use array of const with cdecl, it will work as expected.

>
> I mean, will it work when calling a function written in c in a DLL?


>
> If not, what should I do?
>
> thanks,

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Functions with variable number of parameters

Felipe Monteiro de Carvalho
On 7/10/06, Florian Klaempfl <[hidden email]> wrote:
> Use array of const with cdecl, it will work as expected.

Thank you very much.

--
Felipe Monteiro de Carvalho
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal