Volksdata 1.0b7
RDF library
Loading...
Searching...
No Matches
buffer.h File Reference
#include "volksdata/core.h"
Include dependency graph for buffer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  VOLK_Buffer
 General-purpose data buffer. More...
struct  VOLK_BufferTriple
 Triple of byte buffers. More...

Macros

#define NULL_KEY   0
 "NULL" key, a value that is never user-provided.
#define BUF_DUMMY   VOLK_buffer_new (NULL, 0)
 Dummy buffer to be used with VOLK_buffer_init.
#define BTRP_DUMMY   VOLK_btriple_new (BUF_DUMMY, BUF_DUMMY, BUF_DUMMY)
 Dummy buffer triple.

Enumerations

enum  VOLK_TriplePos { TRP_POS_S = 0 , TRP_POS_P = 1 , TRP_POS_O = 2 }
 Triple position of s, p, o. More...
enum  VOLK_BufferFlag { VOLK_BUF_BORROWED = 1<<0 }
 Buffer flags, stored in buffer structure. More...

Functions

VOLK_rc VOLK_buffer_init (VOLK_Buffer *buf, const size_t size, const unsigned char *data)
 Initialize or reuse a buffer handle.
VOLK_BufferVOLK_buffer_new (const unsigned char *data, const size_t size)
 Create a new buffer and optionally populate it with data.
VOLK_BufferVOLK_buffer_new_borrowed (unsigned char *data, const size_t size)
 Create a borrowed buffer (memory view).
void VOLK_buffer_done (VOLK_Buffer *buf)
 Free the content of a buffer.
void VOLK_buffer_free (VOLK_Buffer *buf)
 Free a buffer.
VOLK_Key VOLK_buffer_hash (const VOLK_Buffer *buf)
 Hash a buffer.
void VOLK_buffer_print (const VOLK_Buffer *buf)
 Print a byte string of a given length in a human-readable format.
char * VOLK_buffer_as_str (const VOLK_Buffer *buf)
 Format a buffer into anb ASCII string.
int VOLK_buffer_cmp (const VOLK_Buffer *buf1, const VOLK_Buffer *buf2)
 Compare two buffers.
bool VOLK_buffer_eq (const VOLK_Buffer *buf1, const VOLK_Buffer *buf2)
 Return whether two buffers are equal.
VOLK_BufferTripleVOLK_btriple_new (VOLK_Buffer *s, VOLK_Buffer *p, VOLK_Buffer *o)
 Create a new buffer triple.
VOLK_rc VOLK_btriple_init (VOLK_BufferTriple *sspo, VOLK_Buffer *s, VOLK_Buffer *p, VOLK_Buffer *o)
 Initialize internal term pointers in a heap-allocated buffer triple.
void VOLK_btriple_done (VOLK_BufferTriple *sspo)
 Free the internal pointers of a buffer triple.
void VOLK_btriple_free (VOLK_BufferTriple *sspo)
 Free a buffer triple and all its internal pointers.
VOLK_BufferVOLK_btriple_pos (const VOLK_BufferTriple *btrp, VOLK_TriplePos n)
 Get serialized triple by term position.
VOLK_Key VOLK_btriple_hash (const VOLK_BufferTriple *strp)
 Hash a buffer triple.

Variables

VOLK_BufferVOLK_default_ctx_buf
 Serialized default context.