Received: from ipfe6h.bau-verm.uni-karlsruhe.de (root@ipfe6h.bau-verm.uni-karlsruhe.de [129.13.144.93]) by hub.org (8.9.3/8.9.3) with ESMTP id OAA48978 for ; Wed, 19 Apr 2000 14:21:18 -0400 (EDT) (envelope-from angel@ipf.uni-karlsruhe.de) Received: from ipf.uni-karlsruhe.de (angel@localhost [127.0.0.1]) by ipfe6h.bau-verm.uni-karlsruhe.de (8.9.3/8.9.3) with ESMTP id TAA05864; Wed, 19 Apr 2000 19:20:52 +0200 Message-ID: <38FDEAF3.E5A07D38@ipf.uni-karlsruhe.de> Date: Wed, 19 Apr 2000 19:20:52 +0200 From: Angel Manuel Diaz Aunion X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.12 i686) X-Accept-Language: en MIME-Version: 1.0 To: "pgsql-sql@postgresql.org" , lockhart@alumni.caltech.edu, maillist@candle.pha.pa.us Subject: Function Content-Type: multipart/alternative; boundary="------------4BC5616083FFA0FCF919FA27" X-Archive-Number: 200004/206 --------------4BC5616083FFA0FCF919FA27 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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. --------------4BC5616083FFA0FCF919FA27 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit 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.
  --------------4BC5616083FFA0FCF919FA27--