From: Angel Manuel Diaz Aunion <angel@ipf.uni-karlsruhe.de>
To: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
To: lockhart@alumni.caltech.edu
To: maillist@candle.pha.pa.us
Subject: Function
Date: Wed, 19 Apr 2000 19:20:52 +0200
Message-ID: <38FDEAF3.E5A07D38@ipf.uni-karlsruhe.de> (raw)
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: angel@ipf.uni-karlsruhe.de, lockhart@alumni.caltech.edu, maillist@candle.pha.pa.us
Subject: Re: Function
In-Reply-To: <38FDEAF3.E5A07D38@ipf.uni-karlsruhe.de>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox