From d5a6331ef703d404709c903066d12d5ef39bae7f Mon Sep 17 00:00:00 2001 From: Dave Beckett Date: Sun, 13 Sep 2020 06:14:19 -0700 Subject: Add raptor_rdf_schema_namespace_uri_len to API Update raptor_namespace_test to define strings once to avoid ASAN odr-violation test failure. --- docs/raptor2-sections.txt | 1 + src/raptor2.h.in | 8 ++++++++ src/raptor_namespace.c | 2 ++ 3 files changed, 11 insertions(+) diff --git a/docs/raptor2-sections.txt b/docs/raptor2-sections.txt index 90869b1b..8e09ea8b 100644 --- a/docs/raptor2-sections.txt +++ b/docs/raptor2-sections.txt @@ -129,6 +129,7 @@ raptor_statement_ntriples_write
section-constants raptor_rdf_namespace_uri_len +raptor_rdf_schema_namespace_uri_len raptor_xml_literal_datatype_uri_string_len RAPTOR_RDF_MS_URI RAPTOR_RDF_SCHEMA_URI diff --git a/src/raptor2.h.in b/src/raptor2.h.in index f9b9f94a..1d38a93d 100644 --- a/src/raptor2.h.in +++ b/src/raptor2.h.in @@ -251,6 +251,14 @@ extern const unsigned int raptor_rdf_namespace_uri_len; RAPTOR_API extern const unsigned char * const raptor_rdf_schema_namespace_uri; +/** + * raptor_rdf_schenma_namespace_uri_len: + * + * Length of #raptor_rdf_schenma_namespace_uri string + */ +RAPTOR_API +extern const unsigned int raptor_rdf_schema_namespace_uri_len; + /** * raptor_xmlschema_datatypes_namespace_uri: * diff --git a/src/raptor_namespace.c b/src/raptor_namespace.c index dbd13537..60c98491 100644 --- a/src/raptor_namespace.c +++ b/src/raptor_namespace.c @@ -84,6 +84,7 @@ * */ +#ifndef STANDALONE const unsigned char * const raptor_xml_namespace_uri = (const unsigned char *)"http://www.w3.org/XML/1998/namespace"; const unsigned char * const raptor_rdf_namespace_uri = (const unsigned char *)"http://www.w3.org/1999/02/22-rdf-syntax-ns#"; const unsigned int raptor_rdf_namespace_uri_len = 43; @@ -91,6 +92,7 @@ const unsigned char * const raptor_rdf_schema_namespace_uri = (const unsigned ch const unsigned int raptor_rdf_schema_namespace_uri_len = 37; const unsigned char * const raptor_xmlschema_datatypes_namespace_uri = (const unsigned char *)"http://www.w3.org/2001/XMLSchema#"; const unsigned char * const raptor_owl_namespace_uri = (const unsigned char *)"http://www.w3.org/2002/07/owl#"; +#endif /* hash function to hash namespace prefix strings (usually short strings) -- cgit v1.2.1