PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ bytebuffer_get_buffer_copy()

uint8_t* bytebuffer_get_buffer_copy ( const bytebuffer_t s,
size_t *  buffer_length 
)

Returns a copy of the internal buffer.

Definition at line 173 of file bytebuffer.c.

References bytebuffer_t::buf_start, bytebuffer_getlength(), and lwalloc().

Referenced by lwgeom_to_twkb_with_idlist().

174 {
175  size_t bufsz = bytebuffer_getlength(s);
176  uint8_t *buf = lwalloc(bufsz);
177  memcpy(buf, s->buf_start, bufsz);
178  if ( buffer_length )
179  *buffer_length = bufsz;
180  return buf;
181 }
size_t bytebuffer_getlength(const bytebuffer_t *s)
Returns the length of the current buffer.
Definition: bytebuffer.c:377
uint8_t * buf_start
Definition: bytebuffer.h:41
void * lwalloc(size_t size)
Definition: lwutil.c:229
unsigned char uint8_t
Definition: uthash.h:79
Here is the call graph for this function:
Here is the caller graph for this function: