raptor.h | raptor.h | |||
---|---|---|---|---|
/* -*- Mode: c; c-basic-offset: 2 -*- | /* -*- Mode: c; c-basic-offset: 2 -*- | |||
* | * | |||
* raptor.h - Redland Parser Toolkit for RDF (Raptor) interfaces and defini tion | * raptor.h - Redland Parser Toolkit for RDF (Raptor) interfaces and defini tion | |||
* | * | |||
* $Id: raptor.h,v 1.128 2004/09/20 11:54:18 cmdjb Exp $ | * $Id: raptor.h,v 1.137 2004/10/24 13:47:58 cmdjb Exp $ | |||
* | * | |||
* Copyright (C) 2000-2004, David Beckett http://purl.org/net/dajobe/ | * Copyright (C) 2000-2004, David Beckett http://purl.org/net/dajobe/ | |||
* Institute for Learning and Research Technology http://www.ilrt.bristol.a c.uk/ | * Institute for Learning and Research Technology http://www.ilrt.bristol.a c.uk/ | |||
* University of Bristol, UK http://www.bristol.ac.uk/ | * University of Bristol, UK http://www.bristol.ac.uk/ | |||
* | * | |||
* This package is Free Software and part of Redland http://librdf.org/ | * This package is Free Software and part of Redland http://librdf.org/ | |||
* | * | |||
* It is licensed under the following three licenses as alternatives: | * It is licensed under the following three licenses as alternatives: | |||
* 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version | |||
* 2. GNU General Public License (GPL) V2 or any newer version | * 2. GNU General Public License (GPL) V2 or any newer version | |||
skipping to change at line 71 | skipping to change at line 71 | |||
#else | #else | |||
#define RAPTOR_DEPRECATED __attribute__((deprecated)) | #define RAPTOR_DEPRECATED __attribute__((deprecated)) | |||
#endif | #endif | |||
#else | #else | |||
#define RAPTOR_DEPRECATED | #define RAPTOR_DEPRECATED | |||
#endif | #endif | |||
typedef void* raptor_uri; | typedef void* raptor_uri; | |||
/* Public statics */ | /* Public statics */ | |||
extern const char * const raptor_short_copyright_string; | RAPTOR_API extern const char * const raptor_short_copyright_string; | |||
extern const char * const raptor_copyright_string; | RAPTOR_API extern const char * const raptor_copyright_string; | |||
extern const char * const raptor_version_string; | RAPTOR_API extern const char * const raptor_version_string; | |||
extern const unsigned int raptor_version_major; | RAPTOR_API extern const unsigned int raptor_version_major; | |||
extern const unsigned int raptor_version_minor; | RAPTOR_API extern const unsigned int raptor_version_minor; | |||
extern const unsigned int raptor_version_release; | RAPTOR_API extern const unsigned int raptor_version_release; | |||
extern const unsigned int raptor_version_decimal; | RAPTOR_API extern const unsigned int raptor_version_decimal; | |||
RAPTOR_API extern const char * const raptor_xml_namespace_uri; | ||||
RAPTOR_API extern const char * const raptor_rdf_namespace_uri; | ||||
RAPTOR_API extern const char * const raptor_rdf_schema_namespace_uri; | ||||
RAPTOR_API extern const char * const raptor_xmlschema_datatypes_namespace_u | ||||
ri; | ||||
RAPTOR_API extern const char * const raptor_owl_namespace_uri; | ||||
RAPTOR_API extern const unsigned int raptor_rdf_namespace_uri_len; | ||||
RAPTOR_API extern const char * const raptor_xml_literal_datatype_uri_string ; | RAPTOR_API extern const char * const raptor_xml_literal_datatype_uri_string ; | |||
RAPTOR_API extern const unsigned int raptor_xml_literal_datatype_uri_string _len; | RAPTOR_API extern const unsigned int raptor_xml_literal_datatype_uri_string _len; | |||
/* Public structure */ | /* Public structure */ | |||
typedef struct raptor_parser_s raptor_parser; | typedef struct raptor_parser_s raptor_parser; | |||
typedef struct raptor_serializer_s raptor_serializer; | ||||
typedef struct raptor_www_s raptor_www; | typedef struct raptor_www_s raptor_www; | |||
typedef struct raptor_iostream_s raptor_iostream; | ||||
typedef struct raptor_sax2_element_s raptor_sax2_element; | typedef struct raptor_sax2_element_s raptor_sax2_element; | |||
typedef struct raptor_xml_writer_s raptor_xml_writer; | typedef struct raptor_xml_writer_s raptor_xml_writer; | |||
typedef struct raptor_qname_s raptor_qname; | typedef struct raptor_qname_s raptor_qname; | |||
typedef struct raptor_namespace_s raptor_namespace; | typedef struct raptor_namespace_s raptor_namespace; | |||
typedef struct raptor_namespace_stack_s raptor_namespace_stack; | typedef struct raptor_namespace_stack_s raptor_namespace_stack; | |||
/* OLD structure - can't deprecate a typedef */ | /* OLD structure - can't deprecate a typedef */ | |||
typedef raptor_parser raptor_ntriples_parser; | typedef raptor_parser raptor_ntriples_parser; | |||
skipping to change at line 260 | skipping to change at line 270 | |||
RAPTOR_API const char* raptor_get_name(raptor_parser *rdf_parser); | RAPTOR_API const char* raptor_get_name(raptor_parser *rdf_parser); | |||
RAPTOR_API const char* raptor_get_label(raptor_parser *rdf_parser); | RAPTOR_API const char* raptor_get_label(raptor_parser *rdf_parser); | |||
RAPTOR_API const char* raptor_get_mime_type(raptor_parser *rdf_parser); | RAPTOR_API const char* raptor_get_mime_type(raptor_parser *rdf_parser); | |||
RAPTOR_API int raptor_features_enumerate(const raptor_feature feature, cons t char **name, raptor_uri **uri, const char **label); | RAPTOR_API int raptor_features_enumerate(const raptor_feature feature, cons t char **name, raptor_uri **uri, const char **label); | |||
RAPTOR_API int raptor_set_feature(raptor_parser *parser, raptor_feature fea ture, int value); | RAPTOR_API int raptor_set_feature(raptor_parser *parser, raptor_feature fea ture, int value); | |||
RAPTOR_API int raptor_get_feature(raptor_parser *parser, raptor_feature fea ture); | RAPTOR_API int raptor_get_feature(raptor_parser *parser, raptor_feature fea ture); | |||
RAPTOR_API raptor_feature raptor_feature_from_uri(raptor_uri *uri); | RAPTOR_API raptor_feature raptor_feature_from_uri(raptor_uri *uri); | |||
RAPTOR_API void raptor_set_parser_strict(raptor_parser* rdf_parser, int is_ strict); | RAPTOR_API void raptor_set_parser_strict(raptor_parser* rdf_parser, int is_ strict); | |||
/* Get serializer names */ | ||||
RAPTOR_API int raptor_serializers_enumerate(const unsigned int counter, con | ||||
st char **name, const char **label, const char **mime_type, const unsigned | ||||
char **uri_string); | ||||
RAPTOR_API int raptor_serializer_syntax_name_check(const char *name); | ||||
/* Serializing */ | ||||
RAPTOR_API raptor_serializer* raptor_new_serializer(const char *name); | ||||
RAPTOR_API void raptor_free_serializer(raptor_serializer* rdf_serializer); | ||||
RAPTOR_API int raptor_serialize_start(raptor_serializer *rdf_serializer, ra | ||||
ptor_uri *uri, raptor_iostream *iostream); | ||||
RAPTOR_API int raptor_serialize_start_to_filename(raptor_serializer *rdf_se | ||||
rializer, const char *filename); | ||||
RAPTOR_API int raptor_serialize_start_to_string(raptor_serializer *rdf_seri | ||||
alizer, raptor_uri *uri, void **string_p, size_t *length_p); | ||||
RAPTOR_API int raptor_serialize_start_to_file_handle(raptor_serializer *rdf | ||||
_serializer, raptor_uri *uri, FILE *fh); | ||||
RAPTOR_API int raptor_serialize_statement(raptor_serializer* rdf_serializer | ||||
, const raptor_statement *statement); | ||||
RAPTOR_API int raptor_serialize_end(raptor_serializer *rdf_serializer); | ||||
RAPTOR_API raptor_iostream* raptor_serializer_get_iostream(raptor_serialize | ||||
r *serializer); | ||||
RAPTOR_API void raptor_serializer_set_error_handler(raptor_serializer* seri | ||||
alizer, void *user_data, raptor_message_handler handler); | ||||
RAPTOR_API void raptor_serializer_set_warning_handler(raptor_serializer* se | ||||
rializer, void *user_data, raptor_message_handler handler); | ||||
RAPTOR_API raptor_locator* raptor_serializer_get_locator(raptor_serializer | ||||
*rdf_serializer); | ||||
/* memory functions */ | /* memory functions */ | |||
RAPTOR_API void raptor_free_memory(void *ptr); | RAPTOR_API void raptor_free_memory(void *ptr); | |||
RAPTOR_API void* raptor_alloc_memory(size_t size); | RAPTOR_API void* raptor_alloc_memory(size_t size); | |||
RAPTOR_API void* raptor_calloc_memory(size_t nmemb, size_t size); | RAPTOR_API void* raptor_calloc_memory(size_t nmemb, size_t size); | |||
/* URI functions */ | /* URI functions */ | |||
RAPTOR_API raptor_uri* raptor_new_uri(const unsigned char *uri_string); | RAPTOR_API raptor_uri* raptor_new_uri(const unsigned char *uri_string); | |||
RAPTOR_API raptor_uri* raptor_new_uri_from_uri_local_name(raptor_uri *uri, const unsigned char *local_name); | RAPTOR_API raptor_uri* raptor_new_uri_from_uri_local_name(raptor_uri *uri, const unsigned char *local_name); | |||
RAPTOR_API raptor_uri* raptor_new_uri_relative_to_base(raptor_uri *base_uri , const unsigned char *uri_string); | RAPTOR_API raptor_uri* raptor_new_uri_relative_to_base(raptor_uri *base_uri , const unsigned char *uri_string); | |||
RAPTOR_API raptor_uri* raptor_new_uri_from_id(raptor_uri *base_uri, const u nsigned char *id); | RAPTOR_API raptor_uri* raptor_new_uri_from_id(raptor_uri *base_uri, const u nsigned char *id); | |||
skipping to change at line 333 | skipping to change at line 362 | |||
RAPTOR_API raptor_www *raptor_www_new(void); | RAPTOR_API raptor_www *raptor_www_new(void); | |||
RAPTOR_API raptor_www *raptor_www_new_with_connection(void* connection); | RAPTOR_API raptor_www *raptor_www_new_with_connection(void* connection); | |||
RAPTOR_API void raptor_www_free(raptor_www *www); | RAPTOR_API void raptor_www_free(raptor_www *www); | |||
RAPTOR_API void raptor_www_set_user_agent(raptor_www *www, const char *user _agent); | RAPTOR_API void raptor_www_set_user_agent(raptor_www *www, const char *user _agent); | |||
RAPTOR_API void raptor_www_set_proxy(raptor_www *www, const char *proxy); | RAPTOR_API void raptor_www_set_proxy(raptor_www *www, const char *proxy); | |||
RAPTOR_API void raptor_www_set_http_accept(raptor_www *www, const char *val ue); | RAPTOR_API void raptor_www_set_http_accept(raptor_www *www, const char *val ue); | |||
RAPTOR_API void raptor_www_set_write_bytes_handler(raptor_www *www, raptor_ www_write_bytes_handler handler, void *user_data); | RAPTOR_API void raptor_www_set_write_bytes_handler(raptor_www *www, raptor_ www_write_bytes_handler handler, void *user_data); | |||
RAPTOR_API void raptor_www_set_content_type_handler(raptor_www *www, raptor _www_content_type_handler handler, void *user_data); | RAPTOR_API void raptor_www_set_content_type_handler(raptor_www *www, raptor _www_content_type_handler handler, void *user_data); | |||
RAPTOR_API void raptor_www_set_error_handler(raptor_www *www, raptor_messag e_handler error_handler, void *error_data); | RAPTOR_API void raptor_www_set_error_handler(raptor_www *www, raptor_messag e_handler error_handler, void *error_data); | |||
RAPTOR_API int raptor_www_fetch(raptor_www *www, raptor_uri *uri); | RAPTOR_API int raptor_www_fetch(raptor_www *www, raptor_uri *uri); | |||
RAPTOR_API int raptor_www_fetch_to_string(raptor_www *www, raptor_uri *uri, void **string_p, size_t *length_p, void *(*malloc_handler)(size_t size)); | ||||
RAPTOR_API void* raptor_www_get_connection(raptor_www *www); | RAPTOR_API void* raptor_www_get_connection(raptor_www *www); | |||
RAPTOR_API void raptor_www_abort(raptor_www *www, const char *reason); | RAPTOR_API void raptor_www_abort(raptor_www *www, const char *reason); | |||
/* raptor_qname - XML qnames */ | /* raptor_qname - XML qnames */ | |||
RAPTOR_API raptor_qname* raptor_new_qname(raptor_namespace_stack *nstack, c onst unsigned char *name, const unsigned char *value, raptor_simple_message _handler error_handler, void *error_data); | RAPTOR_API raptor_qname* raptor_new_qname(raptor_namespace_stack *nstack, c onst unsigned char *name, const unsigned char *value, raptor_simple_message _handler error_handler, void *error_data); | |||
RAPTOR_API raptor_qname* raptor_new_qname_from_namespace_local_name(raptor_ namespace *ns, const unsigned char *local_name, const unsigned char *value) ; | RAPTOR_API raptor_qname* raptor_new_qname_from_namespace_local_name(raptor_ namespace *ns, const unsigned char *local_name, const unsigned char *value) ; | |||
RAPTOR_API void raptor_free_qname(raptor_qname* name); | RAPTOR_API void raptor_free_qname(raptor_qname* name); | |||
RAPTOR_API int raptor_qname_equal(raptor_qname *name1, raptor_qname *name2) ; | RAPTOR_API int raptor_qname_equal(raptor_qname *name1, raptor_qname *name2) ; | |||
/* utility function */ | /* utility function */ | |||
RAPTOR_API raptor_uri* raptor_qname_string_to_uri(raptor_namespace_stack *n stack, const unsigned char *name, size_t name_len, raptor_simple_message_h andler error_handler, void *error_data); | RAPTOR_API raptor_uri* raptor_qname_string_to_uri(raptor_namespace_stack *n stack, const unsigned char *name, size_t name_len, raptor_simple_message_h andler error_handler, void *error_data); | |||
skipping to change at line 409 | skipping to change at line 439 | |||
RAPTOR_API raptor_stringbuffer* raptor_new_stringbuffer(void); | RAPTOR_API raptor_stringbuffer* raptor_new_stringbuffer(void); | |||
RAPTOR_API void raptor_free_stringbuffer(raptor_stringbuffer *stringbuffer) ; | RAPTOR_API void raptor_free_stringbuffer(raptor_stringbuffer *stringbuffer) ; | |||
RAPTOR_API int raptor_stringbuffer_append_counted_string(raptor_stringbuffe r* stringbuffer, const unsigned char *string, size_t length, int do_copy); | RAPTOR_API int raptor_stringbuffer_append_counted_string(raptor_stringbuffe r* stringbuffer, const unsigned char *string, size_t length, int do_copy); | |||
RAPTOR_API int raptor_stringbuffer_append_string(raptor_stringbuffer* strin gbuffer, const unsigned char *string, int do_copy); | RAPTOR_API int raptor_stringbuffer_append_string(raptor_stringbuffer* strin gbuffer, const unsigned char *string, int do_copy); | |||
RAPTOR_API int raptor_stringbuffer_append_decimal(raptor_stringbuffer* stri ngbuffer, int integer); | RAPTOR_API int raptor_stringbuffer_append_decimal(raptor_stringbuffer* stri ngbuffer, int integer); | |||
RAPTOR_API int raptor_stringbuffer_append_stringbuffer(raptor_stringbuffer* stringbuffer, raptor_stringbuffer* append); | RAPTOR_API int raptor_stringbuffer_append_stringbuffer(raptor_stringbuffer* stringbuffer, raptor_stringbuffer* append); | |||
RAPTOR_API int raptor_stringbuffer_prepend_counted_string(raptor_stringbuff er* stringbuffer, const unsigned char *string, size_t length, int do_copy); | RAPTOR_API int raptor_stringbuffer_prepend_counted_string(raptor_stringbuff er* stringbuffer, const unsigned char *string, size_t length, int do_copy); | |||
RAPTOR_API int raptor_stringbuffer_prepend_string(raptor_stringbuffer* stri ngbuffer, const unsigned char *string, int do_copy); | RAPTOR_API int raptor_stringbuffer_prepend_string(raptor_stringbuffer* stri ngbuffer, const unsigned char *string, int do_copy); | |||
RAPTOR_API unsigned char * raptor_stringbuffer_as_string(raptor_stringbuffe r* stringbuffer); | RAPTOR_API unsigned char * raptor_stringbuffer_as_string(raptor_stringbuffe r* stringbuffer); | |||
RAPTOR_API size_t raptor_stringbuffer_length(raptor_stringbuffer* stringbuf fer); | RAPTOR_API size_t raptor_stringbuffer_length(raptor_stringbuffer* stringbuf fer); | |||
RAPTOR_API int raptor_stringbuffer_copy_to_string(raptor_stringbuffer* stri | ||||
ngbuffer, unsigned char *string, size_t length); | ||||
typedef int (*raptor_iostream_init_func) (void *context); | ||||
typedef void (*raptor_iostream_finish_func) (void *context); | ||||
typedef int (*raptor_iostream_write_byte_func) (void *context, const int by | ||||
te); | ||||
typedef int (*raptor_iostream_write_bytes_func) (void *context, const void | ||||
*ptr, size_t size, size_t nmemb); | ||||
typedef void (*raptor_iostream_write_end_func) (void *context); | ||||
typedef struct { | ||||
/* optional, called at most once */ | ||||
raptor_iostream_init_func init; | ||||
/* optional, called at most once */ | ||||
raptor_iostream_finish_func finish; | ||||
/* methods */ | ||||
raptor_iostream_write_byte_func write_byte; | ||||
raptor_iostream_write_bytes_func write_bytes; | ||||
/* optional, called at most once */ | ||||
raptor_iostream_write_end_func write_end; | ||||
} raptor_iostream_handler; | ||||
RAPTOR_API raptor_iostream* raptor_new_iostream_from_handler(void *context, | ||||
raptor_iostream_handler *handler); | ||||
RAPTOR_API raptor_iostream* raptor_new_iostream_to_sink(void); | ||||
RAPTOR_API raptor_iostream* raptor_new_iostream_to_filename(const char *fil | ||||
ename); | ||||
RAPTOR_API raptor_iostream* raptor_new_iostream_to_file_handle(FILE *handle | ||||
); | ||||
RAPTOR_API raptor_iostream* raptor_new_iostream_to_string(void **string_p, | ||||
size_t *length_p, void *(*malloc_handler)(size_t size)); | ||||
RAPTOR_API void raptor_free_iostream(raptor_iostream *iostr); | ||||
RAPTOR_API int raptor_iostream_write_bytes(raptor_iostream *iostr, const vo | ||||
id *ptr, size_t size, size_t nmemb); | ||||
RAPTOR_API int raptor_iostream_write_byte(raptor_iostream *iostr, const int | ||||
byte); | ||||
RAPTOR_API void raptor_iostream_write_end(raptor_iostream *iostr); | ||||
RAPTOR_API int raptor_iostream_write_string(raptor_iostream *iostr, const v | ||||
oid *string); | ||||
RAPTOR_API int raptor_iostream_write_counted_string(raptor_iostream *iostr, | ||||
const void *string, size_t len); | ||||
RAPTOR_API size_t raptor_iostream_get_bytes_written_count(raptor_iostream * | ||||
iostr); | ||||
RAPTOR_API int raptor_iostream_write_decimal(raptor_iostream* iostr, int in | ||||
teger); | ||||
RAPTOR_API int raptor_iostream_format_hexadecimal(raptor_iostream* iostr, u | ||||
nsigned int integer, int width); | ||||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
#endif | #endif | |||
End of changes. 7 change blocks. | ||||
8 lines changed or deleted | 98 lines changed or added | |||