#define PGC_ERRMSG_MAXLEN 2048 //256
-/**
-* Utility to convert cstrings to textp pointers
-*/
-text*
-cstring2text(const char *cstring)
-{
- text *output;
- size_t sz;
-
- /* Guard against null input */
- if( !cstring )
- return NULL;
-
- sz = strlen(cstring);
- output = palloc(sz + VARHDRSZ);
- if ( ! output )
- return NULL;
- SET_VARSIZE(output, sz + VARHDRSZ);
- if ( sz )
- memcpy(VARDATA(output),cstring,sz);
- return output;
-}
-
-char*
-text2cstring(const text *textptr)
-{
- size_t size = VARSIZE(textptr) - VARHDRSZ;
- char *str = lwalloc(size+1);
- memcpy(str, VARDATA(textptr), size);
- str[size]='\0';
- return str;
-}
-
-
/*
* Error message parsing functions
*
*/
int gserialized_datum_get_gbox_p(Datum gsdatum, GBOX *gbox);
-/**
-* Convert cstrings (null-terminated byte array) to textp pointers
-* (PgSQL varlena structure with VARSIZE header).
-*/
-text* cstring2text(const char *cstring);
-
-/**
-* Convert textp (PgSQL varlena structure with VARSIZE header) to
-* cstrings (null-terminated byte array).
-*/
-char* text2cstring(const text *textptr);
-
/*
* For PostgreSQL >= 8.5 redefine the STATRELATT macro to its
* new value of STATRELATTINH
PG_RETURN_NULL();
/* Turn string result into text for return */
- result = cstring2text(gml);
+ result = cstring_to_text(gml);
lwfree(gml);
PG_RETURN_TEXT_P(result);
if ( ! kml )
PG_RETURN_NULL();
- result = cstring2text(kml);
+ result = cstring_to_text(kml);
lwfree(kml);
PG_RETURN_TEXT_P(result);
lwgeom_free(lwgeom);
PG_FREE_IF_COPY(g, 0);
- result = cstring2text(svg);
+ result = cstring_to_text(svg);
lwfree(svg);
PG_RETURN_TEXT_P(result);
PG_FREE_IF_COPY(g, 1);
if (srs) pfree(srs);
- result = cstring2text(geojson);
+ result = cstring_to_text(geojson);
lwfree(geojson);
PG_RETURN_TEXT_P(result);
text *wkt_text = PG_GETARG_TEXT_P(0);
/* Extract the cstring from the varlena */
- char *wkt = text2cstring(wkt_text);
+ char *wkt = text_to_cstring(wkt_text);
/* Pass the cstring to the input parser, and magic occurs! */
if ( lwgeom_parse_wkt(&lwg_parser_result, wkt, LW_PARSER_CHECK_ALL) == LW_FAILURE )
static ND_STATS*
pg_get_nd_stats_by_name(const Oid table_oid, const text *att_text, int mode, bool only_parent)
{
- const char *att_name = text2cstring(att_text);
+ const char *att_name = text_to_cstring(att_text);
AttrNumber att_num;
/* We know the name? Look up the num */
/* Retrieve the stats object */
nd_stats = pg_get_nd_stats_by_name(table_oid, att_text, mode, only_parent);
if ( ! nd_stats )
- elog(ERROR, "stats for \"%s.%s\" do not exist", get_rel_name(table_oid), text2cstring(att_text));
+ elog(ERROR, "stats for \"%s.%s\" do not exist", get_rel_name(table_oid), text_to_cstring(att_text));
/* Convert to JSON */
str = nd_stats_to_json(nd_stats);
- json = cstring2text(str);
+ json = cstring_to_text(str);
pfree(str);
pfree(nd_stats);
PG_RETURN_TEXT_P(json);
nd_stats = pg_get_nd_stats_by_name(table_oid, att_text, mode, false);
if ( ! nd_stats )
- elog(ERROR, "stats for \"%s.%s\" do not exist", get_rel_name(table_oid), text2cstring(att_text));
+ elog(ERROR, "stats for \"%s.%s\" do not exist", get_rel_name(table_oid), text_to_cstring(att_text));
/* Calculate the gbox */
if ( ! gserialized_datum_get_gbox_p(geom_datum, &gbox) )
nd_stats2 = pg_get_nd_stats_by_name(table_oid2, att_text2, mode, false);
if ( ! nd_stats1 )
- elog(ERROR, "stats for \"%s.%s\" do not exist", get_rel_name(table_oid1), text2cstring(att_text1));
+ elog(ERROR, "stats for \"%s.%s\" do not exist", get_rel_name(table_oid1), text_to_cstring(att_text1));
if ( ! nd_stats2 )
- elog(ERROR, "stats for \"%s.%s\" do not exist", get_rel_name(table_oid2), text2cstring(att_text2));
+ elog(ERROR, "stats for \"%s.%s\" do not exist", get_rel_name(table_oid2), text_to_cstring(att_text2));
/* Check if we've been asked to not use 2d mode */
if ( ! PG_ARGISNULL(4) )
{
text *modetxt = PG_GETARG_TEXT_P(4);
- char *modestr = text2cstring(modetxt);
+ char *modestr = text_to_cstring(modetxt);
if ( modestr[0] == 'N' )
mode = 0;
}
if ( PG_NARGS() == 4 )
{
- nsp = text2cstring(PG_GETARG_TEXT_P(0));
- tbl = text2cstring(PG_GETARG_TEXT_P(1));
+ nsp = text_to_cstring(PG_GETARG_TEXT_P(0));
+ tbl = text_to_cstring(PG_GETARG_TEXT_P(1));
col = PG_GETARG_TEXT_P(2);
only_parent = PG_GETARG_BOOL(3);
nsp_tbl = palloc(strlen(nsp) + strlen(tbl) + 6);
}
else if ( PG_NARGS() == 3 )
{
- nsp = text2cstring(PG_GETARG_TEXT_P(0));
- tbl = text2cstring(PG_GETARG_TEXT_P(1));
+ nsp = text_to_cstring(PG_GETARG_TEXT_P(0));
+ tbl = text_to_cstring(PG_GETARG_TEXT_P(1));
col = PG_GETARG_TEXT_P(2);
nsp_tbl = palloc(strlen(nsp) + strlen(tbl) + 6);
sprintf(nsp_tbl, "\"%s\".\"%s\"", nsp, tbl);
}
else if ( PG_NARGS() == 2 )
{
- tbl = text2cstring(PG_GETARG_TEXT_P(0));
+ tbl = text_to_cstring(PG_GETARG_TEXT_P(0));
col = PG_GETARG_TEXT_P(1);
nsp_tbl = palloc(strlen(tbl) + 3);
sprintf(nsp_tbl, "\"%s\"", tbl);
/* Read the extent from the head of the spatial index, if there is one */
idx_oid = table_get_spatial_index(tbl_oid, col, &key_type);
if (!idx_oid)
- elog(DEBUG2, "index for \"%s.%s\" does not exist", tbl, text2cstring(col));
+ elog(DEBUG2, "index for \"%s.%s\" does not exist", tbl, text_to_cstring(col));
gbox = spatial_index_read_extent(idx_oid, key_type);
#endif
/* Error out on no stats */
if ( ! nd_stats ) {
- elog(WARNING, "stats for \"%s.%s\" do not exist", tbl, text2cstring(col));
+ elog(WARNING, "stats for \"%s.%s\" do not exist", tbl, text_to_cstring(col));
PG_RETURN_NULL();
}
ListCell *lc;
List *idx_list;
Oid result = InvalidOid;
- char *colname = text2cstring(col);
+ char *colname = text_to_cstring(col);
/* Lookup our spatial index key types */
Oid b2d_oid = typname_to_oid(INDEX_KEY_2D);
if ( typmod >= 0 && TYPMOD_GET_M(typmod) )
ptr += sprintf(ptr, "%s", "M");
- stext = cstring2text(s);
+ stext = cstring_to_text(s);
pfree(s);
PG_RETURN_TEXT_P(stext);
}
#include "float.h" /* for DBL_DIG */
#include "postgres.h"
#include "executor/spi.h"
+#include "utils/builtins.h"
#include "../postgis_config.h"
#include "lwgeom_pg.h"
if ( ! gml )
PG_RETURN_NULL();
- result = cstring2text(gml);
+ result = cstring_to_text(gml);
lwfree(gml);
PG_RETURN_TEXT_P(result);
}
if( ! kml )
PG_RETURN_NULL();
- result = cstring2text(kml);
+ result = cstring_to_text(kml);
lwfree(kml);
PG_RETURN_POINTER(result);
if (srs) pfree(srs);
- result = cstring2text(geojson);
+ result = cstring_to_text(geojson);
lwfree(geojson);
PG_FREE_IF_COPY(geom, 0);
lwgeom = lwgeom_from_gserialized(geom);
svg = lwgeom_to_svg(lwgeom, precision, relative);
- result = cstring2text(svg);
+ result = cstring_to_text(svg);
lwgeom_free(lwgeom);
pfree(svg);
PG_FREE_IF_COPY(geom, 0);
lwgeom_free(lwgeom);
PG_FREE_IF_COPY(geom, 1);
- result = cstring2text(x3d);
+ result = cstring_to_text(x3d);
lwfree(x3d);
PG_RETURN_TEXT_P(result);
lwgeom_free(lwgeom);
PG_FREE_IF_COPY(geom, 0);
- result = cstring2text(encodedpolyline);
+ result = cstring_to_text(encodedpolyline);
lwfree(encodedpolyline);
PG_RETURN_TEXT_P(result);
#include "postgres.h"
#include "fmgr.h"
-#include "utils/elog.h"
#include "utils/array.h"
+#include "utils/builtins.h"
+#include "utils/elog.h"
#include "utils/geo_decls.h"
#include "../postgis_config.h"
lwgeom_free(lwgeom);
/* create a text obj to return */
- mytext = cstring2text(result);
+ mytext = cstring_to_text(result);
pfree(result);
PG_FREE_IF_COPY(geom,0);
Datum postgis_version(PG_FUNCTION_ARGS)
{
char *ver = POSTGIS_VERSION;
- text *result = cstring2text(ver);
+ text *result = cstring_to_text(ver);
PG_RETURN_TEXT_P(result);
}
Datum postgis_liblwgeom_version(PG_FUNCTION_ARGS)
{
const char *ver = lwgeom_version();
- text *result = cstring2text(ver);
+ text *result = cstring_to_text(ver);
PG_RETURN_TEXT_P(result);
}
Datum postgis_lib_version(PG_FUNCTION_ARGS)
{
char *ver = POSTGIS_LIB_VERSION;
- text *result = cstring2text(ver);
+ text *result = cstring_to_text(ver);
PG_RETURN_TEXT_P(result);
}
if ( rev > 0 )
{
snprintf(ver, 32, "%d", rev);
- PG_RETURN_TEXT_P(cstring2text(ver));
+ PG_RETURN_TEXT_P(cstring_to_text(ver));
}
else
PG_RETURN_NULL();
Datum postgis_lib_build_date(PG_FUNCTION_ARGS)
{
char *ver = POSTGIS_BUILD_DATE;
- text *result = cstring2text(ver);
+ text *result = cstring_to_text(ver);
PG_RETURN_TEXT_P(result);
}
snprintf(ver, 64, "%s r%d", POSTGIS_LIB_VERSION, POSTGIS_SVN_REVISION);
ver[63] = '\0';
- result = cstring2text(ver);
+ result = cstring_to_text(ver);
PG_RETURN_TEXT_P(result);
}
Datum postgis_libxml_version(PG_FUNCTION_ARGS)
{
char *ver = POSTGIS_LIBXML2_VERSION;
- text *result = cstring2text(ver);
+ text *result = cstring_to_text(ver);
PG_RETURN_TEXT_P(result);
}
lwgeom_free(lwgeom);
/* Write to text and free the WKT */
- result = cstring2text(wkt);
+ result = cstring_to_text(wkt);
pfree(wkt);
/* Return the text */
if ( ! geohash )
PG_RETURN_NULL();
- result = cstring2text(geohash);
+ result = cstring_to_text(geohash);
pfree(geohash);
PG_RETURN_TEXT_P(result);
Datum postgis_geos_version(PG_FUNCTION_ARGS)
{
const char *ver = lwgeom_geos_version();
- text *result = cstring2text(ver);
+ text *result = cstring_to_text(ver);
PG_RETURN_POINTER(result);
}
if ( nargs > 2 )
{
text *wkttext = PG_GETARG_TEXT_P(2);
- paramstr = text2cstring(wkttext);
+ paramstr = text_to_cstring(wkttext);
POSTGIS_DEBUGF(3, "paramstr: %s", paramstr);
}
}
POSTGIS_DEBUGF(3, "joinStyle:%d mitreLimit:%g", joinStyle, mitreLimit);
- pfree(paramstr); /* alloc'ed in text2cstring */
+ pfree(paramstr); /* alloc'ed in text_to_cstring */
}
lwgeom_result = lwgeom_offsetcurve(lwgeom_as_lwline(lwgeom_input), size, quadsegs, joinStyle, mitreLimit);
reason_str = GEOSisValidReason(g1);
GEOSGeom_destroy((GEOSGeometry *)g1);
if (!reason_str) HANDLE_GEOS_ERROR("GEOSisValidReason");
- result = cstring2text(reason_str);
+ result = cstring_to_text(reason_str);
GEOSFree(reason_str);
}
else
{
- result = cstring2text(lwgeom_geos_errmsg);
+ result = cstring_to_text(lwgeom_geos_errmsg);
}
PG_FREE_IF_COPY(geom, 0);
if (!relate_str) HANDLE_GEOS_ERROR("GEOSRelate");
- result = cstring2text(relate_str);
+ result = cstring_to_text(relate_str);
GEOSFree(relate_str);
PG_FREE_IF_COPY(geom1, 0);
#include "postgres.h"
#include "fmgr.h"
#include "funcapi.h"
+#include "utils/builtins.h"
#include "../postgis_config.h"
#include "lwgeom_geos.h"
pat_text = (PG_GETARG_TEXT_P(1));
/* Convert from text to cstring */
- mat = text2cstring(mat_text);
- pat = text2cstring(pat_text);
+ mat = text_to_cstring(mat_text);
+ pat = text_to_cstring(pat_text);
initGEOS(lwpgnotice, lwgeom_geos_error);
#include <assert.h>
#include "postgres.h"
+#include "utils/builtins.h"
#include "../postgis_config.h"
#include "lwgeom_pg.h"
if (PG_ARGISNULL(0)) PG_RETURN_NULL();
encodedpolyline_input = PG_GETARG_TEXT_P(0);
- encodedpolyline = text2cstring(encodedpolyline_input);
+ encodedpolyline = text_to_cstring(encodedpolyline_input);
if (PG_NARGS() > 1 && !PG_ARGISNULL(1))
{
#include <assert.h>
#include "postgres.h"
+#include "utils/builtins.h"
#include "../postgis_config.h"
#include "lwgeom_pg.h"
}
geohash_input = PG_GETARG_TEXT_P(0);
- geohash = text2cstring(geohash_input);
+ geohash = text_to_cstring(geohash_input);
box = parse_geohash(geohash, precision);
}
geohash_input = PG_GETARG_TEXT_P(0);
- geohash = text2cstring(geohash_input);
+ geohash = text_to_cstring(geohash_input);
box = parse_geohash(geohash, precision);
# else
# include <json/json.h>
# endif
+
+/* We don't include <utils/builtins.h> to avoid collisions with json-c/json.h */
+static text*
+cstring2text(const char *cstring)
+{
+ size_t len = strlen(cstring);
+ text *result = (text *) palloc(len + VARHDRSZ);
+ SET_VARSIZE(result, len + VARHDRSZ);
+ memcpy(VARDATA(result), cstring, len);
+
+ return result;
+}
+
+static char*
+text2cstring(const text *textptr)
+{
+ size_t size = VARSIZE(textptr) - VARHDRSZ;
+ char *str = lwalloc(size+1);
+ memcpy(str, VARDATA(textptr), size);
+ str[size]='\0';
+ return str;
+}
#endif
Datum geom_from_geojson(PG_FUNCTION_ARGS);
#include "postgres.h"
#include "executor/spi.h"
+#include "utils/builtins.h"
#include "../postgis_config.h"
#include "lwgeom_pg.h"
/* Get the GML stream */
if (PG_ARGISNULL(0)) PG_RETURN_NULL();
xml_input = PG_GETARG_TEXT_P(0);
- xml = text2cstring(xml_input);
+ xml = text_to_cstring(xml_input);
/* Zero for undefined */
root_srid = PG_GETARG_INT32(1);
#include <string.h>
#include "postgres.h"
+#include "utils/builtins.h"
#include "../postgis_config.h"
#include "lwgeom_pg.h"
/* Get the KML stream */
if (PG_ARGISNULL(0)) PG_RETURN_NULL();
xml_input = PG_GETARG_TEXT_P(0);
- xml = text2cstring(xml_input);
+ xml = text_to_cstring(xml_input);
xml_size = VARSIZE(xml_input) - VARHDRSZ;
/* Begin to Parse XML doc */
#include "fmgr.h"
#include "utils/elog.h"
#include "mb/pg_wchar.h"
-# include "lib/stringinfo.h" /* for binary input */
+#include "lib/stringinfo.h" /* for binary input */
#include "utils/array.h"
+#include "utils/builtins.h"
#include "utils/lsyscache.h"
#include "funcapi.h"
PG_RETURN_NULL();
}
- format_str = text2cstring(format_text);
+ format_str = text_to_cstring(format_text);
assert(format_str != NULL);
/* The input string supposedly will be in the database encoding,
}
/* Convert to the postgres output string type. */
- formatted_text = cstring2text(formatted_str);
+ formatted_text = cstring_to_text(formatted_str);
pfree(formatted_str);
PG_RETURN_POINTER(formatted_text);
lwgeom_free(lwgeom);
/* Copy into text obect */
- result = cstring2text(hexwkb);
+ result = cstring_to_text(hexwkb);
pfree(hexwkb);
/* Clean up and return */
Datum result;
/* Unwrap the PgSQL text type into a cstring */
- wkt = text2cstring(wkt_text);
+ wkt = text_to_cstring(wkt_text);
/* Now we call over to the geometry_in function */
result = DirectFunctionCall1(LWGEOM_in, CStringGetDatum(wkt));
#include "access/itup.h"
#include "fmgr.h"
+#include "utils/builtins.h"
#include "utils/elog.h"
#include "../postgis_config.h"
strncat(type_str, lwtype_name(gserialized_get_type(gser)), type_str_len - 3);
/* Build a text type to store things in */
- type_text = cstring2text(type_str);
+ type_text = cstring_to_text(type_str);
PG_FREE_IF_COPY(gser, 0);
PG_RETURN_TEXT_P(type_text);
Datum LWGEOM_from_text(PG_FUNCTION_ARGS)
{
text *wkttext = PG_GETARG_TEXT_P(0);
- char *wkt = text2cstring(wkttext);
+ char *wkt = text_to_cstring(wkttext);
LWGEOM_PARSER_RESULT lwg_parser_result;
GSERIALIZED *geom_result = NULL;
LWGEOM *lwgeom;
POSTGIS_DEBUGF(3, "WKT size = %u, WKT length = %u", (unsigned int)wkt_size, (unsigned int)strlen(wkt));
/* Write to text and free the WKT */
- result = cstring2text(wkt);
+ result = cstring_to_text(wkt);
pfree(wkt);
/* Return the text */
#include "postgres.h"
#include "fmgr.h"
+#include "utils/builtins.h"
#include "../liblwgeom/liblwgeom.h"
#include "lwgeom_pg.h"
GSERIALIZED *geometry_serialize(LWGEOM *lwgeom);
-char* text2cstring(const text *textptr);
+char* text_to_cstring(const text *textptr);
static int __sfcgal_init = 0;
GSERIALIZED* result;
sfcgal_prepared_geometry_t* g;
text *wkttext = PG_GETARG_TEXT_P(0);
- char *cstring = text2cstring(wkttext);
+ char *cstring = text_to_cstring(wkttext);
sfcgal_postgis_init();
Datum postgis_sfcgal_version(PG_FUNCTION_ARGS)
{
const char *ver = lwgeom_sfcgal_version();
- text *result = cstring2text(ver);
+ text *result = cstring_to_text(ver);
PG_RETURN_POINTER(result);
}
#include "postgres.h"
#include "fmgr.h"
+#include "utils/builtins.h"
#include "../postgis_config.h"
#include "liblwgeom.h"
output_proj4_text = (PG_GETARG_TEXT_P(2));
/* Convert from text to cstring for libproj */
- input_proj4 = text2cstring(input_proj4_text);
- output_proj4 = text2cstring(output_proj4_text);
+ input_proj4 = text_to_cstring(input_proj4_text);
+ output_proj4 = text_to_cstring(output_proj4_text);
/* make input and output projection objects */
input_pj = lwproj_from_string(input_proj4);
Datum postgis_proj_version(PG_FUNCTION_ARGS)
{
const char *ver = pj_get_release();
- text *result = cstring2text(ver);
+ text *result = cstring_to_text(ver);
PG_RETURN_POINTER(result);
}
PG_RETURN_NULL();
#else /* HAVE_LIBPROTOBUF */
const char *ver = protobuf_c_version();
- text *result = cstring2text(ver);
+ text *result = cstring_to_text(ver);
PG_RETURN_POINTER(result);
#endif
}
\ No newline at end of file
#include <postgres.h> /* for palloc */
#include <fmgr.h>
+#include <utils/builtins.h>
#include "../../postgis_config.h"
PG_RETURN_NULL();
}
- result = cstring2text(reason);
+ result = cstring_to_text(reason);
PG_RETURN_TEXT_P(result);
}
snprintf(ver, 64, "%s r%d", POSTGIS_LIB_VERSION, POSTGIS_SVN_REVISION);
ver[63] = '\0';
- result = cstring2text(ver);
+ result = cstring_to_text(ver);
PG_RETURN_TEXT_P(result);
}
char *rtn = NULL;
rtn = palloc(strlen(ver) + strlen(" GDAL_DATA not found") + 1);
if (!rtn)
- result = cstring2text(ver);
+ result = cstring_to_text(ver);
else {
sprintf(rtn, "%s GDAL_DATA not found", ver);
- result = cstring2text(rtn);
+ result = cstring_to_text(rtn);
pfree(rtn);
}
}
else
- result = cstring2text(ver);
+ result = cstring_to_text(ver);
PG_RETURN_POINTER(result);
}
#include "postgres.h"
#include "fmgr.h"
#include "c.h" /* for UINT64_FORMAT and uint64 */
+#include "utils/builtins.h"
#include "utils/elog.h"
#include "utils/memutils.h" /* for TopMemoryContext */
#include "utils/array.h" /* for ArrayType */
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
edge_id = PG_GETARG_INT32(1) ;
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
edge_id = PG_GETARG_INT32(1) ;
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
if ( PG_ARGISNULL(1) ) containing_face = -1;
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
start_node = PG_GETARG_INT32(1);
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
startnode_id = PG_GETARG_INT32(1) ;
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
startnode_id = PG_GETARG_INT32(1) ;
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
face_id = PG_GETARG_INT32(1) ;
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
face_id = PG_GETARG_INT32(1) ;
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
edge_id = PG_GETARG_INT32(1) ;
{
buf[63] = '\0';
}
- PG_RETURN_TEXT_P(cstring2text(buf));
+ PG_RETURN_TEXT_P(cstring_to_text(buf));
}
/* ST_RemoveIsoNode(atopology, anode) */
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
node_id = PG_GETARG_INT32(1) ;
{
buf[63] = '\0';
}
- PG_RETURN_TEXT_P(cstring2text(buf));
+ PG_RETURN_TEXT_P(cstring_to_text(buf));
}
/* ST_RemIsoEdge(atopology, anedge) */
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
node_id = PG_GETARG_INT32(1) ;
{
buf[63] = '\0';
}
- PG_RETURN_TEXT_P(cstring2text(buf));
+ PG_RETURN_TEXT_P(cstring_to_text(buf));
}
/* ST_MoveIsoNode(atopology, anode, apoint) */
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
node_id = PG_GETARG_INT32(1) ;
{
buf[63] = '\0';
}
- PG_RETURN_TEXT_P(cstring2text(buf));
+ PG_RETURN_TEXT_P(cstring_to_text(buf));
}
/* ST_RemEdgeModFace(atopology, anedge) */
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
node_id = PG_GETARG_INT32(1) ;
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
node_id = PG_GETARG_INT32(1) ;
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
eid1 = PG_GETARG_INT32(1) ;
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
eid1 = PG_GETARG_INT32(1) ;
LWT_TOPOLOGY *topo;
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
geom = PG_GETARG_GSERIALIZED_P(1);
LWT_TOPOLOGY *topo;
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
geom = PG_GETARG_GSERIALIZED_P(1);
LWT_TOPOLOGY *topo;
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
geom = PG_GETARG_GSERIALIZED_P(1);
LWT_TOPOLOGY *topo;
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
geom = PG_GETARG_GSERIALIZED_P(1);
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
geom = PG_GETARG_GSERIALIZED_P(1);
}
toponame_text = PG_GETARG_TEXT_P(0);
- toponame = text2cstring(toponame_text);
+ toponame = text_to_cstring(toponame_text);
PG_FREE_IF_COPY(toponame_text, 0);
geom = PG_GETARG_GSERIALIZED_P(1);