Re: [GENERAL] Problem with C functions ?

Поиск
Список
Период
Сортировка
От Gene Selkov, Jr.
Тема Re: [GENERAL] Problem with C functions ?
Дата
Msg-id 199911140456.WAA13708@antares
обсуждение исходный текст
Ответ на Problem with C functions ?  (Manuel Weindorf <weindorf@ipf.uni-karlsruhe.de>)
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Larry Rosenman
Дата:
Сообщение: [ADMIN] 6.5.3/doesn't recognize localhost in pg_hba.conf (fwd)
Следующее
От: "Gene Selkov, Jr."
Дата:
Сообщение: Re: [GENERAL] does GIS DMS data type already exist?