Volksdata 1.0b7
RDF library
Loading...
Searching...
No Matches
Private RDF codec API
Collaboration diagram for Private RDF codec API:

Data Structures

struct  VOLK_TTLParserState
 Parser state. More...

Macros

#define CHUNK_SIZE   4096
#define CODEC_TBL

Enumerations

enum  VOLK_CodecType { CODEC_TBL }
 Codec types. All prefixed with VOLK_CODEC_. More...

Functions

uint8_t * uint8_dup (const uint8_t *str)
 Parse error information.
uint8_t * uint8_ndup (const uint8_t *str, size_t size)
 strndup() for unsigned char.
VOLK_rc escape_lit (const char *in, char **out)
 Add escape character (backslash) to illegal literal characters.
char unescape_char (const char c)
 Unescape a single character.
uint8_t * unescape_unicode (const uint8_t *esc_str, size_t size)
 Replace \uxxxx and \Uxxxxxxxx with Unicode bytes.
char * fmt_header (char *pfx)
 Format an informational header.

Detailed Description

Macro Definition Documentation

◆ CHUNK_SIZE

#define CHUNK_SIZE   4096

Max data size passed to the scanner and parser at each iteration.

Definition at line 16 of file codec.h.

◆ CODEC_TBL

#define CODEC_TBL
Value:
/* #enum suffix #fmt #codec if */ \
ENTRY( NT, nt, nt_codec ) \
ENTRY( TTL, ttl, ttl_codec ) \
const VOLK_Codec nt_codec
N-Triples codec.
Definition codec_nt.c:182
const VOLK_Codec ttl_codec
Turtle codec.
Definition codec_ttl.c:305

Definition at line 25 of file codec.h.

Enumeration Type Documentation

◆ VOLK_CodecType

Codec types. All prefixed with VOLK_CODEC_.

Enumerator
CODEC_TBL 

Definition at line 32 of file codec.h.

Function Documentation

◆ uint8_dup()

uint8_t * uint8_dup ( const uint8_t * str)
inline

Parse error information.

strdup() for unsigned char.

This is to be used with uint8_t sequences considered to be UTF-8 sequences, requird by re2c (it won't work with byte sequences containing NUL).

Definition at line 72 of file codec.h.

◆ uint8_ndup()

uint8_t * uint8_ndup ( const uint8_t * str,
size_t size )
inline

strndup() for unsigned char.

This is to be used with uint8_t sequences considered to be UTF-8 sequences, requird by re2c (it won't work with byte sequences containing NUL).

Definition at line 82 of file codec.h.

◆ escape_lit()

VOLK_rc escape_lit ( const char * in,
char ** out )

Add escape character (backslash) to illegal literal characters.

Parameters
[in]inInput string.
[out]outOutput string.
Returns
VOLK_OK on success; VOLK_MEM_ERR on memory error.

Definition at line 81 of file codec.c.

◆ unescape_char()

char unescape_char ( const char c)
inline

Unescape a single character.

Convert escaped special characters such as \t, \n, etc. into their corresponding code points.

Non-special characters are returned unchanged.

Parameters
[in]cCharacter to unescape. Note that this is the single character after \\endiskip.
Returns
Code point corresponding to the escaped character.

Definition at line 128 of file codec.h.

◆ unescape_unicode()

uint8_t * unescape_unicode ( const uint8_t * esc_str,
size_t size )

Replace \uxxxx and \Uxxxxxxxx with Unicode bytes.

Parameters
[in]esc_strEscaped string.
[in]sizeMaximum number of characters to scan, à la strncpy().
Returns
String with escape sequences replaced by Unicode bytes.

Definition at line 11 of file codec.c.

◆ fmt_header()

char * fmt_header ( char * pfx)

Format an informational header.

The information includes software version and current date. It is terminated by a newline + NUL and prefixed with the string specified in pfx. It is NOT prefixed by any comment characters.

Parameters
[in]pfxPrefix to add to the string. It may be a comment starter, such as # .

Definition at line 116 of file codec.c.