[librsvg] Bump libxml2 dependency to 2.7.0
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] Bump libxml2 dependency to 2.7.0
- Date: Sat, 12 Nov 2011 01:03:09 +0000 (UTC)
commit 9e0d425c8b48bba0109cc36dd462010f8c9ed018
Author: Christian Persch <chpe gnome org>
Date: Sat Nov 12 02:01:57 2011 +0100
Bump libxml2 dependency to 2.7.0
... and drop compat code for older libxml2.
configure.in | 2 +-
rsvg-base.c | 56 +-------------------------------------------------------
rsvg-gobject.c | 19 +------------------
3 files changed, 3 insertions(+), 74 deletions(-)
---
diff --git a/configure.in b/configure.in
index d060f25..eecb01d 100644
--- a/configure.in
+++ b/configure.in
@@ -32,7 +32,7 @@ dnl ===========================================================================
GLIB_REQUIRED=2.12.0
GIO_REQUIRED=2.24.0
-LIBXML_REQUIRED=2.4.7
+LIBXML_REQUIRED=2.7.0
CAIRO_REQUIRED=1.2.0
PANGOCAIRO_REQUIRED=1.10.0
GDK_PIXBUF_REQUIRED=1.3.7
diff --git a/rsvg-base.c b/rsvg-base.c
index 1e827a5..9b2e568 100644
--- a/rsvg-base.c
+++ b/rsvg-base.c
@@ -786,14 +786,6 @@ rsvg_characters (void *data, const xmlChar * ch, int len)
rsvg_characters_impl (ctx, ch, len);
}
-#if LIBXML_VERSION >= 20621
-#define RSVG_ENABLE_ENTITIES
-#elif defined(__GNUC__)
-#warning "libxml version less than 2.6.22. XML entities won't work"
-#endif
-
-#ifdef RSVG_ENABLE_ENTITIES
-
static xmlEntityPtr
rsvg_get_entity (void *data, const xmlChar * name)
{
@@ -812,7 +804,6 @@ rsvg_entity_decl (void *data, const xmlChar * name, int type,
RsvgHandle *ctx = (RsvgHandle *) data;
GHashTable *entities = ctx->priv->entities;
xmlEntityPtr entity;
-#if LIBXML_VERSION >= 20700
xmlChar *resolvedSystemId = NULL, *resolvedPublicId = NULL;
if (systemId)
@@ -841,46 +832,6 @@ rsvg_entity_decl (void *data, const xmlChar * name, int type,
xmlFree(resolvedSystemId);
g_hash_table_insert (entities, g_strdup ((const char*) name), entity);
-#else
- xmlChar *dupname;
-
- entity = xmlMalloc (sizeof (xmlEntity));
- memset (entity, 0, sizeof (xmlEntity));
- entity->type = XML_ENTITY_DECL;
- dupname = (xmlChar *) xmlMemStrdup ((const char *) name);
- entity->name = dupname;
-
- entity->etype = type;
- if (content) {
- entity->content = (xmlChar *) xmlMemStrdup ((const char *) content);
- entity->length = strlen ((const char *) content);
- } else if (systemId || publicId) {
- GByteArray *data = NULL;
-
- if (systemId)
- data =
- _rsvg_acquire_xlink_href_resource ((const char *) systemId,
- rsvg_handle_get_base_uri (ctx), NULL);
- else if (publicId)
- data =
- _rsvg_acquire_xlink_href_resource ((const char *) publicId,
- rsvg_handle_get_base_uri (ctx), NULL);
-
- if (data) {
- entity->SystemID = (xmlChar *) xmlMemStrdup ((const char *) systemId);
- entity->ExternalID = (xmlChar *) xmlMemStrdup ((const char *) publicId);
- entity->content = (xmlChar *) xmlMemStrdup ((const char *) data->data);
- entity->length = data->len;
-
- /* fool libxml2 into supporting SYSTEM and PUBLIC entities */
- entity->etype = XML_INTERNAL_GENERAL_ENTITY;
-
- g_byte_array_free (data, TRUE);
- }
- }
-
- g_hash_table_insert (entities, dupname, entity);
-#endif
}
static void
@@ -903,8 +854,6 @@ rsvg_get_parameter_entity (void *data, const xmlChar * name)
return entity;
}
-#endif
-
static void
rsvg_error_cb (void *data, const char *msg, ...)
{
@@ -1820,15 +1769,12 @@ rsvg_handle_read_stream_sync (RsvgHandle *handle,
buffer = _rsvg_xml_input_buffer_new_from_stream (stream, cancellable, XML_CHAR_ENCODING_NONE, &err);
input = xmlNewIOInputStream (priv->ctxt, buffer, XML_CHAR_ENCODING_NONE);
-#if LIBXML_VERSION >= 20700
+
if (xmlPushInput (priv->ctxt, input) < 0) {
rsvg_set_error (error, priv->ctxt);
xmlFreeInputStream (input);
return FALSE;
}
-#else
- xmlPushInput (priv->ctxt, input);
-#endif
result = xmlParseDocument (priv->ctxt);
if (result != 0) {
diff --git a/rsvg-gobject.c b/rsvg-gobject.c
index ba59d80..613386b 100644
--- a/rsvg-gobject.c
+++ b/rsvg-gobject.c
@@ -63,23 +63,6 @@ extern double rsvg_internal_dpi_y;
static GObjectClass *rsvg_parent_class = NULL;
static void
-rsvg_ctx_free_entity (xmlEntityPtr entval)
-{
-#if LIBXML_VERSION < 20700
- /* key == entval->name, so it's implicitly freed below */
-
- xmlFree ((xmlChar *) entval->name);
- xmlFree ((xmlChar *) entval->ExternalID);
- xmlFree ((xmlChar *) entval->SystemID);
- xmlFree (entval->content);
- xmlFree (entval->orig);
- xmlFree (entval);
-#else
- xmlFreeNode((xmlNode *) entval);
-#endif
-}
-
-static void
instance_init (RsvgHandle * self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, RSVG_TYPE_HANDLE, RsvgHandlePrivate);
@@ -90,7 +73,7 @@ instance_init (RsvgHandle * self)
self->priv->entities = g_hash_table_new_full (g_str_hash,
g_str_equal,
g_free,
- (GDestroyNotify) rsvg_ctx_free_entity);
+ (GDestroyNotify) xmlFreeNode);
self->priv->dpi_x = rsvg_internal_dpi_x;
self->priv->dpi_y = rsvg_internal_dpi_y;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]