postgis/lwgeom/lwgeom_geos.c
Sandro Santilli 80bad2c969 versioning functions completed
git-svn-id: http://svn.osgeo.org/postgis/trunk@723 b70326c6-7e19-0410-871a-916f4a2858ee
2004-08-23 15:57:56 +00:00

39 lines
764 B
C

#include "postgres.h"
#include "fmgr.h"
#if USE_GEOS
extern char *GEOSversion();
extern char *GEOSjtsport();
void NOTICE_MESSAGE(char *msg);
void NOTICE_MESSAGE(char *msg)
{
elog(NOTICE,msg);
}
PG_FUNCTION_INFO_V1(postgis_geos_version);
Datum postgis_geos_version(PG_FUNCTION_ARGS)
{
char *ver = GEOSversion();
text *result;
result = (text *) palloc(VARHDRSZ + strlen(ver));
VARATT_SIZEP(result) = VARHDRSZ + strlen(ver) ;
memcpy(VARDATA(result), ver, strlen(ver));
free(ver);
PG_RETURN_POINTER(result);
}
#else // ! defined USE_GEOS
PG_FUNCTION_INFO_V1(postgis_geos_version);
Datum postgis_geos_version(PG_FUNCTION_ARGS)
{
//elog(ERROR,"GEOSversion:: operation not implemented - compile PostGIS with GEOS support");
PG_RETURN_NULL();
}
#endif