PostGIS  2.4.9dev-r@@SVN_REVISION@@
bytebuffer.h File Reference
#include <stdlib.h>
#include <stdarg.h>
#include <stdint.h>
#include "varint.h"
#include "lwgeom_log.h"
Include dependency graph for bytebuffer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  bytebuffer_t
 

Macros

#define BYTEBUFFER_STARTSIZE   512
 
#define BYTEBUFFER_STATICSIZE   1024
 

Functions

void bytebuffer_init_with_size (bytebuffer_t *b, size_t size)
 Allocate just the internal buffer of an existing bytebuffer_t struct. More...
 
bytebuffer_tbytebuffer_create_with_size (size_t size)
 Allocate a new bytebuffer_t. More...
 
bytebuffer_tbytebuffer_create (void)
 Allocate a new bytebuffer_t. More...
 
void bytebuffer_destroy (bytebuffer_t *s)
 Free the bytebuffer_t and all memory managed within it. More...
 
void bytebuffer_destroy_buffer (bytebuffer_t *s)
 Free the bytebuffer_t and all memory managed within it. More...
 
void bytebuffer_clear (bytebuffer_t *s)
 Reset the bytebuffer_t. More...
 
void bytebuffer_append_byte (bytebuffer_t *s, const uint8_t val)
 Writes a uint8_t value to the buffer. More...
 
void bytebuffer_append_varint (bytebuffer_t *s, const int64_t val)
 Writes a signed varInt to the buffer. More...
 
void bytebuffer_append_uvarint (bytebuffer_t *s, const uint64_t val)
 Writes a unsigned varInt to the buffer. More...
 
uint64_t bytebuffer_read_uvarint (bytebuffer_t *s)
 Reads a unsigned varInt from the buffer. More...
 
int64_t bytebuffer_read_varint (bytebuffer_t *s)
 Reads a signed varInt from the buffer. More...
 
size_t bytebuffer_getlength (const bytebuffer_t *s)
 Returns the length of the current buffer. More...
 
bytebuffer_tbytebuffer_merge (bytebuffer_t **buff_array, int nbuffers)
 Returns a new bytebuffer were both ingoing bytebuffers is merged. More...
 
void bytebuffer_reset_reading (bytebuffer_t *s)
 Set the read cursor to the beginning. More...
 
uint8_tbytebuffer_get_buffer_copy (const bytebuffer_t *s, size_t *buffer_length)
 Returns a copy of the internal buffer. More...
 
const uint8_tbytebuffer_get_buffer (const bytebuffer_t *s, size_t *buffer_length)
 Returns a read-only reference to the internal buffer. More...
 
void bytebuffer_append_bytebuffer (bytebuffer_t *write_to, bytebuffer_t *write_from)
 Writes a uint8_t value to the buffer. More...
 
void bytebuffer_append_bulk (bytebuffer_t *s, void *start, size_t size)
 Writes a uint8_t value to the buffer. More...
 
void bytebuffer_append_int (bytebuffer_t *buf, const int val, int swap)
 
void bytebuffer_append_double (bytebuffer_t *buf, const double val, int swap)
 Writes a float64 to the buffer. More...