librdf_statement_encode_parts

Name

librdf_statement_encode_parts --  Serialise parts of a statement into a buffer

Synopsis

size_t librdf_statement_encode_parts (librdf_statement* statement, librdf_node* context_node, unsigned char * buffer, size_t length, librdf_statement_part fields);

Arguments

statement

statement to serialise

context_node

librdf_node context node (can be NULL)

buffer

the buffer to use

length

buffer size

fields

fields to encode

Description

Encodes the given statement in the buffer, which must be of sufficient size. If buffer is NULL, no work is done but the size of buffer required is returned.

The fields values are or-ed combinations of: LIBRDF_STATEMENT_SUBJECT LIBRDF_STATEMENT_PREDICATE LIBRDF_STATEMENT_OBJECT or LIBRDF_STATEMENT_ALL for subject,prdicate,object fields

If context_node is given, it is encoded also

Return value

the number of bytes written or 0 on failure.