Volksdata 1.0b7
RDF library
Loading...
Searching...
No Matches
codec.h File Reference

High-level codec interface. More...

Include dependency graph for codec.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CODEC_TBL
#define ENTRY(a, b, c)

Functions

const VOLK_CodecVOLK_codec_from_fmt (const char *fmt)
 Get a codec by its format string.
VOLK_rc VOLK_codec_decode_str (const char *data, const char *fmt, VOLK_Graph *gr)
 Populate a graph from a RDF string.
VOLK_rc VOLK_codec_decode_file (FILE *fh, const char *fmt, VOLK_Graph *gr)
 Populate a graph from a RDF file handle.

Detailed Description

High-level codec interface.

This module, similarly to the store module, provides a high-level API to the individual codec interfaces. It allows programmatic access to a specified codec and fails gracefully when a codec is missing a requested feature.

Users of this library normally need not access codecs any deeper than this level.

Implementers of new codecs should consult the codec_interface.h documentation for implementation details. New codecs MUST be registered in two places in codec.h: 1) an #include "volksdata/codec/codec_<new_format>.h" line, and 2) an additional entry to the CODEC_TBL X-macro, which takes care of generating all necessary helper functions.

Definition in file codec.h.

Macro Definition Documentation

◆ CODEC_TBL

#define CODEC_TBL
Value:
/* #enum suffix #fmt #codec if */ \
ENTRY( NT, nt, nt_codec ) \
ENTRY( TTL, ttl, ttl_codec ) \
ENTRY( TRIG, trig, trig_codec ) \
const VOLK_Codec nt_codec
N-Triples codec.
Definition codec_nt.h:9
const VOLK_Codec trig_codec
TriG codec.
Definition codec_trig.h:9
const VOLK_Codec ttl_codec
Turtle codec.
Definition codec_ttl.h:10

Definition at line 33 of file codec.h.

◆ ENTRY

#define ENTRY ( a,
b,
c )
Value:
if (strcmp (fmt, #b) == 0) return &c;