Re: [HACKERS] Passing parameters to a C function

2007-05-30 Thread Tom Lane
Martijn van Oosterhout <[EMAIL PROTECTED]> writes: > On Wed, May 30, 2007 at 11:26:01AM -0300, Rodrigo Sakai wrote: >> But using version 1 calling convention it won't work! So, how can I pass the >> 'a' and 'b' variables in complex_add(?, ?)? > Use the DirectFunctionCalln functions in fmgr. There

Re: [HACKERS] Passing parameters to a C function

2007-05-30 Thread Martijn van Oosterhout
On Wed, May 30, 2007 at 11:26:01AM -0300, Rodrigo Sakai wrote: >I have a question about passing parameters to a C function. Imagine the > example by PostgreSQL: > > PG_FUNCTION_INFO_V1(complex_add); > But using version 1 calling convention it won't work! So, how can I pass the > 'a' and 'b'

[HACKERS] Passing parameters to a C function

2007-05-30 Thread Rodrigo Sakai
Hello, I have a question about passing parameters to a C function. Imagine the example by PostgreSQL: PG_FUNCTION_INFO_V1(complex_add); Datum complex_add(PG_FUNCTION_ARGS) { Complex*a = (Complex *) PG_GETARG_POINTER(0); Complex*b = (Complex *) PG_GETARG_P