diff options
author | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-06-10 11:11:14 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-06-10 11:11:14 +0200 |
commit | 941d4f27ef5337c5be5553f93e41aed7745c71e1 (patch) | |
tree | 21ab08f45c8e2bf600b2447aa1b7cc93991765da /libpiano/xml.c | |
parent | c92cbed15b69d823637fb565fefeb6acc3ce178e (diff) | |
download | pianobar-941d4f27ef5337c5be5553f93e41aed7745c71e1.tar.gz pianobar-941d4f27ef5337c5be5553f93e41aed7745c71e1.tar.bz2 pianobar-941d4f27ef5337c5be5553f93e41aed7745c71e1.zip |
Return success/error in PianoRateTrack
Diffstat (limited to 'libpiano/xml.c')
-rw-r--r-- | libpiano/xml.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libpiano/xml.c b/libpiano/xml.c index 370d236..8881ac9 100644 --- a/libpiano/xml.c +++ b/libpiano/xml.c @@ -276,3 +276,32 @@ void PianoXmlParsePlaylist (PianoHandle_t *ph, char *xml) { xmlFreeDoc (doc); xmlCleanupParser(); } + +/* parse addFeedback answer + * @author PromyLOPh + * @added 2008-06-10 + * @param xml string + * @return + */ +PianoReturn_t PianoXmlParseRate (char *xml) { + xmlNode *docRoot = NULL, *curNode = NULL; + xmlDocPtr doc = xmlReadDoc ((xmlChar *) xml, NULL, NULL, 0); + PianoReturn_t ret = PIANO_RET_ERR; + + if (doc == NULL) { + printf ("whoops... xml parser error\n"); + return; + } + + docRoot = xmlDocGetRootElement (doc); + + xmlNode *val = docRoot->children->children->children->children; + if (xmlStrEqual (val->content, (xmlChar *) "1")) { + ret = PIANO_RET_OK; + } + + xmlFreeDoc (doc); + xmlCleanupParser(); + + return ret; +} |