[gupnp-av] Rename internal XML utility functions
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gupnp-av] Rename internal XML utility functions
- Date: Wed, 14 Feb 2018 18:30:13 +0000 (UTC)
commit 69117d1507da91a67b8b71f9b2f8242d7bec8e53
Author: Jens Georg <mail jensge org>
Date: Wed Feb 14 19:27:59 2018 +0100
Rename internal XML utility functions
Prevent clashes with GUPnP when linking statically
https://bugzilla.gnome.org/show_bug.cgi?id=784511
libgupnp-av/fragment-util.c | 25 ++-
libgupnp-av/gupnp-cds-last-change-parser.c | 42 ++--
libgupnp-av/gupnp-didl-lite-container.c | 54 +++---
libgupnp-av/gupnp-didl-lite-contributor.c | 8 +-
libgupnp-av/gupnp-didl-lite-createclass.c | 12 +-
libgupnp-av/gupnp-didl-lite-descriptor.c | 16 +-
libgupnp-av/gupnp-didl-lite-item.c | 19 +-
libgupnp-av/gupnp-didl-lite-object.c | 313 ++++++++++++++--------------
libgupnp-av/gupnp-didl-lite-parser.c | 46 +++--
libgupnp-av/gupnp-didl-lite-resource.c | 118 ++++++-----
libgupnp-av/gupnp-didl-lite-writer.c | 12 +-
libgupnp-av/gupnp-feature-list-parser.c | 9 +-
libgupnp-av/gupnp-last-change-parser.c | 11 +-
libgupnp-av/xml-util.c | 154 +++++++-------
libgupnp-av/xml-util.h | 116 +++++-----
15 files changed, 484 insertions(+), 471 deletions(-)
---
diff --git a/libgupnp-av/fragment-util.c b/libgupnp-av/fragment-util.c
index bd8658c..bf5653c 100644
--- a/libgupnp-av/fragment-util.c
+++ b/libgupnp-av/fragment-util.c
@@ -57,7 +57,7 @@ get_toplevel_changes (xmlNodePtr current_node,
xmlNodePtr new_node)
{
xmlAttrPtr attribute;
- GHashTable *current_attributes = xml_util_get_attributes_map
+ GHashTable *current_attributes = av_xml_util_get_attributes_map
(current_node);
GList *changes = NULL;
const xmlChar *name = new_node->name;
@@ -228,9 +228,9 @@ apply_temporary_modification (DocNode *modified,
xmlNodePtr new_node,
XSDData *xsd_data)
{
- xmlNodePtr mod_cur_node = xml_util_find_node (modified->node,
- current_node);
- xmlNodePtr new_node_copy = xml_util_copy_node (new_node);
+ xmlNodePtr mod_cur_node = av_xml_util_find_node (modified->node,
+ current_node);
+ xmlNodePtr new_node_copy = av_xml_util_copy_node (new_node);
if (mod_cur_node == NULL) {
return GUPNP_DIDL_LITE_FRAGMENT_RESULT_UNKNOWN_ERROR;
@@ -254,12 +254,12 @@ apply_temporary_addition (DocNode *modified,
XSDData *xsd_data)
{
xmlNodePtr mod_sibling;
- xmlNodePtr new_node_copy = xml_util_copy_node (new_node);
+ xmlNodePtr new_node_copy = av_xml_util_copy_node (new_node);
if (sibling->doc == modified->doc)
mod_sibling = sibling;
else
- mod_sibling = xml_util_find_node (modified->node, sibling);
+ mod_sibling = av_xml_util_find_node (modified->node, sibling);
if (mod_sibling == NULL)
return GUPNP_DIDL_LITE_FRAGMENT_RESULT_UNKNOWN_ERROR;
@@ -283,8 +283,8 @@ apply_temporary_removal (DocNode *modified,
xmlNodePtr current_node,
XSDData *xsd_data)
{
- xmlNodePtr mod_cur_node = xml_util_find_node (modified->node,
- current_node);
+ xmlNodePtr mod_cur_node = av_xml_util_find_node (modified->node,
+ current_node);
if (mod_cur_node == NULL)
return GUPNP_DIDL_LITE_FRAGMENT_RESULT_UNKNOWN_ERROR;
@@ -561,7 +561,8 @@ new_doc_is_valid_modification (DocNode *modified,
*/
new_node = new_node->next;
current_node = current_node->next;
- if (xml_util_node_deep_equal (temp_current_node, temp_new_node))
+ if (av_xml_util_node_deep_equal (temp_current_node,
+ temp_new_node))
/* This is just a context, skip the checks. */
continue;
if (xmlStrcmp (temp_current_node->name, temp_new_node->name))
@@ -666,7 +667,7 @@ is_current_doc_part_of_original_doc (DocNode *original,
if (current_node == NULL)
return TRUE;
- this_node = xml_util_find_node (original->node, current_node);
+ this_node = av_xml_util_find_node (original->node, current_node);
if (this_node == NULL)
return FALSE;
@@ -674,7 +675,7 @@ is_current_doc_part_of_original_doc (DocNode *original,
for (current_node = current_node->next, this_node = this_node->next;
current_node != NULL && this_node != NULL;
current_node = current_node->next, this_node = this_node->next)
- if (!xml_util_node_deep_equal (current_node, this_node))
+ if (!av_xml_util_node_deep_equal (current_node, this_node))
return FALSE;
return TRUE;
@@ -825,7 +826,7 @@ fragment_util_apply_modification (xmlNodePtr *node_ptr,
if (node_ptr == NULL || *node_ptr == NULL)
return FALSE;
- node_copy = xml_util_copy_node (modified->node);
+ node_copy = av_xml_util_copy_node (modified->node);
if (node_copy == NULL)
return FALSE;
diff --git a/libgupnp-av/gupnp-cds-last-change-parser.c b/libgupnp-av/gupnp-cds-last-change-parser.c
index cff5f0b..53ba4fd 100644
--- a/libgupnp-av/gupnp-cds-last-change-parser.c
+++ b/libgupnp-av/gupnp-cds-last-change-parser.c
@@ -119,9 +119,9 @@ gupnp_cds_last_change_parser_parse (GUPnPCDSLastChangeParser *parser,
goto out;
}
- state_event = xml_util_get_element ((xmlNode *) doc,
- "StateEvent",
- NULL);
+ state_event = av_xml_util_get_element ((xmlNode *) doc,
+ "StateEvent",
+ NULL);
if (state_event == NULL) {
g_set_error (error,
G_MARKUP_ERROR,
@@ -142,22 +142,22 @@ gupnp_cds_last_change_parser_parse (GUPnPCDSLastChangeParser *parser,
entry->ref_count = 1;
entry->event = GUPNP_CDS_LAST_CHANGE_EVENT_OBJECT_ADDED;
- tmp = xml_util_get_attribute_content (it, "objID");
+ tmp = av_xml_util_get_attribute_content (it, "objID");
entry->object_id = g_strdup (tmp);
- tmp = xml_util_get_attribute_content (it,
- "objParentID");
+ tmp = av_xml_util_get_attribute_content (it,
+ "objParentID");
entry->parent_id = g_strdup (tmp);
- tmp = xml_util_get_attribute_content (it, "objClass");
+ tmp = av_xml_util_get_attribute_content (it, "objClass");
entry->class = g_strdup (tmp);
- entry->update_id = (guint32) xml_util_get_uint_attribute
+ entry->update_id = (guint32) av_xml_util_get_uint_attribute
(it,
"updateID",
0);
entry->is_subtree_update =
- xml_util_get_boolean_attribute
+ av_xml_util_get_boolean_attribute
(it,
"stUpdate");
} else if (g_ascii_strcasecmp ((const char *) it->name,
@@ -168,17 +168,17 @@ gupnp_cds_last_change_parser_parse (GUPnPCDSLastChangeParser *parser,
entry->ref_count = 1;
entry->event = GUPNP_CDS_LAST_CHANGE_EVENT_OBJECT_MODIFIED;
- tmp = xml_util_get_attribute_content (it, "objID");
+ tmp = av_xml_util_get_attribute_content (it, "objID");
entry->object_id = g_strdup (tmp);
- entry->update_id = (guint32) xml_util_get_uint_attribute
+ entry->update_id = (guint32) av_xml_util_get_uint_attribute
(it,
"updateID",
0);
entry->is_subtree_update =
- xml_util_get_boolean_attribute
- (it,
- "stUpdate");
+ av_xml_util_get_boolean_attribute
+ (it,
+ "stUpdate");
} else if (g_ascii_strcasecmp ((const char *) it->name,
"objDel") == 0) {
const char *tmp;
@@ -187,17 +187,17 @@ gupnp_cds_last_change_parser_parse (GUPnPCDSLastChangeParser *parser,
entry->ref_count = 1;
entry->event = GUPNP_CDS_LAST_CHANGE_EVENT_OBJECT_REMOVED;
- tmp = xml_util_get_attribute_content (it, "objID");
+ tmp = av_xml_util_get_attribute_content (it, "objID");
entry->object_id = g_strdup (tmp);
- entry->update_id = (guint32) xml_util_get_uint_attribute
+ entry->update_id = (guint32) av_xml_util_get_uint_attribute
(it,
"updateID",
0);
entry->is_subtree_update =
- xml_util_get_boolean_attribute
- (it,
- "stUpdate");
+ av_xml_util_get_boolean_attribute
+ (it,
+ "stUpdate");
} else if (g_ascii_strcasecmp ((const char *) it->name,
"stDone") == 0) {
const char *tmp;
@@ -206,10 +206,10 @@ gupnp_cds_last_change_parser_parse (GUPnPCDSLastChangeParser *parser,
entry->ref_count = 1;
entry->event = GUPNP_CDS_LAST_CHANGE_EVENT_ST_DONE;
- tmp = xml_util_get_attribute_content (it, "objID");
+ tmp = av_xml_util_get_attribute_content (it, "objID");
entry->object_id = g_strdup (tmp);
- entry->update_id = (guint32) xml_util_get_uint_attribute
+ entry->update_id = (guint32) av_xml_util_get_uint_attribute
(it,
"updateID",
0);
diff --git a/libgupnp-av/gupnp-didl-lite-container.c b/libgupnp-av/gupnp-didl-lite-container.c
index 9956b42..cf6164d 100644
--- a/libgupnp-av/gupnp-didl-lite-container.c
+++ b/libgupnp-av/gupnp-didl-lite-container.c
@@ -269,7 +269,7 @@ gupnp_didl_lite_container_get_searchable (GUPnPDIDLLiteContainer *container)
xml_node = gupnp_didl_lite_object_get_xml_node
(GUPNP_DIDL_LITE_OBJECT (container));
- return xml_util_get_boolean_attribute (xml_node, "searchable");
+ return av_xml_util_get_boolean_attribute (xml_node, "searchable");
}
/**
@@ -292,7 +292,7 @@ gupnp_didl_lite_container_get_child_count (GUPnPDIDLLiteContainer *container)
xml_node = gupnp_didl_lite_object_get_xml_node
(GUPNP_DIDL_LITE_OBJECT (container));
- return xml_util_get_int_attribute (xml_node, "childCount", -1);
+ return av_xml_util_get_int_attribute (xml_node, "childCount", -1);
}
/**
@@ -315,9 +315,9 @@ gupnp_didl_lite_container_get_container_update_id
xml_node = gupnp_didl_lite_object_get_xml_node
(GUPNP_DIDL_LITE_OBJECT (container));
- return xml_util_get_uint_child_element (xml_node,
- "containerUpdateID",
- 0);
+ return av_xml_util_get_uint_child_element (xml_node,
+ "containerUpdateID",
+ 0);
}
/**
@@ -340,8 +340,8 @@ gupnp_didl_lite_container_container_update_id_is_set
xml_node = gupnp_didl_lite_object_get_xml_node
(GUPNP_DIDL_LITE_OBJECT (container));
- content = xml_util_get_child_element_content (xml_node,
- "containerUpdateID");
+ content = av_xml_util_get_child_element_content (xml_node,
+ "containerUpdateID");
return content != NULL;
}
@@ -365,9 +365,9 @@ gupnp_didl_lite_container_get_total_deleted_child_count
xml_node = gupnp_didl_lite_object_get_xml_node
(GUPNP_DIDL_LITE_OBJECT (container));
- return xml_util_get_uint_child_element (xml_node,
- "totalDeletedChildCount",
- -1);
+ return av_xml_util_get_uint_child_element (xml_node,
+ "totalDeletedChildCount",
+ -1);
}
/**
@@ -390,8 +390,8 @@ gupnp_didl_lite_container_total_deleted_child_count_is_set
xml_node = gupnp_didl_lite_object_get_xml_node
(GUPNP_DIDL_LITE_OBJECT (container));
- content = xml_util_get_child_element_content (xml_node,
- "totalDeletedChildCount");
+ content = av_xml_util_get_child_element_content (xml_node,
+ "totalDeletedChildCount");
return content != NULL;
}
/**
@@ -545,7 +545,7 @@ gupnp_didl_lite_container_get_storage_used (GUPnPDIDLLiteContainer *container)
xml_node = gupnp_didl_lite_object_get_xml_node
(GUPNP_DIDL_LITE_OBJECT (container));
- str = xml_util_get_child_element_content (xml_node, "storageUsed");
+ str = av_xml_util_get_child_element_content (xml_node, "storageUsed");
if (str == NULL)
return -1;
@@ -638,12 +638,12 @@ gupnp_didl_lite_container_set_container_update_id
upnp_ns = gupnp_didl_lite_object_get_upnp_namespace (self_as_object);
str = g_strdup_printf ("%u", update_id);
- xml_util_set_child (xml_node,
- GUPNP_XML_NAMESPACE_UPNP,
- &upnp_ns,
- xml_doc->doc,
- "containerUpdateID",
- str);
+ av_xml_util_set_child (xml_node,
+ GUPNP_XML_NAMESPACE_UPNP,
+ &upnp_ns,
+ xml_doc->doc,
+ "containerUpdateID",
+ str);
g_free (str);
g_object_notify (G_OBJECT (container), "container-update-id");
@@ -666,7 +666,7 @@ gupnp_didl_lite_container_unset_container_update_id
xml_node = gupnp_didl_lite_object_get_xml_node
(GUPNP_DIDL_LITE_OBJECT (container));
- xml_util_unset_child (xml_node, "containerUpdateID");
+ av_xml_util_unset_child (xml_node, "containerUpdateID");
g_object_notify (G_OBJECT (container), "container-update-id");
}
@@ -698,12 +698,12 @@ gupnp_didl_lite_container_set_total_deleted_child_count
upnp_ns = gupnp_didl_lite_object_get_upnp_namespace (self_as_object);
str = g_strdup_printf ("%u", count);
- xml_util_set_child (xml_node,
- GUPNP_XML_NAMESPACE_UPNP,
- &upnp_ns,
- xml_doc->doc,
- "totalDeletedChildCount",
- str);
+ av_xml_util_set_child (xml_node,
+ GUPNP_XML_NAMESPACE_UPNP,
+ &upnp_ns,
+ xml_doc->doc,
+ "totalDeletedChildCount",
+ str);
g_free (str);
g_object_notify (G_OBJECT (container), "total-deleted-child-count");
@@ -726,7 +726,7 @@ gupnp_didl_lite_container_unset_total_deleted_child_count
xml_node = gupnp_didl_lite_object_get_xml_node
(GUPNP_DIDL_LITE_OBJECT (container));
- xml_util_unset_child (xml_node, "totalDeletedChildCount");
+ av_xml_util_unset_child (xml_node, "totalDeletedChildCount");
g_object_notify (G_OBJECT (container), "total-deleted-child-count");
}
diff --git a/libgupnp-av/gupnp-didl-lite-contributor.c b/libgupnp-av/gupnp-didl-lite-contributor.c
index ad6e234..9f02638 100644
--- a/libgupnp-av/gupnp-didl-lite-contributor.c
+++ b/libgupnp-av/gupnp-didl-lite-contributor.c
@@ -133,7 +133,7 @@ gupnp_didl_lite_contributor_dispose (GObject *object)
priv = GUPNP_DIDL_LITE_CONTRIBUTOR (object)->priv;
- g_clear_pointer (&priv->xml_doc, xml_doc_unref);
+ g_clear_pointer (&priv->xml_doc, av_xml_doc_unref);
object_class = G_OBJECT_CLASS
(gupnp_didl_lite_contributor_parent_class);
@@ -188,7 +188,7 @@ gupnp_didl_lite_contributor_class_init (GUPnPDIDLLiteContributorClass *klass)
"XMLDoc",
"The reference to XML document"
" containing this contributor.",
- xml_doc_get_type (),
+ av_xml_doc_get_type (),
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_NAME |
@@ -245,8 +245,8 @@ gupnp_didl_lite_contributor_get_role (GUPnPDIDLLiteContributor *contributor)
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_CONTRIBUTOR (contributor),
NULL);
- return xml_util_get_attribute_content (contributor->priv->xml_node,
- "role");
+ return av_xml_util_get_attribute_content (contributor->priv->xml_node,
+ "role");
}
/**
diff --git a/libgupnp-av/gupnp-didl-lite-createclass.c b/libgupnp-av/gupnp-didl-lite-createclass.c
index ea42436..c9212f1 100644
--- a/libgupnp-av/gupnp-didl-lite-createclass.c
+++ b/libgupnp-av/gupnp-didl-lite-createclass.c
@@ -149,7 +149,7 @@ gupnp_didl_lite_create_class_dispose (GObject *object)
priv = GUPNP_DIDL_LITE_CREATE_CLASS (object)->priv;
- g_clear_pointer (&priv->xml_doc, xml_doc_unref);
+ g_clear_pointer (&priv->xml_doc, av_xml_doc_unref);
object_class = G_OBJECT_CLASS
(gupnp_didl_lite_create_class_parent_class);
@@ -206,7 +206,7 @@ gupnp_didl_lite_create_class_class_init (GUPnPDIDLLiteCreateClassClass *klass)
"XMLDoc",
"The reference to XML document"
" containing this object.",
- xml_doc_get_type (),
+ av_xml_doc_get_type (),
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_NAME |
@@ -329,8 +329,8 @@ gupnp_didl_lite_create_class_get_include_derived
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_CREATE_CLASS (create_class),
FALSE);
- return xml_util_get_boolean_attribute (create_class->priv->xml_node,
- "includeDerived");
+ return av_xml_util_get_boolean_attribute (create_class->priv->xml_node,
+ "includeDerived");
}
/**
@@ -375,8 +375,8 @@ gupnp_didl_lite_create_class_get_friendly_name
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_CREATE_CLASS (create_class),
NULL);
- return xml_util_get_attribute_content (create_class->priv->xml_node,
- "name");
+ return av_xml_util_get_attribute_content (create_class->priv->xml_node,
+ "name");
}
/**
diff --git a/libgupnp-av/gupnp-didl-lite-descriptor.c b/libgupnp-av/gupnp-didl-lite-descriptor.c
index bccb517..cc9ac06 100644
--- a/libgupnp-av/gupnp-didl-lite-descriptor.c
+++ b/libgupnp-av/gupnp-didl-lite-descriptor.c
@@ -157,7 +157,7 @@ gupnp_didl_lite_descriptor_dispose (GObject *object)
priv = GUPNP_DIDL_LITE_DESCRIPTOR (object)->priv;
- g_clear_pointer (&priv->xml_doc, xml_doc_unref);
+ g_clear_pointer (&priv->xml_doc, av_xml_doc_unref);
object_class = G_OBJECT_CLASS (gupnp_didl_lite_descriptor_parent_class);
object_class->dispose (object);
@@ -211,7 +211,7 @@ gupnp_didl_lite_descriptor_class_init (GUPnPDIDLLiteDescriptorClass *klass)
"XMLDoc",
"The reference to XML document"
" containing this object.",
- xml_doc_get_type (),
+ av_xml_doc_get_type (),
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_NAME |
@@ -364,8 +364,8 @@ gupnp_didl_lite_descriptor_get_id (GUPnPDIDLLiteDescriptor *descriptor)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_DESCRIPTOR (descriptor), NULL);
- return xml_util_get_attribute_content (descriptor->priv->xml_node,
- "id");
+ return av_xml_util_get_attribute_content (descriptor->priv->xml_node,
+ "id");
}
/**
@@ -382,8 +382,8 @@ gupnp_didl_lite_descriptor_get_metadata_type
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_DESCRIPTOR (descriptor), NULL);
- return xml_util_get_attribute_content (descriptor->priv->xml_node,
- "type");
+ return av_xml_util_get_attribute_content (descriptor->priv->xml_node,
+ "type");
}
/**
@@ -399,8 +399,8 @@ gupnp_didl_lite_descriptor_get_name_space (GUPnPDIDLLiteDescriptor *descriptor)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_DESCRIPTOR (descriptor), NULL);
- return xml_util_get_attribute_content (descriptor->priv->xml_node,
- "nameSpace");
+ return av_xml_util_get_attribute_content (descriptor->priv->xml_node,
+ "nameSpace");
}
/**
diff --git a/libgupnp-av/gupnp-didl-lite-item.c b/libgupnp-av/gupnp-didl-lite-item.c
index 3588052..03bbfc1 100644
--- a/libgupnp-av/gupnp-didl-lite-item.c
+++ b/libgupnp-av/gupnp-didl-lite-item.c
@@ -167,7 +167,7 @@ gupnp_didl_lite_item_get_ref_id (GUPnPDIDLLiteItem *item)
xml_node = gupnp_didl_lite_object_get_xml_node
(GUPNP_DIDL_LITE_OBJECT (item));
- return xml_util_get_attribute_content (xml_node, "refID");
+ return av_xml_util_get_attribute_content (xml_node, "refID");
}
/**
@@ -218,17 +218,17 @@ gupnp_didl_lite_item_set_lifetime (GUPnPDIDLLiteItem *item,
g_object_get (G_OBJECT (object), "xml-doc", &doc, NULL);
if (lifetime < 0)
- xml_util_unset_child (node, "lifetime");
+ av_xml_util_unset_child (node, "lifetime");
else {
char *str;
str = seconds_to_time (lifetime);
- xml_util_set_child (node,
- GUPNP_XML_NAMESPACE_DLNA,
- &ns,
- doc->doc,
- "lifetime",
- str);
+ av_xml_util_set_child (node,
+ GUPNP_XML_NAMESPACE_DLNA,
+ &ns,
+ doc->doc,
+ "lifetime",
+ str);
g_free (str);
}
@@ -254,7 +254,8 @@ gupnp_didl_lite_item_get_lifetime (GUPnPDIDLLiteItem *item)
object = GUPNP_DIDL_LITE_OBJECT (item);
node = gupnp_didl_lite_object_get_xml_node (object);
- lifetime_str = xml_util_get_child_element_content (node, "lifetime");
+ lifetime_str = av_xml_util_get_child_element_content (node,
+ "lifetime");
lifetime = seconds_from_time (lifetime_str);
return lifetime;
diff --git a/libgupnp-av/gupnp-didl-lite-object.c b/libgupnp-av/gupnp-didl-lite-object.c
index 68156dc..ac625b9 100644
--- a/libgupnp-av/gupnp-didl-lite-object.c
+++ b/libgupnp-av/gupnp-didl-lite-object.c
@@ -366,7 +366,7 @@ gupnp_didl_lite_object_dispose (GObject *object)
priv = GUPNP_DIDL_LITE_OBJECT (object)->priv;
- g_clear_pointer (&priv->xml_doc, xml_doc_unref);
+ g_clear_pointer (&priv->xml_doc, av_xml_doc_unref);
object_class = G_OBJECT_CLASS (gupnp_didl_lite_object_parent_class);
object_class->dispose (object);
@@ -419,7 +419,7 @@ gupnp_didl_lite_object_class_init (GUPnPDIDLLiteObjectClass *klass)
"XMLDoc",
"The reference to XML document"
" containing this object.",
- xml_doc_get_type (),
+ av_xml_doc_get_type (),
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_NAME |
@@ -1028,9 +1028,9 @@ gupnp_didl_lite_object_get_upnp_namespace (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_ns (object->priv->xml_doc->doc,
- GUPNP_XML_NAMESPACE_UPNP,
- &(object->priv->upnp_ns));
+ return av_xml_util_get_ns (object->priv->xml_doc->doc,
+ GUPNP_XML_NAMESPACE_UPNP,
+ &(object->priv->upnp_ns));
}
/**
@@ -1047,9 +1047,9 @@ gupnp_didl_lite_object_get_dc_namespace (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_ns (object->priv->xml_doc->doc,
- GUPNP_XML_NAMESPACE_DC,
- &(object->priv->dc_ns));
+ return av_xml_util_get_ns (object->priv->xml_doc->doc,
+ GUPNP_XML_NAMESPACE_DC,
+ &(object->priv->dc_ns));
}
/**
@@ -1065,8 +1065,8 @@ gupnp_didl_lite_object_get_upnp_class (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_child_element_content (object->priv->xml_node,
- "class");
+ return av_xml_util_get_child_element_content (object->priv->xml_node,
+ "class");
}
/**
@@ -1083,9 +1083,9 @@ gupnp_didl_lite_object_get_dlna_namespace (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_ns (object->priv->xml_doc->doc,
- GUPNP_XML_NAMESPACE_DLNA,
- &(object->priv->dlna_ns));
+ return av_xml_util_get_ns (object->priv->xml_doc->doc,
+ GUPNP_XML_NAMESPACE_DLNA,
+ &(object->priv->dlna_ns));
}
/**
@@ -1102,9 +1102,9 @@ gupnp_didl_lite_object_get_pv_namespace (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_ns (object->priv->xml_doc->doc,
- GUPNP_XML_NAMESPACE_PV,
- &(object->priv->pv_ns));
+ return av_xml_util_get_ns (object->priv->xml_doc->doc,
+ GUPNP_XML_NAMESPACE_PV,
+ &(object->priv->pv_ns));
}
@@ -1121,7 +1121,8 @@ gupnp_didl_lite_object_get_id (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_attribute_content (object->priv->xml_node, "id");
+ return av_xml_util_get_attribute_content (object->priv->xml_node,
+ "id");
}
/**
@@ -1137,7 +1138,7 @@ gupnp_didl_lite_object_get_parent_id (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_attribute_content (object->priv->xml_node,
+ return av_xml_util_get_attribute_content (object->priv->xml_node,
"parentID");
}
@@ -1159,8 +1160,8 @@ gupnp_didl_lite_object_get_properties (GUPnPDIDLLiteObject *object,
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
g_return_val_if_fail (name != NULL, NULL);
- return xml_util_get_child_elements_by_name (object->priv->xml_node,
- name);
+ return av_xml_util_get_child_elements_by_name (object->priv->xml_node,
+ name);
}
/**
@@ -1177,8 +1178,8 @@ gupnp_didl_lite_object_is_restricted_set (GUPnPDIDLLiteObject *object)
g_return_val_if_fail (object != NULL, FALSE);
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), FALSE);
- return xml_util_get_attribute_content (object->priv->xml_node,
- "restricted") != NULL;
+ return av_xml_util_get_attribute_content (object->priv->xml_node,
+ "restricted") != NULL;
}
/**
@@ -1194,8 +1195,8 @@ gupnp_didl_lite_object_get_restricted (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), FALSE);
- return xml_util_get_boolean_attribute (object->priv->xml_node,
- "restricted");
+ return av_xml_util_get_boolean_attribute (object->priv->xml_node,
+ "restricted");
}
/**
@@ -1211,8 +1212,8 @@ gupnp_didl_lite_object_get_title (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_child_element_content (object->priv->xml_node,
- "title");
+ return av_xml_util_get_child_element_content (object->priv->xml_node,
+ "title");
}
/**
@@ -1228,8 +1229,8 @@ gupnp_didl_lite_object_get_creator (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_child_element_content (object->priv->xml_node,
- "creator");
+ return av_xml_util_get_child_element_content (object->priv->xml_node,
+ "creator");
}
/**
@@ -1266,8 +1267,8 @@ gupnp_didl_lite_object_get_artist (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_child_element_content (object->priv->xml_node,
- "artist");
+ return av_xml_util_get_child_element_content (object->priv->xml_node,
+ "artist");
}
/**
@@ -1303,8 +1304,8 @@ gupnp_didl_lite_object_get_author (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_child_element_content (object->priv->xml_node,
- "author");
+ return av_xml_util_get_child_element_content (object->priv->xml_node,
+ "author");
}
/**
@@ -1377,8 +1378,8 @@ gupnp_didl_lite_object_get_genre (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_child_element_content (object->priv->xml_node,
- "genre");
+ return av_xml_util_get_child_element_content (object->priv->xml_node,
+ "genre");
}
/**
@@ -1394,8 +1395,8 @@ gupnp_didl_lite_object_get_write_status (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_child_element_content (object->priv->xml_node,
- "writeStatus");
+ return av_xml_util_get_child_element_content (object->priv->xml_node,
+ "writeStatus");
}
/**
@@ -1411,8 +1412,8 @@ gupnp_didl_lite_object_get_album (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_child_element_content (object->priv->xml_node,
- "album");
+ return av_xml_util_get_child_element_content (object->priv->xml_node,
+ "album");
}
/**
@@ -1428,8 +1429,8 @@ gupnp_didl_lite_object_get_album_art (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_child_element_content (object->priv->xml_node,
- "albumArtURI");
+ return av_xml_util_get_child_element_content (object->priv->xml_node,
+ "albumArtURI");
}
/**
@@ -1445,8 +1446,8 @@ gupnp_didl_lite_object_get_description (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_child_element_content (object->priv->xml_node,
- "description");
+ return av_xml_util_get_child_element_content (object->priv->xml_node,
+ "description");
}
/**
@@ -1462,8 +1463,8 @@ gupnp_didl_lite_object_get_date (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_child_element_content (object->priv->xml_node,
- "date");
+ return av_xml_util_get_child_element_content (object->priv->xml_node,
+ "date");
}
/**
@@ -1481,8 +1482,8 @@ gupnp_didl_lite_object_get_track_number (GUPnPDIDLLiteObject *object)
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), -1);
- str = xml_util_get_child_element_content (object->priv->xml_node,
- "originalTrackNumber");
+ str = av_xml_util_get_child_element_content (object->priv->xml_node,
+ "originalTrackNumber");
if (str == NULL)
return -1;
@@ -1507,8 +1508,8 @@ gupnp_didl_lite_object_get_dlna_managed (GUPnPDIDLLiteObject *object)
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object),
GUPNP_OCM_FLAGS_NONE);
- str = xml_util_get_attribute_content (object->priv->xml_node,
- "dlnaManaged");
+ str = av_xml_util_get_attribute_content (object->priv->xml_node,
+ "dlnaManaged");
if (str == NULL)
return GUPNP_OCM_FLAGS_NONE;
@@ -1531,9 +1532,9 @@ gupnp_didl_lite_object_get_update_id (GUPnPDIDLLiteObject *object)
g_return_val_if_fail (object != NULL, 0);
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), 0);
- return xml_util_get_uint_child_element (object->priv->xml_node,
- "objectUpdateID",
- 0);
+ return av_xml_util_get_uint_child_element (object->priv->xml_node,
+ "objectUpdateID",
+ 0);
}
/**
@@ -1552,8 +1553,8 @@ gupnp_didl_lite_object_update_id_is_set (GUPnPDIDLLiteObject *object)
g_return_val_if_fail (object != NULL, FALSE);
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), FALSE);
- content = xml_util_get_child_element_content (object->priv->xml_node,
- "objectUpdateID");
+ content = av_xml_util_get_child_element_content (object->priv->xml_node,
+ "objectUpdateID");
return content != NULL;
}
@@ -1694,12 +1695,12 @@ gupnp_didl_lite_object_set_upnp_class (GUPnPDIDLLiteObject *object,
g_return_if_fail (object != NULL);
g_return_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object));
- xml_util_set_child (object->priv->xml_node,
- GUPNP_XML_NAMESPACE_UPNP,
- &(object->priv->upnp_ns),
- object->priv->xml_doc->doc,
- "class",
- upnp_class);
+ av_xml_util_set_child (object->priv->xml_node,
+ GUPNP_XML_NAMESPACE_UPNP,
+ &(object->priv->upnp_ns),
+ object->priv->xml_doc->doc,
+ "class",
+ upnp_class);
g_object_notify (G_OBJECT (object), "upnp-class");
}
@@ -1787,12 +1788,12 @@ gupnp_didl_lite_object_set_title (GUPnPDIDLLiteObject *object,
g_return_if_fail (object != NULL);
g_return_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object));
- xml_util_set_child (object->priv->xml_node,
- GUPNP_XML_NAMESPACE_DC,
- &(object->priv->dc_ns),
- object->priv->xml_doc->doc,
- "title",
- title);
+ av_xml_util_set_child (object->priv->xml_node,
+ GUPNP_XML_NAMESPACE_DC,
+ &(object->priv->dc_ns),
+ object->priv->xml_doc->doc,
+ "title",
+ title);
g_object_notify (G_OBJECT (object), "title");
}
@@ -1811,12 +1812,12 @@ gupnp_didl_lite_object_set_creator (GUPnPDIDLLiteObject *object,
g_return_if_fail (object != NULL);
g_return_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object));
- xml_util_set_child (object->priv->xml_node,
- GUPNP_XML_NAMESPACE_DC,
- &(object->priv->dc_ns),
- object->priv->xml_doc->doc,
- "creator",
- creator);
+ av_xml_util_set_child (object->priv->xml_node,
+ GUPNP_XML_NAMESPACE_DC,
+ &(object->priv->dc_ns),
+ object->priv->xml_doc->doc,
+ "creator",
+ creator);
g_object_notify (G_OBJECT (object), "creator");
}
@@ -1864,12 +1865,12 @@ gupnp_didl_lite_object_set_artist (GUPnPDIDLLiteObject *object,
g_return_if_fail (object != NULL);
g_return_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object));
- xml_util_set_child (object->priv->xml_node,
- GUPNP_XML_NAMESPACE_UPNP,
- &(object->priv->upnp_ns),
- object->priv->xml_doc->doc,
- "artist",
- artist);
+ av_xml_util_set_child (object->priv->xml_node,
+ GUPNP_XML_NAMESPACE_UPNP,
+ &(object->priv->upnp_ns),
+ object->priv->xml_doc->doc,
+ "artist",
+ artist);
g_object_notify (G_OBJECT (object), "artist");
}
@@ -1916,12 +1917,12 @@ gupnp_didl_lite_object_set_author (GUPnPDIDLLiteObject *object,
g_return_if_fail (object != NULL);
g_return_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object));
- xml_util_set_child (object->priv->xml_node,
- GUPNP_XML_NAMESPACE_DC,
- &(object->priv->upnp_ns),
- object->priv->xml_doc->doc,
- "author",
- author);
+ av_xml_util_set_child (object->priv->xml_node,
+ GUPNP_XML_NAMESPACE_DC,
+ &(object->priv->upnp_ns),
+ object->priv->xml_doc->doc,
+ "author",
+ author);
g_object_notify (G_OBJECT (object), "author");
}
@@ -1966,12 +1967,12 @@ gupnp_didl_lite_object_set_genre (GUPnPDIDLLiteObject *object,
g_return_if_fail (object != NULL);
g_return_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object));
- xml_util_set_child (object->priv->xml_node,
- GUPNP_XML_NAMESPACE_UPNP,
- &(object->priv->upnp_ns),
- object->priv->xml_doc->doc,
- "genre",
- genre);
+ av_xml_util_set_child (object->priv->xml_node,
+ GUPNP_XML_NAMESPACE_UPNP,
+ &(object->priv->upnp_ns),
+ object->priv->xml_doc->doc,
+ "genre",
+ genre);
g_object_notify (G_OBJECT (object), "genre");
}
@@ -1990,12 +1991,12 @@ gupnp_didl_lite_object_set_write_status (GUPnPDIDLLiteObject *object,
g_return_if_fail (object != NULL);
g_return_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object));
- xml_util_set_child (object->priv->xml_node,
- GUPNP_XML_NAMESPACE_DC,
- &(object->priv->dc_ns),
- object->priv->xml_doc->doc,
- "writeStatus",
- write_status);
+ av_xml_util_set_child (object->priv->xml_node,
+ GUPNP_XML_NAMESPACE_DC,
+ &(object->priv->dc_ns),
+ object->priv->xml_doc->doc,
+ "writeStatus",
+ write_status);
g_object_notify (G_OBJECT (object), "write-status");
}
@@ -2014,12 +2015,12 @@ gupnp_didl_lite_object_set_album (GUPnPDIDLLiteObject *object,
g_return_if_fail (object != NULL);
g_return_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object));
- xml_util_set_child (object->priv->xml_node,
- GUPNP_XML_NAMESPACE_UPNP,
- &(object->priv->upnp_ns),
- object->priv->xml_doc->doc,
- "album",
- album);
+ av_xml_util_set_child (object->priv->xml_node,
+ GUPNP_XML_NAMESPACE_UPNP,
+ &(object->priv->upnp_ns),
+ object->priv->xml_doc->doc,
+ "album",
+ album);
g_object_notify (G_OBJECT (object), "album");
}
@@ -2040,16 +2041,16 @@ gupnp_didl_lite_object_set_album_art (GUPnPDIDLLiteObject *object,
g_return_if_fail (object != NULL);
g_return_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object));
- node = xml_util_set_child (object->priv->xml_node,
- GUPNP_XML_NAMESPACE_UPNP,
- &(object->priv->upnp_ns),
- object->priv->xml_doc->doc,
- "albumArtURI",
- album_art);
+ node = av_xml_util_set_child (object->priv->xml_node,
+ GUPNP_XML_NAMESPACE_UPNP,
+ &(object->priv->upnp_ns),
+ object->priv->xml_doc->doc,
+ "albumArtURI",
+ album_art);
- xml_util_get_ns (object->priv->xml_doc->doc,
- GUPNP_XML_NAMESPACE_DLNA,
- &(object->priv->dlna_ns));
+ av_xml_util_get_ns (object->priv->xml_doc->doc,
+ GUPNP_XML_NAMESPACE_DLNA,
+ &(object->priv->dlna_ns));
xmlSetNsProp (node,
object->priv->dlna_ns,
@@ -2073,12 +2074,12 @@ gupnp_didl_lite_object_set_description (GUPnPDIDLLiteObject *object,
g_return_if_fail (object != NULL);
g_return_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object));
- xml_util_set_child (object->priv->xml_node,
- GUPNP_XML_NAMESPACE_DC,
- &(object->priv->dc_ns),
- object->priv->xml_doc->doc,
- "description",
- description);
+ av_xml_util_set_child (object->priv->xml_node,
+ GUPNP_XML_NAMESPACE_DC,
+ &(object->priv->dc_ns),
+ object->priv->xml_doc->doc,
+ "description",
+ description);
g_object_notify (G_OBJECT (object), "description");
}
@@ -2097,12 +2098,12 @@ gupnp_didl_lite_object_set_date (GUPnPDIDLLiteObject *object,
g_return_if_fail (object != NULL);
g_return_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object));
- xml_util_set_child (object->priv->xml_node,
- GUPNP_XML_NAMESPACE_DC,
- &(object->priv->dc_ns),
- object->priv->xml_doc->doc,
- "date",
- date);
+ av_xml_util_set_child (object->priv->xml_node,
+ GUPNP_XML_NAMESPACE_DC,
+ &(object->priv->dc_ns),
+ object->priv->xml_doc->doc,
+ "date",
+ date);
g_object_notify (G_OBJECT (object), "date");
}
@@ -2124,12 +2125,12 @@ gupnp_didl_lite_object_set_track_number (GUPnPDIDLLiteObject *object,
g_return_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object));
str = g_strdup_printf ("%d", track_number);
- xml_util_set_child (object->priv->xml_node,
- GUPNP_XML_NAMESPACE_UPNP,
- &(object->priv->upnp_ns),
- object->priv->xml_doc->doc,
- "originalTrackNumber",
- str);
+ av_xml_util_set_child (object->priv->xml_node,
+ GUPNP_XML_NAMESPACE_UPNP,
+ &(object->priv->upnp_ns),
+ object->priv->xml_doc->doc,
+ "originalTrackNumber",
+ str);
g_free (str);
g_object_notify (G_OBJECT (object), "track-number");
@@ -2151,9 +2152,9 @@ gupnp_didl_lite_object_set_dlna_managed (GUPnPDIDLLiteObject *object,
g_return_if_fail (object != NULL);
g_return_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object));
- xml_util_get_ns (object->priv->xml_doc->doc,
- GUPNP_XML_NAMESPACE_DLNA,
- &(object->priv->dlna_ns));
+ av_xml_util_get_ns (object->priv->xml_doc->doc,
+ GUPNP_XML_NAMESPACE_DLNA,
+ &(object->priv->dlna_ns));
str = g_strdup_printf ("%08x", dlna_managed);
xmlSetNsProp (object->priv->xml_node,
@@ -2182,12 +2183,12 @@ gupnp_didl_lite_object_set_update_id (GUPnPDIDLLiteObject *object,
g_return_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object));
str = g_strdup_printf ("%u", update_id);
- xml_util_set_child (object->priv->xml_node,
- GUPNP_XML_NAMESPACE_UPNP,
- &(object->priv->upnp_ns),
- object->priv->xml_doc->doc,
- "objectUpdateID",
- str);
+ av_xml_util_set_child (object->priv->xml_node,
+ GUPNP_XML_NAMESPACE_UPNP,
+ &(object->priv->upnp_ns),
+ object->priv->xml_doc->doc,
+ "objectUpdateID",
+ str);
g_free (str);
g_object_notify (G_OBJECT (object), "update-id");
@@ -2205,8 +2206,8 @@ gupnp_didl_lite_object_unset_update_id (GUPnPDIDLLiteObject *object)
g_return_if_fail (object != NULL);
g_return_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object));
- xml_util_unset_child (object->priv->xml_node,
- "objectUpdateID");
+ av_xml_util_unset_child (object->priv->xml_node,
+ "objectUpdateID");
g_object_notify (G_OBJECT (object), "update-id");
}
@@ -2275,9 +2276,9 @@ gupnp_didl_lite_object_get_title_xml_string (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_child_string (object->priv->xml_node,
- object->priv->xml_doc->doc,
- "title");
+ return av_xml_util_get_child_string (object->priv->xml_node,
+ object->priv->xml_doc->doc,
+ "title");
}
/**
@@ -2294,9 +2295,9 @@ gupnp_didl_lite_object_get_date_xml_string (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_child_string (object->priv->xml_node,
- object->priv->xml_doc->doc,
- "date");
+ return av_xml_util_get_child_string (object->priv->xml_node,
+ object->priv->xml_doc->doc,
+ "date");
}
/**
@@ -2313,9 +2314,9 @@ gupnp_didl_lite_object_get_upnp_class_xml_string (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_child_string (object->priv->xml_node,
- object->priv->xml_doc->doc,
- "class");
+ return av_xml_util_get_child_string (object->priv->xml_node,
+ object->priv->xml_doc->doc,
+ "class");
}
/**
@@ -2332,9 +2333,9 @@ gupnp_didl_lite_object_get_album_xml_string (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_child_string (object->priv->xml_node,
- object->priv->xml_doc->doc,
- "album");
+ return av_xml_util_get_child_string (object->priv->xml_node,
+ object->priv->xml_doc->doc,
+ "album");
}
/**
@@ -2351,9 +2352,9 @@ gupnp_didl_lite_object_get_track_number_xml_string (GUPnPDIDLLiteObject *object)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_OBJECT (object), NULL);
- return xml_util_get_child_string (object->priv->xml_node,
- object->priv->xml_doc->doc,
- "originalTrackNumber");
+ return av_xml_util_get_child_string (object->priv->xml_node,
+ object->priv->xml_doc->doc,
+ "originalTrackNumber");
}
/**
@@ -2496,8 +2497,8 @@ gupnp_didl_lite_object_apply_fragments (GUPnPDIDLLiteObject *object,
goto out;
}
- modified.node = xml_util_find_node (modified.doc->children,
- original.node);
+ modified.node = av_xml_util_find_node (modified.doc->children,
+ original.node);
if (modified.node == NULL) {
result = GUPNP_DIDL_LITE_FRAGMENT_RESULT_UNKNOWN_ERROR;
diff --git a/libgupnp-av/gupnp-didl-lite-parser.c b/libgupnp-av/gupnp-didl-lite-parser.c
index 59255ef..1ea06d2 100644
--- a/libgupnp-av/gupnp-didl-lite-parser.c
+++ b/libgupnp-av/gupnp-didl-lite-parser.c
@@ -52,7 +52,7 @@ verify_didl_attributes (xmlNode *node)
{
const char *content;
- content = xml_util_get_child_element_content (node, "date");
+ content = av_xml_util_get_child_element_content (node, "date");
if (content) {
/* try to roughly verify the passed date with ^\d{4}-\d{2}-\d{2} */
char *ptr = (char *) content;
@@ -73,9 +73,9 @@ verify_didl_attributes (xmlNode *node)
}
}
- if (xml_util_get_attribute_content (node, "restricted") != NULL) {
- return xml_util_verify_attribute_is_boolean (node,
- "restricted");
+ if (av_xml_util_get_attribute_content (node, "restricted") != NULL) {
+ return av_xml_util_verify_attribute_is_boolean (node,
+ "restricted");
}
return TRUE;
@@ -251,9 +251,9 @@ gupnp_didl_lite_parser_parse_didl_recursive (GUPnPDIDLLiteParser *parser,
}
/* Get a pointer to root element */
- element = xml_util_get_element ((xmlNode *) doc,
- "DIDL-Lite",
- NULL);
+ element = av_xml_util_get_element ((xmlNode *) doc,
+ "DIDL-Lite",
+ NULL);
if (element == NULL) {
g_set_error (error,
G_MARKUP_ERROR,
@@ -277,26 +277,30 @@ gupnp_didl_lite_parser_parse_didl_recursive (GUPnPDIDLLiteParser *parser,
}
/* Create namespaces if they don't exist */
- upnp_ns = xml_util_lookup_namespace (doc, GUPNP_XML_NAMESPACE_UPNP);
+ upnp_ns = av_xml_util_lookup_namespace (doc, GUPNP_XML_NAMESPACE_UPNP);
if (! upnp_ns)
- upnp_ns = xml_util_create_namespace (xmlDocGetRootElement (doc),
- GUPNP_XML_NAMESPACE_UPNP);
+ upnp_ns = av_xml_util_create_namespace
+ (xmlDocGetRootElement (doc),
+ GUPNP_XML_NAMESPACE_UPNP);
- dc_ns = xml_util_lookup_namespace (doc, GUPNP_XML_NAMESPACE_DC);
+ dc_ns = av_xml_util_lookup_namespace (doc, GUPNP_XML_NAMESPACE_DC);
if (! dc_ns)
- dc_ns = xml_util_create_namespace (xmlDocGetRootElement (doc),
- GUPNP_XML_NAMESPACE_DC);
- dlna_ns = xml_util_lookup_namespace (doc, GUPNP_XML_NAMESPACE_DLNA);
+ dc_ns = av_xml_util_create_namespace
+ (xmlDocGetRootElement (doc),
+ GUPNP_XML_NAMESPACE_DC);
+ dlna_ns = av_xml_util_lookup_namespace (doc, GUPNP_XML_NAMESPACE_DLNA);
if (! dlna_ns)
- dlna_ns = xml_util_create_namespace (xmlDocGetRootElement (doc),
- GUPNP_XML_NAMESPACE_DLNA);
+ dlna_ns = av_xml_util_create_namespace
+ (xmlDocGetRootElement (doc),
+ GUPNP_XML_NAMESPACE_DLNA);
- pv_ns = xml_util_lookup_namespace (doc, GUPNP_XML_NAMESPACE_PV);
+ pv_ns = av_xml_util_lookup_namespace (doc, GUPNP_XML_NAMESPACE_PV);
if (! pv_ns)
- pv_ns = xml_util_create_namespace (xmlDocGetRootElement (doc),
- GUPNP_XML_NAMESPACE_PV);
+ pv_ns = av_xml_util_create_namespace
+ (xmlDocGetRootElement (doc),
+ GUPNP_XML_NAMESPACE_PV);
- xml_doc = xml_doc_new (doc);
+ xml_doc = av_xml_doc_new (doc);
result = parse_elements (parser,
element,
@@ -307,7 +311,7 @@ gupnp_didl_lite_parser_parse_didl_recursive (GUPnPDIDLLiteParser *parser,
pv_ns,
recursive,
error);
- xml_doc_unref (xml_doc);
+ av_xml_doc_unref (xml_doc);
return result;
}
diff --git a/libgupnp-av/gupnp-didl-lite-resource.c b/libgupnp-av/gupnp-didl-lite-resource.c
index 1516360..2a497a2 100644
--- a/libgupnp-av/gupnp-didl-lite-resource.c
+++ b/libgupnp-av/gupnp-didl-lite-resource.c
@@ -93,8 +93,9 @@ get_resolution_info (GUPnPDIDLLiteResource *resource,
const char *resolution;
char **tokens;
- resolution = xml_util_get_attribute_content (resource->priv->xml_node,
- "resolution");
+ resolution = av_xml_util_get_attribute_content
+ (resource->priv->xml_node,
+ "resolution");
if (resolution == NULL)
return;
@@ -386,7 +387,7 @@ gupnp_didl_lite_resource_dispose (GObject *object)
priv = GUPNP_DIDL_LITE_RESOURCE (object)->priv;
- g_clear_pointer (&priv->xml_doc, xml_doc_unref);
+ g_clear_pointer (&priv->xml_doc, av_xml_doc_unref);
if (priv->protocol_info != NULL) {
g_object_unref (priv->protocol_info);
@@ -444,7 +445,7 @@ gupnp_didl_lite_resource_class_init (GUPnPDIDLLiteResourceClass *klass)
"XMLDoc",
"The reference to XML document"
" containing this object.",
- xml_doc_get_type (),
+ av_xml_doc_get_type (),
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_NAME |
@@ -947,8 +948,8 @@ gupnp_didl_lite_resource_get_import_uri (GUPnPDIDLLiteResource *resource)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource), NULL);
- return xml_util_get_attribute_content (resource->priv->xml_node,
- "importUri");
+ return av_xml_util_get_attribute_content (resource->priv->xml_node,
+ "importUri");
}
/**
@@ -972,7 +973,7 @@ gupnp_didl_lite_resource_get_protocol_info (GUPnPDIDLLiteResource *resource)
if (resource->priv->protocol_info != NULL)
return resource->priv->protocol_info;
- protocol_info = xml_util_get_attribute_content
+ protocol_info = av_xml_util_get_attribute_content
(resource->priv->xml_node,
"protocolInfo");
if (protocol_info == NULL)
@@ -1020,9 +1021,9 @@ gupnp_didl_lite_resource_get_size64 (GUPnPDIDLLiteResource *resource)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource), -1);
- return xml_util_get_int64_attribute (resource->priv->xml_node,
- "size",
- -1);
+ return av_xml_util_get_int64_attribute (resource->priv->xml_node,
+ "size",
+ -1);
}
/**
@@ -1038,9 +1039,9 @@ gupnp_didl_lite_resource_get_cleartext_size (GUPnPDIDLLiteResource *resource)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource), -1);
- return xml_util_get_int64_attribute (resource->priv->xml_node,
- "cleartextSize",
- -1);
+ return av_xml_util_get_int64_attribute (resource->priv->xml_node,
+ "cleartextSize",
+ -1);
}
/**
@@ -1059,8 +1060,9 @@ gupnp_didl_lite_resource_get_duration (GUPnPDIDLLiteResource *resource)
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource), -1);
- duration_str = xml_util_get_attribute_content (resource->priv->xml_node,
- "duration");
+ duration_str = av_xml_util_get_attribute_content
+ (resource->priv->xml_node,
+ "duration");
duration = seconds_from_time (duration_str);
return duration;
@@ -1079,9 +1081,9 @@ gupnp_didl_lite_resource_get_bitrate (GUPnPDIDLLiteResource *resource)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource), -1);
- return xml_util_get_long_attribute (resource->priv->xml_node,
- "bitrate",
- -1);
+ return av_xml_util_get_long_attribute (resource->priv->xml_node,
+ "bitrate",
+ -1);
}
/**
@@ -1097,9 +1099,9 @@ gupnp_didl_lite_resource_get_sample_freq (GUPnPDIDLLiteResource *resource)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource), -1);
- return xml_util_get_long_attribute (resource->priv->xml_node,
- "sampleFrequency",
- -1);
+ return av_xml_util_get_long_attribute (resource->priv->xml_node,
+ "sampleFrequency",
+ -1);
}
/**
@@ -1115,9 +1117,9 @@ gupnp_didl_lite_resource_get_bits_per_sample (GUPnPDIDLLiteResource *resource)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource), -1);
- return xml_util_get_long_attribute (resource->priv->xml_node,
- "bitsPerSample",
- -1);
+ return av_xml_util_get_long_attribute (resource->priv->xml_node,
+ "bitsPerSample",
+ -1);
}
/**
@@ -1133,8 +1135,8 @@ gupnp_didl_lite_resource_get_protection (GUPnPDIDLLiteResource *resource)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource), NULL);
- return xml_util_get_attribute_content (resource->priv->xml_node,
- "protection");
+ return av_xml_util_get_attribute_content (resource->priv->xml_node,
+ "protection");
}
/**
@@ -1150,9 +1152,9 @@ gupnp_didl_lite_resource_get_audio_channels (GUPnPDIDLLiteResource *resource)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource), -1);
- return xml_util_get_long_attribute (resource->priv->xml_node,
- "nrAudioChannels",
- -1);
+ return av_xml_util_get_long_attribute (resource->priv->xml_node,
+ "nrAudioChannels",
+ -1);
}
/**
@@ -1208,9 +1210,9 @@ gupnp_didl_lite_resource_get_color_depth (GUPnPDIDLLiteResource *resource)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource), -1);
- return xml_util_get_long_attribute (resource->priv->xml_node,
- "colorDepth",
- -1);
+ return av_xml_util_get_long_attribute (resource->priv->xml_node,
+ "colorDepth",
+ -1);
}
/**
@@ -1226,9 +1228,9 @@ gupnp_didl_lite_resource_get_update_count (GUPnPDIDLLiteResource *resource)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource), 0);
- return xml_util_get_uint_attribute (resource->priv->xml_node,
- "updateCount",
- -1);
+ return av_xml_util_get_uint_attribute (resource->priv->xml_node,
+ "updateCount",
+ -1);
}
/**
@@ -1244,9 +1246,9 @@ gupnp_didl_lite_resource_get_track_total (GUPnPDIDLLiteResource *resource)
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource), 0);
- return xml_util_get_uint_attribute (resource->priv->xml_node,
- "trackTotal",
- -1);
+ return av_xml_util_get_uint_attribute (resource->priv->xml_node,
+ "trackTotal",
+ -1);
}
/**
@@ -1264,8 +1266,8 @@ gupnp_didl_lite_resource_update_count_is_set (GUPnPDIDLLiteResource *resource)
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource), FALSE);
- content = xml_util_get_attribute_content (resource->priv->xml_node,
- "updateCount");
+ content = av_xml_util_get_attribute_content (resource->priv->xml_node,
+ "updateCount");
return content != NULL;
}
@@ -1284,8 +1286,8 @@ gupnp_didl_lite_resource_track_total_is_set (GUPnPDIDLLiteResource *resource)
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource), FALSE);
- content = xml_util_get_attribute_content (resource->priv->xml_node,
- "trackTotal");
+ content = av_xml_util_get_attribute_content (resource->priv->xml_node,
+ "trackTotal");
return content != NULL;
}
@@ -1444,9 +1446,9 @@ gupnp_didl_lite_resource_set_cleartext_size
else {
char *str;
str = g_strdup_printf ("%" G_GINT64_FORMAT, cleartext_size);
- xml_util_get_ns (resource->priv->xml_doc->doc,
- GUPNP_XML_NAMESPACE_DLNA,
- &(resource->priv->dlna_ns));
+ av_xml_util_get_ns (resource->priv->xml_doc->doc,
+ GUPNP_XML_NAMESPACE_DLNA,
+ &(resource->priv->dlna_ns));
xmlSetNsProp (resource->priv->xml_node,
resource->priv->dlna_ns,
@@ -1767,9 +1769,9 @@ gupnp_didl_lite_resource_set_track_total (GUPnPDIDLLiteResource *resource,
g_return_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource));
- xml_util_get_ns (resource->priv->xml_doc->doc,
- GUPNP_XML_NAMESPACE_DLNA,
- &(resource->priv->dlna_ns));
+ av_xml_util_get_ns (resource->priv->xml_doc->doc,
+ GUPNP_XML_NAMESPACE_DLNA,
+ &(resource->priv->dlna_ns));
str = g_strdup_printf ("%u", track_total);
xmlSetNsProp (resource->priv->xml_node,
@@ -1831,8 +1833,8 @@ gupnp_didl_lite_resource_get_subtitle_file_uri
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource), NULL);
- return xml_util_get_attribute_content (resource->priv->xml_node,
- "subtitleFileUri");
+ return av_xml_util_get_attribute_content (resource->priv->xml_node,
+ "subtitleFileUri");
}
/**
@@ -1849,8 +1851,8 @@ gupnp_didl_lite_resource_get_subtitle_file_type
{
g_return_val_if_fail (GUPNP_IS_DIDL_LITE_RESOURCE (resource), NULL);
- return xml_util_get_attribute_content (resource->priv->xml_node,
- "subtitleFileType");
+ return av_xml_util_get_attribute_content (resource->priv->xml_node,
+ "subtitleFileType");
}
/**
@@ -1875,9 +1877,9 @@ gupnp_didl_lite_resource_set_subtitle_file_uri
resource->priv->pv_ns,
(unsigned char *) "subtitleFileUri");
else {
- xml_util_get_ns (resource->priv->xml_doc->doc,
- GUPNP_XML_NAMESPACE_PV,
- &(resource->priv->pv_ns));
+ av_xml_util_get_ns (resource->priv->xml_doc->doc,
+ GUPNP_XML_NAMESPACE_PV,
+ &(resource->priv->pv_ns));
xmlSetNsProp (resource->priv->xml_node,
resource->priv->pv_ns,
(unsigned char *) "subtitleFileUri",
@@ -1911,9 +1913,9 @@ gupnp_didl_lite_resource_set_subtitle_file_type
resource->priv->pv_ns,
(unsigned char *) "subtitleFileUri");
else {
- xml_util_get_ns (resource->priv->xml_doc->doc,
- GUPNP_XML_NAMESPACE_PV,
- &(resource->priv->pv_ns));
+ av_xml_util_get_ns (resource->priv->xml_doc->doc,
+ GUPNP_XML_NAMESPACE_PV,
+ &(resource->priv->pv_ns));
xmlSetNsProp (resource->priv->xml_node,
resource->priv->pv_ns,
diff --git a/libgupnp-av/gupnp-didl-lite-writer.c b/libgupnp-av/gupnp-didl-lite-writer.c
index fb37c0b..5b99c18 100644
--- a/libgupnp-av/gupnp-didl-lite-writer.c
+++ b/libgupnp-av/gupnp-didl-lite-writer.c
@@ -223,8 +223,8 @@ filter_node (xmlNode *node,
if (strcmp ((const char *) node->name, "container") == 0) {
is_container = TRUE;
- container_class = xml_util_get_child_element_content (node,
- "class");
+ container_class = av_xml_util_get_child_element_content
+ (node, "class");
}
forbidden = NULL;
@@ -362,7 +362,7 @@ gupnp_didl_lite_writer_constructed (GObject *object)
priv = GUPNP_DIDL_LITE_WRITER (object)->priv;
doc = xmlNewDoc ((unsigned char *) "1.0");
- priv->xml_doc = xml_doc_new (doc);
+ priv->xml_doc = av_xml_doc_new (doc);
priv->xml_node = xmlNewDocNode (priv->xml_doc->doc,
NULL,
@@ -370,8 +370,8 @@ gupnp_didl_lite_writer_constructed (GObject *object)
NULL);
xmlDocSetRootElement (priv->xml_doc->doc, priv->xml_node);
- xml_util_create_namespace (priv->xml_node,
- GUPNP_XML_NAMESPACE_DIDL_LITE);
+ av_xml_util_create_namespace (priv->xml_node,
+ GUPNP_XML_NAMESPACE_DIDL_LITE);
if (priv->language)
xmlSetProp (priv->xml_node,
@@ -391,7 +391,7 @@ gupnp_didl_lite_writer_dispose (GObject *object)
priv = GUPNP_DIDL_LITE_WRITER (object)->priv;
- g_clear_pointer (&priv->xml_doc, xml_doc_unref);
+ g_clear_pointer (&priv->xml_doc, av_xml_doc_unref);
object_class = G_OBJECT_CLASS (gupnp_didl_lite_writer_parent_class);
object_class->dispose (object);
diff --git a/libgupnp-av/gupnp-feature-list-parser.c b/libgupnp-av/gupnp-feature-list-parser.c
index 85fb232..2f179b1 100644
--- a/libgupnp-av/gupnp-feature-list-parser.c
+++ b/libgupnp-av/gupnp-feature-list-parser.c
@@ -138,7 +138,7 @@ gupnp_feature_list_parser_parse_text
}
/* Get a pointer to root element */
- element = xml_util_get_element ((xmlNode *) doc, "Features", NULL);
+ element = av_xml_util_get_element ((xmlNode *) doc, "Features", NULL);
if (element == NULL) {
g_set_error (error,
G_MARKUP_ERROR,
@@ -158,9 +158,10 @@ gupnp_feature_list_parser_parse_text
if (g_ascii_strcasecmp ((char *) element->name,
"Feature") == 0) {
- name = xml_util_get_attribute_content (element, "name");
- version = xml_util_get_attribute_content (element,
- "version");
+ name = av_xml_util_get_attribute_content (element,
+ "name");
+ version = av_xml_util_get_attribute_content (element,
+ "version");
if (!name || !version) {
g_set_error (error,
G_MARKUP_ERROR,
diff --git a/libgupnp-av/gupnp-last-change-parser.c b/libgupnp-av/gupnp-last-change-parser.c
index a98aecf..5c969a3 100644
--- a/libgupnp-av/gupnp-last-change-parser.c
+++ b/libgupnp-av/gupnp-last-change-parser.c
@@ -75,13 +75,13 @@ read_state_variable (const char *variable_name,
xmlNode *variable_node;
const char *val_str;
- variable_node = xml_util_get_element (instance_node,
- variable_name,
- NULL);
+ variable_node = av_xml_util_get_element (instance_node,
+ variable_name,
+ NULL);
if (!variable_node)
return FALSE;
- val_str = xml_util_get_attribute_content (variable_node, "val");
+ val_str = av_xml_util_get_attribute_content (variable_node, "val");
if (!val_str) {
g_warning ("No value provided for variable \"%s\" in "
"LastChange event",
@@ -111,7 +111,8 @@ get_instance_node (xmlDoc *doc,
continue;
if (!xmlStrcmp (node->name, BAD_CAST ("InstanceID")) &&
- xml_util_get_uint_attribute (node, "val", 0) == instance_id)
+ av_xml_util_get_uint_attribute (node, "val", 0) ==
+ instance_id)
break;
}
diff --git a/libgupnp-av/xml-util.c b/libgupnp-av/xml-util.c
index ad2ee1f..b2f1a06 100644
--- a/libgupnp-av/xml-util.c
+++ b/libgupnp-av/xml-util.c
@@ -45,7 +45,7 @@ static GUPnPXMLNamespaceDescription gupnp_xml_namespaces[] =
};
GUPnPAVXMLDoc *
-xml_doc_new (xmlDoc *doc)
+av_xml_doc_new (xmlDoc *doc)
{
GUPnPAVXMLDoc *ret = NULL;
@@ -59,7 +59,7 @@ xml_doc_new (xmlDoc *doc)
}
GUPnPAVXMLDoc *
-xml_doc_ref (GUPnPAVXMLDoc *doc)
+av_xml_doc_ref (GUPnPAVXMLDoc *doc)
{
g_return_val_if_fail (doc, NULL);
g_return_val_if_fail (doc->refcount > 0, NULL);
@@ -69,7 +69,7 @@ xml_doc_ref (GUPnPAVXMLDoc *doc)
}
void
-xml_doc_unref (GUPnPAVXMLDoc *doc)
+av_xml_doc_unref (GUPnPAVXMLDoc *doc)
{
g_return_if_fail (doc);
g_return_if_fail (doc->refcount > 0);
@@ -82,8 +82,8 @@ xml_doc_unref (GUPnPAVXMLDoc *doc)
}
xmlNode *
-xml_util_get_element (xmlNode *node,
- ...)
+av_xml_util_get_element (xmlNode *node,
+ ...)
{
va_list var_args;
@@ -114,7 +114,7 @@ xml_util_get_element (xmlNode *node,
}
GList *
-xml_util_get_child_elements_by_name (xmlNode *node, const char *name)
+av_xml_util_get_child_elements_by_name (xmlNode *node, const char *name)
{
GList *children = NULL;
@@ -131,13 +131,13 @@ xml_util_get_child_elements_by_name (xmlNode *node, const char *name)
}
const char *
-xml_util_get_child_element_content (xmlNode *node,
- const char *child_name)
+av_xml_util_get_child_element_content (xmlNode *node,
+ const char *child_name)
{
xmlNode *child_node;
const char *content;
- child_node = xml_util_get_element (node, child_name, NULL);
+ child_node = av_xml_util_get_element (node, child_name, NULL);
if (!child_node || !(child_node->children))
return NULL;
@@ -149,13 +149,13 @@ xml_util_get_child_element_content (xmlNode *node,
}
guint
-xml_util_get_uint_child_element (xmlNode *node,
- const char *child_name,
- guint default_value)
+av_xml_util_get_uint_child_element (xmlNode *node,
+ const char *child_name,
+ guint default_value)
{
const char *content;
- content = xml_util_get_child_element_content (node, child_name);
+ content = av_xml_util_get_child_element_content (node, child_name);
if (!content)
return default_value;
@@ -163,13 +163,13 @@ xml_util_get_uint_child_element (xmlNode *node,
}
guint64
-xml_util_get_uint64_child_element (xmlNode *node,
- const char *child_name,
- guint64 default_value)
+av_xml_util_get_uint64_child_element (xmlNode *node,
+ const char *child_name,
+ guint64 default_value)
{
const char *content;
- content = xml_util_get_child_element_content (node, child_name);
+ content = av_xml_util_get_child_element_content (node, child_name);
if (!content)
return default_value;
@@ -177,8 +177,8 @@ xml_util_get_uint64_child_element (xmlNode *node,
}
const char *
-xml_util_get_attribute_content (xmlNode *node,
- const char *attribute_name)
+av_xml_util_get_attribute_content (xmlNode *node,
+ const char *attribute_name)
{
xmlAttr *attribute;
@@ -199,14 +199,14 @@ xml_util_get_attribute_content (xmlNode *node,
}
gboolean
-xml_util_get_boolean_attribute (xmlNode *node,
- const char *attribute_name)
+av_xml_util_get_boolean_attribute (xmlNode *node,
+ const char *attribute_name)
{
const char *content;
gchar *str;
gboolean ret;
- content = xml_util_get_attribute_content (node, attribute_name);
+ content = av_xml_util_get_attribute_content (node, attribute_name);
if (!content)
return FALSE;
@@ -228,43 +228,43 @@ xml_util_get_boolean_attribute (xmlNode *node,
}
guint
-xml_util_get_uint_attribute (xmlNode *node,
- const char *attribute_name,
- guint default_value)
+av_xml_util_get_uint_attribute (xmlNode *node,
+ const char *attribute_name,
+ guint default_value)
{
- return (guint) xml_util_get_long_attribute (node,
+ return (guint) av_xml_util_get_long_attribute (node,
attribute_name,
(glong) default_value);
}
gint
-xml_util_get_int_attribute (xmlNode *node,
- const char *attribute_name,
- gint default_value)
+av_xml_util_get_int_attribute (xmlNode *node,
+ const char *attribute_name,
+ gint default_value)
{
- return (gint) xml_util_get_long_attribute (node,
+ return (gint) av_xml_util_get_long_attribute (node,
attribute_name,
(glong) default_value);
}
glong
-xml_util_get_long_attribute (xmlNode *node,
- const char *attribute_name,
- glong default_value)
+av_xml_util_get_long_attribute (xmlNode *node,
+ const char *attribute_name,
+ glong default_value)
{
- return (glong) xml_util_get_int64_attribute (node,
+ return (glong) av_xml_util_get_int64_attribute (node,
attribute_name,
(gint64) default_value);
}
gint64
-xml_util_get_int64_attribute (xmlNode *node,
- const char *attribute_name,
- gint64 default_value)
+av_xml_util_get_int64_attribute (xmlNode *node,
+ const char *attribute_name,
+ gint64 default_value)
{
const char *content;
- content = xml_util_get_attribute_content (node, attribute_name);
+ content = av_xml_util_get_attribute_content (node, attribute_name);
if (!content)
return default_value;
@@ -272,21 +272,21 @@ xml_util_get_int64_attribute (xmlNode *node,
}
xmlNode *
-xml_util_set_child (xmlNode *parent_node,
- GUPnPXMLNamespace ns,
- xmlNsPtr *xmlns,
- xmlDoc *doc,
- const char *name,
- const char *value)
+av_xml_util_set_child (xmlNode *parent_node,
+ GUPnPXMLNamespace ns,
+ xmlNsPtr *xmlns,
+ xmlDoc *doc,
+ const char *name,
+ const char *value)
{
xmlNode *node;
xmlChar *escaped;
- node = xml_util_get_element (parent_node, name, NULL);
+ node = av_xml_util_get_element (parent_node, name, NULL);
if (node == NULL) {
xmlNsPtr ns_ptr = NULL;
- ns_ptr = xml_util_get_ns (doc, ns, xmlns);
+ ns_ptr = av_xml_util_get_ns (doc, ns, xmlns);
node = xmlNewChild (parent_node,
ns_ptr,
(unsigned char *) name,
@@ -301,12 +301,12 @@ xml_util_set_child (xmlNode *parent_node,
}
void
-xml_util_unset_child (xmlNode *parent_node,
- const char *name)
+av_xml_util_unset_child (xmlNode *parent_node,
+ const char *name)
{
xmlNode *node;
- node = xml_util_get_element (parent_node, name, NULL);
+ node = av_xml_util_get_element (parent_node, name, NULL);
if (node != NULL) {
xmlUnlinkNode (node);
xmlFreeNode (node);
@@ -314,13 +314,13 @@ xml_util_unset_child (xmlNode *parent_node,
}
gboolean
-xml_util_verify_attribute_is_boolean (xmlNode *node,
- const char *attribute_name)
+av_xml_util_verify_attribute_is_boolean (xmlNode *node,
+ const char *attribute_name)
{
const char *content;
char *str;
- content = xml_util_get_attribute_content (node, attribute_name);
+ content = av_xml_util_get_attribute_content (node, attribute_name);
if (content == NULL)
return FALSE;
@@ -335,15 +335,15 @@ xml_util_verify_attribute_is_boolean (xmlNode *node,
}
char *
-xml_util_get_child_string (xmlNode *parent_node,
- xmlDoc *doc,
- const char *name)
+av_xml_util_get_child_string (xmlNode *parent_node,
+ xmlDoc *doc,
+ const char *name)
{
xmlBuffer *buffer;
char *ret;
xmlNode *node;
- node = xml_util_get_element (parent_node, name, NULL);
+ node = av_xml_util_get_element (parent_node, name, NULL);
if (!node)
return NULL;
@@ -361,8 +361,8 @@ xml_util_get_child_string (xmlNode *parent_node,
}
gboolean
-xml_util_node_deep_equal (xmlNode *first,
- xmlNode *second)
+av_xml_util_node_deep_equal (xmlNode *first,
+ xmlNode *second)
{
GHashTable *first_attributes;
xmlAttr *attribute;
@@ -377,7 +377,7 @@ xml_util_node_deep_equal (xmlNode *first,
return FALSE;
equal = FALSE;
- first_attributes = xml_util_get_attributes_map (first);
+ first_attributes = av_xml_util_get_attributes_map (first);
/* compare attributes */
for (attribute = second->properties;
attribute != NULL;
@@ -416,7 +416,8 @@ xml_util_node_deep_equal (xmlNode *first,
first_child != NULL && second_child != NULL;
first_child = first_child->next,
second_child = second_child->next)
- if (!xml_util_node_deep_equal (first_child, second_child))
+ if (!av_xml_util_node_deep_equal (first_child,
+ second_child))
return FALSE;
if (first_child != NULL || second_child != NULL)
return FALSE;
@@ -426,16 +427,16 @@ xml_util_node_deep_equal (xmlNode *first,
}
xmlNode *
-xml_util_find_node (xmlNode *haystack,
- xmlNode *needle)
+av_xml_util_find_node (xmlNode *haystack,
+ xmlNode *needle)
{
xmlNodePtr iter;
- if (xml_util_node_deep_equal (haystack, needle))
+ if (av_xml_util_node_deep_equal (haystack, needle))
return haystack;
for (iter = haystack->children; iter != NULL; iter = iter->next) {
- xmlNodePtr found_node = xml_util_find_node (iter, needle);
+ xmlNodePtr found_node = av_xml_util_find_node (iter, needle);
if (found_node != NULL)
return found_node;
@@ -445,7 +446,7 @@ xml_util_find_node (xmlNode *haystack,
}
xmlNode *
-xml_util_copy_node (xmlNode *node)
+av_xml_util_copy_node (xmlNode *node)
{
xmlNode *dup = xmlCopyNode (node, 1);
@@ -455,7 +456,7 @@ xml_util_copy_node (xmlNode *node)
}
GHashTable *
-xml_util_get_attributes_map (xmlNode *node)
+av_xml_util_get_attributes_map (xmlNode *node)
{
xmlAttr *attribute;
GHashTable *attributes_map = g_hash_table_new (g_str_hash,
@@ -472,13 +473,13 @@ xml_util_get_attributes_map (xmlNode *node)
}
/**
- * xml_util_create_namespace:
+ * av_xml_util_create_namespace:
* @root: (allow-none): Document root node or %NULL for anonymous ns.
* @ns: Namespace
* @returns: Newly created namespace on root node
*/
xmlNsPtr
-xml_util_create_namespace (xmlNodePtr root, GUPnPXMLNamespace ns)
+av_xml_util_create_namespace (xmlNodePtr root, GUPnPXMLNamespace ns)
{
g_return_val_if_fail (ns < GUPNP_XML_NAMESPACE_COUNT, NULL);
@@ -488,14 +489,14 @@ xml_util_create_namespace (xmlNodePtr root, GUPnPXMLNamespace ns)
}
/**
- * xml_util_lookup_namespace:
+ * av_xml_util_lookup_namespace:
* @doc: #xmlDoc
* @ns: namespace to look up (except DIDL-Lite, which doesn't have a prefix)
* @returns: %NULL if namespace does not exist, a pointer to the namespace
* otherwise.
*/
xmlNsPtr
-xml_util_lookup_namespace (xmlDocPtr doc, GUPnPXMLNamespace ns)
+av_xml_util_lookup_namespace (xmlDocPtr doc, GUPnPXMLNamespace ns)
{
xmlNsPtr *ns_list, *it, retval = NULL;
const char *ns_prefix = NULL;
@@ -538,7 +539,7 @@ xml_util_lookup_namespace (xmlDocPtr doc, GUPnPXMLNamespace ns)
}
/**
- * xml_util_get_ns:
+ * av_xml_util_get_ns:
* @doc: A #xmlDoc.
* @ns: A #GUPnPXMLNamespace.
* @ns_out: (out) (allow-none): return location for the namespace or %NULL.
@@ -549,7 +550,7 @@ xml_util_lookup_namespace (xmlDocPtr doc, GUPnPXMLNamespace ns)
* @returns: either the existing #xmlNsPtr or a newly created one.
*/
xmlNsPtr
-xml_util_get_ns (xmlDocPtr doc, GUPnPXMLNamespace ns, xmlNsPtr *ns_out)
+av_xml_util_get_ns (xmlDocPtr doc, GUPnPXMLNamespace ns, xmlNsPtr *ns_out)
{
xmlNsPtr tmp_ns;
@@ -557,10 +558,11 @@ xml_util_get_ns (xmlDocPtr doc, GUPnPXMLNamespace ns, xmlNsPtr *ns_out)
if (ns_out != NULL && *ns_out != NULL)
return *ns_out;
- tmp_ns = xml_util_lookup_namespace (doc, ns);
+ tmp_ns = av_xml_util_lookup_namespace (doc, ns);
if (!tmp_ns)
- tmp_ns = xml_util_create_namespace (xmlDocGetRootElement (doc),
- ns);
+ tmp_ns = av_xml_util_create_namespace
+ (xmlDocGetRootElement (doc),
+ ns);
if (ns_out != NULL)
*ns_out = tmp_ns;
@@ -568,4 +570,4 @@ xml_util_get_ns (xmlDocPtr doc, GUPnPXMLNamespace ns, xmlNsPtr *ns_out)
return tmp_ns;
}
-G_DEFINE_BOXED_TYPE (GUPnPAVXMLDoc, xml_doc, xml_doc_ref, xml_doc_unref)
+G_DEFINE_BOXED_TYPE (GUPnPAVXMLDoc, av_xml_doc, av_xml_doc_ref, av_xml_doc_unref)
diff --git a/libgupnp-av/xml-util.h b/libgupnp-av/xml-util.h
index 9ae5b19..0010837 100644
--- a/libgupnp-av/xml-util.h
+++ b/libgupnp-av/xml-util.h
@@ -50,115 +50,115 @@ typedef struct _GPnPAVXMLDoc
} GUPnPAVXMLDoc;
G_GNUC_INTERNAL GUPnPAVXMLDoc *
-xml_doc_new (xmlDoc *doc);
+av_xml_doc_new (xmlDoc *doc);
G_GNUC_INTERNAL GUPnPAVXMLDoc *
-xml_doc_ref (GUPnPAVXMLDoc *doc);
+av_xml_doc_ref (GUPnPAVXMLDoc *doc);
G_GNUC_INTERNAL void
-xml_doc_unref (GUPnPAVXMLDoc *doc);
+av_xml_doc_unref (GUPnPAVXMLDoc *doc);
G_GNUC_INTERNAL GType
-xml_doc_get_type (void) G_GNUC_CONST;
+av_xml_doc_get_type (void) G_GNUC_CONST;
/* Misc utilities for inspecting xmlNodes */
G_GNUC_INTERNAL xmlNode *
-xml_util_get_element (xmlNode *node,
- ...) G_GNUC_NULL_TERMINATED;
+av_xml_util_get_element (xmlNode *node,
+ ...) G_GNUC_NULL_TERMINATED;
G_GNUC_INTERNAL GList *
-xml_util_get_child_elements_by_name (xmlNode *node,
- const char *name);
+av_xml_util_get_child_elements_by_name (xmlNode *node,
+ const char *name);
G_GNUC_INTERNAL const char *
-xml_util_get_child_element_content (xmlNode *node,
- const char *child_name);
+av_xml_util_get_child_element_content (xmlNode *node,
+ const char *child_name);
G_GNUC_INTERNAL guint
-xml_util_get_uint_child_element (xmlNode *node,
- const char *child_name,
- guint default_value);
+av_xml_util_get_uint_child_element (xmlNode *node,
+ const char *child_name,
+ guint default_value);
G_GNUC_INTERNAL guint64
-xml_util_get_uint64_child_element (xmlNode *node,
- const char *child_name,
- guint64 default_value);
+av_xml_util_get_uint64_child_element (xmlNode *node,
+ const char *child_name,
+ guint64 default_value);
G_GNUC_INTERNAL const char *
-xml_util_get_attribute_content (xmlNode *node,
- const char *attribute_name);
+av_xml_util_get_attribute_content (xmlNode *node,
+ const char *attribute_name);
G_GNUC_INTERNAL gboolean
-xml_util_get_boolean_attribute (xmlNode *node,
- const char *attribute_name);
+av_xml_util_get_boolean_attribute (xmlNode *node,
+ const char *attribute_name);
G_GNUC_INTERNAL guint
-xml_util_get_uint_attribute (xmlNode *node,
- const char *attribute_name,
- guint default_value);
+av_xml_util_get_uint_attribute (xmlNode *node,
+ const char *attribute_name,
+ guint default_value);
G_GNUC_INTERNAL gint
-xml_util_get_int_attribute (xmlNode *node,
- const char *attribute_name,
- gint default_value);
+av_xml_util_get_int_attribute (xmlNode *node,
+ const char *attribute_name,
+ gint default_value);
G_GNUC_INTERNAL glong
-xml_util_get_long_attribute (xmlNode *node,
- const char *attribute_name,
- glong default_value);
+av_xml_util_get_long_attribute (xmlNode *node,
+ const char *attribute_name,
+ glong default_value);
G_GNUC_INTERNAL gint64
-xml_util_get_int64_attribute (xmlNode *node,
- const char *attribute_name,
- gint64 default_value);
+av_xml_util_get_int64_attribute (xmlNode *node,
+ const char *attribute_name,
+ gint64 default_value);
G_GNUC_INTERNAL xmlNode *
-xml_util_set_child (xmlNode *parent_node,
- GUPnPXMLNamespace ns,
- xmlNsPtr *namespace,
- xmlDoc *doc,
- const char *name,
- const char *value);
+av_xml_util_set_child (xmlNode *parent_node,
+ GUPnPXMLNamespace ns,
+ xmlNsPtr *namespace,
+ xmlDoc *doc,
+ const char *name,
+ const char *value);
G_GNUC_INTERNAL void
-xml_util_unset_child (xmlNode *parent_node,
- const char *name);
+av_xml_util_unset_child (xmlNode *parent_node,
+ const char *name);
G_GNUC_INTERNAL gboolean
-xml_util_verify_attribute_is_boolean (xmlNode *node,
- const char *attribute_name);
+av_xml_util_verify_attribute_is_boolean (xmlNode *node,
+ const char *attribute_name);
G_GNUC_INTERNAL char *
-xml_util_get_child_string (xmlNode *parent_node,
- xmlDoc *doc,
- const char *name);
+av_xml_util_get_child_string (xmlNode *parent_node,
+ xmlDoc *doc,
+ const char *name);
G_GNUC_INTERNAL gboolean
-xml_util_node_deep_equal (xmlNode *first,
- xmlNode *second);
+av_xml_util_node_deep_equal (xmlNode *first,
+ xmlNode *second);
G_GNUC_INTERNAL xmlNode *
-xml_util_find_node (xmlNode *haystack,
- xmlNode *needle);
+av_xml_util_find_node (xmlNode *haystack,
+ xmlNode *needle);
G_GNUC_INTERNAL xmlNode *
-xml_util_copy_node (xmlNode *node);
+av_xml_util_copy_node (xmlNode *node);
G_GNUC_INTERNAL GHashTable *
-xml_util_get_attributes_map (xmlNode *node);
+av_xml_util_get_attributes_map (xmlNode *node);
G_GNUC_INTERNAL xmlNsPtr
-xml_util_create_namespace (xmlNodePtr root,
- GUPnPXMLNamespace ns);
+av_xml_util_create_namespace (xmlNodePtr root,
+ GUPnPXMLNamespace ns);
G_GNUC_INTERNAL xmlNsPtr
-xml_util_lookup_namespace (xmlDocPtr doc,
- GUPnPXMLNamespace ns);
+av_xml_util_lookup_namespace (xmlDocPtr doc,
+ GUPnPXMLNamespace ns);
G_GNUC_INTERNAL xmlNsPtr
-xml_util_get_ns (xmlDocPtr doc,
- GUPnPXMLNamespace ns,
- xmlNsPtr *ns_out);
+av_xml_util_get_ns (xmlDocPtr doc,
+ GUPnPXMLNamespace ns,
+ xmlNsPtr *ns_out);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]