Re: [GENERAL] Problem with C functions ?

From: "Gene Selkov, Jr(dot)" <selkovjr(at)mcs(dot)anl(dot)gov>
To: Manuel Weindorf <weindorf(at)ipf(dot)uni-karlsruhe(dot)de>, pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Problem with C functions ?
Date: 1999-11-14 04:56:25
Message-ID: 199911140456.WAA13708@antares
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

[having found this topic irrelevant to INTERFACES, I'm not posting my reply there]

> Hi there,
>
> I compiled a C-funtion to compute the azimuth of a LSEG but the function
> never
> returns the correct value

> double ori;
> ....
> return( ori );
>

The right way to do it would be:

#include "postgres.h"
#include "utils/palloc.h"

float64 ori = (float64) palloc(sizeof(float64data));

*ori = (float64) .... /* double type expression */

return ( ori );
}

--Gene

Browse pgsql-general by date

  From Date Subject
Next Message Gene Selkov, Jr. 1999-11-14 05:44:31 Re: [GENERAL] does GIS DMS data type already exist?
Previous Message Larry Rosenman 1999-11-13 21:31:30 [ADMIN] 6.5.3/doesn't recognize localhost in pg_hba.conf (fwd)