diff options
Diffstat (limited to 'libpiano/src/xml.c')
-rw-r--r-- | libpiano/src/xml.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libpiano/src/xml.c b/libpiano/src/xml.c index 1267951..2d9e82d 100644 --- a/libpiano/src/xml.c +++ b/libpiano/src/xml.c @@ -348,6 +348,31 @@ PianoReturn_t PianoXmlParseCreateStation (PianoHandle_t *ph, char *xml) { return PIANO_RET_OK; } +/* parse "add seed" answer, nearly the same as ParseCreateStation + * @param piano handle + * @param xml document + * @param update this station + */ +PianoReturn_t PianoXmlParseAddSeed (PianoHandle_t *ph, char *xml, + PianoStation_t *station) { + xmlNode *docRoot; + xmlDocPtr doc; + PianoReturn_t ret; + + if ((ret = PianoXmlInitDoc (xml, &doc, &docRoot)) != PIANO_RET_OK) { + return ret; + } + + /* get <struct> node */ + xmlNode *dataRoot = docRoot->children->children->children->children; + PianoDestroyStation (station); + PianoXmlStructParser (dataRoot, PianoXmlParseStationsCb, station); + + xmlFreeDoc (doc); + + return PIANO_RET_OK; +} + /* parses playlist; used when searching too * @param piano handle * @param xml document |