Function

Поиск
Список
Период
Сортировка
Искать

Function

От:
Angel Manuel Diaz Aunion <angel@ipf.uni-karlsruhe.de>
Дата:
 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.
 

FAQ