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.138 2004/10/28 21:39:26 cmdjb Exp $ * $Id: raptor.h,v 1.167 2005/01/03 19:32:09 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 79 skipping to change at line 79
/* Public statics */ /* Public statics */
RAPTOR_API extern const char * const raptor_short_copyright_string; RAPTOR_API extern const char * const raptor_short_copyright_string;
RAPTOR_API extern const char * const raptor_copyright_string; RAPTOR_API extern const char * const raptor_copyright_string;
RAPTOR_API extern const char * const raptor_version_string; RAPTOR_API extern const char * const raptor_version_string;
RAPTOR_API extern const unsigned int raptor_version_major; RAPTOR_API extern const unsigned int raptor_version_major;
RAPTOR_API extern const unsigned int raptor_version_minor; RAPTOR_API extern const unsigned int raptor_version_minor;
RAPTOR_API extern const unsigned int raptor_version_release; RAPTOR_API extern const unsigned int raptor_version_release;
RAPTOR_API 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 unsigned char * const raptor_xml_namespace_uri;
RAPTOR_API extern const char * const raptor_rdf_namespace_uri; RAPTOR_API extern const unsigned char * const raptor_rdf_namespace_uri;
RAPTOR_API extern const char * const raptor_rdf_schema_namespace_uri; RAPTOR_API extern const unsigned char * const raptor_rdf_schema_namespace_u
RAPTOR_API extern const char * const raptor_xmlschema_datatypes_namespace_u ri;
ri; RAPTOR_API extern const unsigned char * const raptor_xmlschema_datatypes_na
RAPTOR_API extern const char * const raptor_owl_namespace_uri; mespace_uri;
RAPTOR_API extern const unsigned char * const raptor_owl_namespace_uri;
RAPTOR_API extern const unsigned int raptor_rdf_namespace_uri_len; 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 unsigned char * const raptor_xml_literal_datatype_u ri_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_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_iostream_s raptor_iostream;
typedef struct raptor_sax2_element_s raptor_sax2_element; typedef struct raptor_xml_element_s raptor_xml_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;
typedef enum { typedef enum {
skipping to change at line 140 skipping to change at line 140
RAPTOR_FEATURE_SCANNING, RAPTOR_FEATURE_SCANNING,
RAPTOR_FEATURE_ASSUME_IS_RDF, RAPTOR_FEATURE_ASSUME_IS_RDF,
RAPTOR_FEATURE_ALLOW_NON_NS_ATTRIBUTES, RAPTOR_FEATURE_ALLOW_NON_NS_ATTRIBUTES,
RAPTOR_FEATURE_ALLOW_OTHER_PARSETYPES, RAPTOR_FEATURE_ALLOW_OTHER_PARSETYPES,
RAPTOR_FEATURE_ALLOW_BAGID, RAPTOR_FEATURE_ALLOW_BAGID,
RAPTOR_FEATURE_ALLOW_RDF_TYPE_RDF_LIST, RAPTOR_FEATURE_ALLOW_RDF_TYPE_RDF_LIST,
RAPTOR_FEATURE_NORMALIZE_LANGUAGE, RAPTOR_FEATURE_NORMALIZE_LANGUAGE,
RAPTOR_FEATURE_NON_NFC_FATAL, RAPTOR_FEATURE_NON_NFC_FATAL,
RAPTOR_FEATURE_WARN_OTHER_PARSETYPES, RAPTOR_FEATURE_WARN_OTHER_PARSETYPES,
RAPTOR_FEATURE_CHECK_RDF_ID, RAPTOR_FEATURE_CHECK_RDF_ID,
RAPTOR_FEATURE_LAST=RAPTOR_FEATURE_CHECK_RDF_ID RAPTOR_FEATURE_RELATIVE_URIS,
RAPTOR_FEATURE_START_URI,
RAPTOR_FEATURE_LAST=RAPTOR_FEATURE_START_URI
} raptor_feature; } raptor_feature;
typedef enum { typedef enum {
RAPTOR_GENID_TYPE_BNODEID, RAPTOR_GENID_TYPE_BNODEID,
RAPTOR_GENID_TYPE_BAGID RAPTOR_GENID_TYPE_BAGID
} raptor_genid_type; } raptor_genid_type;
typedef struct { typedef struct {
raptor_identifier_type type; raptor_identifier_type type;
raptor_uri *uri; raptor_uri *uri;
skipping to change at line 266 skipping to change at line 268
RAPTOR_API int raptor_locator_byte(raptor_locator *locator); RAPTOR_API int raptor_locator_byte(raptor_locator *locator);
RAPTOR_API const char * raptor_locator_file(raptor_locator *locator); RAPTOR_API const char * raptor_locator_file(raptor_locator *locator);
RAPTOR_API const char * raptor_locator_uri(raptor_locator *locator); RAPTOR_API const char * raptor_locator_uri(raptor_locator *locator);
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_parser_set_feature_string(raptor_parser *parser, rapt or_feature feature, const unsigned char *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 const unsigned char* raptor_parser_get_feature_string(raptor_par ser *parser, raptor_feature feature);
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 */ /* 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_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); RAPTOR_API int raptor_serializer_syntax_name_check(const char *name);
/* Serializing */ /* Serializing */
RAPTOR_API raptor_serializer* raptor_new_serializer(const char *name); RAPTOR_API raptor_serializer* raptor_new_serializer(const char *name);
RAPTOR_API void raptor_free_serializer(raptor_serializer* rdf_serializer); 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(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_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_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_start_to_file_handle(raptor_serializer *rdf _serializer, raptor_uri *uri, FILE *fh);
RAPTOR_API int raptor_serialize_set_namespace(raptor_serializer* rdf_serial izer, raptor_uri *uri, const unsigned char *prefix);
RAPTOR_API int raptor_serialize_statement(raptor_serializer* rdf_serializer , const raptor_statement *statement); 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 int raptor_serialize_end(raptor_serializer *rdf_serializer);
RAPTOR_API raptor_iostream* raptor_serializer_get_iostream(raptor_serialize r *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_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 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); RAPTOR_API raptor_locator* raptor_serializer_get_locator(raptor_serializer *rdf_serializer);
RAPTOR_API int raptor_serializer_features_enumerate(const raptor_feature fe
ature, const char **name, raptor_uri **uri, const char **label);
RAPTOR_API int raptor_serializer_set_feature(raptor_serializer *serializer,
raptor_feature feature, int value);
RAPTOR_API int raptor_serializer_set_feature_string(raptor_serializer *seri
alizer, raptor_feature feature, const unsigned char *value);
RAPTOR_API int raptor_serializer_get_feature(raptor_serializer *serializer,
raptor_feature feature);
RAPTOR_API const unsigned char *raptor_serializer_get_feature_string(raptor
_serializer *serializer, raptor_feature feature);
/* 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);
skipping to change at line 319 skipping to change at line 328
RAPTOR_API raptor_uri* raptor_new_uri_for_retrieval(raptor_uri* old_uri); RAPTOR_API raptor_uri* raptor_new_uri_for_retrieval(raptor_uri* old_uri);
/* Identifier functions */ /* Identifier functions */
RAPTOR_API raptor_identifier* raptor_new_identifier(raptor_identifier_type type, raptor_uri *uri, raptor_uri_source uri_source, const unsigned char *i d, const unsigned char *literal, raptor_uri *literal_datatype, const unsign ed char *literal_language); RAPTOR_API raptor_identifier* raptor_new_identifier(raptor_identifier_type type, raptor_uri *uri, raptor_uri_source uri_source, const unsigned char *i d, const unsigned char *literal, raptor_uri *literal_datatype, const unsign ed char *literal_language);
RAPTOR_API int raptor_copy_identifier(raptor_identifier *dest, raptor_ident ifier *src); RAPTOR_API int raptor_copy_identifier(raptor_identifier *dest, raptor_ident ifier *src);
RAPTOR_API void raptor_free_identifier(raptor_identifier *identifier); RAPTOR_API void raptor_free_identifier(raptor_identifier *identifier);
/* Utility functions */ /* Utility functions */
RAPTOR_API int raptor_print_ntriples_string(FILE *stream, const unsigned ch ar *string, const char delim); RAPTOR_API int raptor_print_ntriples_string(FILE *stream, const unsigned ch ar *string, const char delim);
RAPTOR_API unsigned char* raptor_ntriples_string_as_utf8_string(raptor_pars er* rdf_parser, unsigned char *src, int len, size_t *dest_lenp); RAPTOR_API unsigned char* raptor_ntriples_string_as_utf8_string(raptor_pars er* rdf_parser, unsigned char *src, int len, size_t *dest_lenp);
RAPTOR_API const char* raptor_ntriples_term_as_string (raptor_ntriples_term RAPTOR_API RAPTOR_DEPRECATED const char* raptor_ntriples_term_as_string(rap
_type term); tor_ntriples_term_type term);
RAPTOR_API int raptor_iostream_write_string_ntriples(raptor_iostream *iostr
, const unsigned char *string, size_t len, const char delim);
RAPTOR_API void raptor_iostream_write_statement_ntriples(raptor_iostream* i
ostr, const raptor_statement *statement);
RAPTOR_API int raptor_xml_escape_string(const unsigned char *string, size_t len, unsigned char *buffer, size_t length, char quote, raptor_simple_messa ge_handler error_handler, void *error_data); RAPTOR_API int raptor_xml_escape_string(const unsigned char *string, size_t len, unsigned char *buffer, size_t length, char quote, raptor_simple_messa ge_handler error_handler, void *error_data);
RAPTOR_API int raptor_iostream_write_xml_escaped_string(raptor_iostream* io str, const unsigned char *string, size_t len, char quote, raptor_simple_mes sage_handler error_handler, void *error_data);
RAPTOR_API char* raptor_vsnprintf(const char *message, va_list arguments); RAPTOR_API char* raptor_vsnprintf(const char *message, va_list arguments);
/* raptor_xml_writer.c */ RAPTOR_API int raptor_xml_name_check(const unsigned char *string, size_t le
/* NOT PUBLIC YET - SEE raptor_internal.h */ ngth, int xml_version);
/* raptor_rfc2396.c */ /* raptor_rfc2396.c */
RAPTOR_API void raptor_uri_resolve_uri_reference (const unsigned char *base _uri, const unsigned char *reference_uri, char unsigned *buffer, size_t len gth); RAPTOR_API void raptor_uri_resolve_uri_reference (const unsigned char *base _uri, const unsigned char *reference_uri, char unsigned *buffer, size_t len gth);
/* raptor_uri.c */ /* raptor_uri.c */
RAPTOR_API unsigned char *raptor_uri_filename_to_uri_string(const char *fil ename); RAPTOR_API unsigned char *raptor_uri_filename_to_uri_string(const char *fil ename);
RAPTOR_API char *raptor_uri_uri_string_to_filename(const unsigned char *uri _string); RAPTOR_API char *raptor_uri_uri_string_to_filename(const unsigned char *uri _string);
RAPTOR_API char *raptor_uri_uri_string_to_filename_fragment(const unsigned char *uri_string, unsigned char **fragment_p); RAPTOR_API char *raptor_uri_uri_string_to_filename_fragment(const unsigned char *uri_string, unsigned char **fragment_p);
RAPTOR_API int raptor_uri_is_file_uri(const unsigned char* uri_string); RAPTOR_API int raptor_uri_is_file_uri(const unsigned char* uri_string);
RAPTOR_API unsigned char* raptor_uri_to_relative_counted_uri_string(raptor_
uri *base_uri, raptor_uri *reference_uri, size_t *length_p);
RAPTOR_API unsigned char* raptor_uri_to_relative_uri_string(raptor_uri *bas
e_uri, raptor_uri *reference_uri);
RAPTOR_API void raptor_uri_print(const raptor_uri* uri, FILE *stream);
RAPTOR_API unsigned char* raptor_uri_to_counted_string(raptor_uri *uri, siz
e_t *len_p);
RAPTOR_API unsigned char* raptor_uri_to_string(raptor_uri *uri);
RAPTOR_API void raptor_uri_init(void); RAPTOR_API void raptor_uri_init(void);
RAPTOR_API void raptor_uri_set_handler(raptor_uri_handler *handler, void *c ontext); RAPTOR_API void raptor_uri_set_handler(raptor_uri_handler *handler, void *c ontext);
RAPTOR_API void raptor_uri_get_handler(raptor_uri_handler **handler, void * *context); RAPTOR_API void raptor_uri_get_handler(raptor_uri_handler **handler, void * *context);
#define RAPTOR_RDF_MS_URI "http://www.w3.org/1999/02/22-rdf-syntax-ns#" #define RAPTOR_RDF_MS_URI raptor_rdf_namespace_uri
#define RAPTOR_RDF_SCHEMA_URI "http://www.w3.org/2000/01/rdf-schema#" #define RAPTOR_RDF_SCHEMA_URI raptor_rdf_schema_namespace_uri
#define RAPTOR_XMLSCHEMA_DATATYPES_URI "http://www.w3.org/2001/XMLSchema#" #define RAPTOR_XMLSCHEMA_DATATYPES_URI raptor_xmlschema_datatypes_namespace
#define RAPTOR_OWL_URI "http://www.w3.org/2002/07/owl#" _uri
#define RAPTOR_OWL_URI raptor_owl_namespace_uri
/* raptor_www */ /* raptor_www */
RAPTOR_API void raptor_www_init(void); RAPTOR_API void raptor_www_init(void);
RAPTOR_API void raptor_www_finish(void); RAPTOR_API void raptor_www_finish(void);
RAPTOR_API void raptor_www_no_www_library_init_finish(void); RAPTOR_API void raptor_www_no_www_library_init_finish(void);
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);
skipping to change at line 369 skipping to change at line 386
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 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 raptor_qname* raptor_qname_copy(raptor_qname *qname);
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);
RAPTOR_API int raptor_iostream_write_qname(raptor_iostream* iostr, raptor_q name *qname);
/* raptor_namespace_stack - stack of XML namespaces */ /* raptor_namespace_stack - stack of XML namespaces */
RAPTOR_API raptor_namespace* raptor_new_namespace_from_uri(raptor_namespace _stack *nstack, const unsigned char *prefix, raptor_uri* ns_uri, int depth );
RAPTOR_API raptor_namespace_stack* raptor_new_namespaces(raptor_uri_handler *uri_handler, void *uri_context, raptor_simple_message_handler error_handl er, void *error_data, int defaults); RAPTOR_API raptor_namespace_stack* raptor_new_namespaces(raptor_uri_handler *uri_handler, void *uri_context, raptor_simple_message_handler error_handl er, void *error_data, int defaults);
RAPTOR_API void raptor_namespaces_init(raptor_namespace_stack *nstack, rapt or_uri_handler *handler, void *context, raptor_simple_message_handler error _handler, void *error_data, int defaults); RAPTOR_API void raptor_namespaces_init(raptor_namespace_stack *nstack, rapt or_uri_handler *handler, void *context, raptor_simple_message_handler error _handler, void *error_data, int defaults);
RAPTOR_API void raptor_namespaces_clear(raptor_namespace_stack *nstack); RAPTOR_API void raptor_namespaces_clear(raptor_namespace_stack *nstack);
RAPTOR_API void raptor_free_namespaces(raptor_namespace_stack *nstack); RAPTOR_API void raptor_free_namespaces(raptor_namespace_stack *nstack);
RAPTOR_API void raptor_namespaces_start_namespace(raptor_namespace_stack *n stack, raptor_namespace *nspace); RAPTOR_API void raptor_namespaces_start_namespace(raptor_namespace_stack *n stack, raptor_namespace *nspace);
RAPTOR_API int raptor_namespaces_start_namespace_full(raptor_namespace_stac k *nstack, const unsigned char *prefix, const unsigned char *nspace, int de pth); RAPTOR_API int raptor_namespaces_start_namespace_full(raptor_namespace_stac k *nstack, const unsigned char *prefix, const unsigned char *nspace, int de pth);
RAPTOR_API void raptor_namespaces_end_for_depth(raptor_namespace_stack *nst ack, int depth); RAPTOR_API void raptor_namespaces_end_for_depth(raptor_namespace_stack *nst ack, int depth);
RAPTOR_API raptor_namespace* raptor_namespaces_get_default_namespace(raptor _namespace_stack *nstack); RAPTOR_API raptor_namespace* raptor_namespaces_get_default_namespace(raptor _namespace_stack *nstack);
RAPTOR_API raptor_namespace *raptor_namespaces_find_namespace(raptor_namesp ace_stack *nstack, const unsigned char *prefix, int prefix_length); RAPTOR_API raptor_namespace *raptor_namespaces_find_namespace(raptor_namesp ace_stack *nstack, const unsigned char *prefix, int prefix_length);
RAPTOR_API raptor_namespace* raptor_namespaces_find_namespace_by_uri(raptor _namespace_stack *nstack, raptor_uri *ns_uri);
RAPTOR_API int raptor_namespaces_namespace_in_scope(raptor_namespace_stack *nstack, const raptor_namespace *nspace); RAPTOR_API int raptor_namespaces_namespace_in_scope(raptor_namespace_stack *nstack, const raptor_namespace *nspace);
/* raptor_namespace - XML namespace */ /* raptor_namespace - XML namespace */
RAPTOR_API raptor_namespace* raptor_new_namespace(raptor_namespace_stack *n stack, const unsigned char *prefix, const unsigned char *ns_uri_string, int depth); RAPTOR_API raptor_namespace* raptor_new_namespace(raptor_namespace_stack *n stack, const unsigned char *prefix, const unsigned char *ns_uri_string, int depth);
RAPTOR_API void raptor_free_namespace(raptor_namespace *ns); RAPTOR_API void raptor_free_namespace(raptor_namespace *ns);
RAPTOR_API int raptor_namespace_copy(raptor_namespace_stack *nstack, raptor _namespace *ns, int new_depth); RAPTOR_API int raptor_namespace_copy(raptor_namespace_stack *nstack, raptor _namespace *ns, int new_depth);
RAPTOR_API raptor_uri* raptor_namespace_get_uri(const raptor_namespace *ns) ; RAPTOR_API raptor_uri* raptor_namespace_get_uri(const raptor_namespace *ns) ;
RAPTOR_API const unsigned char* raptor_namespace_get_prefix(const raptor_na mespace *ns); RAPTOR_API const unsigned char* raptor_namespace_get_prefix(const raptor_na mespace *ns);
RAPTOR_API unsigned char *raptor_namespaces_format(const raptor_namespace * ns, size_t *length_p); RAPTOR_API unsigned char *raptor_namespaces_format(const raptor_namespace * ns, size_t *length_p);
RAPTOR_API int raptor_iostream_write_namespace(raptor_iostream* iostr, rapt
or_namespace *ns);
RAPTOR_API int raptor_new_namespace_parts_from_string(const unsigned char *
string, unsigned char **prefix, unsigned char **uri_string);
typedef struct raptor_stringbuffer_s raptor_stringbuffer; typedef struct raptor_stringbuffer_s raptor_stringbuffer;
/* Sequence class */ /* Sequence class */
typedef struct raptor_sequence_s raptor_sequence; typedef struct raptor_sequence_s raptor_sequence;
typedef void* (raptor_sequence_free_handler(void*)); typedef void (raptor_sequence_free_handler(void*));
typedef void (raptor_sequence_print_handler(void *object, FILE *fh)); typedef void (raptor_sequence_print_handler(void *object, FILE *fh));
/* Create */ /* Create */
RAPTOR_API raptor_sequence* raptor_new_sequence(raptor_sequence_free_handle r* free_handler, raptor_sequence_print_handler* print_handler); RAPTOR_API raptor_sequence* raptor_new_sequence(raptor_sequence_free_handle r* free_handler, raptor_sequence_print_handler* print_handler);
/* Destroy */ /* Destroy */
RAPTOR_API void raptor_free_sequence(raptor_sequence* seq); RAPTOR_API void raptor_free_sequence(raptor_sequence* seq);
/* Methods */ /* Methods */
RAPTOR_API int raptor_sequence_size(raptor_sequence* seq); RAPTOR_API int raptor_sequence_size(raptor_sequence* seq);
RAPTOR_API int raptor_sequence_set_at(raptor_sequence* seq, int idx, void * data); RAPTOR_API int raptor_sequence_set_at(raptor_sequence* seq, int idx, void * data);
RAPTOR_API int raptor_sequence_push(raptor_sequence* seq, void *data); RAPTOR_API int raptor_sequence_push(raptor_sequence* seq, void *data);
skipping to change at line 423 skipping to change at line 447
RAPTOR_API int raptor_compare_strings(const void *a, const void *b); RAPTOR_API int raptor_compare_strings(const void *a, const void *b);
RAPTOR_API void raptor_sequence_sort(raptor_sequence* seq, int(*compare)(co nst void *, const void *)); RAPTOR_API void raptor_sequence_sort(raptor_sequence* seq, int(*compare)(co nst void *, const void *));
/* helper for printing sequences of strings */ /* helper for printing sequences of strings */
RAPTOR_API void raptor_sequence_print_string(char *data, FILE *fh); RAPTOR_API void raptor_sequence_print_string(char *data, FILE *fh);
RAPTOR_API void raptor_sequence_print_uri(char *data, FILE *fh); RAPTOR_API void raptor_sequence_print_uri(char *data, FILE *fh);
RAPTOR_API void raptor_sequence_set_print_handler(raptor_sequence *seq, rap tor_sequence_print_handler *print_handler); RAPTOR_API void raptor_sequence_set_print_handler(raptor_sequence *seq, rap tor_sequence_print_handler *print_handler);
RAPTOR_API void raptor_sequence_print(raptor_sequence* seq, FILE* fh); RAPTOR_API void raptor_sequence_print(raptor_sequence* seq, FILE* fh);
RAPTOR_API int raptor_sequence_join(raptor_sequence* dest, raptor_sequence *src);
/* raptor_utf8.c */ /* Unicode and UTF8 */
RAPTOR_API int raptor_unicode_char_to_utf8(unsigned long c, unsigned char * output); RAPTOR_API int raptor_unicode_char_to_utf8(unsigned long c, unsigned char * output);
RAPTOR_API int raptor_utf8_to_unicode_char(unsigned long *output, const uns igned char *input, int length); RAPTOR_API int raptor_utf8_to_unicode_char(unsigned long *output, const uns igned char *input, int length);
RAPTOR_API int raptor_unicode_is_xml11_namestartchar(long c);
RAPTOR_API int raptor_unicode_is_xml10_namestartchar(long c);
RAPTOR_API int raptor_unicode_is_xml11_namechar(long c);
RAPTOR_API int raptor_unicode_is_xml10_namechar(long c);
RAPTOR_API int raptor_utf8_check(const unsigned char *string, size_t length
);
/* raptor_stringbuffer */ /* raptor_stringbuffer */
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);
skipping to change at line 473 skipping to change at line 503
RAPTOR_API raptor_iostream* raptor_new_iostream_to_string(void **string_p, size_t *length_p, void *(*malloc_handler)(size_t size)); 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 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_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 int raptor_iostream_write_byte(raptor_iostream *iostr, const int byte);
RAPTOR_API void raptor_iostream_write_end(raptor_iostream *iostr); 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_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 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 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_write_decimal(raptor_iostream* iostr, int in teger);
RAPTOR_API int raptor_iostream_format_hexadecimal(raptor_iostream* iostr, u nsigned int integer, int width); RAPTOR_API int raptor_iostream_format_hexadecimal(raptor_iostream* iostr, u nsigned int integer, int width);
RAPTOR_API int raptor_iostream_write_stringbuffer(raptor_iostream* iostr, r
aptor_stringbuffer *sb);
/* Parser and Serializer features */
RAPTOR_API raptor_feature raptor_feature_from_uri(raptor_uri *uri);
RAPTOR_API int raptor_feature_value_type(const raptor_feature feature);
/* SAX2 element Class (raptor_xml_element) */
RAPTOR_API raptor_xml_element* raptor_new_xml_element(raptor_qname* name, c
onst unsigned char* xml_language, raptor_uri* xml_base);
RAPTOR_API void raptor_free_xml_element(raptor_xml_element *element);
RAPTOR_API raptor_qname* raptor_xml_element_get_name(raptor_xml_element *xm
l_element);
RAPTOR_API void raptor_xml_element_set_attributes(raptor_xml_element* xml_e
lement, raptor_qname **attributes, int count);
RAPTOR_API void raptor_xml_element_declare_namespace(raptor_xml_element* xm
l_element, raptor_namespace *nspace);
RAPTOR_API int raptor_iostream_write_xml_element(raptor_iostream *iostr, ra
ptor_xml_element *element, raptor_namespace_stack *nstack, int is_empty, in
t is_end, raptor_simple_message_handler error_handler, void *error_data, in
t depth);
/* XML Writer Class (raptor_xml_writer) */
RAPTOR_API raptor_xml_writer* raptor_new_xml_writer(raptor_namespace_stack
*nstack, raptor_uri_handler *uri_handler, void *uri_context, raptor_iostrea
m* iostr, raptor_simple_message_handler error_handler, void *error_data, in
t canonicalize);
RAPTOR_API void raptor_free_xml_writer(raptor_xml_writer* xml_writer);
RAPTOR_API void raptor_xml_writer_empty_element(raptor_xml_writer* xml_writ
er, raptor_xml_element *element);
RAPTOR_API void raptor_xml_writer_start_element(raptor_xml_writer* xml_writ
er, raptor_xml_element *element);
RAPTOR_API void raptor_xml_writer_end_element(raptor_xml_writer* xml_writer
, raptor_xml_element *element);
RAPTOR_API void raptor_xml_writer_cdata(raptor_xml_writer* xml_writer, cons
t unsigned char *str);
RAPTOR_API void raptor_xml_writer_cdata_counted(raptor_xml_writer* xml_writ
er, const unsigned char *str, unsigned int length);
RAPTOR_API void raptor_xml_writer_raw(raptor_xml_writer* xml_writer, const
unsigned char *str);
RAPTOR_API void raptor_xml_writer_raw_counted(raptor_xml_writer* xml_writer
, const unsigned char *str, unsigned int length);
RAPTOR_API void raptor_xml_writer_comment(raptor_xml_writer* xml_writer, co
nst unsigned char *str);
RAPTOR_API void raptor_xml_writer_comment_counted(raptor_xml_writer* xml_wr
iter, const unsigned char *str, unsigned int length);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 26 change blocks. 
21 lines changed or deleted 113 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/