From 4587199a25029eb86f4632af4f4a0c3379e7308d Mon Sep 17 00:00:00 2001 From: crvi Date: Wed, 30 Sep 2020 21:50:45 +0530 Subject: xml: Add xml_parser_get_node_value() helper function --- plparse/totem-pl-parser-podcast.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/plparse/totem-pl-parser-podcast.c b/plparse/totem-pl-parser-podcast.c index 6e69e0e..8f73484 100644 --- a/plparse/totem-pl-parser-podcast.c +++ b/plparse/totem-pl-parser-podcast.c @@ -98,6 +98,21 @@ totem_pl_parser_is_xml_feed (const char *data, gsize len) #ifndef TOTEM_PL_PARSER_MINI +static const char * +xml_parser_get_node_value (xml_node_t *parent, const char *node_name) +{ + xml_node_t *child; + + for (child = parent->child; child != NULL; child = child->next) { + if (child->name == NULL) + continue; + if (g_ascii_strcasecmp (child->name, node_name) == 0) + return child->data; + } + + return NULL; +} + static gboolean is_image (const char *url) { -- cgit v1.2.1