From: | Angel Manuel Diaz Aunion <angel(at)ipf(dot)uni-karlsruhe(dot)de> |
---|---|
To: | "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>, lockhart(at)alumni(dot)caltech(dot)edu, maillist(at)candle(dot)pha(dot)pa(dot)us |
Subject: | Function |
Date: | 2000-04-19 17:20:52 |
Message-ID: | 38FDEAF3.E5A07D38@ipf.uni-karlsruhe.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
I'm trying to write a function which is defined as follows:
create function lseg_res(path,path) returns _lseg
as '/net/ipfy/angel/postgres/geometry/libMWgeom.so' language 'c';
The output value is supposed to be an array, but what I get is "{}".
I don't know whether
-the function is not well defined, or
-the output value can not be an array
The code:
#include "../include/geometry.h"
LSEG *lseg_res(PATH *p1,PATH *p2)
{
int4 i,j;
bool c;
LSEG *result[p1->npts] ;
for (j = 0; j < p1->npts; j++)
{
result[j] = palloc (sizeof(LSEG));
}
c = path_inter(p1,p2);
if (c == TRUE )
{
for (i = 0 ; i< p1->npts ; i ++)
{
result[i] = lseg_construct( &p1->p[i], &p1->p[i + 1]);
return result[i];
}
return NULL;
}
Thank you very much.
Angel Manuel Diaz Aunion.
Institut fuer Photogrametrie und Fernerkundung.
Universitaet Karlsruhe.
From | Date | Subject | |
---|---|---|---|
Next Message | Laqtib Slam | 2000-04-19 18:16:02 | ERROR: cannot write block ... |
Previous Message | Jan Wieck | 2000-04-19 17:12:11 | TOAST (was: BLOB) |