PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ stringbuffer_getvarlenacopy()

lwvarlena_t* stringbuffer_getvarlenacopy ( stringbuffer_t s)

Definition at line 134 of file stringbuffer.c.

135 {
136  size_t size = (s->str_end - s->str_start);
137  lwvarlena_t *output = (lwvarlena_t *)lwalloc(size + LWVARHDRSZ);
138  LWSIZE_SET(output->size, size + LWVARHDRSZ);
139 
140  memcpy(output->data, s->str_start, size);
141  return output;
142 }
char * s
Definition: cu_in_wkt.c:23
#define LWVARHDRSZ
Definition: liblwgeom.h:326
#define LWSIZE_SET(varsize, len)
Definition: liblwgeom.h:340
void * lwalloc(size_t size)
Definition: lwutil.c:227
uint32_t size
Definition: liblwgeom.h:322
char data[]
Definition: liblwgeom.h:323

References lwvarlena_t::data, lwalloc(), LWSIZE_SET, LWVARHDRSZ, s, and lwvarlena_t::size.

Referenced by lwgeom_to_kml2(), lwgeom_to_marc21(), lwgeom_to_wkt_varlena(), lwgeom_to_x3d3(), and pointarray_to_encoded_polyline().

Here is the call graph for this function:
Here is the caller graph for this function: