Top |
void | (*raptor_statement_handler) () |
int | raptor_snprintf () |
int | raptor_vasprintf () |
char * | raptor_vsnprintf () |
int | raptor_vsnprintf2 () |
void | raptor_sort_r () |
void | (*raptor_log_handler) () |
const char * | raptor_log_level_get_label () |
const char * | raptor_domain_get_label () |
int | (*raptor_data_compare_handler) () |
int | (*raptor_data_compare_arg_handler) () |
void | (*raptor_data_context_free_handler) () |
int | (*raptor_data_context_print_handler) () |
void | (*raptor_data_free_handler) () |
void * | (*raptor_data_malloc_handler) () |
int | (*raptor_data_print_handler) () |
char * | (*raptor_generate_bnodeid_handler) () |
int | raptor_syntax_description_validate () |
void (*raptor_statement_handler) (void *user_data
,raptor_statement *statement
);
Statement (triple) reporting handler function.
This handler function set with
raptor_parser_set_statement_handler()
on a parser receives
statements as the parsing proceeds. The statement
argument to the
handler is shared and must be copied by the caller with
raptor_statement_copy()
.
int raptor_snprintf (char *buffer
,size_t size
,const char *format
,...
);
Format output into an allocated sized buffer
This provides a portable version snprintf()
over variants on
different systems.
If buffer
is NULL, calculates the number of bytes needed to
allocate for buffer and do no formatting.
int raptor_vasprintf (char **ret
,const char *format
,va_list arguments
);
Format output into a new buffer and return it
This is a wrapper around the (GNU) vasprintf function that is not always avaiable.
char * raptor_vsnprintf (const char *format
,va_list arguments
);
raptor_vsnprintf
is deprecated and should not be used in newly-written code.
Format output for a variable arguments list into a newly allocated buffer
Deprecated
: This does not actually conform to vsnprintf's calling
convention and does not return the allocated buffer length. Use
raptor_vsnprintf2()
or raptor_vasprintf()
instead.
int raptor_vsnprintf2 (char *buffer
,size_t size
,const char *format
,va_list arguments
);
Format output for a variable arguments list into an allocated sized buffer.
This is a wrapper around system versions of vsnprintf with different call and return conventions.
If buffer
is NULL or size is 0 or the buffer size is too small,
returns the number of bytes that would be needed for buffer
void raptor_sort_r (void *base
,size_t nel
,size_t width
,raptor_data_compare_arg_handler compar
,void *user_data
);
Sort an array with an extra user data arg for the comparison funciton.
Sorts data at base
of nel
elememnts of width width
using
comparison function comp
that takes args (void* data1, void*
data2, user_data
) and returns <0, 0, or >0 for object comparison.
void (*raptor_log_handler) (void *user_data
,raptor_log_message *message
);
Handler function for log messages with location
Used during parsing and serializing for errors and warnings that
may include location information. Handlers may be set
by raptor_world_set_log_handler()
.
const char *
raptor_log_level_get_label (raptor_log_level level
);
Get label for a log message level
const char *
raptor_domain_get_label (raptor_domain domain
);
Get label for a domain
int (*raptor_data_compare_handler) (const void *data1
,const void *data2
);
Function to compare two data objects - signature like strcmp()
and function pssed to qsort()
Designed to be passed into generic data structure constructors
like raptor_new_avltree()
.
int (*raptor_data_compare_arg_handler) (const void *data1
,const void *data2
,void *user_data
);
Function to compare two data objects with a user data argument
Designed to be used with raptor_sort_r()
and compatible functions
such as raptor_sequence_sort_r()
which uses it.
void (*raptor_data_context_free_handler) (void *context
,void *object
);
Handler function for freeing a sequence item with a contextual pointer.
int (*raptor_data_context_print_handler) (void *context
,void *object
,FILE *fh
);
Function function for printing an object with data context to a stream.
void
(*raptor_data_free_handler) (void *data
);
Typedef for function to free a data object - signature like free()
Designed to be passed into generic data structure constructors
like raptor_new_avltree()
. If data
is NULL, nothing should be done.
void *
(*raptor_data_malloc_handler) (size_t size
);
Typedef for a function to allocate memory - signature like malloc()
Designed to be passed into constructors like raptor_www_fetch_to_string
int (*raptor_data_print_handler) (void *object
,FILE *fh
);
Handler function for printing an object to a stream.
Set by raptor_new_sequence()
char * (*raptor_generate_bnodeid_handler) (void *user_data
,unsigned char *user_bnodeid
);
Generate a blank node identifier handler function.
int
raptor_syntax_description_validate (raptor_syntax_description *desc
);
Validate a syntax description has the required fields (name, labels) and update counts
#define RAPTOR_VERSION 20016
Raptor library version number
Format: major * 10000 + minor * 100 + release
extern const unsigned int raptor_version_major;
Library major version number as a decimal integer.
extern const unsigned int raptor_version_minor;
Library minor version number as a decimal integer.
extern const unsigned int raptor_version_release;
Library release version number as a decimal integer.
extern const unsigned int raptor_version_decimal;
Library full version as a decimal integer.
See also raptor_version_string.
extern const char * const raptor_copyright_string;
Copyright string (multiple lines).
extern const char * const raptor_short_copyright_string;
Short copyright string (one line).
extern const char * const raptor_version_string;
Library full version as a string.
See also raptor_version_decimal.
extern const unsigned char * const raptor_owl_namespace_uri;
OWL (owl:) Namespace URI string.
extern const unsigned char * const raptor_rdf_namespace_uri;
RDF Namespace (rdf:) URI string.
extern const unsigned char * const raptor_rdf_schema_namespace_uri;
RDF Schema (rdfs:) Namespace URI string.
extern const unsigned char * const raptor_xml_literal_datatype_uri_string;
XML Literal datatype (rdf:XMLLiteral) URI string.
extern const unsigned char * const raptor_xml_namespace_uri;
XML Namespace (xml:) URI string.
extern const unsigned char * const raptor_xmlschema_datatypes_namespace_uri;
XML Schema datatypes (xsd:) namespace URI string.
typedef struct { int code; raptor_domain domain; raptor_log_level level; raptor_locator *locator; const char *text; } raptor_log_message;
Log message.
error code or < 0 if not used or known |
||
raptor_domain |
message domain or RAPTOR_DOMAIN_NONE if not used or known |
|
raptor_log_level |
log message level |
|
raptor_locator * |
location associated with message or NULL if not known |
|
message string |
Log levels
Internal |
||
very fine-grained tracing messages information |
||
fine-grained tracing messages suitable for debugging |
||
coarse-grained information messages |
||
warning messages of potentially harmful problems |
||
error messages where the application can continue |
||
fatal error message where the application will likely abort |
||
Internal |
Log domain
typedef struct { const char* names; unsigned int names_count; const char* label; const raptor_type_q* mime_types; unsigned int mime_types_count; const char* uri_strings; unsigned int uri_strings_count; unsigned int flags; } raptor_syntax_description;
Description of a syntax or file format.
array of syntax names - the first one (required) is the public name, the rest are aliases. The array is NULL terminated. |
||
size of |
||
long descriptive label for syntax |
||
const raptor_type_q * |
Array of (MIME type, Q) values associated with the syntax (or NULL). If present the array is NULL terminated. |
|
size of |
||
array of URIs identifying the syntax (or NULL). The first one if present is the main URI, the rest are aliases. The array is NULL terminated. |
||
size of |
||
See raptor_syntax_bitflags for the bits |