diff options
author | crvi <crvisqr@gmail.com> | 2020-09-30 21:50:45 +0530 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2021-02-23 17:52:33 +0100 |
commit | 4587199a25029eb86f4632af4f4a0c3379e7308d (patch) | |
tree | bbad477039c6627c6f76854223af0fa8b7f597e4 | |
parent | 973bd03a8cc3fccf90a399236366a01feadfd80a (diff) | |
download | totem-pl-parser-4587199a25029eb86f4632af4f4a0c3379e7308d.tar.gz |
xml: Add xml_parser_get_node_value() helper function
-rw-r--r-- | plparse/totem-pl-parser-podcast.c | 15 |
1 files changed, 15 insertions, 0 deletions
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) { |