summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2010-05-10 15:44:41 +0200
committerIvo Hinkelmann <ihi@openoffice.org>2010-05-10 15:44:41 +0200
commitd3ab33efd80e5364bcd057da90c664c61524210c (patch)
tree00b2797d44e7a133070113689181ed3ae6d09e59
parent428c42818fdf03e55a47962a1b6874a28d3d97bf (diff)
parent52b6332b4e45f28ab3ce28910daa2b9aae971fa3 (diff)
CWS-TOOLING: integrate CWS odfmetadata4ooo/DEV300_m79ooo/DEV300_m78
-rw-r--r--redland/README6
-rw-r--r--redland/redland/makefile.mk4
-rw-r--r--redland/redland/redland-1.0.8.patch.free_null174
-rw-r--r--redland/redland/redland-1.0.8.patch.storage_hashes_context_serialize_get_statement35
-rw-r--r--redland/redland/redland-1.0.8.patch.storage_hashes_list_duplicates170
5 files changed, 6 insertions, 383 deletions
diff --git a/redland/README b/redland/README
index d01ae08..87299eb 100644
--- a/redland/README
+++ b/redland/README
@@ -22,7 +22,8 @@ Libraries: libraptor, librasqal, librdf
Patches:
There are several patches, most of which contain only hacks to get it to
build with OOo build system.
-There are also 3 patches that fix bugs in redland and are of general interest:
+There used to be also 3 patches here that fix bugs in redland and ought to be
+of general interest:
- redland-1.0.8.patch.free_null:
redland destructor functions don't check if argument is NULL
- redland-1.0.8.patch.storage_hashes_context_serialize_get_statement:
@@ -31,4 +32,7 @@ There are also 3 patches that fix bugs in redland and are of general interest:
- redland-1.0.8.patch.storage_hashes_list_duplicates:
hashes, list storage: if contexts are enabled, then it is possible to add
duplicate statements
+Attempts to upstream these patches failed for reasons upstream kept to
+themselves. Now these patches are replaced with workarounds in unoxml.
+Note to future maintainers: work around redland bugs in client code.
diff --git a/redland/redland/makefile.mk b/redland/redland/makefile.mk
index 9d516aa..d6acd4d 100644
--- a/redland/redland/makefile.mk
+++ b/redland/redland/makefile.mk
@@ -59,9 +59,7 @@ OOO_PATCH_FILES= \
$(TARFILE_NAME).patch.win32
PATCH_FILES=$(OOO_PATCH_FILES) \
- $(TARFILE_NAME).patch.free_null \
- $(TARFILE_NAME).patch.storage_hashes_context_serialize_get_statement \
- $(TARFILE_NAME).patch.storage_hashes_list_duplicates
+
.IF "$(OS)"=="OS2"
BUILD_ACTION=dmake
diff --git a/redland/redland/redland-1.0.8.patch.free_null b/redland/redland/redland-1.0.8.patch.free_null
deleted file mode 100644
index 0524bb6..0000000
--- a/redland/redland/redland-1.0.8.patch.free_null
+++ /dev/null
@@ -1,174 +0,0 @@
---- misc/redland-1.0.8/librdf/rdf_digest.c Tue Jul 1 05:10:26 2008
-+++ misc/build/redland-1.0.8/librdf/rdf_digest.c Thu Nov 6 12:44:39 2008
-@@ -248,6 +248,8 @@
- void
- librdf_free_digest(librdf_digest *digest)
- {
-+ if(!digest)
-+ return;
- if(digest->context)
- LIBRDF_FREE(digest_context, digest->context);
- if(digest->digest)
---- misc/redland-1.0.8/librdf/rdf_hash.c Tue Jul 1 05:10:26 2008
-+++ misc/build/redland-1.0.8/librdf/rdf_hash.c Thu Nov 6 12:44:39 2008
-@@ -488,6 +488,8 @@
- void
- librdf_free_hash(librdf_hash* hash)
- {
-+ if(!hash)
-+ return;
- if(hash->context) {
- if(hash->is_open)
- librdf_hash_close(hash);
---- misc/redland-1.0.8/librdf/rdf_init.c Tue Nov 6 16:26:18 2007
-+++ misc/build/redland-1.0.8/librdf/rdf_init.c Mon Jun 16 15:55:51 2008
-@@ -178,6 +178,9 @@
- void
- librdf_free_world(librdf_world *world)
- {
-+ if(!world)
-+ return;
-+
- /* NOTE: raptor is always initialised as a parser and may
- * be also used as a serializer, but it is NOT finished
- * in the serializer_raptor registration. Therefore, always
---- misc/redland-1.0.8/librdf/rdf_list.c Tue Jul 1 05:10:26 2008
-+++ misc/build/redland-1.0.8/librdf/rdf_list.c Thu Nov 6 12:44:39 2008
-@@ -106,6 +106,8 @@
- void
- librdf_free_list(librdf_list* list)
- {
-+ if(!list)
-+ return;
- LIBRDF_ASSERT_RETURN(list->iterator_count,
- "Iterators were active on freeing list", );
-
---- misc/redland-1.0.8/librdf/rdf_model.c Tue Jul 1 05:10:26 2008
-+++ misc/build/redland-1.0.8/librdf/rdf_model.c Thu Nov 6 12:44:39 2008
-@@ -391,7 +391,8 @@
- librdf_iterator* iterator;
- librdf_model* m;
-
-- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(model, librdf_model);
-+ if(!model)
-+ return;
-
- if(--model->usage)
- return;
---- misc/redland-1.0.8/librdf/rdf_node.c Tue Jul 1 05:10:26 2008
-+++ misc/build/redland-1.0.8/librdf/rdf_node.c Thu Nov 6 12:44:39 2008
-@@ -724,7 +724,8 @@
- librdf_world *world;
- #endif
-
-- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(node, librdf_node);
-+ if(!node)
-+ return;
-
- #ifdef WITH_THREADS
- world = node->world;
---- misc/redland-1.0.8/librdf/rdf_parser.c Tue Jul 1 08:09:58 2008
-+++ misc/build/redland-1.0.8/librdf/rdf_parser.c Thu Nov 6 12:44:39 2008
-@@ -369,7 +369,8 @@
- void
- librdf_free_parser(librdf_parser *parser)
- {
-- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(parser, librdf_parser);
-+ if(!parser)
-+ return;
-
- if(parser->context) {
- if(parser->factory->terminate)
---- misc/redland-1.0.8/librdf/rdf_query.c Tue Jul 1 05:10:26 2008
-+++ misc/build/redland-1.0.8/librdf/rdf_query.c Thu Nov 6 12:44:39 2008
-@@ -386,7 +386,8 @@
- void
- librdf_free_query(librdf_query* query)
- {
-- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(query, librdf_query);
-+ if(!query)
-+ return;
-
- if(--query->usage)
- return;
---- misc/redland-1.0.8/librdf/rdf_query_results.c Tue Jul 1 05:10:26 2008
-+++ misc/build/redland-1.0.8/librdf/rdf_query_results.c Thu Nov 6 12:44:39 2008
-@@ -242,7 +242,8 @@
- void
- librdf_free_query_results(librdf_query_results* query_results)
- {
-- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(query_results, librdf_query_results);
-+ if(!query_results)
-+ return;
-
- if(query_results->query->factory->free_results)
- query_results->query->factory->free_results(query_results);
-@@ -634,6 +635,8 @@
- void
- librdf_free_query_results_formatter(librdf_query_results_formatter* formatter)
- {
-+ if(!formatter)
-+ return;
- if(formatter->query_results->query->factory->free_results_formatter)
- formatter->query_results->query->factory->free_results_formatter(formatter);
- }
---- misc/redland-1.0.8/librdf/rdf_serializer.c Tue Jul 1 05:10:26 2008
-+++ misc/build/redland-1.0.8/librdf/rdf_serializer.c Thu Nov 6 12:44:39 2008
-@@ -371,7 +371,8 @@
- void
- librdf_free_serializer(librdf_serializer *serializer)
- {
-- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(serializer, librdf_serializer);
-+ if(!serializer)
-+ return;
-
- if(serializer->context) {
- if(serializer->factory->terminate)
---- misc/redland-1.0.8/librdf/rdf_statement.c Tue Jul 1 05:10:26 2008
-+++ misc/build/redland-1.0.8/librdf/rdf_statement.c Thu Nov 6 12:44:39 2008
-@@ -253,7 +253,8 @@
- librdf_world *world;
- #endif
-
-- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(statement, librdf_statement);
-+ if(!statement)
-+ return;
-
- #ifdef WITH_THREADS
- world = statement->world;
---- misc/redland-1.0.8/librdf/rdf_storage.c Tue Jul 1 05:10:26 2008
-+++ misc/build/redland-1.0.8/librdf/rdf_storage.c Thu Nov 6 12:44:39 2008
-@@ -610,7 +610,8 @@
- void
- librdf_free_storage(librdf_storage* storage)
- {
-- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(storage, librdf_storage);
-+ if(!storage)
-+ return;
-
- if(--storage->usage)
- return;
---- misc/redland-1.0.8/librdf/rdf_stream.c Tue Jul 1 05:10:26 2008
-+++ misc/build/redland-1.0.8/librdf/rdf_stream.c Thu Nov 6 12:44:39 2008
-@@ -124,6 +124,9 @@
- void
- librdf_free_stream(librdf_stream* stream)
- {
-+ if(!stream)
-+ return;
-+
- if(stream->finished_method)
- stream->finished_method(stream->context);
-
---- misc/redland-1.0.8/librdf/rdf_uri.c Tue Jul 1 05:10:26 2008
-+++ misc/build/redland-1.0.8/librdf/rdf_uri.c Thu Nov 6 12:44:39 2008
-@@ -407,7 +407,8 @@
- librdf_world *world;
- #endif
-
-- LIBRDF_ASSERT_OBJECT_POINTER_RETURN(uri, librdf_uri);
-+ if(!uri)
-+ return;
-
- #ifdef WITH_THREADS
- world = uri->world;
diff --git a/redland/redland/redland-1.0.8.patch.storage_hashes_context_serialize_get_statement b/redland/redland/redland-1.0.8.patch.storage_hashes_context_serialize_get_statement
deleted file mode 100644
index 8c72946..0000000
--- a/redland/redland/redland-1.0.8.patch.storage_hashes_context_serialize_get_statement
+++ /dev/null
@@ -1,35 +0,0 @@
---- misc/redland-1.0.8/librdf/rdf_storage_hashes.c Tue Jul 1 05:10:26 2008
-+++ misc/build/redland-1.0.8/librdf/rdf_storage_hashes.c Thu Nov 6 12:44:39 2008
-@@ -1593,7 +1661,6 @@
- {
- librdf_storage_hashes_context_serialise_stream_context* scontext=(librdf_storage_hashes_context_serialise_stream_context*)context;
- librdf_hash_datum* v;
-- librdf_node** cnp=NULL;
-
- switch(flags) {
- case LIBRDF_ITERATOR_GET_METHOD_GET_OBJECT:
-@@ -1606,20 +1673,14 @@
- return scontext->context_node;
- }
-
-- /* current stuff is out of date - get new cached answers */
-- if(scontext->index_contexts) {
-- if(scontext->context_node)
-- librdf_free_node(scontext->context_node);
-- scontext->context_node=NULL;
-- cnp=&scontext->context_node;
-- }
--
-+ /* note: scontext->context_node is still valid */
-+
- librdf_statement_clear(&scontext->current);
-
- v=(librdf_hash_datum*)librdf_iterator_get_value(scontext->iterator);
--
-+
- /* decode value content and optional context */
-- if(!librdf_statement_decode_parts(&scontext->current, cnp,
-+ if(!librdf_statement_decode_parts(&scontext->current, NULL,
- (unsigned char*)v->data, v->size)) {
- return NULL;
- }
diff --git a/redland/redland/redland-1.0.8.patch.storage_hashes_list_duplicates b/redland/redland/redland-1.0.8.patch.storage_hashes_list_duplicates
deleted file mode 100644
index d2ef7e7..0000000
--- a/redland/redland/redland-1.0.8.patch.storage_hashes_list_duplicates
+++ /dev/null
@@ -1,170 +0,0 @@
---- misc/redland-1.0.8/librdf/rdf_storage_hashes.c Tue Jul 1 05:10:26 2008
-+++ misc/build/redland-1.0.8/librdf/rdf_storage_hashes.c Thu Nov 6 12:44:39 2008
-@@ -1387,6 +1387,66 @@
- LIBRDF_STATEMENT_OBJECT);
- }
-
-+
-+/* return -1 on failure, 1 if context contains stmt, 0 if not */
-+static int
-+librdf_storage_hashes_context_contains_statement(librdf_storage* storage,
-+ librdf_node* context_node,
-+ librdf_statement* statement)
-+{
-+ librdf_storage_hashes_context* context=(librdf_storage_hashes_context*)storage->context;
-+ librdf_hash_datum key, value; /* on stack - not allocated */
-+ size_t size;
-+ int status;
-+
-+ if(context->contexts_index < 0) {
-+ librdf_log(storage->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_STORAGE, NULL,
-+ "Storage was created without context support");
-+ return -1;
-+ }
-+
-+ /* ENCODE KEY */
-+ size=librdf_node_encode(context_node, NULL, 0);
-+ if (!size)
-+ return -1;
-+ key.data=(char*)LIBRDF_MALLOC(cstring, size);
-+ if (!key.data)
-+ return -1;
-+ key.size=librdf_node_encode(context_node,
-+ (unsigned char*)key.data, size);
-+ if (!key.size) {
-+ LIBRDF_FREE(data, key.data);
-+ return -1;
-+ }
-+
-+ /* ENCODE VALUE */
-+ size=librdf_statement_encode(statement, NULL, 0);
-+ if (!size) {
-+ LIBRDF_FREE(data, key.data);
-+ return -1;
-+ }
-+ value.data=(char*)LIBRDF_MALLOC(cstring, size);
-+ if (!value.data) {
-+ LIBRDF_FREE(data, key.data);
-+ return -1;
-+ }
-+ value.size=librdf_statement_encode(statement, (unsigned char*)value.data, size);
-+ if (!value.size) {
-+ LIBRDF_FREE(data, value.data);
-+ LIBRDF_FREE(data, key.data);
-+ return -1;
-+ }
-+
-+ status=librdf_hash_exists(context->hashes[context->contexts_index], &key, &value);
-+ LIBRDF_FREE(data, value.data);
-+ LIBRDF_FREE(data, key.data);
-+
-+ /* DO NOT free statement, ownership was not passed in */
-+ return status;
-+}
-+
-+
-+
- /**
- * librdf_storage_hashes_context_add_statement:
- * @storage: #librdf_storage object
-@@ -1412,7 +1472,15 @@
- "Storage was created without context support");
- return 1;
- }
--
-+
-+ /* Do not add duplicate statements */
-+ status=librdf_storage_hashes_context_contains_statement(storage, context_node, statement);
-+ if(status)
-+ if(status < 0)
-+ return 1;
-+ else
-+ return 0;
-+
- if(librdf_storage_hashes_add_remove_statement(storage,
- statement, context_node, 1))
- return 1;
---- misc/redland-1.0.8/librdf/rdf_storage_list.c Tue Jul 1 05:10:26 2008
-+++ misc/build/redland-1.0.8/librdf/rdf_storage_list.c Thu Nov 6 12:44:39 2008
-@@ -457,6 +457,64 @@
- }
-
-
-+/* return -1 on failure, 1 if context contains stmt, 0 if not */
-+static int
-+librdf_storage_list_context_contains_statement(librdf_storage* storage,
-+ librdf_node* context_node,
-+ librdf_statement* statement)
-+{
-+ librdf_storage_list_context* context=(librdf_storage_list_context*)storage->context;
-+ librdf_hash_datum key, value; /* on stack - not allocated */
-+ size_t size;
-+ int status;
-+
-+ if(!context->index_contexts) {
-+ librdf_log(storage->world, 0, LIBRDF_LOG_WARN, LIBRDF_FROM_STORAGE, NULL,
-+ "Storage was created without context support");
-+ return -1;
-+ }
-+
-+ /* ENCODE KEY */
-+ size=librdf_node_encode(context_node, NULL, 0);
-+ if (!size)
-+ return -1;
-+ key.data=(char*)LIBRDF_MALLOC(cstring, size);
-+ if (!key.data)
-+ return -1;
-+ key.size=librdf_node_encode(context_node,
-+ (unsigned char*)key.data, size);
-+ if (!key.size) {
-+ LIBRDF_FREE(data, key.data);
-+ return -1;
-+ }
-+
-+ /* ENCODE VALUE */
-+ size=librdf_statement_encode(statement, NULL, 0);
-+ if (!size) {
-+ LIBRDF_FREE(data, key.data);
-+ return -1;
-+ }
-+ value.data=(char*)LIBRDF_MALLOC(cstring, size);
-+ if (!value.data) {
-+ LIBRDF_FREE(data, key.data);
-+ return -1;
-+ }
-+ value.size=librdf_statement_encode(statement, (unsigned char*)value.data, size);
-+ if (!value.size) {
-+ LIBRDF_FREE(data, value.data);
-+ LIBRDF_FREE(data, key.data);
-+ return -1;
-+ }
-+
-+ status=librdf_hash_exists(context->contexts, &key, &value);
-+ LIBRDF_FREE(data, value.data);
-+ LIBRDF_FREE(data, key.data);
-+
-+ /* DO NOT free statement, ownership was not passed in */
-+ return status;
-+}
-+
-+
- /**
- * librdf_storage_list_context_add_statement:
- * @storage: #librdf_storage object
-@@ -483,7 +541,15 @@
- "Storage was created without context support");
- return 1;
- }
--
-+
-+ /* Do not add duplicate statements */
-+ status=librdf_storage_list_context_contains_statement(storage, context_node, statement);
-+ if(status)
-+ if(status < 0)
-+ return 1;
-+ else
-+ return 0;
-+
- /* Store statement + node in the storage_list */
- sln=(librdf_storage_list_node*)LIBRDF_MALLOC(librdf_storage_list_node, sizeof(librdf_storage_list_node));
- if(!sln)