PostGIS  2.5.7dev-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.

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:373
char * s
Definition: cu_in_wkt.c:23
void * lwalloc(size_t size)
Definition: lwutil.c:229
unsigned char uint8_t
Definition: uthash.h:79

References bytebuffer_getlength(), lwalloc(), and s.

Referenced by lwgeom_to_twkb_with_idlist().

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