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.84 2003/09/08 12:49:42 cmdjb Exp $ | * $Id: raptor.h,v 1.98 2003/12/23 01:55:35 cmdjb Exp $ | |||
* | * | |||
* Copyright (C) 2000-2003 David Beckett - http://purl.org/net/dajobe/ | * Copyright (C) 2000-2003 David Beckett - http://purl.org/net/dajobe/ | |||
* Institute for Learning and Research Technology - http://www.ilrt.org/ | * Institute for Learning and Research Technology - http://www.ilrt.org/ | |||
* University of Bristol - http://www.bristol.ac.uk/ | * University of Bristol - http://www.bristol.ac.uk/ | |||
* | * | |||
* This package is Free Software or Open Source available under the | * This package is Free Software or Open Source available under the | |||
* following licenses (these are alternatives): | * following licenses (these are alternatives): | |||
* 1. GNU Lesser General Public License (LGPL) | * 1. GNU Lesser General Public License (LGPL) | |||
* 2. GNU General Public License (GPL) | * 2. GNU General Public License (GPL) | |||
* 3. Mozilla Public License (MPL) | * 3. Mozilla Public License (MPL) | |||
skipping to change at line 72 | skipping to change at line 72 | |||
extern const unsigned int raptor_version_decimal; | extern const unsigned int raptor_version_decimal; | |||
/* Public structure */ | /* Public structure */ | |||
typedef struct raptor_parser_s raptor_parser; | typedef struct raptor_parser_s raptor_parser; | |||
typedef struct raptor_www_s raptor_www; | typedef struct raptor_www_s raptor_www; | |||
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_namespace_s raptor_namespace; | ||||
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 { | |||
RAPTOR_IDENTIFIER_TYPE_UNKNOWN, /* Unknown type - illegal */ | RAPTOR_IDENTIFIER_TYPE_UNKNOWN, /* Unknown type - illegal */ | |||
RAPTOR_IDENTIFIER_TYPE_RESOURCE, /* Resource URI (e.g. rdf:abo ut) */ | RAPTOR_IDENTIFIER_TYPE_RESOURCE, /* Resource URI (e.g. rdf:abo ut) */ | |||
RAPTOR_IDENTIFIER_TYPE_ANONYMOUS, /* _:foo N-Triples, or genera ted */ | RAPTOR_IDENTIFIER_TYPE_ANONYMOUS, /* _:foo N-Triples, or genera ted */ | |||
RAPTOR_IDENTIFIER_TYPE_PREDICATE, /* Predicate URI */ | RAPTOR_IDENTIFIER_TYPE_PREDICATE, /* Predicate URI */ | |||
RAPTOR_IDENTIFIER_TYPE_ORDINAL, /* rdf:li, rdf:_<n> etc. */ | RAPTOR_IDENTIFIER_TYPE_ORDINAL, /* rdf:li, rdf:_<n> etc. */ | |||
RAPTOR_IDENTIFIER_TYPE_LITERAL, /* regular literal */ | RAPTOR_IDENTIFIER_TYPE_LITERAL, /* regular literal */ | |||
skipping to change at line 104 | skipping to change at line 108 | |||
int byte; | int byte; | |||
} raptor_locator; | } raptor_locator; | |||
typedef enum { | typedef enum { | |||
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; | } 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; | |||
raptor_uri_source uri_source; | raptor_uri_source uri_source; | |||
const unsigned char *id; | const unsigned char *id; | |||
int ordinal; | int ordinal; | |||
int is_malloced; | int is_malloced; | |||
const unsigned char *literal; | ||||
raptor_uri *literal_datatype; | ||||
const unsigned char *literal_language; | ||||
} raptor_identifier; | } raptor_identifier; | |||
/* Returned by statement_handler */ | /* Returned by statement_handler */ | |||
typedef struct { | typedef struct { | |||
const void *subject; | const void *subject; | |||
raptor_identifier_type subject_type; | raptor_identifier_type subject_type; | |||
const void *predicate; | const void *predicate; | |||
raptor_identifier_type predicate_type; | raptor_identifier_type predicate_type; | |||
const void *object; | const void *object; | |||
raptor_identifier_type object_type; | raptor_identifier_type object_type; | |||
raptor_uri *object_literal_datatype; | raptor_uri *object_literal_datatype; | |||
const unsigned char *object_literal_language; | const unsigned char *object_literal_language; | |||
} raptor_statement; | } raptor_statement; | |||
typedef raptor_uri* (*raptor_new_uri_func) (void *context, const char *uri_ | typedef raptor_uri* (*raptor_new_uri_func) (void *context, const unsigned c | |||
string); | har *uri_string); | |||
typedef raptor_uri* (*raptor_new_uri_from_uri_local_name_func) (void *conte | typedef raptor_uri* (*raptor_new_uri_from_uri_local_name_func) (void *conte | |||
xt, raptor_uri *uri, const char *local_name); | xt, raptor_uri *uri, const unsigned char *local_name); | |||
typedef raptor_uri* (*raptor_new_uri_relative_to_base_func) (void *context, | typedef raptor_uri* (*raptor_new_uri_relative_to_base_func) (void *context, | |||
raptor_uri *base_uri, const char *uri_string); | raptor_uri *base_uri, const unsigned char *uri_string); | |||
typedef raptor_uri* (*raptor_new_uri_for_rdf_concept_func) (void *context, const char *name); | typedef raptor_uri* (*raptor_new_uri_for_rdf_concept_func) (void *context, const char *name); | |||
typedef void (*raptor_free_uri_func) (void *context, raptor_uri *uri); | typedef void (*raptor_free_uri_func) (void *context, raptor_uri *uri); | |||
typedef int (*raptor_uri_equals_func) (void *context, raptor_uri* uri1, rap tor_uri* uri2); | typedef int (*raptor_uri_equals_func) (void *context, raptor_uri* uri1, rap tor_uri* uri2); | |||
typedef raptor_uri* (*raptor_uri_copy_func) (void *context, raptor_uri *uri ); | typedef raptor_uri* (*raptor_uri_copy_func) (void *context, raptor_uri *uri ); | |||
typedef char* (*raptor_uri_as_string_func)(void *context, raptor_uri *uri); | typedef unsigned char* (*raptor_uri_as_string_func)(void *context, raptor_u | |||
typedef char* (*raptor_uri_as_counted_string_func)(void *context, raptor_ur | ri *uri); | |||
i *uri, size_t* len_p); | typedef unsigned char* (*raptor_uri_as_counted_string_func)(void *context, | |||
raptor_uri *uri, size_t* len_p); | ||||
typedef struct { | typedef struct { | |||
/* constructors */ | /* constructors */ | |||
raptor_new_uri_func new_uri; | raptor_new_uri_func new_uri; | |||
raptor_new_uri_from_uri_local_name_func new_uri_from_uri_local_name; | raptor_new_uri_from_uri_local_name_func new_uri_from_uri_local_name; | |||
raptor_new_uri_relative_to_base_func new_uri_relative_to_base; | raptor_new_uri_relative_to_base_func new_uri_relative_to_base; | |||
raptor_new_uri_for_rdf_concept_func new_uri_for_rdf_concept; | raptor_new_uri_for_rdf_concept_func new_uri_for_rdf_concept; | |||
/* destructor */ | /* destructor */ | |||
raptor_free_uri_func free_uri; | raptor_free_uri_func free_uri; | |||
/* methods */ | /* methods */ | |||
raptor_uri_equals_func uri_equals; | raptor_uri_equals_func uri_equals; | |||
raptor_uri_copy_func uri_copy; /* well, copy construct or */ | raptor_uri_copy_func uri_copy; /* well, copy construct or */ | |||
raptor_uri_as_string_func uri_as_string; | raptor_uri_as_string_func uri_as_string; | |||
raptor_uri_as_counted_string_func uri_as_counted_string; | raptor_uri_as_counted_string_func uri_as_counted_string; | |||
int initialised; | int initialised; | |||
} raptor_uri_handler; | } raptor_uri_handler; | |||
typedef void (*raptor_simple_message_handler)(void *user_data, const char * message, ...); | typedef void (*raptor_simple_message_handler)(void *user_data, const char * message, ...); | |||
typedef void (*raptor_message_handler)(void *user_data, raptor_locator* loc ator, const char *message); | typedef void (*raptor_message_handler)(void *user_data, raptor_locator* loc ator, const char *message); | |||
typedef void (*raptor_statement_handler)(void *user_data, const raptor_stat ement *statement); | typedef void (*raptor_statement_handler)(void *user_data, const raptor_stat ement *statement); | |||
typedef const unsigned char* (*raptor_generate_id_handler)(void *user_data, raptor_genid_type type, const unsigned char* user_bnodeid); | typedef unsigned char* (*raptor_generate_id_handler)(void *user_data, rapto r_genid_type type, unsigned char* user_bnodeid); | |||
typedef raptor_uri* (*raptor_container_test_handler)(raptor_uri *element_ur i); | typedef raptor_uri* (*raptor_container_test_handler)(raptor_uri *element_ur i); | |||
typedef void (*raptor_www_write_bytes_handler)(raptor_www* www, void *userd ata, const void *ptr, size_t size, size_t nmemb); | typedef void (*raptor_www_write_bytes_handler)(raptor_www* www, void *userd ata, const void *ptr, size_t size, size_t nmemb); | |||
typedef void (*raptor_www_content_type_handler)(raptor_www* www, void *user data, const char *content_type); | typedef void (*raptor_www_content_type_handler)(raptor_www* www, void *user data, const char *content_type); | |||
/* Public functions */ | /* Public functions */ | |||
RAPTOR_API void raptor_init(void); | RAPTOR_API void raptor_init(void); | |||
RAPTOR_API void raptor_finish(void); | RAPTOR_API void raptor_finish(void); | |||
/* Get parser names */ | ||||
RAPTOR_API int raptor_parsers_enumerate(const unsigned int counter, const c | ||||
har **name, const char **label); | ||||
/* Create */ | /* Create */ | |||
RAPTOR_API raptor_parser* raptor_new_parser(const char *name); | RAPTOR_API raptor_parser* raptor_new_parser(const char *name); | |||
RAPTOR_API int raptor_start_parse(raptor_parser *rdf_parser, raptor_uri *ur i); | RAPTOR_API int raptor_start_parse(raptor_parser *rdf_parser, raptor_uri *ur i); | |||
/* Destroy */ | /* Destroy */ | |||
RAPTOR_API void raptor_free_parser(raptor_parser* parser); | RAPTOR_API void raptor_free_parser(raptor_parser* parser); | |||
/* Handlers */ | /* Handlers */ | |||
RAPTOR_API void raptor_set_fatal_error_handler(raptor_parser* parser, void *user_data, raptor_message_handler handler); | RAPTOR_API void raptor_set_fatal_error_handler(raptor_parser* parser, void *user_data, raptor_message_handler handler); | |||
RAPTOR_API void raptor_set_error_handler(raptor_parser* parser, void *user_ data, raptor_message_handler handler); | RAPTOR_API void raptor_set_error_handler(raptor_parser* parser, void *user_ data, raptor_message_handler handler); | |||
RAPTOR_API void raptor_set_warning_handler(raptor_parser* parser, void *use r_data, raptor_message_handler handler); | RAPTOR_API void raptor_set_warning_handler(raptor_parser* parser, void *use r_data, raptor_message_handler handler); | |||
RAPTOR_API void raptor_set_statement_handler(raptor_parser* parser, void *u ser_data, raptor_statement_handler handler); | RAPTOR_API void raptor_set_statement_handler(raptor_parser* parser, void *u ser_data, raptor_statement_handler handler); | |||
RAPTOR_API void raptor_set_generate_id_handler(raptor_parser* parser, void *user_data, raptor_generate_id_handler handler); | RAPTOR_API void raptor_set_generate_id_handler(raptor_parser* parser, void *user_data, raptor_generate_id_handler handler); | |||
RAPTOR_API void raptor_print_statement(const raptor_statement * const state ment, FILE *stream); | RAPTOR_API void raptor_print_statement(const raptor_statement * const state ment, FILE *stream); | |||
RAPTOR_API void raptor_print_statement_as_ntriples(const raptor_statement * statement, FILE *stream); | RAPTOR_API void raptor_print_statement_as_ntriples(const raptor_statement * statement, FILE *stream); | |||
RAPTOR_API void raptor_print_statement_detailed(const raptor_statement * st atement, int detailed, FILE *stream); | RAPTOR_API void raptor_print_statement_detailed(const raptor_statement * st atement, int detailed, FILE *stream); | |||
RAPTOR_API char* raptor_statement_part_as_counted_string(const void *term, | RAPTOR_API unsigned char* raptor_statement_part_as_counted_string(const voi | |||
raptor_identifier_type type, raptor_uri* literal_datatype, const unsigned c | d *term, raptor_identifier_type type, raptor_uri* literal_datatype, const u | |||
har *literal_language, size_t* len_p); | nsigned char *literal_language, size_t* len_p); | |||
RAPTOR_API char* raptor_statement_part_as_string(const void *term, raptor_i | RAPTOR_API unsigned char* raptor_statement_part_as_string(const void *term, | |||
dentifier_type type, raptor_uri* literal_datatype, const unsigned char *lit | raptor_identifier_type type, raptor_uri* literal_datatype, const unsigned | |||
eral_language); | char *literal_language); | |||
RAPTOR_API raptor_locator* raptor_get_locator(raptor_parser* rdf_parser); | RAPTOR_API raptor_locator* raptor_get_locator(raptor_parser* rdf_parser); | |||
RAPTOR_API void raptor_set_default_generate_id_parameters(raptor_parser* rd f_parser, char *prefix, int base); | RAPTOR_API void raptor_set_default_generate_id_parameters(raptor_parser* rd f_parser, char *prefix, int base); | |||
/* Parsing functions */ | /* Parsing functions */ | |||
RAPTOR_API int raptor_parse_chunk(raptor_parser* rdf_parser, const unsigned char *buffer, size_t len, int is_end); | RAPTOR_API int raptor_parse_chunk(raptor_parser* rdf_parser, const unsigned char *buffer, size_t len, int is_end); | |||
RAPTOR_API int raptor_parse_file_stream(raptor_parser* rdf_parser, FILE *st ream, const char *filename, raptor_uri *base_uri); | RAPTOR_API int raptor_parse_file_stream(raptor_parser* rdf_parser, FILE *st ream, const char *filename, raptor_uri *base_uri); | |||
RAPTOR_API int raptor_parse_file(raptor_parser* rdf_parser, raptor_uri *uri , raptor_uri *base_uri); | RAPTOR_API int raptor_parse_file(raptor_parser* rdf_parser, raptor_uri *uri , raptor_uri *base_uri); | |||
RAPTOR_API int raptor_parse_uri(raptor_parser* rdf_parser, raptor_uri *uri, raptor_uri *base_uri); | RAPTOR_API int raptor_parse_uri(raptor_parser* rdf_parser, raptor_uri *uri, raptor_uri *base_uri); | |||
skipping to change at line 215 | skipping to change at line 226 | |||
/* Utility functions */ | /* Utility functions */ | |||
RAPTOR_API void raptor_print_locator(FILE *stream, raptor_locator* locator) ; | RAPTOR_API void raptor_print_locator(FILE *stream, raptor_locator* locator) ; | |||
RAPTOR_API int raptor_format_locator(char *buffer, size_t length, raptor_lo cator* locator); | RAPTOR_API int raptor_format_locator(char *buffer, size_t length, raptor_lo cator* 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 void raptor_set_feature(raptor_parser *parser, raptor_feature fe ature, int value); | RAPTOR_API void raptor_set_feature(raptor_parser *parser, raptor_feature fe ature, int value); | |||
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); | |||
/* URI functions */ | /* URI functions */ | |||
RAPTOR_API raptor_uri* raptor_new_uri(const 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, | RAPTOR_API raptor_uri* raptor_new_uri_from_uri_local_name(raptor_uri *uri, | |||
const char *local_name); | const unsigned char *local_name); | |||
RAPTOR_API raptor_uri* raptor_new_uri_relative_to_base(raptor_uri *base_uri | RAPTOR_API raptor_uri* raptor_new_uri_relative_to_base(raptor_uri *base_uri | |||
, const char *uri_string); | , 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); | |||
RAPTOR_API raptor_uri* raptor_new_uri_for_rdf_concept(const char *name); | RAPTOR_API raptor_uri* raptor_new_uri_for_rdf_concept(const char *name); | |||
RAPTOR_API void raptor_free_uri(raptor_uri *uri); | RAPTOR_API void raptor_free_uri(raptor_uri *uri); | |||
RAPTOR_API int raptor_uri_equals(raptor_uri* uri1, raptor_uri* uri2); | RAPTOR_API int raptor_uri_equals(raptor_uri* uri1, raptor_uri* uri2); | |||
RAPTOR_API raptor_uri* raptor_uri_copy(raptor_uri *uri); | RAPTOR_API raptor_uri* raptor_uri_copy(raptor_uri *uri); | |||
RAPTOR_API char* raptor_uri_as_string(raptor_uri *uri); | RAPTOR_API unsigned char* raptor_uri_as_string(raptor_uri *uri); | |||
RAPTOR_API char* raptor_uri_as_counted_string(raptor_uri *uri, size_t* len_ | RAPTOR_API unsigned char* raptor_uri_as_counted_string(raptor_uri *uri, siz | |||
p); | e_t* len_p); | |||
/* Make an xml:base-compatible URI from an existing one */ | /* Make an xml:base-compatible URI from an existing one */ | |||
RAPTOR_API raptor_uri* raptor_new_uri_for_xmlbase(raptor_uri* old_uri); | RAPTOR_API raptor_uri* raptor_new_uri_for_xmlbase(raptor_uri* old_uri); | |||
/* Make a URI suitable for retrieval (no fragment, has path) from an existi ng one */ | /* Make a URI suitable for retrieval (no fragment, has path) from an existi ng one */ | |||
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 | RAPTOR_API raptor_identifier* raptor_new_identifier(raptor_identifier_type | |||
type, raptor_uri *uri, raptor_uri_source uri_source, unsigned char *id); | type, raptor_uri *uri, raptor_uri_source uri_source, const unsigned char *i | |||
RAPTOR_API void raptor_init_identifier(raptor_identifier *identifier, rapto | d, const unsigned char *literal, raptor_uri *literal_datatype, const unsign | |||
r_identifier_type type, raptor_uri *uri, raptor_uri_source uri_source, unsi | ed char *literal_language); | |||
gned char *id); | ||||
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 char *strin | RAPTOR_API int raptor_print_ntriples_string(FILE *stream, const unsigned ch | |||
g, const char delim); | 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 const char* raptor_ntriples_term_as_string (raptor_ntriples_term _type term); | RAPTOR_API const char* raptor_ntriples_term_as_string (raptor_ntriples_term _type term); | |||
RAPTOR_API size_t raptor_xml_escape_string(const unsigned char *string, siz e_t len, unsigned char *buffer, size_t length, char quote, raptor_simple_me ssage_handler error_handler, void *error_data); | RAPTOR_API size_t raptor_xml_escape_string(const unsigned char *string, siz e_t len, unsigned char *buffer, size_t length, char quote, raptor_simple_me ssage_handler error_handler, void *error_data); | |||
/* raptor_xml_writer.c */ | /* raptor_xml_writer.c */ | |||
/* NOT PUBLIC YET - SEE raptor_internal.h */ | /* NOT PUBLIC YET - SEE raptor_internal.h */ | |||
/* raptor_uri.c */ | /* raptor_uri.c */ | |||
RAPTOR_API void raptor_uri_resolve_uri_reference (const char *base_uri, con | RAPTOR_API void raptor_uri_resolve_uri_reference (const unsigned char *base | |||
st char *reference_uri, char *buffer, size_t length); | _uri, const unsigned char *reference_uri, char unsigned *buffer, size_t len | |||
RAPTOR_API char *raptor_uri_filename_to_uri_string(const char *filename); | gth); | |||
RAPTOR_API char *raptor_uri_uri_string_to_filename(const char *uri_string); | RAPTOR_API unsigned char *raptor_uri_filename_to_uri_string(const char *fil | |||
RAPTOR_API int raptor_uri_is_file_uri(const char* uri_string); | ename); | |||
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 int raptor_uri_is_file_uri(const unsigned char* uri_string); | ||||
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 "http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |||
#define RAPTOR_RDF_SCHEMA_URI "http://www.w3.org/2000/01/rdf-schema#" | #define RAPTOR_RDF_SCHEMA_URI "http://www.w3.org/2000/01/rdf-schema#" | |||
/* raptor_www */ | /* raptor_www */ | |||
RAPTOR_API void raptor_www_init(void); | RAPTOR_API void raptor_www_init(void); | |||
skipping to change at line 277 | skipping to change at line 289 | |||
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); | |||
void | void | |||
RAPTOR_API raptor_www_set_write_bytes_handler(raptor_www *www, raptor_www_w rite_bytes_handler handler, void *user_data); | RAPTOR_API raptor_www_set_write_bytes_handler(raptor_www *www, raptor_www_w rite_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 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_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 void raptor_free_qname(raptor_qname* name); | ||||
RAPTOR_API int raptor_qname_equal(raptor_qname *name1, raptor_qname *name2) | ||||
; | ||||
/* 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_namespace_stack - stack of XML namespaces */ | ||||
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_clear(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 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 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 int raptor_namespaces_namespace_in_scope(raptor_namespace_stack | ||||
*nstack, const raptor_namespace *nspace); | ||||
/* 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 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 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 unsigned char *raptor_namespaces_format(const raptor_namespace * | ||||
ns, size_t *length_p); | ||||
typedef struct raptor_stringbuffer_s raptor_stringbuffer; | ||||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
#endif | #endif | |||
End of changes. 15 change blocks. | ||||
38 lines changed or deleted | 111 lines changed or added | |||