PostGIS  2.1.10dev-r@@SVN_REVISION@@
char* stringbuffer_getstringcopy ( stringbuffer_t s)

Returns a newly allocated string large enough to contain the current state of the string.

Caller is responsible for freeing the return value.

Definition at line 154 of file stringbuffer.c.

References lwalloc(), stringbuffer_t::str_end, and stringbuffer_t::str_start.

Referenced by lwgeom_to_kml2(), lwgeom_to_wkt(), nd_box_to_json(), and nd_stats_to_json().

155 {
156  size_t size = (s->str_end - s->str_start) + 1;
157  char *str = lwalloc(size);
158  memcpy(str, s->str_start, size);
159  str[size - 1] = '\0';
160  return str;
161 }
char * str_start
Definition: stringbuffer.h:53
void * lwalloc(size_t size)
Definition: lwutil.c:175

Here is the call graph for this function:

Here is the caller graph for this function: