diff options
author | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-08-12 22:36:48 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@gmail.com> | 2008-08-12 22:36:48 +0200 |
commit | bfda4e40cce3aa986e4fe8d3881a689cd6ef411f (patch) | |
tree | 561b24a1e4f3d54f0cc30c4160322e7a9c4bf74d /libpiano/src/xml.c | |
parent | 4878f5911d05af7bfa1917daf984dab0fd07eb42 (diff) | |
download | pianobar-bfda4e40cce3aa986e4fe8d3881a689cd6ef411f.tar.gz pianobar-bfda4e40cce3aa986e4fe8d3881a689cd6ef411f.tar.bz2 pianobar-bfda4e40cce3aa986e4fe8d3881a689cd6ef411f.zip |
Initial "narrative" implementation
"Why did you play this song?"
Diffstat (limited to 'libpiano/src/xml.c')
-rw-r--r-- | libpiano/src/xml.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/libpiano/src/xml.c b/libpiano/src/xml.c index c0d388f..6d4dad8 100644 --- a/libpiano/src/xml.c +++ b/libpiano/src/xml.c @@ -744,3 +744,20 @@ PianoReturn_t PianoXmlParseTranformStation (const char *searchXml) { return PIANO_RET_OK; } + +PianoReturn_t PianoXmlParseNarrative (const char *xml, char **retNarrative) { + xmlNode *docRoot; + xmlDocPtr doc; + PianoReturn_t ret; + + if ((ret = PianoXmlInitDoc (xml, &doc, &docRoot)) != PIANO_RET_OK) { + return ret; + } + + xmlNode *val = docRoot->children->children->children->children; + *retNarrative = strdup ((char *) val->content); + + xmlFreeDoc (doc); + + return ret; +} |